noalyss Version-9
ajax_tva_parameter.php
Go to the documentation of this file.
1<?php
2
3/*
4 * This file is part of NOALYSS.
5 *
6 * PhpCompta is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * NOALYSS is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with PhpCompta; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20// Copyright (2018) Author Dany De Bontridder <dany@alchimerys.be>
21
22if (!defined('ALLOWED'))
23 die('Appel direct ne sont pas permis');
24
25/**
26 * @file
27 * @brief
28 * @param type $name Descriptionara
29 */
30
31if ( $g_user->check_module('CFGTVA') ==0 )
32{
33 return;
34}
35try
36{
37 $table=$http->request('table');
38 $action=$http->request('action');
39 $p_id=$http->request('p_id', "number");
40 $ctl_id=$http->request('ctl');
41}
42catch (Exception $e)
43{
45 return;
46}
47
49$p_id=$http->request('p_id', "number");
50$tva_rate->set_pk_value($p_id);
51$tva_rate->load();
53$manage_table->set_callback("ajax_misc.php");
54$manage_table->add_json_param("op", "tva_parameter");
55
56if ($action=="input")
57{
58
59 $manage_table->set_object_name($ctl_id);
60 header('Content-type: text/xml; charset=UTF-8');
61 echo $manage_table->ajax_input()->saveXML();
62 return;
63}
64elseif ($action=="save")
65{
66 $previous=$http->request("old_tva_id","number");
67 $manage_table->setPreviousId($previous);
68 $manage_table->set_object_name($ctl_id);
69 header('Content-type: text/xml; charset=UTF-8');
70 $xml=$manage_table->ajax_save();
71 $s1=$xml->createElement("previous_id",$previous);
72 $data=$xml->getElementsByTagName("data");
73 $data[0]->appendChild($s1);
74 echo $xml->saveXML();
75 return;
76}
77elseif ($action=="delete")
78{
79 $manage_table->set_object_name($ctl_id);
80 header('Content-type: text/xml; charset=UTF-8');
81 echo $manage_table->ajax_delete()->saveXML();
82}
83return;
record_log($p_message)
Record an error message into the log file of the server.
Definition: ac_common.php:1342
global $g_user
if no group available , then stop
switch($op2) $xml
Definition: ajax_card.php:806
catch(Exception $e) $tva_rate
Configure the tva : code , rate, label ... When using Manage_Table_SQL.
ORM abstract of the view public.v_tva_rate.
if( $delta< 0) elseif( $delta==0)
$table
Definition: menu.inc.php:103