Skip to content

Commit

Permalink
Merge pull request #7446 from hregis/6.0_bug3
Browse files Browse the repository at this point in the history
Fix: wrong supplier product price id
  • Loading branch information
eldy committed Sep 20, 2017
2 parents 5e2cc05 + 77fea19 commit 7706020
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions htdocs/fourn/class/fournisseur.commande.class.php
Expand Up @@ -1414,7 +1414,7 @@ public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0.0, $txlocalt
if ($remise_percent == 0 && $prod->remise_percent !=0)
$remise_percent =$prod->remise_percent;


}
if ($result == 0) // If result == 0, we failed to found the supplier reference price
{
Expand Down Expand Up @@ -2678,14 +2678,14 @@ public function getInputMethod()
if ($db->num_rows($query))
{
$obj = $db->fetch_object($query);

$string = $langs->trans($obj->code);
if ($string == $obj->code)
{
$string = $obj->label != '-' ? $obj->label : '';
}
return $string;
}
}
}
else dol_print_error($db);
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/fourn/commande/card.php
Expand Up @@ -409,7 +409,7 @@
$localtax1_tx,
$localtax2_tx,
$idprod,
$productsupplier->id,
$productsupplier->product_fourn_price_id,
$productsupplier->fourn_ref,
$remise_percent,
'HT',
Expand Down
2 changes: 2 additions & 0 deletions htdocs/product/class/product.class.php
Expand Up @@ -1532,6 +1532,7 @@ function get_buyprice($prodfournprice, $qty, $product_id=0, $fourn_ref='', $fk_s
$obj->price = $price_result;
}
}
$this->product_fourn_price_id = $obj->rowid;
$this->buyprice = $obj->price; // deprecated
$this->fourn_pu = $obj->price / $obj->quantity; // Unit price of product of supplier
$this->fourn_price_base_type = 'HT'; // Price base type
Expand Down Expand Up @@ -1577,6 +1578,7 @@ function get_buyprice($prodfournprice, $qty, $product_id=0, $fourn_ref='', $fk_s
$obj->price = $price_result;
}
}
$this->product_fourn_price_id = $obj->rowid;
$this->buyprice = $obj->price; // deprecated
$this->fourn_qty = $obj->quantity; // min quantity for price for a virtual supplier
$this->fourn_pu = $obj->price / $obj->quantity; // Unit price of product for a virtual supplier
Expand Down

0 comments on commit 7706020

Please sign in to comment.