25 require_once NOALYSS_INCLUDE.
'/class/class_dossier.php';
26 require_once NOALYSS_INCLUDE.
'/lib/class_database.php';
44 "comment"=>
"tva_comment",
45 "account"=>
"tva_poste",
46 "both_side"=>
'tva_both_side');
51 $this->tva_id=$p_tva_id;
53 $this->tva_label=null;
55 $this->tva_comment=null;
56 $this->tva_poste=null;
57 $this->tva_both_side=
'f';
61 if ( array_key_exists($p_string,self::$variable) )
63 $idx=self::$variable[$p_string];
67 echo (__FILE__.
":".__LINE__.
'Erreur attribut inexistant');
71 if ( array_key_exists($p_string,self::$variable) )
73 $idx=self::$variable[$p_string];
77 throw new Exception(
"Attribut inexistant $p_string");
83 return var_export(self::$variable,
true);
93 if ( $this->tva_id == 0 )
101 if ( $this->
verify() != 0 )
return;
102 $sql=
"select tva_insert($1,$2,$3,$4,$5)";
106 array($this->tva_label,
110 $this->tva_both_side)
112 $this->tva_id=$this->
cn->get_current_seq(
's_tva');
118 if ( $this->
verify() != 0 )
return;
119 $sql=
"update tva_rate set tva_label=$1,tva_rate=$2,tva_comment=$3,tva_poste=$4,tva_both_side=$5 ".
120 " where tva_id = $6";
123 array($this->tva_label,
127 $this->tva_both_side,
139 $sql=
"select tva_id,tva_label,tva_rate, tva_comment,tva_poste,tva_both_side from tva_rate where tva_id=$1";
145 if ( $this->
cn->size() == 0 )
return -1;
161 if ( strlen($this->tva_poste) == 0 ) $this->
load();
162 list(
$deb,
$cred)=explode(
",",$this->tva_poste);
172 throw (
new Exception (__FILE__.
':'.__LINE__.
" param est d ou c, on a recu [ $p_side ]"));
175 public function delete()
177 $sql=
"delete from tva_rate where tva_id=$1";
178 $res=$this->
cn->exec_sql(
$sql,array($this->tva_id));
188 $a->set_parameter(
"id",1);
190 $a->set_parameter(
"id",0);
191 $a->set_parameter(
"rate",
"0.2222");
192 $a->set_parameter(
"label",
"test");
197 $a->set_parameter(
"comment",
"un cht'it test");
static test_me()
Test function.
Acc_Tva is used for to map the table tva_rate parameter are.
static fetch_array($ret, $p_indice=0)
wrapper for the function pg_fetch_array
for($i=0;$i<$nb_jrn;$i++) $deb
__construct($p_init, $p_tva_id=0)
static fetch_result($ret, $p_row=0, $p_col=0)
wrapper for the function pg_fetch_all
set_parameter($p_string, $p_value)
get_side($p_side)
get the account of the side (debit or credit)