You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by as...@apache.org on 2009/12/15 14:14:38 UTC
svn commit: r890787 - in /ofbiz/trunk/applications/accounting:
script/org/ofbiz/accounting/payment/PaymentServices.xml
webapp/ap/invoices/PurchaseInvoices.ftl
Author: ashish
Date: Tue Dec 15 13:14:38 2009
New Revision: 890787
URL: http://svn.apache.org/viewvc?rev=890787&view=rev
Log:
Applied patch from jira issue OFBIZ-3334 - Deactivated Financial Account should not get displayed in list for Issue Check Run process.
Thanks Surya & Sumit for the contribution.
Modified:
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml
ofbiz/trunk/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl
Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml?rev=890787&r1=890786&r2=890787&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml (original)
+++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml Tue Dec 15 13:14:38 2009
@@ -500,6 +500,17 @@
</simple-method>
<simple-method method-name="createPaymentAndPaymentGroupForInvoices" short-description="Creates Payments, PaymentApplications and PaymentGroup for the same">
+ <entity-one entity-name="PaymentMethod" value-field="paymentMethod" auto-field-map="true"/>
+ <entity-one entity-name="FinAccount" value-field="finAccount" auto-field-map="false">
+ <field-map field-name="finAccountId" from-field="paymentMethod.finAccountId"/>
+ </entity-one>
+ <if-compare field="finAccount.statusId" operator="equals" value="FNACT_MANFROZEN">
+ <add-error><fail-property resource="AccountingErrorUiLabels.xml" property="AccountingFinAccountInactiveStatusError"/></add-error>
+ </if-compare>
+ <if-compare field="finAccount.statusId" operator="equals" value="FNACT_CANCELLED">
+ <add-error><fail-property resource="AccountingErrorUiLabels.xml" property="AccountingFinAccountStatusNotValidError"/></add-error>
+ </if-compare>
+ <check-errors/>
<set field="invoices" type="List"/>
<iterate list="parameters.invoiceIds" entry="invoiceId">
<entity-one entity-name="Invoice" value-field="invoice" auto-field-map="true"/>
@@ -511,7 +522,6 @@
<clear-field field="invoices"/>
<iterate-map map="partyInvoices" key="partyId" value="invoices">
<set-service-fields service-name="createPaymentAndApplicationForParty" map="parameters" to-map="createPaymentAndApplicationForPartyMap"/>
- <entity-one entity-name="PaymentMethod" value-field="paymentMethod" auto-field-map="true"/>
<set field="createPaymentAndApplicationForPartyMap.paymentMethodTypeId" from-field="paymentMethod.paymentMethodTypeId"/>
<set field="createPaymentAndApplicationForPartyMap.finAccountId" from-field="paymentMethod.finAccountId"/>
<set field="createPaymentAndApplicationForPartyMap.partyId" from-field="partyId"/>
Modified: ofbiz/trunk/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl?rev=890787&r1=890786&r2=890787&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl (original)
+++ ofbiz/trunk/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl Tue Dec 15 13:14:38 2009
@@ -125,7 +125,14 @@
<select name="paymentMethodId">
<#if paymentMethods?has_content>
<#list paymentMethods as paymentMethod>
- <option value="${paymentMethod.get("paymentMethodId")}"><#if paymentMethod.get("description")?has_content>${paymentMethod.get("description")}</#if>[${paymentMethod.get("paymentMethodId")}]</option>
+ <#if paymentMethod.finAccountId?has_content>
+ <#assign finAccount = delegator.findOne("FinAccount", {"finAccountId" : paymentMethod.finAccountId}, true) />
+ <#if finAccount?has_content>
+ <#if (finAccount.statusId != 'FNACT_MANFROZEN') && (finAccount.statusId != 'FNACT_CANCELLED')>
+ <option value="${paymentMethod.get("paymentMethodId")}"><#if paymentMethod.get("description")?has_content>${paymentMethod.get("description")}</#if>[${paymentMethod.get("paymentMethodId")}]</option>
+ </#if>
+ </#if>
+ </#if>
</#list>
</#if>
</select>