Author: jacopoc
Date: Tue Apr 22 06:58:57 2008 New Revision: 650523 URL: http://svn.apache.org/viewvc?rev=650523&view=rev Log: The list of accounts in the edit items screen is now showing the accounts available for the company. Thanks to Brajesh Patel for the patch; OFBIZ-1744 Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/getInvoiceItemTypes.bsh ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/getInvoiceItemTypes.bsh URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/getInvoiceItemTypes.bsh?rev=650523&r1=650522&r2=650523&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/getInvoiceItemTypes.bsh (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/getInvoiceItemTypes.bsh Tue Apr 22 06:58:57 2008 @@ -27,7 +27,7 @@ invoice = context.get("invoice"); if (invoice == null) return; - +glAccountOrganizationAndClassList = null; if ("SALES_INVOICE".equals(invoice.get("invoiceTypeId"))) { List parentTypes = FastList.newInstance(); parentTypes.add(new EntityExpr("parentTypeId", EntityOperator.EQUALS, "INVOICE_ADJ")); @@ -35,6 +35,7 @@ parentTypes.add(new EntityExpr("parentTypeId", EntityOperator.EQUALS, "INV_PROD_ITEM")); parentTypesCond = new EntityConditionList(parentTypes, EntityOperator.OR); invoiceItemTypes = delegator.findByCondition("InvoiceItemType", parentTypesCond, null, UtilMisc.toList("parentTypeId", "invoiceItemTypeId")); + glAccountOrganizationAndClassList = delegator.findByAnd("GlAccountOrganizationAndClass", UtilMisc.toMap("organizationPartyId", invoice.get("partyIdFrom"))); } else if ("PURCHASE_INVOICE".equals(invoice.get("invoiceTypeId"))) { List parentTypes = FastList.newInstance(); parentTypes.add(new EntityExpr("parentTypeId", EntityOperator.EQUALS, "PINVOICE_ADJ")); @@ -42,8 +43,11 @@ parentTypes.add(new EntityExpr("parentTypeId", EntityOperator.EQUALS, "PINV_PROD_ITEM")); parentTypesCond = new EntityConditionList(parentTypes, EntityOperator.OR); invoiceItemTypes = delegator.findByCondition("InvoiceItemType", parentTypesCond, null, UtilMisc.toList("parentTypeId", "invoiceItemTypeId")); + glAccountOrganizationAndClassList = delegator.findByAnd("GlAccountOrganizationAndClass", UtilMisc.toMap("organizationPartyId", invoice.get("partyId"))); } else { map = delegator.findByAndCache("InvoiceItemTypeMap", UtilMisc.toMap("invoiceTypeId", invoice.get("invoiceTypeId"))); invoiceItemTypes = EntityUtil.getRelated("InvoiceItemType", map); } context.put("invoiceItemTypes", invoiceItemTypes); + +context.put("glAccountOrganizationAndClassList", glAccountOrganizationAndClassList); \ No newline at end of file Modified: ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml?rev=650523&r1=650522&r2=650523&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml Tue Apr 22 06:58:57 2008 @@ -312,9 +312,7 @@ <field name="description"><text size="30"/></field> <field name="overrideGlAccountId"> <drop-down allow-empty="true"> - <entity-options entity-name="GlAccount" description="${glAccountId} ${accountName}" key-field-name="glAccountId"> - <entity-order-by field-name="glAccountId"/> - </entity-options> + <list-options list-name="glAccountOrganizationAndClassList" key-name="glAccountId" description="${glAccountId} ${accountName}"/> </drop-down> </field> <field name="amount" title="${uiLabelMap.AccountingUnitPrice}"><text size="7"/></field> @@ -340,9 +338,7 @@ <field position="1" name="description"><text size="80"/></field> <field position="1" name="overrideGlAccountId"> <drop-down allow-empty="true"> - <entity-options entity-name="GlAccount" description="${glAccountId} ${accountName}" key-field-name="glAccountId"> - <entity-order-by field-name="glAccountId"/> - </entity-options> + <list-options list-name="glAccountOrganizationAndClassList" key-name="glAccountId" description="${glAccountId} ${accountName}"/> </drop-down> </field> <field position="2" name="inventoryItemId"><text/></field> |
Free forum by Nabble | Edit this page |