handle the param_detail type Account_Tva The t_id gives the type of total
More...
|
| compute ($p_start, $p_end) |
| Compute the amount of TVA or Account, call internally private functions. More...
|
|
| from_array ($p_array) |
| the p_array contains a row from formulaire_param_detail it will be copied into this->form. More...
|
|
|
static | factory ($p_array) |
| create an object RAPAV_dd_Formula, RAPAV_dd_Account_Tva or Rapav_dd_compute following the idx type_detail More...
|
|
|
| compute_tva ($p_start, $p_end) |
| compute the amount of tva using the given account in either the ledger ACH or VEN following the $this->form->jrn_def_type. More...
|
|
| compute_amount ($p_start, $p_end) |
| compute the amount of account using the given tva_id in either the ledger ACH or VEN following the $this->form->jrn_def_type. More...
|
|
handle the param_detail type Account_Tva The t_id gives the type of total
- 0 TVA + Account
- 1 TVA
- 2 Account the jrn_def_type is either ACH or VEN
- See Also
- RAPAV_Account_Tva
Definition at line 989 of file class_rapav_declaration.php.
Rapav_dd_Account_Tva::compute |
( |
|
$p_start, |
|
|
|
$p_end |
|
) |
| |
Compute the amount of TVA or Account, call internally private functions.
- See Also
- Rapav_dd_Account_Tva::computa_amount Rapav_dd_Account_Tva::compute_tva
- Parameters
-
$p_start | start date |
$p_end | end date |
- Returns
- amount computed
- Exceptions
-
Definition at line 1097 of file class_rapav_declaration.php.
References $amount, compute_amount(), and compute_tva().
1106 switch ($this->form->tt_id)
1110 $t2_amount = $this->
compute_tva($p_start, $p_end);
1111 $amount = bcadd($t1_amount, $t2_amount);
1124 throw new Exception(
'Type de total invalide');
compute_tva($p_start, $p_end)
compute the amount of tva using the given account in either the ledger ACH or VEN following the $this...
compute_amount($p_start, $p_end)
compute the amount of account using the given tva_id in either the ledger ACH or VEN following the $t...
Rapav_dd_Account_Tva::compute_amount |
( |
|
$p_start, |
|
|
|
$p_end |
|
) |
| |
|
private |
compute the amount of account using the given tva_id in either the ledger ACH or VEN following the $this->form->jrn_def_type.
Set the $this->errcode if something wrong has happened
- Parameters
-
$p_start | start date |
$p_end | end date |
- Returns
- amount
- Parameters
-
- Returns
- |int
Definition at line 1052 of file class_rapav_declaration.php.
References $amount, $sql, and RAPAV\get_sql_date().
Referenced by compute().
1054 $filter_ledger =
"";
1055 if ($this->form->jrn_def_id !=
"")
1057 $filter_ledger =
" and j_jrn_def = " . sql_string($this->form->jrn_def_id);
1061 if ($this->form->jrn_def_type ==
'ACH')
1063 $sql =
"select coalesce(sum(qp_price),0) as amount from quant_purchase join jrnx as jrn1 using (j_id)
1064 where qp_vat_code=$1 $sql_date
1065 and j_poste::text like ($4) $filter_ledger";
1067 $amount = $this->cn->get_value(
$sql, array($this->form->tva_id,
1070 $this->form->tmp_val));
1073 if ($this->form->jrn_def_type ==
'VEN')
1075 $sql =
"select coalesce(sum(qs_price),0) as amount from quant_sold
1076 join jrnx as jrn1 using (j_id)
1077 where qs_vat_code=$1 $sql_date
1078 and j_poste::text like ($4) $filter_ledger";
1079 $amount = $this->cn->get_value(
$sql, array($this->form->tva_id,
1082 $this->form->tmp_val));
1085 $this->errcode =
'Erreur dans le journal';
static get_sql_date($p_date, $p_prefix="")
Compute the SQL for the date.
Rapav_dd_Account_Tva::compute_tva |
( |
|
$p_start, |
|
|
|
$p_end |
|
) |
| |
|
private |
compute the amount of tva using the given account in either the ledger ACH or VEN following the $this->form->jrn_def_type.
set the $this->errcode if something wrong has happened
- Parameters
-
$p_start | start date |
$p_end | end date |
- Returns
- amount
Definition at line 1000 of file class_rapav_declaration.php.
References $amount, $sql, and RAPAV\get_sql_date().
Referenced by compute().
1002 $filter_ledger =
"";
1003 if ($this->form->jrn_def_id !=
"")
1005 $filter_ledger =
" and j_jrn_def = " . sql_string($this->form->jrn_def_id);
1009 if ($this->form->jrn_def_type ==
'ACH')
1012 $sql =
"select coalesce(sum(qp_vat),0) as amount
1013 from quant_purchase join jrnx as jrn1 using (j_id)
1014 where qp_vat_code=$1
1016 and j_poste::text like ($4) $filter_ledger";
1017 $amount = $this->cn->get_value(
$sql, array($this->form->tva_id,
1020 $this->form->tmp_val));
1023 if ($this->form->jrn_def_type ==
'VEN')
1025 $sql =
"select coalesce(sum(qs_vat),0) as amount
1026 from quant_sold join jrnx as jrn1 using (j_id)
1027 where qs_vat_code=$1
1029 and j_poste::text like ($4) $filter_ledger";
1031 $amount = $this->cn->get_value(
$sql, array($this->form->tva_id,
1034 $this->form->tmp_val));
1037 $this->errcode =
'Erreur dans le journal';
static get_sql_date($p_date, $p_prefix="")
Compute the SQL for the date.
static Rapav_Declaration_Detail::factory |
( |
|
$p_array | ) |
|
|
staticinherited |
create an object RAPAV_dd_Formula, RAPAV_dd_Account_Tva or Rapav_dd_compute following the idx type_detail
- Parameters
-
- Returns
- object RAPAV_dd_Formula, RAPAV_dd_Account_Tva or Rapav_dd_compute
- Exceptions
-
Definition at line 843 of file class_rapav_declaration.php.
References $ret.
Referenced by Rapav_Declaration_Param\compute(), and Rapav_Declaration_Param\compute_child().
845 switch ($p_array[
'type_detail'])
867 throw new Exception(
"Type inconnu");
870 $ret->from_array($p_array);
871 $ret->ddr_amount = 0;
handle the param_detail type Compute
handle the param_detail type Account The type_sum_account gives the type of total ...
handle the param_detail type Account The type_sum_account gives the type of total ...
handle the param_detail type Account_Tva The t_id gives the type of total
Rapav_Declaration_Detail::from_array |
( |
|
$p_array | ) |
|
|
inherited |
the p_array contains a row from formulaire_param_detail it will be copied into this->form.
- Parameters
-
type | $p_array | match formulaire_param_detail table structure |
Definition at line 880 of file class_rapav_declaration.php.
883 $attribute = explode(
',',
'fp_id,p_id,tmp_val,tva_id,fp_formula,fp_signed,jrn_def_type,tt_id,type_detail,with_tmp_val,type_sum_account,operation_pcm_val,jrn_def_id,date_paid');
884 foreach ($attribute as $e)
886 $this->form->$e = $p_array[$e];
The documentation for this class was generated from the following file: