repzo-sap-absjo 1.0.38 → 1.0.40
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_proforma.js +42 -3
- package/lib/commands/channel.js +17 -12
- package/lib/commands/client.js +29 -24
- package/lib/commands/client_disabled.js +15 -10
- package/lib/commands/measureunit_family.js +103 -30
- package/lib/commands/payment_term.js +17 -12
- package/lib/commands/price_list.js +65 -56
- package/lib/commands/product.js +63 -54
- package/lib/commands/product_disabled.js +13 -6
- package/lib/commands/rep.js +13 -5
- package/lib/commands/warehouse.js +25 -21
- package/lib/test/commands/test.d.ts +1 -0
- package/lib/test/commands/test.js +393 -0
- package/lib/types.d.ts +61 -1
- package/package.json +3 -3
- package/src/actions/create_proforma.ts +14 -1
- package/src/commands/channel.ts +2 -2
- package/src/commands/client.ts +2 -2
- package/src/commands/client_disabled.ts +2 -2
- package/src/commands/measureunit_family.ts +35 -1
- package/src/commands/payment_term.ts +2 -2
- package/src/commands/price_list.ts +2 -2
- package/src/commands/product.ts +2 -2
- package/src/commands/product_disabled.ts +2 -2
- package/src/commands/rep.ts +7 -1
- package/src/commands/warehouse.ts +2 -2
- package/src/test/commands/test.ts +396 -0
- package/src/types.ts +57 -1
|
@@ -28,6 +28,21 @@ export const sync_measureunit_family = async (commandEvent: CommandEvent) => {
|
|
|
28
28
|
try {
|
|
29
29
|
// console.log("sync_measureunit_family");
|
|
30
30
|
|
|
31
|
+
if (commandEvent.app.formData?.measureUnitInjections) {
|
|
32
|
+
try {
|
|
33
|
+
if (typeof commandEvent.app.formData?.measureUnitInjections == "string")
|
|
34
|
+
commandEvent.app.formData.measureUnitInjections = JSON.parse(
|
|
35
|
+
commandEvent.app.formData.measureUnitInjections
|
|
36
|
+
);
|
|
37
|
+
if (!Array.isArray(commandEvent.app.formData?.measureUnitInjections)) {
|
|
38
|
+
delete commandEvent.app.formData.measureUnitInjections;
|
|
39
|
+
}
|
|
40
|
+
} catch (e) {
|
|
41
|
+
console.error(e);
|
|
42
|
+
delete commandEvent.app.formData.measureUnitInjections;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
31
46
|
const new_bench_time = new Date().toISOString();
|
|
32
47
|
const bench_time_key = "bench_time_measureunit_family";
|
|
33
48
|
|
|
@@ -107,7 +122,7 @@ export const sync_measureunit_family = async (commandEvent: CommandEvent) => {
|
|
|
107
122
|
(r_family) => r_family.integration_meta?.id == `${nameSpace}_${key}`
|
|
108
123
|
);
|
|
109
124
|
|
|
110
|
-
|
|
125
|
+
const measureunits: string[] = [];
|
|
111
126
|
Object.keys(sap_family).forEach((unit) => {
|
|
112
127
|
{
|
|
113
128
|
const UoM = repzo_UoMs?.data?.find(
|
|
@@ -119,6 +134,25 @@ export const sync_measureunit_family = async (commandEvent: CommandEvent) => {
|
|
|
119
134
|
}
|
|
120
135
|
});
|
|
121
136
|
|
|
137
|
+
if (commandEvent.app.formData?.measureUnitInjections?.length) {
|
|
138
|
+
const related_uom_s =
|
|
139
|
+
commandEvent.app.formData.measureUnitInjections.filter(
|
|
140
|
+
(doc) => doc?.itemCode == key
|
|
141
|
+
);
|
|
142
|
+
related_uom_s.forEach((related_uom) => {
|
|
143
|
+
const UoM = repzo_UoMs?.data?.find(
|
|
144
|
+
(repzo_uom) =>
|
|
145
|
+
repzo_uom?.name == related_uom?.uom &&
|
|
146
|
+
repzo_uom?.integration_meta?.ITEMCODE == key
|
|
147
|
+
);
|
|
148
|
+
if (UoM) {
|
|
149
|
+
if (!measureunits.includes(UoM._id.toString())) {
|
|
150
|
+
measureunits.push(UoM._id.toString());
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
|
|
122
156
|
const body:
|
|
123
157
|
| Service.MeasureUnitFamily.Create.Body
|
|
124
158
|
| Service.MeasureUnitFamily.Update.Body = {
|
|
@@ -83,7 +83,7 @@ export const sync_payment_term = async (commandEvent: CommandEvent) => {
|
|
|
83
83
|
const sap_clients: SAPClient[] = await get_sap_clients(
|
|
84
84
|
commandEvent.app.formData.sapHostUrl,
|
|
85
85
|
{
|
|
86
|
-
updateAt: commandEvent.app.options_formData[bench_time_key],
|
|
86
|
+
updateAt: commandEvent.app.options_formData?.[bench_time_key],
|
|
87
87
|
GroupCode: commandEvent.app.formData.GroupCode,
|
|
88
88
|
}
|
|
89
89
|
);
|
|
@@ -100,7 +100,7 @@ export const sync_payment_term = async (commandEvent: CommandEvent) => {
|
|
|
100
100
|
await commandLog
|
|
101
101
|
.addDetail(
|
|
102
102
|
`${result.sap_total} Payments Term in SAP changed since ${
|
|
103
|
-
commandEvent.app.options_formData[bench_time_key] || "ever"
|
|
103
|
+
commandEvent.app.options_formData?.[bench_time_key] || "ever"
|
|
104
104
|
}`
|
|
105
105
|
)
|
|
106
106
|
.commit();
|
|
@@ -64,14 +64,14 @@ export const sync_price_list = async (commandEvent: CommandEvent) => {
|
|
|
64
64
|
// Get SAP Price Lists
|
|
65
65
|
const sap_price_lists: SAPPriceListItem[] = await get_sap_price_list(
|
|
66
66
|
commandEvent.app.formData.sapHostUrl,
|
|
67
|
-
{ updateAt: commandEvent.app.options_formData[bench_time_key] }
|
|
67
|
+
{ updateAt: commandEvent.app.options_formData?.[bench_time_key] }
|
|
68
68
|
);
|
|
69
69
|
result.sap_total = sap_price_lists?.length;
|
|
70
70
|
|
|
71
71
|
await commandLog
|
|
72
72
|
.addDetail(
|
|
73
73
|
`${result.sap_total} Price Lists in SAP changed since ${
|
|
74
|
-
commandEvent.app.options_formData[bench_time_key] || "ever"
|
|
74
|
+
commandEvent.app.options_formData?.[bench_time_key] || "ever"
|
|
75
75
|
}`
|
|
76
76
|
)
|
|
77
77
|
.commit();
|
package/src/commands/product.ts
CHANGED
|
@@ -85,14 +85,14 @@ export const sync_product = async (commandEvent: CommandEvent) => {
|
|
|
85
85
|
|
|
86
86
|
const sap_products: SAPProduct[] = await get_sap_products(
|
|
87
87
|
commandEvent.app.formData.sapHostUrl,
|
|
88
|
-
{ updateAt: commandEvent.app.options_formData[bench_time_key] }
|
|
88
|
+
{ updateAt: commandEvent.app.options_formData?.[bench_time_key] }
|
|
89
89
|
);
|
|
90
90
|
result.sap_total = sap_products?.length;
|
|
91
91
|
|
|
92
92
|
await commandLog
|
|
93
93
|
.addDetail(
|
|
94
94
|
`${result.sap_total} Items in SAP changed since ${
|
|
95
|
-
commandEvent.app.options_formData[bench_time_key] || "ever"
|
|
95
|
+
commandEvent.app.options_formData?.[bench_time_key] || "ever"
|
|
96
96
|
}`
|
|
97
97
|
)
|
|
98
98
|
.commit();
|
|
@@ -46,14 +46,14 @@ export const sync_disabled_product = async (commandEvent: CommandEvent) => {
|
|
|
46
46
|
|
|
47
47
|
const sap_products: SAPProduct[] = await get_sap_disabled_products(
|
|
48
48
|
commandEvent.app.formData.sapHostUrl,
|
|
49
|
-
{ updateAt: commandEvent.app.options_formData[bench_time_key] }
|
|
49
|
+
{ updateAt: commandEvent.app.options_formData?.[bench_time_key] }
|
|
50
50
|
);
|
|
51
51
|
result.sap_total = sap_products?.length;
|
|
52
52
|
|
|
53
53
|
await commandLog
|
|
54
54
|
.addDetail(
|
|
55
55
|
`${result.sap_total} Disabled Products in SAP changed since ${
|
|
56
|
-
commandEvent.app.options_formData[bench_time_key] || "ever"
|
|
56
|
+
commandEvent.app.options_formData?.[bench_time_key] || "ever"
|
|
57
57
|
}`
|
|
58
58
|
)
|
|
59
59
|
.commit();
|
package/src/commands/rep.ts
CHANGED
|
@@ -19,6 +19,7 @@ interface SAPRep {
|
|
|
19
19
|
USERCASHACCOUNT: string; // "124020002";
|
|
20
20
|
USERCHECKACCTCODE: string; // "124020003";
|
|
21
21
|
USERWHSCODE: string; // "MToffers";
|
|
22
|
+
INVOICESTATUS: "Y" | "N";
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
interface SAPReps {
|
|
@@ -36,7 +37,7 @@ export const sync_rep = async (commandEvent: CommandEvent) => {
|
|
|
36
37
|
commandEvent.command
|
|
37
38
|
);
|
|
38
39
|
try {
|
|
39
|
-
|
|
40
|
+
console.log("sync_rep");
|
|
40
41
|
|
|
41
42
|
const new_bench_time = new Date().toISOString();
|
|
42
43
|
const bench_time_key = "bench_time_rep";
|
|
@@ -84,6 +85,7 @@ export const sync_rep = async (commandEvent: CommandEvent) => {
|
|
|
84
85
|
USERCASHACCOUNT: true,
|
|
85
86
|
USERCHECKACCTCODE: true,
|
|
86
87
|
USERWHSCODE: true,
|
|
88
|
+
INVOICESTATUS: true,
|
|
87
89
|
});
|
|
88
90
|
db.load(sap_reps?.Users);
|
|
89
91
|
|
|
@@ -125,10 +127,13 @@ export const sync_rep = async (commandEvent: CommandEvent) => {
|
|
|
125
127
|
USERCASHACCOUNT: sap_rep.USERCASHACCOUNT,
|
|
126
128
|
USERCHECKACCTCODE: sap_rep.USERCHECKACCTCODE,
|
|
127
129
|
USERWHSCODE: sap_rep.USERWHSCODE,
|
|
130
|
+
INVOICESTATUS: sap_rep.INVOICESTATUS,
|
|
128
131
|
id: `${nameSpace}_${sap_rep.USERID}`,
|
|
129
132
|
},
|
|
130
133
|
assigned_warehouse: warehouse,
|
|
131
134
|
company_namespace: [nameSpace],
|
|
135
|
+
"settings.treating_invoice_as_proforma_for_etax":
|
|
136
|
+
sap_rep.INVOICESTATUS === "N" ? true : false,
|
|
132
137
|
};
|
|
133
138
|
|
|
134
139
|
if (!repzo_rep) {
|
|
@@ -155,6 +160,7 @@ export const sync_rep = async (commandEvent: CommandEvent) => {
|
|
|
155
160
|
USERCASHACCOUNT: repzo_rep.integration_meta?.USERCASHACCOUNT,
|
|
156
161
|
USERCHECKACCTCODE: repzo_rep.integration_meta?.USERCHECKACCTCODE,
|
|
157
162
|
USERWHSCODE: repzo_rep.integration_meta?.USERWHSCODE,
|
|
163
|
+
INVOICESTATUS: repzo_rep.integration_meta?.INVOICESTATUS,
|
|
158
164
|
});
|
|
159
165
|
if (found_identical_docs.length) continue;
|
|
160
166
|
// Update
|
|
@@ -68,7 +68,7 @@ export const sync_warehouse = async (commandEvent: CommandEvent) => {
|
|
|
68
68
|
{
|
|
69
69
|
updateAt:
|
|
70
70
|
commandEvent.app.formData.warehouseDefaultUpdateDate ||
|
|
71
|
-
commandEvent.app.options_formData[bench_time_key],
|
|
71
|
+
commandEvent.app.options_formData?.[bench_time_key],
|
|
72
72
|
}
|
|
73
73
|
);
|
|
74
74
|
result.sap_total = sap_warehouses?.Warehouses?.length;
|
|
@@ -77,7 +77,7 @@ export const sync_warehouse = async (commandEvent: CommandEvent) => {
|
|
|
77
77
|
.addDetail(
|
|
78
78
|
`${sap_warehouses?.Warehouses?.length} warehouses changed since ${
|
|
79
79
|
commandEvent.app.formData.warehouseDefaultUpdateDate ||
|
|
80
|
-
commandEvent.app.options_formData[bench_time_key] ||
|
|
80
|
+
commandEvent.app.options_formData?.[bench_time_key] ||
|
|
81
81
|
"ever"
|
|
82
82
|
}`
|
|
83
83
|
)
|
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
import { CommandEvent } from "../../types";
|
|
2
|
+
import { Commands } from "../../index.js";
|
|
3
|
+
|
|
4
|
+
let commandEvent: CommandEvent | any = {
|
|
5
|
+
app: {
|
|
6
|
+
_id: "639f0bf52070c5be595e955c",
|
|
7
|
+
name: "SAP",
|
|
8
|
+
disabled: false,
|
|
9
|
+
available_app: {
|
|
10
|
+
_id: "6391a268db71ef64357195da",
|
|
11
|
+
name: "repzo-sap-absjo",
|
|
12
|
+
title: "SAP ABS JO",
|
|
13
|
+
logo: "https://prod-repzo-media-service.s3.us-east-1.amazonaws.com/repzo/image/2022/12/18/3f73de7d-1920-4786-90db-57c76d18acci-SAP_EBS_JO.png",
|
|
14
|
+
description:
|
|
15
|
+
"SAP Jordan. We provide real value to SMEs by understanding their business and driving their vision forward with SAP Business One",
|
|
16
|
+
disabled: false,
|
|
17
|
+
JSONSchema: {
|
|
18
|
+
title: "SAP Integration Settings",
|
|
19
|
+
type: "object",
|
|
20
|
+
required: ["repzoApiKey", "sapHostUrl"],
|
|
21
|
+
properties: {
|
|
22
|
+
repzoApiKey: { type: "string", title: "Repzo API KEY" },
|
|
23
|
+
sapHostUrl: { type: "string", title: "SAP Host Url" },
|
|
24
|
+
errorEmail: {
|
|
25
|
+
type: "string",
|
|
26
|
+
format: "email",
|
|
27
|
+
title: "Email in case of error",
|
|
28
|
+
},
|
|
29
|
+
GroupCode: {
|
|
30
|
+
type: "string",
|
|
31
|
+
format: "string",
|
|
32
|
+
title: "Customers GroupCode",
|
|
33
|
+
},
|
|
34
|
+
warehouseDefaultUpdateDate: {
|
|
35
|
+
type: "string",
|
|
36
|
+
format: "date",
|
|
37
|
+
title: "Warehouse: Default Update Date",
|
|
38
|
+
},
|
|
39
|
+
DepartmentCode: {
|
|
40
|
+
type: "string",
|
|
41
|
+
format: "string",
|
|
42
|
+
title: "Invoice/Return Department Code",
|
|
43
|
+
},
|
|
44
|
+
return_reason: {
|
|
45
|
+
type: "string",
|
|
46
|
+
format: "string",
|
|
47
|
+
title: "Return Reason Array",
|
|
48
|
+
},
|
|
49
|
+
measureUnitInjections: {
|
|
50
|
+
type: "string",
|
|
51
|
+
format: "string",
|
|
52
|
+
title: "Uom Injection Array",
|
|
53
|
+
},
|
|
54
|
+
defaultWarehouseForSalesOrder: {
|
|
55
|
+
type: "string",
|
|
56
|
+
format: "string",
|
|
57
|
+
title: "Default Warehouse Code For Sales Orders",
|
|
58
|
+
},
|
|
59
|
+
SalPersCode: {
|
|
60
|
+
type: "string",
|
|
61
|
+
format: "string",
|
|
62
|
+
title: "Default Sales Person Code For Sales Orders",
|
|
63
|
+
},
|
|
64
|
+
SalesPersonCode: {
|
|
65
|
+
type: "string",
|
|
66
|
+
format: "string",
|
|
67
|
+
title: "Default Sales Person Code For Transfer",
|
|
68
|
+
},
|
|
69
|
+
invoices: {
|
|
70
|
+
type: "object",
|
|
71
|
+
title: "Invoices",
|
|
72
|
+
required: ["createInvoiceHook", "createReturnInvoiceHook"],
|
|
73
|
+
properties: {
|
|
74
|
+
createInvoiceHook: {
|
|
75
|
+
type: "boolean",
|
|
76
|
+
title: "Live Sync Invoices from Repzo to SAP",
|
|
77
|
+
default: false,
|
|
78
|
+
},
|
|
79
|
+
createReturnInvoiceHook: {
|
|
80
|
+
type: "boolean",
|
|
81
|
+
title: "Live Sync Return Invoice from Repzo to SAP",
|
|
82
|
+
default: false,
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
payments: {
|
|
87
|
+
type: "object",
|
|
88
|
+
title: "Payments",
|
|
89
|
+
required: ["createPaymentHook"],
|
|
90
|
+
properties: {
|
|
91
|
+
createPaymentHook: {
|
|
92
|
+
type: "boolean",
|
|
93
|
+
title: "Live Sync Payments from Repzo to SAP",
|
|
94
|
+
default: false,
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
proformas: {
|
|
99
|
+
type: "object",
|
|
100
|
+
title: "Sales Orders",
|
|
101
|
+
required: ["createApprovedProformaHook"],
|
|
102
|
+
properties: {
|
|
103
|
+
createApprovedProformaHook: {
|
|
104
|
+
type: "boolean",
|
|
105
|
+
title: "Live Sync Approved Sales Orders from Repzo to SAP",
|
|
106
|
+
default: false,
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
transfers: {
|
|
111
|
+
type: "object",
|
|
112
|
+
title: "Transfers",
|
|
113
|
+
required: ["createApprovedTransferHook"],
|
|
114
|
+
properties: {
|
|
115
|
+
createApprovedTransferHook: {
|
|
116
|
+
type: "boolean",
|
|
117
|
+
title: "Live Sync Approved Transfers from Repzo to SAP",
|
|
118
|
+
default: false,
|
|
119
|
+
},
|
|
120
|
+
adjustInventoryInFailedTransfer: {
|
|
121
|
+
type: "boolean",
|
|
122
|
+
title:
|
|
123
|
+
"Adjust Inventories in Repzo if creation Transfer Failed in SAP",
|
|
124
|
+
default: false,
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
options_JSONSchema: {
|
|
131
|
+
title: "SAP Integration Optional Settings",
|
|
132
|
+
type: "object",
|
|
133
|
+
required: [],
|
|
134
|
+
properties: {
|
|
135
|
+
bench_time_warehouse: {
|
|
136
|
+
title: "Bench Time: Warehouse",
|
|
137
|
+
type: "string",
|
|
138
|
+
format: "date",
|
|
139
|
+
},
|
|
140
|
+
bench_time_channel: {
|
|
141
|
+
title: "Bench Time: Channels",
|
|
142
|
+
type: "string",
|
|
143
|
+
format: "date-time",
|
|
144
|
+
},
|
|
145
|
+
bench_time_payment_term: {
|
|
146
|
+
title: "Bench Time: Payment Terms",
|
|
147
|
+
type: "string",
|
|
148
|
+
format: "date-time",
|
|
149
|
+
},
|
|
150
|
+
bench_time_product: {
|
|
151
|
+
title: "Bench Time: Products",
|
|
152
|
+
type: "string",
|
|
153
|
+
format: "date-time",
|
|
154
|
+
},
|
|
155
|
+
bench_time_product_disabled: {
|
|
156
|
+
title: "Bench Time: Inactive Products",
|
|
157
|
+
type: "string",
|
|
158
|
+
format: "date-time",
|
|
159
|
+
},
|
|
160
|
+
bench_time_price_list: {
|
|
161
|
+
title: "Bench Time: Price List",
|
|
162
|
+
type: "string",
|
|
163
|
+
format: "date-time",
|
|
164
|
+
},
|
|
165
|
+
bench_time_client: {
|
|
166
|
+
title: "Bench Time: Clients",
|
|
167
|
+
type: "string",
|
|
168
|
+
format: "date-time",
|
|
169
|
+
},
|
|
170
|
+
bench_time_disabled_client: {
|
|
171
|
+
title: "Bench Time: Inactive Clients",
|
|
172
|
+
type: "string",
|
|
173
|
+
format: "date-time",
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
app_settings: {
|
|
178
|
+
repo: "",
|
|
179
|
+
serviceEndPoint: "",
|
|
180
|
+
_id: "6391a268db71ef64357195db",
|
|
181
|
+
},
|
|
182
|
+
app_category: "6249fa8466312f76e595634a",
|
|
183
|
+
commands: [
|
|
184
|
+
{
|
|
185
|
+
command: "basic",
|
|
186
|
+
name: "Full Sync",
|
|
187
|
+
description: "Exclude Join & Adjust Inventories",
|
|
188
|
+
group_sync: false,
|
|
189
|
+
_id: "6391a268db71ef64357195dc",
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
command: "join",
|
|
193
|
+
name: "Join",
|
|
194
|
+
description: "",
|
|
195
|
+
group_sync: false,
|
|
196
|
+
_id: "6391a268db71ef64357195dd",
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
command: "warehouse",
|
|
200
|
+
name: "Sync Warehouse",
|
|
201
|
+
description: "Sync Warehouses From SAP to Repzo",
|
|
202
|
+
group_sync: false,
|
|
203
|
+
_id: "6391c42a1b0f4f7a30e40f40",
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
command: "rep",
|
|
207
|
+
name: "Sync Representatives",
|
|
208
|
+
description: "Sync Representatives From SAP to Repzo",
|
|
209
|
+
group_sync: false,
|
|
210
|
+
_id: "639715c2bee5dd4b6b11e129",
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
command: "tax",
|
|
214
|
+
name: "Sync Taxes",
|
|
215
|
+
description: "Sync Taxes From SAP to Repzo",
|
|
216
|
+
group_sync: false,
|
|
217
|
+
_id: "639715c2bee5dd4b6b11e12a",
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
command: "tag",
|
|
221
|
+
name: "Sync Area Tags",
|
|
222
|
+
description: "Sync Area Tags From SAP to Repzo",
|
|
223
|
+
group_sync: false,
|
|
224
|
+
_id: "639715c2bee5dd4b6b11e12b",
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
command: "measureunit",
|
|
228
|
+
name: "Sync Measure Units",
|
|
229
|
+
description: "Sync Measure Units From SAP to Repzo",
|
|
230
|
+
group_sync: false,
|
|
231
|
+
_id: "639817eaedafde008af0ad0e",
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
command: "measureunit_family",
|
|
235
|
+
name: "Sync Measure Units Family",
|
|
236
|
+
description: "Sync Measure Units Family From SAP to Repzo",
|
|
237
|
+
group_sync: false,
|
|
238
|
+
_id: "63982d09edafde008af0f698",
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
command: "category",
|
|
242
|
+
name: "Sync Product Category",
|
|
243
|
+
description: "Sync Product Categories From SAP to Repzo",
|
|
244
|
+
group_sync: false,
|
|
245
|
+
_id: "63984085edafde008af2f689",
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
command: "brand",
|
|
249
|
+
name: "Sync Product Brand",
|
|
250
|
+
description: "Sync Product Brands From SAP to Repzo",
|
|
251
|
+
group_sync: false,
|
|
252
|
+
_id: "63984085edafde008af2f689",
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
command: "channel",
|
|
256
|
+
name: "Sync Client's Channels",
|
|
257
|
+
description: "Sync Client's Channels From SAP to Repzo",
|
|
258
|
+
group_sync: false,
|
|
259
|
+
_id: "63984085edafde008af2f689",
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
command: "payment_term",
|
|
263
|
+
name: "Sync Payments Term",
|
|
264
|
+
description: "Sync Payments Term From SAP to Repzo",
|
|
265
|
+
group_sync: false,
|
|
266
|
+
_id: "63984085edafde008af2f68a",
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
command: "bank",
|
|
270
|
+
name: "Sync Banks",
|
|
271
|
+
description: "Sync Banks From SAP to Repzo",
|
|
272
|
+
group_sync: false,
|
|
273
|
+
_id: "63986018333b84929c538570",
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
command: "product",
|
|
277
|
+
name: "Sync Products",
|
|
278
|
+
description: "Sync Active Products From SAP to Repzo",
|
|
279
|
+
group_sync: false,
|
|
280
|
+
_id: "63987139333b84929c53a293",
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
command: "disabled_product",
|
|
284
|
+
name: "Sync Inactive Products",
|
|
285
|
+
description: "Sync Inactive Products From SAP to Repzo",
|
|
286
|
+
group_sync: false,
|
|
287
|
+
_id: "6399714d0242db686d496466",
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
command: "price_list",
|
|
291
|
+
name: "Sync Price Lists",
|
|
292
|
+
description: "Sync Price Lists From SAP to Repzo",
|
|
293
|
+
group_sync: false,
|
|
294
|
+
_id: "639972d6e8a1cfdd26deaa7e",
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
command: "price_list_disabled",
|
|
298
|
+
name: "Sync Disbaled Price List Items",
|
|
299
|
+
description: "Sync Disbaled Price List Items From SAP to Repzo",
|
|
300
|
+
group_sync: false,
|
|
301
|
+
_id: "656ed4098961a3f97182773f",
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
command: "client",
|
|
305
|
+
name: "Sync Clients",
|
|
306
|
+
description: "Sync Clients From SAP to Repzo",
|
|
307
|
+
group_sync: false,
|
|
308
|
+
_id: "63997615e8a1cfdd26ded7d1",
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
command: "disabled_client",
|
|
312
|
+
name: "Sync Inactive Clients",
|
|
313
|
+
description: "Sync Inactive Clients From SAP to Repzo",
|
|
314
|
+
group_sync: false,
|
|
315
|
+
_id: "639ac554e157f1c63770c1bc",
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
command: "adjust_inventory",
|
|
319
|
+
name: "Adjust Inventories",
|
|
320
|
+
description: "Adjust Inventories From SAP to Repzo",
|
|
321
|
+
group_sync: false,
|
|
322
|
+
_id: "639ac56fe157f1c63770c2eb",
|
|
323
|
+
},
|
|
324
|
+
],
|
|
325
|
+
actions: [
|
|
326
|
+
{
|
|
327
|
+
action: "create_invoice",
|
|
328
|
+
name: "Sync Invoices",
|
|
329
|
+
description: "Sync Invoices From Repzo to SAP",
|
|
330
|
+
_id: "639ebeacdbba64d7af94520c",
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
action: "create_return_invoice",
|
|
334
|
+
name: "Sync Return Invoices",
|
|
335
|
+
description: "Sync Return Invoices From Repzo to SAP",
|
|
336
|
+
_id: "639ebeacdbba64d7af94520d",
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
action: "create_proforma",
|
|
340
|
+
name: "Sync Approved Sales Orders",
|
|
341
|
+
description: "Sync Approved Sales Orders From Repzo to SAP",
|
|
342
|
+
_id: "639ebeacdbba64d7af94520e",
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
action: "create_payment",
|
|
346
|
+
name: "Sync Paymants",
|
|
347
|
+
description: "Sync Paymants From Repzo to SAP",
|
|
348
|
+
_id: "639ebeacdbba64d7af94520f",
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
action: "create_transfer",
|
|
352
|
+
name: "Sync Approved Transfers",
|
|
353
|
+
description: "Sync Approved Transfers From Repzo to SAP",
|
|
354
|
+
_id: "639ebeacdbba64d7af945210",
|
|
355
|
+
},
|
|
356
|
+
],
|
|
357
|
+
createdAt: "2022-12-08T08:38:00.915Z",
|
|
358
|
+
updatedAt: "2025-09-01T08:32:54.793Z",
|
|
359
|
+
__v: 0,
|
|
360
|
+
subscription_billing_mode: "free",
|
|
361
|
+
},
|
|
362
|
+
company_namespace: ["unipaljo"],
|
|
363
|
+
formData: {
|
|
364
|
+
repzoApiKey: "seCTdOxk1zYljAZZRJaqWga2Hc6zjzWscf6FfaP9eE8",
|
|
365
|
+
sapHostUrl: "http://unipal.b1pro.com:8083/api",
|
|
366
|
+
invoices: { createInvoiceHook: false, createReturnInvoiceHook: false },
|
|
367
|
+
payments: { createPaymentHook: false },
|
|
368
|
+
proformas: { createApprovedProformaHook: false },
|
|
369
|
+
transfers: {
|
|
370
|
+
createApprovedTransferHook: false,
|
|
371
|
+
adjustInventoryInFailedTransfer: false,
|
|
372
|
+
},
|
|
373
|
+
warehouseDefaultUpdateDate: "2015-01-01",
|
|
374
|
+
DepartmentCode: "D2",
|
|
375
|
+
return_reason:
|
|
376
|
+
'[{sap_id:1,sap_name:"BarcodeIssue",repzo_name:"Barcodeissue",repzo_id:"62b074972b332895edf114fc"},{sap_id:2,sap_name:"Damaged",repzo_name:"Damaged",repzo_id:"62b074ace96258fb745982e4"},{sap_id:3,sap_name:"Nearexpiry",repzo_name:"Nearexpiry",repzo_id:"62b074c0a066173bd1c1ea0d"},{sap_id:4,sap_name:"Wrongprinting",repzo_name:"Wrongprinting",repzo_id:"62b074d79e7f41f306a4cb42"},{sap_id:5,sap_name:"experied",repzo_name:"Experied",repzo_id:"62b074faa066173bd1c1eec0"}]',
|
|
377
|
+
SalPersCode: "111",
|
|
378
|
+
SalesPersonCode: "111",
|
|
379
|
+
measureUnitInjections: '[{ "itemCode": "010-KEA-JU0003", "uom": "PC" }]',
|
|
380
|
+
},
|
|
381
|
+
options_formData: {},
|
|
382
|
+
createdAt: "2022-12-18T12:47:49.096Z",
|
|
383
|
+
updatedAt: "2023-12-05T09:35:00.366Z",
|
|
384
|
+
__v: 0,
|
|
385
|
+
subscription_billing_mode: "free",
|
|
386
|
+
},
|
|
387
|
+
end_of_day: "04:00",
|
|
388
|
+
nameSpace: ["unipaljo"],
|
|
389
|
+
timezone: "Asia/Amman",
|
|
390
|
+
meta: "",
|
|
391
|
+
env: "staging",
|
|
392
|
+
sync_id: "774ed706-1868-49bc-9982-d320796babff",
|
|
393
|
+
command: "measureunit_family",
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
Commands(commandEvent);
|
package/src/types.ts
CHANGED
|
@@ -78,8 +78,64 @@ export interface AvailableApp {
|
|
|
78
78
|
app_category: string;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
export interface FormData {
|
|
82
|
+
repzoApiKey: string;
|
|
83
|
+
sapHostUrl: string;
|
|
84
|
+
warehouseDefaultUpdateDate?: string; // "2015-01-01",
|
|
85
|
+
DepartmentCode?: string; // "D2";
|
|
86
|
+
GroupCode?: string;
|
|
87
|
+
return_reasons?:
|
|
88
|
+
| {
|
|
89
|
+
sap_id: number;
|
|
90
|
+
sap_name: string;
|
|
91
|
+
repzo_name: string;
|
|
92
|
+
repzo_id: StringId;
|
|
93
|
+
}[]
|
|
94
|
+
| string;
|
|
95
|
+
defaultWarehouseForSalesOrder?: string; // "1";
|
|
96
|
+
SalPersCode?: string; // "111";
|
|
97
|
+
SalesPersonCode?: string; // "111";
|
|
98
|
+
measureUnitInjections?: { itemCode: string; uom: string }[];
|
|
99
|
+
invoices?: {
|
|
100
|
+
createInvoiceHook?: boolean;
|
|
101
|
+
createReturnInvoiceHook?: boolean;
|
|
102
|
+
};
|
|
103
|
+
payments?: { createPaymentHook?: boolean };
|
|
104
|
+
proformas?: { createApprovedProformaHook?: boolean };
|
|
105
|
+
transfers?: {
|
|
106
|
+
createApprovedTransferHook?: boolean;
|
|
107
|
+
adjustInventoryInFailedTransfer?: boolean;
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
interface OptionsFormData {
|
|
112
|
+
bench_time_warehouse?: string;
|
|
113
|
+
bench_time_channel?: string;
|
|
114
|
+
bench_time_payment_term?: string;
|
|
115
|
+
bench_time_product?: string;
|
|
116
|
+
bench_time_product_disabled?: string;
|
|
117
|
+
bench_time_price_list?: string;
|
|
118
|
+
bench_time_client?: string;
|
|
119
|
+
bench_time_disabled_client?: string;
|
|
120
|
+
bench_time_rep?: string;
|
|
121
|
+
bench_time_tax?: string;
|
|
122
|
+
bench_time_tag?: string;
|
|
123
|
+
bench_time_measureunit?: string;
|
|
124
|
+
bench_time_measureunit_family?: string;
|
|
125
|
+
bench_time_category?: string;
|
|
126
|
+
bench_time_bank?: string;
|
|
127
|
+
bench_time_brand?: string;
|
|
128
|
+
bench_time_price_list_disabled?: string;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
interface AppWithCustomFormData
|
|
132
|
+
extends Service.App.Schema_with_populated_AvailableApp {
|
|
133
|
+
formData: FormData;
|
|
134
|
+
options_formData?: OptionsFormData;
|
|
135
|
+
}
|
|
136
|
+
|
|
81
137
|
export interface CommandEvent {
|
|
82
|
-
app:
|
|
138
|
+
app: AppWithCustomFormData;
|
|
83
139
|
command: CommandType | string;
|
|
84
140
|
nameSpace: NameSpaces;
|
|
85
141
|
meta?: any;
|