noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 277/323: Do not propose disable ledger for ne


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 277/323: Do not propose disable ledger for new operation
Date: Wed, 14 Mar 2018 17:39:04 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 9448b24d4e4c477f5fc4f46581da54cddb9c33d5
Author: Dany De Bontridder <address@hidden>
Date:   Mon Feb 26 19:19:11 2018 +0100

    Do not propose disable ledger for new operation
---
 include/class/acc_ledger.class.php          | 12 +++++++-----
 include/class/acc_ledger_fin.class.php      |  2 +-
 include/class/acc_ledger_purchase.class.php |  2 +-
 include/class/acc_ledger_sold.class.php     |  2 +-
 4 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/include/class/acc_ledger.class.php 
b/include/class/acc_ledger.class.php
index 43a16b0..6cb8dba 100644
--- a/include/class/acc_ledger.class.php
+++ b/include/class/acc_ledger.class.php
@@ -483,14 +483,16 @@ class Acc_Ledger extends jrn_def_sql
     /**
      * @brief Show a select list   of the ledgers you can access in
      * writing, reading or simply accessing.
-     * @param$p_type = ALL or the type of the ledger (ACH,VEN,FIN,ODS)
-     * @param$p_access =3 for READ and WRITE, 2 for write and 1 for readonly
+     * @param $p_type = ALL or the type of the ledger (ACH,VEN,FIN,ODS)
+     * @param $p_access =3 for READ and WRITE, 2 for write and 1 for readonly
+     * @param Boolean TRUE all ledger are selected, or FALSE only enable
      * \return     object HtmlInput select
+     * 
      */
-    function select_ledger($p_type="ALL", $p_access=3)
+    function select_ledger($p_type="ALL", $p_access=3,$enable=TRUE)
     {
         global $g_user;
-        $array=$g_user->get_ledger($p_type, $p_access);
+        $array=$g_user->get_ledger($p_type, $p_access,$enable);
 
         if ($array==null)
             return null;
@@ -765,7 +767,7 @@ class Acc_Ledger extends jrn_def_sql
             // Button for adding customer
             $add_card=TRUE;
         }
-        $wLedger=$this->select_ledger('ODS', 2);
+        $wLedger=$this->select_ledger('ODS', 2,FALSE);
         if ($wLedger==null)
             throw new Exception(_('Pas de journal disponible'));
         
$wLedger->javascript="onChange='update_name();update_predef(\"ods\",\"t\",\"".$_REQUEST['ac']."\");$add_js'";
diff --git a/include/class/acc_ledger_fin.class.php 
b/include/class/acc_ledger_fin.class.php
index ca5da1a..c9ef7d9 100644
--- a/include/class/acc_ledger_fin.class.php
+++ b/include/class/acc_ledger_fin.class.php
@@ -309,7 +309,7 @@ class Acc_Ledger_Fin extends Acc_Ledger
                        $onchange .= 'update_pj();';
 
                $add_js = 'onchange="'.$onchange.'"';
-               $wLedger = $this->select_ledger('FIN', 2);
+               $wLedger = $this->select_ledger('FIN', 2,FALSE);
                if ($wLedger == null)
                        throw  new Exception(_('Pas de journal disponible'));
 
diff --git a/include/class/acc_ledger_purchase.class.php 
b/include/class/acc_ledger_purchase.class.php
index 7dfc938..5990d1d 100644
--- a/include/class/acc_ledger_purchase.class.php
+++ b/include/class/acc_ledger_purchase.class.php
@@ -1053,7 +1053,7 @@ class  Acc_Ledger_Purchase extends Acc_Ledger
         $add_js.='update_pay_method();';
         $add_js.='update_row("sold_item");';
 
-        $wLedger=$this->select_ledger('ACH',2);
+        $wLedger=$this->select_ledger('ACH',2,FALSE);
         
         if ($wLedger == null) throw  new Exception(_('Pas de journal 
disponible'));
         
$wLedger->javascript="onChange='update_predef(\"ach\",\"f\",\"".$_REQUEST['ac']."\");$add_js'";
diff --git a/include/class/acc_ledger_sold.class.php 
b/include/class/acc_ledger_sold.class.php
index b7e8d53..bfee0b6 100644
--- a/include/class/acc_ledger_sold.class.php
+++ b/include/class/acc_ledger_sold.class.php
@@ -1105,7 +1105,7 @@ EOF;
         $add_js.='update_pay_method();';
         $add_js.='update_row("sold_item");';
 
-        $wLedger = $this->select_ledger('VEN', 2);
+        $wLedger = $this->select_ledger('VEN', 2,FALSE);
         if ($wLedger == null)
             throw new Exception(_('Pas de journal disponible'));
         $wLedger->table = 1;



reply via email to

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