Author: lektran
Date: Sun Jun 16 12:57:18 2013
New Revision: 1493506
URL:
http://svn.apache.org/r1493506Log:
Groovy script cleanup, no functional changes
Modified:
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/admin/ListInvoiceItemTypesGlAccount.groovy
Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/admin/ListInvoiceItemTypesGlAccount.groovy
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/admin/ListInvoiceItemTypesGlAccount.groovy?rev=1493506&r1=1493505&r2=1493506&view=diff==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/admin/ListInvoiceItemTypesGlAccount.groovy (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/admin/ListInvoiceItemTypesGlAccount.groovy Sun Jun 16 12:57:18 2013
@@ -31,14 +31,12 @@ invItemTypePrefix += "_%";
organizationPartyId = parameters.organizationPartyId;
exprBldr = new EntityConditionBuilder();
invoiceItemTypes = delegator.findList("InvoiceItemType", exprBldr.LIKE(invoiceItemTypeId: invItemTypePrefix), null, null, null, false);
-allTypes = [];
-invoiceItemTypes.each { invoiceItemType ->
- activeGlDescription = "";
+
+context.invoiceItemTypes = invoiceItemTypes.collect { invoiceItemType ->
defaultAccount = true
- glAccounts = null;
glAccount = null;
invoiceItemTypeOrgs = invoiceItemType.getRelated("InvoiceItemTypeGlAccount", [organizationPartyId : organizationPartyId], null, false);
- overrideGlAccountId = " ";
+ overrideGlAccountId = null
if (invoiceItemTypeOrgs) {
invoiceItemTypeOrg = invoiceItemTypeOrgs[0];
overrideGlAccountId = invoiceItemTypeOrg.glAccountId;
@@ -52,15 +50,10 @@ invoiceItemTypes.each { invoiceItemType
glAccount = invoiceItemType.getRelatedOne("DefaultGlAccount", false);
}
- if (glAccount) {
- activeGlDescription = glAccount.accountName;
- }
-
- allTypes.add([invoiceItemTypeId : invoiceItemType.invoiceItemTypeId,
+ return [invoiceItemTypeId : invoiceItemType.invoiceItemTypeId,
description : invoiceItemType.description,
defaultGlAccountId : invoiceItemType.defaultGlAccountId,
overrideGlAccountId : overrideGlAccountId,
defaultAccount : defaultAccount,
- activeGlDescription : activeGlDescription]);
+ activeGlDescription : glAccount?.accountName];
}
-context.invoiceItemTypes = allTypes;