noalyss Version-9
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
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 For the module C0TVA, save info
28 */
29
30if ( $g_user->check_module('C0TVA') ==0 )
31{
32 return;
33}
34try
35{
36 $table=$http->request('table');
37 $action=$http->request('action');
38 $p_id=$http->request('p_id', "number");
39 $ctl_id=$http->request('ctl');
40}
41catch (Exception $e)
42{
44 return;
45}
46
48$p_id=$http->request('p_id', "number");
49$tva_rate->set_pk_value($p_id);
50$tva_rate->load();
52$manage_table->set_callback("ajax_misc.php");
53$manage_table->add_json_param("op", "tva_parameter");
54
55if ($action=="input")
56{
57
58 $manage_table->set_object_name($ctl_id);
59 header('Content-type: text/xml; charset=UTF-8');
60 echo $manage_table->ajax_input()->saveXML();
61 return;
62}
63elseif ($action=="save")
64{
65 $previous=$http->request("old_tva_id","number");
66 $manage_table->setPreviousId($previous);
67 $manage_table->set_object_name($ctl_id);
68 header('Content-type: text/xml; charset=UTF-8');
69 $xml=$manage_table->ajax_save();
70 $s1=$xml->createElement("previous_id",$previous);
71 $data=$xml->getElementsByTagName("data");
72 $data[0]->appendChild($s1);
73 echo $xml->saveXML();
74 return;
75}
76elseif ($action=="delete")
77{
78 $manage_table->set_object_name($ctl_id);
79 header('Content-type: text/xml; charset=UTF-8');
80 echo $manage_table->ajax_delete()->saveXML();
81}
82return;
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
switch($op2) $xml
$manage_table
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:104