You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ap...@apache.org on 2009/08/03 07:36:44 UTC

svn commit: r800201 - in /ofbiz/trunk/applications/accounting/webapp: accounting/finaccounttrans/FinAccountTrans.ftl accounting/payment/depositWithdrawPayments.ftl ap/invoices/PurchaseInvoices.ftl ar/payment/batchPayments.ftl

Author: apatel
Date: Mon Aug  3 05:36:44 2009
New Revision: 800201

URL: http://svn.apache.org/viewvc?rev=800201&view=rev
Log:
Code improvements. 
Submit button on Bank Reconciliation screen should be disabled till the minimum one transaction is selected.
Thanks Rishi Solanki for the patch.

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

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=800201&r1=800200&r2=800201&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl Mon Aug  3 05:36:44 2009
@@ -28,10 +28,10 @@
             element.checked = master.checked;
         }
     }
-    getFinAccountTransRunningTotal(master);
+    getFinAccountTransRunningTotal();
 }
 
-function getFinAccountTransRunningTotal(e) {
+function getFinAccountTransRunningTotal() {
     var form = document.selectAllForm;
     var finAccountTransList = form.elements.length;
     var isSingle = true;
@@ -46,12 +46,13 @@
             }
         }
     }
-    if (!($(e).checked)) {
-        $('checkAllTransactions').checked = false;
-    } else if (isAllSelected) {
+    if (isAllSelected) {
         $('checkAllTransactions').checked = true;
+    } else {
+        $('checkAllTransactions').checked = false;
     }
     if (!isSingle) {
+        $('submitButton').disabled = false;
         new Ajax.Request('getFinAccountTransRunningTotal', {
             asynchronous: false,
             onSuccess: function(transport) {
@@ -61,6 +62,7 @@
         });
     } else {
         $('showFinAccountTransRunningTotal').update("");
+        $('submitButton').disabled = true;
     }
 }
 -->
@@ -196,7 +198,7 @@
                 <input name="finAccountTransId_o_${finAccountTrans_index}" type="hidden" value="${finAccountTrans.finAccountTransId}"/>
                 <input name="organizationPartyId_o_${finAccountTrans_index}" type="hidden" value="${defaultOrganizationPartyId}"/>
                 <td>
-                  <input id="finAccountTransId_${finAccountTrans_index}" name="_rowSubmit_o_${finAccountTrans_index}" type="checkbox" value="Y" onclick="javascript:getFinAccountTransRunningTotal('finAccountTransId_${finAccountTrans_index}');"/>
+                  <input id="finAccountTransId_${finAccountTrans_index}" name="_rowSubmit_o_${finAccountTrans_index}" type="checkbox" value="Y" onclick="javascript:getFinAccountTransRunningTotal();"/>
                 </td>
                 <#if finAccountTrans.finAccountTransTypeId="ADJUSTMENT">
             </tr>
@@ -223,7 +225,7 @@
           </#list>
     <#if !grandTotal?exists>
           <div align="right">
-             <input id="submitButton" type="submit" onclick="javascript:document.selectAllForm.submit();" value="${uiLabelMap.AccountingReconcile}"/>
+             <input id="submitButton" type="submit" onclick="javascript:document.selectAllForm.submit();" value="${uiLabelMap.AccountingReconcile}" disabled/>
           <div>      
         </table>
       </form>

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/payment/depositWithdrawPayments.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/payment/depositWithdrawPayments.ftl?rev=800201&r1=800200&r2=800201&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/payment/depositWithdrawPayments.ftl (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/payment/depositWithdrawPayments.ftl Mon Aug  3 05:36:44 2009
@@ -28,9 +28,9 @@
             element.checked = master.checked;
         }
     }
-    getPaymentRunningTotal(master);
+    getPaymentRunningTotal();
 }
-function getPaymentRunningTotal(e) {
+function getPaymentRunningTotal() {
     var form = document.depositWithdrawPaymentsForm;
     var payments = form.elements.length;
     var isSingle = true;
@@ -45,10 +45,10 @@
             }
         }
     }
