Applied patch from jira issue OFBIZ-2713 - Invoice generation from Commission Run

Implemented:
– Initial screen for sales invoice search and list form. 

Thanks Amit.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@792939 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Ashish Vijaywargiya
2009-07-10 13:23:23 +00:00
parent b8236c382f
commit a2287e8f6c
6 changed files with 153 additions and 1 deletions
@@ -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>
@@ -2158,6 +2158,11 @@ under the License.
<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 @@ under the License.
<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>
@@ -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>
@@ -151,4 +151,44 @@ under the License.
</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>
@@ -78,5 +78,8 @@ under the License.
<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>
@@ -142,4 +142,18 @@ under the License.
<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>