From 4007084dd6cc8a70b13444b6d2f6a2e7475b30a0 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Tue, 6 Apr 2004 07:21:29 +0000 Subject: [PATCH] =?UTF-8?q?Ajout=202=20fonctions=20pour=20g=E9rer=20les=20?= =?UTF-8?q?dates=20de=20valeurs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/compta/bank/account.class.php | 57 +++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/bank/account.class.php b/htdocs/compta/bank/account.class.php index 9a3e60f9c2b..14bb51ab948 100644 --- a/htdocs/compta/bank/account.class.php +++ b/htdocs/compta/bank/account.class.php @@ -200,7 +200,6 @@ class Account * * */ - Function update() { if (strlen($this->label)==0) @@ -301,6 +300,62 @@ class Account $this->db->free(); } } + /* + * + * + */ + Function datev_next($rowid) + { + $sql = "UPDATE ".MAIN_DB_PREFIX."bank SET "; + + $sql .= " datev = adddate(datev, interval 1 day)"; + + $sql .= " WHERE rowid = $rowid"; + + $result = $this->db->query($sql); + + if ($result) + { + if ($this->db->affected_rows()) + { + return 1; + } + } + else + { + print $this->db->error(); + print "

$sql

"; + return 0; + } + } + /* + * + * + */ + Function datev_previous($rowid) + { + $sql = "UPDATE ".MAIN_DB_PREFIX."bank SET "; + + $sql .= " datev = adddate(datev, interval -1 day)"; + + $sql .= " WHERE rowid = $rowid"; + + $result = $this->db->query($sql); + + if ($result) + { + if ($this->db->affected_rows()) + { + return 1; + } + } + else + { + print $this->db->error(); + print "

$sql

"; + return 0; + } + } }