svn commit: r790965 - in /ofbiz/trunk/applications/accounting: config/ webapp/ar/WEB-INF/ webapp/ar/WEB-INF/actions/ webapp/ar/payment/ widget/ar/ widget/ar/forms/

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

svn commit: r790965 - in /ofbiz/trunk/applications/accounting: config/ webapp/ar/WEB-INF/ webapp/ar/WEB-INF/actions/ webapp/ar/payment/ widget/ar/ widget/ar/forms/

ashish-18
Author: ashish
Date: Fri Jul  3 16:50:35 2009
New Revision: 790965

URL: http://svn.apache.org/viewvc?rev=790965&view=rev
Log:
Applied patch from jira issue OFBIZ-2699 (Create Payment Batches for Ar Payment)
Thanks Awdesh, Sumit and Rishi for your contribution.

Added:
    ofbiz/trunk/applications/accounting/webapp/ar/WEB-INF/actions/
    ofbiz/trunk/applications/accounting/webapp/ar/WEB-INF/actions/BatchPayments.groovy   (with props)
    ofbiz/trunk/applications/accounting/webapp/ar/payment/
    ofbiz/trunk/applications/accounting/webapp/ar/payment/batchPayments.ftl   (with props)
    ofbiz/trunk/applications/accounting/widget/ar/ArPaymentScreens.xml   (with props)
    ofbiz/trunk/applications/accounting/widget/ar/forms/ArPaymentForms.xml   (with props)
Modified:
    ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml
    ofbiz/trunk/applications/accounting/webapp/ar/WEB-INF/controller.xml
    ofbiz/trunk/applications/accounting/widget/ar/ArMenus.xml
    ofbiz/trunk/applications/accounting/widget/ar/CommonScreens.xml

Modified: ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml?rev=790965&r1=790964&r2=790965&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml (original)
+++ ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml Fri Jul  3 16:50:35 2009
@@ -11191,4 +11191,7 @@
         <value xml:lang="it">Mostra voci transazione</value>
         <value xml:lang="nl">Boekingen transactie bekijken</value>
     </property>
+    <property key="PageTitleBatchPayments">
+        <value xml:lang="en">Batch Payments</value>
+    </property>    
 </resource>

Added: ofbiz/trunk/applications/accounting/webapp/ar/WEB-INF/actions/BatchPayments.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/ar/WEB-INF/actions/BatchPayments.groovy?rev=790965&view=auto
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/ar/WEB-INF/actions/BatchPayments.groovy (added)
+++ ofbiz/trunk/applications/accounting/webapp/ar/WEB-INF/actions/BatchPayments.groovy Fri Jul  3 16:50:35 2009
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.ofbiz.entity.condition.*;
+
+List paymentCond = [];
+if (paymentMethodTypeId) {
+    paymentCond.add(EntityCondition.makeCondition("paymentMethodTypeId", EntityOperator.EQUALS, paymentMethodTypeId));
+    if (fromDate) {
+        paymentCond.add(EntityCondition.makeCondition("effectiveDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate));
+    }
+    if (thruDate) {
+        paymentCond.add(EntityCondition.makeCondition("effectiveDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate));
+    }
+    if (partyIdFrom) {
+        paymentCond.add(EntityCondition.makeCondition("partyIdFrom", EntityOperator.EQUALS, partyIdFrom));
+    }
+    payments = delegator.findList("Payment", EntityCondition.makeCondition(paymentCond, EntityOperator.AND), null, null, null, false);
+    paymentListWithCreditCard = [];
+    paymentListWithoutCreditCard = [];
+    if (payments) {
+        payments.each { payment ->
+            paymentGroupMember = delegator.findList("PaymentGroupMember", EntityCondition.makeCondition([paymentId : payment.paymentId]), null, null, null, false);
+            if (!paymentGroupMember) {
+                if (cardType && payment.paymentMethodId) {
+                    
+                        creditCard = delegator.findOne("CreditCard", [paymentMethodId : payment.paymentMethodId], false);
+                        if (creditCard.cardType == cardType) {
+                            paymentListWithCreditCard.add(payment);
+                        }
+                
+                }
+                else {
+                    paymentListWithoutCreditCard.add(payment);
+                }
+            }
+                
+        }
+        if (paymentListWithCreditCard) {
+            context.paymentList = paymentListWithCreditCard;
+        } else {
+            context.paymentList = paymentListWithoutCreditCard;
+        }
+    }
+}
\ No newline at end of file

Propchange: ofbiz/trunk/applications/accounting/webapp/ar/WEB-INF/actions/BatchPayments.groovy
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/accounting/webapp/ar/WEB-INF/actions/BatchPayments.groovy
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/applications/accounting/webapp/ar/WEB-INF/actions/BatchPayments.groovy
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/applications/accounting/webapp/ar/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/ar/WEB-INF/controller.xml?rev=790965&r1=790964&r2=790965&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/ar/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/accounting/webapp/ar/WEB-INF/controller.xml Fri Jul  3 16:50:35 2009
@@ -33,11 +33,25 @@
         <security https="true" auth="true"/>
         <response name="success" type="view" value="ListReports"/>
     </request-map>
-
+    <request-map uri="findPayments">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="FindPayments"/>
+    </request-map>
+    <request-map uri="batchPayments">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="BatchPayments"/>
+    </request-map>
+    <request-map uri="LookupCustomerName">
+        <security auth="true" https="true"/>
+        <response name="success" type="view" value="LookupCustomerName"/>
+    </request-map>
     <!-- end of request mappings -->
 
     <!-- View Mappings -->
     <view-map name="main" type="screen" page="component://accounting/widget/ar/CommonScreens.xml#main"/>
     <view-map name="ListReports" type="screen" page="component://accounting/widget/ar/InvoiceScreens.xml#ListReports"/>
+    <view-map name="FindPayments" type="screen" page="component://accounting/widget/ar/ArPaymentScreens.xml#FindPayments"/>
+    <view-map name="BatchPayments" type="screen" page="component://accounting/widget/ar/ArPaymentScreens.xml#BatchPayments"/>
+    <view-map name="LookupCustomerName" type="screen" page="component://party/widget/partymgr/LookupScreens.xml#LookupCustomerName"/>
     <!-- end of view mappings -->
 </site-conf>
\ No newline at end of file

Added: ofbiz/trunk/applications/accounting/webapp/ar/payment/batchPayments.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/ar/payment/batchPayments.ftl?rev=790965&view=auto
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/ar/payment/batchPayments.ftl (added)
+++ ofbiz/trunk/applications/accounting/webapp/ar/payment/batchPayments.ftl Fri Jul  3 16:50:35 2009
@@ -0,0 +1,49 @@
+<#--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<div class="screenlet">
+    <div class="screenlet-body">
+        <form name='batchPaymentForm'>
+            <table class="basic-table">
+                <tr class="header-row">
+                    <td>${uiLabelMap.FormFieldTitle_paymentId}</td>
+                    <td>${uiLabelMap.Party}</td>
+                    <td>${uiLabelMap.CommonAmount}</td>
+                    <td>${uiLabelMap.CommonDate}</td>
+                </tr>
+                <#if paymentList?has_content>
+                    <#list paymentList as payment>
+                        <tr>
+                            <td><a href="<@ofbizUrl>paymentOverview?paymentId=${payment.paymentId}</@ofbizUrl>">${payment.paymentId}</a></td>
+                            <td>
+                                <#assign partyName = (delegator.findOne("PartyNameView", {"partyId" : payment.partyIdFrom}, false))!>
+                                <#if partyName.partyTypeId == "PERSON">
+                                    ${(partyName.firstName)!} ${(partyName.lastName)!}
+                                <#elseif (partyName.partyTypeId)! == "PARTY_GROUP">
+                                    ${(partyName.groupName)!}
+                                </#if>
+                            </td>
+                            <td>${payment.amount?if_exists}</td>
+                            <td>${payment.effectiveDate?if_exists}</td>
+                        </tr>
+                    </#list>
+                </#if>
+            </table>
+        </form>
+    </div>
+</div>
\ No newline at end of file

Propchange: ofbiz/trunk/applications/accounting/webapp/ar/payment/batchPayments.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/accounting/webapp/ar/payment/batchPayments.ftl
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/applications/accounting/webapp/ar/payment/batchPayments.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/applications/accounting/widget/ar/ArMenus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/ar/ArMenus.xml?rev=790965&r1=790964&r2=790965&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/ar/ArMenus.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/ar/ArMenus.xml Fri Jul  3 16:50:35 2009
@@ -25,4 +25,12 @@
         <menu-item name="payments" title="${uiLabelMap.AccountingPaymentsMenu}"><link target="findPayments"/></menu-item>
         <menu-item name="reports" title="${uiLabelMap.AccountingReports}"><link target="ListReports"/></menu-item>
     </menu>
+    <menu name="ArPaymentTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml">
+        <menu-item name="findPayments" title="${uiLabelMap.PageTitleFindPayment}">
+            <link target="findPayments"/>
+        </menu-item>
+        <menu-item name="batchPayments" title="Batch Payments">
+            <link target="batchPayments"/>
+        </menu-item>
+    </menu>
 </menus>
\ No newline at end of file

Added: ofbiz/trunk/applications/accounting/widget/ar/ArPaymentScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/ar/ArPaymentScreens.xml?rev=790965&view=auto
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/ar/ArPaymentScreens.xml (added)
+++ ofbiz/trunk/applications/accounting/widget/ar/ArPaymentScreens.xml Fri Jul  3 16:50:35 2009
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">
+    <screen name="FindPayments">
+        <section>
+            <actions>
+                <set field="titleProperty" value="PageTitleFindPayment"/>
+                <set field="headerItem" value="payments"/>
+                <set field="tabButtonItem" value="findPayments"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonArPaymentDecorator" location="component://accounting/widget/ar/CommonScreens.xml">
+                    <decorator-section name="body">
+                        <section>
+                            <widgets>
+                                <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml">
+                                    <decorator-section name="menu-bar">
+                                        <container style="button-bar">
+                                            <link target="newPayment" text="${uiLabelMap.CommonCreateNew} ${uiLabelMap.AccountingPayment}" style="buttontext"/>
+                                            <link target="FindSalesInvoicesByDueDate" text="${uiLabelMap.AccountingFindSalesInvoicesByDueDate}" style="buttontext"/>
+                                            <link target="FindPurchaseInvoicesByDueDate" text="${uiLabelMap.AccountingFindPurchaseInvoicesByDueDate}" style="buttontext"/>
+                                        </container>
+                                    </decorator-section>
+                                    <decorator-section name="search-options">
+                                        <include-form name="FindPayments" location="component://accounting/webapp/accounting/payment/PaymentForms.xml"/>
+                                    </decorator-section>
+                                    <decorator-section name="search-results">
+                                        <include-form name="ListPayments"  location="component://accounting/webapp/accounting/payment/PaymentForms.xml"/>
+                                    </decorator-section>
+                                </decorator-screen>
+                            </widgets>
+                        </section>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+    <screen name="BatchPayments">
+        <section>
+            <actions>
+                <set field="titleProperty" value="PageTitleBatchPayments"/>
+                <set field="tabButtonItem" value="batchPayments"/>
+                <set field="paymentMethodTypeId" from-field="parameters.paymentMethodTypeId"/>
+                <set field="cardType" from-field="parameters.cardType"/>
+                <set field="fromDate" type="Timestamp" from-field="parameters.fromDate"/>
+                <set field="thruDate" type="Timestamp" from-field="parameters.thruDate"/>
+                <set field="partyIdFrom" from-field="parameters.partyIdFrom"/>
+                <script location="component://accounting/webapp/ar/WEB-INF/actions/BatchPayments.groovy"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonArPaymentDecorator" location="component://accounting/widget/ar/CommonScreens.xml">
+                    <decorator-section name="body">
+                        <section>
+                            <widgets>
+                                <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml">
+                                    <decorator-section name="search-options">
+                                        <include-form name="FindBatchPayments" location="component://accounting/widget/ar/forms/ArPaymentForms.xml"/>
+                                    </decorator-section>
+                                    <decorator-section name="search-results">
+                                        <platform-specific>
+                                            <html><html-template location="component://accounting/webapp/ar/payment/batchPayments.ftl"/></html>
+                                        </platform-specific>
+                                    </decorator-section>
+                                </decorator-screen>  
+                            </widgets>
+                        </section>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+</screens>
\ No newline at end of file

Propchange: ofbiz/trunk/applications/accounting/widget/ar/ArPaymentScreens.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/accounting/widget/ar/ArPaymentScreens.xml
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/applications/accounting/widget/ar/ArPaymentScreens.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: ofbiz/trunk/applications/accounting/widget/ar/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/ar/CommonScreens.xml?rev=790965&r1=790964&r2=790965&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/ar/CommonScreens.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/ar/CommonScreens.xml Fri Jul  3 16:50:35 2009
@@ -101,4 +101,20 @@
             </widgets>
         </section>
     </screen>
+    <screen name="CommonArPaymentDecorator">
+        <section>
+            <widgets>
+                <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <section>
+                            <widgets>
+                                <include-menu name="ArPaymentTabBar" location="component://accounting/widget/ar/ArMenus.xml"/>
+                                <decorator-section-include name="body"/>
+                            </widgets>
+                        </section>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
 </screens>
\ No newline at end of file

Added: ofbiz/trunk/applications/accounting/widget/ar/forms/ArPaymentForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/ar/forms/ArPaymentForms.xml?rev=790965&view=auto
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/ar/forms/ArPaymentForms.xml (added)
+++ ofbiz/trunk/applications/accounting/widget/ar/forms/ArPaymentForms.xml Fri Jul  3 16:50:35 2009
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd">
+
+    <form name="FindBatchPayments" type="single" target="batchPayments"
+        odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
+        <field name="paymentMethodTypeId" title="${uiLabelMap.FormFieldTitle_paymentMethodTypeId}*" required-field="true">
+            <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="cardType">
+            <drop-down allow-empty="true">
+                <entity-options entity-name="Enumeration" description="${enumCode}" key-field-name="enumCode">
+                    <entity-constraint name="enumTypeId" operator="equals" value="CREDIT_CARD_TYPE"/>
+                    <entity-order-by field-name="enumId"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="partyIdFrom" title="${uiLabelMap.AccountingPartyIdFrom}">
+            <lookup target-form-name="LookupCustomerName"/>
+        </field>
+        <field name="fromDate"><date-time/></field>
+        <field name="thruDate"><date-time/></field>
+        <field name="submitButton" title="${uiLabelMap.CommonFind}" widget-style="smallSubmit"><submit button-type="button"/></field>
+    </form>
+</forms>
\ No newline at end of file

Propchange: ofbiz/trunk/applications/accounting/widget/ar/forms/ArPaymentForms.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/accounting/widget/ar/forms/ArPaymentForms.xml
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/applications/accounting/widget/ar/forms/ArPaymentForms.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml