32if (!defined(
'ALLOWED')) die(
_(
'Non authorisé'));
40mb_internal_encoding(
"UTF-8");
48}
catch (Exception $exc) {
61if (
$g_user->check_dossier(dossier::id(),
true) ==
'X') {
63 require_once NOALYSS_TEMPLATE .
'/ledger_detail_forbidden.php';
65 $html = ob_get_contents();
68 header(
'Content-type: text/xml; charset=UTF-8');
70<?xml version=
"1.0" encoding=
"UTF-8"?>
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();
95 if (!headers_sent()) {
96 header(
'Content-type: text/xml; charset=UTF-8');
99<?xml version=
"1.0" encoding=
"UTF-8"?>
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();
117 header(
'Content-type: text/xml; charset=UTF-8');
119<?xml version=
"1.0" encoding=
"UTF-8"?>
139 $oLedger->jr_id =
$jr_id =
$http->request(
'jr_id',
"number");
142 echo
_(
"Opération Effacée");
143 }
catch (Exception
$e) {
148 $html = ob_get_contents();
151 $html =
_(
"Effacement refusé");
167 if (
$obj ==
null ||
$obj->signature ==
'ODS') {
169 require_once NOALYSS_TEMPLATE .
'/ledger_detail_misc.php';
171 require_once NOALYSS_TEMPLATE .
'/ledger_detail_ach.php';
173 require_once NOALYSS_TEMPLATE .
'/ledger_detail_fin.php';
175 require_once NOALYSS_TEMPLATE .
'/ledger_detail_ven.php';
177 }
catch (Exception
$e) {
180 echo
'<h2 class="error">' .
_(
"Désolé il y a une erreur") .
'</h2>';
182 $html = ob_get_contents();
197 if (
$obj->det->jr_pj_name ==
'') {
199 echo
'<div class="op_detail_frame">';
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" >';
210 $sp->style =
"display:none;background-color:red;color:white;font-size:12px";
211 $sp->value =
_(
"Chargement");
214 echo dossier::hidden();
217 echo
'<INPUT TYPE="FILE" id="receipt_id" name="pj" onchange="' . $check_receipt .
'">';
219 echo
'<p id="receipt_info_id" style="display:inline"></p>';
224 echo
'<div class="op_detail_frame">';
230 echo
_(
'Aucun fichier');
238 echo
'<div class="op_detail_frame">';
243 echo
'<div class="op_detail_frame">';
250 sprintf(
"if (confirm(content[47])) {document.location.href='ajax_misc.php?op=ledger&gDossier=%d&div=%s&jr_id=%s&act=rmf'}",
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);
261 echo
'<span style="margin-left:5rem">'.
262 $acc_document->link_download_xml()
265 echo
'<p id="receipt_info_id" style="display:inline" ></p>';
267 echo
'</body></html>';
274 if (
$access ==
'W' && isset ($_FILES)) {
276 $acc_document=new \Acc_Document(
$cn,
$jr_id);
277 $acc_document->save_receipt();
283 if (!isset(
$_REQUEST[
'ajax'])) echo
"<body class=\"op_detail_frame\">";
else echo
"<body>";
284 echo
'<div class="op_detail_frame">';
291 sprintf(
"if (confirm(content[47])) {document.location.href='ajax_misc.php?op=ledger&gDossier=%d&div=%s&jr_id=%s&act=rmf'}",
294 $filename =
$obj->det->jr_pj_name;
299 echo
'<span style="margin-left:5rem">'.
300 $acc_document->link_download_xml()
302 echo
'<p id="receipt_info_id" style="display:inline" ></p>';
305 echo
'</body></html>';
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">';
320 $sp->style =
"display:none;width:155px;height:15px;background-color:red;color:white;font-size:10px";
321 $sp->value =
_(
"Chargement");
325 echo dossier::hidden();
329 echo
'<INPUT TYPE="FILE" id="receipt_id" name="pj" onchange="' . $check_receipt .
'">';
330 echo
'<p id="receipt_info_id" style="display:inline"></p>';
332 $ret =
$cn->exec_sql(
"select jr_pj from jrn where jr_id=$1", array(
$jr_id));
335 $old_oid =
$r[
'jr_pj'];
336 if (strlen($old_oid) != 0) {
338 $c =
$cn->get_value(
"select count(*) from jrn where jr_pj=$1",
342 $cn->lo_unlink($old_oid);
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));
348 if ( ($oid_xml =
$cn->get_value(
"select jr_document_xml from jrn where jr_id = $1",[
$jr_id])) !=
"")
350 $cn->exec_sql(
"update jrn set jr_document_xml=null where jr_id=$1", array(
$jr_id));
351 $cn->lo_unlink($oid_xml);
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",
373 $cn->exec_sql(
"update jrn set jr_ech=null where jr_id=$1",
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",
386 $cn->exec_sql(
"update jrn set jr_date_paid=null where jr_id=$1",
392 $npj=
$http->post(
'npj');
395 $npj=
$cn->get_value(
"select jr_pj_number from jrn where jr_id=$1",[
$jr_id]);
400 $date=
$cn->get_value(
"select to_char(jr_date,'DD.MM.YYYY') from jrn where jr_id=$1",[
$jr_id]);
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",
404 $find_periode =
$cn->get_value(
"select comptaproc.find_periode($1)",[
$date]);
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)",
408 $cn->exec_sql(
'update operation_analytique set oa_date=j_date from jrnx
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)
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');
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]));
432 if (trim($rapt) !=
'') {
436 if (strpos($rapt,
",") != 0) {
437 $aRapt = explode(
',', $rapt);
439 foreach ($aRapt as $rRapt) {
442 $rec->insert($rRapt);
450 if (isset(
$_POST[
'ipaid'])) {
451 $cn->exec_sql(
"update jrn set jr_rapt='paid' where jr_id=$1", array(
$jr_id));
453 $cn->exec_sql(
"update jrn set jr_rapt=null where jr_id=$1", array(
$jr_id));
459 if (
$owner->MY_ANALYTIC !=
"nu" && isset (
$_POST[
'op'])) {
462 $opanc->save_update_form(
$_POST);
467 $op->save_info(
$http->post(
'OTHER'),
'OTHER');
468 $op->save_info(
$http->post(
'BON_COMMANDE'),
'BON_COMMANDE');
473 $related =
$http->post(
"related",
"string");
474 if ($related ==
"0") {
475 throw new Exception(
'Parameter not send -> related' . __FILE__ . __LINE__, 10);
477 $op->insert_related_action($related);
482 }
catch (Exception
$e) {
483 $html = ob_get_contents();
488 if (DEBUGNOALYSS > 0) echo
$e->getMessage();
489 echo
_(
"Changement impossible: on ne peut pas changer la date dans une période fermée");
492 $html = ob_get_contents();
503 $rec->remove(
$_GET[
'jr_id2']);
511 $html .=
"<form id=\"form_" .
$div .
"\" onsubmit=\"return reverseOperation(this);\">";
517 $html .=
'<h2 class="info">' .
_(
'entrez une date') .
' </H2>' .
$date->input();
529 $ext_date =
$http->request(
"ext_date",
"date");
530 $ext_label =
$http->request(
"ext_label");
534 if (trim($ext_label) ==
"") {
535 $ext_label =
_(
"Extourne") .
$cn->get_value(
"select jr_comment from jrn where jr_id=$1", [
$jr_id]);
537 $oLedger->reverse($ext_date, $ext_label);
539 echo
_(
"Opération extournée");
540 }
catch (Exception
$e) {
542 echo
$e->getMessage();
546 $html = ob_get_contents();
558 echo
$operation->form_clone_operation(
"cloneit");
560 $html = ob_get_contents();
567 echo substr($acc_operation_note->getNote()??
"",0,120);
574 $js_id=
$http->post(
"js_id",
"number");
584 require_once NOALYSS_TEMPLATE.
"/ajax_ledger+input_file.php";
590 if (
sizeof($_FILES)==0) {
593 $nb=count($_FILES[
'document_supplemental'][
"name"]);
597 $file= tempnam($_ENV[
"TMP"],
"sup_file");
598 if ( move_uploaded_file($_FILES[
'document_supplemental'][
'tmp_name'][
$i],
$file))
600 if ( ($oid=
$cn->lo_import(
$file)) !=
false )
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];
608 $rowid=sprintf(
"row_js_%s_%s",
$div,$jrn_sup->js_id);
610 $download=
"export.php?". http_build_query(
612 "act"=>
"RAW:suppl-document"
613 ,
"js_id"=>$jrn_sup->js_id
618 $script_remove=
"Supplement_Document.delete_document('$gDossier','$div','{$jrn_sup->js_id}','$jr_id')";
621<div
class=
"row" id=
"{$rowid}">
623 <a href=
"{$download}" download>
624 {$jrn_sup->js_filename}
628 {$jrn_sup->js_description}
639 print '<div class="row">';
649 print '<div class="row">';
665 $html= ob_get_contents();
667 $count=
$cn->get_value(
"select count(*) from jrn_sup_document where jr_id=$1",[
$jr_id]);
672if (!headers_sent()) {
673 header(
'Content-type: text/xml; charset=UTF-8');
678<?xml version=
"1.0" encoding=
"UTF-8"?>
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_user
if no group available , then stop
if(headers_sent() &&DEBUGNOALYSS > 0) $html
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
h( $row[ 'oa_description'])
if(isset($_REQUEST['gDossier']) && $http->request("gDossier","number", 0) !=0) $repo
_("actif, passif,charge,...")
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.
static build_jrn_id($p_jr_id)
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
Html Input : Input a date format dd.mm.yyyy The property title should be set to indicate what it is e...
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...)
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,...
json_response($p_answer)
Send header and json object.
if( $delta< 0) elseif( $delta==0)