Author: apatel
Date: Fri Jul 31 08:51:17 2009 New Revision: 799547 URL: http://svn.apache.org/viewvc?rev=799547&view=rev Log: Now deposit slip can be printed from finAccountTransaction. Thanks Chirag, Rishi OFBIZ-2727. 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/finaccounttrans/FinAccountTrans.ftl ofbiz/trunk/applications/accounting/webapp/accounting/reports/DepositSlip.fo.ftl ofbiz/trunk/applications/accounting/widget/PaymentGroupScreens.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=799547&r1=799546&r2=799547&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 Fri Jul 31 08:51:17 2009 @@ -618,4 +618,24 @@ <call-service service-name="expirePaymentGroupMember" in-map-name="expirePaymentGroupMemberMap"/> </iterate> </simple-method> + + <simple-method method-name="getPayments" short-description="Get list of payment"> + <set field="paymentGroupId" from-field="parameters.paymentGroupId"/> + <if-not-empty field="paymentGroupId"> + <entity-and entity-name="PaymentGroupMember" list="paymentGroupMembers" filter-by-date="true"> + <field-map field-name="paymentGroupId"/> + </entity-and> + <set field="paymentIds" value="${groovy:org.ofbiz.entity.util.EntityUtil.getFieldListFromEntityList(paymentGroupMembers, 'paymentId', true);}" type="List"/> + <entity-condition entity-name="Payment" list="payments"> + <condition-expr field-name="paymentId" operator="in" from-field="paymentIds"/> + </entity-condition> + </if-not-empty> + <set field="finAccountTransId" from-field="parameters.finAccountTransId"/> + <if-not-empty field="finAccountTransId"> + <entity-and entity-name="Payment" list="payments"> + <field-map field-name="finAccountTransId"/> + </entity-and> + </if-not-empty> + <field-to-result field="payments"/> + </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=799547&r1=799546&r2=799547&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/servicedef/services_payment.xml (original) +++ ofbiz/trunk/applications/accounting/servicedef/services_payment.xml Fri Jul 31 08:51:17 2009 @@ -205,5 +205,12 @@ <auto-attributes entity-name="FinAccountTrans" include="pk" mode="INOUT" optional="true"/> <attribute name="invoiceIds" type="List" mode="IN" optional="true"/> </service> + <service name="getPayments" engine="simple" + location="component://accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml" invoke="getPayments" auth="true"> + <description>Get list of payment</description> + <attribute name="paymentGroupId" type="String" mode="IN" optional="true"/> + <attribute name="finAccountTransId" type="String" mode="IN" optional="true"/> + <attribute name="payments" type="List" mode="OUT" optional="true"/> + </service> </services> Modified: ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl?rev=799547&r1=799546&r2=799547&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl Fri Jul 31 08:51:17 2009 @@ -165,6 +165,7 @@ <script type="text/javascript"> new Popup('displayPayments_${finAccountTrans.finAccountTransId}','togglePayment_${finAccountTrans.finAccountTransId}', {modal: true, position: 'center', trigger: 'click'}) </script> + <a href="<@ofbizUrl>DepositSlip.pdf?finAccountTransId=${finAccountTrans.finAccountTransId}</@ofbizUrl>" class="buttontext">${uiLabelMap.AccountingDepositSlip}</a> <#else> ${finAccountTrans.finAccountTransId} </#if> Modified: ofbiz/trunk/applications/accounting/webapp/accounting/reports/DepositSlip.fo.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/reports/DepositSlip.fo.ftl?rev=799547&r1=799546&r2=799547&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/reports/DepositSlip.fo.ftl (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/reports/DepositSlip.fo.ftl Fri Jul 31 08:51:17 2009 @@ -20,10 +20,16 @@ <#escape x as x?xml> <fo:block font-size="14pt" font-weight="bold" text-align="center">${uiLabelMap.AccountingDepositSlip}</fo:block> <fo:block font-size="12pt" text-align="left" font-weight="bold"> - ${uiLabelMap.AccountingPaymentGroupId} : ${paymentGroup.paymentGroupId?if_exists} + <#if paymentGroup?has_content> + ${uiLabelMap.AccountingPaymentGroupId} : ${parameters.paymentGroupId?if_exists} + <#else> + ${uiLabelMap.FormFieldTitle_finAccountTransId} : ${parameters.finAccountTransId?if_exists} + </#if> </fo:block> <fo:block font-size="12pt" text-align="left"> - ${uiLabelMap.AccountingPaymentGroupName} : ${paymentGroup.paymentGroupName?if_exists} + <#if paymentGroup?has_content> + ${uiLabelMap.AccountingPaymentGroupName} : ${paymentGroup.paymentGroupName?if_exists} + </#if> </fo:block> <fo:block><fo:leader/></fo:block> <fo:block space-after.optimum="10pt" font-size="10pt"> @@ -53,10 +59,9 @@ </fo:table-row> </fo:table-header> <fo:table-body> - <#if paymentGroupMembers?has_content> + <#if payments?has_content> <#assign totalAmount = 0> - <#list paymentGroupMembers as paymentGroupMember> - <#assign payment = delegator.findOne("Payment", {"paymentId" : paymentGroupMember.paymentId}, false)/> + <#list payments as payment> <#if payment.paymentTypeId?has_content> <#assign paymentType = delegator.findOne("PaymentType", {"paymentTypeId" : payment.paymentTypeId}, false)/> </#if> Modified: ofbiz/trunk/applications/accounting/widget/PaymentGroupScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/PaymentGroupScreens.xml?rev=799547&r1=799546&r2=799547&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/PaymentGroupScreens.xml (original) +++ ofbiz/trunk/applications/accounting/widget/PaymentGroupScreens.xml Fri Jul 31 08:51:17 2009 @@ -127,11 +127,9 @@ <actions> <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/> <property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/> - <set field="paymentGroupId" from-field="parameters.paymentGroupId"/> <entity-one entity-name="PaymentGroup" value-field="paymentGroup"/> - <entity-and entity-name="PaymentGroupMember" list="paymentGroupMembers" filter-by-date="true"> - <field-map field-name="paymentGroupId"/> - </entity-and> + <service service-name="getPayments" result-map="getPaymentsMap"/> + <set field="payments" from-field="getPaymentsMap.payments"/> </actions> <widgets> <decorator-screen name="SimpleDecorator" location="component://common/widget/CommonScreens.xml"> @@ -144,4 +142,4 @@ </widgets> </section> </screen> -</screens> \ No newline at end of file +</screens> |
Free forum by Nabble | Edit this page |