compute a formula
More...
|
| compute ($p_start, $p_end) |
| compute the amount for one detail of type formula rapport_advanced.formulaire_param_detail type $cn database connexion 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 a formula
- See Also
- Impress::parse_formula RAPAV_Formula
Definition at line 896 of file class_rapav_declaration.php.
Rapav_dd_Formula::compute |
( |
|
$p_start, |
|
|
|
$p_end |
|
) |
| |
compute the amount for one detail of type formula rapport_advanced.formulaire_param_detail type $cn database connexion
- Parameters
-
$p_start | (date) : computed start date |
$p_end | (date) computed start date |
- Returns
- numeric amount computed
Definition at line 907 of file class_rapav_declaration.php.
References $amount, $cn, and $sql.
911 if ($this->form->jrn_def_id != null)
913 $sql =
' and j_jrn_def =' . $this->form->jrn_def_id;
915 if ($this->form->date_paid == 1)
917 $sql.=sprintf(
" and j_id in ( select j_id from jrnx join jrn on (j_grpt=jr_grpt_id) where jr_date_paid >= to_date('%s','DD.MM.YYYY') and jr_date_paid <= to_date ('%s','DD.MM.YYYY'))", $p_start, $p_end);
918 $p_start =
'01.01.1900';
919 $p_end =
'01.01.2100';
921 if ($this->form->date_paid == 2)
923 $sql.=sprintf(
" and j_id in ( select j_id from jrnx join jrn on (j_grpt=jr_grpt_id) where jr_ech >= to_date('%s','DD.MM.YYYY') and jr_ech <= to_date ('%s','DD.MM.YYYY'))", $p_start, $p_end);
924 $p_start =
'01.01.1900';
925 $p_end =
'01.01.2100';
927 $amount = Impress::parse_formula($cn,
"", $this->form->fp_formula, $p_start, $p_end,
true, 1,
$sql);
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: