@managesome/eposmatic-toolkit 0.2.463 → 0.2.464

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.
@@ -0,0 +1,3 @@
1
+ import { IWarehouseSaleOrderRFQ, IWarehouseSaleOrderRFQIteration } from '../../schemas';
2
+ export declare function generateWarehouseSaleOrderRfqCategories(categories?: IWarehouseSaleOrderRFQ['categories']): IWarehouseSaleOrderRFQ['categories'];
3
+ export declare function generateWarehouseSaleOrderRfqIteration(order: IWarehouseSaleOrderRFQ | IWarehouseSaleOrderRFQIteration, partial?: boolean, skipItemMetadata?: boolean): IWarehouseSaleOrderRFQIteration;
@@ -0,0 +1,64 @@
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.generateWarehouseSaleOrderRfqCategories = generateWarehouseSaleOrderRfqCategories;
7
+ exports.generateWarehouseSaleOrderRfqIteration = generateWarehouseSaleOrderRfqIteration;
8
+ const mongoose_1 = __importDefault(require("mongoose"));
9
+ const common_warehouse_sale_order_actions_1 = require("../store/common-warehouse-sale-order-actions");
10
+ function generateWarehouseSaleOrderRfqCategories(categories) {
11
+ if (!categories)
12
+ return [];
13
+ return categories.map((category) => ({
14
+ ...category,
15
+ category_id: new mongoose_1.default.Types.ObjectId(category.category_id),
16
+ items: category.items.map((item) => ({
17
+ ...item,
18
+ _id: new mongoose_1.default.Types.ObjectId(item._id),
19
+ item_id: new mongoose_1.default.Types.ObjectId(item.item_id),
20
+ })),
21
+ }));
22
+ }
23
+ function getCommonOptionalBoolFieldsSaleOrderRfqIteration(order, partial) {
24
+ const defaultValue = partial ? undefined : false;
25
+ return {
26
+ is_gst_inclusive: order.is_gst_inclusive || defaultValue,
27
+ };
28
+ }
29
+ function getCommonOptionalNumFieldsSaleOrderRfqIteration(order, partial) {
30
+ const defaultValue = partial ? undefined : 0;
31
+ return {
32
+ gst: order.gst || defaultValue,
33
+ gst_amount: order.gst_amount || defaultValue,
34
+ };
35
+ }
36
+ function generateWarehouseSaleOrderRfqIteration(order, partial = true, skipItemMetadata) {
37
+ const iteration = {
38
+ ...getCommonOptionalBoolFieldsSaleOrderRfqIteration(order, partial),
39
+ ...getCommonOptionalNumFieldsSaleOrderRfqIteration(order, partial),
40
+ ...(skipItemMetadata && order.categories != null
41
+ ? {
42
+ categories: (0, common_warehouse_sale_order_actions_1.skipItemMetadataFromWarehouseSaleOrderCategories)(order.categories),
43
+ }
44
+ : {
45
+ categories: generateWarehouseSaleOrderRfqCategories(order.categories),
46
+ }),
47
+ staff_details: order.staff_details,
48
+ special_instructions: order.special_instructions,
49
+ order_status: order.order_status,
50
+ price: order.price,
51
+ amount_earned: order.amount_earned,
52
+ grand_total: order.grand_total,
53
+ tax_number: order.tax_number,
54
+ updatedAt: order.updatedAt,
55
+ };
56
+ if (partial) {
57
+ Object.keys(iteration).forEach((key) => {
58
+ if (iteration[key] === undefined) {
59
+ delete iteration[key];
60
+ }
61
+ });
62
+ }
63
+ return iteration;
64
+ }
@@ -2,3 +2,4 @@ export * from './generate-order';
2
2
  export * from './generate-warehouse-purchase-order';
3
3
  export * from './generate-warehouse-purchase-order-rfq';
4
4
  export * from './generate-warehouse-sale-order';
