svn commit: r792939 - in /ofbiz/trunk/applications/accounting: config/AccountingUiLabels.xml webapp/accounting/WEB-INF/controller.xml webapp/ap/invoices/CommissionRun.ftl widget/ap/InvoiceScreens.xml widget/ap/Menus.xml widget/ap/forms/InvoiceForms.xml

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

svn commit: r792939 - in /ofbiz/trunk/applications/accounting: config/AccountingUiLabels.xml webapp/accounting/WEB-INF/controller.xml webapp/ap/invoices/CommissionRun.ftl widget/ap/InvoiceScreens.xml widget/ap/Menus.xml widget/ap/forms/InvoiceForms.xml

ashish-18
Author: ashish
Date: Fri Jul 10 13:23:23 2009
New Revision: 792939

URL: http://svn.apache.org/viewvc?rev=792939&view=rev
Log:
Applied patch from jira issue OFBIZ-2713 - Invoice generation from Commission Run
Implemented:
– Initial screen for sales invoice search and list form.

Thanks Amit.

Added:
    ofbiz/trunk/applications/accounting/webapp/ap/invoices/CommissionRun.ftl   (with props)
Modified:
    ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml
    ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml
    ofbiz/trunk/applications/accounting/widget/ap/InvoiceScreens.xml
    ofbiz/trunk/applications/accounting/widget/ap/Menus.xml
    ofbiz/trunk/applications/accounting/widget/ap/forms/InvoiceForms.xml

Modified: ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml?rev=792939&r1=792938&r2=792939&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml (original)
+++ ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml Fri Jul 10 13:23:23 2009
@@ -1656,6 +1656,9 @@
         <value xml:lang="th">ความคิดเห็น</value>
         <value xml:lang="zh">评论</value>
     </property>
+    <property key="AccountingCommissionRun">
+        <value xml:lang="en">Commission Run</value>
+    </property>
     <property key="AccountingCompanies">
         <value xml:lang="ar">شركات</value>
         <value xml:lang="de">Firmen</value>
@@ -6848,6 +6851,9 @@
         <value xml:lang="th">หมายเลขบัตรประกัน</value>
         <value xml:lang="zh">卡的安全码</value>
     </property>
+    <property key="AccountingSelectPartiesForCommissionInvoice">
+        <value xml:lang="en">Select The Parties For Commission Invoice</value>
+    </property>
     <property key="AccountingSendChecks">
         <value xml:lang="ar">تعليم الصكوك كمرسلة</value>
         <value xml:lang="en">Mark Checks Sent</value>

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=792939&r1=792938&r2=792939&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml Fri Jul 10 13:23:23 2009
@@ -2158,6 +2158,11 @@
         <response name="success" type="view" value="GlAccountTrialBalanceReportPdf"/>
     </request-map>
 
+    <request-map uri="CommissionRun">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="CommissionRun"/>
+    </request-map>
+
     <!-- end of request mappings -->
 
     <!-- View Mappings -->
@@ -2427,6 +2432,7 @@
     <view-map name="AcctgTransDetailReportPdf" type="screenfop" page="component://accounting/widget/GlScreens.xml#AcctgTransDetailReportPdf" content-type="application/pdf" encoding="none"/>
     <view-map name="GlAccountTrialBalance" type="screen" page="component://accounting/widget/ReportFinancialSummaryScreens.xml#GlAccountTrialBalance"/>
     <view-map name="GlAccountTrialBalanceReportPdf" type="screenfop" page="component://accounting/widget/ReportFinancialSummaryScreens.xml#GlAccountTrialBalanceReportPdf" content-type="application/pdf" encoding="none"/>
-
+    <view-map name="CommissionRun" type="screen" page="component://accounting/widget/ap/InvoiceScreens.xml#CommissionRun"/>
+    
     <!-- end of view mappings -->
 </site-conf>

