svn commit: r428529 - in /incubator/ofbiz/trunk/applications/accounting: config/AccountingUiLabels.properties script/org/ofbiz/accounting/payment/PaymentServices.xml servicedef/services_payment.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r428529 - in /incubator/ofbiz/trunk/applications/accounting: config/AccountingUiLabels.properties script/org/ofbiz/accounting/payment/PaymentServices.xml servicedef/services_payment.xml

sichen
Author: sichen
Date: Thu Aug  3 14:14:58 2006
New Revision: 428529

URL: http://svn.apache.org/viewvc?rev=428529&view=rev
Log:
OFBIZ-132:  Make paymentMethodTypeId optional and get it from paymentMethod.  If neither is supplied, then return an error.  Thanks to Ashish Vijaywargiya

Modified:
    incubator/ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties
    incubator/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml
    incubator/ofbiz/trunk/applications/accounting/servicedef/services_payment.xml

Modified: incubator/ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties?rev=428529&r1=428528&r2=428529&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties (original)
+++ incubator/ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties Thu Aug  3 14:14:58 2006
@@ -384,6 +384,7 @@
 AccountingViewPermissionError=You do not have permission to view this page. ("ACCOUNTING_VIEW" or "ACCOUNTING_ADMIN" needed)
 AccountingFX=Foreign Exchange Rates
 AccountingDataSourceError=Data source error
+AccountingPaymentMethodIdPaymentMethodTypeIdNullError=No values are passed for paymentMethodId or paymentMethodTypeId. At least pass paymentMethodId.
 
 AccountingNewFixedAssetIdents=Create Fixed Asset Identification
 AccountingNewFixedAssetIdentsType=Create Fixed Asset Identification Type

Modified: incubator/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml?rev=428529&r1=428528&r2=428529&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml (original)
+++ incubator/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml Thu Aug  3 14:14:58 2006
@@ -41,11 +41,26 @@
         </if-empty>
         <field-to-result field-name="payment.paymentId" result-name="paymentId"/>
         
+        <if-not-empty field-name="parameters.paymentMethodId">
+            <if-empty field-name="parameters.paymentMethodTypeId">
+                <entity-one entity-name="PaymentMethod" value-name="paymentMethod">
+                    <field-map field-name="paymentMethodId" env-name="parameters.paymentMethodId"/>
+                </entity-one>      
+                <set field="parameters.paymentMethodTypeId" from-field="paymentMethod.paymentMethodTypeId"/>        
+            </if-empty>        
+        </if-not-empty>        
+        <if-empty field-name="parameters.paymentMethodId">
+           <if-empty field-name="parameters.paymentMethodTypeId">
+             <add-error>
+                <fail-property resource="AccountingUiLabels" property="AccountingPaymentMethodIdPaymentMethodTypeIdNullError"/>
+             </add-error>              
+           </if-empty>
+        </if-empty>  
+        
         <set-nonpk-fields map-name="parameters" value-name="payment"/>
         <if-empty field-name="payment.effectiveDate">
             <now-timestamp-to-env env-name="payment.effectiveDate"/>
         </if-empty>
-        
         <create-value value-name="payment"/>
     </simple-method>
     <simple-method method-name="updatePayment" short-description="Update a Payment">

Modified: incubator/ofbiz/trunk/applications/accounting/servicedef/services_payment.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/accounting/servicedef/services_payment.xml?rev=428529&r1=428528&r2=428529&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/accounting/servicedef/services_payment.xml (original)
+++ incubator/ofbiz/trunk/applications/accounting/servicedef/services_payment.xml Thu Aug  3 14:14:58 2006
@@ -24,11 +24,11 @@
     <!-- Payment services -->
     <service name="createPayment" engine="simple" default-entity-name="Payment"
         location="org/ofbiz/accounting/payment/PaymentServices.xml" invoke="createPayment" auth="true">
-        <description>Create a Payment</description>
+        <description>Create a Payment.  If a paymentMethodId is supplied, paymentMethodTypeId is gotten from paymentMethod.  Otherwise, it must be supplied.  If no
+        paymentMethodTypeId and no paymentMethodId is supplied, then an error will be returned. </description>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
         <auto-attributes include="pk" mode="INOUT" optional="true"/>
         <override name="paymentTypeId" optional="false"/>
-        <override name="paymentMethodTypeId" optional="false"/>
         <override name="partyIdFrom" optional="false"/>
         <override name="partyIdTo" optional="false"/>
         <override name="statusId" optional="false"/>