From 07419d28b490310af98052d50ec3ec66944c3eb7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 31 Jan 2005 18:05:14 +0000 Subject: [PATCH] Uniformisation style. --- htdocs/compta/bank/account.php | 22 ++--- htdocs/compta/bank/ligne.php | 161 ++++++++++++++++----------------- 2 files changed, 89 insertions(+), 94 deletions(-) diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 80063612db4..c3999800778 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -205,7 +205,7 @@ if ($account > 0) } print ''; - print 'Date OpeValeur'.$langs->trans("Type").''.$langs->trans("Description").''; + print ''.$langs->trans("Date").'Valeur'.$langs->trans("Type").''.$langs->trans("Description").''; print ''.$langs->trans("Debit").''.$langs->trans("Credit").'Solde'; print ''.$langs->trans("AccountStatement").''; @@ -281,11 +281,11 @@ if ($account > 0) print "Saisie d'une transaction hors facture"; print ''; print 'YYYY MMDD '.$langs->trans("Description").'0000.000000.00'; - print ''; + print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; + print ''; print ''; - print ''; + print ''; - print ''; - print ''; + print ''; + print ''; print ""; print ""; print ''; @@ -313,7 +313,7 @@ if ($account > 0) } else { - print "Erreur : numéro de compte inexistant"; + print $langs->trans("ErrorBankAccountNotFound"); } $db->close(); @@ -351,8 +351,8 @@ function _print_lines($db,$sql,$acct) } print ""; - print "".strftime("%d %b %y",$objp->do)."\n"; - print "".strftime("%d/%m/%y",$objp->dv)."\n"; + print "".dolibarr_print_date($objp->do,"%d/%m/%y")."\n"; + print "".dolibarr_print_date($objp->dv,"%d/%m/%y")."\n"; print "".$objp->fk_type." ".($objp->num_chq?$objp->num_chq:"")."\n"; print "rowid&account=$acct->id\">$objp->label"; /* diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index 37aceb7cbf6..d3e62d56b6e 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Xavier DUTOIT - * Copyright (C) 2004 Laurent Destailleur + * Copyright (C) 2004-2005 Laurent Destailleur * Copyright (C) 2004 Christophe Combelles * * This program is free software; you can redistribute it and/or modify @@ -22,8 +22,8 @@ * $Source$ * */ - -/*! + +/** \file htdocs/compta/bank/ligne.php \ingroup compta \brief Page édition d'une écriture bancaire @@ -35,10 +35,16 @@ require("./pre.inc.php"); if (!$user->rights->banque->modifier) accessforbidden(); +$langs->load("banks"); + llxHeader(); $rowid=isset($_GET["rowid"])?$_GET["rowid"]:$_POST["rowid"]; + +/* + * Actions + */ if ($_GET["action"] == 'dvnext') { $ac = new Account($db); @@ -52,8 +58,6 @@ if ($_GET["action"] == 'dvprev') $ac->datev_previous($_GET["rowid"]); } - - if ($_POST["action"] == 'confirm_delete_categ' && $_POST["confirm"] == "yes") { $sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class WHERE lineid = $rowid AND fk_categ = ".$_GET["cat1"]; @@ -79,12 +83,12 @@ if ($_POST["action"] == 'class') } } -if ($_POST["action"] == $langs->trans("Update")) +if ($_POST["action"] == "update") { // Avant de modifier la date ou le montant, on controle si ce n'est pas encore rapproche if (!empty($_POST['amount'])) { - $sql = "SELECT b.rappro FROM ".MAIN_DB_PREFIX."bank as b WHERE rowid=$rowid"; + $sql = "SELECT b.rappro FROM ".MAIN_DB_PREFIX."bank as b WHERE rowid=".$rowid; $result = $db->query($sql); if ($result) { @@ -94,13 +98,16 @@ if ($_POST["action"] == $langs->trans("Update")) $objp = $db->fetch_object($result); if ($objp->rappro) die ("Vous ne pouvez pas modifier une écriture déjà rapprochée"); - $sql = "UPDATE ".MAIN_DB_PREFIX."bank set label='".$_POST["label"]."' , dateo = '".$_POST["date"]."', amount='$amount' WHERE rowid = $rowid;"; + $sql = "UPDATE ".MAIN_DB_PREFIX."bank set label='".$_POST["label"]."', dateo = '".$_POST["date"]."', amount='$amount' WHERE rowid = $rowid;"; } } else - $sql = "UPDATE ".MAIN_DB_PREFIX."bank set label='".$_POST["label"]."' WHERE rowid = $rowid;"; + $sql = "UPDATE ".MAIN_DB_PREFIX."bank set label='".$_POST["label"]."', dateo = '".$_POST["date"]."' WHERE rowid = $rowid;"; -$result = $db->query($sql); + $result = $db->query($sql); + if (! $result) { + dolibarr_print_error($db); + } } if ($_POST["action"] == 'type') @@ -115,6 +122,8 @@ if ($_POST["action"] == 'num_releve') $result = $db->query($sql); } + +// On initialise la liste des categories $sql = "SELECT rowid, label FROM ".MAIN_DB_PREFIX."bank_categ;"; $result = $db->query($sql); if ($result) @@ -133,7 +142,7 @@ if ($result) } -print_titre("Edition de la ligne"); +print_titre("Edition de l'écriture bancaire"); if ($_GET["action"] == 'delete_categ') @@ -145,15 +154,8 @@ if ($_GET["action"] == 'delete_categ') $var=False; print ''; -print ""; -print ''; -print ""; -print ""; -print ""; -print ""; -print "\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.author, b.num_chq, b.fk_type, fk_account"; +$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.fk_user_author, b.num_chq, b.fk_type, fk_account"; $sql .= " FROM ".MAIN_DB_PREFIX."bank as b WHERE rowid=$rowid"; $sql .= " ORDER BY dateo ASC"; $result = $db->query($sql); @@ -169,36 +171,48 @@ if ($result) $acct->fetch($objp->fk_account); $account = $acct->id; - print ""; - print "\n"; - print ""; - if ($objp->amount < 0) - { - print "\n"; - } - else - { - print "\n"; - } - - print ""; - print ""; - print ""; - - print ""; - print '\n"; - + // Account + print ""; + + print "rowid\">"; + print ""; + + // Date + if (! $objp->rappro) + { + print ""; + print ""; + } + + // Value date + print ""; + print '\n"; print '"; - print ''; - print ""; + // Description + print ""; + print ""; - print ""; + print ""; + } + + print ""; + + print ""; - - print "rowid\">"; - print "trans("Update")."\">"; - print ""; - print ""; - - if (!$objp->rappro) - { - print ""; - print ""; - print ""; - print ""; - } - print ""; - print "rowid\">"; print ''; - print ""; + print "  trans("Update")."\">"; print ""; - print ""; - // Categorie - print ""; - print ""; - - print "'; + // Author + print ""; + $author=new User($db,$objp->fk_user_author); + $author->fetch(); + print ""; print ""; - - print ""; - + $i++; } $db->free(); } print "
'.$langs->trans("Date").''.$langs->trans("Description").'".$langs->trans("Debit")."".$langs->trans("Credit")."Releve".$langs->trans("Author")."
".strftime("%d %b %Y",$objp->do)."$objp->label".price($objp->amount * -1)."  ".price($objp->amount)."num_releve&ve=1&account=$account\">$objp->num_releve$objp->author
'.$langs->trans("DateValue").''.strftime("%d %b %Y",$objp->dv)."
".$langs->trans("Account")."".$acct->label."
".$langs->trans("Date").""; + print 'do).'">'; + print "  trans("Update")."\">
'.$langs->trans("DateValue").''.strftime("%d %b %Y",$objp->dv)."'; print img_previous() . " "; print ''; print img_next() ."
".$langs->trans("Account")."".$acct->label."
".$langs->trans("Label").""; + print ''; + print "  trans("Update")."\">
 "; - + // Amount + if (! $objp->rappro) + { + print "
".$langs->trans("Amount").""; + print ''; + print "  trans("Update")."\">
".$langs->trans("Type").""; print "
rowid\">"; print ''; print '"; print $objp->num_chq?" - $objp->num_chq":''; - print "trans("Update")."\">"; + print "  trans("Update")."\">"; print "
"; - print "
".$langs->trans("Label").""; - print ''; - print "trans("Update")."\">
".$langs->trans("Date").""; - print 'do).'">'; - print "trans("Update")."\">
".$langs->trans("Amount").""; - print ''; - print "trans("Update")."\">
Relevé"; + print "
".$langs->trans("AccountStatement").""; print ''; - print "trans("Update")."\">
".$langs->trans("Category").""; - print " "; - print '
".$langs->trans("Author")."".$author->fullname."
"; -print "
Classé dans:
"; +print '
'; + + +// Liste les categories print ''; -print ""; -print ''; -print "\n"; + +print ""; +print ""; +print "'; +print ""; +print ""; $sql = "SELECT c.label, c.rowid"; $sql .= " FROM ".MAIN_DB_PREFIX."bank_class as a, ".MAIN_DB_PREFIX."bank_categ as c WHERE a.lineid=$rowid AND a.fk_categ = c.rowid ";
'.$langs->trans("Description").'
".$langs->trans("Categories").""; +print " "; +print '