Voiding a completed order sets the quantities and line totals to zero, but fails to reset the order tax.
This results in an order total of zero but a positive order grand total equal to the original tax amount (for a non tax-inclusive order).
The issue seems to be caused by MOrderline.updateHeaderTax():
private boolean updateHeaderTax()
{
// Recalculate Tax for this Tax
if (!getParent().isProcessed())
if (!updateOrderTax(false))
return false;
...
As the (completed) order being voided is flagged as processed this prevents the tax from being updated.
Teo: Your name's on the updateOrderTax function, do you have any suggestions for fixing this? I assume we wouldn't want to just remove the check...
Regards,
Paul
Good catch Paul,
I think the validation is ok in MOrderLine.beforeSave - maybe adding the logic to zero-it the taxes in voidIt method.
Regards,
Carlos Ruiz
Issue is not resolved!
Best Regards,
Anca Bradau
www.arhipac.ro
Revision: 9594
http://adempiere.svn.sourceforge.net/adempiere/?rev=9594&view=rev
Author: phib
Date: 2009-07-03 08:30:50 +0000 (Fri, 03 Jul 2009)
Log Message:
-----------
2386156 Voiding completed order does not update order tax
https://sourceforge.net/tracker/?func=detail&aid=2386156&group_id=176962&atid=879332
Modified Paths:
--------------
trunk/base/src/org/compiere/model/MOrder.java
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).