Do not propose disable ledger for new operation
This commit is contained in:
parent
d0759808ab
commit
9448b24d4e
4 changed files with 10 additions and 8 deletions
|
|
@ -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'";
|
||||
|
|
|
|||
|
|
@ -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'));
|
||||
|
||||
|
|
|
|||
|
|
@ -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'";
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue