UNPKG

@weiliang79/ubl-builder

Version:

Tool to create xml documents with UBL 2.1 standard

60 lines 3.26 kB
"use strict"; // 'use strict' var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.PartyTaxScheme = void 0; const GenericAggregateComponent_1 = __importDefault(require("./GenericAggregateComponent")); const UnqualifiedDataTypes_1 = require("../types/UnqualifiedDataTypes"); const AddressTypeGroup_1 = require("./AddressTypeGroup"); const TaxScheme_1 = require("./TaxScheme"); // const GenericAggregateComponent = require("./GenericAggregateComponent"); // /* TODO GANERIC CLASSES */ // const { UdtCode, UdtIdentifier, UdtDate, UdtText, UdtTime, UdtName } = require("../types/UnqualifiedDataTypes"); // const { RegistrationAddress } = require("./AddressTypeGroup"); // const { TaxScheme, TaxSchemeParams } = require("./TaxScheme"); /* TODO GANERIC CLASSES */ /* http://www.datypic.com/sc/ubl21/t-cac_PartyTaxSchemeType.html 1. cbc:RegistrationName [0..1] The name of the party as registered with the relevant fiscal authority. 2. cbc:CompanyID [0..1] An identifier for the party assigned for tax purposes by the taxation authority. 3. cbc:TaxLevelCode [0..1] A code signifying the tax level applicable to the party within this taxation scheme. 4. cbc:ExemptionReasonCode [0..1] A reason for the party's exemption from tax, expressed as a code. 5. cbc:ExemptionReason [0..*] A reason for the party's exemption from tax, expressed as text. 6. cac:RegistrationAddress [0..1] The address of the party as registered for tax purposes. 7. cac:TaxScheme [1..1] The taxation scheme applicable to the party. */ const ParamsMap = { registrationName: { order: 1, attributeName: 'cbc:RegistrationName', min: 0, max: 1, classRef: UnqualifiedDataTypes_1.UdtName }, companyID: { order: 2, attributeName: 'cbc:CompanyID', min: 0, max: 1, classRef: UnqualifiedDataTypes_1.UdtIdentifier }, taxLevelCode: { order: 3, attributeName: 'cbc:TaxLevelCode', min: 0, max: 1, classRef: UnqualifiedDataTypes_1.UdtCode }, exemptionReasonCode: { order: 4, attributeName: 'cbc:ExemptionReasonCode', min: 0, max: 1, classRef: UnqualifiedDataTypes_1.UdtCode }, exemptionReason: { order: 5, attributeName: 'cbc:ExemptionReason', min: 0, max: undefined, classRef: UnqualifiedDataTypes_1.UdtText }, registrationAddress: { order: 6, attributeName: 'cac:RegistrationAddress', min: 0, max: 1, classRef: AddressTypeGroup_1.RegistrationAddress, }, taxScheme: { order: 7, attributeName: 'cac:TaxScheme', min: 1, max: 1, classRef: TaxScheme_1.TaxScheme }, }; /** * A class to describe a taxation scheme applying to a party. * More info http://www.datypic.com/sc/ubl21/t-cac_PartyTaxSchemeType.html */ class PartyTaxScheme extends GenericAggregateComponent_1.default { constructor(content) { super(content, ParamsMap, 'cac:PartyTaxScheme'); } /** * * @param {boolean} [raw=true] raw value */ getCompanyID(raw = true) { return raw ? this.attributes.companyID.content : this.attributes.companyID; } } exports.PartyTaxScheme = PartyTaxScheme; //# sourceMappingURL=PartyTaxScheme.js.map