noalyss
Version-6.7.2
|
Manage the table parm_code which contains the custom parameter for the module accountancy. More...
Public Member Functions | |
Acc_Parm_Code ($p_cn, $p_id=-1) | |
display () | |
Display an object, with the tag. | |
form () | |
Display a form to enter info about a parm_code object with the tag. | |
load () | |
Complete a parm_code object thanks the p_code. | |
load_all () | |
Load all parmCode return an array of Acc_Parm_Code object. | |
save () | |
update a parm_object into the database p_code is _not_ updatable | |
Data Fields | |
$db | |
$p_code | |
$p_comment | |
$p_value |
Manage the table parm_code which contains the custom parameter for the module accountancy.
Definition at line 31 of file class_acc_parm_code.php.
Acc_Parm_Code::Acc_Parm_Code | ( | $ | p_cn, |
$ | p_id = -1 |
||
) |
Definition at line 38 of file class_acc_parm_code.php.
Referenced by load_all().
Display a form to enter info about a parm_code object with the tag.
Definition at line 124 of file class_acc_parm_code.php.
References $comment, $poste, $r, $value, and Dossier\hidden().
{ $comment=new IText(); $comment->name='p_comment'; $comment->value=$this->p_comment; $comment->size=45; $value=new IPoste(); $value->name='p_value'; $value->value=$this->p_value; $value->size=7; $value->set_attribute('ipopup','ipop_account'); $value->set_attribute('account','p_value'); $poste=new IText(); $poste->setReadOnly(true); $poste->size=strlen($this->p_code)+1; $poste->name='p_code'; $poste->value=$this->p_code; $r=""; $r.='<tr>'; $r.='<td align="right"> Code </td>'; $r.= '<TD>'.$poste->input().'</TD>'; $r.='</tr>'; $r.='<tr>'; $r.='<td align="right"> Commentaire </td>'; $r.= '<TD>'.$comment->input().'</TD>'; $r.='</tr>'; $r.='<tr>'; $r.='<td align="right"> Poste comptable </td>'; $r.= '<TD>'.$value->input(); $r.='<span id="p_value_label"></span></td>'; $r.='</tr>'; $r.=Dossier::hidden(); return $r; }
Complete a parm_code object thanks the p_code.
Definition at line 168 of file class_acc_parm_code.php.
References $Res, $row, $sql, db, Database\fetch_array(), and Database\num_row().
Referenced by Acc_Parm_Code().
{ if ( $this->p_code == -1 ) return "p_code non initialisé"; $sql='select * from parm_code where p_code=$1 '; $Res=$this->db->exec_sql($sql,array($this->p_code)); if ( Database::num_row($Res) == 0 ) return 'INCONNU'; $row= Database::fetch_array($Res,0); $this->p_value=$row['p_value']; $this->p_comment=$row['p_comment']; }
Load all parmCode return an array of Acc_Parm_Code object.
Definition at line 54 of file class_acc_parm_code.php.
References $array, $idx, $r, $Res, $row, $sql, Acc_Parm_Code(), db, and Database\fetch_all().
update a parm_object into the database p_code is _not_ updatable
Definition at line 79 of file class_acc_parm_code.php.
References $acc, $Res, $sql, alert(), db, false, and sql_string().
{ // if p_code=="" nothing to save if ( $this->p_code== -1) return; // check if the account exists $acc=new Acc_Account_Ledger($this->db,$this->p_value); if ( $acc->load() == false ) { alert("Ce compte n'existe pas"); } else { $this->p_comment=sql_string($this->p_comment); $this->p_value=sql_string($this->p_value); $this->p_code=sql_string($this->p_code); $sql="update parm_code set ". "p_comment='".$this->p_comment."' ". ",p_value='".$this->p_value."' ". "where p_code='".$this->p_code."'"; $Res=$this->db->exec_sql($sql); } }
Acc_Parm_Code::$db |
$db database connection
Definition at line 33 of file class_acc_parm_code.php.
Acc_Parm_Code::$p_code |
$p_code parm_code.p_code primary key
Definition at line 34 of file class_acc_parm_code.php.
Acc_Parm_Code::$p_comment |
$p_comment parm_code.p_comment
Definition at line 36 of file class_acc_parm_code.php.
Acc_Parm_Code::$p_value |
$p_value parm_code.p_value
Definition at line 35 of file class_acc_parm_code.php.