update
This commit is contained in:
@ -11,8 +11,8 @@ export abstract class UBLBaseDecoder extends BaseDecoder {
|
||||
protected namespaces: Record<string, string>;
|
||||
protected select: xpath.XPathSelect;
|
||||
|
||||
constructor(xml: string) {
|
||||
super(xml);
|
||||
constructor(xml: string, skipValidation: boolean = false) {
|
||||
super(xml, skipValidation);
|
||||
|
||||
// Parse XML document
|
||||
this.doc = new DOMParser().parseFromString(xml, 'application/xml');
|
||||
|
@ -247,8 +247,10 @@ export class XRechnungDecoder extends UBLBaseDecoder {
|
||||
}
|
||||
};
|
||||
|
||||
// Validate mandatory EN16931 fields
|
||||
EN16931Validator.validateMandatoryFields(invoiceData);
|
||||
// Validate mandatory EN16931 fields unless validation is skipped
|
||||
if (!this.skipValidation) {
|
||||
EN16931Validator.validateMandatoryFields(invoiceData);
|
||||
}
|
||||
|
||||
return invoiceData;
|
||||
} catch (error) {
|
||||
|
Reference in New Issue
Block a user