noalyss Version-9
Public Member Functions | Data Fields | Private Attributes | Static Private Attributes
Acc_Tva Class Reference

Acc_Tva is used for to map the table tva_rate parameter are. More...

+ Collaboration diagram for Acc_Tva:

Public Member Functions

 __construct ($p_init, $p_tva_id=-1)
 
 get_parameter ($p_string)
 
 get_side ($p_side)
 get the account of the side (debit or credit) More...
 
 getTvaRateSql ()
 
 load ()
 Load the VAT,. More...
 
 set_parameter ($p_string, $p_value)
 
 setTvaRateSql (Tva_Rate_SQL $tva_rate_sql)
 

Data Fields

 $tva_both_side
 
 $tva_comment
 
 $tva_id
 
 $tva_label
 
 $tva_poste
 
 $tva_rate
 

Private Attributes

Tva_Rate_SQL $tva_rate_sql
 

Static Private Attributes

static $variable
 

Detailed Description

Acc_Tva is used for to map the table tva_rate parameter are.

Definition at line 36 of file acc_tva.class.php.

Constructor & Destructor Documentation

◆ __construct()

Acc_Tva::__construct (   $p_init,
  $p_tva_id = -1 
)

Definition at line 53 of file acc_tva.class.php.

54 {
55 $this->cn=$p_init;
56 $this->tva_rate_sql=new Tva_Rate_SQL($p_init,$p_tva_id);
57 $this->tva_id=$p_tva_id;
58 $this->tva_label=&$this->tva_rate_sql->tva_label;
59 $this->tva_rate=&$this->tva_rate_sql->tva_rate;
60 $this->tva_comment=&$this->tva_rate_sql->tva_comment;
61 $this->tva_poste=&$this->tva_rate_sql->tva_poste;
62 $this->tva_both_side=&$this->tva_rate_sql->tva_both_side;
63
64 }
$input_from cn
Definition: balance.inc.php:66

References cn.

Member Function Documentation

◆ get_parameter()

Acc_Tva::get_parameter (   $p_string)

Definition at line 82 of file acc_tva.class.php.

83 {
84 if ( array_key_exists($p_string,self::$variable) )
85 {
86 $idx=self::$variable[$p_string];
87 return $this->$idx;
88 }
89
90 echo (__FILE__.":".__LINE__.'Erreur attribut inexistant');
91 }
$idx

References $idx, and $variable.

◆ get_side()

Acc_Tva::get_side (   $p_side)

get the account of the side (debit or credit)

Parameters
$p_sideis d or C
Returns
the account to use
Note
call first load if tva_poste is empty

Definition at line 122 of file acc_tva.class.php.

123 {
124 if ( strlen($this->tva_poste??"") == 0 ) $this->load();
125 list($deb,$cred)=explode(",",$this->tva_poste);
126 switch ($p_side)
127 {
128 case 'd':
129 return $deb;
130 break;
131 case 'c':
132 return $cred;
133 break;
134 default:
135 throw (new Exception (__FILE__.':'.__LINE__." param est d ou c, on a recu [ $p_side ]"));
136 }
137 }
load()
Load the VAT,.
for($i=0;$i< $nb_jrn;$i++) $deb

References $cred, $deb, and load().

+ Here is the call graph for this function:

◆ getTvaRateSql()

Acc_Tva::getTvaRateSql ( )
Returns
Tva_Rate_SQL

Definition at line 68 of file acc_tva.class.php.

69 {
71 }
Tva_Rate_SQL $tva_rate_sql

References $tva_rate_sql.

◆ load()

Acc_Tva::load ( )

Load the VAT,.

Note
if the label is not found then we get an message error, so the best is probably to initialize the VAT object with default value

Definition at line 110 of file acc_tva.class.php.

110 :int
111 {
112 $this->tva_rate_sql->setp("tva_id",$this->tva_id);
113
114 if ( ! $this->tva_rate_sql->load() ) return -1;
115 return 0;
116 }

Referenced by get_side().

◆ set_parameter()

Acc_Tva::set_parameter (   $p_string,
  $p_value 
)

Definition at line 92 of file acc_tva.class.php.

93 {
94 if ( array_key_exists($p_string,self::$variable) )
95 {
96 $idx=self::$variable[$p_string];
97 $this->$idx=$p_value;
98 }
99 else
100 throw new Exception("Attribut inexistant $p_string");
101
102
103 }

References $idx, and $variable.

◆ setTvaRateSql()

Acc_Tva::setTvaRateSql ( Tva_Rate_SQL  $tva_rate_sql)
Parameters
Tva_Rate_SQL$tva_rate_sql

Definition at line 76 of file acc_tva.class.php.

77 {
78 $this->tva_rate_sql = $tva_rate_sql;
79 return $this;
80 }

References $tva_rate_sql.

Field Documentation

◆ $tva_both_side

Acc_Tva::$tva_both_side

Definition at line 49 of file acc_tva.class.php.

◆ $tva_comment

Acc_Tva::$tva_comment

Definition at line 47 of file acc_tva.class.php.

◆ $tva_id

Acc_Tva::$tva_id

Definition at line 44 of file acc_tva.class.php.

◆ $tva_label

Acc_Tva::$tva_label

Definition at line 45 of file acc_tva.class.php.

◆ $tva_poste

Acc_Tva::$tva_poste

Definition at line 48 of file acc_tva.class.php.

◆ $tva_rate

Acc_Tva::$tva_rate

Definition at line 46 of file acc_tva.class.php.

◆ $tva_rate_sql

Tva_Rate_SQL Acc_Tva::$tva_rate_sql
private

Definition at line 51 of file acc_tva.class.php.

Referenced by getTvaRateSql(), and setTvaRateSql().

◆ $variable

Acc_Tva::$variable
staticprivate
Initial value:
=array("id"=>"tva_id",
"label"=>"tva_label",
"rate"=>"tva_rate",
"comment"=>"tva_comment",
"account"=>"tva_poste",
"both_side"=>'tva_both_side')

Definition at line 38 of file acc_tva.class.php.


The documentation for this class was generated from the following file: