noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 03/04: Task #1274 - OD: tout s'efface si bal


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 03/04: Task #1274 - OD: tout s'efface si balance inégale. #1274 : Balance OD , ajout control en JS pour éviter enregistrement si balance incorrecte
Date: Mon, 29 Feb 2016 00:41:08 +0000

sparkyx pushed a commit to branch master
in repository noalyss.

commit 7974d6ccc9384aa204e783e4a8f0c0ce75d8243c
Author: Dany De Bontridder <address@hidden>
Date:   Fri Feb 26 21:51:46 2016 +0100

    Task #1274 - OD: tout s'efface si balance inégale.
    #1274 : Balance OD , ajout control en JS pour éviter enregistrement si 
balance incorrecte
---
 html/js/compute_direct.js         |   11 ++++++++++-
 include/operation_ods_new.inc.php |    2 +-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/html/js/compute_direct.js b/html/js/compute_direct.js
index 04a534d..8773ace 100644
--- a/html/js/compute_direct.js
+++ b/html/js/compute_direct.js
@@ -86,11 +86,20 @@ function checkTotalDirect()
         diff=total_deb-total_cred;
         diff=Math.round(diff*100)/100;
         document.getElementById("totalDiff").innerHTML=diff;
+        return false;
 
     }
     else
     {
         document.getElementById("totalDiff").innerHTML="0.0";
+        return true;
     }
 }
-
+function controleBalance()
+{
+    if ( checkTotalDirect() == true ) { return true;}
+    else {
+        smoke.alert('Balance incorrecte D/C');
+        return false;
+    }
+}
\ No newline at end of file
diff --git a/include/operation_ods_new.inc.php 
b/include/operation_ods_new.inc.php
index 84f0422..396b871 100644
--- a/include/operation_ods_new.inc.php
+++ b/include/operation_ods_new.inc.php
@@ -77,7 +77,7 @@ if ( isset ($_GET['action']) && ! isset($_POST['correct']))
 }
 $p_msg=(isset($p_msg))?$p_msg:"";
 print '<p class="notice">'.$p_msg.'</p>';
-echo '<form method="post"  class="print">';
+echo '<form method="post"  class="print" onsubmit="return controleBalance();" 
>';
 echo dossier::hidden();
 echo HtmlInput::request_to_hidden(array('ac'));
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]