svn commit: r957870 - /ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/CompanyHeader.groovy

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

svn commit: r957870 - /ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/CompanyHeader.groovy

jonesde
Author: jonesde
Date: Fri Jun 25 10:07:38 2010
New Revision: 957870

URL: http://svn.apache.org/viewvc?rev=957870&view=rev
Log:
Added code to get tax id in more circumstances in the PDF company header

Modified:
    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/CompanyHeader.groovy

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/CompanyHeader.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/CompanyHeader.groovy?rev=957870&r1=957869&r2=957870&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/CompanyHeader.groovy (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/CompanyHeader.groovy Fri Jun 25 10:07:38 2010
@@ -204,3 +204,19 @@ selPayments = EntityUtil.filterByDate(pa
 if (selPayments) {
     context.eftAccount = delegator.findByPrimaryKey("EftAccount", [paymentMethodId : selPayments[0].paymentMethodId]);
 }
+
+// Tax ID Info
+partyTaxAuthInfoList = delegator.findByAnd("PartyTaxAuthInfo", [partyId : partyId]);
+if (partyTaxAuthInfoList) {
+    if (address.countryGeoId) {
+        // if we have an address with country filter by that
+        partyTaxAuthInfoList.eachWithIndex { partyTaxAuthInfo, i ->
+            if (partyTaxAuthInfo.taxAuthGeoId.equals(address.countryGeoId)) {
+                context.sendingPartyTaxId = partyTaxAuthInfo.partyTaxId;
+            }
+        }
+    } else {
+        // otherwise just grab the first one
+        context.sendingPartyTaxId = partyTaxAuthInfoList[0].partyTaxId;
+    }
+}