PEPPOL: allow to verify that the customer has is on PEPPOL (Belgium only)
This commit is contained in:
parent
81623d9c6f
commit
a1c59f6cf0
6 changed files with 460 additions and 4 deletions
86
include/lib/ipeppol_id.class.php
Normal file
86
include/lib/ipeppol_id.class.php
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
<?php
|
||||
/*
|
||||
* This file is part of NOALYSS.
|
||||
*
|
||||
* NOALYSS is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* NOALYSS is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with NOALYSS; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
// Copyright Author Dany De Bontridder danydb@aevalys.eu 13/05/24
|
||||
/*!
|
||||
* \file
|
||||
* \brief input of the VAT Number of a supplier / customer, propose a button to check VAT
|
||||
*/
|
||||
|
||||
class IPEPPOL_ID extends HtmlInput
|
||||
{
|
||||
private $itext;
|
||||
|
||||
function __construct($name = '', $value = '', $p_id = "")
|
||||
{
|
||||
|
||||
$p_id = ($p_id=="")?uniqid("peppol_id"):$p_id;
|
||||
|
||||
$this->itext = new IText($name,$value,$p_id);
|
||||
$this->itext->title = _("PEPPOL_ID");
|
||||
$this->itext->placeholder = "9999:9999999999";
|
||||
$this->itext->extra = "";
|
||||
$this->itext->style = ' class="input_text" ';
|
||||
$this->autofocus = false;
|
||||
}
|
||||
|
||||
function input()
|
||||
{
|
||||
if ( $this->readOnly==true) return $this->display();
|
||||
|
||||
$return = $this->itext->input();
|
||||
$return .= $this->button_check_peppol();
|
||||
$return.=sprintf('<div id="info%s" class="notice" style="margin:0px;font-size:80%%;width:auto"></div>',$this->itext->id);
|
||||
return $return;
|
||||
}
|
||||
|
||||
public function getIText(): IText
|
||||
{
|
||||
return $this->itext;
|
||||
}
|
||||
|
||||
public function setIText(IText $itext): IPEPPOL_ID
|
||||
{
|
||||
$this->itext = $itext;
|
||||
return $this;
|
||||
}
|
||||
|
||||
function button_check_peppol()
|
||||
{
|
||||
$button=new \IButton(uniqid());
|
||||
$button->javascript=sprintf("category_card.display_search_peppol('%s')",
|
||||
$this->itext->id);
|
||||
$button->extra='style="padding-bottom:0px"';
|
||||
$button->label=_("Vérifie");
|
||||
return $button->input();
|
||||
|
||||
|
||||
}
|
||||
function display()
|
||||
{
|
||||
return $this->itext->display();
|
||||
|
||||
}
|
||||
|
||||
static function testme()
|
||||
{
|
||||
$ivatnumber=new IPEPPOL_ID("av_text13");
|
||||
|
||||
echo $ivatnumber->input();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue