repzo-sap-absjo 1.0.20 → 1.0.22
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/changelog.md +1 -0
- package/lib/actions/create_invoice.d.ts +19 -13
- package/lib/actions/create_invoice.js +359 -210
- package/lib/actions/create_payment.d.ts +4 -1
- package/lib/actions/create_payment.js +195 -107
- package/lib/actions/create_proforma.d.ts +4 -1
- package/lib/actions/create_proforma.js +288 -147
- package/lib/actions/create_return_invoice.d.ts +4 -1
- package/lib/actions/create_return_invoice.js +312 -158
- package/lib/actions/create_transfer.d.ts +4 -1
- package/lib/actions/create_transfer.js +223 -126
- package/lib/actions/index.js +23 -15
- package/lib/commands/adjust_inventory.d.ts +4 -2
- package/lib/commands/adjust_inventory.js +290 -160
- package/lib/commands/bank.d.ts +4 -2
- package/lib/commands/bank.js +279 -157
- package/lib/commands/basic.js +68 -48
- package/lib/commands/brand.d.ts +3 -1
- package/lib/commands/brand.js +174 -100
- package/lib/commands/category.d.ts +3 -1
- package/lib/commands/category.js +178 -104
- package/lib/commands/channel.d.ts +3 -1
- package/lib/commands/channel.js +198 -117
- package/lib/commands/client.d.ts +34 -32
- package/lib/commands/client.js +404 -244
- package/lib/commands/client_disabled.d.ts +3 -1
- package/lib/commands/client_disabled.js +163 -94
- package/lib/commands/index.d.ts +24 -11
- package/lib/commands/index.js +65 -62
- package/lib/commands/join.js +192 -66
- package/lib/commands/measureunit.d.ts +19 -14
- package/lib/commands/measureunit.js +289 -191
- package/lib/commands/measureunit_family.d.ts +10 -8
- package/lib/commands/measureunit_family.js +250 -138
- package/lib/commands/payment_term.d.ts +3 -1
- package/lib/commands/payment_term.js +202 -123
- package/lib/commands/price_list.d.ts +15 -15
- package/lib/commands/price_list.js +617 -326
- package/lib/commands/price_list_disabled.d.ts +12 -0
- package/lib/commands/price_list_disabled.js +216 -0
- package/lib/commands/product.d.ts +32 -30
- package/lib/commands/product.js +485 -263
- package/lib/commands/product_disabled.d.ts +3 -1
- package/lib/commands/product_disabled.js +160 -94
- package/lib/commands/rep.js +221 -141
- package/lib/commands/tag.js +174 -109
- package/lib/commands/tax.js +177 -112
- package/lib/commands/warehouse.d.ts +3 -1
- package/lib/commands/warehouse.js +207 -119
- package/lib/index.d.ts +30 -12
- package/lib/test/actions/create_invoice.js +193 -188
- package/lib/test/actions/create_payment.js +112 -107
- package/lib/test/actions/create_proforma.js +220 -216
- package/lib/test/actions/create_return_invoice.js +205 -200
- package/lib/test/actions/create_transfer.js +120 -115
- package/lib/test/commands/adjust_inventory.js +90 -90
- package/lib/test/commands/bank.js +90 -90
- package/lib/test/commands/basic.js +335 -327
- package/lib/test/commands/brand.js +90 -90
- package/lib/test/commands/category.js +90 -90
- package/lib/test/commands/channel.js +90 -90
- package/lib/test/commands/client.js +355 -353
- package/lib/test/commands/client_disabled.js +90 -90
- package/lib/test/commands/join.js +328 -327
- package/lib/test/commands/measureunit.js +90 -90
- package/lib/test/commands/measureunit_family.js +90 -90
- package/lib/test/commands/payment_term.js +90 -90
- package/lib/test/commands/price_list.js +337 -334
- package/lib/test/commands/price_list_disabled.d.ts +1 -0
- package/lib/test/commands/price_list_disabled.js +359 -0
- package/lib/test/commands/product.js +90 -90
- package/lib/test/commands/product_disabled.js +90 -90
- package/lib/test/commands/rep.js +346 -344
- package/lib/test/commands/tag.js +90 -90
- package/lib/test/commands/tax.js +90 -90
- package/lib/test/commands/warehouse.js +90 -90
- package/lib/types.d.ts +78 -53
- package/lib/util.d.ts +76 -19
- package/lib/util.js +179 -144
- package/package.json +1 -1
- package/src/actions/create_invoice.ts +7 -18
- package/src/actions/create_proforma.ts +11 -1
- package/src/commands/basic.ts +1 -0
- package/src/commands/index.ts +3 -0
- package/src/commands/price_list.ts +7 -2
- package/src/commands/price_list_disabled.ts +194 -0
- package/src/test/commands/basic.ts +7 -0
- package/src/test/commands/price_list_disabled.ts +362 -0
- package/src/types.ts +1 -0
- package/src/util.ts +18 -1
package/src/util.ts
CHANGED
|
@@ -2,7 +2,7 @@ import axios from "axios";
|
|
|
2
2
|
import Repzo from "repzo";
|
|
3
3
|
import moment from "moment-timezone";
|
|
4
4
|
import { CommandType } from "./types";
|
|
5
|
-
|
|
5
|
+
import { Service } from "repzo/src/types";
|
|
6
6
|
interface Params {
|
|
7
7
|
[key: string]: any;
|
|
8
8
|
}
|
|
@@ -241,3 +241,20 @@ export const send_command_to_marketplace = async ({
|
|
|
241
241
|
throw e;
|
|
242
242
|
}
|
|
243
243
|
};
|
|
244
|
+
|
|
245
|
+
export const getUniqueConcatenatedValues = function (
|
|
246
|
+
item: Service.Item.Schema,
|
|
247
|
+
key: "name" | "ref",
|
|
248
|
+
delimiter: string
|
|
249
|
+
): string {
|
|
250
|
+
item.general_promotions = item.general_promotions || [];
|
|
251
|
+
item.used_promotions = item.used_promotions || [];
|
|
252
|
+
const allPromotions: { name: string; ref?: string; [key: string]: any }[] = [
|
|
253
|
+
...item.general_promotions,
|
|
254
|
+
...item.used_promotions,
|
|
255
|
+
];
|
|
256
|
+
const uniqueValues = new Set(
|
|
257
|
+
allPromotions.map((promotion) => promotion[key]).filter((value) => value)
|
|
258
|
+
);
|
|
259
|
+
return [...uniqueValues].join(delimiter);
|
|
260
|
+
};
|