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: Wed, 19 Nov 2014 12:58:54 +0100

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

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



reply via email to

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