noalyss
Version-6.7.2
|
Acc_Tva is used for to map the table tva_rate parameter are. More...
Public Member Functions | |
__construct ($p_init, $p_tva_id=0) | |
delete () | |
get_info () | |
get_parameter ($p_string) | |
get_side ($p_side) | |
get the account of the side (debit or credit) | |
insert () | |
load () | |
Load the VAT,. | |
save () | |
set_parameter ($p_string, $p_value) | |
update () | |
verify () | |
Static Public Member Functions | |
static | test_me () |
Test function. | |
Private Attributes | |
$cn | |
Static Private Attributes | |
static | $variable |
Acc_Tva is used for to map the table tva_rate parameter are.
Definition at line 38 of file class_acc_tva.php.
Acc_Tva::__construct | ( | $ | p_init, |
$ | p_tva_id = 0 |
||
) |
Acc_Tva::delete | ( | ) |
Definition at line 76 of file class_acc_tva.php.
{ return var_export(self::$variable,true); }
Acc_Tva::get_parameter | ( | $ | p_string | ) |
Acc_Tva::get_side | ( | $ | p_side | ) |
get the account of the side (debit or credit)
$p_side | is d or C |
Definition at line 154 of file class_acc_tva.php.
Acc_Tva::insert | ( | ) |
Definition at line 94 of file class_acc_tva.php.
References $err, $res, $sql, cn, Database\fetch_result(), and verify().
Referenced by save().
{ if ( $this->verify() != 0 ) return; $sql="select tva_insert($1,$2,$3,$4,$5)"; $res=$this->cn->exec_sql( $sql, array($this->tva_label, $this->tva_rate, $this->tva_comment, $this->tva_poste, $this->tva_both_side) ); $this->tva_id=$this->cn->get_current_seq('s_tva'); $err=Database::fetch_result($res); }
Acc_Tva::load | ( | ) |
Load the VAT,.
Definition at line 132 of file class_acc_tva.php.
References $idx, $res, $row, $sql, $value, cn, and Database\fetch_array().
Referenced by get_side().
{ $sql="select tva_id,tva_label,tva_rate, tva_comment,tva_poste,tva_both_side from tva_rate where tva_id=$1"; $res=$this->cn->exec_sql( $sql, array($this->tva_id) ); if ( $this->cn->size() == 0 ) return -1; $row=Database::fetch_array($res,0); foreach ($row as $idx=>$value) { $this->$idx=$value; } return 0; }
Acc_Tva::save | ( | ) |
Acc_Tva::set_parameter | ( | $ | p_string, |
$ | p_value | ||
) |
static Acc_Tva::test_me | ( | ) | [static] |
Test function.
Definition at line 178 of file class_acc_tva.php.
References $a, $cn, echo, and id.
{ $cn=new Database(dossier::id()); $a=new Acc_Tva($cn); echo $a->get_info(); $a->set_parameter("id",1); $a->load(); $a->set_parameter("id",0); $a->set_parameter("rate","0.2222"); $a->set_parameter("label","test"); $a->save(); $a->load(); print_r($a); $a->set_parameter("comment","un cht'it test"); $a->save(); $a->load(); print_r($a); $a->delete(); }
Acc_Tva::update | ( | ) |
Definition at line 111 of file class_acc_tva.php.
References $res, $sql, cn, and verify().
Referenced by save().
{ if ( $this->verify() != 0 ) return; $sql="update tva_rate set tva_label=$1,tva_rate=$2,tva_comment=$3,tva_poste=$4,tva_both_side=$5 ". " where tva_id = $6"; $res=$this->cn->exec_sql( $sql, array($this->tva_label, $this->tva_rate, $this->tva_comment, $this->tva_poste, $this->tva_both_side, $this->tva_id) ); }
Acc_Tva::verify | ( | ) |
Definition at line 81 of file class_acc_tva.php.
Referenced by insert(), and update().
{
// Verify that the elt we want to add is correct
}
Acc_Tva::$cn [private] |
Acc_Tva::$variable [static, private] |
array("id"=>"tva_id", "label"=>"tva_label", "rate"=>"tva_rate", "comment"=>"tva_comment", "account"=>"tva_poste", "both_side"=>'tva_both_side')
Definition at line 41 of file class_acc_tva.php.