repzo-sap-absjo 1.0.37 → 1.0.38

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.
@@ -256,6 +256,23 @@ export const sync_client = async (commandEvent) => {
256
256
  if (is_matched(body, repzo_original_doc)) {
257
257
  continue;
258
258
  }
259
+ if (
260
+ body.hasOwnProperty("integrated_client_balance") &&
261
+ body.integrated_client_balance !=
262
+ repzo_original_doc.integrated_client_balance
263
+ ) {
264
+ // inject all children to update their balance
265
+ const client_children = sap_all_clients.filter(
266
+ (c) => c.PARENTCODE == sap_client.CLIENTID
267
+ );
268
+ if (sap_clients.length) {
269
+ sap_clients.push(
270
+ ...client_children.filter(
271
+ (c) => !sap_clients.find((sc) => sc.CLIENTID == c.CLIENTID)
272
+ )
273
+ );
274
+ }
275
+ }
259
276
  // Update
260
277
  try {
261
278
  const updated_client = await repzo.client.update(
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.37",
4
+ "version": "1.0.38",
5
5
  "homepage": "",
6
6
  "keywords": [],
7
7
  "author": {
@@ -244,6 +244,25 @@ export const sync_client = async (commandEvent: CommandEvent) => {
244
244
  if (is_matched(body, repzo_original_doc)) {
245
245
  continue;
246
246
  }
247
+
248
+ if (
249
+ body.hasOwnProperty("integrated_client_balance") &&
250
+ body.integrated_client_balance !=
251
+ repzo_original_doc.integrated_client_balance
252
+ ) {
253
+ // inject all children to update their balance
254
+ const client_children = sap_all_clients.filter(
255
+ (c) => c.PARENTCODE == sap_client.CLIENTID
256
+ );
257
+ if (sap_clients.length) {
258
+ sap_clients.push(
259
+ ...client_children.filter(
260
+ (c) => !sap_clients.find((sc) => sc.CLIENTID == c.CLIENTID)
261
+ )
262
+ );
263
+ }
264
+ }
265
+
247
266
  // Update
248
267
  try {
249
268
  const updated_client = await repzo.client.update(