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 2011/03/25 09:02:00 UTC
svn commit: r1085276 - in /ofbiz/trunk/applications/order:
script/org/ofbiz/order/order/OrderServices.xml servicedef/secas.xml
servicedef/services.xml webapp/ordermgr/order/orderpaymentinfo.ftl
Author: hansbak
Date: Fri Mar 25 08:01:59 2011
New Revision: 1085276
URL: http://svn.apache.org/viewvc?rev=1085276&view=rev
Log:
application between invoice and payment now automatically created when a payment is entered on the sales order before or after completion of the order. Payment information now also shown on the sales order.
Modified:
ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml
ofbiz/trunk/applications/order/servicedef/secas.xml
ofbiz/trunk/applications/order/servicedef/services.xml
ofbiz/trunk/applications/order/webapp/ordermgr/order/orderpaymentinfo.ftl
Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml?rev=1085276&r1=1085275&r2=1085276&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml (original)
+++ ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml Fri Mar 25 08:01:59 2011
@@ -1441,4 +1441,21 @@ under the License.
</iterate>
<field-to-result field="availabalityList"/>
</simple-method>
+
+ <simple-method method-name="createOrderPaymentApplication" short-description="Create Order Payment Application">
+ <entity-one value-field="paymentMap" entity-name="Payment"/>
+ <set field="createCtx.amountApplied" from-field="paymentMap.amount" type="BigDecimal"/>
+ <set field="createCtx.paymentId" from-field="paymentMap.paymentId"/>
+ <entity-one value-field="orderPaymentPreMap" entity-name="OrderPaymentPreference">
+ <field-map field-name="orderPaymentPreferenceId" from-field="paymentMap.paymentPreferenceId"/>
+ </entity-one>
+ <entity-and list="orderItemBilList" entity-name="OrderItemBilling">
+ <field-map field-name="orderId" from-field="orderPaymentPreMap.orderId"/>
+ <order-by field-name="invoiceId"/>
+ </entity-and>
+ <if-not-empty field="orderItemBilList">
+ <set field="createCtx.invoiceId" from-field="orderItemBilList[0].invoiceId"/>
+ <call-service service-name="createPaymentApplication" in-map-name="createCtx"/>
+ </if-not-empty>
+ </simple-method>
</simple-methods>
Modified: ofbiz/trunk/applications/order/servicedef/secas.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/secas.xml?rev=1085276&r1=1085275&r2=1085276&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/servicedef/secas.xml (original)
+++ ofbiz/trunk/applications/order/servicedef/secas.xml Fri Mar 25 08:01:59 2011
@@ -420,4 +420,10 @@ under the License.
<eca service="createUpdateCustomerAndShippingAddress" event="invoke">
<action service="setAnonUserLogin" mode="sync"/>
</eca>
+
+ <!-- Use for link the payment and the invoice When Received Payment -->
+ <eca service="createPaymentFromPreference" event="commit">
+ <condition field-name="paymentId" operator="is-not-empty"/>
+ <action service="createOrderPaymentApplication" mode="sync"/>
+ </eca>
</service-eca>
Modified: ofbiz/trunk/applications/order/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/services.xml?rev=1085276&r1=1085275&r2=1085276&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/order/servicedef/services.xml Fri Mar 25 08:01:59 2011
@@ -1115,4 +1115,11 @@ under the License.
</description>
<auto-attributes mode="IN" include="pk" optional="false"/>
</service>
+
+ <!-- Use for link the payment and the invoice When Received Payment -->
+ <service name="createOrderPaymentApplication" engine="simple" auth="true"
+ location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="createOrderPaymentApplication">
+ <description>Create Order Payment Application</description>
+ <attribute name="paymentId" type="String" mode="IN" optional="false"/>
+ </service>
</services>
Modified: ofbiz/trunk/applications/order/webapp/ordermgr/order/orderpaymentinfo.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderpaymentinfo.ftl?rev=1085276&r1=1085275&r2=1085276&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/order/orderpaymentinfo.ftl (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/order/orderpaymentinfo.ftl Fri Mar 25 08:01:59 2011
@@ -97,6 +97,7 @@ under the License.
<tr><td colspan="4"><hr /></td></tr>
<#if orderPaymentPreferences?has_content || billingAccount?has_content || invoices?has_content>
<#list orderPaymentPreferences as orderPaymentPreference>
+ <#assign paymentList = orderPaymentPreference.getRelated("Payment")>
<#assign pmBillingAddress = {}>
<#assign oppStatusItem = orderPaymentPreference.getRelatedOne("StatusItem")>
<#if outputted?default("false") == "true">
@@ -177,6 +178,21 @@ under the License.
</#if>
</td>
</tr>
+ <#if paymentList?has_content>
+ <tr>
+ <td align="right" valign="top" width="29%">
+ <div> <span class="label">${uiLabelMap.AccountingInvoicePayments}</span></div>
+ </td>
+ <td width="1%"> </td>
+ <td width="60%">
+ <div>
+ <#list paymentList as paymentMap>
+ <a href="/accounting/control/paymentOverview?paymentId=${paymentMap.paymentId}&externalLoginKey=${externalLoginKey}" class="buttontext">${paymentMap.paymentId}</a><#if paymentMap_has_next><br /></#if>
+ </#list>
+ </div>
+ </td>
+ </tr>
+ </#if>
</#if>
<#else>
<tr>
@@ -222,6 +238,21 @@ under the License.
</#if>
</td>
</tr>
+ <#if paymentList?has_content>
+ <tr>
+ <td align="right" valign="top" width="29%">
+ <div> <span class="label">${uiLabelMap.AccountingInvoicePayments}</span></div>
+ </td>
+ <td width="1%"> </td>
+ <td width="60%">
+ <div>
+ <#list paymentList as paymentMap>
+ <a href="/accounting/control/paymentOverview?paymentId=${paymentMap.paymentId}&externalLoginKey=${externalLoginKey}" class="buttontext">${paymentMap.paymentId}</a><#if paymentMap_has_next><br /></#if>
+ </#list>
+ </div>
+ </td>
+ </tr>
+ </#if>
</#if>
<#else>
<#if paymentMethod.paymentMethodTypeId?if_exists == "CREDIT_CARD">
@@ -345,6 +376,21 @@ under the License.
</#if>
</td>
</tr>
+ <#if paymentList?has_content>
+ <tr>
+ <td align="right" valign="top" width="29%">
+ <div> <span class="label">${uiLabelMap.AccountingInvoicePayments}</span></div>
+ </td>
+ <td width="1%"> </td>
+ <td width="60%">
+ <div>
+ <#list paymentList as paymentMap>
+ <a href="/accounting/control/paymentOverview?paymentId=${paymentMap.paymentId}&externalLoginKey=${externalLoginKey}" class="buttontext">${paymentMap.paymentId}</a><#if paymentMap_has_next><br /></#if>
+ </#list>
+ </div>
+ </td>
+ </tr>
+ </#if>
<#elseif paymentMethod.paymentMethodTypeId?if_exists == "GIFT_CARD">
<#assign giftCard = paymentMethod.getRelatedOne("GiftCard")>
<#if giftCard?exists>
@@ -389,6 +435,21 @@ under the License.
</#if>
</td>
</tr>
+ <#if paymentList?has_content>
+ <tr>
+ <td align="right" valign="top" width="29%">
+ <div> <span class="label">${uiLabelMap.AccountingInvoicePayments}</span></div>
+ </td>
+ <td width="1%"> </td>
+ <td width="60%">
+ <div>
+ <#list paymentList as paymentMap>
+ <a href="/accounting/control/paymentOverview?paymentId=${paymentMap.paymentId}&externalLoginKey=${externalLoginKey}" class="buttontext">${paymentMap.paymentId}</a><#if paymentMap_has_next><br /></#if>
+ </#list>
+ </div>
+ </td>
+ </tr>
+ </#if>
</#if>
</#if>
<#if pmBillingAddress?has_content>
@@ -409,6 +470,21 @@ under the License.
</td>
<td width="10%"> </td>
</tr>
+ <#if paymentList?has_content>
+ <tr>
+ <td align="right" valign="top" width="29%">
+ <div> <span class="label">${uiLabelMap.AccountingInvoicePayments}</span></div>
+ </td>
+ <td width="1%"> </td>
+ <td width="60%">
+ <div>
+ <#list paymentList as paymentMap>
+ <a href="/accounting/control/paymentOverview?paymentId=${paymentMap.paymentId}&externalLoginKey=${externalLoginKey}" class="buttontext">${paymentMap.paymentId}</a><#if paymentMap_has_next><br /></#if>
+ </#list>
+ </div>
+ </td>
+ </tr>
+ </#if>
</#if>
</#list>