Ajout 2 fonctions pour gérer les dates de valeurs
This commit is contained in:
parent
54dddd5f13
commit
4007084dd6
@ -200,7 +200,6 @@ class Account
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Function update()
|
Function update()
|
||||||
{
|
{
|
||||||
if (strlen($this->label)==0)
|
if (strlen($this->label)==0)
|
||||||
@ -301,6 +300,62 @@ class Account
|
|||||||
$this->db->free();
|
$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 "<p>$sql</p>";
|
||||||
|
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 "<p>$sql</p>";
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user