You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ha...@apache.org on 2007/05/20 05:50:20 UTC

svn commit: r539822 - in /ofbiz/trunk/applications/accounting: config/ script/org/ofbiz/accounting/payment/ webapp/accounting/WEB-INF/ webapp/accounting/payment/ widget/

Author: hansbak
Date: Sat May 19 20:50:19 2007
New Revision: 539822

URL: http://svn.apache.org/viewvc?view=rev&rev=539822
Log:
creation of a payment now on separate screens, allow the status change also from the editpayment detail screen

Modified:
    ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties
    ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml
    ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml
    ofbiz/trunk/applications/accounting/webapp/accounting/payment/PaymentForms.xml
    ofbiz/trunk/applications/accounting/widget/Menus.xml
    ofbiz/trunk/applications/accounting/widget/PaymentScreens.xml

Modified: ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties?view=diff&rev=539822&r1=539821&r2=539822
==============================================================================
--- ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties (original)
+++ ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties Sat May 19 20:50:19 2007
@@ -274,6 +274,8 @@
 AccountingNewFixedAssetMaint=New Maintenance
 AccountingNewFixedAssetStdCost=New Standard Cost
 AccountingNewPayment=New Payment
+AccountingNewPaymentIncoming=New incoming payment
+AccountingNewPaymentOutgoing=New outgoing payment
 AccountingNewTaxAuthority=New Tax Authority
 AccountingNewTaxAuthorityPartyInfo=New Tax Authority Party Info
 AccountingNoAccount=No Account

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?view=diff&rev=539822&r1=539821&r2=539822
==============================================================================
--- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml (original)
+++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml Sat May 19 20:50:19 2007
@@ -86,9 +86,19 @@
         <check-errors/>
         
         <if-compare field-name="payment.statusId" value="PMNT_NOT_PAID" operator="not-equals">
-            <add-error>
-                <fail-property resource="AccountingUiLabels" property="AccountingPSUpdateNotAllowedBecauseOfStatus"/>
-            </add-error>
+            <!-- check if only status change -->
+            <make-value value-name="newPayment" entity-name="Payment"/>
+            <make-value value-name="oldPayment" entity-name="Payment"/>
+            <set-nonpk-fields value-name="newPayment" map-name="payment"/>
+            <set-nonpk-fields value-name="oldPayment" map-name="payment"/>
+            <set-nonpk-fields value-name="newPayment" map-name="parameters"/>
+            <set field="newPayment.statusId" from-field="oldPayment.statusId"/>
+            <if-compare-field field-name="oldPayment"  to-field-name="newPayment" operator="not-equals">
+                <log level="always" message="=========Old: ${oldPayment} ============New: ${newPayment}"></log>
+                <add-error>
+                    <fail-property resource="AccountingUiLabels" property="AccountingPSUpdateNotAllowedBecauseOfStatus"/>
+                </add-error>
+            </if-compare-field>
         </if-compare>
         <check-errors/>
         
@@ -101,9 +111,9 @@
         </if-empty>
         <store-value value-name="payment"/>
         
-        <if-not-empty field-name="parameters.StatusId">
+        <if-not-empty field-name="parameters.statusId">
             <if-compare-field field-name="parameters.statusId" operator="not-equals" to-field-name="statusIdSave">
-                <set-service-fields service-name="setPaymentSatus" map-name="parameters" to-map-name="param"/>
+                <set-service-fields service-name="setPaymentStatus" map-name="parameters" to-map-name="param"/>
                 <call-service service-name="setPaymentStatus" in-map-name="param"/>
                 <check-errors/>
             </if-compare-field>

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml?view=diff&rev=539822&r1=539821&r2=539822
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml Sat May 19 20:50:19 2007
@@ -298,6 +298,10 @@
         <security https="true" auth="true"/>
         <response name="success" type="view" value="findPayments"/>
     </request-map>
+    <request-map uri="newPayment">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="newPayment"/>
+    </request-map> 
     <request-map uri="editPayment">
         <security https="true" auth="true"/>
         <response name="success" type="view" value="editPayment"/>
@@ -305,8 +309,8 @@
     <request-map uri="createPayment">
         <security https="true" auth="true"/>
         <event type="service" invoke="createPayment"/>