-    if (!($(e).checked)) {
-        $('checkAllPayments').checked = false;
-    } else if (isAllSelected) {
+    if (isAllSelected) {
         $('checkAllPayments').checked = true;
+    } else {
+        $('checkAllPayments').checked = false;
     }
     if (!isSingle) {
         $('submitButton').disabled = false;
@@ -117,7 +117,7 @@
                             <td>${payment.effectiveDate?if_exists}</td>
                             <td align="right">
                                 ${uiLabelMap.AccountingDeposit}&nbsp;
-                                <input type="checkbox" id="paymentId_${payment_index}" name="paymentIds" value="${payment.paymentId}" onclick="javascript:getPaymentRunningTotal('paymentId_${payment_index}');"/>
+                                <input type="checkbox" id="paymentId_${payment_index}" name="paymentIds" value="${payment.paymentId}" onclick="javascript:getPaymentRunningTotal();"/>
                             </td>
                         </tr>
                     </#list>

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=800201&r1=800200&r2=800201&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl (original)
+++ ofbiz/trunk/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl Mon Aug  3 05:36:44 2009
@@ -27,10 +27,10 @@
             element.checked = master.checked;
         }
     }
-    getInvoiceRunningTotal(master);
+    getInvoiceRunningTotal();
 }
 
-function getInvoiceRunningTotal(e) {
+function getInvoiceRunningTotal() {
     var form = document.listPurchaseInvoices;
     var invoices = form.elements.length;
     var isSingle = true;
@@ -45,10 +45,10 @@
             }
         }
     }
-    if (!($(e).checked)) {
-        $('checkAllInvoices').checked = false;
-    } else if (isAllSelected) {
+    if (isAllSelected) {
         $('checkAllInvoices').checked = true;
+    } else {
+        $('checkAllInvoices').checked = false;
     }
     if (!isSingle) {
         if ($('paymentMethodTypeId').value != "")
@@ -98,7 +98,7 @@
     } else {
         $('submitButton').disabled = false;
     }
-    getInvoiceRunningTotal('checkAllInvoices');
+    getInvoiceRunningTotal();
 }
 -->
 </script>
@@ -166,7 +166,7 @@
         <#if invoicePaymentInfo.outstandingAmount != 0>
           <#assign statusItem = invoice.getRelatedOneCache("StatusItem")>
           <tr valign="middle"<#if alt_row> class="alternate-row"</#if>>
-            <td><input type="checkbox" id="invoiceId_${invoice_index}" name="invoiceIds" value="${invoice.invoiceId}" onclick="javascript:getInvoiceRunningTotal('invoiceId_${invoice_index}');"/></td>
+            <td><input type="checkbox" id="invoiceId_${invoice_index}" name="invoiceIds" value="${invoice.invoiceId}" onclick="javascript:getInvoiceRunningTotal();"/></td>
             <td><a class="buttontext" href="<@o...@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>

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=800201&r1=800200&r2=800201&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/ar/payment/batchPayments.ftl (original)
+++ ofbiz/trunk/applications/accounting/webapp/ar/payment/batchPayments.ftl Mon Aug  3 05:36:44 2009
@@ -28,9 +28,9 @@
             element.checked = master.checked;
         }
     }
-    getPaymentRunningTotal(master);
+    getPaymentRunningTotal();
 }
-function getPaymentRunningTotal(e) {
+function getPaymentRunningTotal() {
     var form = document.paymentBatchForm;
     var payments = form.elements.length;
     var isSingle = true;
@@ -45,13 +45,11 @@
             }
         }
     }
-    if (!($(e).checked)) {
-        $('checkAllPayments').checked = false;
-        
-    } else if (isAllSelected) {
+    if (isAllSelected) {
         $('checkAllPayments').checked = true;
+    } else {
+        $('checkAllPayments').checked = false;
     }
-    
     if (!isSingle) {
         $('submitButton').disabled = false;
         new Ajax.Request('getPaymentRunningTotal', {