repzo-sap-absjo 1.0.31 → 1.0.32
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/lib/actions/create_invoice.js +1 -0
- package/lib/actions/create_payment.js +2 -2
- package/lib/actions/create_return_invoice.js +1 -0
- package/package.json +1 -1
- package/src/actions/create_invoice.ts +3 -1
- package/src/actions/create_payment.ts +2 -2
- package/src/actions/create_return_invoice.ts +3 -1
|
@@ -124,7 +124,7 @@ export const create_payment = async (event, options) => {
|
|
|
124
124
|
);
|
|
125
125
|
});
|
|
126
126
|
if (!repzo_invoice) {
|
|
127
|
-
throw `Invoice with serial number: ${
|
|
127
|
+
throw `Invoice with serial number: ${repzo_inv_serial_number} was not found on Repzo`;
|
|
128
128
|
}
|
|
129
129
|
let sap_open_invoices = [];
|
|
130
130
|
if (repzo_invoice.advanced_serial_number) {
|
|
@@ -150,7 +150,7 @@ export const create_payment = async (event, options) => {
|
|
|
150
150
|
? void 0
|
|
151
151
|
: sap_open_invoices.length)
|
|
152
152
|
) {
|
|
153
|
-
throw `Invoice with serial number: ${
|
|
153
|
+
throw `Invoice with serial number: ${repzo_inv_serial_number} & advance serial number: ${repzo_invoice.advanced_serial_number} was not found on SAP or was closed`;
|
|
154
154
|
}
|
|
155
155
|
sap_payment.InvoiceID = sap_open_invoices[0].InvoiceID;
|
|
156
156
|
sap_payment.InvoiceTotal =
|
|
@@ -271,6 +271,7 @@ export const create_return_invoice = async (event, options) => {
|
|
|
271
271
|
});
|
|
272
272
|
}
|
|
273
273
|
const sap_return_invoice = {
|
|
274
|
+
RepzoSerial: repzo_invoice.serial_number.formatted,
|
|
274
275
|
RefNum:
|
|
275
276
|
repzo_invoice.advanced_serial_number ||
|
|
276
277
|
repzo_invoice.serial_number.formatted,
|
package/package.json
CHANGED
|
@@ -26,7 +26,8 @@ interface SAPInvoiceItem {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
interface SAPInvoice {
|
|
29
|
-
|
|
29
|
+
RepzoSerial: string; // serial_number.formatted: "INV-1021-4"
|
|
30
|
+
RefNum: string; // advanced_serial_number || serial_number.formatted: "INV-1021-4",
|
|
30
31
|
SalPersCode?: string; // "106", // Required
|
|
31
32
|
DocDate: string; // "20211229",
|
|
32
33
|
DocDueDate: string; // "20211229",
|
|
@@ -285,6 +286,7 @@ export const create_invoice = async (event: EVENT, options: Config) => {
|
|
|
285
286
|
}
|
|
286
287
|
|
|
287
288
|
const sap_invoice: SAPInvoice = {
|
|
289
|
+
RepzoSerial: repzo_invoice.serial_number.formatted,
|
|
288
290
|
RefNum:
|
|
289
291
|
repzo_invoice.advanced_serial_number ||
|
|
290
292
|
repzo_invoice.serial_number.formatted,
|
|
@@ -96,7 +96,7 @@ export const create_payment = async (event: EVENT, options: Config) => {
|
|
|
96
96
|
(inv) => inv.serial_number?.formatted == repzo_inv_serial_number
|
|
97
97
|
);
|
|
98
98
|
if (!repzo_invoice) {
|
|
99
|
-
throw `Invoice with serial number: ${
|
|
99
|
+
throw `Invoice with serial number: ${repzo_inv_serial_number} was not found on Repzo`;
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
let sap_open_invoices: SAPOpenInvoice[] = [];
|
|
@@ -115,7 +115,7 @@ export const create_payment = async (event: EVENT, options: Config) => {
|
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
117
|
if (!sap_open_invoices?.length) {
|
|
118
|
-
throw `Invoice with serial number: ${
|
|
118
|
+
throw `Invoice with serial number: ${repzo_inv_serial_number} & advance serial number: ${repzo_invoice.advanced_serial_number} was not found on SAP or was closed`;
|
|
119
119
|
}
|
|
120
120
|
sap_payment.InvoiceID = sap_open_invoices[0].InvoiceID;
|
|
121
121
|
sap_payment.InvoiceTotal =
|
|
@@ -19,7 +19,8 @@ interface SAPInvoiceItem {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
interface SAPInvoice {
|
|
22
|
-
|
|
22
|
+
RepzoSerial: string; // serial_number.formatted: "INV-1021-4"
|
|
23
|
+
RefNum: string; // advanced_serial_number || serial_number.formatted: "INV-1021-4",
|
|
23
24
|
SalPersCode?: string; // "106", // Required
|
|
24
25
|
DocDate: string; // "20211229",
|
|
25
26
|
DocDueDate: string; // "20211229",
|
|
@@ -208,6 +209,7 @@ export const create_return_invoice = async (event: EVENT, options: Config) => {
|
|
|
208
209
|
}
|
|
209
210
|
|
|
210
211
|
const sap_return_invoice: SAPInvoice = {
|
|
212
|
+
RepzoSerial: repzo_invoice.serial_number.formatted,
|
|
211
213
|
RefNum:
|
|
212
214
|
repzo_invoice.advanced_serial_number ||
|
|
213
215
|
repzo_invoice.serial_number.formatted,
|