[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpcompta-dev] r673 - in trunk/transform: . include include/template un
From: |
phpcompta-dev |
Subject: |
[Phpcompta-dev] r673 - in trunk/transform: . include include/template unit-test |
Date: |
Fri, 31 Jan 2014 20:36:41 +0100 (CET) |
Author: danydb
Date: 2014-01-31 20:36:41 +0100 (Fri, 31 Jan 2014)
New Revision: 673
Added:
trunk/transform/include/class_transform_declarant.php
trunk/transform/include/class_transform_intervat.php
trunk/transform/include/class_transform_representative.php
trunk/transform/include/intervat_listing_assujetti.inc.php
trunk/transform/include/template/listing_assujetti_declarant.php
trunk/transform/include/template/listing_assujetti_representative.php
trunk/transform/unit-test/transform_IntervatTest.php
Removed:
trunk/transform/include/class_intervat.php
trunk/transform/unit-test/IntervatTest.php
Modified:
trunk/transform/index.php
Log:
Change name class + add class Transform_Declarant and class
Transform_Representative
update unit test
Deleted: trunk/transform/include/class_intervat.php
===================================================================
--- trunk/transform/include/class_intervat.php 2014-01-31 17:35:53 UTC (rev
672)
+++ trunk/transform/include/class_intervat.php 2014-01-31 19:36:41 UTC (rev
673)
@@ -1,256 +0,0 @@
-<?php
-
-/*
- * Copyright (C) 2014 dany
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-
-
-/**
- * Description of class_intervat
- *
- * @author dany
- */
-class Intervat
-{
-
- /**
- * Content the XML Document
- * @var DOMDocument
- */
- var $domdoc;
-
- function __construct()
- {
- $this->domdoc = new DOMDocument('1.0', 'ISO-8859-1');
- $this->ns = 'http://www.minfin.fgov.be/ClientListingConsignment';
- $this->domdoc->formatOutput = true;
- }
-
- function append_root()
- {
- $ns = 'http://www.minfin.fgov.be/ClientListingConsignment';
- $t = $this->domdoc->createElementNS($this->ns,
'ns2:ClientListingConsignment');
-
- $root = $this->domdoc->appendChild($t);
- $xmls = $root->setAttribute("xmlns",
"http://www.minfin.fgov.be/InputCommon");
-
- $listing = $this->domdoc->appendChild($root);
-
- $nb = $this->domdoc->createAttribute('ClientListingsNbr');
- $nb->value = 1;
- $listing->appendChild($nb);
-
- $this->domdoc->appendChild($root);
- }
-
- /**
- * Creation du mandataire
- @code
- <ns2:Representative>
- <RepresentativeID identificationType="TIN"
issuedBy="BE">0000000097</RepresentativeID>
- <Name>Gevolmachtigde- Mandataire TEST NV-SA </Name>
- <Street>AV Test-laan 8</Street>
- <PostCode>9999</PostCode>
- <City> TESTCITY</City>
- <CountryCode>BE</CountryCode>
- <EmailAddress>address@hidden</EmailAddress>
- <Phone>02555555</Phone>
- </ns2:Representative>
- @endcode
- */
- function append_representative()
- {
- /*
- * Variables
- */
- $ID = "0000000097";
- $issued = "BE";
- $type = 'TIN';
- $name = "Nom Mandataire";
- $street = "Nom de rue";
- $postcode = "9999";
- $city = "TESTCITY";
- $countrycode = "BE";
- $email = "address@hidden";
- $phone = "000000000";
-
- $representative = $this->domdoc->createElementNS($this->ns,
"ns2:Representative");
- $rep_id = $this->domdoc->createElement("RepresentativeID");
- $at = $rep_id->setAttribute('identificationType', $type);
- $ai = $rep_id->setAttribute('issuedBy', $issued);
- $value = $this->domdoc->createTextNode($ID);
- $rep_id->appendChild($value);
- $representative->appendChild($rep_id);
- $representative->appendChild($this->domdoc->createElement("Name",
$name));
- $representative->appendChild($this->domdoc->createElement("Street",
$street));
- $representative->appendChild($this->domdoc->createElement("PostCode",
$postcode));
- $representative->appendChild($this->domdoc->createElement("City",
$city));
-
$representative->appendChild($this->domdoc->createElement("CountryCode",
$countrycode));
-
$representative->appendChild($this->domdoc->createElement("EmailAddress",
$email));
- $representative->appendChild($this->domdoc->createElement("Phone",
$phone));
-
- $l = $this->domdoc->getElementsByTagNameNS($this->ns,
"ClientListingConsignment");
- $nb = $l->length;
- if ($nb <> 1)
- die('erreur non trouvé');
-
- $root = $l->item(0);
- $root->appendChild($representative);
- }
- /**
- * Add the listing
- *
- @code
- <ns2:ClientListing VATAmountSum="00.00" TurnOverSum="1000.72"
ClientsNbr="2" SequenceNumber="1">
- @endcode
- *
- */
- function append_client_listing($p_array)
- {
- // variable
- $vat_amount_sum = 0;
- $turnoversum = 0;
- $clientnb = 2;
- $seqnb = 1;
- $periode = 2009;
- $commentaire="Commentaire";
-
- $decl = $this->domdoc->createElementNS($this->ns, "ns2:ClientListing");
- $ai = $decl->setAttribute('VATAmountSum', $vat_amount_sum);
- $ai = $decl->setAttribute('TurnOverSum', $turnoversum);
- $ai = $decl->setAttribute('ClientsNbr', $clientnb);
- $ai = $decl->setAttribute('SequenceNumber', $seqnb);
-
-
-
- $this->append_declarant($decl, $p_array);
-
- $periode = $this->domdoc->createElementNS($this->ns, "ns2:Period",
$periode);
- $decl->appendChild($periode);
-
- $this->append_listing($decl, $p_array);
-
-
- $l = $this->domdoc->getElementsByTagNameNS($this->ns,
"ClientListingConsignment");
- $nb = $l->length;
- if ($nb <> 1)
- die('erreur non trouvé');
-
- $root = $l->item(0);
- $root->appendChild($decl);
- $decomment = $this->domdoc->createElementNS($this->ns,
"ns2:Comment",$commentaire);
- $decl->appendChild($decomment);
- }
- /*
- * Add the "Declarant"
- * @code
- <ns2:Declarant>
- <VATNumber>0000000097</VATNumber>
- <Name>TEST NV-SA</Name>
- <Street>Av Test-laan 16</Street>
- <PostCode>9999</PostCode>
- <City>TESTCITY</City>
- <CountryCode>BE</CountryCode>
- <EmailAddress>address@hidden</EmailAddress>
- <Phone>025555555</Phone>
- </ns2:Declarant>
- @endcode
- */
- function append_declarant(DOMElement $p_dom, $p_array)
- {
- /*
- * Variables
- */
- $vat_number = "0000000097";
- $name = "Nom Declarant";
- $street = "Rue du declarant";
- $postcode = "9999";
- $city = "TESTCITY";
- $countrycode = "BE";
- $email = "address@hidden";
- $phone = "000000000";
-
- $declarant = $this->domdoc->createElementNS($this->ns,
"ns2:Declarant");
- $declarant->appendChild($this->domdoc->createElement("VATNumber",
$vat_number));
- $declarant->appendChild($this->domdoc->createElement("Name", $name));
- $declarant->appendChild($this->domdoc->createElement("Street",
$street));
- $declarant->appendChild($this->domdoc->createElement("PostCode",
$postcode));
- $declarant->appendChild($this->domdoc->createElement("City", $city));
- $declarant->appendChild($this->domdoc->createElement("CountryCode",
$countrycode));
- $declarant->appendChild($this->domdoc->createElement("EmailAddress",
$email));
- $declarant->appendChild($this->domdoc->createElement("Phone", $phone));
- $p_dom->appendChild($declarant);
- }
- /**
- * Add all the customers
- * @code
- <ns2:Client SequenceNumber="1">
- <ns2:CompanyVATNumber issuedBy="BE">0000000097</ns2:CompanyVATNumber>
- <ns2:TurnOver>500.36</ns2:TurnOver>
- <ns2:VATAmount>0.00</ns2:VATAmount>
- </ns2:Client>
- <ns2:Client SequenceNumber="2">
- <ns2:CompanyVATNumber issuedBy="BE">0000000097</ns2:CompanyVATNumber>
- <ns2:TurnOver>500.36</ns2:TurnOver>
- <ns2:VATAmount>0.00</ns2:VATAmount>
- </ns2:Client>
- * @endcode
- * @param DOMElement $p_dom
- * @param type $p_array
- */
-
- function append_listing(DOMElement $p_dom, $p_array)
- {
- /*
- * Client are in array
- */
- $nb_client = 2;
- $vat_number = "0000000097";
- $issued = "BE";
- $turnover = 500;
- $vat_amount = 0;
- $vat_amount_sum = 0;
-
-
- for ($i = 0; $i < $nb_client; $i++)
- {
- $client = $this->domdoc->createElementNS($this->ns, "ns2:Client");
- $ai = $client->setAttribute('SequenceNumber', $i+1);
- $company = $this->domdoc->createElementNS($this->ns,
"ns2:CompanyVATNumber");
- $company->setAttribute('issuedBy', 'BE');
- $de_vat_number = $this->domdoc->createTextNode($vat_number);
- $company->appendChild($de_vat_number);
- $client->appendChild($company);
-
$client->appendChild($this->domdoc->createElementNS($this->ns,"ns2:TurnOver",
$turnover));
-
$client->appendChild($this->domdoc->createElementNS($this->ns,"ns2:VATAmount",
$vat_amount));
- $p_dom->appendChild($client);
- }
-
- }
-
-}
-/*
- * Test
-$a = new Intervat();
-$a->domdoc->formatOutput = true;
-
-$a->append_root();
-$a->append_representative();
-$a->append_client_listing(array());
-echo $a->domdoc->saveXML();
-*/
\ No newline at end of file
Added: trunk/transform/include/class_transform_declarant.php
===================================================================
--- trunk/transform/include/class_transform_declarant.php
(rev 0)
+++ trunk/transform/include/class_transform_declarant.php 2014-01-31
19:36:41 UTC (rev 673)
@@ -0,0 +1,94 @@
+<?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
+*/
+/**
+ * @brief contains declarant
address@hidden
+$vat_number = "0000000097";
+$name = "Nom Declarant";
+$street = "Rue du declarant";
+$postcode = "9999";
+$city = "TESTCITY";
+$countrycode = "BE";
+$email = "address@hidden";
+$phone = "000000000";
address@hidden
+ */
+// Copyright Author Dany De Bontridder address@hidden
+class Transform_Declarant
+{
+
+ /**
+ * name
+ */
+ var $name;
+ /**
+ * street
+ */
+ var $street;
+ /**
+ * Postcode
+ */
+ var $postcode;
+ /**
+ * city
+ */
+ var $city;
+ /**
+ * country code (BE)
+ */
+ var $countrycode;
+ /**
+ * email
+ */
+ var $email;
+ /**
+ * phone
+ */
+ var $phone;
+ /**
+ * vatnumber
+ */
+ var $vatnumber;
+ function fromPost()
+ {
+ $this->name=HtmlInput::default_value_post("p_name",null);
+ $this->street=HtmlInput::default_value_post("p_street",null);
+ $this->postcode=HtmlInput::default_value_post("p_postcode",null);
+ $this->city=HtmlInput::default_value_post("p_city",null);
+ $this->countrycode=HtmlInput::default_value_post("p_countrycode",null);
+ $this->email=HtmlInput::default_value_post("p_email",null);
+ $this->phone=HtmlInput::default_value_post("p_phone",null);
+ $this->vatnumber=HtmlInput::default_value_post("p_vatnumber",null);
+ }
+ function input()
+ {
+ $h_name=new IText('p_name',$this->name);
+ $h_vatnumber=new IText('p_vatnumber',$this->vatnumber);
+ $h_street=new IText('p_street',$this->street);
+ $h_postcode=new IText('p_postcode',$this->postcode);
+ $h_city=new IText('p_city',$this->city);
+ $h_countrycode=new IText('p_countrycode',$this->countrycode);
+ $h_email=new IText('p_email',$this->email);
+ $h_phone=new IText('p_phone',$this->phone);
+ require_once 'template/listing_assujetti_declarant.php';
+
+ }
+}
+?>
Copied: trunk/transform/include/class_transform_intervat.php (from rev 671,
trunk/transform/include/class_intervat.php)
===================================================================
--- trunk/transform/include/class_transform_intervat.php
(rev 0)
+++ trunk/transform/include/class_transform_intervat.php 2014-01-31
19:36:41 UTC (rev 673)
@@ -0,0 +1,228 @@
+<?php
+
+/*
+ * Copyright (C) 2014 dany
+ *
+ * This program 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.
+ *
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+require_once 'class_transform_declarant.php';
+require_once 'class_transform_representative.php';
+
+
+/**
+ * Description of class_intervat
+ *
+ * @author dany
+ */
+class Transform_Intervat
+{
+
+ /**
+ * Content the XML Document
+ * @var DOMDocument
+ */
+ var $domdoc;
+
+ function __construct()
+ {
+ $this->domdoc = new DOMDocument('1.0', 'ISO-8859-1');
+ $this->ns = 'http://www.minfin.fgov.be/ClientListingConsignment';
+ $this->domdoc->formatOutput = true;
+ }
+
+ function append_root()
+ {
+ $ns = 'http://www.minfin.fgov.be/ClientListingConsignment';
+ $t = $this->domdoc->createElementNS($this->ns,
'ns2:ClientListingConsignment');
+
+ $root = $this->domdoc->appendChild($t);
+ $xmls = $root->setAttribute("xmlns",
"http://www.minfin.fgov.be/InputCommon");
+
+ $listing = $this->domdoc->appendChild($root);
+
+ $nb = $this->domdoc->createAttribute('ClientListingsNbr');
+ $nb->value = 1;
+ $listing->appendChild($nb);
+
+ $this->domdoc->appendChild($root);
+ }
+
+ /**
+ * Creation du mandataire
+ @code
+ <ns2:Representative>
+ <RepresentativeID identificationType="TIN"
issuedBy="BE">0000000097</RepresentativeID>
+ <Name>Gevolmachtigde- Mandataire TEST NV-SA </Name>
+ <Street>AV Test-laan 8</Street>
+ <PostCode>9999</PostCode>
+ <City> TESTCITY</City>
+ <CountryCode>BE</CountryCode>
+ <EmailAddress>address@hidden</EmailAddress>
+ <Phone>02555555</Phone>
+ </ns2:Representative>
+ @endcode
+ */
+ function append_representative(Transform_Representative $p_representative)
+ {
+ /*
+ * Variables
+ */
+
+
+ $representative = $this->domdoc->createElementNS($this->ns,
"ns2:Representative");
+ $rep_id = $this->domdoc->createElement("RepresentativeID");
+ $at = $rep_id->setAttribute('identificationType',
$p_representative->type);
+ $ai = $rep_id->setAttribute('issuedBy', $p_representative->issued);
+ $value = $this->domdoc->createTextNode($p_representative->id);
+ $rep_id->appendChild($value);
+ $representative->appendChild($rep_id);
+ $representative->appendChild($this->domdoc->createElement("Name",
$p_representative->name));
+ $representative->appendChild($this->domdoc->createElement("Street",
$p_representative->street));
+ $representative->appendChild($this->domdoc->createElement("PostCode",
$p_representative->postcode));
+ $representative->appendChild($this->domdoc->createElement("City",
$p_representative->city));
+
$representative->appendChild($this->domdoc->createElement("CountryCode",
$p_representative->countrycode));
+
$representative->appendChild($this->domdoc->createElement("EmailAddress",
$p_representative->email));
+ $representative->appendChild($this->domdoc->createElement("Phone",
$p_representative->phone));
+
+ $l = $this->domdoc->getElementsByTagNameNS($this->ns,
"ClientListingConsignment");
+ $nb = $l->length;
+ if ($nb <> 1)
+ die('erreur non trouvé');
+
+ $root = $l->item(0);
+ $root->appendChild($representative);
+ }
+ /**
+ * Add the listing
+ *
+ @code
+ <ns2:ClientListing VATAmountSum="00.00" TurnOverSum="1000.72"
ClientsNbr="2" SequenceNumber="1">
+ @endcode
+ *
+ */
+ function append_client_listing(Transform_Declarant $p_declarant,$p_array)
+ {
+ // variable
+ $vat_amount_sum = 0;
+ $turnoversum = 0;
+ $clientnb = 2;
+ $seqnb = 1;
+ $periode = 2009;
+ $commentaire="Commentaire";
+
+ $decl = $this->domdoc->createElementNS($this->ns, "ns2:ClientListing");
+ $ai = $decl->setAttribute('VATAmountSum', $vat_amount_sum);
+ $ai = $decl->setAttribute('TurnOverSum', $turnoversum);
+ $ai = $decl->setAttribute('ClientsNbr', $clientnb);
+ $ai = $decl->setAttribute('SequenceNumber', $seqnb);
+
+
+
+ $this->append_declarant($decl, $p_declarant,$p_array);
+
+ $periode = $this->domdoc->createElementNS($this->ns, "ns2:Period",
$periode);
+ $decl->appendChild($periode);
+
+ $this->append_listing($decl, $p_array);
+
+
+ $l = $this->domdoc->getElementsByTagNameNS($this->ns,
"ClientListingConsignment");
+ $nb = $l->length;
+ if ($nb <> 1)
+ die('erreur non trouvé');
+
+ $root = $l->item(0);
+ $root->appendChild($decl);
+ $decomment = $this->domdoc->createElementNS($this->ns,
"ns2:Comment",$commentaire);
+ $decl->appendChild($decomment);
+ }
+ /*
+ * Add the "Declarant"
+ * @code
+ <ns2:Declarant>
+ <VATNumber>0000000097</VATNumber>
+ <Name>TEST NV-SA</Name>
+ <Street>Av Test-laan 16</Street>
+ <PostCode>9999</PostCode>
+ <City>TESTCITY</City>
+ <CountryCode>BE</CountryCode>
+ <EmailAddress>address@hidden</EmailAddress>
+ <Phone>025555555</Phone>
+ </ns2:Declarant>
+ @endcode
+ */
+ function append_declarant(DOMElement $p_dom, Transform_Declarant
$p_declarant,$p_array)
+ {
+
+
+ $declarant = $this->domdoc->createElementNS($this->ns,
"ns2:Declarant");
+ $declarant->appendChild($this->domdoc->createElement("VATNumber",
$p_declarant->vat_number));
+ $declarant->appendChild($this->domdoc->createElement("Name",
$p_declarant->name));
+ $declarant->appendChild($this->domdoc->createElement("Street",
$p_declarant->street));
+ $declarant->appendChild($this->domdoc->createElement("PostCode",
$p_declarant->postcode));
+ $declarant->appendChild($this->domdoc->createElement("City",
$p_declarant->city));
+ $declarant->appendChild($this->domdoc->createElement("CountryCode",
$p_declarant->countrycode));
+ $declarant->appendChild($this->domdoc->createElement("EmailAddress",
$p_declarant->email));
+ $declarant->appendChild($this->domdoc->createElement("Phone",
$p_declarant->phone));
+ $p_dom->appendChild($declarant);
+ }
+ /**
+ * Add all the customers
+ * @code
+ <ns2:Client SequenceNumber="1">
+ <ns2:CompanyVATNumber issuedBy="BE">0000000097</ns2:CompanyVATNumber>
+ <ns2:TurnOver>500.36</ns2:TurnOver>
+ <ns2:VATAmount>0.00</ns2:VATAmount>
+ </ns2:Client>
+ <ns2:Client SequenceNumber="2">
+ <ns2:CompanyVATNumber issuedBy="BE">0000000097</ns2:CompanyVATNumber>
+ <ns2:TurnOver>500.36</ns2:TurnOver>
+ <ns2:VATAmount>0.00</ns2:VATAmount>
+ </ns2:Client>
+ * @endcode
+ * @param DOMElement $p_dom
+ * @param type $p_array
+ */
+
+ function append_listing(DOMElement $p_dom, $p_array)
+ {
+ /*
+ * Client are in array
+ */
+ $nb_client = 2;
+ $vat_number = "0000000097";
+ $issued = "BE";
+ $turnover = 500;
+ $vat_amount = 0;
+ $vat_amount_sum = 0;
+
+
+ for ($i = 0; $i < $nb_client; $i++)
+ {
+ $client = $this->domdoc->createElementNS($this->ns, "ns2:Client");
+ $ai = $client->setAttribute('SequenceNumber', $i+1);
+ $company = $this->domdoc->createElementNS($this->ns,
"ns2:CompanyVATNumber");
+ $company->setAttribute('issuedBy', 'BE');
+ $de_vat_number = $this->domdoc->createTextNode($vat_number);
+ $company->appendChild($de_vat_number);
+ $client->appendChild($company);
+
$client->appendChild($this->domdoc->createElementNS($this->ns,"ns2:TurnOver",
$turnover));
+
$client->appendChild($this->domdoc->createElementNS($this->ns,"ns2:VATAmount",
$vat_amount));
+ $p_dom->appendChild($client);
+ }
+
+ }
+
+}
Added: trunk/transform/include/class_transform_representative.php
===================================================================
--- trunk/transform/include/class_transform_representative.php
(rev 0)
+++ trunk/transform/include/class_transform_representative.php 2014-01-31
19:36:41 UTC (rev 673)
@@ -0,0 +1,115 @@
+<?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 address@hidden
+/**
+ * @brief contains the representative
+ @code
+ $ID = "0000000097";
+$issued = "BE";
+$type = 'TIN';
+$name = "Nom Mandataire";
+$street = "Nom de rue";
+$postcode = "9999";
+$city = "TESTCITY";
+$countrycode = "BE";
+$email = "address@hidden";
+$phone = "000000000";
+ @endcode
+ */
+
+class Transform_Representative
+{
+ /**
+ * id is the id of the listing
+ */
+ var $id;
+ /**
+ * issued by
+ */
+ var $issued;
+ /**
+ * Type (TIN)
+ */
+ var $type;
+ /**
+ * name
+ */
+ var $name;
+ /**
+ * street
+ */
+ var $street;
+ /**
+ * Postcode
+ */
+ var $postcode;
+ /**
+ * city
+ */
+ var $city;
+ /**
+ * country code (BE)
+ */
+ var $countrycode;
+ /**
+ * email
+ */
+ var $email;
+ /**
+ * phone
+ */
+ var $phone;
+ function fromPost()
+ {
+ $this->id=HtmlInput::default_value_post("p_id",null);
+ $this->type=HtmlInput::default_value_post("p_type",null);
+ $this->name=HtmlInput::default_value_post("p_name",null);
+ $this->street=HtmlInput::default_value_post("p_street",null);
+ $this->postcode=HtmlInput::default_value_post("p_postcode",null);
+ $this->city=HtmlInput::default_value_post("p_city",null);
+ $this->countrycode=HtmlInput::default_value_post("p_countrycode",null);
+ $this->email=HtmlInput::default_value_post("p_email",null);
+ $this->phone=HtmlInput::default_value_post("p_phone",null);
+ $this->issued=HtmlInput::default_value_post("p_issued",null);
+ }
+ function input()
+ {
+ $h_type=new ISelect('p_type');
+ $h_type->value=array(
+ array("label"=>'TIN',"value"=>"TIN"),
+ array("label"=>'NVAT',"value"=>"NVAT"),
+ array("label"=>'other',"value"=>"other")
+ );
+ $h_type->selected=$this->type;
+ $h_name=new IText('p_name',$this->name);
+ $h_street=new IText('p_street',$this->street);
+ $h_postcode=new IText('p_postcode',$this->postcode);
+ $h_city=new IText('p_city',$this->city);
+ $h_countrycode=new IText('p_countrycode',$this->countrycode);
+ $h_email=new IText('p_email',$this->email);
+ $h_phone=new IText('p_phone',$this->phone);
+ $h_id=new INum('p_id',$this->id);
+ $h_issued=new IText("p_issued",$this->issued);
+ require_once 'template/listing_assujetti_representative.php';
+
+ }
+}
+
Added: trunk/transform/include/intervat_listing_assujetti.inc.php
===================================================================
--- trunk/transform/include/intervat_listing_assujetti.inc.php
(rev 0)
+++ trunk/transform/include/intervat_listing_assujetti.inc.php 2014-01-31
19:36:41 UTC (rev 673)
@@ -0,0 +1,49 @@
+<?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 address@hidden
+require_once 'class_transform_representative.php';
+require_once 'class_transform_declarant.php';
+$representative=new Transform_Representative();
+$declarant=new Transform_Declarant();
+?>
+<h1>Listing Assujetti Intervat </h1>
+
+<form method="post" enctype="multipart/form-data">
+ <h2><?php echo _('Mandataire');?></h2>
+<?php
+$representative->input();
+?>
+ <h2><?php echo _('Déclarant');?></h2>
+<?php
+$declarant->input();
+?>
+ <p>
+ <?php
+ $file = new IFile('client_assujetti');
+ echo $file->input();
+ ?>
+ </p>
+ <p>
+ <?php
+ echo HtmlInput::request_to_hidden(array('gDossier', 'ac',
'plugin_code', 'sa'));
+ echo HtmlInput::submit('send_list', 'Valider');
+ ?>
+ </p>
+</form>
Added: trunk/transform/include/template/listing_assujetti_declarant.php
===================================================================
--- trunk/transform/include/template/listing_assujetti_declarant.php
(rev 0)
+++ trunk/transform/include/template/listing_assujetti_declarant.php
2014-01-31 19:36:41 UTC (rev 673)
@@ -0,0 +1,68 @@
+<?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 address@hidden
+
+?>
+<table>
+ <tr>
+ <td>
+ <?php echo _('Nom') . "</td><td>" . $h_name->input(); ?>
+ </td>
+ <tr>
+ <tr>
+ <td>
+ <?php echo _('Rue') . "</td><td>" . $h_street->input(); ?>
+ </td>
+ <tr>
+ <tr>
+ <td>
+ <?php echo _('Code postal') . "</td><td>" . $h_postcode->input();
?>
+ </td>
+ <tr>
+ <tr>
+ <td>
+ <?php echo _('Ville') . "</td><td>" . $h_city->input(); ?>
+ </td>
+ <tr>
+ <tr>
+ <td>
+ <?php echo _('Code Pays') . "</td><td>" . $h_countrycode->input();
?>
+ </td>
+ <tr>
+ <tr>
+ <td>
+ <?php echo _('email') . "</td><td>" . $h_email->input(); ?>
+ </td>
+ <tr>
+ <tr>
+ <td>
+ <?php echo _('Téléphone') . "</td><td>" . $h_phone->input(); ?>
+ </td>
+ <tr>
+ <tr>
+ <td>
+ <?php echo _('N° TVA') . "</td><td>" . $h_vatnumber->input(); ?>
+ </td>
+ <tr>
+
+
+</table>
+
Added: trunk/transform/include/template/listing_assujetti_representative.php
===================================================================
--- trunk/transform/include/template/listing_assujetti_representative.php
(rev 0)
+++ trunk/transform/include/template/listing_assujetti_representative.php
2014-01-31 19:36:41 UTC (rev 673)
@@ -0,0 +1,69 @@
+<?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 address@hidden
+?>
+<table>
+ <tr>
+ <td>
+ <?php echo _('Nom') . "</td><td>" . $h_name->input(); ?>
+ </td>
+ <tr>
+ <tr>
+ <td>
+ <?php echo _('Rue') . "</td><td>" . $h_street->input(); ?>
+ </td>
+ <tr>
+ <tr>
+ <td>
+ <?php echo _('Code postal') . "</td><td>" . $h_postcode->input();
?>
+ </td>
+ <tr>
+ <tr>
+ <td>
+ <?php echo _('Ville') . "</td><td>" . $h_city->input(); ?>
+ </td>
+ <tr>
+ <tr>
+ <td>
+ <?php echo _('Code Pays') . "</td><td>" . $h_countrycode->input();
?>
+ </td>
+ <tr>
+ <tr>
+ <td>
+ <?php echo _('email') . "</td><td>" . $h_email->input(); ?>
+ </td>
+ <tr>
+ <tr>
+ <td>
+ <?php echo _('Téléphone') . "</td><td>" . $h_phone->input(); ?>
+ </td>
+ <tr>
+ <tr>
+ <td>
+ <?php echo _('listing id') . "</td><td>" . $h_id->input(); ?>
+ </td>
+ <tr>
+ <tr>
+ <td>
+ <?php echo _('Type') . "</td><td>" . $h_type->input(); ?>
+ </td>
+ <tr>
+
+</table>
\ No newline at end of file
Modified: trunk/transform/index.php
===================================================================
--- trunk/transform/index.php 2014-01-31 17:35:53 UTC (rev 672)
+++ trunk/transform/index.php 2014-01-31 19:36:41 UTC (rev 673)
@@ -19,54 +19,10 @@
// Copyright Author Dany De Bontridder address@hidden
-$doc=new DOMDocument('1.0','ISO-8859-1');
-$doc->formatOutput = true;
+echo '<div style="float:right"><a class="mtitle" style="font-size:140%"
href="http://wiki.phpcompta.eu/doku.php?id=transformateur"
target="_blank">Aide</a>'.
+'<span style="font-size:0.8em;color:red;display:inline">vers:SVNINFO</span>'.
+'</div>';
-// $ns="http://www.w3.org/2001/XMLSchema";
-$ns='http://www.minfin.fgov.be/ClientListingConsignment';
-$t=$doc->createElementNS($ns,'ns2:ClientListingConsignment');
+require_once "include/intervat_listing_assujetti.inc.php";
-$root=$doc->appendChild($t);
-
-// $root->setAttributeNS($ns,'ns2:iso','http://www.minfin.fgov.be/IsoTypes');
-$listing=$doc->appendChild($root);
-$xmls=$root->setAttribute("xmlns","http://www.minfin.fgov.be/InputCommon");
-
-//$xmls->value="http://www.minfin.fgov.be/InputCommon";
-$listing=$doc->appendChild($root);
-
-
-$nb=$doc->createAttribute('ClientListingsNbr');
-$nb->value=1;
-$listing->appendChild($nb);
-
-$declarant=$doc->createElementNS('http://www.minfin.fgov.be/ClientListingConsigment','ns2:Declarant');
-$vatnumber=$doc->createElement("VATNumber","dany");
-$name=$doc->createElement("Name","dany");
-$street=$doc->createElement("Street","dany");
-$postcode=$doc->createElement("PostCode","dany");
-$city=$doc->createElement("City","dany");
-$country=$doc->createElement("CountryCode","dany");
-$email=$doc->createElement("EmailAddress","dany");
-$phone=$doc->createElement("Phone","0000000");
-
-
-
-$declarant_xml=$root->appendChild($declarant);
-$declarant_xml->appendChild($vatnumber);
-$declarant_xml->appendChild($name);
-$declarant_xml->appendChild($street);
-$declarant_xml->appendChild($postcode);
-$declarant_xml->appendChild($city);
-$declarant_xml->appendChild($country);
-$declarant_xml->appendChild($email);
-$declarant_xml->appendChild($phone);
-
-$periode=$doc->createElementNS("http://www.minfin.fgov.be/ClientListingConsignment","ns2Periode","1402");
-$root->appendChild($periode);
-
-$test=$doc->saveXML();
-$doc->save('test.xml');
-echo $test;
-echo ' file text.xml created'.PHP_EOL;
?>
Deleted: trunk/transform/unit-test/IntervatTest.php
===================================================================
--- trunk/transform/unit-test/IntervatTest.php 2014-01-31 17:35:53 UTC (rev
672)
+++ trunk/transform/unit-test/IntervatTest.php 2014-01-31 19:36:41 UTC (rev
673)
@@ -1,176 +0,0 @@
-<?php
-
-/**
- * Testing of class_intervat
- * phpunit-skelgen --bootstrap bootstrap.php --test -- Intervat
../include/class_intervat.php
- * phpunit --bootstrap bootstrap.php IntervatTest.php
- * @author dany
- * Expected result
- * @code
- * <?xml version="1.0" encoding="ISO-8859-1"?>
-<ns2:ClientListingConsignment
xmlns:ns2="http://www.minfin.fgov.be/ClientListingConsignment"
xmlns="http://www.minfin.fgov.be/InputCommon" ClientListingsNbr="1">
- <ns2:Representative>
- <RepresentativeID identificationType="TIN"
issuedBy="BE">0000000097</RepresentativeID>
- <Name>Nom Mandataire</Name>
- <Street>Nom de rue</Street>
- <PostCode>9999</PostCode>
- <City>TESTCITY</City>
- <CountryCode>BE</CountryCode>
- <EmailAddress>address@hidden</EmailAddress>
- <Phone>000000000</Phone>
- </ns2:Representative>
- <ns2:ClientListing VATAmountSum="0" TurnOverSum="0" ClientsNbr="2"
SequenceNumber="1">
- <ns2:Declarant>
- <VATNumber>0000000097</VATNumber>
- <Name>Nom Déclarant</Name>
- <Street>Rue du déclarant</Street>
- <PostCode>9999</PostCode>
- <City>TESTCITY</City>
- <CountryCode>BE</CountryCode>
- <EmailAddress>address@hidden</EmailAddress>
- <Phone>000000000</Phone>
- </ns2:Declarant>
- <ns2:Period>2009</ns2:Period>
- <ns2:Client SequenceNumber="1">
- <ns2:CompanyVATNumber issuedBy="BE">0000000097</ns2:CompanyVATNumber>
- <ns2:TurnOver>500</ns2:TurnOver>
- <ns2:VATAmount>0</ns2:VATAmount>
- </ns2:Client>
- <ns2:Client SequenceNumber="2">
- <ns2:CompanyVATNumber issuedBy="BE">0000000097</ns2:CompanyVATNumber>
- <ns2:TurnOver>500</ns2:TurnOver>
- <ns2:VATAmount>0</ns2:VATAmount>
- </ns2:Client>
- <ns2:Comment>Commentaire</ns2:Comment>
- </ns2:ClientListing>
-</ns2:ClientListingConsignment>
- * @endcode
- *
- */
-require_once 'class_intervat.php';
-require_once 'bootstrap.php';
-
-/**
- * Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2014-01-25 at 18:01:08.
- */
-class IntervatTest extends PHPUnit_Framework_TestCase
-{
-
- /**
- * @var Intervat
- */
- protected $object;
-
- /**
- * Sets up the fixture, for example, opens a network connection.
- * This method is called before a test is executed.
- */
- protected function setUp()
- {
- $this->object = new Intervat;
- $this->result='<?xml version="1.0" encoding="ISO-8859-1"?>
-<ns2:ClientListingConsignment
xmlns:ns2="http://www.minfin.fgov.be/ClientListingConsignment"
xmlns="http://www.minfin.fgov.be/InputCommon" ClientListingsNbr="1">
- <ns2:Representative>
- <RepresentativeID identificationType="TIN"
issuedBy="BE">0000000097</RepresentativeID>
- <Name>Nom Mandataire</Name>
- <Street>Nom de rue</Street>
- <PostCode>9999</PostCode>
- <City>TESTCITY</City>
- <CountryCode>BE</CountryCode>
- <EmailAddress>address@hidden</EmailAddress>
- <Phone>000000000</Phone>
- </ns2:Representative>
- <ns2:ClientListing VATAmountSum="0" TurnOverSum="0" ClientsNbr="2"
SequenceNumber="1">
- <ns2:Declarant>
- <VATNumber>0000000097</VATNumber>
- <Name>Nom Declarant</Name>
- <Street>Rue du declarant</Street>
- <PostCode>9999</PostCode>
- <City>TESTCITY</City>
- <CountryCode>BE</CountryCode>
- <EmailAddress>address@hidden</EmailAddress>
- <Phone>000000000</Phone>
- </ns2:Declarant>
- <ns2:Period>2009</ns2:Period>
- <ns2:Client SequenceNumber="1">
- <ns2:CompanyVATNumber issuedBy="BE">0000000097</ns2:CompanyVATNumber>
- <ns2:TurnOver>500</ns2:TurnOver>
- <ns2:VATAmount>0</ns2:VATAmount>
- </ns2:Client>
- <ns2:Client SequenceNumber="2">
- <ns2:CompanyVATNumber issuedBy="BE">0000000097</ns2:CompanyVATNumber>
- <ns2:TurnOver>500</ns2:TurnOver>
- <ns2:VATAmount>0</ns2:VATAmount>
- </ns2:Client>
- <ns2:Comment>Commentaire</ns2:Comment>
- </ns2:ClientListing>
-</ns2:ClientListingConsignment>
-';
- }
-
- /**
- * Tears down the fixture, for example, closes a network connection.
- * This method is called after a test is executed.
- */
- protected function tearDown()
- {
-
- }
-
- /**
- * @covers Intervat::append_root
- * @todo Implement testAppend_root().
- */
- public function testAppend_root()
- {
- $this->object->append_root();
- $result = $this->object->domdoc->saveXML();
- $must_march = '<?xml version="1.0" encoding="ISO-8859-1"?>
- <ns2:ClientListingConsignment
xmlns="http://www.minfin.fgov.be/InputCommon"
xmlns:ns2="http://www.minfin.fgov.be/ClientListingConsignment"
ClientListingsNbr="1">';
- $this->assertContains('<?xml version="1.0" encoding="ISO-8859-1"?>',
$result);
- $this->assertContains('<ns2:ClientListingConsignment', $result);
- $this->assertContains('xmlns="http://www.minfin.fgov.be/InputCommon"',
$result);
-
$this->assertContains('xmlns:ns2="http://www.minfin.fgov.be/ClientListingConsignment"',
$result);
- $this->assertContains('ClientListingsNbr="1"', $result);
- }
- public function testAppend_representative()
- {
- $this->object->append_root();
- $this->object->append_representative();
- $result = $this->object->domdoc->saveXML();
- $this->assertContains('ns2:Representative',$result);
- }
- /**
- * @covers Intervat::append_client_listing
- * @todo Implement testAppend_client_listing().
- */
- public function testAppend_client_listing()
- {
- $this->object->append_root();
- $this->object->append_representative();
- $this->object->append_client_listing(array());
- $result = $this->object->domdoc->saveXML();
- $this->assertEquals($this->result,$result);
-
- }
-
- /**
- * @covers Intervat::append_declarant
- * @todo Implement testAppend_declarant().
- */
- public function testAppend_declarant()
- {
-
- }
-
- /**
- * @covers Intervat::append_listing
- * @todo Implement testAppend_listing().
- */
- public function testAppend_listing()
- {
-
- }
-
-
-}
Copied: trunk/transform/unit-test/transform_IntervatTest.php (from rev 671,
trunk/transform/unit-test/IntervatTest.php)
===================================================================
--- trunk/transform/unit-test/transform_IntervatTest.php
(rev 0)
+++ trunk/transform/unit-test/transform_IntervatTest.php 2014-01-31
19:36:41 UTC (rev 673)
@@ -0,0 +1,197 @@
+<?php
+
+/**
+ * Testing of class_intervat
+ * phpunit-skelgen --bootstrap bootstrap.php --test -- Intervat
../include/class_transform_intervat.php
+ * phpunit --bootstrap bootstrap.php transform_IntervatTest.php
+ * @author dany
+ * Expected result
+ * @code
+ * <?xml version="1.0" encoding="ISO-8859-1"?>
+ <ns2:ClientListingConsignment
xmlns:ns2="http://www.minfin.fgov.be/ClientListingConsignment"
xmlns="http://www.minfin.fgov.be/InputCommon" ClientListingsNbr="1">
+ <ns2:Representative>
+ <RepresentativeID identificationType="TIN"
issuedBy="BE">0000000097</RepresentativeID>
+ <Name>Nom Mandataire</Name>
+ <Street>Nom de rue</Street>
+ <PostCode>9999</PostCode>
+ <City>TESTCITY</City>
+ <CountryCode>BE</CountryCode>
+ <EmailAddress>address@hidden</EmailAddress>
+ <Phone>000000000</Phone>
+ </ns2:Representative>
+ <ns2:ClientListing VATAmountSum="0" TurnOverSum="0" ClientsNbr="2"
SequenceNumber="1">
+ <ns2:Declarant>
+ <VATNumber>0000000097</VATNumber>
+ <Name>Nom Déclarant</Name>
+ <Street>Rue du déclarant</Street>
+ <PostCode>9999</PostCode>
+ <City>TESTCITY</City>
+ <CountryCode>BE</CountryCode>
+ <EmailAddress>address@hidden</EmailAddress>
+ <Phone>000000000</Phone>
+ </ns2:Declarant>
+ <ns2:Period>2009</ns2:Period>
+ <ns2:Client SequenceNumber="1">
+ <ns2:CompanyVATNumber issuedBy="BE">0000000097</ns2:CompanyVATNumber>
+ <ns2:TurnOver>500</ns2:TurnOver>
+ <ns2:VATAmount>0</ns2:VATAmount>
+ </ns2:Client>
+ <ns2:Client SequenceNumber="2">
+ <ns2:CompanyVATNumber issuedBy="BE">0000000097</ns2:CompanyVATNumber>
+ <ns2:TurnOver>500</ns2:TurnOver>
+ <ns2:VATAmount>0</ns2:VATAmount>
+ </ns2:Client>
+ <ns2:Comment>Commentaire</ns2:Comment>
+ </ns2:ClientListing>
+ </ns2:ClientListingConsignment>
+ * @endcode
+ *
+ */
+require_once 'class_transform_intervat.php';
+require_once 'class_transform_representative.php';
+require_once 'bootstrap.php';
+
+/**
+ * Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2014-01-25 at 18:01:08.
+ */
+class IntervatTest extends PHPUnit_Framework_TestCase
+{
+
+ /**
+ * @var Intervat
+ */
+ protected $object;
+
+ /**
+ * Sets up the fixture, for example, opens a network connection.
+ * This method is called before a test is executed.
+ */
+ protected function setUp()
+ {
+ $this->object = new Transform_Intervat;
+ $this->result = '<?xml version="1.0" encoding="ISO-8859-1"?>
+<ns2:ClientListingConsignment
xmlns:ns2="http://www.minfin.fgov.be/ClientListingConsignment"
xmlns="http://www.minfin.fgov.be/InputCommon" ClientListingsNbr="1">
+ <ns2:Representative>
+ <RepresentativeID identificationType="TIN"
issuedBy="BE">0000000097</RepresentativeID>
+ <Name>Nom Mandataire</Name>
+ <Street>Nom de rue</Street>
+ <PostCode>9999</PostCode>
+ <City>TESTCITY</City>
+ <CountryCode>BE</CountryCode>
+ <EmailAddress>address@hidden</EmailAddress>
+ <Phone>000000000</Phone>
+ </ns2:Representative>
+ <ns2:ClientListing VATAmountSum="0" TurnOverSum="0" ClientsNbr="2"
SequenceNumber="1">
+ <ns2:Declarant>
+ <VATNumber>0000000097</VATNumber>
+ <Name>Nom Declarant</Name>
+ <Street>Rue du declarant</Street>
+ <PostCode>9999</PostCode>
+ <City>TESTCITY</City>
+ <CountryCode>BE</CountryCode>
+ <EmailAddress>address@hidden</EmailAddress>
+ <Phone>000000000</Phone>
+ </ns2:Declarant>
+ <ns2:Period>2009</ns2:Period>
+ <ns2:Client SequenceNumber="1">
+ <ns2:CompanyVATNumber issuedBy="BE">0000000097</ns2:CompanyVATNumber>
+ <ns2:TurnOver>500</ns2:TurnOver>
+ <ns2:VATAmount>0</ns2:VATAmount>
+ </ns2:Client>
+ <ns2:Client SequenceNumber="2">
+ <ns2:CompanyVATNumber issuedBy="BE">0000000097</ns2:CompanyVATNumber>
+ <ns2:TurnOver>500</ns2:TurnOver>
+ <ns2:VATAmount>0</ns2:VATAmount>
+ </ns2:Client>
+ <ns2:Comment>Commentaire</ns2:Comment>
+ </ns2:ClientListing>
+</ns2:ClientListingConsignment>
+';
+ $this->representative = new Transform_Representative();
+ $this->representative->id = "0000000097";
+ $this->representative->issued = "BE";
+ $this->representative->type = 'TIN';
+ $this->representative->name = "Nom Mandataire";
+ $this->representative->street = "Nom de rue";
+ $this->representative->postcode = "9999";
+ $this->representative->city = "TESTCITY";
+ $this->representative->countrycode = "BE";
+ $this->representative->email = "address@hidden";
+ $this->representative->phone = "000000000";
+ /*
+ * Variables
+ */
+ $this->declarant=new Transform_Declarant();
+ $this->declarant->vat_number = "0000000097";
+ $this->declarant->name = "Nom Declarant";
+ $this->declarant->street = "Rue du declarant";
+ $this->declarant->postcode = "9999";
+ $this->declarant->city = "TESTCITY";
+ $this->declarant->countrycode = "BE";
+ $this->declarant->email = "address@hidden";
+ $this->declarant->phone = "000000000";
+ }
+
+ /**
+ * Tears down the fixture, for example, closes a network connection.
+ * This method is called after a test is executed.
+ */
+ protected function tearDown()
+ {
+
+ }
+
+ /**
+ * @covers Intervat::append_root
+ * @todo Implement testAppend_root().
+ */
+ public function testAppend_root()
+ {
+ $this->object->append_root();
+ $result = $this->object->domdoc->saveXML();
+ $must_march = '<?xml version="1.0" encoding="ISO-8859-1"?>
+ <ns2:ClientListingConsignment
xmlns="http://www.minfin.fgov.be/InputCommon"
xmlns:ns2="http://www.minfin.fgov.be/ClientListingConsignment"
ClientListingsNbr="1">';
+ $this->assertContains('<?xml version="1.0" encoding="ISO-8859-1"?>',
$result);
+ $this->assertContains('<ns2:ClientListingConsignment', $result);
+ $this->assertContains('xmlns="http://www.minfin.fgov.be/InputCommon"',
$result);
+
$this->assertContains('xmlns:ns2="http://www.minfin.fgov.be/ClientListingConsignment"',
$result);
+ $this->assertContains('ClientListingsNbr="1"', $result);
+ }
+
+ public function testAppend_representative()
+ {
+
+ $this->object->append_root();
+ $this->object->append_representative($this->representative);
+ $result = $this->object->domdoc->saveXML();
+ $this->assertContains('ns2:Representative', $result);
+ }
+
+ /**
+ * @covers Intervat::append_client_listing
+ * @todo Implement testAppend_client_listing().
+ */
+ public function testAppend_client_listing()
+ {
+ $this->object->append_root();
+ $this->object->append_representative($this->representative);
+ $this->object->append_client_listing($this->declarant,array());
+ $result = $this->object->domdoc->saveXML();
+ $this->assertEquals($this->result, $result);
+ }
+
+ /**
+ * @covers Intervat::append_declarant
+ * @todo Implement testAppend_declarant().
+ */
+ public function testAppend_declarant()
+ {
+ $this->object->append_root();
+ $this->object->append_representative($this->representative);
+ $this->object->append_client_listing($this->declarant,array());
+ $result = $this->object->domdoc->saveXML();
+ $this->assertEquals($this->result, $result);
+ }
+
+
+}
---
PhpCompta est un logiciel de comptabilité libre en ligne (full web)
Projet opensource http://www.phpcompta.eu
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpcompta-dev] r673 - in trunk/transform: . include include/template unit-test,
phpcompta-dev <=