NEW Introduce option MAIN_WEIGHT_DEFAULT_UNIT and

MAIN_VOLUME_DEFAULT_UNIT to force output unit for weight and volume.
This commit is contained in:
Laurent Destailleur
2016-04-01 18:44:23 +02:00
parent 7edd1d89a0
commit 281b06a2d3
7 changed files with 106 additions and 76 deletions

View File

@@ -1718,7 +1718,8 @@ class Commande extends CommonOrder
$sql.= ' l.total_ht, l.total_ttc, l.total_tva, l.total_localtax1, l.total_localtax2, l.date_start, l.date_end,';
$sql.= ' l.fk_unit,';
$sql.= ' l.fk_multicurrency, l.multicurrency_code, l.multicurrency_subprice, l.multicurrency_total_ht, l.multicurrency_total_tva, l.multicurrency_total_ttc,';
$sql.= ' p.ref as product_ref, p.description as product_desc, p.fk_product_type, p.label as product_label';
$sql.= ' p.ref as product_ref, p.description as product_desc, p.fk_product_type, p.label as product_label,';
$sql.= ' p.weight, p.weight_units, p.volume, p.volume_units';
$sql.= ' FROM '.MAIN_DB_PREFIX.'commandedet as l';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON (p.rowid = l.fk_product)';
$sql.= ' WHERE l.fk_commande = '.$this->id;
@@ -1777,6 +1778,11 @@ class Commande extends CommonOrder
$line->product_desc = $objp->product_desc;
$line->fk_product_type = $objp->fk_product_type; // Produit ou service
$line->fk_unit = $objp->fk_unit;
$line->weight = $objp->weight;
$line->weight_units = $objp->weight_units;
$line->volume = $objp->volume;
$line->volume_units = $objp->volume_units;
$line->date_start = $this->db->jdate($objp->date_start);
$line->date_end = $this->db->jdate($objp->date_end);