noalyss
Version-6.7.2
|
Manage the additionnal info for operation (from jrn), when an invoice is generated, the order or other info are going to be stored and used in the detail. this class maps the table jrn_info. More...
Public Member Functions | |
__construct ($p_cn, $p_ji_id=0) | |
count () | |
from_array ($p_array) | |
insert () | |
load () | |
load_all () | |
load all the jrn_info thanks the jr_id | |
save_extra ($p_jr_id, $p_array) | |
save all extra information in once, called by compta_ven and compta_ach | |
search_id_internal ($p_internal) | |
set_id ($p_ji_id) | |
set_jrn_id ($p_id) | |
set_type ($p_id) | |
set_value ($p_id) | |
update () | |
Static Public Member Functions | |
static | test_me () |
Data Fields | |
$cn | |
$id_type | |
$ji_id | |
$ji_value | |
$jr_id |
Manage the additionnal info for operation (from jrn), when an invoice is generated, the order or other info are going to be stored and used in the detail. this class maps the table jrn_info.
Definition at line 34 of file class_acc_ledger_info.php.
Acc_Ledger_Info::__construct | ( | $ | p_cn, |
$ | p_ji_id = 0 |
||
) |
Definition at line 41 of file class_acc_ledger_info.php.
References cn.
{ $this->cn=$p_cn; $this->ji_id=$p_ji_id; }
Acc_Ledger_Info::from_array | ( | $ | p_array | ) |
Definition at line 46 of file class_acc_ledger_info.php.
References $e, $sql, cn, echo, exit, Database\fetch_result(), and jr_id.
Referenced by save_extra().
{ if ( ! isset ($this->jr_id) || ! isset ($this->ji_value) || ! isset ($this->id_type ) ) { echo 'Appel incorrecte '.__FILE__.__LINE__; var_dump($this); exit(); } try { $sql=$this->cn->exec_sql('insert into jrn_info(jr_id,id_type,ji_value) values ($1,$2,$3)'. ' returning ji_id ', array ($this->jr_id,$this->id_type,$this->ji_value) ); $this->ji_id=Database::fetch_result($sql,0,0); } catch (Exception $e) { echo "Echec sauvegarde info additionnelles"; throw $e; } }
Definition at line 93 of file class_acc_ledger_info.php.
References $r, $sql, cn, Database\fetch_array(), from_array(), and Database\num_row().
{ $sql="select jr_id,id_type,ji_value from jrn_info where ji_id=".$this->ji_id; $r=$this->cn->exec_sql($sql); if (Database::num_row ($r) > 0 ) { $this->from_array(Database::fetch_array($r,0)); return 0; } else { return 1; } }
load all the jrn_info thanks the jr_id
Definition at line 134 of file class_acc_ledger_info.php.
References $array, $r, $ret, $row, $sql, cn, echo, exit, Database\fetch_all(), jr_id, and Database\num_row().
{ if ( ! isset ($this->jr_id) ) { echo "jr_id is not set ".__FILE__.__LINE__; exit(); } $sql="select ji_id from jrn_info where jr_id=".$this->jr_id; $r=$this->cn->exec_sql($sql); if (Database::num_row($r) == 0 ) return array(); $array=Database::fetch_all($r); $ret=array(); foreach ($array as $row) { $o=new Acc_Ledger_Info($this->cn,$row['ji_id']); $o->load(); $ret[]=clone $o; } return $ret; }
Acc_Ledger_Info::save_extra | ( | $ | p_jr_id, |
$ | p_array | ||
) |
save all extra information in once, called by compta_ven and compta_ach
$p_jr_id | is the jrn.jr_id concerned, |
$p_array | is the array with the data usually it is $_POST |
Definition at line 184 of file class_acc_ledger_info.php.
References $p_array, insert(), jr_id, set_type(), set_value(), and trim().
{ $this->jr_id=$p_jr_id; if (strlen(trim($p_array['bon_comm'] )) != 0 ) { $this->set_type('BON_COMMANDE'); $this->set_value($p_array['bon_comm']); $this->insert(); } if (strlen(trim($p_array['other_info'] )) != 0 ) { $this->set_type('OTHER'); $this->set_value($p_array['other_info']); $this->insert(); } }
Acc_Ledger_Info::search_id_internal | ( | $ | p_internal | ) |
Definition at line 162 of file class_acc_ledger_info.php.
References $r, $sql, cn, Database\fetch_result(), jr_id, and Database\num_row().
Acc_Ledger_Info::set_id | ( | $ | p_ji_id | ) |
Definition at line 115 of file class_acc_ledger_info.php.
References $ji_id.
{ $this->$ji_id=$p_ji_id; }
Acc_Ledger_Info::set_jrn_id | ( | $ | p_id | ) |
Acc_Ledger_Info::set_type | ( | $ | p_id | ) |
Definition at line 123 of file class_acc_ledger_info.php.
Referenced by save_extra().
{ $this->id_type=$p_id; }
Acc_Ledger_Info::set_value | ( | $ | p_id | ) |
Definition at line 127 of file class_acc_ledger_info.php.
Referenced by save_extra().
{ $this->ji_value=$p_id; }
static Acc_Ledger_Info::test_me | ( | ) | [static] |
Definition at line 200 of file class_acc_ledger_info.php.
References $a, $cn, echo, and Dossier\id().
Definition at line 70 of file class_acc_ledger_info.php.
References $e, $sql, cn, echo, exit, and jr_id.
{ if ( ! isset ($this->jr_id) || ! isset ($this->ji_value) || ! isset ($this->jr_id ) ) { echo 'Appel incorrecte '.__FILE__.__LINE__; var_dump($this); exit(); } try { $sql=$this->exec_sql('update jrn_info set jr_id=$1 ,id_type=$2,ji_value=$3 where ji_id=$4)'. array ($this->jr_id,$this->id_type,$this->ji_value,$this->ji_id) ); } catch (Exception $e) { $this->cn->rollback(); echo "Echec sauvegarde info additionnelles"; throw $e; } }
Acc_Ledger_Info::$cn |
Acc_Ledger_Info::$id_type |
type id
Definition at line 38 of file class_acc_ledger_info.php.
Acc_Ledger_Info::$ji_id |
Acc_Ledger_Info::$ji_value |
value for this
Definition at line 40 of file class_acc_ledger_info.php.
Acc_Ledger_Info::$jr_id |
primary key of the table jrn
Definition at line 39 of file class_acc_ledger_info.php.