noalyss Version-10
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
ajax_ledger.php
Go to the documentation of this file.
1<?php
2/*
3 * This file is part of NOALYSS.
4 *
5 * NOALYSS is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * NOALYSS is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with NOALYSS; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18*/
19
20// Copyright Author Dany De Bontridder danydb@aevalys.eu
21
22/*!\file
23 * \brief answer to the ajax request for the ledger
24 * it means :
25 - detail of an operation (expert, user and analytic view)
26 - removal of an operation
27 - load a receipt document
28 - for reconcialiation
29 - update of analytic content
30*
31*/
32if (!defined('ALLOWED')) die(_('Non authorisé'));
33
35
36/**
37 * Check if we receive the needed data (jr_id...)
38 */
40mb_internal_encoding("UTF-8");
41
42try {
43 $action = $http->request('act');
44 $jr_id = $http->request('jr_id');
45 $div = $http->request('div'); /* the div source and target for javascript */
46 $gDossier = dossier::id();
47
48} catch (Exception $exc) {
49 record_log($exc);
50 return;
51}
52
53/**
54 *if $_SESSION[SESSION_KEY.'g_user'] is not set : echo a warning
55 */
56
59
60$g_user->check();
61if ($g_user->check_dossier(dossier::id(), true) == 'X') {
62 ob_start();
63 require_once NOALYSS_TEMPLATE . '/ledger_detail_forbidden.php';
65 $html = ob_get_contents();
66 ob_end_clean();
68 header('Content-type: text/xml; charset=UTF-8');
69 echo <<<EOF
70<?xml version="1.0" encoding="UTF-8"?>
71<data>
72<ctl>$div</ctl>
73<code>$html</code>
74</data>
75EOF;
76 exit();
77}
78
79
80// check if the user can access the ledger where the operation is (view) and
81// if he can modify it
83$op->jr_id = $jr_id;
84$ledger = $op->get_ledger();
85if ($ledger == "") {
86
87 ob_start();
88 echo HtmlInput::title_box(_("Information"), $div);
89 require_once NOALYSS_TEMPLATE . '/ledger_detail_forbidden.php';
90 echo HtmlInput::button_close($div);
91 $html = ob_get_contents();
92 ob_end_clean();
93
95 if (!headers_sent()) {
96 header('Content-type: text/xml; charset=UTF-8');
97 }
98 echo <<<EOF
99<?xml version="1.0" encoding="UTF-8"?>
100<data>
101<ctl>$div</ctl>
102<code>$html</code>
103</data>
104EOF;
105 exit();
106
107}
108$access = $g_user->get_ledger_access($ledger);
109if ($access == 'X') {
110 ob_start();
111 echo HtmlInput::title_box(_("Information"), $div);
112 require_once NOALYSS_TEMPLATE . '/ledger_detail_forbidden.php';
113 echo HtmlInput::button_close($div);
114 $html = ob_get_contents();
115 ob_end_clean();
117 header('Content-type: text/xml; charset=UTF-8');
118 echo <<<EOF
119<?xml version="1.0" encoding="UTF-8"?>
120<data>
121<ctl>$div</ctl>
122<code>$html</code>
123</data>
124EOF;
125 exit();
126}
127$html = var_export($_REQUEST, true);
128switch ($action) {
129 ///////////////////////////////////////////////////////////////////////////
130 // remove op
131 ///////////////////////////////////////////////////////////////////////////
132 case 'rmop':
133 if ($access == 'W' && $g_user->check_action(RMOPER) == 1 && $g_parameter->MY_STRICT=='N') {
134 ob_start();
135 /* get the ledger */
136 try {
137 $cn->start();
138 $oLedger = new Acc_Ledger($cn, $ledger);
139 $oLedger->jr_id = $jr_id = $http->request('jr_id', "number");
140 $oLedger->delete();
141 $cn->commit();
142 echo _("Opération Effacée");
143 } catch (Exception $e) {
144 record_log($e);
145 $e->getMessage();
146 $cn->rollback();
147 }
148 $html = ob_get_contents();
149 ob_end_clean();
150 } else {
151 $html = _("Effacement refusé");
152 }
153 break;
154 //////////////////////////////////////////////////////////////////////
155 // DE Detail
156 //////////////////////////////////////////////////////////////////////
157 case 'de':
158 ob_start();
159
160 try {
161 /* get detail op (D/C) */
162 $op->get();
163 /* return an obj. ACH / FIN or VEN or null if nothing is found*/
164 $obj = $op->get_quant();
165
166 $oLedger = new Acc_Ledger($cn, $ledger);
167 if ($obj == null || $obj->signature == 'ODS') {
168 /* only the details */
169 require_once NOALYSS_TEMPLATE . '/ledger_detail_misc.php';
170 } elseif ($obj->signature == 'ACH') {
171 require_once NOALYSS_TEMPLATE . '/ledger_detail_ach.php';
172 } elseif ($obj->signature == 'FIN') {
173 require_once NOALYSS_TEMPLATE . '/ledger_detail_fin.php';
174 } elseif ($obj->signature == 'VEN') {
175 require_once NOALYSS_TEMPLATE . '/ledger_detail_ven.php';
176 }
177 } catch (Exception $e) {
178 record_log($e);
180 echo '<h2 class="error">' . _("Désolé il y a une erreur") . '</h2>';
181 }
182 $html = ob_get_contents();
183 ob_end_clean();
184
185 break;
186 /////////////////////////////////////////////////////////////////////////////
187 // form for the file
188 /////////////////////////////////////////////////////////////////////////////
189 case 'file':
190 $op->get();
191 $obj = $op->get_quant(); /* return an obj. ACH / FIN or VEN or null if nothing is found*/
192
193 $repo = new Database();
194 html_min_page_start($_SESSION[SESSION_KEY . 'g_theme']);
195
196 // if there is a receipt document
197 if ($obj->det->jr_pj_name == '') {
198 if (!isset($_REQUEST['ajax'])) {
199 echo '<div class="op_detail_frame">';
200 } else {
201 echo "<div>";
202
203 }
204 if ($access == 'W') {
205 $check_receipt = sprintf("check_receipt_size('%s','file%s')",
206 MAX_FILE_SIZE, $div);
207 echo '<FORM METHOD="POST" ENCTYPE="multipart/form-data" id="form_file" >';
208
209 $sp = new ISpan('file' . $div);
210 $sp->style = "display:none;background-color:red;color:white;font-size:12px";
211 $sp->value = _("Chargement");
212 echo $sp->input();
213 echo HtmlInput::hidden('act', 'loadfile');
214 echo dossier::hidden();
215 echo HtmlInput::hidden('jr_id', $jr_id);
216 echo HtmlInput::hidden('div', $div);
217 echo '<INPUT TYPE="FILE" id="receipt_id" name="pj" onchange="' . $check_receipt . '">';
218
219 echo '<p id="receipt_info_id" style="display:inline"></p>';
220
221 echo '</FORM>';
222 } else {
223 if (!isset($_REQUEST['ajax'])) {
224 echo '<div class="op_detail_frame">';
225 } else {
226 echo "<div>";
227 }
228
229
230 echo _('Aucun fichier');
231 }
232 echo '</div>';
233 exit();
234 } else {
235 // There is no document attached to this writing
236 //
237 if (!isset($_REQUEST['ajax'])) {
238 echo '<div class="op_detail_frame">';
239 } else {
240 echo "<div>";
241
242 }
243 echo '<div class="op_detail_frame">';
244 $x = '';
245 if ($access == 'W' && $g_user->check_action(RMRECEIPT) == 1) {
246 // Not possible to remove the file thanks a modal dialog box,
247 // because of the frameset
248
249 $x = Icon_Action::trash(uniqid(),
250 sprintf("if (confirm(content[47])) {document.location.href='ajax_misc.php?op=ledger&gDossier=%d&div=%s&jr_id=%s&act=rmf'}",
252
253 }
254 $filename = $obj->det->jr_pj_name;
255 if (strlen($obj->det->jr_pj_name) > 60) {
256 $filename = mb_substr($obj->det->jr_pj_name, 0, 60);
257 }
258 echo HtmlInput::show_receipt_document($jr_id, h($filename));
259 // if using the XML Belgian format, add a tab for showing it
260 $acc_document=new Acc_Document($cn,$jr_id);
261 echo '<span style="margin-left:5rem">'.
262 $acc_document->link_download_xml()
263 .'</span>';
264 echo $x;
265 echo '<p id="receipt_info_id" style="display:inline" ></p>';
266 echo '</div>';
267 echo '</body></html>';
268 exit();
269 }
270/////////////////////////////////////////////////////////////////////////////
271// load a file
272/////////////////////////////////////////////////////////////////////////////
273 case 'loadfile':
274 if ($access == 'W' && isset ($_FILES)) {
275 $cn->start();
276 $acc_document=new \Acc_Document($cn,$jr_id);
277 $acc_document->save_receipt();
278 $cn->commit();
279 // Show a link to the new file
280 $op->get();
281 $obj = $op->get_quant(); /* return an obj. ACH / FIN or VEN or null if nothing is found*/
282 html_min_page_start($_SESSION[SESSION_KEY . 'g_theme']);
283 if (!isset($_REQUEST['ajax'])) echo "<body class=\"op_detail_frame\">"; else echo "<body>";
284 echo '<div class="op_detail_frame">';
285 $x = "";
286 // check if the user can remove a document
287 if ($g_user->check_action(RMRECEIPT) == 1) {
288 // Not possible to remove the file thanks a modal dialog box,
289 // because of the frameset
290 $x = Icon_Action::trash(uniqid(),
291 sprintf("if (confirm(content[47])) {document.location.href='ajax_misc.php?op=ledger&gDossier=%d&div=%s&jr_id=%s&act=rmf'}",
293 }
294 $filename = $obj->det->jr_pj_name;
295 echo HtmlInput::show_receipt_document($jr_id, h($filename));
296 echo $x;
297 // if using the XML Belgian format, add a tab for showing it
298 $acc_document=new Acc_Document($cn,$jr_id);
299 echo '<span style="margin-left:5rem">'.
300 $acc_document->link_download_xml()
301 .'</span>';
302 echo '<p id="receipt_info_id" style="display:inline" ></p>';
303 echo '</div>';
304 echo '</div>';
305 echo '</body></html>';
306 }
307 exit();
308/////////////////////////////////////////////////////////////////////////////
309// remove a file
310/////////////////////////////////////////////////////////////////////////////
311 case 'rmf':
312 if ($access == 'W' && $g_user->check_action(RMRECEIPT) == 1) {
313 $repo = new Database();
314 html_min_page_start($_SESSION[SESSION_KEY . 'g_theme']);
315 echo '<div class="op_detail_frame">';
316 $check_receipt = sprintf("check_receipt_size('%s','file%s')",
317 MAX_FILE_SIZE, $div);
318 echo '<FORM METHOD="POST" ENCTYPE="multipart/form-data" id="form_file">';
319 $sp = new ISpan('file' . $div);
320 $sp->style = "display:none;width:155px;height:15px;background-color:red;color:white;font-size:10px";
321 $sp->value = _("Chargement");
322 echo $sp->input();
323
324 echo HtmlInput::hidden('act', 'loadfile');
325 echo dossier::hidden();
326 echo HtmlInput::hidden('jr_id', $jr_id);
327 echo HtmlInput::hidden('div', $div);
328
329 echo '<INPUT TYPE="FILE" id="receipt_id" name="pj" onchange="' . $check_receipt . '">';
330 echo '<p id="receipt_info_id" style="display:inline"></p>';
331 echo '</FORM>';
332 $ret = $cn->exec_sql("select jr_pj from jrn where jr_id=$1", array($jr_id));
333 if (Database::num_row($ret) != 0) {
335 $old_oid = $r['jr_pj'];
336 if (strlen($old_oid) != 0) {
337 // check if this pj is used somewhere else
338 $c = $cn->get_value("select count(*) from jrn where jr_pj=$1",
339 [$old_oid]);
340
341 if ($c == 1)
342 $cn->lo_unlink($old_oid);
343 }
344
345 $cn->exec_sql("update jrn set jr_pj=null, jr_pj_name=null, " .
346 "jr_pj_type=null where jr_id=$1", array($jr_id));
347
348 if ( ($oid_xml = $cn->get_value("select jr_document_xml from jrn where jr_id = $1",[$jr_id])) != "")
349 {
350 $cn->exec_sql("update jrn set jr_document_xml=null where jr_id=$1", array($jr_id));
351 $cn->lo_unlink($oid_xml);
352 }
353 }
354 }
355 echo '</div>';
356 exit();
357/////////////////////////////////////////////////////////////////////////////
358// Save operation detail
359/////////////////////////////////////////////////////////////////////////////
360 case 'save':
361 ob_start();
362 $http = new HttpInput();
363 try {
364 $cn->start();
365 if ($access == "W" ) {
366 if (isset($_POST['p_ech'])) {
367 $ech = $http->post('p_ech');
368 if (trim($ech) != '' && isDate($ech) != null) {
369 $cn->exec_sql("update jrn set jr_ech=to_date($1,'DD.MM.YYYY') where jr_id=$2",
370 array($ech, $jr_id));
371
372 } else {
373 $cn->exec_sql("update jrn set jr_ech=null where jr_id=$1",
374 array($jr_id));
375
376 }
377 }
378
379 if (isset($_POST['p_date_paid'])) {
380 $ech = $http->post('p_date_paid');
381 if (trim($ech) != '' && isDate($ech) != null) {
382 $cn->exec_sql("update jrn set jr_date_paid=to_date($1,'DD.MM.YYYY') where jr_id=$2",
383 array($ech, $jr_id));
384
385 } else {
386 $cn->exec_sql("update jrn set jr_date_paid=null where jr_id=$1",
387 array($jr_id));
388
389 }
390 }
391 $oLedger=new Acc_Ledger($cn,$ledger);
392 $npj=$http->post('npj');
393 // protect receipt number
394 if ( ($g_parameter->MY_PJ_SUGGEST == 'A'||$g_user->check_action(UPDRECEIPT)==0) && $oLedger->get_type() !='FIN') {
395 $npj=$cn->get_value("select jr_pj_number from jrn where jr_id=$1",[$jr_id]);
396 }
397 // protect date in strict mode
398 $date=$http->post("p_date");
399 if ( $g_parameter->MY_STRICT=='Y' && $g_user->check_action(UPDDATE)==0) {
400 $date=$cn->get_value("select to_char(jr_date,'DD.MM.YYYY') from jrn where jr_id=$1",[$jr_id]);
401 }
402 $cn->exec_sql("update jrn set jr_comment=$1,jr_pj_number=$2,jr_date=to_date($4,'DD.MM.YYYY'),jr_optype=$5 where jr_id=$3",
403 array($http->post('lib'), $npj, $jr_id,$date, $http->post('jr_optype')));
404 $find_periode = $cn->get_value("select comptaproc.find_periode($1)",[$date]);
405
406 $cn->exec_sql("update jrnx set j_date=to_date($1,'DD.MM.YYYY'),j_tech_per=$3 where j_grpt in (select jr_grpt_id from jrn where jr_id=$2)",
407 array($date, $jr_id,$find_periode));
408 $cn->exec_sql('update operation_analytique set oa_date=j_date from jrnx
409 where
410 operation_analytique.j_id=jrnx.j_id and
411 operation_analytique.j_id in (select j_id
412 from jrnx join jrn on (j_grpt=jr_grpt_id)
413 where jr_id=$1)
414 ', array($jr_id));
415 //------------------------------------------------
416 // Save note
417 //------------------------------------------------
418 $acc_operation_note= Acc_Operation_Note::build_jrn_id($jr_id);
419 $acc_operation_note->setOperation_id($jr_id);
420 $acc_operation_note->setNote(decodeURI($http->post("jr_note",'raw')??""));
421 $acc_operation_note->save();
422 $rapt = $http->post('rapt');
423
424
425 if ($g_parameter->MY_UPDLAB == 'Y' && isset ($_POST['j_id'])) {
426 $a_rowid = $http->post("j_id");
427 for ($e = 0; $e < count($a_rowid); $e++) {
428 $id = "e_march" . $a_rowid[$e] . "_label";
429 $cn->exec_sql('update jrnx set j_text=$1 where j_id=$2', array($http->post($id), $a_rowid[$e]));
430 }
431 }
432 if (trim($rapt) != '') {
433 $rec = new Acc_Reconciliation ($cn);
434 $rec->set_jr_id($jr_id);
435
436 if (strpos($rapt, ",") != 0) {
437 $aRapt = explode(',', $rapt);
438 /* reconcialition */
439 foreach ($aRapt as $rRapt) {
440 if (isNumber($rRapt) == 1) {
441 // Add a "concerned operation to bound these op.together
442 $rec->insert($rRapt);
443 }
444 }
445 } else
446 if (isNumber($rapt) == 1) {
447 $rec->insert($rapt);
448 }
449 }
450 if (isset($_POST['ipaid'])) {
451 $cn->exec_sql("update jrn set jr_rapt='paid' where jr_id=$1", array($jr_id));
452 } else {
453 $cn->exec_sql("update jrn set jr_rapt=null where jr_id=$1", array($jr_id));
454 }
455 ////////////////////////////////////////////////////
456 // CA
457 //////////////////////////////////////////////////
459 if ($owner->MY_ANALYTIC != "nu" && isset ($_POST['op'])) {
460 // for each item, insert into operation_analytique */
461 $opanc = new Anc_Operation($cn);
462 $opanc->save_update_form($_POST);
463 }
464 //////////////////////////////////////////////////////////////////
465 //Save other info
466 //////////////////////////////////////////////////////////////////
467 $op->save_info($http->post('OTHER'), 'OTHER');
468 $op->save_info($http->post('BON_COMMANDE'), 'BON_COMMANDE');
469
470 ///////////////////////////////////////////////////////////////////
471 // Save related
472 //////////////////////////////////////////////////////////////////
473 $related = $http->post("related", "string");
474 if ($related == "0") {
475 throw new Exception('Parameter not send -> related' . __FILE__ . __LINE__, 10);
476 }
477 $op->insert_related_action($related);
478
479 }
480 echo 'OK';
481 $cn->commit();
482 } catch (Exception $e) {
483 $html = ob_get_contents();
484 ob_end_clean();
485 record_log($e);
487
488 if (DEBUGNOALYSS > 0) echo $e->getMessage();
489 echo _("Changement impossible: on ne peut pas changer la date dans une période fermée");
490 return;
491 }
492 $html = ob_get_contents();
493 ob_end_clean();
494
495 break;
496 ////////////////////////////////////////////////////////////////////////////
497 // remove a reconciliation
498 ////////////////////////////////////////////////////////////////////////////
499 case 'rmr':
500 if ($access == 'W') {
501 $rec = new Acc_Reconciliation($cn);
502 $rec->set_jr_id($jr_id);
503 $rec->remove($_GET['jr_id2']);
504 }
505 break;
506 ////////////////////////////////////////////////////////////////////////////
507 // ask for a date for reversing the operation
508 ////////////////////////////////////////////////////////////////////////////
509 case 'ask_extdate':
510 $date = new IDate('p_date');
511 $html .= "<form id=\"form_" . $div . "\" onsubmit=\"return reverseOperation(this);\">";
512 $html .= HtmlInput::hidden('jr_id', $http->request('jr_id','number')) .
513 HtmlInput::hidden('div', $div) .
514 dossier::hidden() .
515 HtmlInput::hidden('act', 'reverseop');
516
517 $html .= '<h2 class="info">' . _('entrez une date') . ' </H2>' . $date->input();
518 $html .= HtmlInput::submit('x', 'accepter');
520 $html .= '</form>';
521 break;
522 ////////////////////////////////////////////////////////////////////////////
523 // Reverse an operation
524 ////////////////////////////////////////////////////////////////////////////
525 case 'reverseop':
526 if ($access == 'W') {
527 ob_start();
528 try {
529 $ext_date = $http->request("ext_date", "date");
530 $ext_label = $http->request("ext_label");
531 $cn->start();
532 $oLedger = new Acc_Ledger($cn, $ledger);
533 $oLedger->jr_id = $jr_id;
534 if (trim($ext_label) == "") {
535 $ext_label = _("Extourne") . $cn->get_value("select jr_comment from jrn where jr_id=$1", [$jr_id]);
536 }
537 $oLedger->reverse($ext_date, $ext_label);
538 $cn->commit();
539 echo _("Opération extournée");
540 } catch (Exception $e) {
541 record_log($e);
542 echo $e->getMessage();
543 $cn->rollback();
544 }
545 }
546 $html = ob_get_contents();
547 ob_end_clean();
548 break;
549
550 case 'duplicateop':
551 ///////////////////////////////////////////////////////////////////////////////////////////////////////////
552 // Duplicate operation
553 ///////////////////////////////////////////////////////////////////////////////////////////////////////////
555 $operation->jr_id = $jr_id;
556 ob_start();
557 echo HtmlInput::title_box(_("Dupliquer une opération"), $div);
558 echo $operation->form_clone_operation("cloneit");
559
560 $html = ob_get_contents();
561 ob_end_clean();
562
563
564 break;
565 case 'note_refresh':
566 $acc_operation_note= Acc_Operation_Note::build_jrn_id($jr_id);
567 echo substr($acc_operation_note->getNote()??"",0,120);
568
569 return;
570 case "rmsup":
571 //------------------------------------------------
572 // Remove a document from JRN_SUP_DOCUMENT
573 //------------------------------------------------
574 $js_id=$http->post("js_id","number");
575 $jrn_sup= new Jrn_Sup_Document_SQL($cn,$js_id);
576 $jrn_sup->delete();
577 // no answer, we stop here
578 return;
579 case 'input_file':
580 //------------------------------------------------
581 // Display form for adding file , directly HTML
582 //
583 //------------------------------------------------
584 require_once NOALYSS_TEMPLATE."/ajax_ledger+input_file.php";
585 return;
586 case 'save_file':
587 //------------------------------------------------
588 // Add a document to the operation
589 //------------------------------------------------
590 if (sizeof($_FILES)==0) {
591 return;
592 }
593 $nb=count($_FILES['document_supplemental']["name"]);
594 $cn->start();
595 for ($i=0;$i<$nb;$i++)
596 {
597 $file= tempnam($_ENV["TMP"], "sup_file");
598 if ( move_uploaded_file($_FILES['document_supplemental']['tmp_name'][$i],$file))
599 {
600 if ( ($oid=$cn->lo_import($file)) != false )
601 {
602 $jrn_sup=new Jrn_Sup_Document_SQL($cn);
603 $jrn_sup->jr_id=$jr_id;
604 $jrn_sup->js_lob=$oid;
605 $jrn_sup->js_mimetype=$_FILES['document_supplemental']['type'][$i];
606 $jrn_sup->js_filename=$_FILES['document_supplemental']['name'][$i];
607 $jrn_sup->insert();
608 $rowid=sprintf("row_js_%s_%s",$div,$jrn_sup->js_id);
609 // @var $download (url) to send file
610 $download="export.php?". http_build_query(
611 [
612 "act"=>"RAW:suppl-document"
613 ,"js_id"=>$jrn_sup->js_id
614 ,"gDossier"=>$gDossier
615 ]);
616
617
618 $script_remove="Supplement_Document.delete_document('$gDossier','$div','{$jrn_sup->js_id}','$jr_id')";
619 $icon_remove=\Icon_Action::trash(uniqid("sdd"),$script_remove);
620 echo <<<EOF
621<div class="row" id="{$rowid}">
622 <div class="col">
623 <a href="{$download}" download>
624 {$jrn_sup->js_filename}
625 </a>
626 </div>
627 <div class="col">
628 {$jrn_sup->js_description}
629 </div>
630 <div class="col">
631 {$icon_remove}
632 </div>
633</div>
634EOF;
635 }
636 else
637 {
638 // failed
639 print '<div class="row">';
640 echo_warning(_("1 Echec ").$_FILES["name"]);
641 print '</div>';
642 }
643
644 }
645 else
646 {
647 //failed
648 // failed
649 print '<div class="row">';
650 echo_warning(_("2 Echec ").$_FILES["name"]);
651 print '</div>';
652 }
653 }
654
655 $cn->commit();
656 return;
657 case 'refresh_file':
658 //------------------------------------------------
659 // refresh list of suppemental files
660 //------------------------------------------------
661 // @var $jr_id (int) JRN.JR_ID
662 $jr_id=$http->get("jr_id");
663 ob_start();
665 $html= ob_get_contents();
666 ob_end_clean();
667 $count=$cn->get_value("select count(*) from jrn_sup_document where jr_id=$1",[$jr_id]);
668 echo json_response(["html"=>$html,"count"=>$count]);
669 return;
670}
672if (!headers_sent()) {
673 header('Content-type: text/xml; charset=UTF-8');
674}
675
676
677echo <<<EOF
678<?xml version="1.0" encoding="UTF-8"?>
679<data>
680<ctl>$div</ctl>
681<code>$html</code>
682</data>
683EOF;
isNumber($p_int)
isDate($p_date)
Verifie qu'une date est bien formaté en d.m.y et est valable.
echo_warning($p_string)
warns
html_min_page_start($p_theme="", $p_script="", $p_script2="")
Minimal page header for each page, used for small popup window.
record_log($p_message)
Record an error message into the log file of the server or in the log folder of NOALYSS Record also t...
global $g_parameter
global $g_user
if no group available , then stop
catch(Exception $e) $obj
if(headers_sent() &&DEBUGNOALYSS > 0) $html
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
$op
h( $row[ 'oa_description'])
if($ledger=="") $access
$jr_id
if(isset($_REQUEST['gDossier']) && $http->request("gDossier","number", 0) !=0) $repo
$_REQUEST['ac']
_("actif, passif,charge,...")
$_GET['qcode']
Document used in accountancy : invoice , credit note, ... It is a specialization of Document used in ...
static display_supplementary_doc($cn, $div, $jr_id)
Class for jrn, class acc_ledger for manipulating the ledger AND some acc.
this file match the tables jrn & jrnx the purpose is to remove or save accountant writing to these ta...
new class for managing the reconciliation it must be used instead of the function InsertRapt,...
this class is used to show the form for entering an operation only FOR analytic operation to save it,...
static fetch_array($ret, $p_indice=0, $p_mode=PGSQL_ASSOC)
wrapper for the function pg_fetch_array
static num_row($ret)
wrapper for the function pg_num_rows
contains the class for connecting to Noalyss
static connect()
static button_close($div_name, $class='smallbutton')
close button for the HTML popup
static show_receipt_document($p_jr_id, $p_name="")
Returns HTML code for displaying a icon with a link to a receipt document from the ledger.
static hidden($p_name, $p_value, $p_id="")
static title_box($p_name, $p_div, $p_mod="close", $p_js="", $p_draggable="n", $p_enlarge='n', $raw="", $refresh='')
Title for boxes, you can customize the symbol thanks symbol with the mode "custom".
static submit($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
manage the http input (get , post, request) and extract from an array
Html Input : Input a date format dd.mm.yyyy The property title should be set to indicate what it is e...
Html Input.
static close($p_div)
Return a html string with an anchor which close the inside popup.
static trash($p_id, $p_javascript)
Display the icon of a trashbin.
abstract of the table public.jrn_sup_document
Class to manage the company parameter (address, name...)
$c
Definition compute.php:48
const RMRECEIPT
const UPDDATE
const UPDRECEIPT
const RMOPER
$_POST['ac']
Definition do.php:323
$count
for($e=0; $e< count($afiche); $e++) exit
escape_xml($p_xml)
When data are transfered thanks ajax in a xml document, the xml can not contains some character,...
decodeURI($string)
json_response($p_answer)
Send header and json object.
print
Type of printing.
if( $delta< 0) elseif( $delta==0)