noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 19/46: Task #0001704: Faciliter l'ajout de pl


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 19/46: Task #0001704: Faciliter l'ajout de plusieurs lignes
Date: Mon, 4 May 2020 13:38:47 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 5bd1ed9373638386e2ce079f43852bf7d9849015
Author: Dany De Bontridder <address@hidden>
AuthorDate: Mon Mar 2 20:39:15 2020 +0100

    Task #0001704: Faciliter l'ajout de plusieurs lignes
---
 html/js/acc_ledger.js                       | 16 ++++++++++++++++
 include/class/acc_ledger.class.php          |  1 +
 include/class/acc_ledger_purchase.class.php |  2 +-
 include/class/acc_ledger_sold.class.php     |  3 +--
 include/class/pre_op_advanced.class.php     |  1 +
 include/class/pre_op_ven.class.php          |  2 +-
 include/compta_fin.inc.php                  |  2 +-
 include/operation_ods_new.inc.php           |  2 +-
 8 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/html/js/acc_ledger.js b/html/js/acc_ledger.js
index d6b2882..f236bf3 100644
--- a/html/js/acc_ledger.js
+++ b/html/js/acc_ledger.js
@@ -345,6 +345,22 @@ function ledger_fin_add_row()
 }
 
 /**
+ * Add multiple row
+ * @param p_numrow
+ */
+function ledger_add_multiple(p_elid)
+{
+    var nbrow=$(p_elid).value;
+    if (nbrow == NaN) {nbrow=1;}
+    var type_ledger=$(p_elid+"_ledger").value;
+    var i=0;
+    for (i=0;i<nbrow;i++) {
+        if ( type_ledger == 'O' ) {ledger_add_row();}
+        if ( type_ledger == 'F') { ledger_fin_add_row();}
+        if ( type_ledger == 'M') { quick_writing_add_row();}
+    }
+}
+/**
  *  add a line in the form for the purchase ledger
  * @param p_dossier folder id
  * @param p_table_name
diff --git a/include/class/acc_ledger.class.php 
b/include/class/acc_ledger.class.php
index 606a7de..b2f05da 100644
--- a/include/class/acc_ledger.class.php
+++ b/include/class/acc_ledger.class.php
@@ -48,6 +48,7 @@ require_once NOALYSS_INCLUDE.'/class/acc_payment.class.php';
 require_once NOALYSS_INCLUDE.'/class/acc_ledger_history.class.php';
 require_once NOALYSS_INCLUDE.'/lib/http_input.class.php';
 require_once NOALYSS_INCLUDE.'/class/pre_op_ods.class.php';
+require_once NOALYSS_INCLUDE.'/class/html_input_noalyss.class.php';
 
 /** \file
  * @brief Class for jrn,  class acc_ledger for manipulating the ledger
diff --git a/include/class/acc_ledger_purchase.class.php 
b/include/class/acc_ledger_purchase.class.php
index 3fb6492..d6bd3ff 100644
--- a/include/class/acc_ledger_purchase.class.php
+++ b/include/class/acc_ledger_purchase.class.php
@@ -1332,7 +1332,7 @@ class  Acc_Ledger_Purchase extends Acc_Ledger
 
         // Set correctly the REQUEST param for jrn_type
         $r.= HtmlInput::hidden('jrn_type','ACH');
-        $r.= HtmlInput::button('add_item',_('Ajout article'),      ' 
onClick="ledger_add_row()"');
+        $r.= Html_Input_Noalyss::ledger_add_item("O");
 
 
 
diff --git a/include/class/acc_ledger_sold.class.php 
b/include/class/acc_ledger_sold.class.php
index 7b14a50..4e0e7c5 100644
--- a/include/class/acc_ledger_sold.class.php
+++ b/include/class/acc_ledger_sold.class.php
@@ -1330,8 +1330,7 @@ EOF;
 
         // Set correctly the REQUEST param for jrn_type
         $r.=HtmlInput::hidden('jrn_type', 'VEN');
-
-        $r.=HtmlInput::button('add_item', _('Ajout article'), ' 
onClick="ledger_add_row()"');
+        $r.= Html_Input_Noalyss::ledger_add_item("O");
         $r.= create_script("$('" . $Date->id . "').focus()");
         return $r;
     }
diff --git a/include/class/pre_op_advanced.class.php 
b/include/class/pre_op_advanced.class.php
index ec78536..2c110fe 100644
--- a/include/class/pre_op_advanced.class.php
+++ b/include/class/pre_op_advanced.class.php
@@ -284,6 +284,7 @@ class Pre_Op_Advanced extends Pre_operation_detail
                 // If readonly == 1 then show CA
         }
         $ret.='</table>';
+        $ret.=Html_Input_Noalyss::ledger_add_item("M");
         return $ret;
     }
 }
diff --git a/include/class/pre_op_ven.class.php 
b/include/class/pre_op_ven.class.php
index 0a2c79d..c76252c 100644
--- a/include/class/pre_op_ven.class.php
+++ b/include/class/pre_op_ven.class.php
@@ -406,8 +406,8 @@ class Pre_op_ven extends Pre_operation_detail
 
         // Set correctly the REQUEST param for jrn_type
         $r.=HtmlInput::hidden('jrn_type','VEN');
+        $r.= Html_Input_Noalyss::ledger_add_item("O");
 
-        $r.=HtmlInput::button('add_item',_('Ajout article'),      ' 
onClick="ledger_add_row()"');
         return $r;
     }
 }
diff --git a/include/compta_fin.inc.php b/include/compta_fin.inc.php
index 7627696..b15f39d 100644
--- a/include/compta_fin.inc.php
+++ b/include/compta_fin.inc.php
@@ -145,7 +145,7 @@ try
 {
     echo $Ledger->input($array);
 
-    echo HtmlInput::button('add_item',_('Ajout article'),   ' 
onClick="ledger_fin_add_row()"');
+    echo  Html_Input_Noalyss::ledger_add_item("F");
     echo HtmlInput::submit('save',_('Sauve'));
     echo HtmlInput::reset(_('Effacer'));
 
diff --git a/include/operation_ods_new.inc.php 
b/include/operation_ods_new.inc.php
index 9396314..bad4da0 100644
--- a/include/operation_ods_new.inc.php
+++ b/include/operation_ods_new.inc.php
@@ -94,7 +94,7 @@ $iconcerned->amount_id="totalDeb";
 printf (_("Opération rapprochée : %s"),$iconcerned->input());
 
 echo '<p>';
-echo HtmlInput::button('add', _('Ajout d\'une ligne'), 
'onClick="quick_writing_add_row()"');
+echo Html_Input_Noalyss::ledger_add_item("M");
 echo HtmlInput::submit('summary', _('Sauvez'));
 echo '</p>';
 



reply via email to

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