Author: jacopoc
Date: Mon Dec 17 10:48:45 2007 New Revision: 604964 URL: http://svn.apache.org/viewvc?rev=604964&view=rev Log: Implemented very simple screens to search for invoices by due date; they will be enhanced soon. OFBIZ-1530 Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml ofbiz/trunk/applications/accounting/servicedef/services_payment.xml ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml ofbiz/trunk/applications/accounting/webapp/accounting/payment/PaymentForms.xml ofbiz/trunk/applications/accounting/widget/PaymentScreens.xml Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml?rev=604964&r1=604963&r2=604964&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml (original) +++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml Mon Dec 17 10:48:45 2007 @@ -244,7 +244,12 @@ </simple-method> <simple-method method-name="getInvoicePaymentInfoList" short-description="Create a list with information on payment due dates and amounts for the invoice"> - <entity-one entity-name="Invoice" value-name="invoice"/> + <if-empty field-name="parameters.invoice"> + <entity-one entity-name="Invoice" value-name="invoice"/> + <else> + <set field="invoice" from-field="parameters.invoice"/> + </else> + </if-empty> <call-class-method class-name="org.ofbiz.accounting.invoice.InvoiceWorker" method-name="getInvoiceTotalBd" ret-field-name="invoiceTotalAmount"> <field field-name="invoice" type="org.ofbiz.entity.GenericValue"/> </call-class-method> @@ -342,6 +347,45 @@ </then> </if> <field-to-result field-name="invoicePaymentInfoList" result-name="invoicePaymentInfoList"/> + </simple-method> + + <simple-method method-name="getInvoicePaymentInfoListByDueDateOffset" short-description="Select a list with information on payment due dates and amounts for invoices."> + <now-timestamp-to-env env-name="nowTimestamp"/> + <call-class-method class-name="org.ofbiz.base.util.UtilDateTime" method-name="getDayEnd" ret-field-name="asOfDate"> + <field field-name="nowTimestamp" type="Timestamp"/> + <field field-name="parameters.daysOffset" type="Long"/> + </call-class-method> + <entity-condition entity-name="Invoice" list-name="invoices"> + <condition-list combine="and"> + <condition-expr field-name="invoiceTypeId" operator="equals" env-name="parameters.invoiceTypeId"/> + <condition-expr field-name="partyId" operator="equals" env-name="parameters.partyId" ignore-if-empty="true"/> + <condition-expr field-name="partyIdFrom" operator="equals" env-name="parameters.partyIdFrom" ignore-if-empty="true"/> + <condition-expr field-name="statusId" operator="not-equals" value="INVOICE_CANCELLED"/> + <condition-expr field-name="statusId" operator="not-equals" value="INVOICE_PAID"/> + </condition-list> + <order-by field-name="invoiceDate"/> + </entity-condition> + <iterate list-name="invoices" entry-name="invoice"> + <clear-field field-name="getInvoicePaymentInfoListInMap"/> + <set field="getInvoicePaymentInfoListInMap.invoice" from-field="invoice"/> + <call-service service-name="getInvoicePaymentInfoList" in-map-name="getInvoicePaymentInfoListInMap"> + <result-to-field field-name="invoicePaymentInfoList" result-name="invoicePaymentInfoList"/> + </call-service> + <iterate list-name="invoicePaymentInfoList" entry-name="invoicePaymentInfo"> + <if> + <condition> + <and> + <if-compare field-name="invoicePaymentInfo.outstandingAmount" operator="greater" value="0.0" type="BigDecimal"/> + <if-compare-field field-name="invoicePaymentInfo.dueDate" operator="less" to-field-name="asOfDate" type="Timestamp"/> + </and> + </condition> + <then> + <set field="selectedInvoicePaymentInfoList[]" from-field="invoicePaymentInfo"/> + </then> + </if> + </iterate> + </iterate> + <field-to-result field-name="selectedInvoicePaymentInfoList" result-name="invoicePaymentInfoList"/> </simple-method> </simple-methods> Modified: ofbiz/trunk/applications/accounting/servicedef/services_payment.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/services_payment.xml?rev=604964&r1=604963&r2=604964&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/servicedef/services_payment.xml (original) +++ ofbiz/trunk/applications/accounting/servicedef/services_payment.xml Mon Dec 17 10:48:45 2007 @@ -128,8 +128,16 @@ <service name="getInvoicePaymentInfoList" engine="simple" location="org/ofbiz/accounting/payment/PaymentServices.xml" invoke="getInvoicePaymentInfoList" auth="true"> - <description>Create a list with information on payment due dates and amounts for the invoice</description> - <attribute name="invoiceId" type="String" mode="IN" optional="false"/> + <description>Create a list with information on payment due dates and amounts for the invoice; one of invoiceId or invoice must be provided.</description> + <attribute name="invoiceId" type="String" mode="IN" optional="true"/> + <attribute name="invoice" type="GenericValue" mode="IN" optional="true"/> <attribute name="invoicePaymentInfoList" type="List" mode="OUT" optional="false"/> + </service> + <service name="getInvoicePaymentInfoListByDueDateOffset" engine="simple" + location="org/ofbiz/accounting/payment/PaymentServices.xml" invoke="getInvoicePaymentInfoListByDueDateOffset" auth="true"> + <description>Create a list with information on payment due dates and amounts.</description> + <attribute name="invoiceTypeId" type="String" mode="IN" optional="false"/> + <attribute name="daysOffset" type="Long" mode="IN" optional="false"/> + <attribute name="invoicePaymentInfoList" type="List" mode="OUT" optional="true"/> </service> </services> 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=604964&r1=604963&r2=604964&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml Mon Dec 17 10:48:45 2007 @@ -343,6 +343,28 @@ <response name="success" type="view" value="ListChecksToSend"/> <response name="error" type="view" value="ListChecksToSend"/> </request-map> + + <request-map uri="FindSalesInvoicesByDueDate"> + <security https="true" auth="true"/> + <response name="success" type="view" value="FindSalesInvoicesByDueDate"/> + </request-map> + <request-map uri="findSalesInvoicesByDueDate"> + <security https="true" auth="true"/> + <event type="service" invoke="getInvoicePaymentInfoListByDueDateOffset"/> + <response name="success" type="view" value="FindSalesInvoicesByDueDate"/> + <response name="error" type="view" value="FindSalesInvoicesByDueDate"/> + </request-map> + <request-map uri="FindPurchaseInvoicesByDueDate"> + <security https="true" auth="true"/> + <response name="success" type="view" value="FindPurchaseInvoicesByDueDate"/> + </request-map> + <request-map uri="findPurchaseInvoicesByDueDate"> + <security https="true" auth="true"/> + <event type="service" invoke="getInvoicePaymentInfoListByDueDateOffset"/> + <response name="success" type="view" value="FindPurchaseInvoicesByDueDate"/> + <response name="error" type="view" value="FindPurchaseInvoicesByDueDate"/> + </request-map> + <!-- transaction page requests --> <request-map uri="FindGatewayResponses"> <security https="true" auth="true"/> @@ -1662,7 +1684,9 @@ <view-map name="editPaymentApplications" type="screen" page="component://accounting/widget/PaymentScreens.xml#EditPaymentApplications"/> <view-map name="ManualTransaction" type="screen" page="component://accounting/widget/PaymentScreens.xml#ManualTransaction"/> <view-map name="PrintChecks" type="screenfop" page="component://accounting/widget/PaymentScreens.xml#PrintChecks" content-type="application/pdf" encoding="none"/> - + <view-map name="FindSalesInvoicesByDueDate" type="screen" page="component://accounting/widget/PaymentScreens.xml#FindSalesInvoicesByDueDate"/> + <view-map name="FindPurchaseInvoicesByDueDate" type="screen" page="component://accounting/widget/PaymentScreens.xml#FindPurchaseInvoicesByDueDate"/> + <!-- Party Accounts --> <view-map name="PartyAccountsSummary" type="screen" page="component://accounting/widget/GlScreens.xml#PartyAccountsSummary"/> <view-map name="FindAcctgTrans" type="screen" page="component://accounting/widget/GlScreens.xml#FindAcctgTrans"/> Modified: ofbiz/trunk/applications/accounting/webapp/accounting/payment/PaymentForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/payment/PaymentForms.xml?rev=604964&r1=604963&r2=604964&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/payment/PaymentForms.xml (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/payment/PaymentForms.xml Mon Dec 17 10:48:45 2007 @@ -428,4 +428,45 @@ <field name="_rowSubmit" title="${uiLabelMap.CommonSelect}"><check/></field> <field name="submitButton" title="${uiLabelMap.CommonSend}" widget-style="smallSubmit"><submit/></field> </form> + + <form name="FindSalesInvoicesByDueDate" type="single" target="findSalesInvoicesByDueDate"> + <field name="invoiceTypeId"><hidden value="SALES_INVOICE"/></field> + <field name="organizationPartyId" parameter-name="partyIdFrom"> + <drop-down allow-empty="false"> + <entity-options description="${partyId}" entity-name="PartyAcctgPreference" key-field-name="partyId"> + <entity-order-by field-name="partyId"/> + </entity-options> + </drop-down> + </field> + <field name="partyId"><lookup target-form-name="LookupPartyName"/></field> + <field name="daysOffset"><text default-value="0"/></field> + <field name="searchButton" title="${uiLabelMap.CommonSelect}"> + <submit button-type="button"/> + </field> + </form> + <form name="FindPurchaseInvoicesByDueDate" type="single" target="findPurchaseInvoicesByDueDate"> + <field name="invoiceTypeId"><hidden value="PURCHASE_INVOICE"/></field> + <field name="organizationPartyId" parameter-name="partyId"> + <drop-down allow-empty="false"> + <entity-options description="${partyId}" entity-name="PartyAcctgPreference" key-field-name="partyId"> + <entity-order-by field-name="partyId"/> + </entity-options> + </drop-down> + </field> + <field name="partyIdFrom"><lookup target-form-name="LookupPartyName"/></field> + <field name="daysOffset"><text default-value="0"/></field> + <field name="searchButton" title="${uiLabelMap.CommonSelect}"> + <submit button-type="button"/> + </field> + </form> + <form name="ListInvoicesByDueDate" type="list" list-name="invoicePaymentInfoList"> + <field name="invoiceId" widget-style="buttontext"><hyperlink target="invoiceOverview?invoiceId=${invoiceId}" description="${invoiceId}"/></field> + <field name="termTypeId"> + <display-entity entity-name="TermType" description="${description}"/> + </field> + <field name="dueDate"><display/></field> + <field name="amount"><display/></field> + <field name="paidAmount"><display/></field> + <field name="outstandingAmount"><display/></field> + </form> </forms> Modified: ofbiz/trunk/applications/accounting/widget/PaymentScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/PaymentScreens.xml?rev=604964&r1=604963&r2=604964&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/PaymentScreens.xml (original) +++ ofbiz/trunk/applications/accounting/widget/PaymentScreens.xml Mon Dec 17 10:48:45 2007 @@ -32,7 +32,11 @@ <widgets> <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}"> <decorator-section name="body"> - <container><link target="newPayment" text="${uiLabelMap.CommonCreateNew} ${uiLabelMap.AccountingPayment}" style="buttontext"/></container> + <container> + <link target="newPayment" text="${uiLabelMap.CommonCreateNew} ${uiLabelMap.AccountingPayment}" style="buttontext"/> + <link target="FindSalesInvoicesByDueDate" text="Find Sales Invoices By Due Date" style="buttontext"/> + <link target="FindPurchaseInvoicesByDueDate" text="Find Purchase Invoices By Due Date" style="buttontext"/> + </container> <container><label style="head1" text="${uiLabelMap.AccountingFindPayments}"/></container> <include-form name="FindPayments" location="component://accounting/webapp/accounting/payment/PaymentForms.xml"/> <include-form name="ListPayments" location="component://accounting/webapp/accounting/payment/PaymentForms.xml"/> @@ -383,4 +387,64 @@ </widgets> </section> </screen> + + <screen name="FindSalesInvoicesByDueDate"> + <section> + <actions> + <set field="title" value="Find Invoices By Due Date"/> + <set field="titleProperty" value="PageTitleFindInvoicesByDueDate"/> + <set field="headerItem" value="payments"/> + <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer" default-value="0"/> + <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="50"/> + + <set field="invoicePaymentInfoList" from-field="parameters.invoicePaymentInfoList" type="List"/> + </actions> + <widgets> + <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}"> + <decorator-section name="body"> + <container><label style="head1" text="Sales Invoices"/></container> + <include-form name="FindSalesInvoicesByDueDate" location="component://accounting/webapp/accounting/payment/PaymentForms.xml"/> + <section> + <condition> + <not><if-empty field-name="invoicePaymentInfoList"/></not> + </condition> + <widgets> + <include-form name="ListInvoicesByDueDate" location="component://accounting/webapp/accounting/payment/PaymentForms.xml"/> + </widgets> + </section> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> + <screen name="FindPurchaseInvoicesByDueDate"> + <section> + <actions> + <set field="title" value="Find Invoices By Due Date"/> + <set field="titleProperty" value="PageTitleFindInvoicesByDueDate"/> + <set field="headerItem" value="payments"/> + <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer" default-value="0"/> + <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="50"/> + + <set field="invoicePaymentInfoList" from-field="parameters.invoicePaymentInfoList" type="List"/> + </actions> + <widgets> + <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}"> + <decorator-section name="body"> + <container><label style="head1" text="Purchase Invoices"/></container> + <include-form name="FindPurchaseInvoicesByDueDate" location="component://accounting/webapp/accounting/payment/PaymentForms.xml"/> + <section> + <condition> + <not><if-empty field-name="invoicePaymentInfoList"/></not> + </condition> + <widgets> + <include-form name="ListInvoicesByDueDate" location="component://accounting/webapp/accounting/payment/PaymentForms.xml"/> + </widgets> + </section> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> + </screens> |
Free forum by Nabble | Edit this page |