dolibarr-bugtrack
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dolibarr-bugtrack] [Bug #1701] Incorrect total buying price


From: Doliforge
Subject: [Dolibarr-bugtrack] [Bug #1701] Incorrect total buying price
Date: Fri, 21 Nov 2014 19:46:37 +0100

Doliforge
Ce message ne s'affiche pas correctement?
mettez à jour vos préférences utilisateur.

Incorrect total buying price

Dernières modifications

21/11/2014 19:46 (Europe/Paris)
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.
Changements :
  • Assigned to: 
AucunChristophe Battarel (cbattarel)
  • Resolution: 
AucunFixed

Répondre

É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:  Christophe Battarel (cbattarel)
Resolution:  Fixed 

Commentaires

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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]