Dolibarr ERP & CRM » Bugs » bug #1701 Incorrect total buying priceDernières modifications
Répondre
État Détails |
Last Modified On: | 21/11/2014 19:46 | | Submitted by: | Francois Couque (fcouque) |
Submitted 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: | Closed | | Assigned to: | Christophe Battarel (cbattarel) |
Resolution: | Fixed | |
Commentaires- Christophe Battarel 22/11/2014 18:59
- The bug has been corrected. Pull request send inside GIT sources
(http://www.github.com/Dolibarr/dolibarr) and waiting to merge
into develop branch. - Christophe Battarel 21/11/2014 19:46
- fixed but waiting for other pull requests integration before pulling this one; otherwise needs to revert my previous changes, create another branch for them, sending a PR and then do the same for this one... git is great when PR are validated quickly but can be a mess when not.
|
|
(http://www.github.com/Dolibarr/dolibarr) and waiting to merge
into develop branch.
Open→ Closed