Author: ashish
Date: Mon Jul 6 16:11:52 2009 New Revision: 791531 URL: http://svn.apache.org/viewvc?rev=791531&view=rev Log: Applied patch from jira issue OFBIZ-2706 - Create a screen under AP -> Invoice, which will search for a PURCHASE_INVOICE between dates. Thanks Chirag, Rishi & Sumit for the contribution. Added: ofbiz/trunk/applications/accounting/webapp/ap/WEB-INF/actions/ ofbiz/trunk/applications/accounting/webapp/ap/WEB-INF/actions/invoices/ ofbiz/trunk/applications/accounting/webapp/ap/WEB-INF/actions/invoices/FindApInvoices.groovy (with props) ofbiz/trunk/applications/accounting/webapp/ap/invoices/ ofbiz/trunk/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl (with props) Modified: ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml ofbiz/trunk/applications/accounting/webapp/ap/WEB-INF/controller.xml ofbiz/trunk/applications/accounting/webapp/ap/WEB-INF/web.xml ofbiz/trunk/applications/accounting/widget/ap/CommonScreens.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=791531&r1=791530&r2=791531&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml (original) +++ ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml Mon Jul 6 16:11:52 2009 @@ -2742,6 +2742,9 @@ <value xml:lang="ru">ФинанÑовÑе ÑÑеÑа</value> <value xml:lang="th">à¸à¸à¸à¸³à¹à¸£à¸ªà¸°à¸ªà¸¡à¹à¸¥à¸°à¸à¸à¹à¸ªà¸à¸à¸à¸²à¸£à¹à¸à¸¥à¸µà¹à¸¢à¸à¹à¸à¸¥à¸à¸à¸²à¸à¸°à¸à¸²à¸£à¹à¸à¸´à¸</value> </property> + <property key="AccountingFindApInvoices"> + <value xml:lang="en">Find AP Invoices</value> + </property> <property key="AccountingFindFixedAssets"> <value xml:lang="de">Suche Anlagen</value> <value xml:lang="en">Find Fixed Assets</value> @@ -2771,6 +2774,9 @@ <property key="AccountingFindPaymentGroup"> <value xml:lang="en">Find Payment Group</value> </property> + <property key="AccountingFindPurchaseInvoices"> + <value xml:lang="en">Find Purchase Invoices</value> + </property> <property key="AccountingFindPurchaseInvoicesByDueDate"> <value xml:lang="de">Suche Einkaufsrechnungen über Fälligkeit</value> <value xml:lang="en">Find Purchase Invoices By Due Date</value> @@ -6641,6 +6647,9 @@ <value xml:lang="th">ราà¸à¸²à¸ªà¸´à¸à¸à¹à¸²</value> <value xml:lang="zh">产åç¨ç</value> </property> + <property key="AccountingPurchaseInvoices"> + <value xml:lang="en">Purchase Invoices</value> + </property> <property key="AccountingPurchaseInvoiceToRevenue"> <value xml:lang="en">Purchase Invoice type to Revenue GL Account Number assignment list</value> <value xml:lang="fr">Liste d'affectation du type facture d'achat au n° de compte de produit</value> @@ -7553,6 +7562,9 @@ <value xml:lang="it">Motivazione Varianza Conti Gl</value> <value xml:lang="nl">Reden afwijking GB-rekening</value> </property> + <property key="AccountingVendorParty"> + <value xml:lang="en">Vendor Party</value> + </property> <property key="AccountingVerifyTransaction"> <value xml:lang="en">Verify Transaction</value> <value xml:lang="fr">Vérifier la transaction</value> Added: ofbiz/trunk/applications/accounting/webapp/ap/WEB-INF/actions/invoices/FindApInvoices.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/ap/WEB-INF/actions/invoices/FindApInvoices.groovy?rev=791531&view=auto ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/ap/WEB-INF/actions/invoices/FindApInvoices.groovy (added) +++ ofbiz/trunk/applications/accounting/webapp/ap/WEB-INF/actions/invoices/FindApInvoices.groovy Mon Jul 6 16:11:52 2009 @@ -0,0 +1,42 @@ +/* + * 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.EntityCondition; +import org.ofbiz.entity.condition.EntityOperator; +import org.ofbiz.entity.util.EntityUtil; + +invoiceMap = dispatcher.runSync("performFind", [inputFields : parameters, + entityName : "Invoice", + orderBy : parameters.sortField]); + +invoiceTypes = EntityUtil.getFieldListFromEntityList(delegator.findList("InvoiceType", EntityCondition.makeCondition("parentTypeId", EntityOperator.EQUALS, "PURCHASE_INVOICE"), null, null, null, false), "invoiceTypeId", false); +invoices = []; +invoiceList = []; + +if (invoiceMap.listIt != null) + invoiceList = invoiceMap.listIt.getCompleteList(); + +if (invoiceList) { + invoiceList.each { invoice -> + if (invoiceTypes.contains(invoice.invoiceTypeId)) + invoices.add(invoice); + } +} + +context.invoices = invoices; \ No newline at end of file Propchange: ofbiz/trunk/applications/accounting/webapp/ap/WEB-INF/actions/invoices/FindApInvoices.groovy ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/accounting/webapp/ap/WEB-INF/actions/invoices/FindApInvoices.groovy ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/applications/accounting/webapp/ap/WEB-INF/actions/invoices/FindApInvoices.groovy ------------------------------------------------------------------------------ svn:mime-type = text/plain 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=791531&r1=791530&r2=791531&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/ap/WEB-INF/controller.xml (original) +++ ofbiz/trunk/applications/accounting/webapp/ap/WEB-INF/controller.xml Mon Jul 6 16:11:52 2009 @@ -31,6 +31,19 @@ <security https="true" auth="true"/> <response name="success" type="view" value="ListReports"/> </request-map> + <request-map uri="FindPurchaseInvoices"> + <security https="true" auth="true"/> + <response name="success" type="view" value="FindPurchaseInvoices"/> + </request-map> + <request-map uri="FindApInvoices"> + <security https="true" auth="true"/> + <response name="success" type="view" value="FindApInvoices"/> + </request-map> + <request-map uri="NewPurchaseInvoice"> + <security https="true" auth="true"/> + <response name="success" type="view" value="NewPurchaseInvoice"/> + </request-map> + <!-- ================ Vendor requests ================ --> <request-map uri="findVendors"> <security https="true" auth="true"/> @@ -58,6 +71,10 @@ <!-- View Mappings --> <view-map name="main" type="screen" page="component://accounting/widget/ap/CommonScreens.xml#main"/> <view-map name="ListReports" type="screen" page="component://accounting/widget/ap/InvoiceScreens.xml#ListReports"/> + <view-map name="FindPurchaseInvoices" type="screen" page="component://accounting/widget/ap/InvoiceScreens.xml#FindPurchaseInvoices"/> + <view-map name="FindApInvoices" type="screen" page="component://accounting/widget/ap/InvoiceScreens.xml#FindApInvoices"/> + <view-map name="NewPurchaseInvoice" type="screen" page="component://accounting/widget/ap/InvoiceScreens.xml#NewPurchaseInvoice"/> + <!-- Vendor Mappings --> <view-map name="FindVendors" type="screen" page="component://accounting/widget/ap/CommonScreens.xml#FindVendors"/> <view-map name="EditVendor" type="screen" page="component://accounting/widget/ap/CommonScreens.xml#EditVendor"/> Modified: ofbiz/trunk/applications/accounting/webapp/ap/WEB-INF/web.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/ap/WEB-INF/web.xml?rev=791531&r1=791530&r2=791531&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/ap/WEB-INF/web.xml (original) +++ ofbiz/trunk/applications/accounting/webapp/ap/WEB-INF/web.xml Mon Jul 6 16:11:52 2009 @@ -45,6 +45,11 @@ <param-value>component://accounting/widget/ap/CommonScreens.xml</param-value> <description>The location of the main-decorator screen to use for this webapp; referred to as a context variable in screen def XML files.</description> </context-param> + <context-param> + <param-name>CommonApInvoiceDecoratorLocation</param-name> + <param-value>component://accounting/widget/ap/CommonScreens.xml</param-value> + <description>The location of the CommonApInvoiceDecorator screen to use for this webapp; referred to as a context variable in screen def XML files.</description> + </context-param> <filter> <filter-name>ContextFilter</filter-name> Added: ofbiz/trunk/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl?rev=791531&view=auto ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl (added) +++ ofbiz/trunk/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl Mon Jul 6 16:11:52 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. +--> + +<#if invoices?has_content > + <form name="ListPurchaseInvoices"> + <table class="basic-table hover-bar" cellspacing="0"> + <#-- Header Begins --> + <tr class="header-row-2"> + <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> + <#if invoicePaymentInfo.outstandingAmount != 0> + <#assign statusItem = invoice.getRelatedOneCache("StatusItem")> + <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>${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> + </#if> + </#list> + </table> + </form> +<#else> + <td colspan='4'><h3>${uiLabelMap.AccountingNoInvoicesFound}</h3></td> +</#if> Propchange: ofbiz/trunk/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: ofbiz/trunk/applications/accounting/widget/ap/CommonScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/ap/CommonScreens.xml?rev=791531&r1=791530&r2=791531&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/ap/CommonScreens.xml (original) +++ ofbiz/trunk/applications/accounting/widget/ap/CommonScreens.xml Mon Jul 6 16:11:52 2009 @@ -28,6 +28,7 @@ <set field="applicationMenuName" value="ApAppBar" global="true"/> <set field="applicationMenuLocation" value="component://accounting/widget/ap/Menus.xml" global="true"/> <set field="applicationTitle" value="${uiLabelMap.AccountingApManagerApplication}" global="true"/> + <set field="invoiceMenuLocation" value="component://accounting/widget/ap/ApInvoiceMenus.xml" global="true"/> </actions> <widgets> <include-screen name="ApplicationDecorator" location="component://commonext/widget/CommonScreens.xml"/> @@ -209,6 +210,27 @@ </widgets> </section> </screen> + + <screen name="CommonApInvoiceDecorator"> + <section> + <actions> + <set field="headerItem" value="invoices"/> + </actions> + <widgets> + <decorator-screen name="main-decorator" location="${parameter.mainDecoratorLocation}"> + <decorator-section name="body"> + <section> + <widgets> + <include-menu location="component://accounting/widget/ap/Menus.xml" name="ApInvoiceTabBar"/> + <container style="clear"/> + <decorator-section-include name="body"/> + </widgets> + </section> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> <screen name="CommonPaymentDecorator"> <section> Modified: ofbiz/trunk/applications/accounting/widget/ap/InvoiceScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/ap/InvoiceScreens.xml?rev=791531&r1=791530&r2=791531&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/ap/InvoiceScreens.xml (original) +++ ofbiz/trunk/applications/accounting/widget/ap/InvoiceScreens.xml Mon Jul 6 16:11:52 2009 @@ -40,4 +40,102 @@ </widgets> </section> </screen> + + <screen name="FindApInvoices"> + <section> + <actions> + <set field="titleProperty" value="AccountingFindApInvoices"/> + <set field="tabButtonItem" value="viewInvoices"/> + <set field="parameters.sortField" from-field="parameters.sortField" default-value="-invoiceDate"/> + <script location="component://accounting/webapp/ap/WEB-INF/actions/invoices/FindApInvoices.groovy"/> + </actions> + <widgets> + <decorator-screen name="CommonApInvoiceDecorator" location="${parameters.CommonApInvoiceDecoratorLocation}"> + <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="NewPurchaseInvoice" text="${uiLabelMap.CommonCreateNew}" style="buttontext"/> + </container> + </decorator-section> + <decorator-section name="search-options"> + <include-form name="FindApInvoices" location="component://accounting/widget/ap/forms/InvoiceForms.xml"/> + </decorator-section> + <decorator-section name="search-results"> + <include-form name="ListApInvoices" location="component://accounting/widget/ap/forms/InvoiceForms.xml"/> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> + + <screen name="FindPurchaseInvoices"> + <section> + <actions> + <set field="titleProperty" value="AccountingFindPurchaseInvoices"/> + <set field="tabButtonItem" value="purchaseInvoices"/> + <entity-condition entity-name="Invoice" list="invoices"> + <condition-list combine="and"> + <condition-expr field-name="invoiceTypeId" operator="equals" from-field="parameters.invoiceTypeId" ignore-if-empty="false"/> + <condition-expr field-name="partyIdFrom" operator="equals" from-field="parameters.partyIdFrom" ignore-if-empty="true"/> + <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="dueDate" operator="greater-equals" from-field="parameters.fromDueDate" ignore-if-empty="true"/> + <condition-expr field-name="dueDate" operator="less-equals" from-field="parameters.thruDueDate" 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="partyIdFrom"/> + </entity-condition> + </actions> + <widgets> + <decorator-screen name="CommonApInvoiceDecorator" location="${parameters.CommonApInvoiceDecoratorLocation}"> + <decorator-section name="body"> + <section> + <widgets> + <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml"> + <decorator-section name="search-options"> + <include-form name="FindPurchaseInvoices" 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/PurchaseInvoices.ftl"/></html> + </platform-specific> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> + + <screen name="NewPurchaseInvoice"> + <section> + <actions> + <set field="titleProperty" value="AccountingCreateNewInvoice"/> + <set field="headerItem" value="invoices"/> + <entity-one entity-name="Invoice" value-field="invoice"/> + </actions> + <widgets> + <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}"> + <decorator-section name="body"> + <section> + <widgets> + <screenlet title="${uiLabelMap.AccountingCreateNewPurchaseInvoice}"> + <include-form name="NewPurchaseInvoice" location="component://accounting/webapp/accounting/invoice/InvoiceForms.xml"/> + </screenlet> + </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=791531&r1=791530&r2=791531&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/ap/Menus.xml (original) +++ ofbiz/trunk/applications/accounting/widget/ap/Menus.xml Mon Jul 6 16:11:52 2009 @@ -20,7 +20,7 @@ <menus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-menu.xsd"> <menu name="ApAppBar" title="${uiLabelMap.AccountingApManagerApplication}" extends="CommonAppBarMenu" extends-resource="component://common/widget/CommonMenus.xml"> <menu-item name="agreements" title="${uiLabelMap.AccountingAgreements}"><link target="FindAgreement"/></menu-item> - <menu-item name="invoices" title="${uiLabelMap.AccountingInvoicesMenu}"><link target="findInvoices"/></menu-item> + <menu-item name="invoices" title="${uiLabelMap.AccountingInvoicesMenu}"><link target="FindApInvoices"/></menu-item> <menu-item name="payments" title="${uiLabelMap.AccountingPaymentsMenu}"><link target="findPayments"/></menu-item> <menu-item name="findVendors" title="${uiLabelMap.PartyVendor} ${uiLabelMap.CommonList}"><link target="findVendors"/></menu-item> <menu-item name="reports" title="${uiLabelMap.AccountingReports}"><link target="listReports"/></menu-item> @@ -57,16 +57,26 @@ </menu> <menu name="ApMainInvoiceTypeMenu" type="simple" default-selected-style="selected"> <menu-item name="findInvoice" title="${uiLabelMap.AccountingShowInvoices} ${invoiceType.description}"> - <link target="findInvoices"> + <link target="FindApInvoices"> <parameter param-name="lookupFlag" value="Y"/> </link> </menu-item> </menu> <menu name="ApMainInvoiceStatusMenu" type="simple" default-selected-style="selected"> <menu-item name="findInvoice" title="${uiLabelMap.AccountingShowInvoices} ${invoicesStatus.description}"> - <link target="findInvoices"> + <link target="FindApInvoices"> <parameter param-name="lookupFlag" value="Y"/> </link> </menu-item> </menu> + + <menu name="ApInvoiceTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml" + default-menu-item-name="viewInvoices"> + <menu-item name="viewInvoices" title="${uiLabelMap.CommonMain}"> + <link target="FindApInvoices"/> + </menu-item> + <menu-item name="purchaseInvoices" title="${uiLabelMap.AccountingPurchaseInvoices}"> + <link target="FindPurchaseInvoices"/> + </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=791531&r1=791530&r2=791531&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/ap/forms/InvoiceForms.xml (original) +++ ofbiz/trunk/applications/accounting/widget/ap/forms/InvoiceForms.xml Mon Jul 6 16:11:52 2009 @@ -66,4 +66,75 @@ <field name="total" widget-area-style="align-text"><display type="currency" currency="${currencyUomId}"/></field> <field name="amountToApply" widget-area-style="align-text"><display type="currency" currency="${currencyUomId}"/></field> </form> + + <form name="FindApInvoices" type="single" target="FindApInvoices" extends="FindInvoices" extends-resource="component://accounting/webapp/accounting/invoice/InvoiceForms.xml"> + <field position="1" name="invoiceTypeId"> + <drop-down allow-empty="true"> + <entity-options entity-name="InvoiceType" description="${description}"> + <entity-constraint name="parentTypeId" value="PURCHASE_INVOICE"/> + </entity-options> + </drop-down> + </field> + </form> + + <form name="ListApInvoices" type="list" separate-columns="true" list-name="invoices" default-entity-name="Invoice" + odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar"> + <row-actions> + <service service-name="getPartyNameForDate" result-map="partyNameResultFrom"> + <field-map field-name="partyId" from-field="partyIdFrom"/> + <field-map field-name="compareDate" from-field="invoiceDate"/> + <field-map field-name="lastNameFirst" value="Y"/> + </service> + <service service-name="getPartyNameForDate" result-map="partyNameResultTo"> + <field-map field-name="partyId" from-field="partyId"/> + <field-map field-name="compareDate" from-field="invoiceDate"/> + <field-map field-name="lastNameFirst" value="Y"/> + </service> + <set field="amountToApply" default-value="0" value="${groovy:org.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceNotApplied(delegator,invoiceId) + .multiply(org.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceCurrencyConversionRate(delegator,invoiceId))}"/> + <set field="total" default-value="0" value="${groovy:org.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceTotal(delegator,invoiceId) + .multiply(org.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceCurrencyConversionRate(delegator,invoiceId))}"/> + <set field="currencyUomId" from-field="defaultOrganizationPartyCurrencyUomId"/> + </row-actions> + + <field name="invoiceId" widget-style="buttontext" sort-field="true"> + <hyperlink description="${invoiceId}" target="invoiceOverview"> + <parameter param-name="invoiceId"/> + </hyperlink> + </field> + <field name="invoiceTypeId" sort-field="true"><display-entity entity-name="InvoiceType" description="${description}"/></field> + <field name="invoiceDate" sort-field="true"><display type="date"/></field> + <field name="statusId" sort-field="true"><display-entity entity-name="StatusItem" description="${description}"/></field> + <field name="description" sort-field="true"><display/></field> + <field name="partyIdFrom" sort-field="true"> + <hyperlink target="/partymgr/control/PartyFinancialHistory" target-type="inter-app" description="${partyNameResultFrom.fullName} [${partyIdFrom}]"> + <parameter param-name="partyId" from-field="partyIdFrom"/> + </hyperlink> + </field> + <field name="partyIdTo" parameter-name="partyId"> + <hyperlink target="/partymgr/control/PartyFinancialHistory" target-type="inter-app" description="${partyNameResultTo.fullName} [${partyId}]"> + <parameter param-name="partyId"/> + </hyperlink> + </field> + <field name="total" widget-area-style="align-text"><display type="currency" currency="${currencyUomId}"/></field> + <field name="amountToApply" widget-area-style="align-text"><display type="currency" currency="${currencyUomId}"/></field> + </form> + + <form name="FindPurchaseInvoices" type="single" target="FindPurchaseInvoices"> + <field name="partyIdFrom" title="${uiLabelMap.AccountingVendorParty}" position="1"><lookup target-form-name="LookupPartyName"/></field> + <field name="statusId" position="2"> + <drop-down allow-empty="true"> + <entity-options entity-name="StatusItem" description="${description}"> + <entity-constraint name="statusTypeId" operator="equals" value="INVOICE_STATUS"/> + </entity-options> + </drop-down> + </field> + <field name="invoiceTypeId"><hidden value="PURCHASE_INVOICE"/></field> + <field name="fromInvoiceDate" position="1"><date-time/></field> + <field name="thruInvoiceDate" position="2"><date-time/></field> + <field name="fromDueDate" position="1"><date-time/></field> + <field name="thruDueDate" position="2"><date-time/></field> + <field name="search" widget-style="smallSubmit"><submit button-type="button"/></field> + </form> + </forms> \ No newline at end of file |
Free forum by Nabble | Edit this page |