Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0038085Openbravo ERP07. Sales managementpublic2018-03-08 15:542018-03-29 13:07
ngarcia 
markmm82 
urgentmajoralways
closedfixed 
5
 
3.0PR18Q2 
dmiguelez
Core
No
0038085: Prices in Invoice lines of discounts copied by Copy Lines process are updated to 0 when completing if a price adjustment exists
Prices in Invoice lines of discounts copied by Copy Lines process are updated to 0 when completing if a price adjustment exists and price includes taxes

The problem is that the grosspricestd is 0 and M_PROMOTION_CALCULATE function transfers it to gross_unit_price column
As group admin role:
   Create a new record in Discounts and Promotions window:
      Discount/Promotion Type: Price Adjustment
      Starting Date: today
      Included...: Only those defined (the discount will not applicable as we are not going to include any record in the tabs)
   Create a Sales Order
   Select a price list set as Price Includes Tax
   Add a product and a basic discount to it
   Book it
   Launch Create Invoices From Orders process and select the previously create order
   Check the invoice is correct
   Create a new Sales Invoice header
   Launch Copy Lines process and select previously created invoice
   Complete it and check prices in Discount line are updated to 0
No tags attached.
related to defect 0036969 closed markmm82 Purchase order lines created from Requisitions are created with 0 price if price list includes taxes and a discount is defined 
related to defect 0037314 closed collazoandy4 Gross Unit Price is updated to 0 if a sales invoice line from a Return Material Receipt is modified and price includes taxes 
related to defect 0037960 closed markmm82 When not stocked product is exploded before booking the order and price includes taxes, Gross Unit Price is updated to 0 
Issue History
2018-03-08 15:54ngarciaNew Issue
2018-03-08 15:54ngarciaAssigned To => Triage Finance
2018-03-08 15:54ngarciaModules => Core
2018-03-08 15:54ngarciaResolution time => 1522274400
2018-03-08 15:54ngarciaTriggers an Emergency Pack => No
2018-03-08 15:55ngarciaIssue Monitored: networkb
2018-03-08 15:55ngarciaRelationship addedrelated to 0036969
2018-03-08 15:55ngarciaRelationship addeddepends on 0037314
2018-03-08 15:55ngarciaRelationship addeddepends on 0037960
2018-03-08 15:58ngarciaDescription Updatedbug_revision_view_page.php?rev_id=16819#r16819
2018-03-08 16:01ngarciaRelationship replacedrelated to 0037314
2018-03-08 16:01ngarciaRelationship replacedrelated to 0037960
2018-03-08 17:47dmiguelezAssigned ToTriage Finance => markmm82
2018-03-14 17:22markmm82Note Added: 0103247
2018-03-14 17:30markmm82Statusnew => scheduled
2018-03-26 09:20hgbotCheckin
2018-03-26 09:20hgbotNote Added: 0103489
2018-03-26 09:20hgbotStatusscheduled => resolved
2018-03-26 09:20hgbotResolutionopen => fixed
2018-03-26 09:20hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/1c30cd9ab98620fcb18afda5ca737c989bf2d4ca [^]
2018-03-26 09:21dmiguelezReview Assigned To => dmiguelez
2018-03-26 09:21dmiguelezNote Added: 0103490
2018-03-26 09:21dmiguelezStatusresolved => closed
2018-03-26 09:21dmiguelezFixed in Version => 3.0PR18Q2
2018-03-29 13:07hudsonbotCheckin
2018-03-29 13:07hudsonbotNote Added: 0103629

Notes
(0103247)
markmm82   
2018-03-14 17:22   
Test Plan:
    As group admin role:
   Create a new record in Discounts and Promotions window:
      Discount/Promotion Type: Price Adjustment
      Starting Date: today
      Included...: Only those defined (the discount will not applicable as we are not going to include any record in the tabs)
   Create a Sales Order
   Select a price list set as Price Includes Tax
   Add a product and a basic discount to it
   Book it
   Launch Create Invoices From Orders process and select the previously create order
   Check the invoice is correct
   Create a new Sales Invoice header
   Launch Copy Lines process and select previously created invoice
   Complete it and check prices in Discount line still the same and all invoice values are correct
(0103489)
hgbot   
2018-03-26 09:20   
Repository: erp/devel/pi
Changeset: 1c30cd9ab98620fcb18afda5ca737c989bf2d4ca
Author: Mark <markmm82 <at> gmail.com>
Date: Thu Mar 22 10:16:12 2018 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/1c30cd9ab98620fcb18afda5ca737c989bf2d4ca [^]

Fixes issue 38085: Prices in Invoice lines of discounts copied by Copy Lines
process are updated to 0 when completing if a price adjustment exists.

The problem is happening when we are copying the invoice line with the basic
discount, in the Copy Lines process and M_PROMOTION_CALCULATE function resets the
price for this line too. As lines with basic discount have zero grosspricestd,
gross_unit_price and line_gross_amount are set to zero too.

We should avoid to reset prices in the M_PROMOTION_CALCULATE function for those
lines related to basic discounts. They are the invoice lines related to an invoice
discount, or those when product is related to a basic discount.

---
M src-db/database/model/functions/M_PROMOTION_CALCULATE.xml
M src/org/openbravo/erpCommon/ad_actionButton/CopyFromInvoice_data.xsql
---
(0103490)
dmiguelez   
2018-03-26 09:21   
Code Review + Testing Ok
(0103629)
hudsonbot   
2018-03-29 13:07   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/ead4656f507e [^]
Maturity status: Test