@managesome/eposmatic-toolkit 0.2.446 → 0.2.449
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/helpers/store/common-warehouse-purchase-order-rfq-actions.js +1 -1
- package/lib/helpers/store/common-warehouse-sale-order-rfq-actions.d.ts +2 -2
- package/lib/helpers/store/index.d.ts +1 -0
- package/lib/helpers/store/index.js +1 -0
- package/lib/helpers/store/warehouse-purchase-order-rfq-cart-actions.d.ts +9 -9
- package/lib/helpers/store/warehouse-purchase-order-rfq-cart-actions.js +26 -26
- package/lib/helpers/store/warehouse-sale-order-rfq-cart-actions.d.ts +18 -0
- package/lib/helpers/store/warehouse-sale-order-rfq-cart-actions.js +286 -0
- package/lib/schemas/models/warehouse_sale_orders.d.ts +13 -12
- package/lib/schemas/models/warehouse_sale_orders.js +1 -1
- package/lib/schemas/types/index.d.ts +0 -1
- package/lib/schemas/types/index.js +0 -1
- package/lib/schemas/types/warehouse_sale_order_rfqs.d.ts +33 -4
- package/lib/schemas/types/warehouse_sale_orders.d.ts +33 -4
- package/package.json +1 -1
|
@@ -80,7 +80,7 @@ function syncWarehousePurchaseOrderRfqData(order) {
|
|
|
80
80
|
...order,
|
|
81
81
|
iterations: [],
|
|
82
82
|
};
|
|
83
|
-
const newOrder = getWarehousePurchaseOrderRfqWithPrice((0, warehouse_purchase_order_rfq_cart_actions_1.
|
|
83
|
+
const newOrder = getWarehousePurchaseOrderRfqWithPrice((0, warehouse_purchase_order_rfq_cart_actions_1.calculateCartWarehousePurchaseOrderRfqOrderInfoAndSyncData)(getWarehousePurchaseOrderRfqWithPrice(updatedOrder), true), true);
|
|
84
84
|
newOrder.iterations = order.iterations;
|
|
85
85
|
return newOrder;
|
|
86
86
|
}
|
|
@@ -24,8 +24,8 @@ interface IGetVoidItemsWithReasonSaleOrderRfq {
|
|
|
24
24
|
previousCategories: IWarehouseSaleOrderRFQCategory[];
|
|
25
25
|
}
|
|
26
26
|
export declare function getVoidItemsWithReasonWarehouseSaleOrderRfq({ currentCategories, iterationsFromFrontend, previousCategories, }: IGetVoidItemsWithReasonSaleOrderRfq): {
|
|
27
|
-
newIterationCategories:
|
|
28
|
-
voidOrderItems:
|
|
27
|
+
newIterationCategories: IWarehouseSaleOrderRFQCategory[];
|
|
28
|
+
voidOrderItems: IWarehouseSaleOrderRFQItem[];
|
|
29
29
|
hasNewItems: boolean;
|
|
30
30
|
};
|
|
31
31
|
export {};
|
|
@@ -18,3 +18,4 @@ export * from './offline-ordering';
|
|
|
18
18
|
export * from './warehouse-invoice-cart-actions';
|
|
19
19
|
export * from './warehouse-purchase-order-rfq-cart-actions';
|
|
20
20
|
export * from './warehouse-purchase-orders-cart-actions';
|
|
21
|
+
export * from './warehouse-sale-order-rfq-cart-actions';
|
|
@@ -34,3 +34,4 @@ __exportStar(require("./offline-ordering"), exports);
|
|
|
34
34
|
__exportStar(require("./warehouse-invoice-cart-actions"), exports);
|
|
35
35
|
__exportStar(require("./warehouse-purchase-order-rfq-cart-actions"), exports);
|
|
36
36
|
__exportStar(require("./warehouse-purchase-orders-cart-actions"), exports);
|
|
37
|
+
__exportStar(require("./warehouse-sale-order-rfq-cart-actions"), exports);
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { IWarehousePurchaseOrderRFQ, IWarehousePurchaseOrderRFQItem } from '../../schemas';
|
|
2
|
-
export declare function
|
|
3
|
-
export declare function
|
|
2
|
+
export declare function calculateCartWarehousePurchaseOrderRfqOrderInfoAndSyncData<T extends IWarehousePurchaseOrderRFQ | Partial<IWarehousePurchaseOrderRFQ>>(data: T, calculateItemMetadata?: boolean): T;
|
|
3
|
+
export declare function getRemoveItemFromWarehousePurchaseOrderRfqCartData(data: Partial<IWarehousePurchaseOrderRFQ>, payload: {
|
|
4
4
|
_id: string;
|
|
5
5
|
void_reason?: string;
|
|
6
6
|
}): Partial<IWarehousePurchaseOrderRFQ>;
|
|
7
|
-
export declare function
|
|
8
|
-
interface
|
|
7
|
+
export declare function getUpdateWarehousePurchaseOrderRfqCartInfoData(data: Partial<IWarehousePurchaseOrderRFQ>, payload: Partial<IWarehousePurchaseOrderRFQ>): Partial<IWarehousePurchaseOrderRFQ>;
|
|
8
|
+
interface ISetAddItemToPurchaseOrderRfqCartActionPayload {
|
|
9
9
|
name: string;
|
|
10
10
|
category_id: string;
|
|
11
11
|
item: IWarehousePurchaseOrderRFQItem;
|
|
12
12
|
replace_id?: string;
|
|
13
13
|
}
|
|
14
|
-
export declare function
|
|
15
|
-
export declare function
|
|
16
|
-
export declare function
|
|
17
|
-
export declare function
|
|
18
|
-
export declare function
|
|
14
|
+
export declare function getAddItemToWarehousePurchaseOrderRfqCartData(data: Partial<IWarehousePurchaseOrderRFQ>, payload: ISetAddItemToPurchaseOrderRfqCartActionPayload): Partial<IWarehousePurchaseOrderRFQ>;
|
|
15
|
+
export declare function getUpdateItemInWarehousePurchaseOrderRfqCartData(data: Partial<IWarehousePurchaseOrderRFQ>, payload: Partial<IWarehousePurchaseOrderRFQItem>): Partial<IWarehousePurchaseOrderRFQ>;
|
|
16
|
+
export declare function getUpdateItemsInWarehousePurchaseOrderRfqCartData(data: Partial<IWarehousePurchaseOrderRFQ>, payload: Partial<IWarehousePurchaseOrderRFQItem>[]): Partial<IWarehousePurchaseOrderRFQ>;
|
|
17
|
+
export declare function getSplitWarehousePurchaseOrderRfqCartItemToTwo(data: Partial<IWarehousePurchaseOrderRFQ>, orderItemId: string): Partial<IWarehousePurchaseOrderRFQ>;
|
|
18
|
+
export declare function getAddItemsToWarehousePurchaseOrderRfqCartData(data: Partial<IWarehousePurchaseOrderRFQ>, payload: ISetAddItemToPurchaseOrderRfqCartActionPayload[]): Partial<IWarehousePurchaseOrderRFQ>;
|
|
19
19
|
export {};
|
|
@@ -3,14 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
8
|
-
exports.
|
|
9
|
-
exports.
|
|
10
|
-
exports.
|
|
11
|
-
exports.
|
|
12
|
-
exports.
|
|
13
|
-
exports.
|
|
6
|
+
exports.calculateCartWarehousePurchaseOrderRfqOrderInfoAndSyncData = calculateCartWarehousePurchaseOrderRfqOrderInfoAndSyncData;
|
|
7
|
+
exports.getRemoveItemFromWarehousePurchaseOrderRfqCartData = getRemoveItemFromWarehousePurchaseOrderRfqCartData;
|
|
8
|
+
exports.getUpdateWarehousePurchaseOrderRfqCartInfoData = getUpdateWarehousePurchaseOrderRfqCartInfoData;
|
|
9
|
+
exports.getAddItemToWarehousePurchaseOrderRfqCartData = getAddItemToWarehousePurchaseOrderRfqCartData;
|
|
10
|
+
exports.getUpdateItemInWarehousePurchaseOrderRfqCartData = getUpdateItemInWarehousePurchaseOrderRfqCartData;
|
|
11
|
+
exports.getUpdateItemsInWarehousePurchaseOrderRfqCartData = getUpdateItemsInWarehousePurchaseOrderRfqCartData;
|
|
12
|
+
exports.getSplitWarehousePurchaseOrderRfqCartItemToTwo = getSplitWarehousePurchaseOrderRfqCartItemToTwo;
|
|
13
|
+
exports.getAddItemsToWarehousePurchaseOrderRfqCartData = getAddItemsToWarehousePurchaseOrderRfqCartData;
|
|
14
14
|
const bson_objectid_1 = __importDefault(require("bson-objectid"));
|
|
15
15
|
const lodash_1 = require("lodash");
|
|
16
16
|
const constants_1 = require("../../constants");
|
|
@@ -20,7 +20,7 @@ const utils_1 = require("../utils");
|
|
|
20
20
|
* IWarehousePurchaseOrderRFQCategory ≡ IPurchaseOrderCategory (same type),
|
|
21
21
|
* IWarehousePurchaseOrderRFQItem ≡ IWarehousePurchaseOrderItem (same type).
|
|
22
22
|
* ================================================================= */
|
|
23
|
-
function
|
|
23
|
+
function calculateCartWarehousePurchaseOrderRfqOrderInfoAndSyncData(data, calculateItemMetadata) {
|
|
24
24
|
const isConfirmed = data.order_status === constants_1.WAREHOUSE_PURCHASE_ORDER_RFQ_STATUS_ENUM.CONFIRMED;
|
|
25
25
|
let subtotal = 0;
|
|
26
26
|
const categories = [];
|
|
@@ -106,14 +106,14 @@ function calculateCartWarehouseRfqOrderInfoAndSyncData(data, calculateItemMetada
|
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
108
|
// ── Shared ──
|
|
109
|
-
const
|
|
109
|
+
const getUpdatedPurchaseOrderRfqItem = (item) => ({
|
|
110
110
|
item_id: item.item_id,
|
|
111
111
|
name: item.name,
|
|
112
112
|
price: item.price,
|
|
113
113
|
special_instructions: item.special_instructions,
|
|
114
114
|
});
|
|
115
115
|
// ── Remove ──
|
|
116
|
-
function
|
|
116
|
+
function getRemoveItemFromWarehousePurchaseOrderRfqCartData(data, payload) {
|
|
117
117
|
const orderItemIdsMap = {};
|
|
118
118
|
let categories;
|
|
119
119
|
if (data.categories != null) {
|
|
@@ -164,17 +164,17 @@ function getRemoveItemFromWarehouseRfqCartData(data, payload) {
|
|
|
164
164
|
}
|
|
165
165
|
iterations.push({ ...firstIteration, categories: firstIterationCategories }, ...restIterations);
|
|
166
166
|
}
|
|
167
|
-
return
|
|
167
|
+
return calculateCartWarehousePurchaseOrderRfqOrderInfoAndSyncData({
|
|
168
168
|
...data,
|
|
169
169
|
...(iterations.length > 0 && { iterations }),
|
|
170
170
|
categories,
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
173
|
// ── Update Info ──
|
|
174
|
-
function
|
|
175
|
-
return
|
|
174
|
+
function getUpdateWarehousePurchaseOrderRfqCartInfoData(data, payload) {
|
|
175
|
+
return calculateCartWarehousePurchaseOrderRfqOrderInfoAndSyncData({ ...data, ...payload });
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function getAddItemToWarehousePurchaseOrderRfqCartData(data, payload) {
|
|
178
178
|
const { category_id, name, item, replace_id } = payload;
|
|
179
179
|
let mainItemId = item._id;
|
|
180
180
|
const orderData = { ...data };
|
|
@@ -184,7 +184,7 @@ function getAddItemToWarehouseRfqCartData(data, payload) {
|
|
|
184
184
|
const category = categories[i];
|
|
185
185
|
if (category.category_id !== category_id)
|
|
186
186
|
continue;
|
|
187
|
-
const updatedItem =
|
|
187
|
+
const updatedItem = getUpdatedPurchaseOrderRfqItem(item);
|
|
188
188
|
const allItems = [...category.items];
|
|
189
189
|
let didFindItem = false;
|
|
190
190
|
let itemExists = false;
|
|
@@ -202,7 +202,7 @@ function getAddItemToWarehouseRfqCartData(data, payload) {
|
|
|
202
202
|
if (!didFindItem && itemExists) {
|
|
203
203
|
for (let j = 0; j < allItems.length; j++) {
|
|
204
204
|
const itm = allItems[j];
|
|
205
|
-
if (itm.item_id === item.item_id && (0, lodash_1.isEqual)(
|
|
205
|
+
if (itm.item_id === item.item_id && (0, lodash_1.isEqual)(getUpdatedPurchaseOrderRfqItem(itm), updatedItem)) {
|
|
206
206
|
mainItemId = replace_id ?? itm._id;
|
|
207
207
|
allItems[j] = {
|
|
208
208
|
...item,
|
|
@@ -256,14 +256,14 @@ function getAddItemToWarehouseRfqCartData(data, payload) {
|
|
|
256
256
|
}
|
|
257
257
|
iterations.push({ ...firstIteration, categories: firstIterationCategories }, ...restIterations);
|
|
258
258
|
}
|
|
259
|
-
return
|
|
259
|
+
return calculateCartWarehousePurchaseOrderRfqOrderInfoAndSyncData({
|
|
260
260
|
...orderData,
|
|
261
261
|
...(iterations.length > 0 && { iterations }),
|
|
262
262
|
categories,
|
|
263
263
|
});
|
|
264
264
|
}
|
|
265
265
|
// ── Update Item ──
|
|
266
|
-
function
|
|
266
|
+
function getUpdateItemInWarehousePurchaseOrderRfqCartData(data, payload) {
|
|
267
267
|
const orderItemIdsMap = {};
|
|
268
268
|
let categories;
|
|
269
269
|
if (data.categories != null) {
|
|
@@ -318,18 +318,18 @@ function getUpdateItemInWarehouseRfqCartData(data, payload) {
|
|
|
318
318
|
}
|
|
319
319
|
iterations.push({ ...firstIteration, categories: firstIterationCategories }, ...restIterations);
|
|
320
320
|
}
|
|
321
|
-
return
|
|
321
|
+
return calculateCartWarehousePurchaseOrderRfqOrderInfoAndSyncData({
|
|
322
322
|
...data,
|
|
323
323
|
...(iterations.length > 0 && { iterations }),
|
|
324
324
|
categories,
|
|
325
325
|
});
|
|
326
326
|
}
|
|
327
327
|
// ── Update Items (batch) ──
|
|
328
|
-
function
|
|
329
|
-
return payload.reduce((acc, item) =>
|
|
328
|
+
function getUpdateItemsInWarehousePurchaseOrderRfqCartData(data, payload) {
|
|
329
|
+
return payload.reduce((acc, item) => getUpdateItemInWarehousePurchaseOrderRfqCartData(acc, item), data);
|
|
330
330
|
}
|
|
331
331
|
// ── Split Item ──
|
|
332
|
-
function
|
|
332
|
+
function getSplitWarehousePurchaseOrderRfqCartItemToTwo(data, orderItemId) {
|
|
333
333
|
if (data.categories == null)
|
|
334
334
|
return data;
|
|
335
335
|
const newCategories = [];
|
|
@@ -362,12 +362,12 @@ function getSplitWarehouseRfqCartItemToTwo(data, orderItemId) {
|
|
|
362
362
|
}
|
|
363
363
|
newCategories.push({ ...category, items: newItems });
|
|
364
364
|
}
|
|
365
|
-
return
|
|
365
|
+
return calculateCartWarehousePurchaseOrderRfqOrderInfoAndSyncData({
|
|
366
366
|
...data,
|
|
367
367
|
categories: newCategories,
|
|
368
368
|
});
|
|
369
369
|
}
|
|
370
370
|
// ── Add Items (batch) ──
|
|
371
|
-
function
|
|
372
|
-
return payload.reduce((acc, item) =>
|
|
371
|
+
function getAddItemsToWarehousePurchaseOrderRfqCartData(data, payload) {
|
|
372
|
+
return payload.reduce((acc, item) => getAddItemToWarehousePurchaseOrderRfqCartData(acc, item), data);
|
|
373
373
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IWarehouseSaleOrderRFQ, IWarehouseSaleOrderRFQItem } from '../../schemas';
|
|
2
|
+
export declare function getRemoveItemFromWarehouseSaleOrderRfqCartData(data: Partial<IWarehouseSaleOrderRFQ>, payload: {
|
|
3
|
+
_id: string;
|
|
4
|
+
void_reason?: string;
|
|
5
|
+
}): Partial<IWarehouseSaleOrderRFQ>;
|
|
6
|
+
export declare function getUpdateWarehouseSaleOrderRfqCartInfoData(data: Partial<IWarehouseSaleOrderRFQ>, payload: Partial<IWarehouseSaleOrderRFQ>): Partial<IWarehouseSaleOrderRFQ>;
|
|
7
|
+
interface ISetAddItemToSaleOrderRfqCartActionPayload {
|
|
8
|
+
name: string;
|
|
9
|
+
category_id: string;
|
|
10
|
+
item: IWarehouseSaleOrderRFQItem;
|
|
11
|
+
replace_id?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function getAddItemToWarehouseSaleOrderRfqCartData(data: Partial<IWarehouseSaleOrderRFQ>, payload: ISetAddItemToSaleOrderRfqCartActionPayload): Partial<IWarehouseSaleOrderRFQ>;
|
|
14
|
+
export declare function getUpdateItemInWarehouseSaleOrderRfqCartData(data: Partial<IWarehouseSaleOrderRFQ>, payload: Partial<IWarehouseSaleOrderRFQItem>): Partial<IWarehouseSaleOrderRFQ>;
|
|
15
|
+
export declare function getUpdateItemsInWarehouseSaleOrderRfqCartData(data: Partial<IWarehouseSaleOrderRFQ>, payload: Partial<IWarehouseSaleOrderRFQItem>[]): Partial<IWarehouseSaleOrderRFQ>;
|
|
16
|
+
export declare function getSplitWarehouseSaleOrderRfqCartItemToTwo(data: Partial<IWarehouseSaleOrderRFQ>, orderItemId: string): Partial<IWarehouseSaleOrderRFQ>;
|
|
17
|
+
export declare function getAddItemsToWarehouseSaleOrderRfqCartData(data: Partial<IWarehouseSaleOrderRFQ>, payload: ISetAddItemToSaleOrderRfqCartActionPayload[]): Partial<IWarehouseSaleOrderRFQ>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getRemoveItemFromWarehouseSaleOrderRfqCartData = getRemoveItemFromWarehouseSaleOrderRfqCartData;
|
|
7
|
+
exports.getUpdateWarehouseSaleOrderRfqCartInfoData = getUpdateWarehouseSaleOrderRfqCartInfoData;
|
|
8
|
+
exports.getAddItemToWarehouseSaleOrderRfqCartData = getAddItemToWarehouseSaleOrderRfqCartData;
|
|
9
|
+
exports.getUpdateItemInWarehouseSaleOrderRfqCartData = getUpdateItemInWarehouseSaleOrderRfqCartData;
|
|
10
|
+
exports.getUpdateItemsInWarehouseSaleOrderRfqCartData = getUpdateItemsInWarehouseSaleOrderRfqCartData;
|
|
11
|
+
exports.getSplitWarehouseSaleOrderRfqCartItemToTwo = getSplitWarehouseSaleOrderRfqCartItemToTwo;
|
|
12
|
+
exports.getAddItemsToWarehouseSaleOrderRfqCartData = getAddItemsToWarehouseSaleOrderRfqCartData;
|
|
13
|
+
const bson_objectid_1 = __importDefault(require("bson-objectid"));
|
|
14
|
+
const lodash_1 = require("lodash");
|
|
15
|
+
const utils_1 = require("../utils");
|
|
16
|
+
const common_warehouse_sale_order_rfq_actions_1 = require("./common-warehouse-sale-order-rfq-actions");
|
|
17
|
+
/* =================================================================
|
|
18
|
+
* Sale-order RFQ cart helpers — CRUD operations for cart items.
|
|
19
|
+
* Mirrors warehouse-purchase-order-rfq-cart-actions.ts for sale RFQ types.
|
|
20
|
+
* ================================================================= */
|
|
21
|
+
// ── Shared ──
|
|
22
|
+
const getUpdatedSaleOrderRfqItem = (item) => ({
|
|
23
|
+
item_id: item.item_id,
|
|
24
|
+
name: item.name,
|
|
25
|
+
price: item.price,
|
|
26
|
+
special_instructions: item.special_instructions,
|
|
27
|
+
});
|
|
28
|
+
// ── Remove ──
|
|
29
|
+
function getRemoveItemFromWarehouseSaleOrderRfqCartData(data, payload) {
|
|
30
|
+
const orderItemIdsMap = {};
|
|
31
|
+
let categories;
|
|
32
|
+
if (data.categories != null) {
|
|
33
|
+
categories = [];
|
|
34
|
+
for (let i = 0; i < data.categories.length; i++) {
|
|
35
|
+
const category = data.categories[i];
|
|
36
|
+
const items = [];
|
|
37
|
+
for (let j = 0; j < category.items.length; j++) {
|
|
38
|
+
const item = category.items[j];
|
|
39
|
+
if (item._id !== payload._id) {
|
|
40
|
+
items.push(item);
|
|
41
|
+
orderItemIdsMap[item._id] = item.quantity;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (items.length > 0) {
|
|
45
|
+
categories.push({ ...category, items });
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const iterations = [];
|
|
50
|
+
if (data.iterations != null && data.iterations.length > 0) {
|
|
51
|
+
const [firstIteration, ...restIterations] = data.iterations;
|
|
52
|
+
const firstIterationCategories = [];
|
|
53
|
+
for (let i = 0; i < firstIteration.categories.length; i++) {
|
|
54
|
+
const category = firstIteration.categories[i];
|
|
55
|
+
const allPrevItems = [];
|
|
56
|
+
for (let j = 0; j < category.items.length; j++) {
|
|
57
|
+
const prevItem = category.items[j];
|
|
58
|
+
if (prevItem._id === payload._id && payload.void_reason != null) {
|
|
59
|
+
allPrevItems.push({ ...prevItem, void_reason: payload.void_reason });
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
const currentItemQuantity = orderItemIdsMap[prevItem._id];
|
|
63
|
+
const isRemovedItem = !currentItemQuantity || currentItemQuantity < prevItem.quantity;
|
|
64
|
+
if (isRemovedItem) {
|
|
65
|
+
allPrevItems.push(prevItem);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
const updatedPrevItem = { ...prevItem };
|
|
69
|
+
delete updatedPrevItem.void_reason;
|
|
70
|
+
allPrevItems.push(updatedPrevItem);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (allPrevItems.length > 0) {
|
|
75
|
+
firstIterationCategories.push({ ...category, items: allPrevItems });
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
iterations.push({ ...firstIteration, categories: firstIterationCategories }, ...restIterations);
|
|
79
|
+
}
|
|
80
|
+
return (0, common_warehouse_sale_order_rfq_actions_1.calculateCartWarehouseSaleOrderRfqOrderInfoAndSyncData)({
|
|
81
|
+
...data,
|
|
82
|
+
...(iterations.length > 0 && { iterations }),
|
|
83
|
+
categories,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
// ── Update Info ──
|
|
87
|
+
function getUpdateWarehouseSaleOrderRfqCartInfoData(data, payload) {
|
|
88
|
+
return (0, common_warehouse_sale_order_rfq_actions_1.calculateCartWarehouseSaleOrderRfqOrderInfoAndSyncData)({ ...data, ...payload });
|
|
89
|
+
}
|
|
90
|
+
function getAddItemToWarehouseSaleOrderRfqCartData(data, payload) {
|
|
91
|
+
const { category_id, name, item, replace_id } = payload;
|
|
92
|
+
let mainItemId = item._id;
|
|
93
|
+
const orderData = { ...data };
|
|
94
|
+
const categories = [...(orderData.categories ?? [])];
|
|
95
|
+
let didFindCategory = false;
|
|
96
|
+
for (let i = 0; i < categories.length; i++) {
|
|
97
|
+
const category = categories[i];
|
|
98
|
+
if (category.category_id !== category_id)
|
|
99
|
+
continue;
|
|
100
|
+
const updatedItem = getUpdatedSaleOrderRfqItem(item);
|
|
101
|
+
const allItems = [...category.items];
|
|
102
|
+
let didFindItem = false;
|
|
103
|
+
let itemExists = false;
|
|
104
|
+
for (let j = 0; j < allItems.length; j++) {
|
|
105
|
+
const itm = allItems[j];
|
|
106
|
+
if (itm._id === item._id) {
|
|
107
|
+
allItems[j] = item;
|
|
108
|
+
didFindItem = true;
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
if (itm.item_id === item.item_id) {
|
|
112
|
+
itemExists = true;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if (!didFindItem && itemExists) {
|
|
116
|
+
for (let j = 0; j < allItems.length; j++) {
|
|
117
|
+
const itm = allItems[j];
|
|
118
|
+
if (itm.item_id === item.item_id && (0, lodash_1.isEqual)(getUpdatedSaleOrderRfqItem(itm), updatedItem)) {
|
|
119
|
+
mainItemId = replace_id ?? itm._id;
|
|
120
|
+
allItems[j] = {
|
|
121
|
+
...item,
|
|
122
|
+
_id: mainItemId,
|
|
123
|
+
quantity: item.quantity + itm.quantity,
|
|
124
|
+
};
|
|
125
|
+
didFindItem = true;
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
if (!didFindItem) {
|
|
131
|
+
allItems.push(item);
|
|
132
|
+
}
|
|
133
|
+
categories[i] = { ...category, items: allItems };
|
|
134
|
+
didFindCategory = true;
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
if (!didFindCategory) {
|
|
138
|
+
categories.push({ category_id, name, items: [item] });
|
|
139
|
+
}
|
|
140
|
+
const iterations = [];
|
|
141
|
+
if (orderData.iterations != null && orderData.iterations.length > 0) {
|
|
142
|
+
const orderItemIdsMap = {};
|
|
143
|
+
for (let i = 0; i < categories.length; i++) {
|
|
144
|
+
for (let j = 0; j < categories[i].items.length; j++) {
|
|
145
|
+
orderItemIdsMap[categories[i].items[j]._id] = categories[i].items[j].quantity;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
const [firstIteration, ...restIterations] = orderData.iterations;
|
|
149
|
+
const firstIterationCategories = [];
|
|
150
|
+
for (let i = 0; i < firstIteration.categories.length; i++) {
|
|
151
|
+
const category = firstIteration.categories[i];
|
|
152
|
+
const allPrevItems = [];
|
|
153
|
+
for (let j = 0; j < category.items.length; j++) {
|
|
154
|
+
const prevItem = category.items[j];
|
|
155
|
+
const currentItemQuantity = orderItemIdsMap[prevItem._id];
|
|
156
|
+
const isRemovedItem = !currentItemQuantity || currentItemQuantity < prevItem.quantity;
|
|
157
|
+
if (isRemovedItem) {
|
|
158
|
+
allPrevItems.push(prevItem);
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
const updatedPrevItem = { ...prevItem };
|
|
162
|
+
delete updatedPrevItem.void_reason;
|
|
163
|
+
allPrevItems.push(updatedPrevItem);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
if (allPrevItems.length > 0) {
|
|
167
|
+
firstIterationCategories.push({ ...category, items: allPrevItems });
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
iterations.push({ ...firstIteration, categories: firstIterationCategories }, ...restIterations);
|
|
171
|
+
}
|
|
172
|
+
return (0, common_warehouse_sale_order_rfq_actions_1.calculateCartWarehouseSaleOrderRfqOrderInfoAndSyncData)({
|
|
173
|
+
...orderData,
|
|
174
|
+
...(iterations.length > 0 && { iterations }),
|
|
175
|
+
categories,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
// ── Update Item ──
|
|
179
|
+
function getUpdateItemInWarehouseSaleOrderRfqCartData(data, payload) {
|
|
180
|
+
const orderItemIdsMap = {};
|
|
181
|
+
let categories;
|
|
182
|
+
if (data.categories != null) {
|
|
183
|
+
categories = [];
|
|
184
|
+
for (let i = 0; i < data.categories.length; i++) {
|
|
185
|
+
const category = data.categories[i];
|
|
186
|
+
const items = [];
|
|
187
|
+
for (let j = 0; j < category.items.length; j++) {
|
|
188
|
+
const item = category.items[j];
|
|
189
|
+
let newItem = item;
|
|
190
|
+
if (item._id === payload._id) {
|
|
191
|
+
newItem = { ...item, ...payload };
|
|
192
|
+
}
|
|
193
|
+
if (newItem.quantity > 0) {
|
|
194
|
+
items.push(newItem);
|
|
195
|
+
orderItemIdsMap[newItem._id] = newItem.quantity;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
if (items.length > 0) {
|
|
199
|
+
categories.push({ ...category, items });
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
const iterations = [];
|
|
204
|
+
if (payload.quantity != null && data.iterations != null && data.iterations.length > 0) {
|
|
205
|
+
const [firstIteration, ...restIterations] = data.iterations;
|
|
206
|
+
const firstIterationCategories = [];
|
|
207
|
+
for (let i = 0; i < firstIteration.categories.length; i++) {
|
|
208
|
+
const category = firstIteration.categories[i];
|
|
209
|
+
const allPrevItems = [];
|
|
210
|
+
for (let j = 0; j < category.items.length; j++) {
|
|
211
|
+
const prevItem = category.items[j];
|
|
212
|
+
if (prevItem._id === payload._id && payload.void_reason != null) {
|
|
213
|
+
allPrevItems.push({ ...prevItem, void_reason: payload.void_reason });
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
const currentItemQuantity = orderItemIdsMap[prevItem._id];
|
|
217
|
+
const isRemovedItem = !currentItemQuantity || currentItemQuantity < prevItem.quantity;
|
|
218
|
+
if (isRemovedItem) {
|
|
219
|
+
allPrevItems.push(prevItem);
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
const updatedPrevItem = { ...prevItem };
|
|
223
|
+
delete updatedPrevItem.void_reason;
|
|
224
|
+
allPrevItems.push(updatedPrevItem);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
if (allPrevItems.length > 0) {
|
|
229
|
+
firstIterationCategories.push({ ...category, items: allPrevItems });
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
iterations.push({ ...firstIteration, categories: firstIterationCategories }, ...restIterations);
|
|
233
|
+
}
|
|
234
|
+
return (0, common_warehouse_sale_order_rfq_actions_1.calculateCartWarehouseSaleOrderRfqOrderInfoAndSyncData)({
|
|
235
|
+
...data,
|
|
236
|
+
...(iterations.length > 0 && { iterations }),
|
|
237
|
+
categories,
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
// ── Update Items (batch) ──
|
|
241
|
+
function getUpdateItemsInWarehouseSaleOrderRfqCartData(data, payload) {
|
|
242
|
+
return payload.reduce((acc, item) => getUpdateItemInWarehouseSaleOrderRfqCartData(acc, item), data);
|
|
243
|
+
}
|
|
244
|
+
// ── Split Item ──
|
|
245
|
+
function getSplitWarehouseSaleOrderRfqCartItemToTwo(data, orderItemId) {
|
|
246
|
+
if (data.categories == null)
|
|
247
|
+
return data;
|
|
248
|
+
const newCategories = [];
|
|
249
|
+
for (let i = 0; i < data.categories.length; i++) {
|
|
250
|
+
const category = data.categories[i];
|
|
251
|
+
const newItems = [];
|
|
252
|
+
for (let j = 0; j < category.items.length; j++) {
|
|
253
|
+
const item = { ...category.items[j] };
|
|
254
|
+
if (item._id !== orderItemId) {
|
|
255
|
+
newItems.push(item);
|
|
256
|
+
continue;
|
|
257
|
+
}
|
|
258
|
+
if (item.quantity === 1) {
|
|
259
|
+
newItems.push(item);
|
|
260
|
+
continue;
|
|
261
|
+
}
|
|
262
|
+
const newQuantity = item.quantity - 1;
|
|
263
|
+
newItems.push({
|
|
264
|
+
...item,
|
|
265
|
+
quantity: newQuantity,
|
|
266
|
+
subtotal: (0, utils_1.parseNum)(item.price * newQuantity),
|
|
267
|
+
});
|
|
268
|
+
const newId = new bson_objectid_1.default(Math.floor(new bson_objectid_1.default(item._id).getTimestamp().getTime() / 1000) + 1).toHexString();
|
|
269
|
+
newItems.push({
|
|
270
|
+
...item,
|
|
271
|
+
_id: newId,
|
|
272
|
+
quantity: 1,
|
|
273
|
+
subtotal: (0, utils_1.parseNum)(item.price * 1),
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
newCategories.push({ ...category, items: newItems });
|
|
277
|
+
}
|
|
278
|
+
return (0, common_warehouse_sale_order_rfq_actions_1.calculateCartWarehouseSaleOrderRfqOrderInfoAndSyncData)({
|
|
279
|
+
...data,
|
|
280
|
+
categories: newCategories,
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
// ── Add Items (batch) ──
|
|
284
|
+
function getAddItemsToWarehouseSaleOrderRfqCartData(data, payload) {
|
|
285
|
+
return payload.reduce((acc, item) => getAddItemToWarehouseSaleOrderRfqCartData(acc, item), data);
|
|
286
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Schema } from 'mongoose';
|
|
2
|
+
import { WAREHOUSE_SALES_ORDER_STATUS_ENUM } from '../../constants';
|
|
2
3
|
export declare const SaleOrdersSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
3
4
|
timestamps: true;
|
|
4
5
|
versionKey: false;
|
|
@@ -153,7 +154,7 @@ export declare const SaleOrdersSchema: Schema<any, import("mongoose").Model<any,
|
|
|
153
154
|
price: number;
|
|
154
155
|
order_number: number;
|
|
155
156
|
special_instructions: string;
|
|
156
|
-
order_status:
|
|
157
|
+
order_status: WAREHOUSE_SALES_ORDER_STATUS_ENUM;
|
|
157
158
|
tax_number: string;
|
|
158
159
|
amount_earned: number;
|
|
159
160
|
grand_total: number;
|
|
@@ -300,7 +301,7 @@ export declare const SaleOrdersSchema: Schema<any, import("mongoose").Model<any,
|
|
|
300
301
|
}>;
|
|
301
302
|
price: number;
|
|
302
303
|
special_instructions: string;
|
|
303
|
-
order_status:
|
|
304
|
+
order_status: WAREHOUSE_SALES_ORDER_STATUS_ENUM;
|
|
304
305
|
tax_number: string;
|
|
305
306
|
amount_earned: number;
|
|
306
307
|
grand_total: number;
|
|
@@ -456,7 +457,7 @@ export declare const SaleOrdersSchema: Schema<any, import("mongoose").Model<any,
|
|
|
456
457
|
}>;
|
|
457
458
|
price: number;
|
|
458
459
|
special_instructions: string;
|
|
459
|
-
order_status:
|
|
460
|
+
order_status: WAREHOUSE_SALES_ORDER_STATUS_ENUM;
|
|
460
461
|
tax_number: string;
|
|
461
462
|
amount_earned: number;
|
|
462
463
|
grand_total: number;
|
|
@@ -612,7 +613,7 @@ export declare const SaleOrdersSchema: Schema<any, import("mongoose").Model<any,
|
|
|
612
613
|
}>;
|
|
613
614
|
price: number;
|
|
614
615
|
special_instructions: string;
|
|
615
|
-
order_status:
|
|
616
|
+
order_status: WAREHOUSE_SALES_ORDER_STATUS_ENUM;
|
|
616
617
|
tax_number: string;
|
|
617
618
|
amount_earned: number;
|
|
618
619
|
grand_total: number;
|
|
@@ -797,7 +798,7 @@ export declare const SaleOrdersSchema: Schema<any, import("mongoose").Model<any,
|
|
|
797
798
|
price: number;
|
|
798
799
|
order_number: number;
|
|
799
800
|
special_instructions: string;
|
|
800
|
-
order_status:
|
|
801
|
+
order_status: WAREHOUSE_SALES_ORDER_STATUS_ENUM;
|
|
801
802
|
tax_number: string;
|
|
802
803
|
amount_earned: number;
|
|
803
804
|
grand_total: number;
|
|
@@ -944,7 +945,7 @@ export declare const SaleOrdersSchema: Schema<any, import("mongoose").Model<any,
|
|
|
944
945
|
}>;
|
|
945
946
|
price: number;
|
|
946
947
|
special_instructions: string;
|
|
947
|
-
order_status:
|
|
948
|
+
order_status: WAREHOUSE_SALES_ORDER_STATUS_ENUM;
|
|
948
949
|
tax_number: string;
|
|
949
950
|
amount_earned: number;
|
|
950
951
|
grand_total: number;
|
|
@@ -1100,7 +1101,7 @@ export declare const SaleOrdersSchema: Schema<any, import("mongoose").Model<any,
|
|
|
1100
1101
|
}>;
|
|
1101
1102
|
price: number;
|
|
1102
1103
|
special_instructions: string;
|
|
1103
|
-
order_status:
|
|
1104
|
+
order_status: WAREHOUSE_SALES_ORDER_STATUS_ENUM;
|
|
1104
1105
|
tax_number: string;
|
|
1105
1106
|
amount_earned: number;
|
|
1106
1107
|
grand_total: number;
|
|
@@ -1256,7 +1257,7 @@ export declare const SaleOrdersSchema: Schema<any, import("mongoose").Model<any,
|
|
|
1256
1257
|
}>;
|
|
1257
1258
|
price: number;
|
|
1258
1259
|
special_instructions: string;
|
|
1259
|
-
order_status:
|
|
1260
|
+
order_status: WAREHOUSE_SALES_ORDER_STATUS_ENUM;
|
|
1260
1261
|
tax_number: string;
|
|
1261
1262
|
amount_earned: number;
|
|
1262
1263
|
grand_total: number;
|
|
@@ -1441,7 +1442,7 @@ export declare const SaleOrdersSchema: Schema<any, import("mongoose").Model<any,
|
|
|
1441
1442
|
price: number;
|
|
1442
1443
|
order_number: number;
|
|
1443
1444
|
special_instructions: string;
|
|
1444
|
-
order_status:
|
|
1445
|
+
order_status: WAREHOUSE_SALES_ORDER_STATUS_ENUM;
|
|
1445
1446
|
tax_number: string;
|
|
1446
1447
|
amount_earned: number;
|
|
1447
1448
|
grand_total: number;
|
|
@@ -1588,7 +1589,7 @@ export declare const SaleOrdersSchema: Schema<any, import("mongoose").Model<any,
|
|
|
1588
1589
|
}>;
|
|
1589
1590
|
price: number;
|
|
1590
1591
|
special_instructions: string;
|
|
1591
|
-
order_status:
|
|
1592
|
+
order_status: WAREHOUSE_SALES_ORDER_STATUS_ENUM;
|
|
1592
1593
|
tax_number: string;
|
|
1593
1594
|
amount_earned: number;
|
|
1594
1595
|
grand_total: number;
|
|
@@ -1744,7 +1745,7 @@ export declare const SaleOrdersSchema: Schema<any, import("mongoose").Model<any,
|
|
|
1744
1745
|
}>;
|
|
1745
1746
|
price: number;
|
|
1746
1747
|
special_instructions: string;
|
|
1747
|
-
order_status:
|
|
1748
|
+
order_status: WAREHOUSE_SALES_ORDER_STATUS_ENUM;
|
|
1748
1749
|
tax_number: string;
|
|
1749
1750
|
amount_earned: number;
|
|
1750
1751
|
grand_total: number;
|
|
@@ -1900,7 +1901,7 @@ export declare const SaleOrdersSchema: Schema<any, import("mongoose").Model<any,
|
|
|
1900
1901
|
}>;
|
|
1901
1902
|
price: number;
|
|
1902
1903
|
special_instructions: string;
|
|
1903
|
-
order_status:
|
|
1904
|
+
order_status: WAREHOUSE_SALES_ORDER_STATUS_ENUM;
|
|
1904
1905
|
tax_number: string;
|
|
1905
1906
|
amount_earned: number;
|
|
1906
1907
|
grand_total: number;
|
|
@@ -212,7 +212,7 @@ exports.SaleOrdersSchema = new mongoose_1.Schema({
|
|
|
212
212
|
order_status: {
|
|
213
213
|
type: String,
|
|
214
214
|
enum: constants_1.ALL_WAREHOUSE_SALES_ORDER_STATUS_NAMES,
|
|
215
|
-
|
|
215
|
+
default: constants_1.WAREHOUSE_SALES_ORDER_STATUS_ENUM.DRAFT,
|
|
216
216
|
},
|
|
217
217
|
tax_number: {
|
|
218
218
|
type: String,
|
|
@@ -81,7 +81,6 @@ export * from './warehouse_purchase_order_vendor_returns';
|
|
|
81
81
|
export * from './warehouse_purchase_orders';
|
|
82
82
|
export * from './warehouse_sale_deliveries';
|
|
83
83
|
export * from './warehouse_sale_invoices';
|
|
84
|
-
export * from './warehouse_sale_order_common';
|
|
85
84
|
export * from './warehouse_sale_order_rfqs';
|
|
86
85
|
export * from './warehouse_sale_orders';
|
|
87
86
|
export * from './warehouse_staffs';
|
|
@@ -97,7 +97,6 @@ __exportStar(require("./warehouse_purchase_order_vendor_returns"), exports);
|
|
|
97
97
|
__exportStar(require("./warehouse_purchase_orders"), exports);
|
|
98
98
|
__exportStar(require("./warehouse_sale_deliveries"), exports);
|
|
99
99
|
__exportStar(require("./warehouse_sale_invoices"), exports);
|
|
100
|
-
__exportStar(require("./warehouse_sale_order_common"), exports);
|
|
101
100
|
__exportStar(require("./warehouse_sale_order_rfqs"), exports);
|
|
102
101
|
__exportStar(require("./warehouse_sale_orders"), exports);
|
|
103
102
|
__exportStar(require("./warehouse_staffs"), exports);
|
|
@@ -1,8 +1,37 @@
|
|
|
1
1
|
import { WAREHOUSE_SALE_ORDER_RFQ_STATUS_ENUM } from '../../constants';
|
|
2
|
-
import {
|
|
3
|
-
export type IWarehouseSaleOrderRFQItem =
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { IStaffDetails } from './orders';
|
|
3
|
+
export type IWarehouseSaleOrderRFQItem = {
|
|
4
|
+
_id: string;
|
|
5
|
+
item_id: string;
|
|
6
|
+
is_ready?: boolean;
|
|
7
|
+
void_reason?: string | null;
|
|
8
|
+
name: string;
|
|
9
|
+
price: number;
|
|
10
|
+
subtotal: number;
|
|
11
|
+
quantity: number;
|
|
12
|
+
_net_amount: number;
|
|
13
|
+
_gross_amount: number;
|
|
14
|
+
_gst_amount: number;
|
|
15
|
+
_discount_amount: number;
|
|
16
|
+
special_instructions: string;
|
|
17
|
+
};
|
|
18
|
+
export type IWarehouseSaleOrderRFQCategory = {
|
|
19
|
+
name: string;
|
|
20
|
+
category_id: string;
|
|
21
|
+
items: IWarehouseSaleOrderRFQItem[];
|
|
22
|
+
};
|
|
23
|
+
export interface IWarehouseSaleOrderRFQIteration {
|
|
24
|
+
categories: IWarehouseSaleOrderRFQCategory[];
|
|
25
|
+
staff_details: IStaffDetails;
|
|
26
|
+
is_gst_inclusive?: boolean;
|
|
27
|
+
gst?: number | null;
|
|
28
|
+
gst_amount?: number | null;
|
|
29
|
+
special_instructions: string;
|
|
30
|
+
price: number;
|
|
31
|
+
amount_earned: number;
|
|
32
|
+
grand_total: number;
|
|
33
|
+
order_status: WAREHOUSE_SALE_ORDER_RFQ_STATUS_ENUM;
|
|
34
|
+
updatedAt: Date;
|
|
6
35
|
tax_number: string;
|
|
7
36
|
}
|
|
8
37
|
export interface IWarehouseSaleOrderRFQ extends IWarehouseSaleOrderRFQIteration {
|
|
@@ -1,8 +1,37 @@
|
|
|
1
1
|
import { WAREHOUSE_SALES_ORDER_STATUS_ENUM } from '../../constants';
|
|
2
|
-
import {
|
|
3
|
-
export type IWarehouseSaleOrderItem =
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { IStaffDetails } from './orders';
|
|
3
|
+
export type IWarehouseSaleOrderItem = {
|
|
4
|
+
_id: string;
|
|
5
|
+
item_id: string;
|
|
6
|
+
is_ready?: boolean;
|
|
7
|
+
void_reason?: string | null;
|
|
8
|
+
name: string;
|
|
9
|
+
price: number;
|
|
10
|
+
subtotal: number;
|
|
11
|
+
quantity: number;
|
|
12
|
+
_net_amount: number;
|
|
13
|
+
_gross_amount: number;
|
|
14
|
+
_gst_amount: number;
|
|
15
|
+
_discount_amount: number;
|
|
16
|
+
special_instructions: string;
|
|
17
|
+
};
|
|
18
|
+
export type IWarehouseSaleOrderCategory = {
|
|
19
|
+
name: string;
|
|
20
|
+
category_id: string;
|
|
21
|
+
items: IWarehouseSaleOrderItem[];
|
|
22
|
+
};
|
|
23
|
+
export interface IWarehouseSaleOrderIteration {
|
|
24
|
+
categories: IWarehouseSaleOrderCategory[];
|
|
25
|
+
staff_details: IStaffDetails;
|
|
26
|
+
is_gst_inclusive?: boolean;
|
|
27
|
+
gst?: number | null;
|
|
28
|
+
gst_amount?: number | null;
|
|
29
|
+
special_instructions: string;
|
|
30
|
+
price: number;
|
|
31
|
+
amount_earned: number;
|
|
32
|
+
grand_total: number;
|
|
33
|
+
order_status: WAREHOUSE_SALES_ORDER_STATUS_ENUM;
|
|
34
|
+
updatedAt: Date;
|
|
6
35
|
tax_number: string;
|
|
7
36
|
}
|
|
8
37
|
export interface IWarehouseSaleOrder extends IWarehouseSaleOrderIteration {
|