diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index eedad88ea8b..25451c26b36 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -359,7 +359,7 @@ if ($result) if (! $objp->rappro) { print ''; - print ' '.$conf->monnaie; + print ' '.$langs->trans("Currency".$conf->monnaie); print ''; } else @@ -372,7 +372,7 @@ if ($result) print ""; // Type paiement - print "".$langs->trans("Type").""; + print "".$langs->trans("Type")." / ".$langs->trans("Numero").""; print "
rowid\">"; print ''; print ""; diff --git a/htdocs/compta/bank/rappro.php b/htdocs/compta/bank/rappro.php index 2ffc21ea93b..4a1911be68d 100644 --- a/htdocs/compta/bank/rappro.php +++ b/htdocs/compta/bank/rappro.php @@ -171,16 +171,16 @@ if ($resql) dolibarr_print_error($db); } - print ''; + print '
'; print "\n"; - print ''; - print ''; + print ''; + print ''; print ''; print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; print "\n"; @@ -196,21 +196,40 @@ if ($resql) print ""; print "rowid."\">"; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; @@ -226,18 +245,18 @@ if ($resql) if ($objp->rappro) { // Si ligne déjà rapprochée, on affiche relevé. - print ""; + print ""; } else { // Si pas encore rapprochée if ($user->rights->banque->modifier) { - print '"; } @@ -256,24 +275,25 @@ if ($resql) } - // Affiche bouton "Rapprocher" - if ($objp->do <= mktime() ) { - print ""; - print ""; } else { - print ""; + print ''; } print "\n"; diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 91b4b33ca98..c6c822633f7 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -111,180 +111,223 @@ if (! isset($_GET["num"])) } else { - /** - * Vue d'un releve - * - */ - if ($_GET["rel"] == 'prev') + /** + * Affiche liste ecritures d'un releve + */ + if ($_GET["rel"] == 'prev') { - // Recherche valeur pour num = numéro relevé précédent - $sql = "SELECT distinct(num_releve) as num"; - $sql.= " FROM ".MAIN_DB_PREFIX."bank"; - $sql.= " WHERE num_releve < ".$_GET["num"]." AND fk_account = ".$_GET["account"]; - $sql.= " ORDER BY num_releve DESC"; - $result = $db->query($sql); - if ($result) - { - $var=True; - $numrows = $db->num_rows($result); - $i = 0; - if ($numrows > 0) - { - $obj = $db->fetch_object($result); - $num = $obj->num; - } - } + // Recherche valeur pour num = numéro relevé précédent + $sql = "SELECT distinct(num_releve) as num"; + $sql.= " FROM ".MAIN_DB_PREFIX."bank"; + $sql.= " WHERE num_releve < ".$_GET["num"]." AND fk_account = ".$_GET["account"]; + $sql.= " ORDER BY num_releve DESC"; + $result = $db->query($sql); + if ($result) + { + $var=True; + $numrows = $db->num_rows($result); + $i = 0; + if ($numrows > 0) + { + $obj = $db->fetch_object($result); + $num = $obj->num; + } + } } - elseif ($_GET["rel"] == 'next') + elseif ($_GET["rel"] == 'next') { - // Recherche valeur pour num = numéro relevé précédent - $sql = "SELECT distinct(num_releve) as num"; - $sql.= " FROM ".MAIN_DB_PREFIX."bank"; - $sql.= " WHERE num_releve > ".$_GET["num"]." AND fk_account = ".$_GET["account"]; - $sql.= " ORDER BY num_releve ASC"; - $result = $db->query($sql); - if ($result) - { - $var=True; - $numrows = $db->num_rows($result); - $i = 0; - if ($numrows > 0) - { - $obj = $db->fetch_object($result); - $num = $obj->num; - } - } + // Recherche valeur pour num = numéro relevé précédent + $sql = "SELECT distinct(num_releve) as num"; + $sql.= " FROM ".MAIN_DB_PREFIX."bank"; + $sql.= " WHERE num_releve > ".$_GET["num"]." AND fk_account = ".$_GET["account"]; + $sql.= " ORDER BY num_releve ASC"; + $result = $db->query($sql); + if ($result) + { + $var=True; + $numrows = $db->num_rows($result); + $i = 0; + if ($numrows > 0) + { + $obj = $db->fetch_object($result); + $num = $obj->num; + } + } } - else { - // On veut le relevé num - $num=$_GET["num"]; - } - $ve=$_GET["ve"]; - - $mesprevnext ="id\">".img_previous()."  "; - $mesprevnext.= $langs->trans("AccountStatement")." $num"; - $mesprevnext.="   id\">".img_next().""; - print_fiche_titre($langs->trans("AccountStatement").' '.$num.', '.$langs->trans("BankAccount").' : '.$acct->label.'',$mesprevnext); - print '
'; - - print ""; - print ""; - print '
'.$langs->trans("Date").''.$langs->trans("DateValue").''.$langs->trans("DateOperationShort").''.$langs->trans("DateValueShort").''.$langs->trans("Type").''.$langs->trans("Description").''.$langs->trans("Debit").''.$langs->trans("Credit").''.$langs->trans("Action").''.$langs->trans("AccountStatement").' (Ex: YYYYMM)'.$langs->trans("Debit").''.$langs->trans("Credit").''.$langs->trans("Action").''.$langs->trans("AccountStatement").'
(Ex: YYYYMM)
'.dolibarr_print_date($objp->do).''.dolibarr_print_date($objp->dv).''.$objp->type.($objp->num_chq?' '.$objp->num_chq:'').''.$objp->label.''; + print ''.dolibarr_print_date($objp->do,"%d/%m/%Y").''.dolibarr_print_date($objp->dv,"%d/%m/%Y").''.$objp->type.($objp->num_chq?' '.$objp->num_chq:'').''.$objp->label.''; + /* - * Ajout les liens + * Ajout les liens (societe, company...) */ + $newline=1; $links = $acct->get_url($objp->rowid); foreach($links as $key=>$val) { - print ' - '; - print ''; - // if ($links[$key]['type']=='payment') { print img_object($langs->trans('ShowPayment'),'payment').' '; } - // if ($links[$key]['type']=='company') { print img_object($langs->trans('ShowCustomer'),'company').' '; } - print $links[$key]['label'].''; + if (! $newline) print ' - '; + else print '
'; + if ($links[$key]['type']=='payment') { + print ''; + print img_object($langs->trans('ShowPayment'),'payment').' '; + print $langs->trans("Payment"); + print ''; + $newline=0; + } + elseif ($links[$key]['type']=='company') { + print ''; + print img_object($langs->trans('ShowCustomer'),'company').' '; + print dolibarr_trunc($links[$key]['label'],24); + print ''; + $newline=0; + } + else { + print ''; + print $links[$key]['label']; + print ''; + $newline=0; + } } print '
num_releve&account=$acct->id\">$objp->num_relevenum_releve&account=$acct->id\">$objp->num_releve'; + print ''; print ''; print img_edit(); - print '   '; + print '  '; if ($objp->do <= mktime() ) { print ''; @@ -245,7 +264,7 @@ if ($resql) print ''; } else { - print " "; // On n'empeche la suppression car le raprochement ne pourra se faire qu'après la date passée et que l'écriture apparaissent bien sur le compte. + print " "; // On n'empeche la suppression car le raprochement ne pourra se faire qu'après la date passée et que l'écriture apparaisse bien sur le compte. } print ""; + // Affiche zone saisie relevé + bouton "Rapprocher" + if ($objp->do <= mktime()) + { + print ''; print ""; + print '   '; + print "trans("Rapprocher")."\">"; if ($options) { print "
"; } print "
trans("Rapprocher")."\">"; - print ""; - print "Ecriture future. Ne peut pas encore être rapprochée."; - print "'; + print 'Ecriture future. Ne peut pas encore être rapprochée.'; + print '
'; - print ""; - print ''; - print ''; - print ''; - print ''; - print ''; - print "\n"; - - - $sql = "SELECT sum(amount) FROM ".MAIN_DB_PREFIX."bank WHERE num_releve < $num AND fk_account = ".$acct->id; - $resql=$db->query($sql); - if ($resql) - { - $total = $db->result(0, 0); - $db->free($resql); - } - - $sql = "SELECT b.rowid,".$db->pdate("b.dateo")." as do,".$db->pdate("b.datev")." as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type"; - $sql .= " FROM ".MAIN_DB_PREFIX."bank as b"; - $sql .= " WHERE num_releve='".$num."'"; - if (!isset($num)) { - $sql .= " or num_releve is null"; - } - $sql .= " AND fk_account = ".$acct->id; - $sql .= " ORDER BY datev ASC"; - $result = $db->query($sql); - if ($result) - { - $var=True; - $numrows = $db->num_rows($result); - $i = 0; - - // Ligne Solde début releve - print ""; - print "\n"; - - while ($i < $numrows) - { - $objp = $db->fetch_object($result); - $total = $total + $objp->amount; - - $var=!$var; - print ""; - - print '\n"; - print ''; - print ""; - - if ($objp->amount < 0) - { - $totald = $totald + abs($objp->amount); - print '\n"; - } - else - { - $totalc = $totalc + abs($objp->amount); - print "\n"; - } + else { + // On veut le relevé num + $num=$_GET["num"]; + } + $ve=$_GET["ve"]; - print "\n"; - - if ($user->rights->banque->modifier) - { - print ""; - } - else - { - print ""; - } - print ""; - $i++; - } - $db->free($result); + $mesprevnext ="id\">".img_previous()."  "; + $mesprevnext.= $langs->trans("AccountStatement")." $num"; + $mesprevnext.="   id\">".img_next().""; + print_fiche_titre($langs->trans("AccountStatement").' '.$num.', '.$langs->trans("BankAccount").' : '.$acct->label.'',$mesprevnext); + print '
'; + + print ""; + print ""; + + print '
'.$langs->trans("Date").''.$langs->trans("DateValue").''.$langs->trans("Type").''.$langs->trans("Description").''.$langs->trans("Debit").''.$langs->trans("Credit").''.$langs->trans("Balance").' 
id."\">Vue etendue".$langs->trans("Solde initial")." :".price($total)." 
'.dolibarr_print_date($objp->do).''; - - /* Mise à jour de la date de valeur */ - - print ''; - print img_previous() . " "; - print strftime("%d/%m/%Y",$objp->dv) ." "; - print ''; - print img_next(); - - print "'.$objp->fk_type.' '.($objp->num_chq?$objp->num_chq:'').'$objp->label"; - - if ($ve) - { - $sql = "SELECT label FROM ".MAIN_DB_PREFIX."bank_categ as ct, ".MAIN_DB_PREFIX."bank_class as cl WHERE ct.rowid=cl.fk_categ AND cl.lineid=$objp->rowid"; - $resc = $db->query($sql); - if ($resc) - { - $numc = $db->num_rows($resc); - $ii = 0; - while ($ii < $numc) - { - $objc = $db->fetch_object($resc); - print "
$objc->label"; - $ii++; - } - } - else - { - dolibarr_print_error($db); - } - } - - print "
'.price($objp->amount * -1)."  ".price($objp->amount)."".price($total)."rowid&account=".$acct->id."\">"; - print img_edit(); - print " 
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + + + $sql = "SELECT sum(amount) FROM ".MAIN_DB_PREFIX."bank WHERE num_releve < $num AND fk_account = ".$acct->id; + $resql=$db->query($sql); + if ($resql) + { + $total = $db->result(0, 0); + $db->free($resql); } - // Ligne Total - print ""; - // Ligne Solde - print "\n"; - print "
'.$langs->trans("DateOperationShort").''.$langs->trans("DateValueShort").''.$langs->trans("Type").''.$langs->trans("Description").''.$langs->trans("Debit").''.$langs->trans("Credit").''.$langs->trans("Balance").' 
".$langs->trans("Total")." :".price($totald)."".price($totalc)."  
 ".$langs->trans("Solde final")." :".price($total)." 
\n"; - + + $sql = "SELECT b.rowid,".$db->pdate("b.dateo")." as do,".$db->pdate("b.datev")." as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type"; + $sql .= " FROM ".MAIN_DB_PREFIX."bank as b"; + $sql .= " WHERE num_releve='".$num."'"; + if (!isset($num)) + { + $sql .= " or num_releve is null"; + } + $sql .= " AND fk_account = ".$acct->id; + $sql .= " ORDER BY datev ASC"; + $result = $db->query($sql); + + if ($result) + { + $var=True; + $numrows = $db->num_rows($result); + $i = 0; + + // Ligne Solde début releve + print "id."\"> "; + print "".$langs->trans("InitialBankBalance")." :".price($total)." \n"; + + while ($i < $numrows) + { + $objp = $db->fetch_object($result); + $total = $total + $objp->amount; + + $var=!$var; + print ""; + + // Date operation + print ''.dolibarr_print_date($objp->do,"%d/%m/%Y").''; + + // Date de valeur + print ''; + print ''; + print img_previous().' '; + print dolibarr_print_date($objp->dv,"%d/%m/%Y") .' '; + print ''; + print img_next().''; + print "\n"; + + // Num chq + print ''.$objp->fk_type.' '.($objp->num_chq?$objp->num_chq:'').''; + + // Libelle + print ''.$objp->label.''; + + /* + * Ajout les liens (societe, company...) + */ + $newline=1; + $links = $acct->get_url($objp->rowid); + foreach($links as $key=>$val) + { + if (! $newline) print ' - '; + else print '
'; + if ($links[$key]['type']=='payment') { + print ''; + print img_object($langs->trans('ShowPayment'),'payment').' '; + print $langs->trans("Payment"); + print ''; + $newline=0; + } + elseif ($links[$key]['type']=='company') { + print ''; + print img_object($langs->trans('ShowCustomer'),'company').' '; + print dolibarr_trunc($links[$key]['label'],24); + print ''; + $newline=0; + } + else { + print ''; + print $links[$key]['label']; + print ''; + $newline=0; + } + } + + // Catégories + if ($ve) + { + $sql = "SELECT label FROM ".MAIN_DB_PREFIX."bank_categ as ct, ".MAIN_DB_PREFIX."bank_class as cl WHERE ct.rowid=cl.fk_categ AND cl.lineid=$objp->rowid"; + $resc = $db->query($sql); + if ($resc) + { + $numc = $db->num_rows($resc); + $ii = 0; + if ($numc && ! $newline) print '
'; + while ($ii < $numc) + { + $objc = $db->fetch_object($resc); + print "
$objc->label"; + $ii++; + } + } + else + { + dolibarr_print_error($db); + } + } + + print ""; + + if ($objp->amount < 0) + { + $totald = $totald + abs($objp->amount); + print ''.price($objp->amount * -1)." \n"; + } + else + { + $totalc = $totalc + abs($objp->amount); + print " ".price($objp->amount)."\n"; + } + + print "".price($total)."\n"; + + if ($user->rights->banque->modifier) + { + print "rowid&account=".$acct->id."\">"; + print img_edit(); + print ""; + } + else + { + print " "; + } + print ""; + $i++; + } + $db->free($result); + } + + // Ligne Total + print "".$langs->trans("Total")." :".price($totald)."".price($totalc)."  "; + + // Ligne Solde + print " ".$langs->trans("EndBankBalance")." :".price($total)." \n"; + print "\n"; } $db->close(); diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 194b23ce589..724a8a0743e 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1267,7 +1267,7 @@ else print ''; /* - * Paiements + * Liste des paiements */ print $langs->trans('Payments').' :
'; $sql = 'SELECT '.$db->pdate('datep').' as dp, pf.amount,'; @@ -1281,7 +1281,7 @@ else if ($result) { $num = $db->num_rows($result); - $i = 0; $total = 0; + $i = 0; $totalpaye = 0; print ''; print ''; print ''; diff --git a/htdocs/fourn/paiement/fiche.php b/htdocs/fourn/paiement/fiche.php index 200006c45bb..f66db820d7c 100644 --- a/htdocs/fourn/paiement/fiche.php +++ b/htdocs/fourn/paiement/fiche.php @@ -18,7 +18,6 @@ * * $Id$ * $Source$ - * */ /** @@ -182,14 +181,17 @@ if ($resql) $total = 0; print '
'.$langs->trans('Date').''.$langs->trans('Type').''.$langs->trans('Amount').' 
'; print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; print "\n"; if ($num > 0) { $var=True; + $fac_static=new FactureFournisseur($db); while ($i < $num) { $objp = $db->fetch_object($resql); @@ -198,10 +200,9 @@ if ($resql) print '\n"; + print ''; print ''; print ''; - $fac=new FactureFournisseur($db); - print ''; print "\n"; if ($objp->paye == 1) { diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang index 0f9823fa16e..09ae1b2690e 100644 --- a/htdocs/langs/en_US/banks.lang +++ b/htdocs/langs/en_US/banks.lang @@ -15,6 +15,7 @@ SavingAccounts=Saving accounts ErrorBankLabelAlreadyExists=Financial account label already exists BankBalance=Balance InitialBankBalance=Initial balance +EndBankBalance=End balance CurrentBalance=Current balance RIB=RIB IBAN=IBAN number diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 8de378f6508..530192ebff8 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -117,6 +117,9 @@ DateValidation=Validation date DateClosing=Closing date DateDue=Due date DateValue=Value date +DateValueShort=Value date +DateOperation=Operation date +DateOperationShort=Ope. Date DateLimit=Limit date DateRequest=Request date DateProcess=Process date diff --git a/htdocs/langs/fr_FR/banks.lang b/htdocs/langs/fr_FR/banks.lang index 9acda26b069..4db7ef10b09 100644 --- a/htdocs/langs/fr_FR/banks.lang +++ b/htdocs/langs/fr_FR/banks.lang @@ -15,6 +15,7 @@ SavingAccounts=Comptes ErrorBankLabelAlreadyExists=Libellé de compte financier déjà existant BankBalance=Solde InitialBankBalance=Solde initial +EndBankBalance=Solde final CurrentBalance=Solde actuel RIB=RIB IBAN=Identifiant IBAN diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 52cc92645d3..49a1ad91266 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -116,6 +116,9 @@ DateValidation=Date validation DateClosing=Date clôture DateDue=Date échéance DateValue=Date valeur +DateValueShort=Date valeur +DateOperation=Date opération +DateOperationShort=Date opé. DateLimit=Date limite DateRequest=Date demande DateProcess=Date traitement
'.$langs->trans('Bill').''.$langs->trans('Company').''.$langs->trans('AmountTTC').''.$langs->trans('Status').''.$langs->trans('Bill').''.$langs->trans('Status').''.$langs->trans('Company').''.$langs->trans('AmountTTC').'
'.img_object($langs->trans('ShowBill'),'bill').' '; print $objp->facnumber; print "'.$fac_static->LibStatut($objp->paye,$objp->fk_statut).''.img_object($langs->trans('ShowCompany'),'company').' '.$objp->nom.''.price($objp->amount).''.$fac->LibStatut($objp->paye,$objp->fk_statut).'