diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 1dd1a797494..9c826a4bb61 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -122,6 +122,7 @@ class Propal extends CommonObject /** * Status of the quote * @var int + * @deprecated Try to use $status now * @see Propal::STATUS_DRAFT, Propal::STATUS_VALIDATED, Propal::STATUS_SIGNED, Propal::STATUS_NOTSIGNED, Propal::STATUS_BILLED */ public $statut; @@ -1606,7 +1607,8 @@ class Propal extends CommonObject $this->ref = $obj->ref; $this->ref_client = $obj->ref_client; - $this->ref_ext = $obj->ref_ext; + $this->ref_customer = $obj->ref_client; + $this->ref_ext = $obj->ref_ext; $this->remise = $obj->remise; // TODO deprecated $this->remise_percent = $obj->remise_percent; // TODO deprecated diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 67eb5190425..f6d11eed0fd 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1899,7 +1899,7 @@ class Commande extends CommonOrder $this->ref = $obj->ref; $this->ref_client = $obj->ref_client; $this->ref_customer = $obj->ref_client; - $this->ref_ext = $obj->ref_ext; + $this->ref_ext = $obj->ref_ext; $this->socid = $obj->fk_soc; $this->thirdparty = null; // Clear if another value was already set by fetch_thirdparty diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 18de3c14b64..4750c9af54c 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -177,9 +177,6 @@ class Facture extends CommonInvoice */ public $ref_customer; - //Check constants for types - public $type = self::TYPE_STANDARD; - // Warning: Do not set default value into property defintion. it must stay null. // For example to avoid to have substition done when object is generic and not yet defined. public $remise_absolue; @@ -302,6 +299,7 @@ class Facture extends CommonInvoice public $retained_warranty_fk_cond_reglement; + /** * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" @@ -492,7 +490,9 @@ class Facture extends CommonInvoice if (empty($this->type)) { $this->type = self::TYPE_STANDARD; } + $this->ref_client = trim($this->ref_client); + $this->note = (isset($this->note) ? trim($this->note) : trim($this->note_private)); // deprecated $this->note_private = (isset($this->note_private) ? trim($this->note_private) : trim($this->note_private)); $this->note_public = trim($this->note_public); diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 055cb58e84f..d93f25522ae 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -33,6 +33,16 @@ abstract class CommonInvoice extends CommonObject { use CommonIncoterm; + /** + * @var int Type of invoice (See TYPE_XXX constants) + */ + public $type = self::TYPE_STANDARD; + + /** + * @var int Sub type of invoice (A subtype code coming from llx_invoice_subtype table. May be used by some countries like Greece) + */ + public $subtype; + /** * Standard invoice */