From 9300974432c582c118e61d2ae81be292a2043de2 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Tue, 6 Apr 2004 08:29:11 +0000 Subject: [PATCH] Gestion des dates de valeurs --- htdocs/compta/bank/account.class.php | 6 ++++-- htdocs/compta/bank/ligne.php | 31 +++++++++++++++++++++++++--- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/bank/account.class.php b/htdocs/compta/bank/account.class.php index 14bb51ab948..e9d2dd443c3 100644 --- a/htdocs/compta/bank/account.class.php +++ b/htdocs/compta/bank/account.class.php @@ -143,8 +143,10 @@ class Account break; } - $sql = "INSERT INTO ".MAIN_DB_PREFIX."bank (datec, dateo, label, amount, author, num_chq,fk_account, fk_type)"; - $sql .= " VALUES (now(), '$date', '$label', '" . ereg_replace(",",".",$amount) . "','$author','$num_chq', '$this->rowid', '$oper')"; + $datev = $date; + + $sql = "INSERT INTO ".MAIN_DB_PREFIX."bank (datec, dateo, datev, label, amount, author, num_chq,fk_account, fk_type)"; + $sql .= " VALUES (now(), '$date', '$datev', '$label', '" . ereg_replace(",",".",$amount) . "','$author','$num_chq', '$this->rowid', '$oper')"; if ($this->db->query($sql)) diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index dbb84579caf..4f0c0b0ced7 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -27,6 +27,21 @@ if (!$user->rights->banque->modifier) llxHeader(); +if ($_GET["action"] == 'dvnext') +{ + $ac = new Account($db); + $ac->datev_next($_GET["rowid"]); +} + + +if ($_GET["action"] == 'dvprev') +{ + $ac = new Account($db); + $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 = $cat1"; @@ -119,7 +134,7 @@ print "Auteur"; print "\n"; -$sql = "SELECT b.rowid,".$db->pdate("b.dateo")." as do, 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.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); @@ -142,11 +157,11 @@ if ($result) print "
"; print ""; - print "".strftime("%d %b %Y",$objp->do)."\n"; + print "".strftime("%d %b %Y",$objp->do)."\n"; print "$objp->label"; if ($objp->amount < 0) { - print "".price($objp->amount * -1)." \n"; + print "".price($objp->amount * -1)." \n"; } else { @@ -157,6 +172,16 @@ if ($result) print "$objp->author"; print ""; + print ""; + print 'Date de valeur : '.strftime("%d %b %Y",$objp->dv)."\n"; + + print ''; + print img_previous() . " "; + print ''; + print img_next() .""; + + print ''; + print " "; print $objp->fk_type .' - '; print $objp->num_chq;