Author: jacopoc
Date: Sun Jun 3 10:17:59 2007
New Revision: 543944
URL:
http://svn.apache.org/viewvc?view=rev&rev=543944Log:
Fixed to the new billing account code, found while testing.
Modified:
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java
Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java?view=diff&rev=543944&r1=543943&r2=543944==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java Sun Jun 3 10:17:59 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);
}