svn commit: r793468 - in /ofbiz/trunk/applications/accounting/webapp: ap/invoices/PurchaseInvoices.ftl ar/payment/batchPayments.ftl

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r793468 - in /ofbiz/trunk/applications/accounting/webapp: ap/invoices/PurchaseInvoices.ftl ar/payment/batchPayments.ftl

ashish-18
Author: ashish
Date: Mon Jul 13 06:20:46 2009
New Revision: 793468

URL: http://svn.apache.org/viewvc?rev=793468&view=rev
Log:
This patch includes:
-- improvement in running total functionality , implemented for batch payment and purchase invoice search form.
Thanks Awdesh for your contribution.

Modified:
    ofbiz/trunk/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl
    ofbiz/trunk/applications/accounting/webapp/ar/payment/batchPayments.ftl

Modified: 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=793468&r1=793467&r2=793468&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl (original)
+++ ofbiz/trunk/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl Mon Jul 13 06:20:46 2009
@@ -34,14 +34,21 @@
     var form = document.listPurchaseInvoices;
     var invoices = form.elements.length;
     var isSingle = true;
+    var isAllSelected = true;
     for (var i = 0; i < invoices; i++) {
         var element = form.elements[i];
-        if (element.name == "invoiceIds" && element.checked) {
-            isSingle = false;
+        if (element.name == "invoiceIds") {
+            if (element.checked) {
+                isSingle = false;
+            } else {
+                isAllSelected = false;
+            }
         }
     }
     if (!($(e).checked)) {
         $('checkAllInvoices').checked = false;
+    } else if (isAllSelected) {
+        $('checkAllInvoices').checked = true;
     }
     if (!isSingle) {
         new Ajax.Request('getInvoiceRunningTotal', {

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=793468&r1=793467&r2=793468&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/ar/payment/batchPayments.ftl (original)
+++ ofbiz/trunk/applications/accounting/webapp/ar/payment/batchPayments.ftl Mon Jul 13 06:20:46 2009
@@ -34,15 +34,24 @@
     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" && element.checked) {
-            isSingle = false;
+        if (element.name == "paymentIds") {
+            if (element.checked) {
+                isSingle = false;
+            } else {
+                isAllSelected = false;
+            }
         }
     }
     if (!($(e).checked)) {
         $('checkAllPayments').checked = false;
+        
+    } else if (isAllSelected) {
+        $('checkAllPayments').checked = true;
     }
+    
     if (!isSingle) {
         new Ajax.Request('getPaymentRunningTotal', {
             asynchronous: false,
@@ -79,7 +88,7 @@
                         <td>${uiLabelMap.CommonAmount}</td>
                         <td>${uiLabelMap.CommonDate}</td>
                         <td align="right">
-                            ${uiLabelMap.ProductSelectAll}&nbsp;
+                            ${uiLabelMap.CommonSelectAll}&nbsp;
                             <input type="checkbox" id="checkAllPayments" name="checkAllPayments" onchange="javascript:togglePaymentId(this);"/>
                         </td>
                     </tr>
@@ -101,12 +110,12 @@
                             </td>
                         </tr>
                     </#list>
-                    <tr>
-                        <td align="right">
-                            <a href="javascript:document.paymentBatchForm.submit();" class="buttontext">${uiLabelMap.AccountingCreateBatch}</a>
-                        </td>
-                    </tr>
                 </table>
+                <div align="right">
+                    <a href="javascript:document.paymentBatchForm.submit();" class="buttontext">${uiLabelMap.AccountingCreateBatch}</a>
+                <div>
+            <#else>
+                <span class="label">${uiLabelMap.AccountingNoRecordFound}</span>
             </#if>
         </form>
     </div>