From 510cf06610b7dc74e7130219ccdd50ef262eb67c Mon Sep 17 00:00:00 2001 From: Vinicius Nogueira Date: Fri, 6 Apr 2012 19:34:30 -0300 Subject: [PATCH 1/2] Add: Added link to filter only those bills late. Added link to filter only Those bills late or show all invoices from suppliers, so there was this link for customer invoices, this link is extremely important for the operator. --- htdocs/fourn/facture/impayees.php | 21 ++++++++++++++++++++- htdocs/langs/pt_BR/bills.lang | 4 ++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/facture/impayees.php b/htdocs/fourn/facture/impayees.php index 01b8f7453cb..ebb682a3adc 100644 --- a/htdocs/fourn/facture/impayees.php +++ b/htdocs/fourn/facture/impayees.php @@ -3,6 +3,7 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2012-2012 Vinicius Nogueira * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,6 +37,7 @@ $langs->load("bills"); $socid=GETPOST('socid','int'); +$option = GETPOST('option'); // Security check if ($user->societe_id > 0) @@ -53,6 +55,8 @@ $now=dol_now(); llxHeader('',$langs->trans("BillsSuppliersUnpaid")); +$title=$langs->trans("BillsSuppliersUnpaid"); + $facturestatic=new FactureFournisseur($db); $companystatic=new Societe($db); @@ -87,6 +91,7 @@ if ($user->rights->fournisseur->facture->lire) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf ON f.rowid=pf.fk_facturefourn "; $sql.= " WHERE f.fk_soc = s.rowid"; $sql.= " AND f.paye = 0 AND f.fk_statut = 1"; + if ($option == 'late') $sql.=" AND f.date_lim_reglement < '".$db->idate(dol_now() - $conf->facture->fournisseur->warning_delay)."'"; if (! $user->rights->societe->client->voir && ! $socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql .= " AND s.rowid = ".$socid; @@ -145,9 +150,23 @@ if ($user->rights->fournisseur->facture->lire) $soc = new Societe($db); $soc->fetch($socid); } + + $param=""; + $param.=($option?"&option=".$option:""); + if ($late) $param.='&late='.urlencode($late); + $urlsource.=str_replace('&','&',$param); $titre=($socid?$langs->trans("BillsSuppliersUnpaidForCompany",$soc->nom):$langs->trans("BillsSuppliersUnpaid")); - print_barre_liste($titre,$page,"impayees.php","&socid=$socid",$sortfield,$sortorder,'',0); // We don't want pagination on this page + + if ($option == 'late') $titre.=' ('.$langs->trans("Late").')'; + else $titre.=' ('.$langs->trans("All").')'; + + $link=''; + if (empty($option)) $link=''.$langs->trans("ShowUnpaidLateOnly").''; + elseif ($option == 'late') $link=''.$langs->trans("ShowUnpaidAll").''; + print_fiche_titre($titre,$link); + + print_barre_liste('','',"impayees.php","&socid=$socid",$sortfield,$sortorder,'',0); // We don't want pagination on this page $i = 0; print ''; print ''; diff --git a/htdocs/langs/pt_BR/bills.lang b/htdocs/langs/pt_BR/bills.lang index 92ee568d59c..4b4f08b5f62 100755 --- a/htdocs/langs/pt_BR/bills.lang +++ b/htdocs/langs/pt_BR/bills.lang @@ -353,8 +353,8 @@ ChequeDeposits=Depósito de Cheques Cheques=Cheques CreditNoteConvertedIntoDiscount=Este depósito converteu-se em %s UsBillingContactAsIncoiveRecipientIfExist=Utilizar o endereço do contato de cliente de faturação da fatura em vez do endereço do Fornecedor como destinatário das faturas -ShowUnpayedAll=Ver todos os não remunerados -ShowUnpayedLateOnly=Mostrar apenas os não remunerados +ShowUnpaidAll=Mostrar todas as faturas +ShowUnpaidLateOnly=Mostrar apenas faturas em Atraso PaymentInvoiceRef=Pagamento Fatura %s ErrorDeletePaymentLinkedToAClosedInvoiceNotPossible=Não é possível excluir pagamento de uma Fatura fechada. CustomerBillsUnpaid=Faturas de Clientes Pendentes de Cobrança From 78c5fc8cff867c3ffb96fb597f1c29254b4c7b54 Mon Sep 17 00:00:00 2001 From: Vinicius Nogueira Date: Sat, 7 Apr 2012 01:45:48 -0300 Subject: [PATCH 2/2] Add Tax: Brasil Zero rate for the invoices to suppliers can be fulfilled. --- htdocs/install/mysql/data/llx_c_tva.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/install/mysql/data/llx_c_tva.sql b/htdocs/install/mysql/data/llx_c_tva.sql index aa907c95cc8..7d4ca09019e 100644 --- a/htdocs/install/mysql/data/llx_c_tva.sql +++ b/htdocs/install/mysql/data/llx_c_tva.sql @@ -48,6 +48,9 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (41 insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (412, 41, '10','0','VAT reduced rate', 1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (413, 41, '0','0','VAT Rate 0',1); +-- BRASIL (id country=59) +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (561, 56, '0','0','VAT reduced rate',1); + -- BULGARIA (id country=59) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (591, 59, '20','0','VAT standard rate',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (592, 59, '7','0','VAT reduced rate', 1);