Skip to content

Commit

Permalink
FIX #4964 buyprice in customer from shipping
Browse files Browse the repository at this point in the history
buyprice wasn't load in expedition::fetch_lines
  • Loading branch information
Alexis Algoud committed Jun 30, 2016
1 parent b6700c7 commit 0216947
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion htdocs/expedition/class/expedition.class.php
Expand Up @@ -1266,7 +1266,7 @@ function fetch_lines()

$sql = "SELECT cd.rowid, cd.fk_product, cd.label as custom_label, cd.description, cd.qty as qty_asked";
$sql.= ", cd.total_ht, cd.total_localtax1, cd.total_localtax2, cd.total_ttc, cd.total_tva";
$sql.= ", cd.tva_tx, cd.localtax1_tx, cd.localtax2_tx, cd.price, cd.subprice, cd.remise_percent";
$sql.= ", cd.tva_tx, cd.localtax1_tx, cd.localtax2_tx, cd.price, cd.subprice, cd.remise_percent,cd.buy_price_ht as pa_ht";
$sql.= ", ed.rowid as line_id, ed.qty as qty_shipped, ed.fk_origin_line, ed.fk_entrepot";
$sql.= ", p.ref as product_ref, p.label as product_label, p.fk_product_type";
$sql.= ", p.weight, p.weight_units, p.length, p.length_units, p.surface, p.surface_units, p.volume, p.volume_units, p.tobatch as product_tobatch";
Expand Down Expand Up @@ -1336,6 +1336,8 @@ function fetch_lines()
$line->volume = $obj->volume;
$line->volume_units = $obj->volume_units;

$line->pa_ht = $obj->pa_ht;

// For invoicing
$tabprice = calcul_price_total($obj->qty_shipped, $obj->subprice, $obj->remise_percent, $obj->tva_tx, $obj->localtax1_tx, $obj->localtax2_tx, 0, 'HT', $obj->info_bits, $obj->fk_product_type, $mysoc); // We force type to 0
$line->desc = $obj->description; // We need ->desc because some code into CommonObject use desc (property defined for other elements)
Expand Down

0 comments on commit 0216947

Please sign in to comment.