Added: ofbiz/trunk/applications/accounting/webapp/ap/invoices/CommissionRun.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/ap/invoices/CommissionRun.ftl?rev=792939&view=auto
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/ap/invoices/CommissionRun.ftl (added)
+++ ofbiz/trunk/applications/accounting/webapp/ap/invoices/CommissionRun.ftl Fri Jul 10 13:23:23 2009
@@ -0,0 +1,83 @@
+<#--
+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.
+-->
+
+<script language="JavaScript" type="text/javascript">
+<!--
+function toggleInvoiceId(master) {
+    var form = document.listSalesInvoices;
+    var invoices = form.elements.length;
+    for (var i = 0; i < invoices; i++) {
+        var element = form.elements[i];
+        if (element.name == "invoiceIds") {
+            element.checked = master.checked;
+        }
+    }
+}
+-->
+</script>
+
+<#if invoices?has_content >
+  <form name="listSalesInvoices" id="listSalesInvoices">
+    <div align="right">
+      <select name="serviceName" id="serviceName">
+        <option value=""/>
+        <option value="commissionRun">${uiLabelMap.AccountingCommissionRun}</option>
+      </select>
+      <a href="#" id="runAction" class="buttontext">${uiLabelMap.OrderRunAction}</a>
+    </div>
+    <table class="basic-table hover-bar" cellspacing="0">
+      <#-- Header Begins -->
+      <tr class="header-row-2">
+        <td width="8%"><input type="checkbox" id="checkAllInvoices" name="checkAllInvoices" onchange="javascript:toggleInvoiceId(this);"/> ${uiLabelMap.CommonSelectAll}</td>
+        <td width="10%">${uiLabelMap.FormFieldTitle_invoiceId}</td>
+        <td width="15%">${uiLabelMap.AccountingVendorParty}</td>
+        <td width="10%">${uiLabelMap.CommonStatus}</td>
+        <td width="10%">${uiLabelMap.AccountingReferenceNumber}</td>
+        <td width="10%">${uiLabelMap.AccountingInvoiceDate}</td>
+        <td width="10%">${uiLabelMap.AccountingDueDate}</td>
+        <td width="9%">${uiLabelMap.AccountingAmount}</td>
+        <td width="9%">${uiLabelMap.FormFieldTitle_paidAmount}</td>
+        <td width="9%">${uiLabelMap.FormFieldTitle_outstandingAmount}</td>
+      </tr>
+      <#-- Header Ends-->
+      <#assign alt_row = false>
+      <#list invoices as invoice>
+        <#assign invoicePaymentInfoList = dispatcher.runSync("getInvoicePaymentInfoList", Static["org.ofbiz.base.util.UtilMisc"].toMap("invoiceId", invoice.invoiceId, "userLogin", userLogin))/>
+        <#assign invoicePaymentInfo = invoicePaymentInfoList.get("invoicePaymentInfoList").get(0)?if_exists>
+        <#assign statusItem = invoice.getRelatedOneCache("StatusItem")>
+        <tr valign="middle"<#if alt_row> class="alternate-row"</#if>>
+          <td><input type="checkbox" id="invoiceId_${invoice_index}" name="invoiceIds" value="${invoice.invoiceId}"/></td>
+          <td><a class="buttontext" href="<@ofbizUrl>invoiceOverview?invoiceId=${invoice.invoiceId}</@ofbizUrl>">${invoice.get("invoiceId")}</a></td>
+          <td>${Static["org.ofbiz.party.party.PartyHelper"].getPartyName(delegator, invoice.partyIdFrom, false)?if_exists}</td>
+          <td>${statusItem.get("description")?if_exists}</td>
+          <td>${invoice.get("referenceNumber")?if_exists}</td>
+          <td>${invoice.get("invoiceDate")?if_exists}</td>
+          <td>${invoice.get("dueDate")?if_exists}</td>
+          <td><@ofbizCurrency amount=invoicePaymentInfo.amount isoCode=defaultOrganizationPartyCurrencyUomId/></td>
+          <td><@ofbizCurrency amount=invoicePaymentInfo.paidAmount isoCode=defaultOrganizationPartyCurrencyUomId/></td>
+          <td><@ofbizCurrency amount=invoicePaymentInfo.outstandingAmount isoCode=defaultOrganizationPartyCurrencyUomId/></td>
+        </tr>
+        <#-- toggle the row color -->
+        <#assign alt_row = !alt_row>
+      </#list>
+    </table>
+  </form>
+<#else>
+  <td colspan='4'><h3>${uiLabelMap.AccountingNoInvoicesFound}</h3></td>
+</#if>

