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();
48 if (
$op ==
'search_peppol') session_write_close();
50}
catch (\Exception
$e) {
55if (
$http->request(
'op',
"string",
"") ==
'disconnect') {
63if ( ! isset($_SESSION[SESSION_KEY.
"g_user"])) {
68mb_internal_encoding(
"UTF-8");
85 $cn =Dossier::connect();
90 die(
_(
'Non autorisé'));
103if ( !
$g_user->is_double_identified()) {
110if (
$op ==
"progressBar") {
120if (
$op==
'password_chk') {
127 foreach (
$result as $item) {
$str.=sprintf(
"<li>%s</li>",$item);}
137 $file_loginput=fopen($_ENV[
'TMP'].
'/scenario-ajax-'.$_SERVER[
'REQUEST_TIME'].
'.php',
'a+');
138 fwrite ($file_loginput,
"<?php \n");
139 fwrite ($file_loginput,
'//@description:'.
$op.
"\n");
140 fwrite($file_loginput,
'$_GET='.var_export(
$_GET,
true));
141 fwrite($file_loginput,
";\n");
142 fwrite($file_loginput,
'$_POST='.var_export(
$_POST,
true));
143 fwrite($file_loginput,
";\n");
144 fwrite($file_loginput,
'$_POST[\'gDossier\']=$gDossierLogInput;');
145 fwrite($file_loginput,
"\n");
146 fwrite($file_loginput,
'$_GET[\'gDossier\']=$gDossierLogInput;');
147 fwrite($file_loginput,
"\n");
148 fwrite($file_loginput,
' $_REQUEST=array_merge($_GET,$_POST);');
149 fwrite($file_loginput,
"\n");
150 fwrite($file_loginput,
"include '".basename(__FILE__).
"';\n");
151 fclose($file_loginput);
157if (
$op ==
'widget') {
158 session_write_close();
159 require_once NOALYSS_INCLUDE.
'/widget/ajax.php';
165 "account"=>
"ajax_account",
168 "ledger"=>
"ajax_ledger",
170 "ledger_access"=>
"ajax_user_security",
172 "profile"=>
"ajax_user_security",
174 "user_sec_ledger"=>
"ajax_user_security",
176 "user_sec_action"=>
"ajax_user_security",
178 "ledger_access_all"=>
"ajax_user_security",
180 "action_access"=>
"ajax_user_security",
182 "action_access_all"=>
"ajax_user_security",
183 "todo_list"=>
"ajax_todo_list",
185 "history"=>
"ajax_history",
186 "mod_doc"=>
"ajax_mod_document",
188 'periode'=>
"ajax_periode",
189 "mod_predf"=>
"ajax_mod_predf_op",
190 "save_predf"=>
"ajax_save_predf_op",
191 "search_action"=>
"ajax_search_action",
192 "display_profile"=>
"ajax_get_profile",
193 "det_menu"=>
"ajax_get_menu_detail",
194 "add_menu"=>
"ajax_add_menu",
195 "display_submenu"=>
"ajax_display_submenu",
196 "remove_submenu"=>
"ajax_remove_submenu",
197 "cardsearch"=>
"ajax_boxcard_search",
198 "saldo"=>
"ajax_bank_saldo",
199 "upd_receipt"=>
"ajax_get_receipt",
200 "up_pay_method"=>
"ajax_update_payment",
201 "openancsearch"=>
"ajax_anc_search",
202 "resultancsearch"=>
"ajax_anc_search",
203 "autoanc"=>
"ajax_auto_anc_card",
204 "create_menu"=>
"ajax_create_menu",
205 "modify_menu"=>
"ajax_mod_menu",
206 "mod_stock_repo"=>
"ajax_mod_stock_repo",
207 "view_mod_stock"=>
"ajax_view_mod_stock",
208 "fddetail"=>
"ajax_fiche_def_detail",
209 "vw_action"=>
"ajax_view_action",
210 "minrow"=>
"ajax_min_row",
211 "navigator"=>
"ajax_navigator",
212 "preference"=>
"ajax_preference",
213 "bookmark"=>
"ajax_bookmark",
215 "tag_detail"=>
"ajax_tag_detail",
216 "tag_save"=>
"ajax_tag_save",
217 "tag_list"=>
"ajax_tag_list",
218 "tag_add"=>
"ajax_tag_add_action",
219 "tag_remove"=>
"ajax_tag_remove_action",
220 "tag_choose"=>
"ajax_tag_choose",
221 "tag_activate"=>
"ajax_tag_save",
223 "search_display_tag"=>
"ajax_search_display_tag",
224 "search_add_tag"=>
"ajax_search_add_tag",
225 "search_clear_tag"=>
"ajax_search_clear_tag",
226 "calendar_zoom"=>
"ajax_calendar_zoom",
227 "ledger_show"=>
"ajax_ledger_show",
229 "anc_key_choice"=>
"ajax_anc_key_choice" ,
231 "anc_key_clean"=>
"ajax_anc_key_clean" ,
233 "anc_key_compute"=>
"ajax_anc_key_compute" ,
235 "folder_remove"=>
"ajax_admin",
237 "folder_display"=>
"ajax_admin",
240 "folder_add"=>
"ajax_admin",
242 "folder_drop"=>
"ajax_admin",
245 "folder_modify"=>
"ajax_admin",
247 "modele_drop"=>
"ajax_admin",
249 "modele_modify"=>
"ajax_admin",
251 "upgradeCore"=>
"ajax_admin",
253 "upgradePlugin"=>
"ajax_admin",
255 "installTemplate"=>
"ajax_admin",
257 "action_show"=>
"ajax_gestion",
259 "action_add"=>
"ajax_gestion",
261 "action_save"=>
"ajax_gestion",
263 "dl"=>
"ajax_display_letter",
265 "anc_accounting"=>
"ajax_anc_accounting",
267 "anc_updatedescription"=>
"ajax_anc_plan",
269 "accounting"=>
"ajax_accounting",
271 "anc_detail_op"=>
"ajax_anc_detail_operation",
273 "history_anc_account"=>
"ajax_history_anc_account",
275 "display_search_filter"=>
"ajax_search_filter",
277 "save_filter"=>
"ajax_search_filter",
279 "load_filter"=>
"ajax_search_filter",
281 "display_list_filter"=>
"ajax_search_filter",
283 'display_filter_tag'=>
'ajax_search_filter',
285 'search_op'=>
'ajax_search_operation',
287 'delete_search_operation'=>
'ajax_search_filter',
289 'template_cat_card'=>
'ajax_template_cat_card',
291 'template_cat_category'=>
'ajax_template_cat_category',
293 'update_comment_followUp'=>
'ajax_follow_up',
295 'followup_comment_oneedit'=>
'ajax_follow_up',
297 "tva_parameter"=>
"ajax_tva_parameter",
299 "CurrencyManage"=>
"ajax_currency",
301 "CurrencyRateDelete"=>
"ajax_currency",
303 "payment_method"=>
"ajax_payment_method",
305 "display_all_card"=>
"ajax_display_all_card",
307 "up_predef"=>
"ajax_update_predef",
309 "cfgaction"=>
'ajax_cfgaction',
311 "contact_option_list"=>
'ajax_contact_option_list',
313 'tag_group'=>
'ajax_tag_group',
315 'tag_set_group'=>
"ajax_tag_set_group",
317 "document_state"=>
"ajax_document_state",
319 'operation_tag_add'=>
"ajax_operation_tag",
321 'operation_tag_remove'=>
"ajax_operation_tag",
323 'operation_tag_select'=>
"ajax_operation_tag",
325 "forecast_item"=>
"ajax_forecast_item",
327 "forecast_category"=>
"ajax_forecast_category",
329 "forecast"=>
"ajax_forecast",
331 "company"=>
"ajax_company",
333 "report_definition"=>
"ajax_report_definition",
335 "search_account_card"=>
"ajax_search_account_card",
337 "mobile_device_menu"=>
"ajax_mobile_device_menu",
339 "other_tax"=>
"ajax_other_tax",
341 "update_visibility_quantity"=>
"ajax_update_visibility_quantity",
343 "event_display_detail"=>
"ajax_event_display_detail",
345 "operation_exercice+update_periode"=>
"ajax_operation_exercice",
347 "operation_exercice+modify_row"=>
"ajax_operation_exercice",
349 "operation_exercice+save_row"=>
"ajax_operation_exercice",
351 "operation_exercice+display_total"=>
"ajax_operation_exercice",
353 "operation_exercice+delete_row"=>
"ajax_operation_exercice",
355 "operation_exercice+date"=>
"ajax_operation_exercice",
357 "operation_exercice+text"=>
"ajax_operation_exercice",
359 'operation_exercice+transfer'=>
"ajax_operation_exercice",
361 "view_followup_card"=>
"ajax_follow_up",
363 'list_filter_followup'=>
"ajax_follow_up",
365 'delete_filter_followup'=>
"ajax_follow_up",
367 "check_vatnumber"=>
"ajax_check_vatnumber",
369 "tax_detail"=>
"ajax_tax_detail"
371 ,
"category_card_definition"=>
"ajax_category_card_definition"
373 ,
'activate_plugin'=>
'ajax_activate_plugin'
375 ,
'payment_status'=>
'ajax_payment_status'
377 ,
'email_setting'=>
'ajax_email_setting'
379 ,
'check_ibannumber'=>
'ajax_check_ibannumber'
381 ,
'search_peppol'=>
'ajax_search_peppol'
383 ,
'search_vatex'=>
'ajax_search_vatex'
387 require NOALYSS_INCLUDE.
'/ajax/'.
$path[
$op].
".php";
405 $a_answer[
'content']=
$cn->get_value(
"select ch_value from v_currency_last_value where currency_id=$1",
410 catch (Exception
$ex)
414 $jsson=json_encode(
$a_answer, JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES|JSON_NUMERIC_CHECK);
415 header(
'Content-Type: application/json;charset=utf-8');
431 $a_answer[
'content']=
$cn->get_value(
"select cr_code_iso||' ('||cr_name||')' from v_currency_last_value where currency_id=$1",
435 catch (Exception
$ex)
439 $jsson=json_encode(
$a_answer, JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES|JSON_NUMERIC_CHECK);
440 header(
'Content-Type: application/json;charset=utf-8');
446 case "periode_change":
448 $field=
$http->get(
"field");
464 $iperiod =
new IPeriod($field);
468 $iperiod->filter_year =
true;
473 $iperiod->filter_year =
false;
477 $iperiod->show_end_date=FALSE;
480 $iperiod->show_start_date=FALSE;
484 throw new Exception(
_(
"Invalide type"));
487 $iperiod->type =
ALL;
488 echo $iperiod->input();
493 case "pref_exercice":
494 $iperiod =
new IPeriod(
"period");
495 $iperiod->id=
"setting_period";
498 $iperiod->filter_year =
true;
499 $iperiod->exercice=
$http->get(
"exercice");
501 $iperiod->type =
ALL;
502 echo $iperiod->input();
507 if (
$g_user->check_module(
'ANCODS') == 0)
510 $cn->exec_sql(
"delete from operation_analytique where oa_group=$1", array(
$oa_group));
513 if (
$g_user->check_module(
'STOCK') == 0)
515 require_once NOALYSS_INCLUDE.
'/constant.security.php';
516 $cn->exec_sql(
'delete from stock_goods where sg_id=$1', array($s_id));
518 header(
'Content-type: text/xml; charset=UTF-8');
519 printf(
'{"d_id":"%s"}', $s_id);
525 require_once NOALYSS_INCLUDE.
'/class/acc_ledger_fin.class.php';
530 header(
'Content-type: text/xml; charset=UTF-8');
532<?xml version=
"1.0" encoding=
"UTF-8"?>
541 require_once NOALYSS_INCLUDE.
'/class/acc_ledger_fin.class.php';
546 header(
'Content-type: text/xml; charset=UTF-8');
548<?xml version=
"1.0" encoding=
"UTF-8"?>
557 require_once NOALYSS_INCLUDE.
'/class/calendar.class.php';
566 header(
'Content-type: text/xml; charset=UTF-8');
568<?xml version=
"1.0" encoding=
"UTF-8"?>
587 order by tva_id asc");
596 order by tva_id asc");
599 $Res =
$cn->exec_sql(
"select * from v_tva_rate
601 tva_purchase <> '#' or tva_sale <> '#'
602 order by tva_id asc");
609 $r.=
'<TABLE class="sortable" style="width:100%" id="tva_select_table">';
610 $r.=
th(
_(
'id'),
'class="sorttable_sorted"');
613 $r.=
th(
_(
'Symbole'));
614 $r.=
th(
_(
'Explication'));
619 if (!isset($compute))
623 $script =
"onclick=\"$('$ctl').value='" .
$row[
'tva_id'] .
"';removeDiv('tva_select');\"";
627 $script =
"onclick=\"$('$ctl').value='" .
$row[
'tva_id'] .
"';set_value('$code','" .
$row[
'tva_label'] .
"');removeDiv('tva_select');\"";
634 $script =
"onclick=\"$('$ctl').value='" .
$row[
'tva_id'] .
"';removeDiv('tva_select');clean_tva('$compute');compute_ledger('$compute');\"";
638 $script =
"onclick=\"$('$ctl').value='" .
$row[
'tva_id'] .
"';set_value('$code','" .
$row[
'tva_label'] .
"');removeDiv('tva_select');clean_tva('$compute');compute_ledger('$compute');\"";
641 $set =
'<INPUT TYPE="BUTTON" class="button" Value="select" ' .
$script .
'>';
642 $class=(
$i%2 == 0)?
' class="odd" ':
' class="even" ';
643 $r.=
'<tr'.$class.
$script.
' style="cursor : pointer">';
656 header(
'Content-type: text/xml; charset=UTF-8');
658<?xml version=
"1.0" encoding=
"UTF-8"?>
670 if ($tva->tva_id == -1 )
674 $value=htmlentities($tva->tva_label);
676 header(
'Content-type: text/xml; charset=UTF-8');
678<?xml version=
"1.0" encoding=
"UTF-8"?>
689 $me_file =
new IText(
'me_file');
690 $me_menu =
new IText(
'me_menu');
691 $me_description =
new IText(
"me_description");
692 $me_parameter =
new IText(
"me_parameter");
694 require_once NOALYSS_INCLUDE.
'/ajax/ajax_plugin_detail.php';
697 $m =
$cn->get_array(
"select me_code,me_file,me_menu,me_description,me_parameter
698 from menu_ref where me_code=$1", array(
$me_code));
702 echo
"<p>"._(
"Il y a une erreur, ce plugin n'existe pas").
707 $me_file =
new IText(
'me_file',
$m[0] [
'me_file']);
708 $me_menu =
new IText(
'me_menu',
$m[0] [
'me_menu']);
709 $me_description =
new IText(
"me_description",
$m[0] [
'me_description']);
710 $me_parameter =
new IText(
"me_parameter",
$m[0] [
'me_parameter']);
712 require_once NOALYSS_INCLUDE.
'/ajax/ajax_plugin_detail.php';
714 case 'ledger_description':
715 $ajrn=
$cn->get_array(
'select jrn_def_name,jrn_def_description from jrn_def where jrn_def_id=$1',array(
$l));
716 if ( count($ajrn)==1)
719 echo
'<h1 >'.$ajrn[0][
'jrn_def_name'].
'</h1>';
720 if (
noalyss_trim($ajrn[0][
'jrn_def_description']) !=
"") {
721 echo
'<p style="border:1px solid;margin-top:0px;padding:1rem">'.$ajrn[0][
'jrn_def_description'].
'</p>';
729 $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",
737 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
for($i=0; $i< $nb_vatex_code; $i++)($i % 2==0) ? " odd " $cnt
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,...")
$class
Display the Plugin and for each profile were it is installed or not.
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)