30if (
$op ==
"operation_exercice+update_periode") {
33 $folder_id =
$http->get(
"folder",
"number");
36 }
catch (\Exception
$e) {
42 $periode = $conx->make_array(
"select distinct p_exercice,p_exercice from parm_periode order by p_exercice desc");
52if (
$op ==
"operation_exercice+modify_row") {
54 $row_id =
$http->post(
"row_id",
"number", -1);
55 $oe_id =
$http->post(
"oe_id",
"number");
56 }
catch (\Exception
$e) {
57 echo
$e->getMessage();
61 $operation_detail_sql->oe_id = $oe_id;
62 if ($row_id == -1) $operation_detail_sql->oed_debit =
'f';
70if (
$op ==
"operation_exercice+save_row") {
72 $row_id =
$http->post(
"row_id",
"number");
73 $oe_id =
$http->post(
"oe_id",
"number");
74 $oe_poste =
$http->post(
"oe_poste",
"text");
78 $debit =
$http->post(
"debit",
"text",
'f');
79 }
catch (\Exception
$e) {
80 echo
$e->getMessage();
85 $operation_detail_sql->setp(
"oed_poste", $oe_poste)
86 ->setp(
"oed_qcode",
$qcode)
87 ->setp(
"oed_label",
$label)
89 ->setp(
"oe_id", $oe_id)
90 ->setp(
"oed_debit", $debit);
92 $operation_detail_sql->save();
93 $data = $operation_detail_sql->to_array();
98 $operation_exercice->display_row(
$data,
true);
101 $operation_exercice->display_row(
$data,
false);
103 $str = ob_get_contents();
108 $answer[
'row_id'] = $operation_detail_sql->oed_id;
109 $answer[
'oe_id'] = $operation_detail_sql->oe_id;
112 }
catch (\Exception
$e) {
113 echo
$e->getMessage();
121if (
$op ==
"operation_exercice+display_total") {
123 $row_id =
$http->get(
"row_id",
"number");
125 if ($operation_detail_sql->getp(
"oe_id") ==
"") {
126 throw new Exception(
"AOE-113:not existing line");
129 $operation_exercice->display_total(
false);
131 }
catch (\Exception
$e) {
132 echo
$e->getMessage();
139if (
$op ==
"operation_exercice+delete_row") {
141 $row_id =
$http->get(
"row_id",
"number");
143 $oe_id = $operation_detail_sql->oe_id;
144 $other_row =
$cn->get_value(
"select oed_id from operation_exercice_detail where oe_id=$1 limit 1 ",
147 $operation_detail_sql->delete();
148 echo
json_response(array(
"status" =>
"OK",
"row_id" => $other_row));
149 }
catch (\Exception
$e) {
150 echo
$e->getMessage();
157if (
$op ==
"operation_exercice+date") {
159 $oe_id =
$http->request(
"oe_id",
"number");
160 }
catch (\Exception
$e) {
161 echo
$e->getMessage();
164 $action =
$http->request(
"ieaction",
"string",
"display");
166 $ajax_date->add_json_param(
"op",
"operation_exercice+date");
167 $ajax_date->add_json_param(
"gDossier",
Dossier::id());
168 $ajax_date->add_json_param(
"oe_id", $oe_id);
169 $ajax_date->set_callback(
"ajax_misc.php");
173 echo $ajax_date->ajax_input();
177 $cn->exec_sql(
"update operation_exercice set oe_date=to_date($1,'DD.MM.YYYY') where oe_id=$2", [
$value, $oe_id]);
178 $ajax_date->set_value(
$value);
179 echo $ajax_date->value();
183 echo $ajax_date->value();
190if (
$op ==
"operation_exercice+text") {
192 $oe_id =
$http->request(
"oe_id",
"number");
193 }
catch (\Exception
$e) {
194 echo
$e->getMessage();
197 $action =
$http->request(
"ieaction",
"string",
"display");
199 $ajax_text->add_json_param(
"op",
"operation_exercice+text");
200 $ajax_text->add_json_param(
"gDossier",
Dossier::id());
201 $ajax_text->add_json_param(
"oe_id", $oe_id);
202 $ajax_text->set_callback(
"ajax_misc.php");
206 echo $ajax_text->ajax_input();
210 $cn->exec_sql(
"update operation_exercice set oe_text=$1 where oe_id=$2", [
$value, $oe_id]);
211 $ajax_text->set_value(
$value);
212 echo $ajax_text->value();
216 echo $ajax_text->value();
223if (
$op ==
"operation_exercice+transfer") {
225 $operation_exercice_id =
$http->request(
"oe_id",
"number");
228 }
catch (\Exception
$e) {
229 echo
$e->getMessage();
235 global $oe_result, $oe_status;
237 $operation_exercice->submit_transfer(
$ledger_id);
238 $answer[
'status'] = $oe_status;
239 if (
$answer[
'status'] ==
'NOK') {
240 $answer[
'content'] =
span($oe_result,
'class=warning');
span($p_string, $p_extra='')
contains the class for connecting to Noalyss
static id()
return the 'gDossier' value after a check
Html Input , create a tag <SELECT> ... </SELECT> if readonly == true then display the label correspon...
static build($p_serialize)
build a Inplace_Edit object from a serialized string (ajax json parameter = input)
static input_row(Operation_Exercice_Detail_SQL $operation_detail_sql)
input one row of operation_exercice
json_response($p_answer)
Send header and json object.