Dolibarr ERP & CRM » Bugs » bug #1701 Incorrect total buying priceÉtat Détails |
Submitted by: | Francois Couque (fcouque) | | Submitted on: | 19/11/2014 12:58 |
Last Modified On: | 19/11/2014 12:58 | |
Summary: | Incorrect total buying price |
Description: | In margin/customerMargins.php , the buying price is incorrectly calculated when a line of invoice has 100% discount leading to a different amount displayed in the invoice card. ( which is correct there )
Suggested fix:
Replace in margin/customerMargins.php
$sql.= " sum(".$db->ifsql('d.total_ht <=0','d.qty * d.buy_price_ht * -1','d.qty * d.buy_price_ht').") as buying_price,";
by
$sql.= " sum(".$db->ifsql('d.total_ht <0','d.qty * d.buy_price_ht * -1','d.qty * d.buy_price_ht').") as buying_price,";
|
Step to reproduce bug: | Create an invoice with a line detail with a 100% discount and a not null buying price.
Note the total buying price of the invoice.
Goto:
margin/customerMargins.php
Then select the customer. You will see your invoice with a different and incorrect amount for the buying price.
Detected in 3.6 and 3.7. |
Detected in version: | 3.6.1 | | Category: | Other |
Severity: | 4 | | OS Type/Version: | |
PHP version: | | | Database type and version: | |
Etat |
Status: | Open | | Assigned to: | Aucun |
Resolution: | Aucun | |
Répondre
|
|