[ 
https://issues.apache.org/jira/browse/OFBIZ-5576?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13940269#comment-13940269
 ] 

Jacopo Cappellato commented on OFBIZ-5576:
------------------------------------------

Thank you Adrian,
this bug report is indeed a valid one and your proposed patch was in the right 
direction.

I have some doubts on the approach Hans Bakker have followed to implement the 
payment-to-invoice applications with different currencies but I don't have time 
to propose and implement an alternative approach.
In the meantime I have committed a fix, in rev. 1579155 (trunk), rev. 1579157 
(13.07), rev. 1579158 (12.04) that is in the spirit of Hans' design.

> Currency won't match for Invoice & Payment in different currency than default
> -----------------------------------------------------------------------------
>
>                 Key: OFBIZ-5576
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-5576
>             Project: OFBiz
>          Issue Type: Bug
>          Components: accounting
>    Affects Versions: SVN trunk, Release Branch 12.04, Release Branch 13.07
>         Environment: Linux, Java 1.7
>            Reporter: Adrian Stern
>            Assignee: Jacopo Cappellato
>            Priority: Critical
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Default Currency: USD
> When creating an invoice & payment in a different currency than the default 
> currency, but the same currency for invoice and payment, the process can't be 
> completed because the "currencies don't match"-error.
> 1. Create Invoice EUR amount of 1000.-; set to ready
> 2. Create Payment EUR amount of 1000.-; Apply to Invoice
> This will throw the error that the currencies don't match. It works when the 
> "actual currency" attribute is set to EUR as well.
> The problem is, that the payment.currencyUomId property is never checkt 
> during Application.
> This patch will solve this issue. But i can't estimate the overall impact of 
> it.
> Index: accounting/payment/PaymentServices.xml
> ===================================================================
> --- accounting/payment/PaymentServices.xml    (revision 1576834)
> +++ accounting/payment/PaymentServices.xml    (working copy)
> @@ -185,6 +185,7 @@
>                  <condition>
>                      <or>
>                          <if-compare-field  field="invoice.currencyUomId" 
> operator="equals" to-field="defaultCurrencyUomId"/>
> +                        <if-compare-field  field="invoice.currencyUomId" 
> operator="equals" to-field="payment.currencyUomId"/>
>                          <and>
>                              <if-compare-field  field="invoice.currencyUomId" 
> operator="not-equals" to-field="defaultCurrencyUomId"/>
>                              <if-compare-field  field="invoice.currencyUomId" 
> operator="equals" to-field="payment.actualCurrencyUomId"/>



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to