From deec93e27bb95fc431e139549d34ffc56fe1d59e Mon Sep 17 00:00:00 2001 From: Si Chen Date: Thu, 21 Dec 2006 01:14:09 +0000 Subject: [PATCH] Fixed invoice item type dropdown to be more flexible. Now it shows the item types for a given invoice type instead of using a non-extensible heuristic. git-svn-id: https://svn.apache.org/repos/asf/incubator/ofbiz/trunk@489239 13f79535-47bb-0310-9956-ffa450edef68 --- .../actions/invoice/getInvoiceItemTypes.bsh | 25 ++++++++++ .../accounting/invoice/InvoiceForms.xml | 46 ++----------------- .../accounting/widget/InvoiceScreens.xml | 1 + 3 files changed, 30 insertions(+), 42 deletions(-) create mode 100644 applications/accounting/webapp/accounting/WEB-INF/actions/invoice/getInvoiceItemTypes.bsh diff --git a/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/getInvoiceItemTypes.bsh b/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/getInvoiceItemTypes.bsh new file mode 100644 index 0000000000..d64ffe08cb --- /dev/null +++ b/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/getInvoiceItemTypes.bsh @@ -0,0 +1,25 @@ +/* + * Copyright 2005-2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.entity.util.EntityUtil; + +invoice = context.get("invoice"); +if (invoice == null) return; + +map = delegator.findByAndCache("InvoiceItemTypeMap", UtilMisc.toMap("invoiceTypeId", invoice.get("invoiceTypeId"))); +invoiceItemTypes = EntityUtil.getRelated("InvoiceItemType", map); +context.put("invoiceItemTypes", invoiceItemTypes); diff --git a/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml b/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml index 57d4fa412e..ed5ae05bb0 100644 --- a/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml +++ b/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml @@ -248,32 +248,13 @@ under the License. - + - - - - + - - - - - - - - - - - - - - - - @@ -292,31 +273,12 @@ under the License. - + - - - - + - - - - - - - - - - - - - - - - diff --git a/applications/accounting/widget/InvoiceScreens.xml b/applications/accounting/widget/InvoiceScreens.xml index e73e4bbfba..40c15e6d36 100644 --- a/applications/accounting/widget/InvoiceScreens.xml +++ b/applications/accounting/widget/InvoiceScreens.xml @@ -235,6 +235,7 @@ under the License. +