38if ( ! defined(
'ALLOWED')) define (
'ALLOWED',1);
39require_once
'../include/constant.php';
41require_once NOALYSS_INCLUDE.
"/lib/ac_common.php";
47 if (
$op ==
'check_vatnumber') session_write_close();
49}
catch (\Exception
$e) {
54if (
$http->request(
'op',
"string",
"") ==
'disconnect') {
62if ( ! isset($_SESSION[SESSION_KEY.
"g_user"])) {
67mb_internal_encoding(
"UTF-8");
84 $cn =Dossier::connect();
89 die(
_(
'Non autorisé'));
104if (
$op ==
"progressBar") {
114if (
$op==
'password_chk') {
115 $cnt =
$http->request(
"pass");
121 foreach (
$result as $item) {
$str.=sprintf(
"<li>%s</li>",$item);}
131 $file_loginput=fopen($_ENV[
'TMP'].
'/scenario-ajax-'.$_SERVER[
'REQUEST_TIME'].
'.php',
'a+');
132 fwrite ($file_loginput,
"<?php \n");
133 fwrite ($file_loginput,
'//@description:'.
$op.
"\n");
134 fwrite($file_loginput,
'$_GET='.var_export(
$_GET,
true));
135 fwrite($file_loginput,
";\n");
136 fwrite($file_loginput,
'$_POST='.var_export(
$_POST,
true));
137 fwrite($file_loginput,
";\n");
138 fwrite($file_loginput,
'$_POST[\'gDossier\']=$gDossierLogInput;');
139 fwrite($file_loginput,
"\n");
140 fwrite($file_loginput,
'$_GET[\'gDossier\']=$gDossierLogInput;');
141 fwrite($file_loginput,
"\n");
142 fwrite($file_loginput,
' $_REQUEST=array_merge($_GET,$_POST);');
143 fwrite($file_loginput,
"\n");
144 fwrite($file_loginput,
"include '".basename(__FILE__).
"';\n");
145 fclose($file_loginput);
151if (
$op ==
'widget') {
152 session_write_close();
153 require_once NOALYSS_INCLUDE.
'/widget/ajax.php';
159 "account"=>
"ajax_account",
162 "ledger"=>
"ajax_ledger",
164 "ledger_access"=>
"ajax_user_security",
166 "profile"=>
"ajax_user_security",
168 "user_sec_ledger"=>
"ajax_user_security",
170 "user_sec_action"=>
"ajax_user_security",
172 "ledger_access_all"=>
"ajax_user_security",
174 "action_access"=>
"ajax_user_security",
176 "action_access_all"=>
"ajax_user_security",
177 "todo_list"=>
"ajax_todo_list",
179 "history"=>
"ajax_history",
180 "mod_doc"=>
"ajax_mod_document",
182 'periode'=>
"ajax_periode",
183 "mod_predf"=>
"ajax_mod_predf_op",
184 "save_predf"=>
"ajax_save_predf_op",
185 "search_action"=>
"ajax_search_action",
186 "display_profile"=>
"ajax_get_profile",
187 "det_menu"=>
"ajax_get_menu_detail",
188 "add_menu"=>
"ajax_add_menu",
189 "display_submenu"=>
"ajax_display_submenu",
190 "remove_submenu"=>
"ajax_remove_submenu",
191 "cardsearch"=>
"ajax_boxcard_search",
192 "saldo"=>
"ajax_bank_saldo",
193 "upd_receipt"=>
"ajax_get_receipt",
194 "up_pay_method"=>
"ajax_update_payment",
195 "openancsearch"=>
"ajax_anc_search",
196 "resultancsearch"=>
"ajax_anc_search",
197 "autoanc"=>
"ajax_auto_anc_card",
198 "create_menu"=>
"ajax_create_menu",
199 "modify_menu"=>
"ajax_mod_menu",
200 "mod_stock_repo"=>
"ajax_mod_stock_repo",
201 "view_mod_stock"=>
"ajax_view_mod_stock",
202 "fddetail"=>
"ajax_fiche_def_detail",
203 "vw_action"=>
"ajax_view_action",
204 "minrow"=>
"ajax_min_row",
205 "navigator"=>
"ajax_navigator",
206 "preference"=>
"ajax_preference",
207 "bookmark"=>
"ajax_bookmark",
209 "tag_detail"=>
"ajax_tag_detail",
210 "tag_save"=>
"ajax_tag_save",
211 "tag_list"=>
"ajax_tag_list",
212 "tag_add"=>
"ajax_tag_add_action",
213 "tag_remove"=>
"ajax_tag_remove_action",
214 "tag_choose"=>
"ajax_tag_choose",
215 "tag_activate"=>
"ajax_tag_save",
217 "search_display_tag"=>
"ajax_search_display_tag",
218 "search_add_tag"=>
"ajax_search_add_tag",
219 "search_clear_tag"=>
"ajax_search_clear_tag",
220 "calendar_zoom"=>
"ajax_calendar_zoom",
221 "ledger_show"=>
"ajax_ledger_show",
223 "anc_key_choice"=>
"ajax_anc_key_choice" ,
225 "anc_key_clean"=>
"ajax_anc_key_clean" ,
227 "anc_key_compute"=>
"ajax_anc_key_compute" ,
229 "folder_remove"=>
"ajax_admin",
231 "folder_display"=>
"ajax_admin",
234 "folder_add"=>
"ajax_admin",
236 "folder_drop"=>
"ajax_admin",
239 "folder_modify"=>
"ajax_admin",
241 "modele_drop"=>
"ajax_admin",
243 "modele_modify"=>
"ajax_admin",
245 "upgradeCore"=>
"ajax_admin",
247 "upgradePlugin"=>
"ajax_admin",
249 "installTemplate"=>
"ajax_admin",
251 "action_show"=>
"ajax_gestion",
253 "action_add"=>
"ajax_gestion",
255 "action_save"=>
"ajax_gestion",
257 "dl"=>
"ajax_display_letter",
259 "anc_accounting"=>
"ajax_anc_accounting",
261 "anc_updatedescription"=>
"ajax_anc_plan",
263 "accounting"=>
"ajax_accounting",
265 "anc_detail_op"=>
"ajax_anc_detail_operation",
267 "history_anc_account"=>
"ajax_history_anc_account",
269 "display_search_filter"=>
"ajax_search_filter",
271 "save_filter"=>
"ajax_search_filter",
273 "load_filter"=>
"ajax_search_filter",
275 "display_list_filter"=>
"ajax_search_filter",
277 'display_filter_tag'=>
'ajax_search_filter',
279 'search_op'=>
'ajax_search_operation',
281 'delete_search_operation'=>
'ajax_search_filter',
283 'template_cat_card'=>
'ajax_template_cat_card',
285 'template_cat_category'=>
'ajax_template_cat_category',
287 'update_comment_followUp'=>
'ajax_follow_up',
289 'followup_comment_oneedit'=>
'ajax_follow_up',
291 "tva_parameter"=>
"ajax_tva_parameter",
293 "CurrencyManage"=>
"ajax_currency",
295 "CurrencyRateDelete"=>
"ajax_currency",
297 "payment_method"=>
"ajax_payment_method",
299 "display_all_card"=>
"ajax_display_all_card",
301 "up_predef"=>
"ajax_update_predef",
303 "cfgaction"=>
'ajax_cfgaction',
305 "contact_option_list"=>
'ajax_contact_option_list',
307 'tag_group'=>
'ajax_tag_group',
309 'tag_set_group'=>
"ajax_tag_set_group",
311 "document_state"=>
"ajax_document_state",
313 'operation_tag_add'=>
"ajax_operation_tag",
315 'operation_tag_remove'=>
"ajax_operation_tag",
317 'operation_tag_select'=>
"ajax_operation_tag",
319 "forecast_item"=>
"ajax_forecast_item",
321 "forecast_category"=>
"ajax_forecast_category",
323 "forecast"=>
"ajax_forecast",
325 "company"=>
"ajax_company",
327 "report_definition"=>
"ajax_report_definition",
329 "search_account_card"=>
"ajax_search_account_card",
331 "mobile_device_menu"=>
"ajax_mobile_device_menu",
333 "other_tax"=>
"ajax_other_tax",
335 "update_visibility_quantity"=>
"ajax_update_visibility_quantity",
337 "event_display_detail"=>
"ajax_event_display_detail",
339 "operation_exercice+update_periode"=>
"ajax_operation_exercice",
341 "operation_exercice+modify_row"=>
"ajax_operation_exercice",
343 "operation_exercice+save_row"=>
"ajax_operation_exercice",
345 "operation_exercice+display_total"=>
"ajax_operation_exercice",
347 "operation_exercice+delete_row"=>
"ajax_operation_exercice",
349 "operation_exercice+date"=>
"ajax_operation_exercice",
351 "operation_exercice+text"=>
"ajax_operation_exercice",
353 'operation_exercice+transfer'=>
"ajax_operation_exercice",
355 "view_followup_card"=>
"ajax_follow_up",
357 'list_filter_followup'=>
"ajax_follow_up",
359 'delete_filter_followup'=>
"ajax_follow_up",
361 "check_vatnumber"=>
"ajax_check_vatnumber",
363 "tax_detail"=>
"ajax_tax_detail"
365 ,
"category_card_definition"=>
"ajax_category_card_definition"
367 ,
'activate_plugin'=>
'ajax_activate_plugin'
369 ,
'payment_status'=>
'ajax_payment_status'
373 require NOALYSS_INCLUDE.
'/ajax/'.
$path[
$op].
".php";
391 $a_answer[
'content']=
$cn->get_value(
"select ch_value from v_currency_last_value where currency_id=$1",
396 catch (Exception
$ex)
400 $jsson=json_encode(
$a_answer, JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES|JSON_NUMERIC_CHECK);
401 header(
'Content-Type: application/json;charset=utf-8');
417 $a_answer[
'content']=
$cn->get_value(
"select cr_code_iso||' ('||cr_name||')' from v_currency_last_value where currency_id=$1",
421 catch (Exception
$ex)
425 $jsson=json_encode(
$a_answer, JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES|JSON_NUMERIC_CHECK);
426 header(
'Content-Type: application/json;charset=utf-8');
432 case "periode_change":
434 $field=
$http->get(
"field");
450 $iperiod =
new IPeriod($field);
454 $iperiod->filter_year =
true;
459 $iperiod->filter_year =
false;
463 $iperiod->show_end_date=FALSE;
466 $iperiod->show_start_date=FALSE;
470 throw new Exception(
_(
"Invalide type"));
473 $iperiod->type =
ALL;
474 echo $iperiod->input();
479 case "pref_exercice":
480 $iperiod =
new IPeriod(
"period");
481 $iperiod->id=
"setting_period";
484 $iperiod->filter_year =
true;
485 $iperiod->exercice=
$http->get(
"exercice");
487 $iperiod->type =
ALL;
488 echo $iperiod->input();
493 if (
$g_user->check_module(
'ANCODS') == 0)
496 $cn->exec_sql(
"delete from operation_analytique where oa_group=$1", array(
$oa_group));
499 if (
$g_user->check_module(
'STOCK') == 0)
501 require_once NOALYSS_INCLUDE.
'/constant.security.php';
502 $cn->exec_sql(
'delete from stock_goods where sg_id=$1', array($s_id));
504 header(
'Content-type: text/xml; charset=UTF-8');
505 printf(
'{"d_id":"%s"}', $s_id);
511 require_once NOALYSS_INCLUDE.
'/class/acc_ledger_fin.class.php';
516 header(
'Content-type: text/xml; charset=UTF-8');
518<?xml version=
"1.0" encoding=
"UTF-8"?>
527 require_once NOALYSS_INCLUDE.
'/class/acc_ledger_fin.class.php';
532 header(
'Content-type: text/xml; charset=UTF-8');
534<?xml version=
"1.0" encoding=
"UTF-8"?>
543 require_once NOALYSS_INCLUDE.
'/class/calendar.class.php';
552 header(
'Content-type: text/xml; charset=UTF-8');
554<?xml version=
"1.0" encoding=
"UTF-8"?>
573 order by tva_id asc");
582 order by tva_id asc");
585 $Res =
$cn->exec_sql(
"select * from v_tva_rate
587 tva_purchase <> '#' and tva_sale <> '#'
588 order by tva_id asc");
595 $r.=
'<TABLE class="sortable" style="width:100%" id="tva_select_table">';
596 $r.=
th(
_(
'id'),
'class="sorttable_sorted"');
599 $r.=
th(
_(
'Symbole'));
600 $r.=
th(
_(
'Explication'));
605 if (!isset($compute))
609 $script =
"onclick=\"$('$ctl').value='" .
$row[
'tva_id'] .
"';removeDiv('tva_select');\"";
613 $script =
"onclick=\"$('$ctl').value='" .
$row[
'tva_id'] .
"';set_value('$code','" .
$row[
'tva_label'] .
"');removeDiv('tva_select');\"";
620 $script =
"onclick=\"$('$ctl').value='" .
$row[
'tva_id'] .
"';removeDiv('tva_select');clean_tva('$compute');compute_ledger('$compute');\"";
624 $script =
"onclick=\"$('$ctl').value='" .
$row[
'tva_id'] .
"';set_value('$code','" .
$row[
'tva_label'] .
"');removeDiv('tva_select');clean_tva('$compute');compute_ledger('$compute');\"";
627 $set =
'<INPUT TYPE="BUTTON" class="button" Value="select" ' .
$script .
'>';
628 $class=(
$i%2 == 0)?
' class="odd" ':
' class="even" ';
629 $r.=
'<tr'.$class.
$script.
' style="cursor : pointer">';
642 header(
'Content-type: text/xml; charset=UTF-8');
644<?xml version=
"1.0" encoding=
"UTF-8"?>
656 if ($tva->tva_id == -1 )
660 $value=htmlentities($tva->tva_label);
662 header(
'Content-type: text/xml; charset=UTF-8');
664<?xml version=
"1.0" encoding=
"UTF-8"?>
675 $me_file =
new IText(
'me_file');
676 $me_menu =
new IText(
'me_menu');
677 $me_description =
new IText(
"me_description");
678 $me_parameter =
new IText(
"me_parameter");
680 require_once NOALYSS_INCLUDE.
'/ajax/ajax_plugin_detail.php';
683 $m =
$cn->get_array(
"select me_code,me_file,me_menu,me_description,me_parameter
684 from menu_ref where me_code=$1", array(
$me_code));
688 echo
"<p>"._(
"Il y a une erreur, ce plugin n'existe pas").
693 $me_file =
new IText(
'me_file',
$m[0] [
'me_file']);
694 $me_menu =
new IText(
'me_menu',
$m[0] [
'me_menu']);
695 $me_description =
new IText(
"me_description",
$m[0] [
'me_description']);
696 $me_parameter =
new IText(
"me_parameter",
$m[0] [
'me_parameter']);
698 require_once NOALYSS_INCLUDE.
'/ajax/ajax_plugin_detail.php';
700 case 'ledger_description':
701 $ajrn=
$cn->get_array(
'select jrn_def_name,jrn_def_description from jrn_def where jrn_def_id=$1',array(
$l));
702 if ( count($ajrn)==1)
705 echo
'<h1 >'.$ajrn[0][
'jrn_def_name'].
'</h1>';
706 if (
noalyss_trim($ajrn[0][
'jrn_def_description']) !=
"") {
707 echo
'<p style="border:1px solid;margin-top:0px;padding:1rem">'.$ajrn[0][
'jrn_def_description'].
'</p>';
715 $code=
$cn->get_value(
"select cr_code_iso from public.currency join jrn_def on (currency.id=jrn_def.currency_id) where jrn_def.jrn_def_id=$1",
723 echo $acc_ledger->input_additional_tax();
th($p_string, $p_extra='', $raw='')
ajax_disconnected($p_div)
Should a dialog box when you are disconnected from an ajax call propose to reload or to connect in an...
check_password_strength($password)
returns an double array with the error found and code , if the count is 0 then the password is very s...
set_language()
set the lang thanks the _SESSION['g_lang'] var.
td($p_string='', $p_extra='')
surround the string with td
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
catch(Exception $ex) if( $g_user->check_module( 'C0DEV')==0) switch($act) $jsson
check if module C0DEV
catch(Exception $e) $exercice
if(LOGINPUT) if($op=='widget') $path
for widget we call immediately a file outside the ajax folder
if(isNumber($jr_id)==0) $ledger_id
if(! empty( $error)) for($i=0;$i< count($error);$i++)( $last !=$error[$i]) $last
_("actif, passif,charge,...")
the class Acc_Ledger_Fin inherits from Acc_Ledger, this object permit to manage the financial ledger
Class for jrn, class acc_ledger for manipulating the ledger AND some acc.
static build($db, $p_code)
retrieve TVA rate thanks the code that could be the tva_id or tva_code.
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 set_firstDate($firstDate)
Generate the form for the periode Data Members.
Class to manage the company parameter (address, name...)
Use one db for tracking progress bar value, the task id must be unique and let you follow the progres...
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)