-        <response name="success" type="view" value="editPaymentApplications"/>
-        <response name="error" type="view" value="editPayment"/>
+        <response name="success" type="view" value="editPayment"/>
+        <response name="error" type="view" value="newPayment"/>
     </request-map>
     <request-map uri="updatePayment">
         <security https="true" auth="true"/>
@@ -1355,6 +1359,7 @@
     <!-- Payment -->
     <view-map name="findPayments" type="screen" page="component://accounting/widget/PaymentScreens.xml#FindPayments"/>
     <view-map name="paymentOverview" type="screen" page="component://accounting/widget/PaymentScreens.xml#PaymentOverview"/>
+    <view-map name="newPayment" type="screen" page="component://accounting/widget/PaymentScreens.xml#NewPayment"/>
     <view-map name="editPayment" type="screen" page="component://accounting/widget/PaymentScreens.xml#EditPayment"/>
     <view-map name="editPaymentApplications" type="screen" page="component://accounting/widget/PaymentScreens.xml#EditPaymentApplications"/>
     <view-map name="ManualTransaction" type="screen" page="component://accounting/widget/PaymentScreens.xml#ManualTransaction"/>

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/payment/PaymentForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/payment/PaymentForms.xml?view=diff&rev=539822&r1=539821&r2=539822
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/payment/PaymentForms.xml (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/payment/PaymentForms.xml Sat May 19 20:50:19 2007
@@ -73,8 +73,88 @@
         <field name="amountToApply"><display also-hidden="false" type="currency" currency="${currencyUomId}"/></field>
     </form>
 
+    <form name="NewPaymentOut" type="single" target="createPayment" default-map-name="payment">
+        <field name="statusId"><hidden value="PMNT_NOT_PAID"/></field>
+        <field position="1" name="organizationPartyId" parameter-name="partyIdFrom">
+            <drop-down allow-empty="false">
+                <entity-options description="${partyId}" entity-name="PartyAcctgPreference" key-field-name="partyId">
+                    <entity-order-by field-name="partyId"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="partyIdTo" position="2"><lookup target-form-name="LookupPartyName"/></field>
+        <field position="1" name="paymentTypeId">
+            <drop-down allow-empty="false">
+                <entity-options description="${description}" entity-name="PaymentType">
+                    <entity-order-by field-name="description"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field position="2" name="paymentMethodTypeId">
+            <drop-down allow-empty="false">
+                <entity-options entity-name="PaymentMethodType"  description="${description}">
+                    <entity-order-by field-name="description"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="amount" position="1"><text/></field>
+        <field position="2" name="currencyUomId" >
+            <drop-down allow-empty="true" no-current-selected-key="${defaultCurrencyUomId}">
+                <entity-options key-field-name="uomId" description="${abbreviation} - ${description}" entity-name="Uom">
+                    <entity-constraint name="uomTypeId" operator="equals" value="CURRENCY_MEASURE"/>
+                    <entity-order-by field-name="description"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field position="1" name="createButton" widget-style="smallSubmit">
+            <submit button-type="button"/>
+        </field>
+    </form>
+    <form name="NewPaymentIn" type="single" target="createPayment" default-map-name="payment">
+        <field name="statusId"><hidden value="PMNT_NOT_PAID"/></field>
+        <field position="1" name="organizationPartyId" parameter-name="partyIdTo">
+            <drop-down allow-empty="false">
+                <entity-options description="${partyId}" entity-name="PartyAcctgPreference" key-field-name="partyId">
+                    <entity-order-by field-name="partyId"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="partyIdFrom" position="2"><lookup target-form-name="LookupPartyName"/></field>
+        <field position="1" name="paymentTypeId">
+            <drop-down allow-empty="false">
+                <entity-options description="${description}" entity-name="PaymentType">
+                    <entity-order-by field-name="description"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field position="2" name="paymentMethodTypeId">
+            <drop-down allow-empty="false">
+                <entity-options entity-name="PaymentMethodType"  description="${description}">
+                    <entity-order-by field-name="description"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="amount" position="1"><text/></field>
+        <field position="2" name="currencyUomId" >
+            <drop-down allow-empty="true" no-current-selected-key="${defaultCurrencyUomId}">
+                <entity-options key-field-name="uomId" description="${abbreviation} - ${description}" entity-name="Uom">
+                    <entity-constraint name="uomTypeId" operator="equals" value="CURRENCY_MEASURE"/>
+                    <entity-order-by field-name="description"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field position="1" name="createButton" widget-style="smallSubmit">
+            <submit button-type="button"/>
+        </field>
+    </form>
+    
     <form name="EditPayment" type="single" target="updatePayment" default-map-name="payment">
-        <alt-target use-when="payment==null" target="createPayment"/>
+        <actions>
+            <entity-one entity-name="StatusItem" value-name="currentStatus">
+                <field-map field-name="statusId" env-name="payment.statusId"/>
+            </entity-one>
+        </actions>
+        <auto-fields-entity entity-name="Payment"/>
         <field name="paymentId"><hidden/></field>
         <field position="1" name="paymentTypeId">
             <drop-down allow-empty="false">
@@ -90,12 +170,15 @@
                 </entity-options>
             </drop-down>
         </field>
-        <field name="statusId" use-when="payment!=null" position="1"><display-entity entity-name="StatusItem"/></field>
-        <field name="statusId" use-when="payment==null"><hidden value="PMNT_NOT_PAID"/></field>
-        <field position="2" name="paymentMethodId" use-when="(payment==null)||(payment.get(&quot;partyIdFrom&quot;)==null)">
-            <text/>
+        <field name="statusId" position="1">
+            <drop-down allow-empty="false" current-description="${currentStatus.description}">
+                <entity-options entity-name="StatusValidChangeToDetail" key-field-name="statusIdTo" description="${transitionName} (${description})">
+                    <entity-constraint name="statusId" value="${payment.statusId}"/>
+                    <entity-order-by field-name="sequenceId"/>
+                </entity-options>
+            </drop-down>
         </field>
-        <field position="2" name="paymentMethodId" use-when="(payment!=null)&amp;&amp;(payment.get(&quot;partyIdFrom&quot;)!=null)">
+        <field position="1" name="paymentMethodId">
             <drop-down allow-empty="false">
                 <entity-options  key-field-name="paymentMethodId" entity-name="PaymentMethod" description="${paymentMethodTypeId} (${paymentMethodId})">
                     <entity-constraint name="partyId" operator="equals" value="${payment.partyIdFrom}"/>
@@ -103,10 +186,17 @@
                 </entity-options>
             </drop-down>
         </field>
+        <field name="roleTypeIdTo" position="2">
+            <drop-down allow-empty="true">
+                <entity-options  key-field-name="roleTypeId" description="${description}" entity-name="RoleType">
+                    <entity-order-by field-name="roleTypeId"/>
+                </entity-options>
+            </drop-down>
+        </field>
         <field name="partyIdFrom" position="1"><lookup target-form-name="LookupPartyName"/></field>
         <field name="partyIdTo" position="2"><lookup target-form-name="LookupPartyName"/></field>
         <field name="amount" position="1"><text/></field>
-        <field position="2" name="currencyUomId" >
+        <field position="2" name="currencyUomId">
             <drop-down allow-empty="true" no-current-selected-key="${defaultCurrencyUomId}">
                 <entity-options key-field-name="uomId" description="${abbreviation} - ${description}" entity-name="Uom">
                     <entity-constraint name="uomTypeId" operator="equals" value="CURRENCY_MEASURE"/>
@@ -114,22 +204,25 @@
                 </entity-options>
             </drop-down>
         </field>
-        <field name="effectiveDate" position="1"><date-time/></field>
-        <field name="comments" position="2"><text/></field>
-        <field name="paymentRefNum" position="1"><text/></field>
-        <field name="paymentPreferenceId" position="2"><text/></field>
-        <!--field name="paymentGatewayResponseId" title="Paym Gatw Resp." position="2"><display/></field-->
-        <field name="roleTypeIdTo">
-            <drop-down allow-empty="true">
-                <entity-options  key-field-name="roleTypeId" description="${description}" entity-name="RoleType">
-                    <entity-order-by field-name="roleTypeId"/>
+        <field name="actualAmount" position="1"><text/></field>
+        <field position="2" name="actualCurrencyUomId">
+            <drop-down allow-empty="true" no-current-selected-key="${defaultCurrencyUomId}">
+                <entity-options key-field-name="uomId" description="${abbreviation} - ${description}" entity-name="Uom">
+                    <entity-constraint name="uomTypeId" operator="equals" value="CURRENCY_MEASURE"/>
+                    <entity-order-by field-name="description"/>
                 </entity-options>
             </drop-down>
         </field>
+        <field name="effectiveDate" position="2"><date-time/></field>
+        <field name="comments" position="2"><text/></field>
+        <field name="paymentRefNum" position="1"><text/></field>
+        <field name="paymentPreferenceId"><ignored/></field>
+        <field name="paymentGatewayResponseId"><ignored/></field>
         <field name="finAccountTransId" position="1"><text/></field>
         <field name="overrideGlAccountId" position="2"><lookup target-form-name="LookupGlAccount"/></field>
-        <field position="1" use-when="payment==null" name="createButton" title="${uiLabelMap.CommonCreate}" widget-style="smallSubmit"><submit button-type="button"/></field>
-        <field position="1" use-when="payment!=null" name="updateButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit button-type="button"/></field>
+        <field name="finAccountTransId"><ignored/></field>
+        <field name="actualAmount"><ignored/></field>
+        <field position="1" name="updateButton" widget-style="smallSubmit"><submit button-type="button"/></field>
     </form>
     
     <form name="editPaymentApplicationsInv" default-entity-name="PaymentApplication" list-name="paymentApplicationsInv" target="updatePaymentApplication" type="list" separate-columns="false">

Modified: ofbiz/trunk/applications/accounting/widget/Menus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/Menus.xml?view=diff&rev=539822&r1=539821&r2=539822
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/Menus.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/Menus.xml Sat May 19 20:50:19 2007
@@ -249,6 +249,8 @@
                     <not><if-empty field-name="payment.paymentId"/></not>
                     <or>
                         <if-compare field-name="payment.statusId" operator="equals" value="PMNT_NOT_PAID"/>
+                        <if-compare field-name="payment.statusId" operator="equals" value="PMNT_RECEIVED"/>
+                        <if-compare field-name="payment.statusId" operator="equals" value="PMNT_SENT"/>
                     </or>                
                 </and>
             </condition>
@@ -277,7 +279,7 @@
             <condition>
                 <not><if-empty field-name="payment.paymentId"/></not>
             </condition>
-            <link target="editPayment"/>
+            <link target="newPayment"/>
         </menu-item>
         <menu-item name="statusToSend" title="${uiLabelMap.AccountingPaymentTabStatusToSent}">
             <condition>

Modified: ofbiz/trunk/applications/accounting/widget/PaymentScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/PaymentScreens.xml?view=diff&rev=539822&r1=539821&r2=539822
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/PaymentScreens.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/PaymentScreens.xml Sat May 19 20:50:19 2007
@@ -32,10 +32,35 @@
             <widgets>
                 <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
-                        <container><link target="editPayment" text="${uiLabelMap.CommonCreateNew} ${uiLabelMap.AccountingPayment}" style="buttontext"/></container>
+                        <container><link target="newPayment" text="${uiLabelMap.CommonCreateNew} ${uiLabelMap.AccountingPayment}" style="buttontext"/></container>
                         <container><label style="head1" text="${uiLabelMap.AccountingFindPayments}"/></container>
                         <include-form name="FindPayments" location="component://accounting/webapp/accounting/payment/PaymentForms.xml"/>
                         <include-form name="ListPayments"  location="component://accounting/webapp/accounting/payment/PaymentForms.xml"/>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+    <screen name="NewPayment">
+        <section>
+            <actions>
+                <set field="title" value="Create Payment"/>
+                <set field="titleProperty" value="PageTitleEditPayment"/>
+                <set field="tabButtonItem" value="editPayment"/>
+                <set field="paymentId" from-field="parameters.paymentId"/>
+                <property-to-field field="defaultCurrencyUomId" resource="general" property="currency.uom.id.default" default="USD" />
+            </actions>
+            <widgets>
+                <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <section>
+                            <widgets>
+                                <label style="head1" text="${uiLabelMap.AccountingNewPaymentIncoming}"/>
+                                <include-form name="NewPaymentIn" location="component://accounting/webapp/accounting/payment/PaymentForms.xml"/>
+                                <label style="head1" text="${uiLabelMap.AccountingNewPaymentOutgoing}"/>
+                                <include-form name="NewPaymentOut" location="component://accounting/webapp/accounting/payment/PaymentForms.xml"/>
+                            </widgets>
+                        </section>
                     </decorator-section>
                 </decorator-screen>
             </widgets>