Author: lektran
Date: Fri Jul  6 22:37:25 2007
New Revision: 554138

URL: http://svn.apache.org/viewvc?view=rev&rev=554138
Log:
Applied fix from trunk for revision: 543944

Modified:
    
ofbiz/branches/release4.0/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java

Modified: 
ofbiz/branches/release4.0/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/branches/release4.0/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java?view=diff&rev=554138&r1=554137&r2=554138
==============================================================================
--- 
ofbiz/branches/release4.0/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java
 (original)
+++ 
ofbiz/branches/release4.0/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java
 Fri Jul  6 22:37:25 2007
@@ -1420,11 +1420,13 @@
                         // the amount to capture is lower than the amount 
available in this payment application:
                         // split the payment application into two records and 
apply one to the invoice
                         GenericValue newPaymentApplication = 
delegator.makeValue("PaymentApplication", paymentApplication);
+                        String paymentApplicationId = 
delegator.getNextSeqId("PaymentApplication");
                         paymentApplication.set("invoiceId", invoiceId);
                         paymentApplication.set("amountApplied", 
amountToCapture);
                         paymentApplication.store();
+                        newPaymentApplication.set("paymentApplicationId", 
paymentApplicationId);
                         newPaymentApplication.set("amountApplied", 
paymentApplicationAmount.subtract(amountToCapture));
-                        newPaymentApplication.store();
+                        newPaymentApplication.create();
                     }
                     capturedAmount = capturedAmount.add(amountToCapture);
                 }


Reply via email to