Fix do we really must copy notes when creating an object from another

source object? Add a hack with hidden option to be able to change this.
This commit is contained in:
Laurent Destailleur 2019-03-18 20:09:09 +01:00
parent 0c101f3d1b
commit aa013ff753
2 changed files with 13 additions and 9 deletions

View File

@ -1212,8 +1212,12 @@ class Commande extends CommonOrder
$this->fk_delivery_address = $object->fk_delivery_address;
$this->contact_id = $object->contactid;
$this->ref_client = $object->ref_client;
$this->note_private = $object->note_private;
$this->note_public = $object->note_public;
if (! empty($conf->global->MAIN_DISABLE_PROPAGATE_NOTES_FROM_ORIGIN))
{
$this->note_private = $object->note_private;
$this->note_public = $object->note_public;
}
$this->origin = $object->element;
$this->origin_id = $object->id;

View File

@ -1081,7 +1081,7 @@ class Facture extends CommonInvoice
*/
function createFromOrder($object, User $user)
{
global $hookmanager;
global $conf, $hookmanager;
$error=0;
@ -1142,8 +1142,12 @@ class Facture extends CommonInvoice
$this->fk_delivery_address = $object->fk_delivery_address;
$this->contact_id = $object->contactid;
$this->ref_client = $object->ref_client;
$this->note_private = $object->note_private;
$this->note_public = $object->note_public;
if (! empty($conf->global->MAIN_DISABLE_PROPAGATE_NOTES_FROM_ORIGIN))
{
$this->note_private = $object->note_private;
$this->note_public = $object->note_public;
}
$this->origin = $object->element;
$this->origin_id = $object->id;
@ -4402,10 +4406,6 @@ class FactureLigne extends CommonInvoiceLine
public $date_start;
public $date_end;
// Ne plus utiliser
//var $price; // P.U. HT apres remise % de ligne (exemple 80)
//var $remise; // Montant calcule de la remise % sur PU HT (exemple 20)
// From llx_product
/**
* @deprecated