|
| get_amount_filter ($p_code, $p_account) |
| get the amount of operation from the table quant_sold or quant_purchase More...
|
|
| get_vat_filter ($p_code, $p_account) |
| get the amount of VAT from the table quant_sold or quant_purchase More...
|
|
Definition at line 32 of file class_tva_amount.php.
Tva_Amount::__construct |
( |
|
$p_init, |
|
|
|
$p_dir, |
|
|
|
$p_start_periode, |
|
|
|
$p_end_periode |
|
) |
| |
Definition at line 43 of file class_tva_amount.php.
45 $this->start_periode=$p_start_periode;
46 $this->end_periode=$p_end_periode;
Tva_Amount::amount_operation |
( |
| ) |
|
get the amount of vat thanks its code
- Parameters
-
$p_gril | is the gril code |
$p_dir | is out or in in for the table quant_purchase and out for the table quant_sold |
- Returns
- a number
Definition at line 89 of file class_tva_amount.php.
References get_amount_filter(), and load_parameter().
94 for ($i=0;$i<count($this->param);$i++)
96 $tmp_calc=$this->
get_amount_filter($this->param[$i][
'tva_id'],$this->param[$i][
'pcm_val']);
97 $result=bcadd($result,$tmp_calc);
100 return round($result,2);
get_amount_filter($p_code, $p_account)
get the amount of operation from the table quant_sold or quant_purchase
load_parameter()
load parameters and set param to a array of value from parameter_chld
Tva_Amount::amount_vat |
( |
| ) |
|
Definition at line 104 of file class_tva_amount.php.
References get_vat_filter(), and load_parameter().
109 for ($i=0;$i<count($this->param);$i++)
111 $tmp_calc=$this->
get_vat_filter($this->param[$i][
'tva_id'],$this->param[$i][
'pcm_val']);
112 $result=bcadd($result,$tmp_calc);
115 return round($result,2);
get_vat_filter($p_code, $p_account)
get the amount of VAT from the table quant_sold or quant_purchase
load_parameter()
load parameters and set param to a array of value from parameter_chld
Tva_Amount::get_amount_filter |
( |
|
$p_code, |
|
|
|
$p_account |
|
) |
| |
|
private |
get the amount of operation from the table quant_sold or quant_purchase
- Returns
- amount
Definition at line 124 of file class_tva_amount.php.
References $res, and $sql.
Referenced by amount_operation().
125 if ( $this->dir ==
'out' && trim($p_account) !=
'' && trim($p_code) !=
'' ) {
126 $sql=
"select coalesce(sum(qs_price),0) as amount from quant_sold
127 join jrnx using (j_id)
128 where qs_vat_code=$1 and (j_date >= to_date($2,'DD.MM.YYYY') and j_date <= to_date($3,'DD.MM.YYYY'))
129 and j_poste::text like ($4)";
130 $res=$this->db->get_array(
$sql,array($p_code,
131 $this->start_periode,
134 return $res[0][
'amount'];
137 if ( $this->dir ==
'in' && trim($p_account) !=
'' && trim($p_code) !=
'' ) {
138 $sql=
"select coalesce(sum(qp_price),0) as amount from quant_purchase join jrnx using (j_id)
139 where qp_vat_code=$1 and (j_date >= to_date($2,'DD.MM.YYYY') and j_date <= to_date($3,'DD.MM.YYYY'))
140 and j_poste::text like ($4)";
141 $res=$this->db->get_array(
$sql,array($p_code,
142 $this->start_periode,
145 return $res[0][
'amount'];
Tva_Amount::get_parameter |
( |
|
$p_string | ) |
|
Definition at line 49 of file class_tva_amount.php.
50 if ( array_key_exists($p_string,self::$variable) ) {
51 $idx=self::$variable[$p_string];
55 throw new Exception(
"Attribut inexistant $p_string");
Tva_Amount::get_vat_filter |
( |
|
$p_code, |
|
|
|
$p_account |
|
) |
| |
|
private |
get the amount of VAT from the table quant_sold or quant_purchase
- Returns
- amount
Definition at line 156 of file class_tva_amount.php.
References $res, and $sql.
Referenced by amount_vat().
157 if ( $this->dir ==
'out' && trim($p_account) !=
'' && trim($p_code) !=
'' ) {
158 $sql=
"select coalesce(sum(qs_vat),0) as amount from quant_sold join jrnx using (j_id)
159 where qs_vat_code=$1 and (j_date >= to_date($2,'DD.MM.YYYY') and j_date <= to_date($3,'DD.MM.YYYY'))
160 and j_poste::text like ($4)";
161 $res=$this->db->get_array(
$sql,array($p_code,
162 $this->start_periode,
165 return $res[0][
'amount'];
168 if ( $this->dir ==
'in' && trim($p_account) !=
'' && trim($p_code) !=
'' ) {
169 $sql=
"select coalesce(sum(qp_vat),0) as amount from quant_purchase join jrnx using (j_id)
170 where qp_vat_code=$1 and (j_date >= to_date($2,'DD.MM.YYYY') and j_date <= to_date($3,'DD.MM.YYYY'))
171 and j_poste::text like ($4)";
172 $res=$this->db->get_array(
$sql,array($p_code,
173 $this->start_periode,
176 return $res[0][
'amount'];
Tva_Amount::load_parameter |
( |
| ) |
|
load parameters and set param to a array of value from parameter_chld
Definition at line 74 of file class_tva_amount.php.
Referenced by amount_operation(), and amount_vat().
76 $ctva=$this->db->get_array(
"select tva_id,pcm_val from tva_belge.parameter_chld where pcode=$1",array($this->grid));
77 if ( count($ctva)== 0 ) {
Tva_Amount::record_ledger |
( |
| ) |
|
record into the ledger the operation for purging the the vat accouting
Definition at line 188 of file class_tva_amount.php.
Tva_Amount::set_parameter |
( |
|
$p_string, |
|
|
|
$p_value |
|
) |
| |
Definition at line 57 of file class_tva_amount.php.
58 if ( array_key_exists($p_string,self::$variable) ) {
59 $idx=self::$variable[$p_string];
63 throw new Exception(
"Attribut inexistant $p_string");
static Tva_Amount::test_me |
( |
| ) |
|
|
static |
Initial value:=array('amount'=>'amount',
'amount_tva'=>'amount_tva',
'param'=>'param',
'dir'=>'dir',
'start_periode'=>'start_periode',
'end_periode'=>'end_periode',
'grid'=>'grid'
)
Definition at line 35 of file class_tva_amount.php.
The documentation for this class was generated from the following file: