Openbravo Issue Tracking System - Retail Modules
View Issue Details
0029221Retail ModulesReturn Receiptpublic2015-03-10 13:282015-03-30 12:38
migueldejuana 
migueldejuana 
normalmajoralways
closedfixed 
5
 
RR15Q2 
marvintm
No
0029221: Discounts wrong calculated when splitting lines in returns
We are no calculating well discounts when returning a verified return. We are using remaining quantity instead of total line qty.
- Activate "Split Lines in Shipments when Returning" preference
- Login
- Create an order with stock in 2 different bins adding 10% discount
- Press Verified Returns in the menu
- Select previous order and return part of the qty
- Complete the return
- Press Verified Returns in the menu
- Select previous order and return all qty
- ERROR: See discounts applied
Replace:

 splitpromo.amt = OB.DEC.mul(p.amt, (splitline.remainingQuantity / line.remainingQuantity));
                  splitpromo.actualAmt = OB.DEC.mul(p.actualAmt, (splitline.remainingQuantity / line.remainingQuantity));

With:

 splitpromo.amt = OB.DEC.mul(p.amt, (splitline.remainingQuantity / line.quantity));
                  splitpromo.actualAmt = OB.DEC.mul(p.actualAmt, (splitline.remainingQuantity / line.quantity));
No tags attached.
Issue History
2015-03-10 13:28migueldejuanaNew Issue
2015-03-10 13:28migueldejuanaAssigned To => malsasua
2015-03-10 13:28migueldejuanaRegression level => Production - QA Approved
2015-03-10 13:28migueldejuanaTriggers an Emergency Pack => No
2015-03-12 16:23migueldejuanaRegression levelProduction - QA Approved =>
2015-03-17 09:21migueldejuanaAssigned Tomalsasua => migueldejuana
2015-03-17 09:56hgbotCheckin
2015-03-17 09:56hgbotNote Added: 0075681
2015-03-17 09:56hgbotStatusnew => resolved
2015-03-17 09:56hgbotResolutionopen => fixed
2015-03-17 09:56hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.returns/rev/f876c9ef309bcafba6ca8644fc4f01a7462c4c1e [^]
2015-03-30 11:45marvintmNote Added: 0076129
2015-03-30 11:45marvintmStatusresolved => new
2015-03-30 11:45marvintmResolutionfixed => open
2015-03-30 12:28marvintmNote Deleted: 0076129
2015-03-30 12:35marvintmStatusnew => scheduled
2015-03-30 12:35marvintmStatusscheduled => resolved
2015-03-30 12:35marvintmFixed in Version => RR15Q2
2015-03-30 12:35marvintmResolutionopen => fixed
2015-03-30 12:38marvintmReview Assigned To => marvintm
2015-03-30 12:38marvintmStatusresolved => closed

Notes
(0075681)
hgbot   
2015-03-17 09:56   
Repository: erp/pmods/org.openbravo.retail.returns
Changeset: f876c9ef309bcafba6ca8644fc4f01a7462c4c1e
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Tue Mar 17 09:50:51 2015 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.returns/rev/f876c9ef309bcafba6ca8644fc4f01a7462c4c1e [^]

Fixed issue 0029221: Discounts wrong calculated when splitting lines in returns

We have to calculate amount discounted based on the total line quantity.

---
M web/org.openbravo.retail.returns/js/modalReturnLines.js
---