svn commit: r1609067 - in /ofbiz/branches/release12.04: ./ applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1609067 - in /ofbiz/branches/release12.04: ./ applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml

jacopoc
Author: jacopoc
Date: Wed Jul  9 09:41:14 2014
New Revision: 1609067

URL: http://svn.apache.org/r1609067
Log:
Applied fix from trunk for revision: 1609065
===

Fixed wrong tax adjustment types set by the "addtax" service used by the manual invoice editing screens; thanks to Aswath Satrasala for the bug report in OFBIZ-3255


Modified:
    ofbiz/branches/release12.04/   (props changed)
    ofbiz/branches/release12.04/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml

Propchange: ofbiz/branches/release12.04/
------------------------------------------------------------------------------
  Merged /ofbiz/trunk:r1609065

Modified: ofbiz/branches/release12.04/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml?rev=1609067&r1=1609066&r2=1609067&view=diff
==============================================================================
--- ofbiz/branches/release12.04/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml (original)
+++ ofbiz/branches/release12.04/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml Wed Jul  9 09:41:14 2014
@@ -863,7 +863,12 @@ under the License.
                     <if-not-empty field="itemAdjustment">
                         <iterate list="itemAdjustment" entry="orderAdjustment">
                             <set field="createInvoiceItemContext.invoiceId" from-field="invoice.invoiceId"/>
-                            <set field="createInvoiceItemContext.invoiceItemTypeId" value="ITM_SALES_TAX"/>
+                            <if-compare field="invoice.invoiceTypeId" value="PURCHASE_INVOICE" operator="equals">
+                                <set field="createInvoiceItemContext.invoiceItemTypeId" value="PITM_SALES_TAX"/>
+                            <else>
+                                <set field="createInvoiceItemContext.invoiceItemTypeId" value="ITM_SALES_TAX"/>
+                            </else>
+                            </if-compare>
                             <set field="createInvoiceItemContext.overrideGlAccountId" from-field="orderAdjustment.overrideGlAccountId"/>
                             <set field="createInvoiceItemContext.productId" from-field="itemMap.productList[countItemId]"/>
                             <set field="createInvoiceItemContext.taxAuthPartyId" from-field="orderAdjustment.taxAuthPartyId"/>
@@ -881,7 +886,12 @@ under the License.
                 <iterate list="orderAdjustments" entry="Adjustment">
                     <if-not-empty field="Adjustment">
                         <set field="InvoiceItemContext.invoiceId" from-field="invoice.invoiceId"/>
-                        <set field="InvoiceItemContext.invoiceItemTypeId" value="ITM_SALES_TAX"/>
+                        <if-compare field="invoice.invoiceTypeId" value="PURCHASE_INVOICE" operator="equals">
+                            <set field="InvoiceItemContext.invoiceItemTypeId" value="PITM_SALES_TAX"/>
+                        <else>
+                            <set field="InvoiceItemContext.invoiceItemTypeId" value="ITM_SALES_TAX"/>
+                        </else>
+                        </if-compare>
                         <set field="InvoiceItemContext.overrideGlAccountId" from-field="Adjustment.overrideGlAccountId"/>
                         <set field="InvoiceItemContext.taxAuthPartyId" from-field="Adjustment.taxAuthPartyId"/>
                         <set field="InvoiceItemContext.taxAuthGeoId" from-field="Adjustment.taxAuthGeoId"/>