Merge remote-tracking branch 'origin/3.6' into 3.7

Conflicts:
	htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php
	htdocs/core/tpl/objectline_create.tpl.php
	htdocs/fichinter/fiche.php
This commit is contained in:
Laurent Destailleur
2014-11-28 02:20:01 +01:00
16 changed files with 76 additions and 21 deletions

View File

@@ -1224,7 +1224,15 @@ class Commande extends CommonOrder
$this->line->date_end=$date_end;
// infos marge
$this->line->fk_fournprice = $fk_fournprice;
if (!empty($fk_product) && empty($fk_fournprice) && empty($pa_ht)) {
// by external module, take lowest buying price
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
$productFournisseur = new ProductFournisseur($this->db);
$productFournisseur->find_min_price_product_fournisseur($fk_product);
$this->line->fk_fournprice = $productFournisseur->product_fourn_price_id;
} else {
$this->line->fk_fournprice = $fk_fournprice;
}
$this->line->pa_ht = $pa_ht;
// TODO Ne plus utiliser
@@ -2421,7 +2429,15 @@ class Commande extends CommonOrder
$this->line->skip_update_total=$skip_update_total;
// infos marge
$this->line->fk_fournprice = $fk_fournprice;
if (!empty($fk_product) && empty($fk_fournprice) && empty($pa_ht)) {
//by external module, take lowest buying price
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
$productFournisseur = new ProductFournisseur($this->db);
$productFournisseur->find_min_price_product_fournisseur($fk_product);
$this->line->fk_fournprice = $productFournisseur->product_fourn_price_id;
} else {
$this->line->fk_fournprice = $fk_fournprice;
}
$this->line->pa_ht = $pa_ht;
// TODO deprecated