You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by le...@apache.org on 2013/06/16 14:51:52 UTC
svn commit: r1493505 - in /ofbiz/trunk/applications/accounting:
webapp/accounting/WEB-INF/actions/admin/ListInvoiceItemTypesGlAccount.groovy
widget/GlSetupForms.xml
Author: lektran
Date: Sun Jun 16 12:51:52 2013
New Revision: 1493505
URL: http://svn.apache.org/r1493505
Log:
FIX: The Sales/Purchase Invoice GlAccount Override screen would always so the Remove button even when no overrides were in place
Modified:
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/admin/ListInvoiceItemTypesGlAccount.groovy
ofbiz/trunk/applications/accounting/widget/GlSetupForms.xml
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=1493505&r1=1493504&r2=1493505&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:51:52 2013
@@ -34,7 +34,7 @@ invoiceItemTypes = delegator.findList("I
allTypes = [];
invoiceItemTypes.each { invoiceItemType ->
activeGlDescription = "";
- remove = " ";
+ defaultAccount = true
glAccounts = null;
glAccount = null;
invoiceItemTypeOrgs = invoiceItemType.getRelated("InvoiceItemTypeGlAccount", [organizationPartyId : organizationPartyId], null, false);
@@ -46,6 +46,7 @@ invoiceItemTypes.each { invoiceItemType
glAccounts = invoiceItemTypeOrg.getRelated("GlAccount", null, null, false);
if (glAccounts) {
glAccount = glAccounts[0];
+ defaultAccount = false
}
} else {
glAccount = invoiceItemType.getRelatedOne("DefaultGlAccount", false);
@@ -53,14 +54,13 @@ invoiceItemTypes.each { invoiceItemType
if (glAccount) {
activeGlDescription = glAccount.accountName;
- remove = "Remove";
}
allTypes.add([invoiceItemTypeId : invoiceItemType.invoiceItemTypeId,
description : invoiceItemType.description,
defaultGlAccountId : invoiceItemType.defaultGlAccountId,
overrideGlAccountId : overrideGlAccountId,
- remove : remove,
+ defaultAccount : defaultAccount,
activeGlDescription : activeGlDescription]);
}
context.invoiceItemTypes = allTypes;
Modified: ofbiz/trunk/applications/accounting/widget/GlSetupForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/GlSetupForms.xml?rev=1493505&r1=1493504&r2=1493505&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/GlSetupForms.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/GlSetupForms.xml Sun Jun 16 12:51:52 2013
@@ -415,7 +415,7 @@ under the License.
</field>
<field name="overrideGlAccountId"><display/></field>
<field name="activeGlDescription"><display/></field>
- <field name="remove" title=" " widget-style="buttontext">
+ <field name="remove" title=" " widget-style="buttontext" use-when="defaultAccount==false">
<hyperlink target="removeSalInvoiceItemTypeGlAssignment" description="${uiLabelMap.CommonRemove}">
<parameter param-name="organizationPartyId"/><parameter param-name="invoiceItemTypeId"/>
</hyperlink>
@@ -469,7 +469,7 @@ under the License.
</field>
<field name="overrideGlAccountId" title="${uiLabelMap.AccountingInvoiceOverrideExpenseGlAccountId}"><display/></field>
<field name="activeGlDescription"><display/></field>
- <field name="remove" title=" " widget-style="buttontext">
+ <field name="remove" title=" " widget-style="buttontext" use-when="defaultAccount==false">
<hyperlink target="removePurInvoiceItemTypeGlAssignment" description="${uiLabelMap.CommonRemove}">
<parameter param-name="organizationPartyId"/><parameter param-name="invoiceItemTypeId"/>
</hyperlink>