Comments (6)
Hmmm self update, Solution 1 can't be used ! so i start to test all get returns before accessing to supposed values ...
from einvoicing.
Hello @rycks,
UXML is a different library, UXML::get()
must return null
if no element is found as per the specification. So yeah, that cannot be changed.
The PR you propose isn't possible either as none of the values you've changed can be null
(eInvoicing expects them to be non empty). Probably adding a few null
checks and throwing an InvalidArgumentException
is the best approach here given it will comply with the current documentation, which would be ideal for backward compatibility.
Will that fit your use case? I'm assuming you're parsing an XML document that doesn't comply with the UBL PEPPOL specs. Or is it a valid invoice using a CIUS that overrides PEPPOL in weird ways?
from einvoicing.
you are right, is that a peppol invoice ?
<?xml version="1.0" encoding="UTF-8"?>
<Invoice xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDataty
pes-2" xmlns:ccts="urn:oasis:names:specification:ubl:schema:xsd:CoreComponentPar
ameters-2" xmlns:stat="urn:oasis:names:specification:ubl:schema:xsd:DocumentStat
usCode-1.0" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicC
omponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggre
gateComponents-2" xmlns:udt="urn:un:unece:uncefact:data:draft:UnqualifiedDataTyp
esSchemaModule:2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
>
<cbc:UBLVersionID>2.0</cbc:UBLVersionID>
<cbc:CustomizationID>1.0</cbc:CustomizationID>
<cbc:ProfileID>FFF.BE ExactOnline</cbc:ProfileID>
<cbc:ID>20700108</cbc:ID>
<cbc:InvoiceTypeCode listURI="http://www.FFF.be/ubl/2.0/cl/gc/BE-InvoiceCode-1.0.gc">380</cbc:InvoiceTypeCode>
what could i do before open it with your peppol lib to check if it's a good peppol invoice ?
from einvoicing.
The UBL snippet you provided appears to have been generated by a software called Exact Online (not a valid EN 16931 invoice).
You can verify this by reading the <cbc:ProfileID />
field and making sure it starts with "urn:cen.eu:en16931:2017#compliant". For instance, PEPPOL BIS 3.0 invoices here have a value of "urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0".
I'm closing the issue now that this has been clarified.
from einvoicing.
Ok, thanks
but it could be good idea to make a early test in UXML no and get an error or exception in case of XML is not valid ?
from einvoicing.
Just added proper error handling to throw an InvalidArgumentException
when the XML document is invalid. You can test it by requiring the latest development version:
composer require josemmo/einvoicing:dev-develop
from einvoicing.
Related Issues (20)
- Support for BG-30 Line VAT information attributes schemID and schemeAgencyId (NLCIUS v1.0.3) HOT 6
- Question about BaseQuantity HOT 2
- Add support for TaxCurrencyCode (BT-6) HOT 3
- Add support for CompanyLegalForm (BT-33)
- Add support for multiple Invoice Notes (BG-1 -> BT-22)
- PartyTaxScheme xsd validation error with passing null as scheme
- Text for Payment Means (BT-82) is bugged? HOT 3
- decimal rounding number HOT 9
- Peppol compliance status and messaging extension HOT 3
- Invoice rounding problem HOT 5
- Missing fields HOT 2
- CreditNote support HOT 2
- How to add tag SupplierAssignedAccountID HOT 4
- XML validator when there is allowance on lines HOT 2
- How to add the informations payment HOT 1
- Negative PayableRoundingAmount HOT 1
- Add seller iban and bank name HOT 1
- Edge case using VAT HOT 4
- Division by zero for $invoice->getTotals()->taxInclusiveAmount HOT 5
- Support for Purchase Orders (EN16931 UBL Peppol BIS Ordering)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from einvoicing.