repzo-sap-absjo 1.0.1
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/README.md +3 -0
- package/changelog.md +17 -0
- package/lib/actions/create_invoice.d.ts +26 -0
- package/lib/actions/create_invoice.js +311 -0
- package/lib/actions/create_payment.d.ts +5 -0
- package/lib/actions/create_payment.js +177 -0
- package/lib/actions/create_proforma.d.ts +5 -0
- package/lib/actions/create_proforma.js +241 -0
- package/lib/actions/create_return_invoice.d.ts +5 -0
- package/lib/actions/create_return_invoice.js +268 -0
- package/lib/actions/create_transfer.d.ts +5 -0
- package/lib/actions/create_transfer.js +171 -0
- package/lib/actions/index.d.ts +3 -0
- package/lib/actions/index.js +31 -0
- package/lib/commands/adjust_inventory.d.ts +6 -0
- package/lib/commands/adjust_inventory.js +303 -0
- package/lib/commands/bank.d.ts +7 -0
- package/lib/commands/bank.js +301 -0
- package/lib/commands/basic.d.ts +2 -0
- package/lib/commands/basic.js +73 -0
- package/lib/commands/category.d.ts +4 -0
- package/lib/commands/category.js +193 -0
- package/lib/commands/channel.d.ts +4 -0
- package/lib/commands/channel.js +213 -0
- package/lib/commands/client.d.ts +39 -0
- package/lib/commands/client.js +410 -0
- package/lib/commands/client_disabled.d.ts +4 -0
- package/lib/commands/client_disabled.js +183 -0
- package/lib/commands/index.d.ts +23 -0
- package/lib/commands/index.js +82 -0
- package/lib/commands/join.d.ts +2 -0
- package/lib/commands/join.js +134 -0
- package/lib/commands/measureunit.d.ts +23 -0
- package/lib/commands/measureunit.js +314 -0
- package/lib/commands/measureunit_family.d.ts +12 -0
- package/lib/commands/measureunit_family.js +263 -0
- package/lib/commands/payment_term.d.ts +4 -0
- package/lib/commands/payment_term.js +217 -0
- package/lib/commands/price_list.d.ts +18 -0
- package/lib/commands/price_list.js +608 -0
- package/lib/commands/product.d.ts +39 -0
- package/lib/commands/product.js +454 -0
- package/lib/commands/product_disabled.d.ts +4 -0
- package/lib/commands/product_disabled.js +178 -0
- package/lib/commands/rep.d.ts +2 -0
- package/lib/commands/rep.js +246 -0
- package/lib/commands/tag.d.ts +2 -0
- package/lib/commands/tag.js +195 -0
- package/lib/commands/tax.d.ts +2 -0
- package/lib/commands/tax.js +198 -0
- package/lib/commands/warehouse.d.ts +4 -0
- package/lib/commands/warehouse.js +221 -0
- package/lib/index.d.ts +29 -0
- package/lib/index.js +6 -0
- package/lib/test/actions/create_invoice.d.ts +1 -0
- package/lib/test/actions/create_invoice.js +214 -0
- package/lib/test/actions/create_payment.d.ts +1 -0
- package/lib/test/actions/create_payment.js +131 -0
- package/lib/test/actions/create_proforma.d.ts +1 -0
- package/lib/test/actions/create_proforma.js +242 -0
- package/lib/test/actions/create_return_invoice.d.ts +1 -0
- package/lib/test/actions/create_return_invoice.js +226 -0
- package/lib/test/actions/create_transfer.d.ts +1 -0
- package/lib/test/actions/create_transfer.js +142 -0
- package/lib/test/commands/adjust_inventory.d.ts +1 -0
- package/lib/test/commands/adjust_inventory.js +97 -0
- package/lib/test/commands/bank.d.ts +1 -0
- package/lib/test/commands/bank.js +97 -0
- package/lib/test/commands/basic.d.ts +1 -0
- package/lib/test/commands/basic.js +339 -0
- package/lib/test/commands/category.d.ts +1 -0
- package/lib/test/commands/category.js +97 -0
- package/lib/test/commands/channel.d.ts +1 -0
- package/lib/test/commands/channel.js +97 -0
- package/lib/test/commands/client.d.ts +1 -0
- package/lib/test/commands/client.js +97 -0
- package/lib/test/commands/client_disabled.d.ts +1 -0
- package/lib/test/commands/client_disabled.js +97 -0
- package/lib/test/commands/join.d.ts +1 -0
- package/lib/test/commands/join.js +339 -0
- package/lib/test/commands/measureunit.d.ts +1 -0
- package/lib/test/commands/measureunit.js +97 -0
- package/lib/test/commands/measureunit_family.d.ts +1 -0
- package/lib/test/commands/measureunit_family.js +97 -0
- package/lib/test/commands/payment_term.d.ts +1 -0
- package/lib/test/commands/payment_term.js +97 -0
- package/lib/test/commands/price_list.d.ts +1 -0
- package/lib/test/commands/price_list.js +97 -0
- package/lib/test/commands/product.d.ts +1 -0
- package/lib/test/commands/product.js +97 -0
- package/lib/test/commands/product_disabled.d.ts +1 -0
- package/lib/test/commands/product_disabled.js +97 -0
- package/lib/test/commands/rep.d.ts +1 -0
- package/lib/test/commands/rep.js +97 -0
- package/lib/test/commands/tag.d.ts +1 -0
- package/lib/test/commands/tag.js +97 -0
- package/lib/test/commands/tax.d.ts +1 -0
- package/lib/test/commands/tax.js +97 -0
- package/lib/test/commands/warehouse.d.ts +1 -0
- package/lib/test/commands/warehouse.js +97 -0
- package/lib/types.d.ts +77 -0
- package/lib/types.js +1 -0
- package/lib/util.d.ts +70 -0
- package/lib/util.js +164 -0
- package/package.json +51 -0
- package/src/actions/create_invoice.ts +275 -0
- package/src/actions/create_payment.ts +138 -0
- package/src/actions/create_proforma.ts +187 -0
- package/src/actions/create_return_invoice.ts +217 -0
- package/src/actions/create_transfer.ts +160 -0
- package/src/actions/index.ts +27 -0
- package/src/commands/adjust_inventory.ts +250 -0
- package/src/commands/bank.ts +243 -0
- package/src/commands/basic.ts +64 -0
- package/src/commands/category.ts +176 -0
- package/src/commands/channel.ts +219 -0
- package/src/commands/client.ts +368 -0
- package/src/commands/client_disabled.ts +158 -0
- package/src/commands/index.ts +87 -0
- package/src/commands/join.ts +80 -0
- package/src/commands/measureunit.ts +276 -0
- package/src/commands/measureunit_family.ts +209 -0
- package/src/commands/payment_term.ts +224 -0
- package/src/commands/price_list.ts +434 -0
- package/src/commands/product.ts +359 -0
- package/src/commands/product_disabled.ts +152 -0
- package/src/commands/rep.ts +209 -0
- package/src/commands/tag.ts +173 -0
- package/src/commands/tax.ts +178 -0
- package/src/commands/warehouse.ts +204 -0
- package/src/index.ts +7 -0
- package/src/test/actions/create_invoice.ts +214 -0
- package/src/test/actions/create_payment.ts +131 -0
- package/src/test/actions/create_proforma.ts +242 -0
- package/src/test/actions/create_return_invoice.ts +226 -0
- package/src/test/actions/create_transfer.ts +142 -0
- package/src/test/commands/adjust_inventory.ts +100 -0
- package/src/test/commands/bank.ts +100 -0
- package/src/test/commands/basic.ts +342 -0
- package/src/test/commands/category.ts +100 -0
- package/src/test/commands/channel.ts +100 -0
- package/src/test/commands/client.ts +100 -0
- package/src/test/commands/client_disabled.ts +100 -0
- package/src/test/commands/join.ts +342 -0
- package/src/test/commands/measureunit.ts +100 -0
- package/src/test/commands/measureunit_family.ts +100 -0
- package/src/test/commands/payment_term.ts +100 -0
- package/src/test/commands/price_list.ts +100 -0
- package/src/test/commands/product.ts +100 -0
- package/src/test/commands/product_disabled.ts +100 -0
- package/src/test/commands/rep.ts +100 -0
- package/src/test/commands/tag.ts +100 -0
- package/src/test/commands/tax.ts +100 -0
- package/src/test/commands/warehouse.ts +100 -0
- package/src/types.ts +76 -0
- package/src/util.ts +205 -0
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { Actions } from "../../index.js";
|
|
2
|
+
Actions(
|
|
3
|
+
{
|
|
4
|
+
version: "2.0",
|
|
5
|
+
routeKey: "POST /actions",
|
|
6
|
+
rawPath: "/actions",
|
|
7
|
+
rawQueryString: "app=repzo-sap-absjo&action=create_invoice",
|
|
8
|
+
headers: {
|
|
9
|
+
action_sync_id: "Actions-0000001", // SYNC_ID
|
|
10
|
+
accept: "*/*",
|
|
11
|
+
"accept-encoding": "gzip, deflate",
|
|
12
|
+
"content-length": "3658",
|
|
13
|
+
"content-type": "application/json",
|
|
14
|
+
host: "staging.marketplace.api.repzo.me",
|
|
15
|
+
"svix-id": "msg_29I1By29ETyPiZ4SNrc99KIg7D6",
|
|
16
|
+
"svix-signature": "v1,OkktM+dibxzeb0M6383POFjBr7DX14HECpBIh17FQnU=",
|
|
17
|
+
"svix-timestamp": "1652785653",
|
|
18
|
+
"user-agent": "Svix-Webhooks/1.4",
|
|
19
|
+
"x-amzn-trace-id": "Root=1-628381f6-0b2c6f346d2eb5d207b582ee",
|
|
20
|
+
"x-forwarded-for": "52.215.16.239",
|
|
21
|
+
"x-forwarded-port": "443",
|
|
22
|
+
"x-forwarded-proto": "https",
|
|
23
|
+
},
|
|
24
|
+
queryStringParameters: {
|
|
25
|
+
action: "create_invoice",
|
|
26
|
+
app: "repzo-sap-absjo",
|
|
27
|
+
},
|
|
28
|
+
requestContext: {
|
|
29
|
+
accountId: "478266140170",
|
|
30
|
+
apiId: "ulkb1ikop2",
|
|
31
|
+
domainName: "staging.marketplace.api.repzo.me",
|
|
32
|
+
domainPrefix: "staging",
|
|
33
|
+
http: {
|
|
34
|
+
method: "POST",
|
|
35
|
+
path: "/actions",
|
|
36
|
+
protocol: "HTTP/1.1",
|
|
37
|
+
sourceIp: "52.215.16.239",
|
|
38
|
+
userAgent: "Svix-Webhooks/1.4",
|
|
39
|
+
},
|
|
40
|
+
requestId: "SRE-ejb6IAMEPWQ=",
|
|
41
|
+
routeKey: "POST /actions",
|
|
42
|
+
stage: "$default",
|
|
43
|
+
time: "17/May/2022:11:07:34 +0000",
|
|
44
|
+
timeEpoch: 1652785654069,
|
|
45
|
+
},
|
|
46
|
+
body: JSON.stringify({
|
|
47
|
+
__v: 0,
|
|
48
|
+
_id: "639eaf634428fb70bdc0f1cd",
|
|
49
|
+
authorization:
|
|
50
|
+
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0aW1lem9uZSI6IkFzaWEvUml5YWRoIiwidXNlcm5hbWUiOiJ1bmlwYWxqbzIwNCIsIm5hbWUiOiJWUyBBeWVzaCBJYnJhaGltICBBbGxib29uIiwic2NvcGUiOiJyZXAiLCJuYW1lU3BhY2UiOlsidW5pcGFsam8iXSwidGVhbSI6WyI2MzhjOWNlOWRmOWRjNzcyOTFiMWQyNzgiXSwiaWRlbnRpZmllciI6MTE2NSwiaWQiOiI2MzZhNWY3ZjYyNmJiOTU5Mzc1NzM1NWQiLCJhcHBfY29kZSI6InJlcHpvX3BybyIsImNvdW50cnlfY29kZSI6WyJKTyJdLCJwZXJtYVN0cmluZyI6InZ2djB2dnZ2djB2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnYwdnZ2dnZ2djAwMDB2MHYwdnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2MHZ2dnZ2MHZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2MHYwdnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnYiLCJpYXQiOjE2NzEzMzg2NzksImV4cCI6MTY3MTM4MTg3OX0.E2H5w7-idnhtU5bGNcdo5_8E94z5TUdzTqXXNCEr7oA",
|
|
51
|
+
business_day: "2022-12-18",
|
|
52
|
+
client_id: "639ad007506dfca71556d892",
|
|
53
|
+
client_name: "الاصدقاء - الظليل",
|
|
54
|
+
comment: "",
|
|
55
|
+
company_namespace: ["unisap"],
|
|
56
|
+
createdAt: "2022-12-18T06:13:24.425Z",
|
|
57
|
+
creator: {
|
|
58
|
+
_id: "6395afcaa7fbbe901db1c5d9",
|
|
59
|
+
name: "VS Ayesh Ibrahim Allboon",
|
|
60
|
+
rep: "6395afcaa7fbbe901db1c5d9",
|
|
61
|
+
type: "rep",
|
|
62
|
+
},
|
|
63
|
+
currency: "JOD",
|
|
64
|
+
deductionFixed: 0,
|
|
65
|
+
deductionRatio: 0,
|
|
66
|
+
delivery_date: null,
|
|
67
|
+
discount_amount: 0,
|
|
68
|
+
due_date: "2022-12-18",
|
|
69
|
+
is_void: false,
|
|
70
|
+
issue_date: "2022-12-18",
|
|
71
|
+
items: [
|
|
72
|
+
{
|
|
73
|
+
_id: "639eaf84c843d331be3658c2",
|
|
74
|
+
applicable_promotions: [],
|
|
75
|
+
base_unit_qty: 4,
|
|
76
|
+
class: "invoice",
|
|
77
|
+
company_namespace: [],
|
|
78
|
+
deductedTax: 0,
|
|
79
|
+
deduction: 0,
|
|
80
|
+
deductionBeforeTax: 0,
|
|
81
|
+
deductionRatio: 0,
|
|
82
|
+
discount_value: 0,
|
|
83
|
+
discounted_price: 4210,
|
|
84
|
+
general_promotions: [],
|
|
85
|
+
gross_value: 4884,
|
|
86
|
+
isAdditional: false,
|
|
87
|
+
lineTotalAfterDeduction: 19534,
|
|
88
|
+
line_total: 19534,
|
|
89
|
+
line_total_without_modifiers: 19534,
|
|
90
|
+
measureunit: {
|
|
91
|
+
_id: "63981ca3bee5dd4b6b12e8c6",
|
|
92
|
+
company_namespace: [],
|
|
93
|
+
disabled: false,
|
|
94
|
+
factor: 1,
|
|
95
|
+
name: "PC",
|
|
96
|
+
parent: "63981c32e9f3eafb51d7f0af",
|
|
97
|
+
},
|
|
98
|
+
modifiers_groups: [],
|
|
99
|
+
modifiers_tax_total: 0,
|
|
100
|
+
modifiers_total: 0,
|
|
101
|
+
modifiers_total_before_tax: 0,
|
|
102
|
+
note: "",
|
|
103
|
+
overwritePrice: null,
|
|
104
|
+
price: 4210,
|
|
105
|
+
qty: 4,
|
|
106
|
+
tax: {
|
|
107
|
+
_id: "639715d5edafde008aefe936",
|
|
108
|
+
disabled: false,
|
|
109
|
+
name: "امانات ضريبة المبيعات 16%",
|
|
110
|
+
rate: 0.16,
|
|
111
|
+
type: "additive",
|
|
112
|
+
},
|
|
113
|
+
tax_amount: 674,
|
|
114
|
+
tax_total: 2694,
|
|
115
|
+
tax_total_without_modifiers: 2694,
|
|
116
|
+
total_before_tax: 16840,
|
|
117
|
+
total_before_tax_without_modifiers: 16840,
|
|
118
|
+
used_promotions: [],
|
|
119
|
+
variant: {
|
|
120
|
+
_id: "6398a6ade8a1cfdd26dc66fe",
|
|
121
|
+
listed_price: 0,
|
|
122
|
+
product_id: "6398a6ade8a1cfdd26dc66fc",
|
|
123
|
+
product_name: "BREITSAMER HONEY GOLDEN 500GR",
|
|
124
|
+
variant_id: "6398a6ade8a1cfdd26dc66fe",
|
|
125
|
+
variant_name: "010-BRE-HO0008",
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
latest: true,
|
|
130
|
+
origin_warehouse: "6391cce3f3a9fd99bd2d17e4",
|
|
131
|
+
overwriteTaxExempt: false,
|
|
132
|
+
pre_discount_amount: 0,
|
|
133
|
+
pre_subtotal: 16840,
|
|
134
|
+
pre_tax_amount: 2694,
|
|
135
|
+
pre_taxable_subtotal: 16840,
|
|
136
|
+
pre_total: 19534,
|
|
137
|
+
processable: true,
|
|
138
|
+
promotions: [],
|
|
139
|
+
return_discount_amount: 0,
|
|
140
|
+
return_items: [],
|
|
141
|
+
return_subtotal: 0,
|
|
142
|
+
return_tax_amount: 0,
|
|
143
|
+
return_taxable_subtotal: 0,
|
|
144
|
+
return_total: 0,
|
|
145
|
+
route: null,
|
|
146
|
+
serial_number: {
|
|
147
|
+
_id: "639eaf84c843d331be3658bd",
|
|
148
|
+
count: 80,
|
|
149
|
+
formatted: "INV-1165-80",
|
|
150
|
+
identifier: "1165",
|
|
151
|
+
},
|
|
152
|
+
shipping_charge: 0,
|
|
153
|
+
shipping_price: 0,
|
|
154
|
+
shipping_tax: 0,
|
|
155
|
+
signature: null,
|
|
156
|
+
status: "paid",
|
|
157
|
+
subtotal: 16840,
|
|
158
|
+
sync_id: "948ff1f9-b654-4a87-8858-9d11cb353de4",
|
|
159
|
+
tax_amount: 2694,
|
|
160
|
+
tax_exempt: false,
|
|
161
|
+
taxable_subtotal: 16840,
|
|
162
|
+
taxes: {
|
|
163
|
+
"امانات ضريبة المبيعات 16%": {
|
|
164
|
+
name: "امانات ضريبة المبيعات 16%",
|
|
165
|
+
rate: 0.16,
|
|
166
|
+
total: 2694,
|
|
167
|
+
type: "additive",
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
teams: ["638c9ce9df9dc77291b1d278"],
|
|
171
|
+
time: 1671343991648,
|
|
172
|
+
total: 19534,
|
|
173
|
+
totalDeductedTax: 0,
|
|
174
|
+
totalDeduction: 0,
|
|
175
|
+
totalDeductionBeforeTax: 0,
|
|
176
|
+
total_with_charges: 19534,
|
|
177
|
+
transaction_processed: true,
|
|
178
|
+
updatedAt: "2022-12-18T06:13:29.951Z",
|
|
179
|
+
version: 2,
|
|
180
|
+
visit_id: "15c245fa-3767-4efa-ae63-f5ee962b699d",
|
|
181
|
+
}),
|
|
182
|
+
isBase64Encoded: false,
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
repzoEndPoint: "",
|
|
186
|
+
serviceEndPoint: "",
|
|
187
|
+
env: "staging",
|
|
188
|
+
data: {
|
|
189
|
+
invoices: {
|
|
190
|
+
createInvoiceHook: false,
|
|
191
|
+
createReturnInvoiceHook: false,
|
|
192
|
+
},
|
|
193
|
+
payments: {
|
|
194
|
+
createPaymentHook: false,
|
|
195
|
+
},
|
|
196
|
+
proformas: {
|
|
197
|
+
createApprovedProformaHook: false,
|
|
198
|
+
},
|
|
199
|
+
transfer: {
|
|
200
|
+
createApprovedTransferHook: false,
|
|
201
|
+
},
|
|
202
|
+
repzoApiKey: "L98_Pc8qZG2R5hZIIMjxLQNUgUzT3_0aX2BuLvkyh74",
|
|
203
|
+
sapHostUrl: "http://unipal.b1pro.com:8083/api",
|
|
204
|
+
errorEmail: "maram.alshen@repzoapp.com",
|
|
205
|
+
serviceApiKey: "awdas",
|
|
206
|
+
warehouseDefaultUpdateDate: "2015-01-01",
|
|
207
|
+
DepartmentCode: "D2",
|
|
208
|
+
return_reason:
|
|
209
|
+
'[{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"}]',
|
|
210
|
+
SalPersCode: "111",
|
|
211
|
+
SalesPersonCode: "111",
|
|
212
|
+
},
|
|
213
|
+
}
|
|
214
|
+
);
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { Actions } from "../../index.js";
|
|
2
|
+
Actions(
|
|
3
|
+
{
|
|
4
|
+
version: "2.0",
|
|
5
|
+
routeKey: "POST /actions",
|
|
6
|
+
rawPath: "/actions",
|
|
7
|
+
rawQueryString: "app=repzo-sap-absjo&action=create_payment",
|
|
8
|
+
headers: {
|
|
9
|
+
action_sync_id: "Actions-0000004", // SYNC_ID
|
|
10
|
+
accept: "*/*",
|
|
11
|
+
"accept-encoding": "gzip, deflate",
|
|
12
|
+
"content-length": "3658",
|
|
13
|
+
"content-type": "application/json",
|
|
14
|
+
host: "staging.marketplace.api.repzo.me",
|
|
15
|
+
"svix-id": "msg_29I1By29ETyPiZ4SNrc99KIg7D6",
|
|
16
|
+
"svix-signature": "v1,OkktM+dibxzeb0M6383POFjBr7DX14HECpBIh17FQnU=",
|
|
17
|
+
"svix-timestamp": "1652785653",
|
|
18
|
+
"user-agent": "Svix-Webhooks/1.4",
|
|
19
|
+
"x-amzn-trace-id": "Root=1-628381f6-0b2c6f346d2eb5d207b582ee",
|
|
20
|
+
"x-forwarded-for": "52.215.16.239",
|
|
21
|
+
"x-forwarded-port": "443",
|
|
22
|
+
"x-forwarded-proto": "https",
|
|
23
|
+
},
|
|
24
|
+
queryStringParameters: {
|
|
25
|
+
action: "create_payment",
|
|
26
|
+
app: "repzo-sap-absjo",
|
|
27
|
+
},
|
|
28
|
+
requestContext: {
|
|
29
|
+
accountId: "478266140170",
|
|
30
|
+
apiId: "ulkb1ikop2",
|
|
31
|
+
domainName: "staging.marketplace.api.repzo.me",
|
|
32
|
+
domainPrefix: "staging",
|
|
33
|
+
http: {
|
|
34
|
+
method: "POST",
|
|
35
|
+
path: "/actions",
|
|
36
|
+
protocol: "HTTP/1.1",
|
|
37
|
+
sourceIp: "52.215.16.239",
|
|
38
|
+
userAgent: "Svix-Webhooks/1.4",
|
|
39
|
+
},
|
|
40
|
+
requestId: "SRE-ejb6IAMEPWQ=",
|
|
41
|
+
routeKey: "POST /actions",
|
|
42
|
+
stage: "$default",
|
|
43
|
+
time: "17/May/2022:11:07:34 +0000",
|
|
44
|
+
timeEpoch: 1652785654069,
|
|
45
|
+
},
|
|
46
|
+
body: JSON.stringify({
|
|
47
|
+
_id: "639da8a8298f9ea4d6d543dd",
|
|
48
|
+
status: "unconsumed",
|
|
49
|
+
remainder: 3651631,
|
|
50
|
+
amount: 3651631,
|
|
51
|
+
client_id: "639adef7b4dc172fc503645e",
|
|
52
|
+
client_name: "ماي ماركت _ مسكه لتجارة المواد الغذائية",
|
|
53
|
+
creator: {
|
|
54
|
+
_id: "6395af44a7fbbe901db1c2aa",
|
|
55
|
+
type: "rep",
|
|
56
|
+
name: "RET MUSTAFA MOHAMMAD RASHEED ABDALLAH",
|
|
57
|
+
},
|
|
58
|
+
time: 1671276710322,
|
|
59
|
+
serial_number: {
|
|
60
|
+
identifier: "1036",
|
|
61
|
+
formatted: "PAY-1036-362",
|
|
62
|
+
count: 362,
|
|
63
|
+
_id: "639da8a8298f9ea4d6d543de",
|
|
64
|
+
},
|
|
65
|
+
route: null,
|
|
66
|
+
paytime: "2022-12-17",
|
|
67
|
+
note: "",
|
|
68
|
+
currency: "JOD",
|
|
69
|
+
payment_type: "check",
|
|
70
|
+
check: {
|
|
71
|
+
drawer_name: "شركة مسكة لتجارة المواد الغذائيه ",
|
|
72
|
+
bank: "639863e6333b84929c539077",
|
|
73
|
+
bank_branch: "دابوق ",
|
|
74
|
+
check_number: 11322,
|
|
75
|
+
check_date: "2022-12-17",
|
|
76
|
+
photo:
|
|
77
|
+
"https://repzo-media-service.s3.eu-west-2.amazonaws.com/unisap/image/2022/12/17/f7027375-8e21-4b0d-baff-15bc7e642803.jpeg",
|
|
78
|
+
media: [],
|
|
79
|
+
caption: null,
|
|
80
|
+
disabled: false,
|
|
81
|
+
_id: "639da8a8298f9ea4d6d543df",
|
|
82
|
+
},
|
|
83
|
+
company_namespace: ["unisap"],
|
|
84
|
+
sync_id: "0109372a-8479-44ba-b519-5f1041afca8e",
|
|
85
|
+
teams: [],
|
|
86
|
+
paymentsData: {
|
|
87
|
+
amount: -3651631,
|
|
88
|
+
paid: 0,
|
|
89
|
+
balance: -3651631,
|
|
90
|
+
payments: [],
|
|
91
|
+
_id: "639da8a8298f9ea4d6d543e0",
|
|
92
|
+
},
|
|
93
|
+
reference: "",
|
|
94
|
+
createdAt: "2022-12-17T11:31:52.069Z",
|
|
95
|
+
updatedAt: "2022-12-17T11:31:52.069Z",
|
|
96
|
+
__v: 0,
|
|
97
|
+
balance_to_refund: 3651631,
|
|
98
|
+
}),
|
|
99
|
+
isBase64Encoded: false,
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
repzoEndPoint: "",
|
|
103
|
+
serviceEndPoint: "",
|
|
104
|
+
env: "staging",
|
|
105
|
+
data: {
|
|
106
|
+
invoices: {
|
|
107
|
+
createInvoiceHook: false,
|
|
108
|
+
createReturnInvoiceHook: false,
|
|
109
|
+
},
|
|
110
|
+
payments: {
|
|
111
|
+
createPaymentHook: false,
|
|
112
|
+
},
|
|
113
|
+
proformas: {
|
|
114
|
+
createApprovedProformaHook: false,
|
|
115
|
+
},
|
|
116
|
+
transfer: {
|
|
117
|
+
createApprovedTransferHook: false,
|
|
118
|
+
},
|
|
119
|
+
repzoApiKey: "L98_Pc8qZG2R5hZIIMjxLQNUgUzT3_0aX2BuLvkyh74",
|
|
120
|
+
sapHostUrl: "http://unipal.b1pro.com:8083/api",
|
|
121
|
+
errorEmail: "maram.alshen@repzoapp.com",
|
|
122
|
+
serviceApiKey: "awdas",
|
|
123
|
+
warehouseDefaultUpdateDate: "2015-01-01",
|
|
124
|
+
DepartmentCode: "D2",
|
|
125
|
+
return_reason:
|
|
126
|
+
'[{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"}]',
|
|
127
|
+
SalPersCode: "111",
|
|
128
|
+
SalesPersonCode: "111",
|
|
129
|
+
},
|
|
130
|
+
}
|
|
131
|
+
);
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { Actions } from "../../index.js";
|
|
2
|
+
Actions(
|
|
3
|
+
{
|
|
4
|
+
version: "2.0",
|
|
5
|
+
routeKey: "POST /actions",
|
|
6
|
+
rawPath: "/actions",
|
|
7
|
+
rawQueryString: "app=repzo-sap-absjo&action=create_proforma",
|
|
8
|
+
headers: {
|
|
9
|
+
action_sync_id: "Actions-0000003", // SYNC_ID
|
|
10
|
+
accept: "*/*",
|
|
11
|
+
"accept-encoding": "gzip, deflate",
|
|
12
|
+
"content-length": "3658",
|
|
13
|
+
"content-type": "application/json",
|
|
14
|
+
host: "staging.marketplace.api.repzo.me",
|
|
15
|
+
"svix-id": "msg_29I1By29ETyPiZ4SNrc99KIg7D6",
|
|
16
|
+
"svix-signature": "v1,OkktM+dibxzeb0M6383POFjBr7DX14HECpBIh17FQnU=",
|
|
17
|
+
"svix-timestamp": "1652785653",
|
|
18
|
+
"user-agent": "Svix-Webhooks/1.4",
|
|
19
|
+
"x-amzn-trace-id": "Root=1-628381f6-0b2c6f346d2eb5d207b582ee",
|
|
20
|
+
"x-forwarded-for": "52.215.16.239",
|
|
21
|
+
"x-forwarded-port": "443",
|
|
22
|
+
"x-forwarded-proto": "https",
|
|
23
|
+
},
|
|
24
|
+
queryStringParameters: {
|
|
25
|
+
action: "create_proforma",
|
|
26
|
+
app: "repzo-sap-absjo",
|
|
27
|
+
},
|
|
28
|
+
requestContext: {
|
|
29
|
+
accountId: "478266140170",
|
|
30
|
+
apiId: "ulkb1ikop2",
|
|
31
|
+
domainName: "staging.marketplace.api.repzo.me",
|
|
32
|
+
domainPrefix: "staging",
|
|
33
|
+
http: {
|
|
34
|
+
method: "POST",
|
|
35
|
+
path: "/actions",
|
|
36
|
+
protocol: "HTTP/1.1",
|
|
37
|
+
sourceIp: "52.215.16.239",
|
|
38
|
+
userAgent: "Svix-Webhooks/1.4",
|
|
39
|
+
},
|
|
40
|
+
requestId: "SRE-ejb6IAMEPWQ=",
|
|
41
|
+
routeKey: "POST /actions",
|
|
42
|
+
stage: "$default",
|
|
43
|
+
time: "17/May/2022:11:07:34 +0000",
|
|
44
|
+
timeEpoch: 1652785654069,
|
|
45
|
+
},
|
|
46
|
+
body: JSON.stringify({
|
|
47
|
+
_id: "639dc3af162ee0872ff7356c",
|
|
48
|
+
processable: true,
|
|
49
|
+
client_id: "639ae1df506dfca71557a7f7",
|
|
50
|
+
client_name: "تزويد للحلول التجاريه",
|
|
51
|
+
comment: "تسليم المفرق ",
|
|
52
|
+
creator: {
|
|
53
|
+
_id: "6395af40a7fbbe901db1c28c",
|
|
54
|
+
type: "rep",
|
|
55
|
+
rep: "6395af40a7fbbe901db1c28c",
|
|
56
|
+
name: "RET KHALDOUN IBRAHIM MOHAMMAD OTHMAN",
|
|
57
|
+
},
|
|
58
|
+
latest: true,
|
|
59
|
+
version: 1,
|
|
60
|
+
time: 1671283619190,
|
|
61
|
+
business_day: "2022-12-17",
|
|
62
|
+
issue_date: "2022-12-17",
|
|
63
|
+
delivery_date: null,
|
|
64
|
+
currency: "JOD",
|
|
65
|
+
serial_number: {
|
|
66
|
+
identifier: "1032",
|
|
67
|
+
formatted: "PRO-1032-1602",
|
|
68
|
+
count: 1602,
|
|
69
|
+
_id: "639dc3af162ee0872ff7356d",
|
|
70
|
+
},
|
|
71
|
+
route: null,
|
|
72
|
+
geo_tag: {
|
|
73
|
+
type: "Point",
|
|
74
|
+
coordinates: [35.9446535, 31.8430022],
|
|
75
|
+
_id: "639dc3af162ee0872ff7356e",
|
|
76
|
+
},
|
|
77
|
+
sync_id: "29816665-1664-4a06-8300-2414fd111840",
|
|
78
|
+
company_namespace: ["unipaljo"],
|
|
79
|
+
promotions: [],
|
|
80
|
+
priceLists: [
|
|
81
|
+
{
|
|
82
|
+
_id: "61c9b0740281e55fe35ee7c1",
|
|
83
|
+
product_id: "6398bd370242db686d474f58",
|
|
84
|
+
variant_id: "6398bd370242db686d474f5a",
|
|
85
|
+
pricelist_id: "61c9b01f0281e55fe35ee03e",
|
|
86
|
+
price: 1642,
|
|
87
|
+
disabled: false,
|
|
88
|
+
createdAt: "2021-12-27T12:24:20.168Z",
|
|
89
|
+
updatedAt: "2022-02-17T07:44:23.940Z",
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
visit_id: "54306e61-ac85-4c99-94e4-9cecd408c4d2",
|
|
93
|
+
teams: [],
|
|
94
|
+
editor: {
|
|
95
|
+
_id: "61943ed1282027d0bff9972f",
|
|
96
|
+
type: "admin",
|
|
97
|
+
admin: "61943ed1282027d0bff9972f",
|
|
98
|
+
name: "Ali Inab",
|
|
99
|
+
},
|
|
100
|
+
disabled: false,
|
|
101
|
+
status: "approved",
|
|
102
|
+
items: [
|
|
103
|
+
{
|
|
104
|
+
isAdditional: false,
|
|
105
|
+
variant: {
|
|
106
|
+
product_id: "6398bd370242db686d474f58",
|
|
107
|
+
product_name: "Unium Chicken Luncheon Meat 500gm @ 15% P.off",
|
|
108
|
+
variant_id: "6398bd370242db686d474f5a",
|
|
109
|
+
variant_name: "010-UNI-UN0058",
|
|
110
|
+
listed_price: 0,
|
|
111
|
+
_id: "6398bd370242db686d474f5a",
|
|
112
|
+
variant_sku: "",
|
|
113
|
+
product_sku: "010-UNI-UN0058",
|
|
114
|
+
variant_barcode: "",
|
|
115
|
+
product_barcode: "6253005346534",
|
|
116
|
+
},
|
|
117
|
+
qty: 50,
|
|
118
|
+
measureunit: {
|
|
119
|
+
parent: "63981c32e9f3eafb51d7f0af",
|
|
120
|
+
name: "CRTN",
|
|
121
|
+
factor: 24,
|
|
122
|
+
disabled: false,
|
|
123
|
+
company_namespace: [],
|
|
124
|
+
_id: "63981cb0edafde008af0d513",
|
|
125
|
+
},
|
|
126
|
+
tax: {
|
|
127
|
+
name: "امانات ضريبة المبيعات 10%",
|
|
128
|
+
rate: 0.1,
|
|
129
|
+
type: "additive",
|
|
130
|
+
disabled: false,
|
|
131
|
+
_id: "639715d5bee5dd4b6b11e430",
|
|
132
|
+
},
|
|
133
|
+
base_unit_qty: 1200,
|
|
134
|
+
overwritePrice: null,
|
|
135
|
+
price: 1642,
|
|
136
|
+
discounted_price: 1642,
|
|
137
|
+
tax_amount: 164,
|
|
138
|
+
tax_total: 197040,
|
|
139
|
+
discount_value: 0,
|
|
140
|
+
gross_value: 1806,
|
|
141
|
+
line_total: 2167440,
|
|
142
|
+
total_before_tax: 1970400,
|
|
143
|
+
modifiers_total: 0,
|
|
144
|
+
modifiers_total_before_tax: 0,
|
|
145
|
+
modifiers_tax_total: 0,
|
|
146
|
+
tax_total_without_modifiers: 197040,
|
|
147
|
+
line_total_without_modifiers: 2167440,
|
|
148
|
+
total_before_tax_without_modifiers: 1970400,
|
|
149
|
+
deductionRatio: 0,
|
|
150
|
+
deductedTax: 0,
|
|
151
|
+
deduction: 0,
|
|
152
|
+
deductionBeforeTax: 0,
|
|
153
|
+
lineTotalAfterDeduction: 2167440,
|
|
154
|
+
promotions: {
|
|
155
|
+
isGet: false,
|
|
156
|
+
taken: 0,
|
|
157
|
+
free: 1200,
|
|
158
|
+
bookings: [],
|
|
159
|
+
highlight: false,
|
|
160
|
+
},
|
|
161
|
+
used_promotions: [],
|
|
162
|
+
general_promotions: [],
|
|
163
|
+
applicable_promotions: [],
|
|
164
|
+
modifiers_groups: [],
|
|
165
|
+
company_namespace: [],
|
|
166
|
+
note: "",
|
|
167
|
+
_id: "639dc3af162ee0872ff7356f",
|
|
168
|
+
},
|
|
169
|
+
],
|
|
170
|
+
subtotal: 1970400,
|
|
171
|
+
discount_amount: 0,
|
|
172
|
+
taxable_subtotal: 1970400,
|
|
173
|
+
tax_amount: 197040,
|
|
174
|
+
total: 2167440,
|
|
175
|
+
pre_subtotal: 1970400,
|
|
176
|
+
pre_discount_amount: 0,
|
|
177
|
+
pre_taxable_subtotal: 1970400,
|
|
178
|
+
pre_tax_amount: 197040,
|
|
179
|
+
pre_total: 2167440,
|
|
180
|
+
return_subtotal: 0,
|
|
181
|
+
return_discount_amount: 0,
|
|
182
|
+
return_taxable_subtotal: 0,
|
|
183
|
+
return_tax_amount: 0,
|
|
184
|
+
return_total: 0,
|
|
185
|
+
deductionRatio: 0,
|
|
186
|
+
deductionFixed: 0,
|
|
187
|
+
totalDeductedTax: 0,
|
|
188
|
+
totalDeduction: 0,
|
|
189
|
+
totalDeductionBeforeTax: 0,
|
|
190
|
+
totalAfterDeduction: 2167440,
|
|
191
|
+
taxes: {
|
|
192
|
+
"امانات ضريبة المبيعات 10%": {
|
|
193
|
+
name: "امانات ضريبة المبيعات 10%",
|
|
194
|
+
rate: 0.1,
|
|
195
|
+
total: 197040,
|
|
196
|
+
type: "additive",
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
overwriteTaxExempt: false,
|
|
200
|
+
tax_exempt: false,
|
|
201
|
+
shipping_price: 0,
|
|
202
|
+
shipping_tax: 0,
|
|
203
|
+
shipping_charge: 0,
|
|
204
|
+
payment_charge: 0,
|
|
205
|
+
total_with_charges: 2167440,
|
|
206
|
+
createdAt: "2022-12-17T13:27:11.321Z",
|
|
207
|
+
updatedAt: "2022-12-17T18:33:43.378Z",
|
|
208
|
+
__v: 0,
|
|
209
|
+
}),
|
|
210
|
+
isBase64Encoded: false,
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
repzoEndPoint: "",
|
|
214
|
+
serviceEndPoint: "",
|
|
215
|
+
env: "staging",
|
|
216
|
+
data: {
|
|
217
|
+
invoices: {
|
|
218
|
+
createInvoiceHook: false,
|
|
219
|
+
createReturnInvoiceHook: false,
|
|
220
|
+
},
|
|
221
|
+
payments: {
|
|
222
|
+
createPaymentHook: false,
|
|
223
|
+
},
|
|
224
|
+
proformas: {
|
|
225
|
+
createApprovedProformaHook: false,
|
|
226
|
+
},
|
|
227
|
+
transfer: {
|
|
228
|
+
createApprovedTransferHook: false,
|
|
229
|
+
},
|
|
230
|
+
repzoApiKey: "L98_Pc8qZG2R5hZIIMjxLQNUgUzT3_0aX2BuLvkyh74",
|
|
231
|
+
sapHostUrl: "http://unipal.b1pro.com:8083/api",
|
|
232
|
+
errorEmail: "maram.alshen@repzoapp.com",
|
|
233
|
+
serviceApiKey: "awdas",
|
|
234
|
+
warehouseDefaultUpdateDate: "2015-01-01",
|
|
235
|
+
DepartmentCode: "D2",
|
|
236
|
+
return_reason:
|
|
237
|
+
'[{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"}]',
|
|
238
|
+
SalPersCode: "111",
|
|
239
|
+
SalesPersonCode: "111",
|
|
240
|
+
},
|
|
241
|
+
}
|
|
242
|
+
);
|