phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r5447 - phpcompta/trunk/html/js


From: phpcompta-dev
Subject: [Phpcompta-dev] r5447 - phpcompta/trunk/html/js
Date: Sat, 28 Sep 2013 23:43:09 +0200 (CEST)

Author: danydb
Date: 2013-09-28 23:43:09 +0200 (Sat, 28 Sep 2013)
New Revision: 5447

Modified:
   phpcompta/trunk/html/js/acc_ledger.js
Log:
add row to gestion

Modified: phpcompta/trunk/html/js/acc_ledger.js
===================================================================
--- phpcompta/trunk/html/js/acc_ledger.js       2013-09-28 20:59:22 UTC (rev 
5446)
+++ phpcompta/trunk/html/js/acc_ledger.js       2013-09-28 21:43:09 UTC (rev 
5447)
@@ -357,7 +357,7 @@
     g("e_march"+nb.value+"_price").value='0';
     g("e_march"+nb.value).value="";
     g("e_quant"+nb.value).value="1";
-        if ($("e_march"+nb.value+"_tva_amount")) 
g("e_march"+nb.value+"_tva_amount").value=0;
+    if ($("e_march"+nb.value+"_tva_amount")) 
g("e_march"+nb.value+"_tva_amount").value=0;
 
     nb.value++;
 
@@ -1025,4 +1025,46 @@
        }
 
 
+}
+/**
+ * @brief add a line in the form for the purchase ledger
+ */
+function gestion_add_row()
+{
+    try {
+        style = 'class="input_text"';
+        var mytable = g("art").tBodies[0];
+        var ofirstRow = mytable.rows[1];
+        var line = mytable.rows.length;
+        var nCell = mytable.rows[1].cells.length;
+        var row = mytable.insertRow(line);
+        var nb = g("nb_item");
+        for (var e = 0; e < nCell; e++)
+        {
+            var newCell = row.insertCell(e);
+            var tt = ofirstRow.cells[e].innerHTML;
+            var new_tt = tt.replace(/march0/g, "march" + nb.value);
+            new_tt = new_tt.replace(/quant0/g, "quant" + nb.value);
+            new_tt = new_tt.replace(/sold\(0\)/g, "sold(" + nb.value + ")");
+            new_tt = new_tt.replace(/compute_ledger\(0\)/g, "compute_ledger(" 
+ nb.value + ")");
+            new_tt = new_tt.replace(/clean_tva\(0\)/g, "clean_tva(" + nb.value 
+ ")");
+            newCell.innerHTML = new_tt;
+            new_tt.evalScripts();
+        }
+
+        g("e_march" + nb.value + "_label").innerHTML = '&nbsp;';
+        g("e_march" + nb.value + "_label").value = '';
+        g("e_march" + nb.value + "_price").value = '0';
+        g("e_march" + nb.value).value = "";
+        g("e_quant" + nb.value).value = "1";
+        if ($("e_march" + nb.value + "_tva_amount"))
+            g("e_march" + nb.value + "_tva_amount").value = 0;
+
+        nb.value++;
+
+        new_tt.evalScripts();
+    } catch (e) {
+        alert(e.message);
+    }
+
 }
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilité libre en ligne (full web)
Projet opensource http://www.phpcompta.eu



reply via email to

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