Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0014816Openbravo ERP07. Sales managementpublic2010-10-07 13:582010-12-20 17:42
networkb 
adrianromero 
highminoralways
closedfixed 
5
2.50MP22 
2.50MP25 
OBPS
Core
No
0014816: Error when processing Return Material order which has Discount applied
If you have defined a discount for a BP, and you try to process Return Material order for this BP you get an error.
1. Master Data Management || Business Partner || Business Partner >> Discount : create record for Discount03% with all check-bocks checked, for Mcgiver business partner
2. Sales Management || Transactions || Sales Order || Header : create "Return Material" order for mcgiver
3. Sales Management || Transactions || Sales Order || Header >> Lines : add line with product=Hat and qty= -1
4.come back to header and try to process. You will receive the following error:
Return Material order lines require negative quantities.

The error is because when processing it is trying to add another line to product "Discount03" with qty positive.
The check for not allowing negative quantities must just for items products
No tags attached.
blocks defect 00154903.0RC4 closed adrianromero Error when processing Return Material order which has Discount applied 
Issue History
2010-10-07 13:58networkbNew Issue
2010-10-07 13:58networkbAssigned To => adrianromero
2010-10-07 13:58networkbOBNetwork customer => Yes
2010-11-08 16:56adrianromeroNote Added: 0032473
2010-11-08 17:19psarobeNote Added: 0032477
2010-11-08 17:19psarobeStatusnew => closed
2010-11-08 17:19psarobeResolutionopen => no change required
2010-11-09 10:14networkbNote Added: 0032492
2010-11-09 10:14networkbStatusclosed => new
2010-11-09 10:14networkbResolutionno change required => open
2010-11-09 11:24psarobeNote Added: 0032495
2010-11-09 11:24psarobeStatusnew => closed
2010-11-09 11:24psarobeResolutionopen => no change required
2010-11-09 17:05networkbNote Added: 0032509
2010-11-09 17:06networkbStatusclosed => new
2010-11-09 17:06networkbResolutionno change required => open
2010-11-09 18:42psarobeProposed Solution updated
2010-11-09 18:42psarobeStatusnew => scheduled
2010-11-09 18:42psarobefix_in_branch => pi
2010-11-17 13:18adrianromeroTarget Version2.50MP24 => 2.50MP25
2010-12-01 10:26hgbotCheckin
2010-12-01 10:26hgbotNote Added: 0032970
2010-12-01 10:26hgbotStatusscheduled => resolved
2010-12-01 10:26hgbotResolutionopen => fixed
2010-12-01 10:26hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/cb6a144e18fdfab715fc0354c8756a286141405b [^]
2010-12-01 17:30hudsonbotCheckin
2010-12-01 17:30hudsonbotNote Added: 0032986
2010-12-20 16:39hgbotCheckin
2010-12-20 16:39hgbotNote Added: 0033299
2010-12-20 16:39hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/cb6a144e18fdfab715fc0354c8756a286141405b [^] => http://code.openbravo.com/erp/stable/2.50/rev/f8d68566798aaca2c9fdd00f889f8098e9bd8180 [^]
2010-12-20 17:28adrianromeroTypedefect => backport
2010-12-20 17:28adrianromerofix_in_branchpi =>
2010-12-20 17:29adrianromeroIssue cloned0015490
2010-12-20 17:29adrianromeroRelationship addedblocks 0015490
2010-12-20 17:35psarobeNote Added: 0033305
2010-12-20 17:35psarobeStatusresolved => closed
2010-12-20 17:42adrianromeroNote Added: 0033307

Notes
(0032473)
adrianromero   
2010-11-08 16:56   
Probably the error is when calculating discounts it will be needed to check if the quantity is negative or positive and set the discount quantity with the same sign.
(0032477)
psarobe   
2010-11-08 17:19   
Remove the discounts that are in the discount tab
(0032492)
networkb   
2010-11-09 10:14   
If I remove discounts then I am not returning same amount.

For example:
1. I had StandardSalesOrder for 1 Hat at 35€ (plus Discount0.3%) --> Order amount=33.95
2. I want to return this order so I create ReturnMaterial for -1 Hat at 35€ --> if I remove applied discount Order amount will be -35€ (instead of -33.95)
(0032495)
psarobe   
2010-11-09 11:24   
Please so change the price that fits with it. For documents type "Return material" you cannot add lines with positive quantities. This is something you explicitly ask for.
Another possibility is to directly create the goods shipment. That would be the best approach and when you invoice it the discounts will be applied
(0032509)
networkb   
2010-11-09 17:05   
In my opinion, these are only workarounds and no solutions because:
* about change price --> it is not acceptable at my real price is 35 but then i am deciding apply a discount
* about make shipment and invoice --> i am not able to perform a complete returning cicle (order-shipment-invoice)
For example, a solution would be to create a new DocumentType based on ARInvoice and use it for Return Material, having its own sequence and setting negative quantities for lines but being able to reflect discounts.

I agree that "Return Material" order only accept negative quantities, but then we need to document that they are not working with Discounts together.
And also we need to set proper error message as when we receive "Return Material order lines require negative quantities" message, line for discount does not appear in sales order lines so all lines you can see have negative quantities. In this case message should say explicit that problem is that Discount is trying to be applied.
(0032970)
hgbot   
2010-12-01 10:26   
Repository: erp/devel/pi
Changeset: cb6a144e18fdfab715fc0354c8756a286141405b
Author: Harikrishnan Raja <harikrishnan.raja <at> openbravo.com>
Date: Wed Dec 01 14:55:25 2010 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/cb6a144e18fdfab715fc0354c8756a286141405b [^]

Fixes Issue 14816: Error when processing Return Material order which has Discount applied

---
M src-db/database/model/functions/C_ORDER_POST1.xml
---
(0032986)
hudsonbot   
2010-12-01 17:30   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/cb6a144e18fd [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/73d8e3106d34 [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.19056.obx [^]
(0033299)
hgbot   
2010-12-20 16:39   
Repository: erp/stable/2.50
Changeset: f8d68566798aaca2c9fdd00f889f8098e9bd8180
Author: Adrián Romero <adrianromero <at> openbravo.com>
Date: Mon Dec 20 16:35:22 2010 +0100
URL: http://code.openbravo.com/erp/stable/2.50/rev/f8d68566798aaca2c9fdd00f889f8098e9bd8180 [^]

Fixes Issue 14816: Error when processing Return Material order which has Discount applied
It has been added removed from the check discount lines in return material orders

---
M src-db/database/model/functions/C_ORDER_POST1.xml
---
(0033305)
psarobe   
2010-12-20 17:35   
Tested working fine
(0033307)
adrianromero   
2010-12-20 17:42   
* Testing the issue

Kindly follow the steps to test and verify that a return material order with discounts can be properly completed. Verify also that the discount amounts in the material order are correct.

* Other areas affected

It is only affected the process of completing orders, and in particular only return material orders. Verify also that normal orders and return material orders without discounts can be completed and there is not any change in the behavior.