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.
@@ -333,6 +333,7 @@ export const create_invoice = async (event, options) => {
333
333
  });
334
334
  }
335
335
  const sap_invoice = {
336
+ RepzoSerial: repzo_invoice.serial_number.formatted,
336
337
  RefNum:
337
338
  repzo_invoice.advanced_serial_number ||
338
339
  repzo_invoice.serial_number.formatted,
@@ -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: ${repzo_payment.LinkedTxn.Txn_serial_number.formatted} was not found on Repzo`;
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: ${repzo_payment.LinkedTxn.Txn_serial_number.formatted} was not found on SAP or was closed`;
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "repzo-sap-absjo",
3
3
  "description": "repzo SAP ABS jo integration",
4
- "version": "1.0.31",
4
+ "version": "1.0.32",
5
5
  "homepage": "",
6
6
  "keywords": [],
7
7
  "author": {
@@ -26,7 +26,8 @@ interface SAPInvoiceItem {
26
26
  }
27
27
 
28
28
  interface SAPInvoice {
29
- RefNum: string; // "INV-1021-4",
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: ${repzo_payment.LinkedTxn.Txn_serial_number.formatted} was not found on Repzo`;
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: ${repzo_payment.LinkedTxn.Txn_serial_number.formatted} was not found on SAP or was closed`;
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
- RefNum: string; // "INV-1021-4",
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,