30 require_once
'class_coprop_appel_fond.php';
44 throw new Exception(
"Choisissez le type de calcul");
48 $appel_fond->compute_budget($_GET);
52 $appel_fond->compute_amount($_GET);
56 $appel_fond->display_ledger();
63 alert($e->getMessage());
68 if (isset($_POST[
'correct']))
71 $appel_fond->id = $_POST[
'af_id'];
72 $ledger =
new Acc_Ledger(
$cn, $_POST[
'p_jrn']);
74 echo
'<FORM METHOD="GET" class="print">';
76 echo HtmlInput::request_to_hidden(array(
'amount',
'key',
'w_categorie_appel',
'b_id',
'aft',
'bud_pct',
'p_date',
'ac',
'plugin_code',
'sa'));
77 echo HtmlInput::extension() . dossier::hidden();
78 echo HtmlInput::hidden(
'action',
'confirm');
79 echo HtmlInput::hidden(
'af_id', $appel_fond->id);
80 echo HtmlInput::submit(
'save',
'Sauve');
82 echo HtmlInput::button(
'add', _(
'Ajout d\'une ligne'),
'onClick="quick_writing_add_row()"');
84 echo
'<div class="info">' .
85 _(
'Débit') .
' = <span id="totalDeb"></span> ' .
86 _(
'Crédit') .
' = <span id="totalCred"></span> ' .
87 _(
'Difference') .
' = <span id="totalDiff"></span></div> ';
88 echo
"<script>checkTotalDirect();</script>";
94 if (isset($_POST[
'confirm']))
99 $ledger =
new Acc_Ledger(
$cn, $_POST[
'p_jrn']);
100 $ledger->with_concerned =
false;
102 echo
"<h2>Opération sauvée</h2>";
104 echo
$ledger->confirm($_POST,
true);
106 $appel_fond->id = $_POST[
'af_id'];
107 $appel_fond->jr_internal=
$ledger->internal;
108 $appel_fond->confirm();
113 alert($e->getMessage());
119 if (isset($_GET[
'save']))
123 $ledger =
new Acc_Ledger(
$cn, $_GET[
'p_jrn']);
124 $ledger->with_concerned =
false;
126 echo
'<form method="POST">';
128 echo HtmlInput::hidden(
'af_id', $_GET[
'af_id']);
131 echo HtmlInput::submit(
'confirm',
'Confirmer');
132 echo HtmlInput::submit(
'correct',
'Corriger');
138 alert($e->getMessage());
140 $appel_fond->id = $_GET[
'af_id'];
141 $ledger =
new Acc_Ledger(
$cn, $_GET[
'p_jrn']);
143 echo
'<FORM METHOD="GET" class="print">';
145 echo HtmlInput::get_to_hidden(array(
'amount',
'key',
'w_categorie_appel',
'b_id',
'aft',
'bud_pct',
'p_date',
'ac',
'plugin_code',
'sa'));
146 echo HtmlInput::extension() . dossier::hidden();
147 echo HtmlInput::hidden(
'action',
'confirm');
148 echo HtmlInput::hidden(
'af_id', $appel_fond->id);
149 echo HtmlInput::submit(
'save',
'Sauve');
151 echo HtmlInput::button(
'add', _(
'Ajout d\'une ligne'),
'onClick="quick_writing_add_row()"');
153 echo
'<div class="info">' .
154 _(
'Débit') .
' = <span id="totalDeb"></span> ' .
155 _(
'Crédit') .
' = <span id="totalCred"></span> ' .
156 _(
'Difference') .
' = <span id="totalDiff"></span></div> ';
157 echo
"<script>checkTotalDirect();</script>";
167 $date->value = HtmlInput::default_value(
'p_date',
"", $_GET);
170 $amount->value = HtmlInput::default_value(
'amount', 0, $_GET);
181 $categorie_appel->value = isset($_GET[
'w_categorie_appel']) ? $_GET[
'w_categorie_appel'] :
"";
210 $key->value =
$cn->make_array(
"select cr_id,cr_name from coprop.clef_repartition order by cr_name");
211 $key->selected = HtmlInput::default_value(
'key', -1, $_GET);
218 $f_add_button->javascript =
" this.filter='$filter';this.jrn=-1;select_card_type(this);";
223 $budget_sel->value =
$cn->make_array(
"select b_id,b_name from coprop.budget order by b_name");
224 $budget_sel->selected = HtmlInput::default_value(
'b_id', -1, $_GET);
228 $budget_pct->value = HtmlInput::default_value(
'bud_pct', 0, $_GET);
233 array(
"value" => -1,
'label' =>
'Faites votre choix'),
234 array(
"value" => 1,
'label' =>
'Appel de fond par budget'),
235 array(
"value" => 2,
'label' =>
'Appel de fond par montant')
241 echo
'<form method="get">';
242 echo HtmlInput::request_to_hidden(array(
'ac',
'plugin_code',
'sa',
'gDossier'));
243 require_once
'template/appel_fond.php';
244 echo HtmlInput::submit(
'calc',
"Calculer");
if(isset($calc)) if(isset($_POST['correct'])) if(isset($_POST['confirm'])) if(isset($_GET['save'])) $date
global $g_copro_parameter