Propchange: ofbiz/trunk/applications/accounting/webapp/ap/invoices/CommissionRun.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/accounting/webapp/ap/invoices/CommissionRun.ftl
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/applications/accounting/webapp/ap/invoices/CommissionRun.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/applications/accounting/widget/ap/InvoiceScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/ap/InvoiceScreens.xml?rev=792939&r1=792938&r2=792939&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/ap/InvoiceScreens.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/ap/InvoiceScreens.xml Fri Jul 10 13:23:23 2009
@@ -151,4 +151,44 @@
             </widgets>
         </section>
     </screen>
+
+    <screen name="CommissionRun">
+        <section>
+            <actions>
+                <set field="titleProperty" value="AccountingFindSalesInvoicesForCommissionRun"/>
+                <set field="tabButtonItem" value="commissionRun"/>
+                <set field="parameters.sortField" from-field="parameters.sortField" default-value="-invoiceDate"/>
+                <entity-condition entity-name="Invoice" list="invoices">
+                    <condition-list combine="and">
+                        <condition-expr field-name="invoiceId" operator="equals" from-field="parameters.invoiceId" ignore-if-empty="true"/>
+                        <condition-expr field-name="invoiceTypeId" operator="equals" from-field="parameters.invoiceTypeId" ignore-if-empty="false"/>
+                        <condition-expr field-name="invoiceDate" operator="greater-equals" from-field="parameters.fromInvoiceDate" ignore-if-empty="true"/>
+                        <condition-expr field-name="invoiceDate" operator="less-equals" from-field="parameters.thruInvoiceDate" ignore-if-empty="true"/>
+                        <condition-expr field-name="statusId" operator="equals" from-field="parameters.statusId" ignore-if-empty="true"/>
+                    </condition-list>
+                    <order-by field-name="invoiceId"/>
+                </entity-condition>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonApInvoiceDecorator" location="component://accounting/widget/ap/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="CommissionRun" location="component://accounting/widget/ap/forms/InvoiceForms.xml"/>
+                                    </decorator-section>
+                                    <decorator-section name="search-results">
+                                        <platform-specific>
+                                            <html><html-template location="component://accounting/webapp/ap/invoices/CommissionRun.ftl"/></html>
+                                        </platform-specific>
+                                    </decorator-section>
+                                </decorator-screen>
+                            </widgets>
+                        </section>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
 </screens>
\ No newline at end of file

Modified: ofbiz/trunk/applications/accounting/widget/ap/Menus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/ap/Menus.xml?rev=792939&r1=792938&r2=792939&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/ap/Menus.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/ap/Menus.xml Fri Jul 10 13:23:23 2009
@@ -78,5 +78,8 @@
         <menu-item name="purchaseInvoices" title="${uiLabelMap.AccountingPurchaseInvoices}">
             <link target="FindPurchaseInvoices"/>
         </menu-item>
+        <menu-item name="commissionRun" title="${uiLabelMap.AccountingCommissionRun}">
+            <link target="CommissionRun"/>
+        </menu-item>
     </menu>
 </menus>

Modified: ofbiz/trunk/applications/accounting/widget/ap/forms/InvoiceForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/ap/forms/InvoiceForms.xml?rev=792939&r1=792938&r2=792939&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/ap/forms/InvoiceForms.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/ap/forms/InvoiceForms.xml Fri Jul 10 13:23:23 2009
@@ -142,4 +142,18 @@
         <field name="search" widget-style="smallSubmit"><submit button-type="button"/></field>
     </form>
 
+    <form name="CommissionRun" type="single" target="CommissionRun">
+        <field name="partyId" title="${uiLabelMap.PartyPartyId}" required-field="true">
+            <drop-down allow-multiple="true">
+                <entity-options entity-name="PartyRole" description="${partyId}">
+                    <entity-constraint name="roleTypeId" operator="equals" value="SALES_REP"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="invoiceTypeId"><hidden value="SALES_INVOICE"/></field>
+        <field name="statusId"><hidden value="INVOICE_PAID"/></field>
+        <field name="fromInvoiceDate" position="1"><date-time/></field>
+        <field name="thruInvoiceDate" position="2"><date-time/></field>
+        <field name="search" widget-style="smallSubmit"><submit button-type="button"/></field>
+    </form>
 </forms>
\ No newline at end of file