From 02169478d03e86ae3b8ec1c57373b30376cb5d37 Mon Sep 17 00:00:00 2001 From: Alexis Algoud Date: Thu, 30 Jun 2016 15:30:07 +0200 Subject: [PATCH 1/2] FIX #4964 buyprice in customer from shipping buyprice wasn't load in expedition::fetch_lines --- htdocs/expedition/class/expedition.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 1b7fbefb8a6..a15c3b53b83 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -1266,7 +1266,7 @@ class Expedition extends CommonObject $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"; @@ -1336,6 +1336,8 @@ class Expedition extends CommonObject $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) From 75bb16193089d141c71a96d0db24fb95364545ec Mon Sep 17 00:00:00 2001 From: atm-geoffrey Date: Thu, 30 Jun 2016 16:20:53 +0200 Subject: [PATCH 2/2] FIX #4828 --- htdocs/comm/action/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 123189bdc87..a78eac54695 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -781,7 +781,7 @@ if ($action == 'create') print ''.$langs->trans("Project").''; - $numproject=$formproject->select_projects((! empty($societe->id)?$societe->id:0),GETPOST("projectid")?GETPOST("projectid"):'','projectid'); + $numproject=$formproject->select_projects((! empty($societe->id)?$societe->id:-1),GETPOST("projectid")?GETPOST("projectid"):'','projectid'); if ($numproject==0) { print '   '.$langs->trans("AddProject").'';