41 "comment"=>
"tva_comment",
42 "account"=>
"tva_poste",
43 "both_side"=>
'tva_both_side',
44 'tva_reverse_account'=>
'tva_reverse_account',
45 'tva_code'=>
'tva_code');
63 $this->tva_id=$p_tva_id;
64 $this->tva_label=&$this->tva_rate_sql->tva_label;
65 $this->tva_rate=&$this->tva_rate_sql->tva_rate;
66 $this->tva_comment=&$this->tva_rate_sql->tva_comment;
67 $this->tva_poste=&$this->tva_rate_sql->tva_poste;
68 $this->tva_both_side=&$this->tva_rate_sql->tva_both_side;
69 $this->tva_code=&$this->tva_rate_sql->tva_code;
70 $this->tva_reverse_account=&$this->tva_rate_sql->tva_reverse_account;
92 if ( array_key_exists($p_string,self::$variable) )
94 $idx=self::$variable[$p_string];
98 throw new Exception(
"ACC98".
"Attribut inexistant $p_string",
EXC_INVALID);
102 if ( array_key_exists($p_string,self::$variable) )
104 $idx=self::$variable[$p_string];
105 $this->
$idx=$p_value;
108 throw new Exception(
"ACC108".
"Attribut inexistant $p_string",
EXC_INVALID);
121 $this->tva_rate_sql->setp(
"tva_id",$this->tva_id);
123 if ( ! $this->tva_rate_sql->load() )
return -1;
133 if ( strlen($this->tva_poste??
"") == 0 ) $this->
load();
134 list(
$deb,
$cred)=explode(
",",$this->tva_poste);
144 throw (
new Exception (__FILE__.
':'.__LINE__.
" param est d ou c, on a recu [ $p_side ]"));
157 $tva_id = $db->get_value(
"select tva_id from public.tva_rate where tva_code=upper(trim($1))",[$p_code]);
158 if ( $db->size() == 1) {
159 return new Acc_Tva($db,$tva_id);
162 $exist = $db->get_value(
"select count(*) from public.tva_rate where tva_id=$1",[$p_code]);
164 return new Acc_Tva($db,$p_code);
if(!headers_sent())
– pour utiliser unoconv démarrer un server libreoffice commande libreoffice –headless –accept="socket...
Acc_Tva is used for to map the table tva_rate parameter are.
setTvaRateSql(Tva_Rate_SQL $tva_rate_sql)
static build($db, $p_code)
retrieve TVA rate thanks the code that could be the tva_id or tva_code.
__construct($p_init, $p_tva_id=-1)
set_parameter($p_string, $p_value)
load()
Load the VAT, return 0 if the TVA_ID exists otherwise -1.
get_side($p_side)
get the account of the side (debit or credit)
Tva_Rate_SQL $tva_rate_sql
for($i=0;$i< $nb_jrn;$i++) $deb