FIX: Unsigned propal having signing date (#29825)

* FIX propal dates: setting sign date only if signed

* FIX propal dates: clearing sign date when reopenning a propal

* FIX propal dates: reworked + not clearing sign date

Not clearing the sign date anymore because of 17.0 configuration that allow the user to choose if he wants to keep the previous sign date or the current date.

* FIX propal dates: move comma to fix sql syntax error

* FIX propal dates: add SQL request to update database

This SQL request is meant to set the sign date and the signing user to null to match the fix

* Update 15.0.0-16.0.0.sql

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
Yannis Hoareau 2024-06-04 10:52:29 +02:00 committed by GitHub
parent 659830b68a
commit 26e09f85d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2629,7 +2629,10 @@ class Propal extends CommonObject
$newprivatenote = dol_concatdesc($this->note_private, $note);
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
$sql .= " SET fk_statut = ".((int) $status).", note_private = '".$this->db->escape($newprivatenote)."', date_signature='".$this->db->idate($now)."', fk_user_signature=".$user->id;
$sql .= " SET fk_statut = ".((int) $status).", note_private = '".$this->db->escape($newprivatenote)."'";
if ($status == self::STATUS_SIGNED) {
$sql .= ", date_signature='".$this->db->idate($now)."', fk_user_signature=".$user->id;
}
$sql .= " WHERE rowid = ".((int) $this->id);
$resql = $this->db->query($sql);