FIX #13382 Note will be concat to private note

This commit is contained in:
Laurent Destailleur 2020-03-18 21:06:36 +01:00
parent 25b62646b6
commit 56d6c4691f
3 changed files with 13 additions and 5 deletions

View File

@ -117,6 +117,9 @@ if (!empty($conf->expedition->enabled) && $conf->global->WAREHOUSE_ASK_WAREHOUSE
if (empty($object->warehouse_id) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) $object->warehouse_id = $user->fk_warehouse;
}
$error = 0;
/*
* Actions
*/

View File

@ -1223,8 +1223,13 @@ class CommandeFournisseur extends CommonOrder
{
$this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur SET fk_statut = ".self::STATUS_ORDERSENT.", fk_input_method=".$methode.", date_commande='".$this->db->idate($date)."'";
$sql .= " WHERE rowid = ".$this->id;
$newnoteprivate = $this->note_private;
if ($comment) $newnoteprivate = dol_concatdesc($newnoteprivate, $langs->trans("Comment").': '.$comment);
$sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur";
$sql .= " SET fk_statut=".self::STATUS_ORDERSENT.", fk_input_method=".$methode.", date_commande='".$this->db->idate($date)."', ";
$sql .= " note_private='".$this->db->escape($newnoteprivate)."'";
$sql .= " WHERE rowid=".$this->id;
dol_syslog(get_class($this)."::commande", LOG_DEBUG);
if ($this->db->query($sql))
@ -1232,6 +1237,7 @@ class CommandeFournisseur extends CommonOrder
$this->statut = self::STATUS_ORDERSENT;
$this->methode_commande_id = $methode;
$this->date_commande = $date;
$this->context = array('comments' => $comment);
// Call trigger
$result = $this->call_trigger('ORDER_SUPPLIER_SUBMIT', $user);

View File

@ -62,7 +62,6 @@ $id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
$comclientid = GETPOST('comid', 'int');
$socid = GETPOST('socid', 'int');
$projectid = GETPOST('projectid', 'int');
$cancel = GETPOST('cancel', 'alpha');
@ -917,7 +916,7 @@ if (empty($reshook))
// Force mandatory order method
if ($action == 'commande') {
$methodecommande = GETPOST('methodecommande');
$methodecommande = GETPOST('methodecommande', 'int');
if ($methodecommande <= 0) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("OrderMode")), null, 'errors');
@ -927,7 +926,7 @@ if (empty($reshook))
if ($action == 'confirm_commande' && $confirm == 'yes' && $user->rights->fournisseur->commande->commander)
{
$result = $object->commande($user, $_REQUEST["datecommande"], $_REQUEST["methode"], $_REQUEST['comment']);
$result = $object->commande($user, GETPOST("datecommande"), GETPOST("methode", 'int'), GETPOST('comment', 'alphanohtml'));
if ($result > 0)
{
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))