Skip to content

Commit

Permalink
Fix: Supplier price displayed on document lines and margin infos didn…
Browse files Browse the repository at this point in the history
…t take discount
  • Loading branch information
altairis-tof committed Sep 15, 2013
1 parent 6959ccf commit 775d259
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ChangeLog
Expand Up @@ -25,7 +25,7 @@ Fix: Edit propal line was losing product supplier price id
Fix: Delete linked element to supplier invoice when deleted
Fix: [ bug #1061 ] Bad info shipped products
Fix: [ bug #1062 ] Documents lost in propals and contracts validating
Fix: Supplier price displayed on document lines didnt take discount
Fix: Supplier price displayed on document lines and margin infos didnt take discount
Qual: Add travis-ci integration


Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/class/commonobject.class.php
Expand Up @@ -3104,7 +3104,7 @@ function getMarginInfos($force_price=false) {
if (empty($line->pa_ht) && isset($line->fk_fournprice) && !$force_price) {
$product = new ProductFournisseur($this->db);
if ($product->fetch_product_fournisseur_price($line->fk_fournprice))
$line->pa_ht = $product->fourn_unitprice;
$line->pa_ht = $product->fourn_unitprice * (1 - $product->fourn_remise_percent / 100);
if (isset($conf->global->MARGIN_TYPE) && $conf->global->MARGIN_TYPE == "2" && $product->fourn_unitcharges > 0)
$line->pa_ht += $product->fourn_unitcharges;
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/margin/lib/margins.lib.php
Expand Up @@ -103,7 +103,7 @@ function getMarginInfos($pvht, $remise_percent, $tva_tx, $localtax1_tx, $localta
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
$product = new ProductFournisseur($db);
if ($product->fetch_product_fournisseur_price($fk_pa)) {
$paht_ret = $product->fourn_unitprice;
$paht_ret = $product->fourn_unitprice * (1 - $product->fourn_remise_percent / 100);
if ($conf->global->MARGIN_TYPE == "2" && $product->fourn_unitcharges > 0)
$paht_ret += $product->fourn_unitcharges;
}
Expand Down

0 comments on commit 775d259

Please sign in to comment.