You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The example usage code given in the readme seems not to work.
I tried with a simplified version of it, in order to just generate XML :
<?phprequire'vendor/autoload.php';
$invoice = new \Kinulab\Facturx\CrossIndustryInvoice\CrossIndustryInvoice(
\Kinulab\Facturx\CrossIndustryInvoice\CrossIndustryInvoice::PROFILE_MINIMUM
);
$invoice->setInvoiceNumber("FC123456789");
$invoice->setInvoiceType(Kinulab\Facturx\CrossIndustryInvoice\CrossIndustryInvoice::INVOICE_TYPE_COMMERCIAL_INVOICE);
$invoice->setPaymentInstruction(null);
$invoice->setPaymentMeansCode(0);
$invoice->setIssueDate( new \DateTime('today') );
$invoice->setDueDate( (new \DateTime('today'))->modify('+30 days') );
$invoice->setSeller( new \Kinulab\Facturx\CrossIndustryInvoice\LegalEntity() );
$invoice->setBuyer( new \Kinulab\Facturx\CrossIndustryInvoice\LegalEntity() );
$invoice->setCurrencyCode('EUR');
$invoice->setTaxBasisTotalAmount(100);
$invoice->setTaxTotalAmount(5.61);
$invoice->setGrandTotalAmount( 105.61 );
$invoice->setDuePayableAmount( 105.61 );
$seller = $invoice->getSeller();
$seller->setName('My Company Name');
$seller->setSiret('XXXXXX');
$seller->setVatIdentifier( 'XXXXX');
$seller->setAddress( new \Kinulab\Facturx\CrossIndustryInvoice\Address() );
$sellerAddress = $seller->getAddress();
$sellerAddress->setCountryId('FR');
$buyer = $invoice->getBuyer();
$buyer->setName('The Client');
$buyer->setVatIdentifier("ABC123");
echo \Kinulab\Facturx\CrossIndustryInvoice\XmlWriter::write($invoice);
I get the fatal error Typed property Kinulab\Facturx\CrossIndustryInvoice\CrossIndustryInvoice::$paymentInstruction must not be accessed before initialization in (...)/vendor/kinulab/facturx/src/CrossIndustryInvoice/CrossIndustryInvoice.php:470
If I add $invoice->setPaymentInstruction(null); I get Typed property Kinulab\Facturx\CrossIndustryInvoice\CrossIndustryInvoice::$paymentMeansCode must not be accessed before initialization in (...)/vendor/kinulab/facturx/src/CrossIndustryInvoice/CrossIndustryInvoice.php:210
And finally if I add $invoice->setPaymentMeansCode(0); I get :
<br />
<b>Fatal error</b>: Uncaught Exception: The MINIMUM XML file is not valid against the official
XML Schema Definition : Exception: MINIMUM XML file invalid schema : XML error "Element '{urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100}PayeeTradeParty': This element is not expected. Expected is ( {urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100}SpecifiedTradeSettlementHeaderMonetarySummation ).
"
in /var/www/html/vendor/atgp/factur-x/src/Facturx.php:162
Stack trace:
#0 /var/www/html/vendor/kinulab/facturx/src/CrossIndustryInvoice/XmlWriter.php(34): Atgp\FacturX\Facturx->checkFacturxXsd('<?xml version="...')
#1 /var/www/html/xml.php(72): Kinulab\Facturx\CrossIndustryInvoice\XmlWriter::write(Object(Kinulab\Facturx\CrossIndustryInvoice\CrossIndustryInvoice))
#2 {main}. in /var/www/html/vendor/atgp/factur-x/src/Facturx.php:165
Stack trace:
#0 /var/www/html/vendor/kinulab/facturx/src/CrossIndustryInvoice/XmlWriter.php(34): Atgp\FacturX\Facturx->checkFacturxXsd('<?xml version="...')
#1 /var/www/html/xml.php(72): Kinulab\Facturx\CrossIndustryInvoice\XmlWriter::write(Object(Kinulab\Facturx\CrossIndustryInvoice\CrossIndustryInvoice))
#2 {main}
thrown in <b>/var/www/html/vendor/atgp/factur-x/src/Facturx.php</b> on line <b>165</b><br />
I haven't managed to generate a minimal XML example yet :(
The text was updated successfully, but these errors were encountered:
Hi,
The example usage code given in the readme seems not to work.
I tried with a simplified version of it, in order to just generate XML :
I get the fatal error
Typed property Kinulab\Facturx\CrossIndustryInvoice\CrossIndustryInvoice::$paymentInstruction must not be accessed before initialization in (...)/vendor/kinulab/facturx/src/CrossIndustryInvoice/CrossIndustryInvoice.php:470
If I add
$invoice->setPaymentInstruction(null);
I getTyped property Kinulab\Facturx\CrossIndustryInvoice\CrossIndustryInvoice::$paymentMeansCode must not be accessed before initialization in (...)/vendor/kinulab/facturx/src/CrossIndustryInvoice/CrossIndustryInvoice.php:210
And finally if I add
$invoice->setPaymentMeansCode(0);
I get :I haven't managed to generate a minimal XML example yet :(
The text was updated successfully, but these errors were encountered: