29 require_once
'class_rapport_avance_sql.php';
30 require_once
'class_rapav_formulaire.php';
31 require_once
'class_rapav.php';
40 echo HtmlInput::title_box(
'Formule',
'param_detail_div');
41 echo
'<h2>' . $parent->p_code .
" " . $parent->p_libelle .
'</h2>';
43 require_once
'template/param_detail_new.php';
48 echo HtmlInput::title_box(
'Formule',
'param_detail_div');
49 echo
'<h2>' . $parent->p_code .
" " . $parent->p_libelle .
'</h2>';
51 require_once
'template/param_detail_new_child.php';
55 $html=
'<td id="del_' . $this->fp_id .
'">';
56 $html.=HtmlInput::anchor(
"Effacer",
"", sprintf(
"onclick=\"delete_param_detail('%s','%s','%s','%s','%s','%s')\""
63 $html=
'<td id="mod_' . $this->fp_id .
'">';
64 $html.=HtmlInput::anchor(
"Modifier",
"", sprintf(
"onclick=\"modify_param_detail('%s','%s','%s','%s')\""
76 $select =
new ISelect(
'p_ledger');
77 $a_ledger = $cn->make_array(
'select jrn_def_id,jrn_def_name from jrn_def order by 2', 1);
78 $a_ledger[0][
'label'] =
'-- Tous les journaux -- ';
80 if ( $this->fp_id != -1)
82 $select->selected=$this->jrn_def_id;
85 echo
'<p> Filtrage par journal ' .
$select->input() .
'</p>';
93 $s_date =
new ISelect(
'p_paid');
94 $s_date->value = array();
95 $s_date->value[] = array(
"value" => 0,
"label" =>
'Date d\'opération');
96 $s_date->value[] = array(
"value" => 1,
"label" =>
'Date de paiement');
97 $s_date->value[] = array(
"value" => 2,
"label" =>
'Date d\'échéance');
98 echo
'<p> Si la date donnée concerne la date de paiement ou d\'écheance, cela limitera la recherche aux journaux VEN et ACH ';
99 echo HtmlInput::infobulle(36);
100 if ( $this->fp_id != -1)
102 $s_date->selected=$this->date_paid;
104 echo $s_date->input();
117 printf(
"Résultat de la formule %s utilisant $ledger %s", $this->fp_formula, $paid);
122 $account =
new IPoste(
"formula_new",
"",
"form_id");
123 if ($this->fp_id != -1)
125 $account->value=$this->fp_formula;
128 $account->label = _(
"Recherche poste");
129 $account->set_attribute(
'gDossier',
dossier::id());
130 $account->set_attribute(
'bracket', 1);
131 $account->set_attribute(
'no_overwrite', 1);
132 $account->set_attribute(
'noquery', 1);
133 $account->set_attribute(
'account', $account->id);
134 echo $account->input();
160 $type_total = $cn->get_value(
"select tt_label from rapport_advanced.total_type where tt_id=$1", array($this->tt_id));
162 printf(
"Poste comptable %s avec le code tva %s (%s) dans le journal de type %s [ %s ] $ledger %s", $this->tmp_val, $this->tva_id, $this->tva_id, $this->jrn_def_type, $type_total, $paid);
168 $account =
new IPoste(
"formtva",
"",
"formtva_id");
170 $account->label = _(
"Recherche poste");
171 $account->set_attribute(
'gDossier',
dossier::id());
172 $account->set_attribute(
'noquery', 1);
173 $account->set_attribute(
'account', $account->id);
174 $account->value=$this->tmp_val;
176 $tva =
new ITva_Popup(
"code_tva");
177 $tva->id = HtmlInput::generate_id(
"code_tva");
181 $select =
new ISelect(
'code_jrn');
183 array(
'value' =>
'VEN',
'label' =>
'journaux Vente'),
184 array(
'value' =>
'ACH',
'label' =>
'journaux Achat')
186 $select->selected=$this->jrn_def_type;
188 echo
'<tr><td>Poste comptable</td>';
189 echo td($account->input());
191 echo td(
'TVA') . td(
$tva->input());
193 echo td(_(
'Choix du type de journal ')) . td(
$select->input());
196 $code_base =
new ISelect(
'code_base');
197 $code_base->value = $cn->make_array(
"select tt_id,tt_label from rapport_advanced.total_type order by 2");
198 $code_base->selected=$this->tt_id;
199 echo td(
"Type de total");
200 echo td($code_base->input());
214 if (trim($this->tmp_val) ==
"")
216 $this->errcode =
'Poste comptable est vide';
219 $count = $cn->get_value(
"select count(*) from tva_rate where tva_id=$1", array($this->tva_id));
222 $this->errcode =
'Code TVA inexistant';
234 printf(
"Total des codes du formulaire %s", $this->fp_formula);
240 $f_id = $cn->get_value(
"select f_id from rapport_advanced.formulaire_param where p_id=$1", array($this->
p_id));
241 $account =
new IText(
"form_compute");
243 $account->value=$this->fp_formula;
244 echo $account->input();
245 echo HtmlInput::button(
'rapav_search_code_bt',
'Cherche codes', sprintf(
" onclick=\"rapav_search_code('%s','%s','%s','%s')\"",
$_REQUEST[
'ac'],
$_REQUEST[
'plugin_code'],
$_REQUEST[
'gDossier'], $f_id));
274 $total_type_account = $cn->get_value(
'select tt_label from rapport_advanced.total_type_account where tt_id=$1', array($this->type_sum_account));
275 printf(
"Total %s poste comptable %s utilisé avec le poste comptable %s utilisant $ledger %s", $total_type_account, $this->tmp_val, $this->with_tmp_val, $paid);
281 $sum_type =
new ISelect(
'account_sum_type');
282 $sum_type->value = $cn->make_array(
"select tt_id, tt_label from rapport_advanced.total_type_account ");
283 $sum_type->selected=$this->type_sum_account;
284 $account =
new IPoste(
"account_first",
"",
"account_first_id");
286 $account->label = _(
"Recherche poste");
287 $account->value=$this->tmp_val;
288 $account->set_attribute(
'gDossier',
dossier::id());
289 $account->set_attribute(
'account', $account->id);
291 $account_second =
new IPoste(
"account_second",
"",
"account_second_id");
292 $account_second->size = 10;
293 $account_second->label = _(
"Recherche poste");
294 $account_second->set_attribute(
'gDossier',
dossier::id());
295 $account_second->set_attribute(
'account', $account_second->id);
296 $account_second->value=$this->with_tmp_val;
299 echo $sum_type->input();
302 echo _(
'du poste comptable') .
'(1)'.
" ". HtmlInput::infobulle(203);
303 echo $account->input();
306 echo _(
' utilisé avec le poste comptable').
" " . HtmlInput::infobulle(203);
307 echo $account_second->input();
320 if (trim($this->tmp_val) ==
"" || trim($this->with_tmp_val) ==
"")
322 $this->errcode = _(
" Un poste comptable est manquant");
340 $total_type_account = $cn->get_value(
'select tt_label from rapport_advanced.total_type_account where tt_id=$1', array($this->type_sum_account));
342 printf(
"Total %s poste comptable %s utilisé avec le poste comptable %s rapprochée dans la période donnée
343 avec une opération utilisant le poste comptable %s utilisant $ledger", $total_type_account, $this->tmp_val, $this->with_tmp_val, $this->operation_pcm_val);
349 $sum_type =
new ISelect(
'account_sum_type');
350 $sum_type->value = $cn->make_array(
"select tt_id, tt_label from rapport_advanced.total_type_account ");
351 $sum_type->selected=$this->type_sum_account;
352 $account =
new IPoste(
"acrec_first",
"",
"acrec_first_id");
354 $account->label = _(
"Recherche poste");
355 $account->set_attribute(
'gDossier',
dossier::id());
356 $account->set_attribute(
'account', $account->id);
357 $account->value=$this->tmp_val;
359 $account_second =
new IPoste(
"acrec_second",
"",
"acrec_second_id");
360 $account_second->size = 10;
361 $account_second->label = _(
"Recherche poste");
362 $account_second->set_attribute(
'gDossier',
dossier::id());
363 $account_second->set_attribute(
'account', $account_second->id);
364 $account_second->value=$this->with_tmp_val;
366 $account_third =
new IPoste(
"acrec_third",
"",
"acrec_third_id");
367 $account_third->size = 10;
368 $account_third->label = _(
"Recherche poste");
369 $account_third->set_attribute(
'gDossier',
dossier::id());
370 $account_third->set_attribute(
'account', $account_third->id);
371 $account_third->value=$this->operation_pcm_val;
375 echo $sum_type->input();
378 echo
'du poste comptable ' . HtmlInput::infobulle(203);
379 echo $account->input();
382 echo
' utilisé avec le poste comptable ' . HtmlInput::infobulle(203);
383 echo $account_second->input();
386 echo
' rapproché avec une opération dans la période donnée utilisant le poste comptable ' . HtmlInput::infobulle(203);
387 echo $account_third->input();
400 if (trim($this->tmp_val) ==
"" || trim($this->with_tmp_val) ==
"" || trim($this->operation_pcm_val) ==
'')
402 $this->errcode =
" Un poste comptable est manquant";
poste comptable utilisé avec le poste comptable, choix entre diff crédit - debit, diff débit-crédit...
poste comptable utilisé avec le poste comptable, choix entre diff crédit - debit, diff débit-crédit...
static verify_compute($p_formula)
check if the formula is valid, return 1 for an error and set errcode to the error msg errcode is glob...
static str_date_type($p_type)
Compute the string to display for date.
if(isset($_POST['save'])) $tva
static get_ledger_name($p_jrn)
Return the ledger's name of p_jrn.