svn commit: r599737 - in /ofbiz/trunk/applications/accounting: webapp/accounting/WEB-INF/ webapp/accounting/WEB-INF/actions/order/ webapp/accounting/billingaccount/ webapp/accounting/invoice/ widget/

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

svn commit: r599737 - in /ofbiz/trunk/applications/accounting: webapp/accounting/WEB-INF/ webapp/accounting/WEB-INF/actions/order/ webapp/accounting/billingaccount/ webapp/accounting/invoice/ widget/

apatel-2
Author: apatel
Date: Fri Nov 30 00:37:27 2007
New Revision: 599737

URL: http://svn.apache.org/viewvc?rev=599737&view=rev
Log:
Shortcut for all Unpaid Invoices on a BillingAccount,
Pankaj, thanks for your contribution.

Added:
    ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/order/
    ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/order/billingAccountOrders.bsh
Modified:
    ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml
    ofbiz/trunk/applications/accounting/webapp/accounting/billingaccount/BillingAccountTabBar.ftl
    ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml
    ofbiz/trunk/applications/accounting/widget/BillingAccountForms.xml
    ofbiz/trunk/applications/accounting/widget/BillingAccountScreens.xml

Added: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/order/billingAccountOrders.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/order/billingAccountOrders.bsh?rev=599737&view=auto
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/order/billingAccountOrders.bsh (added)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/order/billingAccountOrders.bsh Fri Nov 30 00:37:27 2007
@@ -0,0 +1,43 @@
+/*
+ * 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.base.util.UtilMisc;
+import org.ofbiz.entity.util.EntityUtil;
+import javolution.util.FastMap;
+
+if(billingAccountId != null) {    
+    List orderPaymentPreferencesList = new LinkedList();    
+    orderList = delegator.findByAnd("OrderHeader", UtilMisc.toMap("billingAccountId", billingAccountId));
+    if(orderList != null) {
+        itr = orderList.iterator();
+        while(itr.hasNext()) {
+            GenericValue orderHeader = itr.next();
+            orderId = orderHeader.get("orderId");  
+            orderBillingAcc = EntityUtil.getFirst(delegator.findByAnd("OrderHeaderAndPaymentPref", UtilMisc.toMap("orderId", orderId)));
+            Map orderBillingAccMap = FastMap.newInstance();
+            if(orderBillingAcc.getString("paymentMethodTypeId").equals("EXT_BILLACT") && orderBillingAcc.getString("paymentStatusId").equals("PAYMENT_NOT_RECEIVED")) {                    
+                orderBillingAccMap.putAll((Map) orderBillingAcc);  
+                orderId = orderBillingAcc.get("orderId");                
+                orderBillingAccMap.put("orderId", orderId);                
+            }                        
+            orderPaymentPreferencesList.add(orderBillingAccMap);
+        }
+        context.put("orderPaymentPreferencesList", orderPaymentPreferencesList);      
+    }
+}
\ No newline at end of file

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?rev=599737&r1=599736&r2=599737&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml Fri Nov 30 00:37:27 2007
@@ -139,6 +139,10 @@
         <security https="true" auth="true"/>
         <response name="success" type="view" value="BillingAccountPayments"/>
     </request-map>
+    <request-map uri="BillingAccountOrders">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="BillingAccountOrders"/>
+    </request-map>
     <request-map uri="createPaymentAndAssociateToBillingAccount">
         <security https="true" auth="true"/>
         <event type="service" invoke="createPaymentAndApplication"/>

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/billingaccount/BillingAccountTabBar.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/billingaccount/BillingAccountTabBar.ftl?rev=599737&r1=599736&r2=599737&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/billingaccount/BillingAccountTabBar.ftl (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/billingaccount/BillingAccountTabBar.ftl Fri Nov 30 00:37:27 2007
@@ -26,6 +26,7 @@
       <li<#if selected == "EditBillingAccountTerms"> class="selected"</#if>><a href="<@ofbizUrl>EditBillingAccountTerms?billingAccountId=${billingAccount.billingAccountId}</@ofbizUrl>">${uiLabelMap.PartyTerms}</a></li>
       <li<#if selected == "BillingAccountInvoices"> class="selected"</#if>><a href="<@ofbizUrl>BillingAccountInvoices?billingAccountId=${billingAccount.billingAccountId}</@ofbizUrl>">${uiLabelMap.AccountingInvoices}</a></li>
       <li<#if selected == "BillingAccountPayments"> class="selected"</#if>><a href="<@ofbizUrl>BillingAccountPayments?billingAccountId=${billingAccount.billingAccountId}</@ofbizUrl>">${uiLabelMap.AccountingPayments}</a></li>
+      <li<#if selected == "BillingAccountOrders"> class="selected"</#if>><a href="<@ofbizUrl>BillingAccountOrders?billingAccountId=${billingAccount.billingAccountId}</@ofbizUrl>">${uiLabelMap.AccountingOrders}</a></li>
     </ul>
     <br class="clear"/>
   </div>

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml?rev=599737&r1=599736&r2=599737&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml Fri Nov 30 00:37:27 2007
@@ -455,4 +455,16 @@
         <field name="invoiceId"><hidden/></field>
         
     </form>
+    <form name="lookupInvoicesStatus" type="single" target="BillingAccountInvoices" title="">
+        <field name="billingAccountId"><hidden/></field>
+        <field name="statusId">
+            <drop-down allow-empty="true">
+                <entity-options description="${description}" entity-name="StatusItem">
+                    <entity-constraint name="statusTypeId" operator="equals" value="INVOICE_STATUS"/>
+                    <entity-order-by field-name="sequenceId"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="submitButton" title="${uiLabelMap.CommonSubmit}"><submit button-type="button"/></field>
+    </form>
 </forms>

Modified: ofbiz/trunk/applications/accounting/widget/BillingAccountForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/BillingAccountForms.xml?rev=599737&r1=599736&r2=599737&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/BillingAccountForms.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/BillingAccountForms.xml Fri Nov 30 00:37:27 2007
@@ -50,7 +50,10 @@
     <form name="ListBillingAccountInvoices" type="list" list-name="billingAccountInvoices" paginate-target="BillingAccountInvoices" default-entity-name="Invoice">
         <actions>
             <entity-condition entity-name="Invoice" list-name="billingAccountInvoices">
-                <condition-expr field-name="billingAccountId" env-name="billingAccountId"/>
+                <condition-list>
+                    <condition-expr field-name="billingAccountId" env-name="billingAccountId"/>
+                    <condition-expr field-name="statusId" env-name="parameters.statusId"/>
+                </condition-list>
             </entity-condition>
         </actions>
         <row-actions>
@@ -275,6 +278,22 @@
         <field name="amount"><text/></field>
         <field name="createButton">
             <submit button-type="button"/>
+        </field>
+    </form>
+    <form name="ListBillingAccountOrders" type="list" list-name="orderPaymentPreferencesList" paginate-target="BillingAccountOrders">
+        <field name="billingAccountId"><hidden/></field>
+        <field name="orderId" widget-style="buttontext">
+            <hyperlink target="/ordermgr/control/orderview?orderId=${orderId}" target-type="inter-app" description="${orderId}" also-hidden="false"/>
+        </field>  
+        <field name="orderDate" title="${uiLabelMap.OrderDate}"><display/></field>
+        <field name="paymentMethodTypeId" title="${uiLabelMap.CommonType}">
+            <display-entity entity-name="PaymentMethodType" key-field-name="paymentMethodTypeId" description="${description}"/>
+        </field>
+        <field name="paymentStatusId" title="${uiLabelMap.CommonStatus}">
+            <display-entity entity-name="StatusItem" key-field-name="statusId" description="${description}"/>
+        </field>
+        <field name="maxAmount">
+            <display type="currency" currency="${currencyUomId}"/>
         </field>
     </form>
 

Modified: ofbiz/trunk/applications/accounting/widget/BillingAccountScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/BillingAccountScreens.xml?rev=599737&r1=599736&r2=599737&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/BillingAccountScreens.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/BillingAccountScreens.xml Fri Nov 30 00:37:27 2007
@@ -188,11 +188,35 @@
             <widgets>
                 <decorator-screen name="CommonBillingAccountDecorator">
                     <decorator-section name="body">
+                        <label style="head1" text="${uiLabelMap.AccountingFindInvoices}"/>
+                        <include-form name="lookupInvoicesStatus" location="component://accounting/webapp/accounting/invoice/InvoiceForms.xml"/>
+                        <label style="head1" text="${uiLabelMap.AccountingListInvoices}"/>
                         <include-form name="ListBillingAccountInvoices" location="component://accounting/widget/BillingAccountForms.xml"/>
                     </decorator-section>
                 </decorator-screen>
             </widgets>
          </section>
+    </screen>
+    <screen name="BillingAccountOrders">
+        <section>
+            <actions>
+                <set field="title" value="Billing Account Orders"/>
+                <set field="titleProperty" value="PageTitleEditBillingAccountOrders"/>
+                <set field="headerItem" value="billingaccount"/>
+                <set field="tabButtonItem" value="BillingAccountOrders"/>
+                    
+                <set field="billingAccountId" from-field="parameters.billingAccountId"/>
+                <entity-one entity-name="BillingAccount" value-name="billingAccount"/>
+                <script location="component://accounting/webapp/accounting/WEB-INF/actions/order/billingAccountOrders.bsh"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonBillingAccountDecorator">
+                    <decorator-section name="body">
+                        <include-form name="ListBillingAccountOrders" location="component://accounting/widget/BillingAccountForms.xml"/>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
     </screen>
     <screen name="BillingAccountPayments">
         <section>