5
+ export * from './generate-warehouse-sale-order-rfq';
@@ -18,3 +18,4 @@ __exportStar(require("./generate-order"), exports);
18
18
  __exportStar(require("./generate-warehouse-purchase-order"), exports);
19
19
  __exportStar(require("./generate-warehouse-purchase-order-rfq"), exports);
20
20
  __exportStar(require("./generate-warehouse-sale-order"), exports);
21
+ __exportStar(require("./generate-warehouse-sale-order-rfq"), exports);
@@ -1,5 +1,6 @@
1
1
  import { WAREHOUSE_SALES_ORDER_STATUS_ENUM } from '../../constants';
2
2
  import { IWarehouseSaleOrder, IWarehouseSaleOrderStatus } from '../../schemas';
3
+ export declare const DEFAULT_WAREHOUSE_SALE_ORDER_STATUS: IWarehouseSaleOrderStatus[];
3
4
  export declare function getWarehouseSaleOrdersPostedData(data: IWarehouseSaleOrder[], order: IWarehouseSaleOrder): IWarehouseSaleOrder[];
4
5
  export declare function getWarehouseSaleOrdersUpdatedData(data: IWarehouseSaleOrder[], order: Partial<IWarehouseSaleOrder>): IWarehouseSaleOrder[];
5
6
  export declare function getWarehouseSaleOrdersDeletedData(data: IWarehouseSaleOrder[], orderId: string): IWarehouseSaleOrder[];
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_WAREHOUSE_SALE_ORDER_STATUS = void 0;
3
4
  exports.getWarehouseSaleOrdersPostedData = getWarehouseSaleOrdersPostedData;
4
5
  exports.getWarehouseSaleOrdersUpdatedData = getWarehouseSaleOrdersUpdatedData;
5
6
  exports.getWarehouseSaleOrdersDeletedData = getWarehouseSaleOrdersDeletedData;
@@ -7,7 +8,7 @@ exports.getWarehouseSaleOrderStatusInfo = getWarehouseSaleOrderStatusInfo;
7
8
  const constants_1 = require("../../constants");
8
9
  const common_order_actions_1 = require("./common-order-actions");
9
10
  const common_warehouse_sale_order_actions_1 = require("./common-warehouse-sale-order-actions");
10
- const DEFAULT_WAREHOUSE_SALE_ORDER_STATUS = [
11
+ exports.DEFAULT_WAREHOUSE_SALE_ORDER_STATUS = [
11
12
  {
12
13
  status: constants_1.WAREHOUSE_SALES_ORDER_STATUS_ENUM.DRAFT,
13
14
  color: '#727472',
@@ -53,14 +54,14 @@ function getWarehouseSaleOrderStatusInfo(currentStatus) {
53
54
  currentOrderStatus: null,
54
55
  };
55
56
  let currentStatusIndex;
56
- for (let i = 0; i < DEFAULT_WAREHOUSE_SALE_ORDER_STATUS.length; i++) {
57
- const obj = DEFAULT_WAREHOUSE_SALE_ORDER_STATUS[i];
57
+ for (let i = 0; i < exports.DEFAULT_WAREHOUSE_SALE_ORDER_STATUS.length; i++) {
58
+ const obj = exports.DEFAULT_WAREHOUSE_SALE_ORDER_STATUS[i];
58
59
  if (obj.status === currentStatus) {
59
60
  info.currentOrderStatus = obj;
60
61
  currentStatusIndex = i;
61
62
  if (info.currentOrderStatus.status !== constants_1.WAREHOUSE_SALES_ORDER_STATUS_ENUM.CANCELLED) {
62
63
  // Total is -2 because we don't want to count draft and cancelled
63
- const total = DEFAULT_WAREHOUSE_SALE_ORDER_STATUS.length - 2;
64
+ const total = exports.DEFAULT_WAREHOUSE_SALE_ORDER_STATUS.length - 2;
64
65
  info.orderProgress = Math.round((obj.priority / total) * 100);
65
66
  }
66
67
  break;
@@ -69,7 +70,7 @@ function getWarehouseSaleOrderStatusInfo(currentStatus) {
69
70
  if (currentStatusIndex == null) {
70
71
  return info;
71
72
  }
72
- const nextObj = DEFAULT_WAREHOUSE_SALE_ORDER_STATUS[currentStatusIndex + 1];
73
+ const nextObj = exports.DEFAULT_WAREHOUSE_SALE_ORDER_STATUS[currentStatusIndex + 1];
73
74
  if (!nextObj || nextObj.status === constants_1.WAREHOUSE_SALES_ORDER_STATUS_ENUM.CANCELLED) {
74
75
  return info;
75
76
  }
@@ -5,7 +5,6 @@ export declare function getWarehouseSaleOrderRfqIterationsWithPrice(iterations?:
5
5
  export declare function getWarehouseSaleOrderRfqItemsWithPrice(items: IWarehouseSaleOrderRFQItem[] | undefined, convertToPrice: (price: number) => number): IWarehouseSaleOrderRFQItem[];
6
6
  export declare function getWarehouseSaleOrderRfqCategoriesWithPrice(categories: IWarehouseSaleOrderRFQCategory[] | undefined, convertToPrice: (price: number) => number): IWarehouseSaleOrderRFQCategory[];
7
7
  export declare function getWarehouseSaleOrderRfqWithPrice<T extends Partial<IWarehouseSaleOrderRFQ> | IWarehouseSaleOrderRFQ | IWarehouseSaleOrderRFQIteration>(order: T, writeable?: boolean): T;
8
- export declare function calculateCartWarehouseSaleOrderRfqOrderInfoAndSyncData<T extends IWarehouseSaleOrderRFQ | Partial<IWarehouseSaleOrderRFQ>>(data: T, calculateItemMetadata?: boolean): T;
9
8
  export declare function syncWarehouseSaleOrderRfqData(order: IWarehouseSaleOrderRFQ): IWarehouseSaleOrderRFQ;
10
9
  export declare function skipItemMetadataFromWarehouseSaleOrderRfqCategories(categories: IWarehouseSaleOrderRFQ['categories'], previousCategories?: IWarehouseSaleOrderRFQ['categories']): IWarehouseSaleOrderRFQ['categories'];
11
10
  export declare function getWarehouseSaleOrderRfqWithAllFields<T extends IWarehouseSaleOrderRFQ | Partial<IWarehouseSaleOrderRFQ>>(order: T, skipItemMetadata?: boolean): T;
@@ -7,7 +7,6 @@ exports.getWarehouseSaleOrderRfqIterationsWithPrice = getWarehouseSaleOrderRfqIt
7
7
  exports.getWarehouseSaleOrderRfqItemsWithPrice = getWarehouseSaleOrderRfqItemsWithPrice;
8
8
  exports.getWarehouseSaleOrderRfqCategoriesWithPrice = getWarehouseSaleOrderRfqCategoriesWithPrice;
9
9
  exports.getWarehouseSaleOrderRfqWithPrice = getWarehouseSaleOrderRfqWithPrice;
10
- exports.calculateCartWarehouseSaleOrderRfqOrderInfoAndSyncData = calculateCartWarehouseSaleOrderRfqOrderInfoAndSyncData;
11
10
  exports.syncWarehouseSaleOrderRfqData = syncWarehouseSaleOrderRfqData;
12
11
  exports.skipItemMetadataFromWarehouseSaleOrderRfqCategories = skipItemMetadataFromWarehouseSaleOrderRfqCategories;
13
12
  exports.getWarehouseSaleOrderRfqWithAllFields = getWarehouseSaleOrderRfqWithAllFields;
@@ -17,6 +16,7 @@ const bson_objectid_1 = __importDefault(require("bson-objectid"));
17
16
  const lodash_1 = require("lodash");
18
17
  const constants_1 = require("../../constants");
19
18
  const utils_1 = require("../utils");
19
+ const warehouse_sale_order_rfq_cart_actions_1 = require("./warehouse-sale-order-rfq-cart-actions");
20
20
  /* =================================================================
21
21
  * Sale-order RFQ common helpers — price conversion, field defaults, cart UI.
22
22
  * Mirrors common-warehouse-purchase-order-rfq-actions.ts for sale RFQ types.
@@ -74,99 +74,13 @@ function getWarehouseSaleOrderRfqWithPrice(order, writeable) {
74
74
  };
75
75
  return payload;
76
76
  }
77
- // ── Cart calculation ──
78
- function calculateCartWarehouseSaleOrderRfqOrderInfoAndSyncData(data, calculateItemMetadata) {
79
- const isConfirmed = data.order_status === constants_1.WAREHOUSE_SALE_ORDER_RFQ_STATUS_ENUM.CONFIRMED;
80
- let subtotal = 0;
81
- const categories = [];
82
- const length = data.categories?.length ?? 0;
83
- for (let c = 0; c < length; c++) {
84
- const category = data.categories[c];
85
- const newItems = [];
86
- const itemsLength = category.items.length;
87
- for (let i = 0; i < itemsLength; i++) {
88
- const item = category.items[i];
89
- const itemSubtotal = (0, utils_1.parseNum)(item.price * item.quantity);
90
- const newItem = {
91
- ...item,
92
- is_ready: item.is_ready || isConfirmed,
93
- subtotal: itemSubtotal,
94
- _discount_amount: 0,
95
- _gross_amount: 0,
96
- _gst_amount: 0,
97
- _net_amount: 0,
98
- };
99
- delete newItem.void_reason;
100
- newItems.push(newItem);
101
- subtotal += itemSubtotal;
102
- }
103
- categories.push({ ...category, items: newItems });
104
- }
105
- let grand_total = subtotal;
106
- let gst_amount = 0;
107
- const gst = data.gst ?? 0;
108
- if (data.is_gst_inclusive) {
109
- gst_amount = (0, utils_1.parseFloatCeil)((grand_total * gst) / (100 + gst));
110
- }
111
- else {
112
- gst_amount = (0, utils_1.getPercentageAmount)(grand_total, gst);
113
- grand_total += gst_amount;
114
- }
115
- grand_total = (0, utils_1.parseNum)(grand_total);
116
- const amount_earned = (0, utils_1.parseNum)(grand_total);
117
- if (calculateItemMetadata) {
118
- let leftGrossAmount = subtotal;
119
- let leftNetAmount = subtotal;
120
- let leftDiscountAmount = 0;
121
- let leftGstAmount = gst_amount;
122
- categories.forEach((category, categoryIndex) => {
123
- const isLastCategory = categoryIndex === categories.length - 1;
124
- category.items.forEach((item, itemIndex) => {
125
- const isLastItem = isLastCategory && itemIndex === category.items.length - 1;
126
- let grossAmount = item.subtotal;
127
- let netAmount = item.subtotal;
128
- let itemTotalDiscountAmount = 0;
129
- let itemGst = 0;
130
- if (gst_amount > 0) {
131
- itemGst = (item.subtotal / subtotal) * gst_amount;
132
- }
133
- grossAmount = (0, utils_1.parseFloatCeil)(grossAmount);
134
- const netAmountParsed = (0, utils_1.parseFloatCeil)(netAmount);
135
- const itemTotalDiscountAmountParsed = (0, utils_1.parseFloatCeil)(itemTotalDiscountAmount);
136
- itemGst = (0, utils_1.parseFloatCeil)(itemGst);
137
- leftGrossAmount -= grossAmount;
138
- leftNetAmount -= netAmountParsed;
139
- leftDiscountAmount -= itemTotalDiscountAmountParsed;
140
- leftGstAmount -= itemGst;
141
- if (isLastItem) {
142
- grossAmount += leftGrossAmount;
143
- netAmount += leftNetAmount;
144
- itemTotalDiscountAmount += leftDiscountAmount;
145
- itemGst += leftGstAmount;
146
- }
147
- item._gross_amount = Math.max(grossAmount, 0);
148
- item._net_amount = Math.max(netAmount, 0);
149
- item._discount_amount = Math.max(itemTotalDiscountAmount, 0);
150
- item._gst_amount = Math.max(itemGst, 0);
151
- });
152
- });
153
- }
154
- return {
155
- ...data,
156
- categories,
157
- amount_earned,
158
- gst_amount,
159
- price: (0, utils_1.parseNum)(subtotal),
160
- grand_total,
161
- };
162
- }
163
77
  // ── Sync ──
164
78
  function syncWarehouseSaleOrderRfqData(order) {
165
79
  const updatedOrder = {
166
80
  ...order,
167
81
  iterations: [],
168
82
  };
169
- const newOrder = getWarehouseSaleOrderRfqWithPrice(calculateCartWarehouseSaleOrderRfqOrderInfoAndSyncData(getWarehouseSaleOrderRfqWithPrice(updatedOrder), true), true);
83
+ const newOrder = getWarehouseSaleOrderRfqWithPrice((0, warehouse_sale_order_rfq_cart_actions_1.calculateCartWarehouseSaleOrderRfqOrderInfoAndSyncData)(getWarehouseSaleOrderRfqWithPrice(updatedOrder), true), true);
170
84
  newOrder.iterations = order.iterations;
171
85
  return newOrder;
172
86
  }
@@ -1,4 +1,5 @@
1
1
  import { IWarehouseSaleOrderRFQ, IWarehouseSaleOrderRFQItem } from '../../schemas';
2
+ export declare function calculateCartWarehouseSaleOrderRfqOrderInfoAndSyncData<T extends IWarehouseSaleOrderRFQ | Partial<IWarehouseSaleOrderRFQ>>(data: T, calculateItemMetadata?: boolean): T;
2
3
  export declare function getRemoveItemFromWarehouseSaleOrderRfqCartData(data: Partial<IWarehouseSaleOrderRFQ>, payload: {
3
4
  _id: string;
4
5
  void_reason?: string;
@@ -3,6 +3,7 @@ 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.calculateCartWarehouseSaleOrderRfqOrderInfoAndSyncData = calculateCartWarehouseSaleOrderRfqOrderInfoAndSyncData;
6
7
  exports.getRemoveItemFromWarehouseSaleOrderRfqCartData = getRemoveItemFromWarehouseSaleOrderRfqCartData;
7
8
  exports.getUpdateWarehouseSaleOrderRfqCartInfoData = getUpdateWarehouseSaleOrderRfqCartInfoData;
8
9
  exports.getAddItemToWarehouseSaleOrderRfqCartData = getAddItemToWarehouseSaleOrderRfqCartData;
@@ -12,12 +13,97 @@ exports.getSplitWarehouseSaleOrderRfqCartItemToTwo = getSplitWarehouseSaleOrderR
12
13
  exports.getAddItemsToWarehouseSaleOrderRfqCartData = getAddItemsToWarehouseSaleOrderRfqCartData;
13
14
  const bson_objectid_1 = __importDefault(require("bson-objectid"));
14
15
  const lodash_1 = require("lodash");
16
+ const constants_1 = require("../../constants");
15
17
  const utils_1 = require("../utils");
16
- const common_warehouse_sale_order_rfq_actions_1 = require("./common-warehouse-sale-order-rfq-actions");
17
18
  /* =================================================================
18
- * Sale-order RFQ cart helpers — CRUD operations for cart items.
19
+ * Sale-order RFQ cart helpers — fully typed, no delegation to SO functions.
19
20
  * Mirrors warehouse-purchase-order-rfq-cart-actions.ts for sale RFQ types.
20
21
  * ================================================================= */
22
+ function calculateCartWarehouseSaleOrderRfqOrderInfoAndSyncData(data, calculateItemMetadata) {
23
+ const isConfirmed = data.order_status === constants_1.WAREHOUSE_SALE_ORDER_RFQ_STATUS_ENUM.CONFIRMED;
24
+ let subtotal = 0;
25
+ const categories = [];
26
+ const length = data.categories?.length ?? 0;
27
+ for (let c = 0; c < length; c++) {
28
+ const category = data.categories[c];
29
+ const newItems = [];
30
+ const itemsLength = category.items.length;
31
+ for (let i = 0; i < itemsLength; i++) {
32
+ const item = category.items[i];
33
+ const itemSubtotal = (0, utils_1.parseNum)(item.price * item.quantity);
34
+ const newItem = {
35
+ ...item,
36
+ is_ready: item.is_ready || isConfirmed,
37
+ subtotal: itemSubtotal,
38
+ _discount_amount: 0,
39
+ _gross_amount: 0,
40
+ _gst_amount: 0,
41
+ _net_amount: 0,
42
+ };
43
+ delete newItem.void_reason;
44
+ newItems.push(newItem);
45
+ subtotal += itemSubtotal;
46
+ }
47
+ categories.push({ ...category, items: newItems });
48
+ }
49
+ let grand_total = subtotal;
50
+ let gst_amount = 0;
51
+ const gst = data.gst ?? 0;
52
+ if (data.is_gst_inclusive) {
53
+ gst_amount = (0, utils_1.parseFloatCeil)((grand_total * gst) / (100 + gst));
54
+ }
55
+ else {
56
+ gst_amount = (0, utils_1.getPercentageAmount)(grand_total, gst);
57
+ grand_total += gst_amount;
58
+ }
59
+ grand_total = (0, utils_1.parseNum)(grand_total);
60
+ const amount_earned = (0, utils_1.parseNum)(grand_total);
61
+ if (calculateItemMetadata) {
62
+ let leftGrossAmount = subtotal;
63
+ let leftNetAmount = subtotal;
64
+ let leftDiscountAmount = 0;
65
+ let leftGstAmount = gst_amount;
66
+ categories.forEach((category, categoryIndex) => {
67
+ const isLastCategory = categoryIndex === categories.length - 1;
68
+ category.items.forEach((item, itemIndex) => {
69
+ const isLastItem = isLastCategory && itemIndex === category.items.length - 1;
70
+ let grossAmount = item.subtotal;
71
+ let netAmount = item.subtotal;
72
+ let itemTotalDiscountAmount = 0;
73
+ let itemGst = 0;
74
+ if (gst_amount > 0) {
75
+ itemGst = (item.subtotal / subtotal) * gst_amount;
76
+ }
77
+ grossAmount = (0, utils_1.parseFloatCeil)(grossAmount);
78
+ const netAmountParsed = (0, utils_1.parseFloatCeil)(netAmount);
79
+ const itemTotalDiscountAmountParsed = (0, utils_1.parseFloatCeil)(itemTotalDiscountAmount);
80
+ itemGst = (0, utils_1.parseFloatCeil)(itemGst);
81
+ leftGrossAmount -= grossAmount;
82
+ leftNetAmount -= netAmountParsed;
83
+ leftDiscountAmount -= itemTotalDiscountAmountParsed;
84
+ leftGstAmount -= itemGst;
85
+ if (isLastItem) {
86
+ grossAmount += leftGrossAmount;
87
+ netAmount += leftNetAmount;
88
+ itemTotalDiscountAmount += leftDiscountAmount;
89
+ itemGst += leftGstAmount;
90
+ }
91
+ item._gross_amount = Math.max(grossAmount, 0);
92
+ item._net_amount = Math.max(netAmount, 0);
93
+ item._discount_amount = Math.max(itemTotalDiscountAmount, 0);
94
+ item._gst_amount = Math.max(itemGst, 0);
95
+ });
96
+ });
97
+ }
98
+ return {
99
+ ...data,
100
+ categories,
101
+ amount_earned,
102
+ gst_amount,
103
+ price: (0, utils_1.parseNum)(subtotal),
104
+ grand_total,
105
+ };
106
+ }
21
107
  // ── Shared ──
22
108
  const getUpdatedSaleOrderRfqItem = (item) => ({
23
109
  item_id: item.item_id,
@@ -77,7 +163,7 @@ function getRemoveItemFromWarehouseSaleOrderRfqCartData(data, payload) {
77
163
  }
78
164
  iterations.push({ ...firstIteration, categories: firstIterationCategories }, ...restIterations);
79
165
  }
80
- return (0, common_warehouse_sale_order_rfq_actions_1.calculateCartWarehouseSaleOrderRfqOrderInfoAndSyncData)({
166
+ return calculateCartWarehouseSaleOrderRfqOrderInfoAndSyncData({
81
167
  ...data,
82
168
  ...(iterations.length > 0 && { iterations }),
83
169
  categories,
@@ -85,7 +171,7 @@ function getRemoveItemFromWarehouseSaleOrderRfqCartData(data, payload) {
85
171
  }
86
172
  // ── Update Info ──
87
173
  function getUpdateWarehouseSaleOrderRfqCartInfoData(data, payload) {
88
- return (0, common_warehouse_sale_order_rfq_actions_1.calculateCartWarehouseSaleOrderRfqOrderInfoAndSyncData)({ ...data, ...payload });
174
+ return calculateCartWarehouseSaleOrderRfqOrderInfoAndSyncData({ ...data, ...payload });
89
175
  }
90
176
  function getAddItemToWarehouseSaleOrderRfqCartData(data, payload) {
91
177
  const { category_id, name, item, replace_id } = payload;
@@ -169,7 +255,7 @@ function getAddItemToWarehouseSaleOrderRfqCartData(data, payload) {
169
255
  }
170
256
  iterations.push({ ...firstIteration, categories: firstIterationCategories }, ...restIterations);
171
257
  }
172
- return (0, common_warehouse_sale_order_rfq_actions_1.calculateCartWarehouseSaleOrderRfqOrderInfoAndSyncData)({
258
+ return calculateCartWarehouseSaleOrderRfqOrderInfoAndSyncData({
173
259
  ...orderData,
174
260
  ...(iterations.length > 0 && { iterations }),
175
261
  categories,
@@ -231,7 +317,7 @@ function getUpdateItemInWarehouseSaleOrderRfqCartData(data, payload) {
231
317
  }
232
318
  iterations.push({ ...firstIteration, categories: firstIterationCategories }, ...restIterations);
233
319
  }
234
- return (0, common_warehouse_sale_order_rfq_actions_1.calculateCartWarehouseSaleOrderRfqOrderInfoAndSyncData)({
320
+ return calculateCartWarehouseSaleOrderRfqOrderInfoAndSyncData({
235
321
  ...data,
236
322
  ...(iterations.length > 0 && { iterations }),
237
323
  categories,
@@ -275,7 +361,7 @@ function getSplitWarehouseSaleOrderRfqCartItemToTwo(data, orderItemId) {
275
361
  }
276
362
  newCategories.push({ ...category, items: newItems });
277
363
  }
278
- return (0, common_warehouse_sale_order_rfq_actions_1.calculateCartWarehouseSaleOrderRfqOrderInfoAndSyncData)({
364
+ return calculateCartWarehouseSaleOrderRfqOrderInfoAndSyncData({
279
365
  ...data,
280
366
  categories: newCategories,
281
367
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managesome/eposmatic-toolkit",
3
- "version": "0.2.463",
3
+ "version": "0.2.464",
4
4
  "description": "A Toolkit Library for Eposmatic",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",