Author: apatel
Date: Thu Jul 23 05:13:11 2009
New Revision: 796948
URL: http://svn.apache.org/viewvc?rev=796948&view=rev
Log:
Fix edit invoice screen for COMMISSION invoices. Patch from JIRA-2752
Thanks Sumit.
Modified:
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/GetInvoiceItemTypes.groovy
Modified:
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/GetInvoiceItemTypes.groovy
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/GetInvoiceItemTypes.groovy?rev=796948&r1=796947&r2=796948&view=diff
==============================================================================
---
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/GetInvoiceItemTypes.groovy
(original)
+++
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/GetInvoiceItemTypes.groovy
Thu Jul 23 05:13:11 2009
@@ -62,6 +62,15 @@
itemTypesCond = EntityCondition.makeCondition(itemTypes,
EntityOperator.OR);
invoiceItemTypes = delegator.findList("InvoiceItemType", itemTypesCond,
null, ["parentTypeId", "invoiceItemTypeId"], null, false);
glAccountOrganizationAndClassList =
delegator.findByAnd("GlAccountOrganizationAndClass", [organizationPartyId :
invoice.partyId]);
+} else if ("COMMISSION_INVOICE".equals(invoice.invoiceTypeId)) {
+ List itemTypes = FastList.newInstance();
+ itemTypes.add(EntityCondition.makeCondition("invoiceItemTypeId",
EntityOperator.EQUALS, "COMM_INV_ITEM"));
+ itemTypes.add(EntityCondition.makeCondition("parentTypeId",
EntityOperator.EQUALS, "COMM_INV_ITEM"));
+ itemTypes.add(EntityCondition.makeCondition("invoiceItemTypeId",
EntityOperator.EQUALS, "COMM_INV_ADJ"));
+ itemTypes.add(EntityCondition.makeCondition("parentTypeId",
EntityOperator.EQUALS, "COMM_INV_ADJ"));
+ itemTypesCond = EntityCondition.makeCondition(itemTypes,
EntityOperator.OR);
+ invoiceItemTypes = delegator.findList("InvoiceItemType", itemTypesCond,
null, ["parentTypeId", "invoiceItemTypeId"], null, false);
+ glAccountOrganizationAndClassList =
delegator.findByAnd("GlAccountOrganizationAndClass", [organizationPartyId :
invoice.partyId]);
} else {
map = delegator.findByAndCache("InvoiceItemTypeMap", [invoiceTypeId :
invoice.invoiceTypeId]);
invoiceItemTypes = EntityUtil.getRelated("InvoiceItemType", map);