Applied patch from jira issue OFBIZ-3331 - Restrict Cancelled Financial Account operation on AP New Payment Screen.

Thanks Awdesh & Sumit for the contribution.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@890229 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Ashish Vijaywargiya
2009-12-14 08:55:48 +00:00
parent 141a75160f
commit df7db96318
5 changed files with 41 additions and 15 deletions
@@ -19,6 +19,12 @@
under the License.
-->
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<property key="AccountingFinAccountInactiveStatusError">
<value xml:lang="en">FinAccount must be in active status</value>
</property>
<property key="AccountingFinAccountStatusNotValidError">
<value xml:lang="en">FinAccount not in valid status</value>
</property>
<property key="AccountingPayPalCommunicationError">
<value xml:lang="en">A problem occurred while communicating with PayPal, please try again or select a different checkout method</value>
<value xml:lang="hi_IN">Paypal से संचार में समस्या, कृपया पुन: प्रयास करें या एक अलग Checkout पद्धति का चयन करें</value>
@@ -3284,12 +3284,6 @@
<value xml:lang="th">การอนุญาต</value>
<value xml:lang="zh">授权</value>
</property>
<property key="AccountingFinAccountInactiveStatusError">
<value xml:lang="en">FinAccount must be in active status</value>
</property>
<property key="AccountingFinAccountNotValidError">
<value xml:lang="en">FinAccount not in valid status</value>
</property>
<property key="AccountingFinAccountTransaction">
<value xml:lang="en">Financial Account Transaction</value>
<value xml:lang="hi_IN">वित्तीय खाता लेन-देन</value>
@@ -3952,4 +3952,15 @@ under the License.
<key-map field-name="finAccountTransId"/>
</view-link>
</view-entity>
<view-entity entity-name="PaymentMethodAndFinAccount" package-name="org.ofbiz.accounting.finaccount" title="PaymentMethod and FinAccount view entity">
<member-entity entity-alias="PM" entity-name="PaymentMethod"/>
<member-entity entity-alias="FA" entity-name="FinAccount"/>
<alias-all entity-alias="FA"/>
<alias-all entity-alias="PM">
<exclude field="finAccountId"/>
</alias-all>
<view-link rel-entity-alias="PM" entity-alias="FA">
<key-map field-name="finAccountId"/>
</view-link>
</view-entity>
</entitymodel>
@@ -120,10 +120,10 @@ under the License.
</then>
<else>
<if-compare field="lookedUpValue.statusId" operator="equals" value="FNACT_MANFROZEN">
<add-error><fail-property resource="AccountingUiLabels" property="AccountingFinAccountInactiveStatusError"/></add-error>
<add-error><fail-property resource="AccountingErrorUiLabels" property="AccountingFinAccountInactiveStatusError"/></add-error>
</if-compare>
<if-compare field="lookedUpValue.statusId" operator="equals" value="FNACT_CANCELLED">
<add-error><fail-property resource="AccountingUiLabels" property="AccountingFinAccountNotValidError"/></add-error>
<add-error><fail-property resource="AccountingErrorUiLabels" property="AccountingFinAccountStatusNotValidError"/></add-error>
</if-compare>
<check-errors/>
</else>
@@ -171,10 +171,10 @@ under the License.
<simple-method method-name="createFinAccountTrans" short-description="Create a Financial Account Transaction">
<entity-one entity-name="FinAccount" value-field="finAccount"/>
<if-compare field="finAccount.statusId" operator="equals" value="FNACT_MANFROZEN">
<add-error><fail-property resource="AccountingUiLabels" property="AccountingFinAccountInactiveStatusError"/></add-error>
<add-error><fail-property resource="AccountingErrorUiLabels" property="AccountingFinAccountInactiveStatusError"/></add-error>
</if-compare>
<if-compare field="finAccount.statusId" operator="equals" value="FNACT_CANCELLED">
<add-error><fail-property resource="AccountingUiLabels" property="AccountingFinAccountNotValidError"/></add-error>
<add-error><fail-property resource="AccountingErrorUiLabels" property="AccountingFinAccountStatusNotValidError"/></add-error>
</if-compare>
<check-errors/>
<call-simple-method method-name="getArithmeticSettingsInline"/>
@@ -212,10 +212,10 @@ under the License.
<simple-method method-name="createFinAccountRole" short-description="Create a Financial Account Role">
<entity-one entity-name="FinAccount" value-field="finAccount"/>
<if-compare field="finAccount.statusId" operator="equals" value="FNACT_MANFROZEN">
<add-error><fail-property resource="AccountingUiLabels" property="AccountingFinAccountInactiveStatusError"/></add-error>
<add-error><fail-property resource="AccountingErrorUiLabels" property="AccountingFinAccountInactiveStatusError"/></add-error>
</if-compare>
<if-compare field="finAccount.statusId" operator="equals" value="FNACT_CANCELLED">
<add-error><fail-property resource="AccountingUiLabels" property="AccountingFinAccountNotValidError"/></add-error>
<add-error><fail-property resource="AccountingErrorUiLabels" property="AccountingFinAccountStatusNotValidError"/></add-error>
</if-compare>
<check-errors/>
<make-value value-field="newEntity" entity-name="FinAccountRole"/>
@@ -924,6 +924,16 @@ under the License.
<result-to-field result-name="paymentId"/>
</call-service>
<if-not-empty field="paymentMethod.finAccountId">
<entity-one entity-name="FinAccount" value-field="finAccount">
<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" property="AccountingFinAccountInactiveStatusError"/></add-error>
</if-compare>
<if-compare field="finAccount.statusId" operator="equals" value="FNACT_CANCELLED">
<add-error><fail-property resource="AccountingErrorUiLabels" property="AccountingFinAccountStatusNotValidError"/></add-error>
</if-compare>
<check-errors/>
<if-compare field="parameters.isDepositWithDrawPayment" operator="equals" value="Y">
<set-service-fields service-name="createFinAccountTrans" map="parameters" to-map="createFinAccountTransMap"/>
<set field="createFinAccountTransMap.finAccountId" from-field="paymentMethod.finAccountId"/>
@@ -105,6 +105,13 @@ under the License.
</entity-one>
<set field="partyGroupName" from-field="partyGroup.groupName"/>
<set field="paymentPartyId" from-field="parameters.partyIdFrom" default-value="${defaultOrganizationPartyId}"/>
<entity-condition entity-name="PaymentMethodAndFinAccount" list="paymentMethodAndFinAccounts">
<condition-list>
<condition-expr field-name="partyId" from-field="paymentPartyId"/>
<condition-expr field-name="statusId" operator="not-equals" value="FNACT_MANFROZEN"/>
<condition-expr field-name="statusId" operator="not-equals" value="FNACT_CANCELLED"/>
</condition-list>
</entity-condition>
</actions>
<field name="statusId"><hidden value="PMNT_NOT_PAID"/></field>
<field name="currencyUomId"><hidden value="${defaultOrganizationPartyCurrencyUomId}"/></field>
@@ -118,9 +125,7 @@ under the License.
</field>
<field name="paymentMethodId" id-name="paymentMethodId" position="2">
<drop-down allow-empty="false">
<entity-options entity-name="PaymentMethod" description="${description}" filter-by-date="by-name">
<entity-constraint name="partyId" operator="equals" value="${paymentPartyId}"/>
</entity-options>
<list-options list-name="paymentMethodAndFinAccounts" key-name="paymentMethodId" description="${description}"/>
</drop-down>
</field>
<field name="partyIdTo" position="1"><lookup target-form-name="LookupPartyName"/></field>