Merge branch 'hotfixes/hotfix-chrono-facture-update-date-paiement' into staging
This commit is contained in:
commit
970c7655a9
@ -1455,18 +1455,16 @@ class Bdd {
|
||||
|
||||
if(in_array($table, $this->whiteTable) && in_array($column, $this->whiteColumn)){
|
||||
if(strcmp($table, "facture")==0 && strcmp($column, "date_paiement")==0) {
|
||||
|
||||
$facture = $this->getFactureByFactureId($id);
|
||||
if($facture['date_paiement'] != $data){
|
||||
$facturationDatetime = Datetime::createFromFormat('Y-m-d',$data);
|
||||
$factureNumber = $this->getFactureNumberByDate($facturationDatetime);
|
||||
$fullFactureNumber = DateHelpers::GetFullFactureOrDevisNumberByDate($facturationDatetime,$factureNumber,"FAC");
|
||||
$sql = "UPDATE ".$this->tableprefix.$table." SET `facture_number`= ? WHERE `id` = ?";
|
||||
$this->execSQLNoData($sql, array($factureNumber, $id));
|
||||
$sql = "UPDATE ".$this->tableprefix.$table." SET $column = ?, `num`= ? WHERE `id` = ?";
|
||||
$this->execSQLNoData($sql, array($data, $fullFactureNumber, $id));
|
||||
}
|
||||
else{
|
||||
$fullFactureNumber = $facture["num"];
|
||||
}
|
||||
$sql = "UPDATE ".$this->tableprefix.$table." SET $column = ?, `num`= ? WHERE `id` = ?";
|
||||
$this->execSQLNoData($sql, array($data, $fullFactureNumber, $id));
|
||||
|
||||
} else if(strcmp($table, "facture")==0 && strcmp($column, "id_devis")==0) {
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user