noalyss Version-10
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
ajax_search_vatex.php
Go to the documentation of this file.
1<?php
2
3/*
4 * This file is part of NOALYSS.
5 *
6 * NOALYSS 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 NOALYSS; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19*/
20// Copyright Author Dany De Bontridder danydb@aevalys.eu 22/10/23
21
22
23/**
24 * @file
25 * @brief find and select a VATEX code : VAT Exemption code mandatory for PEPPOL
26 */
27try {
28 $select_code=$http->get("select_code","string","");
29 $dgbox=$http->get("dgbox");
30
31} catch (Exception $exc) {
32 echo $exc->getTraceAsString();
33}
34
35
36if ($select_code == "")
37{
38
39 require_once NOALYSS_TEMPLATE."/ajax-search_vatex.php";
40 return;
41}
42
43//------------------------------------------------
44// a VATEX Code has been selected
45//------------------------------------------------
46if ($select_code != "")
47{
48 $row=$cn->get_row("select vx_code,vx_code_name,vx_description,vx_remark from vatex_code where vx_code=$1",
49 [$select_code]);
50 $answer=array();
51 if ( ! empty ($row))
52 {
53 $answer['vx_code']=$row['vx_code'];
54 $answer['vx_value']=Icon_Action::trash(uniqid(),"vat_code.select_value('xx')").$row['vx_code'];
55 $answer['vx_description']=$row['vx_description'].span($row['vx_remark'],' class="text-muted" ');
56 }else {
57 $answer['vx_code']=$answer['vx_value']=$answer['vx_description']="";
58 }
60 return;
61}
$answer
static trash($p_id, $p_javascript)
Display the icon of a trashbin.
json_response($p_answer)
Send header and json object.