noalyss Version-9
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
ivatnumber.class.php
Go to the documentation of this file.
1<?php
2/*
3 * This file is part of NOALYSS.
4 *
5 * NOALYSS is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * NOALYSS is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with NOALYSS; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18*/
19// Copyright Author Dany De Bontridder danydb@aevalys.eu 13/05/24
20/*!
21 * \file
22 * \brief input of the VAT Number of a supplier / customer, propose a button to check VAT
23 */
24
25class IVATNumber extends HtmlInput
26{
27 private $itext;
28
29 function __construct($name = '', $value = '', $p_id = "")
30 {
31
32 $p_id = ($p_id=="")?uniqid("vatnumber"):$p_id;
33
34 $this->itext = new IText($name,$value,$p_id);
35 $this->itext->title = _("Numéro TVA");
36 $this->itext->placeholder = "CO9999999999";
37 $this->itext->extra = "";
38 $this->itext->style = ' class="input_text" ';
39 $this->autofocus = false;
40 }
41
42 function input()
43 {
44 if ( $this->readOnly==true) return $this->display();
45
46 $return = $this->itext->input();
47 $return .= $this->button_check_vat();
48 $return.=sprintf('<div id="info%s" class="notice" style="margin:0px;font-size:80%%;width:auto"></div>',$this->itext->id);
49 return $return;
50 }
51
52 public function getIText(): IText
53 {
54 return $this->itext;
55 }
56
57 public function setIText(IText $itext): IVATNumber
58 {
59 $this->itext = $itext;
60 return $this;
61 }
62
64 {
65 $button=new \IButton(uniqid());
66 $button->javascript=sprintf("category_card.check_vatnumber('%s')",
67 $this->itext->id);
68 $button->extra='style="padding-bottom:0px"';
69 $button->label=_("Vérifie");
70 return $button->input();
71
72
73 }
74 function display()
75 {
76 return $this->itext->display();
77
78 }
79
80 static function testme()
81 {
82 $ivatnumber=new IVATNumber("av_text13");
83
84 echo $ivatnumber->input();
85 }
86}
_("actif, passif,charge,...")
Html Input.
setIText(IText $itext)
__construct($name='', $value='', $p_id="")
$icard readOnly