Author: ashish
Date: Thu Nov 26 14:58:17 2009 New Revision: 884572 URL: http://svn.apache.org/viewvc?rev=884572&view=rev Log: Applied patch from jira issue OFBIZ-3263 - Add bulk status change action on AR find invoice screen, also add ability to print bulk invoices. Provide following features on screen : https://demo.ofbiz.org/ar/control/FindArInvoices (AR > Find Invoice) 1). Ability to change bulk invoice status. 2). Display invoice running total same as purchase invoice list form of AP. 3). Ability to print sales invoices in bulk. This patch covers following thing : - 1) Implementation of mentioned functionality. 2) Data for entity UomConversionDated. 3) Improvement in service createAcctgTransForSalesInvoice . Thanks Awdesh, Sumit for the contribution. Added: ofbiz/trunk/applications/accounting/webapp/ar/invoice/ ofbiz/trunk/applications/accounting/webapp/ar/invoice/ListInvoices.ftl (with props) Modified: ofbiz/trunk/applications/accounting/data/DemoGlSetupData.xml ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml ofbiz/trunk/applications/accounting/webapp/ap/WEB-INF/controller.xml ofbiz/trunk/applications/accounting/webapp/ar/WEB-INF/controller.xml ofbiz/trunk/applications/accounting/widget/ar/InvoiceScreens.xml Modified: ofbiz/trunk/applications/accounting/data/DemoGlSetupData.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/data/DemoGlSetupData.xml?rev=884572&r1=884571&r2=884572&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/data/DemoGlSetupData.xml (original) +++ ofbiz/trunk/applications/accounting/data/DemoGlSetupData.xml Thu Nov 26 14:58:17 2009 @@ -398,7 +398,9 @@ <CustomTimePeriod organizationPartyId="Company" customTimePeriodId="6018" periodTypeId="FISCAL_QUARTER" fromDate="2010-07-01" thruDate="2010-10-01" isClosed="N" periodNum="3" periodName="2010/Q3" parentPeriodId="6015"/> <CustomTimePeriod organizationPartyId="Company" customTimePeriodId="6019" periodTypeId="FISCAL_QUARTER" fromDate="2010-10-01" thruDate="2011-01-01" isClosed="N" periodNum="4" periodName="2010/Q4" parentPeriodId="6015"/> - <UomConversionDated uomId="USD" uomIdTo="EUR" fromDate="2001-01-01 00:00:00.0" conversionFactor="0.7"/><!-- to convert demo invoice --> + <!-- to convert demo invoice --> + <UomConversionDated uomId="USD" uomIdTo="EUR" fromDate="2001-01-01 00:00:00.0" conversionFactor="0.7"/> + <UomConversionDated uomId="EUR" uomIdTo="USD" fromDate="2001-01-01 00:00:00.0" conversionFactor="1.5"/> <!-- Gl Reconciliation --> <GlReconciliation glReconciliationId="9000" glReconciliationName="demoGlReconciliation" glAccountId="111100" statusId="GLREC_RECONCILED" organizationPartyId="Company" reconciledBalance="75000.00" reconciledDate="2009-08-08 20:03:14.000"/> Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml?rev=884572&r1=884571&r2=884572&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml (original) +++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml Thu Nov 26 14:58:17 2009 @@ -2140,7 +2140,7 @@ <iterate list="invoiceItems" entry="invoiceItem"> <!-- TODO: handle serialized inventory --> <if-empty field="invoiceItem.quantity"> - <set field="invoiceItem.quantity" value="1"/> + <set field="invoiceItem.quantity" type="BigDecimal" value="1"/> </if-empty> <calculate field="origAmount" decimal-scale="${ledgerDecimals}" rounding-mode="${roundingMode}"> <calcop operator="multiply"> 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=884572&r1=884571&r2=884572&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml Thu Nov 26 14:58:17 2009 @@ -278,7 +278,11 @@ <response name="success" type="view" value="editInvoice"/> <response name="error" type="view" value="editInvoice"/> </request-map> - + <request-map uri="getInvoiceRunningTotal"> + <event type="jsonservice" invoke="getInvoiceRunningTotal"/> + <response name="success" type="none"/> + <response name="error" type="none"/> + </request-map> <!-- Request EditInvoiceItemType --> <request-map uri="editInvoiceItemType"> <security https="true" auth="true"/> Modified: ofbiz/trunk/applications/accounting/webapp/ap/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/ap/WEB-INF/controller.xml?rev=884572&r1=884571&r2=884572&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/ap/WEB-INF/controller.xml (original) +++ ofbiz/trunk/applications/accounting/webapp/ap/WEB-INF/controller.xml Thu Nov 26 14:58:17 2009 @@ -43,11 +43,6 @@ <security https="true" auth="true"/> <response name="success" type="view" value="NewPurchaseInvoice"/> </request-map> - <request-map uri="getInvoiceRunningTotal"> - <event type="jsonservice" invoke="getInvoiceRunningTotal"/> - <response name="success" type="none"/> - <response name="error" type="none"/> - </request-map> <request-map uri="processMassCheckRun"> <security https="true" auth="true"/> <event type="service" invoke="createPaymentAndPaymentGroupForInvoices"/> 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=884572&r1=884571&r2=884572&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/ar/WEB-INF/controller.xml (original) +++ ofbiz/trunk/applications/accounting/webapp/ar/WEB-INF/controller.xml Thu Nov 26 14:58:17 2009 @@ -89,6 +89,12 @@ <response name="success" type="view" value="BatchPayments"/> <response name="error" type="view" value="BatchPayments"/> </request-map> + <request-map uri="massChangeInvoiceStatus"> + <security https="true" auth="true"/> + <event type="service" invoke="massChangeInvoiceStatus"/> + <response name="success" type="view" value="FindArInvoices"/> + <response name="error" type="view" value="FindArInvoices"/> + </request-map> <!-- end of request mappings --> <!-- View Mappings --> Added: ofbiz/trunk/applications/accounting/webapp/ar/invoice/ListInvoices.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/ar/invoice/ListInvoices.ftl?rev=884572&view=auto ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/ar/invoice/ListInvoices.ftl (added) +++ ofbiz/trunk/applications/accounting/webapp/ar/invoice/ListInvoices.ftl Thu Nov 26 14:58:17 2009 @@ -0,0 +1,144 @@ +<script type="text/javascript"> +//<![CDATA[ + + function toggleInvoiceId(master) { + var invoices = $('listInvoices').getInputs('checkbox','invoiceIds'); + invoices.each(function(invoice){ + invoice.checked = master.checked; + }); + getInvoiceRunningTotal(); + } + + function getInvoiceRunningTotal() { + var invoices = $('listInvoices').getInputs('checkbox','invoiceIds'); + if(invoices.pluck('checked').all()) { + $('checkAllInvoices').checked = true; + } else { + $('checkAllInvoices').checked = false; + } + if(invoices.pluck('checked').any()) { + new Ajax.Request('getInvoiceRunningTotal', { + asynchronous: false, + onSuccess: function(transport) { + var data = transport.responseText.evalJSON(true); + $('showInvoiceRunningTotal').update(data.invoiceRunningTotal); + }, + parameters: $('listInvoices').serialize(), + requestHeaders: {Accept: 'application/json'} + }); + if($F('serviceName') != "") { + $('submitButton').disabled = false; + } + + } else { + $('submitButton').disabled = true; + $('showInvoiceRunningTotal').update(""); + } + } + + function setServiceName(selection) { + if ( selection.value == 'massInvoicesToApprove' || selection.value == 'massInvoicesToReceive' || selection.value == 'massInvoicesToReady' || selection.value == 'massInvoicesToPaid' || selection.value == 'massInvoicesToWriteoff' || selection.value == 'massInvoicesToCancel') { + $('listInvoices').action = $('invoiceStatusChange').value; + } else { + $('listInvoices').action = selection.value; + } + if (selection.value == 'massInvoicesToApprove') { + $('statusId').value = "INVOICE_APPROVED"; + } else if (selection.value == 'massInvoicesToReceive') { + $('statusId').value = "INVOICE_RECEIVED"; + } else if (selection.value == 'massInvoicesToReady') { + $('statusId').value = "INVOICE_READY"; + } else if (selection.value == 'massInvoicesToPaid') { + $('statusId').value = "INVOICE_PAID"; + } else if (selection.value == 'massInvoicesToWriteoff') { + $('statusId').value = "INVOICE_WRITEOFF"; + } else if (selection.value == 'massInvoicesToCancel') { + $('statusId').value = "INVOICE_CANCELLED"; + } + if($('listInvoices').getInputs('checkbox','invoiceIds').pluck('checked').any() && ($F('serviceName') != "")) { + $('submitButton').disabled = false; + } + } +//]]> +</script> +<#if invoices?has_content> + <#assign invoiceList = invoices.getCompleteList() /> + <#assign eliClose = invoices.close() /> +</#if> +<#if invoiceList?has_content && (parameters.noConditionFind)?if_exists == 'Y'> + <div> + <span class="label">${uiLabelMap.AccountingRunningTotalOutstanding} :</span> + <span class="label" id="showInvoiceRunningTotal"></span> + </div> + <form name="listInvoices" id="listInvoices" method="post" action=""> + <div align="right"> + <select name="serviceName" id="serviceName" onchange="javascript:setServiceName(this);"> + <option value="">${uiLabelMap.AccountingSelectAction}</option> + <option value="<@ofbizUrl>PrintInvoices</@ofbizUrl>">${uiLabelMap.AccountingPrintInvoices}</option> + <option value="massInvoicesToApprove">${uiLabelMap.AccountingInvoiceStatusToApproved}</option> + <option value="massInvoicesToReceive">${uiLabelMap.AccountingInvoiceStatusToReceived}</option> + <option value="massInvoicesToReady">${uiLabelMap.AccountingInvoiceStatusToReady}</option> + <option value="massInvoicesToPaid">${uiLabelMap.AccountingInvoiceStatusToPaid}</option> + <option value="massInvoicesToWriteoff">${uiLabelMap.AccountingInvoiceStatusToWriteoff}</option> + <option value="massInvoicesToCancel">${uiLabelMap.AccountingInvoiceStatusToCancelled}</option> + </select> + <input id="submitButton" type="button" onclick="javascript:$('listInvoices').submit();" value="${uiLabelMap.CommonRun}" disabled/> + <input type="hidden" name="organizationPartyId" value="${defaultOrganizationPartyId}"/> + <input type="hidden" name="partyIdFrom" value="${parameters.partyIdFrom?if_exists}"/> + <input type="hidden" name="statusId" id="statusId" value="${parameters.statusId?if_exists}"/> + <input type="hidden" name="fromInvoiceDate" value="${parameters.fromInvoiceDate?if_exists}"/> + <input type="hidden" name="thruInvoiceDate" value="${parameters.thruInvoiceDate?if_exists}"/> + <input type="hidden" name="fromDueDate" value="${parameters.fromDueDate?if_exists}"/> + <input type="hidden" name="thruDueDate" value="${parameters.thruDueDate?if_exists}"/> + <input type="hidden" name="invoiceStatusChange" id="invoiceStatusChange" value="<@ofbizUrl>massChangeInvoiceStatus</@ofbizUrl>"/> + </div> + + <table class="basic-table hover-bar" cellspacing="0"> + <thead> + <tr class="header-row-2"> + <td>${uiLabelMap.FormFieldTitle_invoiceId}</td> + <td>${uiLabelMap.FormFieldTitle_invoiceTypeId}</td> + <td>${uiLabelMap.AccountingInvoiceDate}</td> + <td>${uiLabelMap.CommonStatus}</td> + <td>${uiLabelMap.CommonDescription}</td> + <td>${uiLabelMap.AccountingVendorParty}</td> + <td>${uiLabelMap.AccountingToParty}</td> + <td>${uiLabelMap.AccountingAmount}</td> + <td>${uiLabelMap.FormFieldTitle_paidAmount}</td> + <td>${uiLabelMap.FormFieldTitle_outstandingAmount}</td> + <td align="right">${uiLabelMap.CommonSelectAll} <input type="checkbox" id="checkAllInvoices" name="checkAllInvoices" onchange="javascript:toggleInvoiceId(this);"/></td> + </tr> + </thead> + <tbody> + <#assign alt_row = false> + <#list invoiceList 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> + <tr valign="middle"<#if alt_row> class="alternate-row"</#if>> + <td><a class="buttontext" href="<@ofbizUrl>invoiceOverview?invoiceId=${invoice.invoiceId}</@ofbizUrl>">${invoice.get("invoiceId")}</a></td> + <td> + <#assign invoiceType = delegator.findOne("InvoiceType", {"invoiceTypeId" : invoice.invoiceTypeId}, true) /> + ${invoiceType.description?default(invoice.invoiceTypeId)} + </td> + <td>${(invoice.invoiceDate)?if_exists}</td> + <td> + <#assign statusItem = delegator.findOne("StatusItem", {"statusId" : invoice.statusId}, true) /> + ${statusItem.description?default(invoice.statusId)} + </td> + <td>${(invoice.description)?if_exists}</td> + <td><a href="/partymgr/control/viewprofile?partyId=${invoice.partyIdFrom}">${Static["org.ofbiz.party.party.PartyHelper"].getPartyName(delegator, invoice.partyIdFrom, false)?if_exists} [${(invoice.partyIdFrom)?if_exists}] </a></td> + <td><a href="/partymgr/control/viewprofile?partyId=${invoice.partyId}">${Static["org.ofbiz.party.party.PartyHelper"].getPartyName(delegator, invoice.partyId, false)?if_exists} [${(invoice.partyId)?if_exists}]</a></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> + <td align="right"><input type="checkbox" id="invoiceId_${invoice_index}" name="invoiceIds" value="${invoice.invoiceId}" onclick="javascript:getInvoiceRunningTotal();"/></td> + </tr> + <#-- toggle the row color --> + <#assign alt_row = !alt_row> + </#list> + </tbody> + </table> + </form> +<#else> + <h3>${uiLabelMap.AccountingNoInvoicesFound}</h3> +</#if> Propchange: ofbiz/trunk/applications/accounting/webapp/ar/invoice/ListInvoices.ftl ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/accounting/webapp/ar/invoice/ListInvoices.ftl ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/applications/accounting/webapp/ar/invoice/ListInvoices.ftl ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: ofbiz/trunk/applications/accounting/widget/ar/InvoiceScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/ar/InvoiceScreens.xml?rev=884572&r1=884571&r2=884572&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/ar/InvoiceScreens.xml (original) +++ ofbiz/trunk/applications/accounting/widget/ar/InvoiceScreens.xml Thu Nov 26 14:58:17 2009 @@ -63,6 +63,12 @@ <section> <actions> <set field="titleProperty" value="AccountingFindArInvoices"/> + <service service-name="performFind" result-map="result"> + <field-map field-name="inputFields" from-field="parameters"/> + <field-map field-name="entityName" value="InvoiceAndType"/> + <field-map field-name="orderBy" value="invoiceDate DESC"/> + </service> + <set field="invoices" from-field="result.listIt"/> </actions> <widgets> <decorator-screen name="CommonArInvoiceDecorator" location="${parameters.mainDecoratorLocation}"> @@ -79,7 +85,9 @@ <include-form name="FindArInvoices" location="component://accounting/widget/ar/forms/InvoiceForms.xml"/> </decorator-section> <decorator-section name="search-results"> - <include-form name="ListInvoices" location="component://accounting/widget/InvoiceForms.xml"/> + <platform-specific> + <html><html-template location="component://accounting/webapp/ar/invoice/ListInvoices.ftl"/></html> + </platform-specific> </decorator-section> </decorator-screen> </widgets> |
Free forum by Nabble | Edit this page |