facture date paiement chrono
This commit is contained in:
parent
01d6e8f39a
commit
ff98dd31a2
@ -1456,11 +1456,17 @@ class Bdd {
|
|||||||
if(in_array($table, $this->whiteTable) && in_array($column, $this->whiteColumn)){
|
if(in_array($table, $this->whiteTable) && in_array($column, $this->whiteColumn)){
|
||||||
if(strcmp($table, "facture")==0 && strcmp($column, "date_paiement")==0) {
|
if(strcmp($table, "facture")==0 && strcmp($column, "date_paiement")==0) {
|
||||||
|
|
||||||
$facture = json_decode($this->getOneFacture($id, $idNextcloud))[0];
|
$facture = $this->getFactureByFactureId($id);
|
||||||
$numfacture = explode('/', $facture->num)[2];
|
if($facture['date_paiement'] != $data){
|
||||||
$datesplit = explode('-', $data);
|
$facturationDatetime = Datetime::createFromFormat('Y-m-d',$data);
|
||||||
|
$factureNumber = $this->getFactureNumberByDate($facturationDatetime);
|
||||||
|
$fullFactureNumber = DateHelpers::GetFullFactureOrDevisNumberByDate($facturationDatetime,$factureNumber,"FAC");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$fullFactureNumber = $facture["num"];
|
||||||
|
}
|
||||||
$sql = "UPDATE ".$this->tableprefix.$table." SET $column = ?, `num`= ? WHERE `id` = ?";
|
$sql = "UPDATE ".$this->tableprefix.$table." SET $column = ?, `num`= ? WHERE `id` = ?";
|
||||||
$this->execSQLNoData($sql, array(htmlentities(rtrim($data)), "ETS".$datesplit[0]."/".$datesplit[1]."/".$numfacture, $id));
|
$this->execSQLNoData($sql, array($data, $fullFactureNumber, $id));
|
||||||
|
|
||||||
} else if(strcmp($table, "facture")==0 && strcmp($column, "id_devis")==0) {
|
} else if(strcmp($table, "facture")==0 && strcmp($column, "id_devis")==0) {
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user