2
0
forked from Wavyzz/dolibarr

Clean code

This commit is contained in:
Laurent Destailleur
2025-04-24 17:17:05 +02:00
parent aaf70a5942
commit 68cb665d8d

View File

@@ -947,7 +947,7 @@ class Commande extends CommonOrder
}
/**
* Create order
* Create sale order
* Note that this->ref can be set or empty. If empty, we will use "(PROV)"
*
* @param User $user Object user that make creation
@@ -1083,7 +1083,7 @@ class Commande extends CommonOrder
if (getDolGlobalString('MAIN_CREATEFROM_KEEP_LINE_ORIGIN_INFORMATION')) {
$originid = $line->origin_id;
$origintype = $line->origin;
$origintype = empty($line->origin_type) ? $line->origin : $line->origin_type;
} else {
$originid = $line->id;
$origintype = $this->element;
@@ -1179,7 +1179,7 @@ class Commande extends CommonOrder
}
if (!$error && $this->id && getDolGlobalString('MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN') && !empty($this->origin) && !empty($this->origin_id)) { // Get contact from origin object
$originforcontact = $this->origin;
$originforcontact = empty($this->origin_type) ? $this->origin : $this->origin_type;
$originidforcontact = $this->origin_id;
if ($originforcontact == 'shipping') { // shipment and order share the same contacts. If creating from shipment we take data of order
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';