Posted by
Jacopo Cappellato on
Apr 26, 2006; 5:50pm
URL: http://ofbiz.116.s1.nabble.com/Re-Users-invoice-wrong-calculation-tp138691p138698.html
Joachim,
sorry, could you please apply the attached patch instead?
You can do it without stopping and without recompiling OFBiz.
Jacopo
Jacopo Cappellato wrote:
> Hi Joachim,
>
> just curious... could you please try to comment the line 42 of file
> accounting/webapp/accounting/WEB-INF/actions/payment/listNotAppliedPayments.bsh
> ?
>
> Line 42 should contain:
>
> Locale locale = parameters.get("locale");
>
> Jacopo
>
>
>
> Schreibmaier Joachim wrote:
>> Hans,
>>
>>> with the latest update it should be a lot better now. If you find some
>>> more let me know...
>> Same behaviour as before. Although I did an offline payment (total invoice
>> amount) there is the full invoice amount open to pay. If I manually try to
>> update the payment amount I get the exception:
>> org.ofbiz.base.util.GeneralException: Error rendering screen
>> [component://accounting/widget/PaymentScreens.xml#EditPaymentApplications]:
>> org.ofbiz.base.util.GeneralException: Error running BSH script at location
>> [component://accounting/webapp/accounting/WEB-INF/actions/payment/listNotApp
>> liedInvoices.bsh]: org.ofbiz.base.util.GeneralException: Error running BSH
>> script at
>> [component://accounting/webapp/accounting/WEB-INF/actions/payment/listNotApp
>> liedInvoices.bsh], line [64]: Sourced file:
>> component://accounting/webapp/accounting/WEB-INF/actions/payment/listNotAppl
>> iedInvoices.bsh : null : at Line: 64 : in file:
>> component://accounting/webapp/accounting/WEB-INF/actions/payment/listNotAppl
>> iedInvoices.bsh : .get ( "lastLocale" )
>>
>> I am now working with svn revision no. 7421 and also compiled the source
>> files.
>>
>> Thanks for helping.
>>
>> Best Regards
>>
>> Joachim
>
>
> _______________________________________________
> Users mailing list
>
[hidden email]
>
http://lists.ofbiz.org/mailman/listinfo/users>
Index: applications/accounting/webapp/accounting/WEB-INF/actions/payment/listNotAppliedInvoices.bsh
===================================================================
--- applications/accounting/webapp/accounting/WEB-INF/actions/payment/listNotAppliedInvoices.bsh (revision 7421)
+++ applications/accounting/webapp/accounting/WEB-INF/actions/payment/listNotAppliedInvoices.bsh (working copy)
@@ -28,6 +28,7 @@
import java.math.*;
import java.text.NumberFormat;
+Locale locale = context.get("locale");
paymentId = parameters.get("paymentId");
payment = delegator.findByPrimaryKey("Payment", UtilMisc.toMap("paymentId", paymentId));
@@ -61,7 +62,6 @@
invoiceMap.put("description",invoice.getString("description"));
invoiceMap.put("invoiceDate", invoice.getString("invoiceDate").substring(0,10)); // display only YYYY-MM-DD
invoiceMap.put("amountApplied", invoiceApplied);
- locale = parameters.get("autoUserLogin").get("lastLocale");
if (paymentToApply.compareTo(invoiceToApply) < 0 ) {
invoiceMap.put("amountToApply",paymentToApply);
}
Index: applications/accounting/webapp/accounting/WEB-INF/actions/payment/listNotAppliedPayments.bsh
===================================================================
--- applications/accounting/webapp/accounting/WEB-INF/actions/payment/listNotAppliedPayments.bsh (revision 7421)
+++ applications/accounting/webapp/accounting/WEB-INF/actions/payment/listNotAppliedPayments.bsh (working copy)
@@ -39,7 +39,7 @@
int decimals = UtilNumber.getBigDecimalScale("invoice.decimals");
int rounding = UtilNumber.getBigDecimalRoundingMode("invoice.rounding");
-Locale locale = parameters.get("locale");
+Locale locale = context.get("locale");
ArrayList paymentsMapList = new ArrayList(); // to pass back to the screeen list of unapplied payments
@@ -81,7 +81,7 @@
paymentMap.put("toPaymentId", payment.getString("paymentId"));
paymentMap.put("currencyUomId", payment.getString("currencyUomId"));
paymentMap.put("effectiveDate", payment.getString("effectiveDate").substring(0,10)); // list as YYYY-MM-DD
- paymentMap.put("amount", payment.getString("amount"));
+ paymentMap.put("amount", payment.getBigDecimal("amount"));
paymentMap.put("amountApplied", PaymentWorker.getPaymentAppliedBd(payment));
BigDecimal paymentToApply = PaymentWorker.getPaymentNotAppliedBd(payment);
if (paymentToApply.compareTo(basePaymentToApply) < 0 ) {
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users