@dangl/avacloud-client-node 1.63.3-avacloud-preview → 1.63.4-avacloud-preview
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api.d.ts +76 -0
- package/api.js +114 -1
- package/api.js.map +1 -1
- package/api.ts +180 -0
- package/package.json +1 -1
package/api.ts
CHANGED
|
@@ -12353,6 +12353,9 @@ Single line items in the invoice */
|
|
|
12353
12353
|
lineItems?: InvoiceLineItem[] | undefined;
|
|
12354
12354
|
/** The source type from which the invoice was created */
|
|
12355
12355
|
sourceType!: SourceType;
|
|
12356
|
+
/** In case the original invoice document was in Factur-X / ZUGFeRD format, this property can hold
|
|
12357
|
+
additional Factur-X specific data that is not part of the XRechnung specification */
|
|
12358
|
+
facturXData?: FacturXData | undefined;
|
|
12356
12359
|
|
|
12357
12360
|
constructor(data?: IInvoice) {
|
|
12358
12361
|
if (data) {
|
|
@@ -12425,6 +12428,7 @@ Single line items in the invoice */
|
|
|
12425
12428
|
this.lineItems[i] = item && !(<any>item).toJSON ? new InvoiceLineItem(item) : <InvoiceLineItem>item;
|
|
12426
12429
|
}
|
|
12427
12430
|
}
|
|
12431
|
+
this.facturXData = data.facturXData && !(<any>data.facturXData).toJSON ? new FacturXData(data.facturXData) : <FacturXData>this.facturXData;
|
|
12428
12432
|
}
|
|
12429
12433
|
}
|
|
12430
12434
|
|
|
@@ -12486,6 +12490,7 @@ Single line items in the invoice */
|
|
|
12486
12490
|
this.lineItems!.push(InvoiceLineItem.fromJS(item));
|
|
12487
12491
|
}
|
|
12488
12492
|
this.sourceType = _data["sourceType"];
|
|
12493
|
+
this.facturXData = _data["facturXData"] ? FacturXData.fromJS(_data["facturXData"]) : <any>undefined;
|
|
12489
12494
|
}
|
|
12490
12495
|
}
|
|
12491
12496
|
|
|
@@ -12658,6 +12663,15 @@ Single line items in the invoice */
|
|
|
12658
12663
|
}
|
|
12659
12664
|
}
|
|
12660
12665
|
data["sourceType"] = this.sourceType;
|
|
12666
|
+
if (this.facturXData) {
|
|
12667
|
+
if (typeof this.facturXData.toJSON !== "undefined") {
|
|
12668
|
+
data["facturXData"] = this.facturXData.toJSON();
|
|
12669
|
+
} else {
|
|
12670
|
+
data["facturXData"] = this.facturXData;
|
|
12671
|
+
}
|
|
12672
|
+
} else {
|
|
12673
|
+
data["facturXData"] = <any>undefined;
|
|
12674
|
+
}
|
|
12661
12675
|
return data;
|
|
12662
12676
|
}
|
|
12663
12677
|
}
|
|
@@ -12736,6 +12750,9 @@ Single line items in the invoice */
|
|
|
12736
12750
|
lineItems?: IInvoiceLineItem[] | undefined;
|
|
12737
12751
|
/** The source type from which the invoice was created */
|
|
12738
12752
|
sourceType: SourceType;
|
|
12753
|
+
/** In case the original invoice document was in Factur-X / ZUGFeRD format, this property can hold
|
|
12754
|
+
additional Factur-X specific data that is not part of the XRechnung specification */
|
|
12755
|
+
facturXData?: IFacturXData | undefined;
|
|
12739
12756
|
}
|
|
12740
12757
|
|
|
12741
12758
|
/** Type of the invoice */
|
|
@@ -14174,6 +14191,7 @@ export enum PaymentType {
|
|
|
14174
14191
|
JPElectronicallyRecordedMonetaryClaims = "JPElectronicallyRecordedMonetaryClaims",
|
|
14175
14192
|
}
|
|
14176
14193
|
|
|
14194
|
+
/** BG-16, BG-17 & BG-18 Represents a payment means for an invoice */
|
|
14177
14195
|
export class PaymentMeans implements IPaymentMeans {
|
|
14178
14196
|
/** BT-84
|
|
14179
14197
|
This is typically the IBAN or account number
|
|
@@ -14260,6 +14278,7 @@ https://github.com/itplr-kosit/validator-configuration-xrechnung/issues/53 */
|
|
|
14260
14278
|
}
|
|
14261
14279
|
}
|
|
14262
14280
|
|
|
14281
|
+
/** BG-16, BG-17 & BG-18 Represents a payment means for an invoice */
|
|
14263
14282
|
export interface IPaymentMeans {
|
|
14264
14283
|
/** BT-84
|
|
14265
14284
|
This is typically the IBAN or account number
|
|
@@ -15780,6 +15799,167 @@ export enum SourceType {
|
|
|
15780
15799
|
FacturX = "FacturX",
|
|
15781
15800
|
}
|
|
15782
15801
|
|
|
15802
|
+
/** Represents data related to Factur-X, including additional payment terms. */
|
|
15803
|
+
export class FacturXData implements IFacturXData {
|
|
15804
|
+
/** The field BT-20 in XRechnung can only hold one payment term, but Factur-X / ZUGFeRD
|
|
15805
|
+
allows multiple payment terms. If the invoice was originally created in Factur-X / ZUGFeRD format,
|
|
15806
|
+
then this property holds all additional payment terms except the first one. Similar,
|
|
15807
|
+
on export, this property is used to export additional payment terms to Factur-X / ZUGFeRD. */
|
|
15808
|
+
additionalPaymentTerms?: string[] | undefined;
|
|
15809
|
+
/** Factur-X / ZUGFeRD allows a more detailled representation of payment discount terms. */
|
|
15810
|
+
facturXPaymentDiscountTerms?: FacturXPaymentDiscountTerm[] | undefined;
|
|
15811
|
+
|
|
15812
|
+
constructor(data?: IFacturXData) {
|
|
15813
|
+
if (data) {
|
|
15814
|
+
for (var property in data) {
|
|
15815
|
+
if (data.hasOwnProperty(property))
|
|
15816
|
+
(<any>this)[property] = (<any>data)[property];
|
|
15817
|
+
}
|
|
15818
|
+
if (data.facturXPaymentDiscountTerms) {
|
|
15819
|
+
this.facturXPaymentDiscountTerms = [];
|
|
15820
|
+
for (let i = 0; i < data.facturXPaymentDiscountTerms.length; i++) {
|
|
15821
|
+
let item = data.facturXPaymentDiscountTerms[i];
|
|
15822
|
+
this.facturXPaymentDiscountTerms[i] = item && !(<any>item).toJSON ? new FacturXPaymentDiscountTerm(item) : <FacturXPaymentDiscountTerm>item;
|
|
15823
|
+
}
|
|
15824
|
+
}
|
|
15825
|
+
}
|
|
15826
|
+
}
|
|
15827
|
+
|
|
15828
|
+
init?(_data?: any) {
|
|
15829
|
+
if (_data) {
|
|
15830
|
+
if (Array.isArray(_data["additionalPaymentTerms"])) {
|
|
15831
|
+
this.additionalPaymentTerms = [] as any;
|
|
15832
|
+
for (let item of _data["additionalPaymentTerms"])
|
|
15833
|
+
this.additionalPaymentTerms!.push(item);
|
|
15834
|
+
}
|
|
15835
|
+
if (Array.isArray(_data["facturXPaymentDiscountTerms"])) {
|
|
15836
|
+
this.facturXPaymentDiscountTerms = [] as any;
|
|
15837
|
+
for (let item of _data["facturXPaymentDiscountTerms"])
|
|
15838
|
+
this.facturXPaymentDiscountTerms!.push(FacturXPaymentDiscountTerm.fromJS(item));
|
|
15839
|
+
}
|
|
15840
|
+
}
|
|
15841
|
+
}
|
|
15842
|
+
|
|
15843
|
+
static fromJS(data: any): FacturXData {
|
|
15844
|
+
data = typeof data === 'object' ? data : {};
|
|
15845
|
+
let result = new FacturXData();
|
|
15846
|
+
result.init!(data);
|
|
15847
|
+
return result;
|
|
15848
|
+
}
|
|
15849
|
+
|
|
15850
|
+
toJSON?(data?: any) {
|
|
15851
|
+
data = typeof data === 'object' ? data : {};
|
|
15852
|
+
if (Array.isArray(this.additionalPaymentTerms)) {
|
|
15853
|
+
data["additionalPaymentTerms"] = [];
|
|
15854
|
+
for (let item of this.additionalPaymentTerms)
|
|
15855
|
+
data["additionalPaymentTerms"].push(item);
|
|
15856
|
+
}
|
|
15857
|
+
if (Array.isArray(this.facturXPaymentDiscountTerms)) {
|
|
15858
|
+
data["facturXPaymentDiscountTerms"] = [];
|
|
15859
|
+
for (let item of this.facturXPaymentDiscountTerms)
|
|
15860
|
+
if (typeof item.toJSON !== "undefined") {
|
|
15861
|
+
data["facturXPaymentDiscountTerms"].push(item.toJSON());
|
|
15862
|
+
} else {
|
|
15863
|
+
data["facturXPaymentDiscountTerms"].push(item);
|
|
15864
|
+
}
|
|
15865
|
+
}
|
|
15866
|
+
return data;
|
|
15867
|
+
}
|
|
15868
|
+
}
|
|
15869
|
+
|
|
15870
|
+
/** Represents data related to Factur-X, including additional payment terms. */
|
|
15871
|
+
export interface IFacturXData {
|
|
15872
|
+
/** The field BT-20 in XRechnung can only hold one payment term, but Factur-X / ZUGFeRD
|
|
15873
|
+
allows multiple payment terms. If the invoice was originally created in Factur-X / ZUGFeRD format,
|
|
15874
|
+
then this property holds all additional payment terms except the first one. Similar,
|
|
15875
|
+
on export, this property is used to export additional payment terms to Factur-X / ZUGFeRD. */
|
|
15876
|
+
additionalPaymentTerms?: string[] | undefined;
|
|
15877
|
+
/** Factur-X / ZUGFeRD allows a more detailled representation of payment discount terms. */
|
|
15878
|
+
facturXPaymentDiscountTerms?: IFacturXPaymentDiscountTerm[] | undefined;
|
|
15879
|
+
}
|
|
15880
|
+
|
|
15881
|
+
/** Factur-X / ZUGFeRD allows a more detailled representation of payment discount terms. If those are present in the invoice, they will be stored in this object. */
|
|
15882
|
+
export class FacturXPaymentDiscountTerm implements IFacturXPaymentDiscountTerm {
|
|
15883
|
+
/** Such payment terms are usually an additional, machine-readable representation of a given payment term,
|
|
15884
|
+
so they usually are linked to a specific payment term by its index. Please note that the index is 0-based,
|
|
15885
|
+
so the first payment term will refer PaymentTerms, subsequent ones
|
|
15886
|
+
will refer to AdditionalPaymentTerms. */
|
|
15887
|
+
index?: number | undefined;
|
|
15888
|
+
/** The base amount unto which the discount applies. */
|
|
15889
|
+
baseAmount?: number | undefined;
|
|
15890
|
+
/** The actual discount amount that will be deducted if the payment is done within the specified period. */
|
|
15891
|
+
actualDiscountAmount?: number | undefined;
|
|
15892
|
+
/** The base date for calculating the discount period. This is typically the invoice date. */
|
|
15893
|
+
baseDate?: Date | undefined;
|
|
15894
|
+
/** The duration of the discount period, e.g. "30" for 30 days. */
|
|
15895
|
+
periodMeasure?: number | undefined;
|
|
15896
|
+
/** The unit in which the period is specified, e.g. "DAY". */
|
|
15897
|
+
periodMeasureUnitCode?: string | undefined;
|
|
15898
|
+
/** The percentage of the discount, e.g. ".02" for 2%. */
|
|
15899
|
+
calculationPercent?: number | undefined;
|
|
15900
|
+
|
|
15901
|
+
constructor(data?: IFacturXPaymentDiscountTerm) {
|
|
15902
|
+
if (data) {
|
|
15903
|
+
for (var property in data) {
|
|
15904
|
+
if (data.hasOwnProperty(property))
|
|
15905
|
+
(<any>this)[property] = (<any>data)[property];
|
|
15906
|
+
}
|
|
15907
|
+
}
|
|
15908
|
+
}
|
|
15909
|
+
|
|
15910
|
+
init?(_data?: any) {
|
|
15911
|
+
if (_data) {
|
|
15912
|
+
this.index = _data["index"];
|
|
15913
|
+
this.baseAmount = _data["baseAmount"];
|
|
15914
|
+
this.actualDiscountAmount = _data["actualDiscountAmount"];
|
|
15915
|
+
this.baseDate = _data["baseDate"] ? new Date(_data["baseDate"].toString()) : <any>undefined;
|
|
15916
|
+
this.periodMeasure = _data["periodMeasure"];
|
|
15917
|
+
this.periodMeasureUnitCode = _data["periodMeasureUnitCode"];
|
|
15918
|
+
this.calculationPercent = _data["calculationPercent"];
|
|
15919
|
+
}
|
|
15920
|
+
}
|
|
15921
|
+
|
|
15922
|
+
static fromJS(data: any): FacturXPaymentDiscountTerm {
|
|
15923
|
+
data = typeof data === 'object' ? data : {};
|
|
15924
|
+
let result = new FacturXPaymentDiscountTerm();
|
|
15925
|
+
result.init!(data);
|
|
15926
|
+
return result;
|
|
15927
|
+
}
|
|
15928
|
+
|
|
15929
|
+
toJSON?(data?: any) {
|
|
15930
|
+
data = typeof data === 'object' ? data : {};
|
|
15931
|
+
data["index"] = this.index;
|
|
15932
|
+
data["baseAmount"] = this.baseAmount;
|
|
15933
|
+
data["actualDiscountAmount"] = this.actualDiscountAmount;
|
|
15934
|
+
data["baseDate"] = this.baseDate ? this.baseDate.toISOString() : <any>undefined;
|
|
15935
|
+
data["periodMeasure"] = this.periodMeasure;
|
|
15936
|
+
data["periodMeasureUnitCode"] = this.periodMeasureUnitCode;
|
|
15937
|
+
data["calculationPercent"] = this.calculationPercent;
|
|
15938
|
+
return data;
|
|
15939
|
+
}
|
|
15940
|
+
}
|
|
15941
|
+
|
|
15942
|
+
/** Factur-X / ZUGFeRD allows a more detailled representation of payment discount terms. If those are present in the invoice, they will be stored in this object. */
|
|
15943
|
+
export interface IFacturXPaymentDiscountTerm {
|
|
15944
|
+
/** Such payment terms are usually an additional, machine-readable representation of a given payment term,
|
|
15945
|
+
so they usually are linked to a specific payment term by its index. Please note that the index is 0-based,
|
|
15946
|
+
so the first payment term will refer PaymentTerms, subsequent ones
|
|
15947
|
+
will refer to AdditionalPaymentTerms. */
|
|
15948
|
+
index?: number | undefined;
|
|
15949
|
+
/** The base amount unto which the discount applies. */
|
|
15950
|
+
baseAmount?: number | undefined;
|
|
15951
|
+
/** The actual discount amount that will be deducted if the payment is done within the specified period. */
|
|
15952
|
+
actualDiscountAmount?: number | undefined;
|
|
15953
|
+
/** The base date for calculating the discount period. This is typically the invoice date. */
|
|
15954
|
+
baseDate?: Date | undefined;
|
|
15955
|
+
/** The duration of the discount period, e.g. "30" for 30 days. */
|
|
15956
|
+
periodMeasure?: number | undefined;
|
|
15957
|
+
/** The unit in which the period is specified, e.g. "DAY". */
|
|
15958
|
+
periodMeasureUnitCode?: string | undefined;
|
|
15959
|
+
/** The percentage of the discount, e.g. ".02" for 2%. */
|
|
15960
|
+
calculationPercent?: number | undefined;
|
|
15961
|
+
}
|
|
15962
|
+
|
|
15783
15963
|
/** This is a wrapper class that maps Dangl.AVA projects along with additional required information to create invoices */
|
|
15784
15964
|
export class AvaProjectWrapper implements IAvaProjectWrapper {
|
|
15785
15965
|
/** The Dangl.AVA.Project from which to convert */
|