details: https://code.openbravo.com/erp/devel/pi/rev/b5115ab17d95 changeset: 28707:b5115ab17d95 user: Mark <m.molina <at> nectus.com> date: Wed Mar 09 18:53:24 2016 -0500 summary: Fixes issue 32428: Wrong orders created by the Copy Record process
Fixed the wrong Tax Amount and Total Gross Amount calculation in orders created by the Copy Record process if price list includes taxes. These amounts are calculated when related triggers are fired, due that when the order is cloned from the original order was necessary to reset calculated amounts and then triggers updates them again when lines are added to the cloned order. details: https://code.openbravo.com/erp/devel/pi/rev/201577aba6ba changeset: 28708:201577aba6ba user: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com> date: Thu Mar 10 17:56:11 2016 +0100 summary: Related to issue 32428: Code review improvements Use BigDecimal.ZERO instead of new BigDecimal(0). diffstat: modules/org.openbravo.client.application/src/org/openbravo/client/application/businesslogic/CloneOrderActionHandler.java | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-) diffs (36 lines): diff -r f4eb6b0d41e0 -r 201577aba6ba modules/org.openbravo.client.application/src/org/openbravo/client/application/businesslogic/CloneOrderActionHandler.java --- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/businesslogic/CloneOrderActionHandler.java Tue Mar 08 10:56:37 2016 +0100 +++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/businesslogic/CloneOrderActionHandler.java Thu Mar 10 17:56:11 2016 +0100 @@ -11,7 +11,7 @@ * under the License. * The Original Code is Openbravo ERP. * The Initial Developer of the Original Code is Openbravo SLU - * All portions are Copyright (C) 2011-2015 Openbravo SLU + * All portions are Copyright (C) 2011-2016 Openbravo SLU * All Rights Reserved. * Contributor(s): Mallikarjun M ************************************************************************ @@ -60,7 +60,6 @@ User currentUser = OBContext.getOBContext().getUser(); Order objOrder = OBDal.getInstance().get(Order.class, orderId); Order objCloneOrder = (Order) DalUtil.copy(objOrder, false); - BigDecimal bLineNetAmt = getLineNetAmt(orderId); objCloneOrder.setDocumentAction("CO"); objCloneOrder.setDocumentStatus("DR"); @@ -87,13 +86,12 @@ cal.set(Calendar.MILLISECOND, 0); objCloneOrder.setOrderDate(cal.getTime()); objCloneOrder.setScheduledDeliveryDate(cal.getTime()); + objCloneOrder.setGrandTotalAmount(BigDecimal.ZERO); + objCloneOrder.setSummedLineAmount(BigDecimal.ZERO); // save the cloned order object OBDal.getInstance().save(objCloneOrder); - objCloneOrder.setSummedLineAmount(objCloneOrder.getSummedLineAmount().subtract(bLineNetAmt)); - objCloneOrder.setGrandTotalAmount(objCloneOrder.getGrandTotalAmount().subtract(bLineNetAmt)); - // get the lines associated with the order and clone them to the new // order line. for (OrderLine ordLine : objOrder.getOrderLineList()) { ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits