Author: apatel
Date: Sat Nov 7 06:27:52 2009 New Revision: 833636 URL: http://svn.apache.org/viewvc?rev=833636&view=rev Log: Adding mass payment status change to find screen. Also added few more details in payments list. Modified: ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml ofbiz/trunk/applications/accounting/servicedef/services_payment.xml ofbiz/trunk/applications/accounting/webapp/ar/WEB-INF/controller.xml ofbiz/trunk/applications/accounting/webapp/ar/payment/batchPayments.ftl Modified: ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml?rev=833636&r1=833635&r2=833636&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml (original) +++ ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml Sat Nov 7 06:27:52 2009 @@ -7695,6 +7695,10 @@ <value xml:lang="en">Payment status must be received or sent</value> <value xml:lang="hi_IN">à¤à¥à¤à¤¤à¤¾à¤¨ à¤à¥ सà¥à¤¥à¤¿à¤¤à¤¿ 'पà¥à¤°à¤¾à¤ªà¥à¤¤' या 'à¤à¥à¤à¤¾ दिया' हà¥à¤¨à¤¾ à¤à¤¾à¤¹à¤¿à¤</value> </property> + <property key="AccountingPaymentStatusToNotPaid"> + <value xml:lang="en">Status to "Not Paid"</value> + <value xml:lang="hi_IN">à¤à¥à¤à¤¤à¤¾à¤¨ नहà¥à¤ दिया</value> + </property> <property key="AccountingPermissionError"> <value xml:lang="ar">Ùا رخصة ÙدÙÙÙ ÙÙذ٠اÙع٠ÙÙØ©</value> <value xml:lang="de">Sie haben keine Berechtigung für diese Funktion.</value> 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=833636&r1=833635&r2=833636&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 Sat Nov 7 06:27:52 2009 @@ -694,4 +694,13 @@ </else> </if-not-empty> </simple-method> + + <simple-method method-name="massChangePaymentStatus" short-description="Service set status of Payments in bulk."> + <iterate list="parameters.paymentIds" entry="paymentId"> + <set field="setPaymentStatusMap.paymentId" from-field="paymentId"/> + <set field="setPaymentStatusMap.statusId" from-field="parameters.statusId"/> + <call-service service-name="setPaymentStatus" in-map-name="setPaymentStatusMap"/> + <clear-field field="setPaymentStatusMap"/> + </iterate> + </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=833636&r1=833635&r2=833636&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/servicedef/services_payment.xml (original) +++ ofbiz/trunk/applications/accounting/servicedef/services_payment.xml Sat Nov 7 06:27:52 2009 @@ -225,4 +225,12 @@ <description>Check the valid(unbatched) payment and create batch for same</description> <implements service="createPaymentGroupAndMember"/> </service> + + <service name="massChangePaymentStatus" engine="simple" + location="component://accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml" invoke="massChangePaymentStatus" auth="true"> + <description>Set status of Payments in bulk.</description> + <attribute name="paymentIds" type="List" mode="IN" optional="false"/> + <attribute name="statusId" type="String" mode="IN" optional="false"/> + <attribute name="errorMessage" type="String" optional="true" mode="OUT"/> + </service> </services> 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=833636&r1=833635&r2=833636&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/ar/WEB-INF/controller.xml (original) +++ ofbiz/trunk/applications/accounting/webapp/ar/WEB-INF/controller.xml Sat Nov 7 06:27:52 2009 @@ -83,7 +83,12 @@ <security https="true" auth="true"/> <response name="success" type="view" value="FindArPaymentGroups"/> </request-map> - + <request-map uri="massChangePaymentStatus"> + <security https="true" auth="true"/> + <event type="service" invoke="massChangePaymentStatus"/> + <response name="success" type="view" value="BatchPayments"/> + <response name="error" type="view" value="BatchPayments"/> + </request-map> <!-- end of request mappings --> <!-- View Mappings --> Modified: ofbiz/trunk/applications/accounting/webapp/ar/payment/batchPayments.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/ar/payment/batchPayments.ftl?rev=833636&r1=833635&r2=833636&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/ar/payment/batchPayments.ftl (original) +++ ofbiz/trunk/applications/accounting/webapp/ar/payment/batchPayments.ftl Sat Nov 7 06:27:52 2009 @@ -17,136 +17,183 @@ under the License. --> -<script language="JavaScript" type="text/javascript"> -<!-- // +<script type="text/javascript"> +//<![CDATA[ function togglePaymentId(master) { - var form = document.paymentBatchForm; - var payments = form.elements.length; - for (var i = 0; i < payments; i++) { - var element = form.elements[i]; - if (element.name == "paymentIds") { - element.checked = master.checked; - } - } + var payments = $('paymentBatchForm').getInputs('checkbox','paymentIds'); + payments.each(function(payment){ + payment.checked = master.checked; + }); getPaymentRunningTotal(); } function getPaymentRunningTotal() { - var form = document.paymentBatchForm; - var payments = form.elements.length; - var isSingle = true; - var isAllSelected = true; - for (var i = 0; i < payments; i++) { - var element = form.elements[i]; - if (element.name == "paymentIds") { - if (element.checked) { - isSingle = false; - } else { - isAllSelected = false; - } - } - } - if (isAllSelected) { + var payments = $('paymentBatchForm').getInputs('checkbox','paymentIds'); + if(payments.pluck('checked').all()) { $('checkAllPayments').checked = true; } else { $('checkAllPayments').checked = false; } - if (!isSingle) { - $('submitButton').disabled = false; + + if(payments.pluck('checked').any()) { new Ajax.Request('getPaymentRunningTotal', { asynchronous: false, onSuccess: function(transport) { var data = transport.responseText.evalJSON(true); $('showPaymentRunningTotal').update(data.paymentRunningTotal); - }, parameters: $('paymentBatchForm').serialize(), requestHeaders: {Accept: 'application/json'} + }, + parameters: $('paymentBatchForm').serialize(), + requestHeaders: {Accept: 'application/json'} }); + if($F('serviceName') != "") { + $('submitButton').disabled = false; + } + } else { $('submitButton').disabled = true; $('showPaymentRunningTotal').update(""); } } function setServiceName(selection) { - $('paymentBatchForm').action = '<@ofbizUrl>'+selection.value+'</@ofbizUrl>'; - showCreatePaymentBatch(selection); - $('submitButton').disabled = true; -} -function showCreatePaymentBatch(selection) { - if (selection.value == 'createPaymentBatch') { - Effect.BlindDown('createPaymentBatch',{duration: 0.0}); + if (selection.value == 'massPaymentsToNotPaid' || selection.value == 'massPaymentsToSent' || selection.value == 'massPaymentsToReceived' || selection.value == 'massPaymentsToConfirmed' || selection.value == 'massPaymentsToCancelled' || selection.value == 'massPaymentsToVoid') { + $('paymentBatchForm').action = $('paymentStatusChange').value; + } + else { + $('paymentBatchForm').action = selection.value; + } + if (selection.value == 'massPaymentsToNotPaid') { + $('statusId').value = "PMNT_NOT_PAID"; + } else if (selection.value == 'massPaymentsToSent') { + $('statusId').value = "PMNT_SENT"; + }else if (selection.value == 'massPaymentsToReceived') { + $('statusId').value = "PMNT_RECEIVED"; + }else if (selection.value == 'massPaymentsToConfirmed') { + $('statusId').value = "PMNT_CONFIRMED"; + }else if (selection.value == 'massPaymentsToCancelled') { + $('statusId').value = "PMNT_CANCELLED"; + }else if (selection.value == 'massPaymentsToVoid') { + $('statusId').value = "PMNT_VOID"; + } + if ($('processBatchPayment').selected) { + Effect.BlindDown('createPaymentBatch'); } else { - Effect.BlindUp('createPaymentBatch',{duration: 0.0}); + Effect.BlindUp('createPaymentBatch'); + } + if($('paymentBatchForm').getInputs('checkbox','paymentIds').pluck('checked').any() && ($F('serviceName') != "")) { + $('submitButton').disabled = false; + } else { + $('submitButton').disabled = true; } -} -// --> +} +//]]> </script> <div class="screenlet"> <div class="screenlet-body"> - <form id="paymentBatchForm" name="paymentBatchForm" method="post" action=""> + <form id="paymentBatchForm" method="post" action=""> <#if paymentList?has_content> - <div> + <div class="clearfix"> + <div class="float-left"> <span class="label">${uiLabelMap.AccountingRunningTotal} :</span> <span class="label" id="showPaymentRunningTotal"></span> </div> - <div align="right"> + <div class="align-float"> <select name="serviceName" id="serviceName" onchange="javascript:setServiceName(this);"> <option value="">${uiLabelMap.AccountingSelectAction}</options> - <option value="createPaymentBatch">${uiLabelMap.AccountingCreateBatch}</option> + <option value="<@ofbizUrl>createPaymentBatch</@ofbizUrl>" id="processBatchPayment">${uiLabelMap.AccountingCreateBatch}</option> + <option value="massPaymentsToNotPaid">${uiLabelMap.AccountingPaymentStatusToNotPaid}</option> + <option value="massPaymentsToSent">${uiLabelMap.AccountingInvoiceStatusToSent}</option> + <option value="massPaymentsToReceived">${uiLabelMap.AccountingInvoiceStatusToReceived}</option> + <option value="massPaymentsToConfirmed">${uiLabelMap.AccountingPaymentTabStatusToConfirmed}</option> + <option value="massPaymentsToCancelled">${uiLabelMap.AccountingPaymentTabStatusToCancelled}</option> + <option value="massPaymentsToVoid">${uiLabelMap.AccountingPaymentTabStatusToVoid}</option> </select> - <input id="submitButton" type="button" onclick="javascript:$('paymentBatchForm').submit();" value="${uiLabelMap.CommonRun}" disabled/> - <input type="hidden" name='organizationPartyId' value="${organizationPartyId?if_exists}"> - <input type="hidden" name='paymentGroupTypeId' value="BATCH_PAYMENT"> - <input type="hidden" name="groupInOneTransaction" value="Y"/> + <input id="submitButton" type="button" onclick="javascript:$('paymentBatchForm').submit();" value="${uiLabelMap.CommonRun}" disabled="disabled" /> + <input type="hidden" name='organizationPartyId' value="${organizationPartyId?if_exists}" /> + <input type="hidden" name='paymentGroupTypeId' value="BATCH_PAYMENT" /> + <input type="hidden" name="groupInOneTransaction" value="Y" /> + <input type="hidden" name="paymentStatusChange" id="paymentStatusChange" value="<@ofbizUrl>massChangePaymentStatus</@ofbizUrl>" /> + <input type="hidden" name="statusId" id="statusId" value="${parameters.statusId?if_exists}" /> <#if finAccountId?has_content> - <input type="hidden" name='finAccountId' value="${finAccountId?if_exists}"> + <input type="hidden" name='finAccountId' value="${finAccountId?if_exists}" /> </#if> - <input type="hidden" name='paymentMethodTypeId' value="${paymentMethodTypeId?if_exists}"> - <input type="hidden" name='cardType' value="${cardType?if_exists}"> - <input type="hidden" name='partyIdFrom' value="${partyIdFrom?if_exists}"> - <input type="hidden" name='fromDate' value="${fromDate?if_exists}"> - <input type="hidden" name='thruDate' value="${thruDate?if_exists}"> + <input type="hidden" name='paymentMethodTypeId' value="${paymentMethodTypeId?if_exists}" /> + <input type="hidden" name='cardType' value="${cardType?if_exists}" /> + <input type="hidden" name='partyIdFrom' value="${partyIdFrom?if_exists}" /> + <input type="hidden" name='fromDate' value="${fromDate?if_exists}" /> + <input type="hidden" name='thruDate' value="${thruDate?if_exists}" /> </div> - <table class="basic-table"> + </div> + <div id="createPaymentBatch" style="display: none;" class="align-float"> + <label for="paymentGroupName">${uiLabelMap.AccountingPaymentGroupName}</label> + <input type="text" size='25' id="paymentGroupName" name='paymentGroupName' /> + <#if finAccounts?has_content> + <label for="finAccountId">${uiLabelMap.AccountingBankAccount}</label> + <select name="finAccountId" id="finAccountId"> + <#list finAccounts as finAccount> + <option value="${finAccount.get("finAccountId")}">${finAccount.get("finAccountName")} [${finAccount.get("finAccountId")}]</option> + </#list> + </select> + </#if> + </div> + <table class="basic-table hover-bar"> + <thead> <tr class="header-row-2"> - <td>${uiLabelMap.FormFieldTitle_paymentId}</td> - <td>${uiLabelMap.Party}</td> - <td>${uiLabelMap.CommonAmount}</td> - <td>${uiLabelMap.CommonDate}</td> - <td align="right"> - ${uiLabelMap.CommonSelectAll} - <input type="checkbox" id="checkAllPayments" name="checkAllPayments" onchange="javascript:togglePaymentId(this);"/> - </td> + <th>${uiLabelMap.FormFieldTitle_paymentId}</th> + <th>${uiLabelMap.AccountingPaymentType}</th> + <th>${uiLabelMap.CommonStatus}</th> + <th>${uiLabelMap.CommonComments}</th> + <th>${uiLabelMap.AccountingFromParty}</th> + <th>${uiLabelMap.AccountingToParty}</th> + <th>${uiLabelMap.AccountingEffectiveDate}</th> + <th>${uiLabelMap.AccountingAmount}</th> + <th>${uiLabelMap.FormFieldTitle_amountToApply}</th> + <th>${uiLabelMap.CommonPaymentMethodType}</th> + <th> + ${uiLabelMap.CommonSelectAll} + <input type="checkbox" id="checkAllPayments" name="checkAllPayments" onchange="javascript:togglePaymentId(this);"/> + </th> </tr> + </thead> + <tbody> <#assign alt_row = false> <#list paymentList as payment> - <tr <#if alt_row> class="alternate-row"</#if>> - <td><a href="<@ofbizUrl>paymentOverview?paymentId=${payment.paymentId}</@ofbizUrl>">${payment.paymentId}</a></td> - <td> - <a href="/partymgr/control/viewprofile?partyId=${payment.partyIdFrom}">${(payment.partyFromFirstName)!} ${(payment.partyFromLastName)!} ${(payment.partyFromGroupName)!}[${(payment.partyIdFrom)!}]</a> - </td> - <td><@ofbizCurrency amount=payment.amount isoCode=payment.currencyUomId/></td> - <td>${payment.effectiveDate?if_exists}</td> - <td align="right"> - <input type="checkbox" id="paymentId_${payment_index}" name="paymentIds" value="${payment.paymentId}" onclick="javascript:getPaymentRunningTotal('paymentId_${payment_index}');"/> - </td> - </tr> + <tr <#if alt_row> class="alternate-row"</#if>> + <td><a href="<@ofbizUrl>paymentOverview?paymentId=${payment.paymentId}</@ofbizUrl>" class="buttontext">${payment.paymentId}</a></td> + <td> + ${payment.paymentTypeDesc?default(payment.paymentTypeId)} + </td> + <td> + ${payment.statusDesc?default(payment.statusId)} + </td> + <td>${(payment.comments)?if_exists}</td> + <td> + <a href="/partymgr/control/viewprofile?partyId=${payment.partyIdFrom}">${(payment.partyFromFirstName)?if_exists} ${(payment.partyFromLastName)?if_exists} ${(payment.partyFromGroupName)?if_exists}[${(payment.partyIdFrom)?if_exists}]</a> + </td> + <td> + <a href="/partymgr/control/viewprofile?partyId=${payment.partyIdTo}">${(payment.partyToFirstName)?if_exists} ${(payment.partyToLastName)?if_exists} ${(payment.partyToGroupName)?if_exists}[${(payment.partyIdTo)?if_exists}]</a> + </td> + <td>${payment.effectiveDate?if_exists}</td> + <td><@ofbizCurrency amount = payment.amount isoCode = payment.currencyUomId /></td> + <td> + <#assign amountToApply = Static["org.ofbiz.accounting.payment.PaymentWorker"].getPaymentNotApplied(payment) /> + <@ofbizCurrency amount = amountToApply isoCode = amountToApply.currencyUomId /> + </td> + <td> + <#assign creditCard = (delegator.findOne("CreditCard", {"paymentMethodId" : payment.paymentMethodId}, false))?if_exists /> + ${payment.paymentMethodTypeDesc?default(payment.paymentMethodTypeId)} + <#if creditCard?has_content>/${(creditCard.cardType)?if_exists}</#if> + </td> + <td> + <input type="checkbox" id="paymentId_${payment_index}" name="paymentIds" value="${payment.paymentId}" onclick="javascript:getPaymentRunningTotal('paymentId_${payment_index}');" /> + </td> + </tr> <#assign alt_row = !alt_row> </#list> - <div id="createPaymentBatch" style="display: none;" align="right"> - <span class="label">${uiLabelMap.AccountingPaymentGroupName}</span> - <input type="text" size='25' id="paymentGroupName" name='paymentGroupName'> - <#if finAccounts?has_content> - <span class="label">${uiLabelMap.AccountingBankAccount}</span> - <select name="finAccountId"> - <#list finAccounts as finAccount> - <option value="${finAccount.get("finAccountId")}">${finAccount.get("finAccountName")} [${finAccount.get("finAccountId")}]</option> - </#list> - </select> - </#if> - <div> + </tbody> </table> <#else> - <span class="label">${uiLabelMap.AccountingNoRecordFound}</span> + <h2>${uiLabelMap.AccountingNoRecordFound}</h3> </#if> </form> </div> |
Free forum by Nabble | Edit this page |