@managesome/eposmatic-toolkit 0.2.431 → 0.2.433
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/constants/ENUMS.d.ts +0 -289
- package/lib/constants/ENUMS.js +2 -393
- package/lib/constants/PURCHASE_ORDER.d.ts +5 -3
- package/lib/constants/PURCHASE_ORDER.js +58 -20
- package/lib/constants/WAREHOUSE_ANALYTICS.d.ts +41 -41
- package/lib/constants/WAREHOUSE_ANALYTICS.js +28 -28
- package/lib/constants/WAREHOUSE_ENUMS.d.ts +289 -0
- package/lib/constants/WAREHOUSE_ENUMS.js +392 -0
- package/lib/constants/WAREHOUSE_INVOICE.js +10 -10
- package/lib/constants/WORKER_ENDPOINTS.d.ts +63 -0
- package/lib/constants/WORKER_ENDPOINTS.js +76 -0
- package/lib/constants/index.d.ts +2 -0
- package/lib/constants/index.js +2 -0
- package/lib/helpers/order/generate-purchase-order-rfq.d.ts +3 -3
- package/lib/helpers/order/generate-purchase-order-rfq.js +2 -2
- package/lib/helpers/order/generate-purchase-order.d.ts +8 -8
- package/lib/helpers/order/generate-purchase-order.js +2 -2
- package/lib/helpers/order/generate-warehouse-purchase-order-rfq.d.ts +3 -0
- package/lib/helpers/order/generate-warehouse-purchase-order-rfq.js +64 -0
- package/lib/helpers/order/generate-warehouse-purchase-order.d.ts +11 -0
- package/lib/helpers/order/generate-warehouse-purchase-order.js +196 -0
- package/lib/helpers/order/index.d.ts +2 -2
- package/lib/helpers/order/index.js +2 -2
- package/lib/helpers/store/all-purchase-orders-actions.d.ts +7 -7
- package/lib/helpers/store/all-purchase-orders-actions.js +2 -2
- package/lib/helpers/store/all-sale-orders-actions.d.ts +2 -2
- package/lib/helpers/store/all-warehouse-purchase-orders-actions.d.ts +13 -0
- package/lib/helpers/store/all-warehouse-purchase-orders-actions.js +56 -0
- package/lib/helpers/store/all-warehouse-sale-orders-actions.d.ts +2 -0
- package/lib/helpers/store/all-warehouse-sale-orders-actions.js +8 -0
- package/lib/helpers/store/common-purchase-order-actions.d.ts +15 -15
- package/lib/helpers/store/common-sale-order-actions.d.ts +5 -5
- package/lib/helpers/store/common-warehouse-purchase-order-actions.d.ts +31 -0
- package/lib/helpers/store/common-warehouse-purchase-order-actions.js +545 -0
- package/lib/helpers/store/common-warehouse-sale-order-actions.d.ts +5 -0
- package/lib/helpers/store/common-warehouse-sale-order-actions.js +65 -0
- package/lib/helpers/store/index.d.ts +6 -6
- package/lib/helpers/store/index.js +6 -6
- package/lib/helpers/store/purchase-order-rfq-cart-actions.d.ts +11 -11
- package/lib/helpers/store/purchase-order-rfq-cart-actions.js +3 -3
- package/lib/helpers/store/purchase-orders-cart-actions.d.ts +18 -18
- package/lib/helpers/store/purchase-orders-cart-actions.js +1 -1
- package/lib/helpers/store/warehouse-purchase-order-rfq-cart-actions.d.ts +19 -0
- package/lib/helpers/store/warehouse-purchase-order-rfq-cart-actions.js +373 -0
- package/lib/helpers/store/warehouse-purchase-orders-cart-actions.d.ts +57 -0
- package/lib/helpers/store/warehouse-purchase-orders-cart-actions.js +486 -0
- package/lib/helpers/types/index.d.ts +1 -1
- package/lib/helpers/types/index.js +1 -1
- package/lib/helpers/types/purchase-order-cart-actions.d.ts +2 -2
- package/lib/helpers/types/warehouse-purchase-order-cart-actions.d.ts +26 -0
- package/lib/helpers/types/warehouse-purchase-order-cart-actions.js +2 -0
- package/lib/helpers/types/workers.d.ts +39 -32
- package/lib/helpers/utils/index.d.ts +8 -8
- package/lib/helpers/utils/index.js +8 -11
- package/lib/helpers/utils/invoice-x-report-helpers.d.ts +2 -2
- package/lib/helpers/utils/invoice-x-report-helpers.js +14 -14
- package/lib/helpers/utils/purchase-order-engine.d.ts +4 -4
- package/lib/helpers/utils/purchase-order-receipt-engine.d.ts +5 -5
- package/lib/helpers/utils/purchase-order-receipt-engine.js +2 -2
- package/lib/helpers/utils/purchase-order-x-report-helpers.js +2 -2
- package/lib/helpers/utils/sale-x-report-helpers.js +2 -2
- package/lib/helpers/utils/void-purchase-order-items-helpers.d.ts +3 -3
- package/lib/helpers/utils/void-purchase-order-items-report-helpers.d.ts +2 -2
- package/lib/helpers/utils/void-warehouse-invoice-items-helpers.d.ts +3 -3
- package/lib/helpers/utils/void-warehouse-invoice-items-helpers.js +2 -2
- package/lib/helpers/utils/void-warehouse-invoice-items-report-helpers.d.ts +5 -5
- package/lib/helpers/utils/warehouse-catalog-conversion.d.ts +3 -3
- package/lib/helpers/utils/warehouse-catalog-conversion.js +9 -7
- package/lib/helpers/utils/warehouse-invoice-order-engine.js +1 -1
- package/lib/helpers/utils/warehouse-invoice-x-report-helpers.d.ts +58 -0
- package/lib/helpers/utils/warehouse-invoice-x-report-helpers.js +1432 -0
- package/lib/helpers/utils/warehouse-purchase-order-engine.d.ts +9 -0
- package/lib/helpers/utils/warehouse-purchase-order-engine.js +34 -0
- package/lib/helpers/utils/warehouse-purchase-order-receipt-engine.d.ts +149 -0
- package/lib/helpers/utils/warehouse-purchase-order-receipt-engine.js +214 -0
- package/lib/helpers/utils/warehouse-purchase-order-x-report-helpers.d.ts +58 -0
- package/lib/helpers/utils/warehouse-purchase-order-x-report-helpers.js +1440 -0
- package/lib/helpers/utils/warehouse-sale-order-x-report-helpers.d.ts +30 -0
- package/lib/helpers/utils/warehouse-sale-order-x-report-helpers.js +2 -0
- package/lib/helpers/utils/warehouse-sale-x-report-helpers.d.ts +58 -0
- package/lib/helpers/utils/warehouse-sale-x-report-helpers.js +1456 -0
- package/lib/helpers/utils/warehouse-void-purchase-order-items-helpers.d.ts +3 -0
- package/lib/helpers/utils/warehouse-void-purchase-order-items-helpers.js +38 -0
- package/lib/helpers/utils/warehouse-void-purchase-order-items-report-helpers.d.ts +13 -0
- package/lib/helpers/utils/warehouse-void-purchase-order-items-report-helpers.js +22 -0
- package/lib/schemas/models/gift_cards.d.ts +108 -108
- package/lib/schemas/models/halfhalf_setup.d.ts +3 -3
- package/lib/schemas/models/index.d.ts +7 -7
- package/lib/schemas/models/index.js +7 -7
- package/lib/schemas/models/internal_invoices.d.ts +6 -6
- package/lib/schemas/models/inventory_lot_serial_numbers.d.ts +6 -6
- package/lib/schemas/models/inventory_transactions.d.ts +3 -3
- package/lib/schemas/models/item_transactions.d.ts +6 -6
- package/lib/schemas/models/offers.d.ts +146 -146
- package/lib/schemas/models/orders.d.ts +2573 -2573
- package/lib/schemas/models/printer_settings.d.ts +12 -12
- package/lib/schemas/models/reservations.d.ts +6 -6
- package/lib/schemas/models/rewards_usage.d.ts +6 -6
- package/lib/schemas/models/riders.d.ts +3 -3
- package/lib/schemas/models/tenants.d.ts +135 -135
- package/lib/schemas/models/void_order_items.d.ts +15 -15
- package/lib/schemas/models/void_warehouse_invoice_items.d.ts +25 -25
- package/lib/schemas/models/void_warehouse_invoice_items.js +2 -2
- package/lib/schemas/models/vouchers.d.ts +9 -9
- package/lib/schemas/models/warehouse-activity-logs.d.ts +13 -13
- package/lib/schemas/models/warehouse-activity-logs.js +4 -4
- package/lib/schemas/models/warehouse_categories.d.ts +4 -4
- package/lib/schemas/models/warehouse_categories.js +2 -2
- package/lib/schemas/models/warehouse_communications.d.ts +21 -21
- package/lib/schemas/models/warehouse_internal_movements.d.ts +33 -33
- package/lib/schemas/models/warehouse_internal_movements.js +8 -8
- package/lib/schemas/models/warehouse_inventory_lot_serial_numbers.d.ts +154 -0
- package/lib/schemas/models/warehouse_inventory_lot_serial_numbers.js +193 -0
- package/lib/schemas/models/warehouse_inventory_transactions.d.ts +6 -6
- package/lib/schemas/models/warehouse_invoices.d.ts +351 -351
- package/lib/schemas/models/warehouse_item_transactions.d.ts +9 -9
- package/lib/schemas/models/warehouse_items.d.ts +13 -13
- package/lib/schemas/models/warehouse_items.js +2 -2
- package/lib/schemas/models/warehouse_operational_roles.d.ts +3 -3
- package/lib/schemas/models/warehouse_purchase_order_receipts.d.ts +165 -0
- package/lib/schemas/models/warehouse_purchase_order_receipts.js +151 -0
- package/lib/schemas/models/warehouse_purchase_order_rfqs.d.ts +1959 -0
- package/lib/schemas/models/warehouse_purchase_order_rfqs.js +328 -0
- package/lib/schemas/models/warehouse_purchase_order_vendor_returns.d.ts +234 -0
- package/lib/schemas/models/warehouse_purchase_order_vendor_returns.js +188 -0
- package/lib/schemas/models/warehouse_purchase_orders.d.ts +2678 -0
- package/lib/schemas/models/warehouse_purchase_orders.js +336 -0
- package/lib/schemas/models/warehouse_sale_deliveries.d.ts +15 -15
- package/lib/schemas/models/warehouse_sale_deliveries.js +7 -4
- package/lib/schemas/models/warehouse_sale_invoices.d.ts +30 -30
- package/lib/schemas/models/warehouse_sale_invoices.js +8 -5
- package/lib/schemas/models/warehouse_sale_order_rfqs.d.ts +362 -362
- package/lib/schemas/models/warehouse_sale_order_rfqs.js +5 -5
- package/lib/schemas/models/warehouse_sale_orders.d.ts +367 -367
- package/lib/schemas/models/warehouse_sale_orders.js +5 -5
- package/lib/schemas/models/warehouse_void_invoice_items.d.ts +176 -0
- package/lib/schemas/models/warehouse_void_invoice_items.js +176 -0
- package/lib/schemas/models/warehouse_void_purchase_order_items.d.ts +176 -0
- package/lib/schemas/models/warehouse_void_purchase_order_items.js +177 -0
- package/lib/schemas/models/warehouses.d.ts +52 -52
- package/lib/schemas/models/warehouses.js +2 -2
- package/lib/schemas/types/index.d.ts +9 -9
- package/lib/schemas/types/index.js +9 -9
- package/lib/schemas/types/inventory_lot_serial_numbers.d.ts +5 -5
- package/lib/schemas/types/warehouse-activity-logs.d.ts +7 -7
- package/lib/schemas/types/warehouse_categories.d.ts +2 -2
- package/lib/schemas/types/warehouse_internal_movements.d.ts +9 -9
- package/lib/schemas/types/warehouse_inventory_lot_serial_numbers.d.ts +85 -0
- package/lib/schemas/types/warehouse_inventory_lot_serial_numbers.js +4 -0
- package/lib/schemas/types/warehouse_items.d.ts +2 -2
- package/lib/schemas/types/warehouse_purchase_order_common.d.ts +39 -0
- package/lib/schemas/types/warehouse_purchase_order_common.js +2 -0
- package/lib/schemas/types/warehouse_purchase_order_receipts.d.ts +39 -0
- package/lib/schemas/types/warehouse_purchase_order_receipts.js +21 -0
- package/lib/schemas/types/warehouse_purchase_order_rfqs.d.ts +33 -0
- package/lib/schemas/types/warehouse_purchase_order_rfqs.js +2 -0
- package/lib/schemas/types/warehouse_purchase_order_vendor_returns.d.ts +48 -0
- package/lib/schemas/types/warehouse_purchase_order_vendor_returns.js +2 -0
- package/lib/schemas/types/warehouse_purchase_orders.d.ts +33 -0
- package/lib/schemas/types/warehouse_purchase_orders.js +2 -0
- package/lib/schemas/types/warehouse_sale_deliveries.d.ts +29 -29
- package/lib/schemas/types/warehouse_sale_invoices.d.ts +17 -17
- package/lib/schemas/types/warehouse_sale_order_common.d.ts +39 -0
- package/lib/schemas/types/warehouse_sale_order_common.js +2 -0
- package/lib/schemas/types/warehouse_sale_order_rfqs.d.ts +7 -7
- package/lib/schemas/types/warehouse_sale_orders.d.ts +7 -7
- package/lib/schemas/types/warehouse_void_invoice_items.d.ts +37 -0
- package/lib/schemas/types/warehouse_void_invoice_items.js +2 -0
- package/lib/schemas/types/warehouse_void_purchase_order_items.d.ts +37 -0
- package/lib/schemas/types/warehouse_void_purchase_order_items.js +2 -0
- package/lib/schemas/types/warehouses.d.ts +2 -2
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.generatePurchaseOrderRfqCategories = generatePurchaseOrderRfqCategories;
|
|
7
7
|
exports.generatePurchaseOrderRfqIteration = generatePurchaseOrderRfqIteration;
|
|
8
8
|
const mongoose_1 = __importDefault(require("mongoose"));
|
|
9
|
-
const
|
|
9
|
+
const common_warehouse_purchase_order_actions_1 = require("../store/common-warehouse-purchase-order-actions");
|
|
10
10
|
function generatePurchaseOrderRfqCategories(categories) {
|
|
11
11
|
if (!categories)
|
|
12
12
|
return [];
|
|
@@ -39,7 +39,7 @@ function generatePurchaseOrderRfqIteration(order, partial = true, skipItemMetada
|
|
|
39
39
|
...getCommonOptionalNumFieldsRfqIteration(order, partial),
|
|
40
40
|
...(skipItemMetadata && order.categories != null
|
|
41
41
|
? {
|
|
42
|
-
categories: (0,
|
|
42
|
+
categories: (0, common_warehouse_purchase_order_actions_1.skipItemMetadataFromPurchaseOrderCategories)(order.categories),
|
|
43
43
|
}
|
|
44
44
|
: {
|
|
45
45
|
categories: generatePurchaseOrderRfqCategories(order.categories),
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function generatePurchaseOrderCategories(categories?:
|
|
3
|
-
export declare function generatePurchaseOrderIteration(order:
|
|
4
|
-
export declare function generatePurchaseOrderOnCreate<T extends
|
|
5
|
-
export declare function generatePurchaseOrderOnUpdate(partialUpdatedOrder: Partial<
|
|
1
|
+
import { WarehouseIPurchaseOrder, WarehouseIPurchaseOrderIteration } from '../../schemas';
|
|
2
|
+
export declare function generatePurchaseOrderCategories(categories?: WarehouseIPurchaseOrder['categories']): WarehouseIPurchaseOrder['categories'];
|
|
3
|
+
export declare function generatePurchaseOrderIteration(order: WarehouseIPurchaseOrder | WarehouseIPurchaseOrderIteration, partial?: boolean, skipItemMetadata?: boolean): WarehouseIPurchaseOrderIteration;
|
|
4
|
+
export declare function generatePurchaseOrderOnCreate<T extends WarehouseIPurchaseOrder | Partial<WarehouseIPurchaseOrder>>(order: T, withIterations?: boolean): T;
|
|
5
|
+
export declare function generatePurchaseOrderOnUpdate(partialUpdatedOrder: Partial<WarehouseIPurchaseOrder>): {
|
|
6
6
|
updateOperation: {
|
|
7
|
-
$unset?: Partial<Record<keyof
|
|
8
|
-
$set?: Partial<Record<keyof
|
|
7
|
+
$unset?: Partial<Record<keyof WarehouseIPurchaseOrder, any>> | undefined;
|
|
8
|
+
$set?: Partial<Record<keyof WarehouseIPurchaseOrder, any>> | undefined;
|
|
9
9
|
};
|
|
10
|
-
partialResponseOrder: Partial<
|
|
10
|
+
partialResponseOrder: Partial<WarehouseIPurchaseOrder>;
|
|
11
11
|
};
|
|
@@ -9,7 +9,7 @@ exports.generatePurchaseOrderOnCreate = generatePurchaseOrderOnCreate;
|
|
|
9
9
|
exports.generatePurchaseOrderOnUpdate = generatePurchaseOrderOnUpdate;
|
|
10
10
|
const mongoose_1 = __importDefault(require("mongoose"));
|
|
11
11
|
const constants_1 = require("../../constants");
|
|
12
|
-
const
|
|
12
|
+
const common_warehouse_purchase_order_actions_1 = require("../store/common-warehouse-purchase-order-actions");
|
|
13
13
|
function generatePurchaseOrderCategories(categories) {
|
|
14
14
|
if (!categories)
|
|
15
15
|
return [];
|
|
@@ -42,7 +42,7 @@ function generatePurchaseOrderIteration(order, partial = true, skipItemMetadata)
|
|
|
42
42
|
...getCommonOptionalNumFieldsPurchaseOrderIteration(order, partial),
|
|
43
43
|
...(skipItemMetadata && order.categories != null
|
|
44
44
|
? {
|
|
45
|
-
categories: (0,
|
|
45
|
+
categories: (0, common_warehouse_purchase_order_actions_1.skipItemMetadataFromPurchaseOrderCategories)(order.categories),
|
|
46
46
|
}
|
|
47
47
|
: {
|
|
48
48
|
categories: generatePurchaseOrderCategories(order.categories),
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { IWarehousePurchaseOrderRFQ, IWarehousePurchaseOrderRFQIteration } from '../../schemas';
|
|
2
|
+
export declare function generateWarehousePurchaseOrderRfqCategories(categories?: IWarehousePurchaseOrderRFQ['categories']): IWarehousePurchaseOrderRFQ['categories'];
|
|
3
|
+
export declare function generateWarehousePurchaseOrderRfqIteration(order: IWarehousePurchaseOrderRFQ | IWarehousePurchaseOrderRFQIteration, partial?: boolean, skipItemMetadata?: boolean): IWarehousePurchaseOrderRFQIteration;
|
|
@@ -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.generateWarehousePurchaseOrderRfqCategories = generateWarehousePurchaseOrderRfqCategories;
|
|
7
|
+
exports.generateWarehousePurchaseOrderRfqIteration = generateWarehousePurchaseOrderRfqIteration;
|
|
8
|
+
const mongoose_1 = __importDefault(require("mongoose"));
|
|
9
|
+
const common_warehouse_purchase_order_actions_1 = require("../store/common-warehouse-purchase-order-actions");
|
|
10
|
+
function generateWarehousePurchaseOrderRfqCategories(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 getCommonOptionalBoolFieldsRfqIteration(order, partial) {
|
|
24
|
+
const defaultValue = partial ? undefined : false;
|
|
25
|
+
return {
|
|
26
|
+
is_gst_inclusive: order.is_gst_inclusive || defaultValue,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function getCommonOptionalNumFieldsRfqIteration(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 generateWarehousePurchaseOrderRfqIteration(order, partial = true, skipItemMetadata) {
|
|
37
|
+
const iteration = {
|
|
38
|
+
...getCommonOptionalBoolFieldsRfqIteration(order, partial),
|
|
39
|
+
...getCommonOptionalNumFieldsRfqIteration(order, partial),
|
|
40
|
+
...(skipItemMetadata && order.categories != null
|
|
41
|
+
? {
|
|
42
|
+
categories: (0, common_warehouse_purchase_order_actions_1.skipItemMetadataFromWarehousePurchaseOrderCategories)(order.categories),
|
|
43
|
+
}
|
|
44
|
+
: {
|
|
45
|
+
categories: generateWarehousePurchaseOrderRfqCategories(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
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IWarehousePurchaseOrder, IWarehousePurchaseOrderIteration } from '../../schemas';
|
|
2
|
+
export declare function generateWarehousePurchaseOrderCategories(categories?: IWarehousePurchaseOrder['categories']): IWarehousePurchaseOrder['categories'];
|
|
3
|
+
export declare function generateWarehousePurchaseOrderIteration(order: IWarehousePurchaseOrder | IWarehousePurchaseOrderIteration, partial?: boolean, skipItemMetadata?: boolean): IWarehousePurchaseOrderIteration;
|
|
4
|
+
export declare function generateWarehousePurchaseOrderOnCreate<T extends IWarehousePurchaseOrder | Partial<IWarehousePurchaseOrder>>(order: T, withIterations?: boolean): T;
|
|
5
|
+
export declare function generateWarehousePurchaseOrderOnUpdate(partialUpdatedOrder: Partial<IWarehousePurchaseOrder>): {
|
|
6
|
+
updateOperation: {
|
|
7
|
+
$unset?: Partial<Record<keyof IWarehousePurchaseOrder, any>> | undefined;
|
|
8
|
+
$set?: Partial<Record<keyof IWarehousePurchaseOrder, any>> | undefined;
|
|
9
|
+
};
|
|
10
|
+
partialResponseOrder: Partial<IWarehousePurchaseOrder>;
|
|
11
|
+
};
|
|
@@ -0,0 +1,196 @@
|
|
|
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.generateWarehousePurchaseOrderCategories = generateWarehousePurchaseOrderCategories;
|
|
7
|
+
exports.generateWarehousePurchaseOrderIteration = generateWarehousePurchaseOrderIteration;
|
|
8
|
+
exports.generateWarehousePurchaseOrderOnCreate = generateWarehousePurchaseOrderOnCreate;
|
|
9
|
+
exports.generateWarehousePurchaseOrderOnUpdate = generateWarehousePurchaseOrderOnUpdate;
|
|
10
|
+
const mongoose_1 = __importDefault(require("mongoose"));
|
|
11
|
+
const constants_1 = require("../../constants");
|
|
12
|
+
const common_warehouse_purchase_order_actions_1 = require("../store/common-warehouse-purchase-order-actions");
|
|
13
|
+
function generateWarehousePurchaseOrderCategories(categories) {
|
|
14
|
+
if (!categories)
|
|
15
|
+
return [];
|
|
16
|
+
return categories.map((category) => ({
|
|
17
|
+
...category,
|
|
18
|
+
category_id: new mongoose_1.default.Types.ObjectId(category.category_id),
|
|
19
|
+
items: category.items.map((item) => ({
|
|
20
|
+
...item,
|
|
21
|
+
_id: new mongoose_1.default.Types.ObjectId(item._id),
|
|
22
|
+
item_id: new mongoose_1.default.Types.ObjectId(item.item_id),
|
|
23
|
+
})),
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
function getCommonOptionalBoolFieldsPurchaseOrderIteration(order, partial) {
|
|
27
|
+
const defaultValue = partial ? undefined : false;
|
|
28
|
+
return {
|
|
29
|
+
is_gst_inclusive: order.is_gst_inclusive || defaultValue,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function getCommonOptionalNumFieldsPurchaseOrderIteration(order, partial) {
|
|
33
|
+
const defaultValue = partial ? undefined : 0;
|
|
34
|
+
return {
|
|
35
|
+
gst: order.gst || defaultValue,
|
|
36
|
+
gst_amount: order.gst_amount || defaultValue,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function generateWarehousePurchaseOrderIteration(order, partial = true, skipItemMetadata) {
|
|
40
|
+
const iteration = {
|
|
41
|
+
...getCommonOptionalBoolFieldsPurchaseOrderIteration(order, partial),
|
|
42
|
+
...getCommonOptionalNumFieldsPurchaseOrderIteration(order, partial),
|
|
43
|
+
...(skipItemMetadata && order.categories != null
|
|
44
|
+
? {
|
|
45
|
+
categories: (0, common_warehouse_purchase_order_actions_1.skipItemMetadataFromWarehousePurchaseOrderCategories)(order.categories),
|
|
46
|
+
}
|
|
47
|
+
: {
|
|
48
|
+
categories: generateWarehousePurchaseOrderCategories(order.categories),
|
|
49
|
+
}),
|
|
50
|
+
payments: order.payments,
|
|
51
|
+
staff_details: order.staff_details,
|
|
52
|
+
special_instructions: order.special_instructions,
|
|
53
|
+
order_status: order.order_status,
|
|
54
|
+
price: order.price,
|
|
55
|
+
amount_earned: order.amount_earned,
|
|
56
|
+
grand_total: order.grand_total,
|
|
57
|
+
tax_number: order.tax_number,
|
|
58
|
+
updatedAt: order.updatedAt,
|
|
59
|
+
};
|
|
60
|
+
if (partial) {
|
|
61
|
+
Object.keys(iteration).forEach((key) => {
|
|
62
|
+
if (iteration[key] === undefined) {
|
|
63
|
+
delete iteration[key];
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return iteration;
|
|
68
|
+
}
|
|
69
|
+
function getPurchaseOrderIterations(iterations) {
|
|
70
|
+
if (!iterations)
|
|
71
|
+
return [];
|
|
72
|
+
return iterations.map((iteration) => ({
|
|
73
|
+
...iteration,
|
|
74
|
+
categories: generateWarehousePurchaseOrderCategories(iteration.categories),
|
|
75
|
+
updatedAt: new Date(iteration.updatedAt),
|
|
76
|
+
}));
|
|
77
|
+
}
|
|
78
|
+
function generateWarehousePurchaseOrderOnCreate(order, withIterations) {
|
|
79
|
+
const newOrder = {
|
|
80
|
+
...order,
|
|
81
|
+
...(order.payments != null
|
|
82
|
+
? {
|
|
83
|
+
payments: order.payments.map((payment) => ({
|
|
84
|
+
...payment,
|
|
85
|
+
_id: new mongoose_1.default.Types.ObjectId(payment._id),
|
|
86
|
+
})),
|
|
87
|
+
}
|
|
88
|
+
: {}),
|
|
89
|
+
...(order.categories != null ? { categories: generateWarehousePurchaseOrderCategories(order.categories) } : {}),
|
|
90
|
+
_id: new mongoose_1.default.Types.ObjectId(order._id),
|
|
91
|
+
iterations: withIterations ? getPurchaseOrderIterations(order.iterations) : [],
|
|
92
|
+
};
|
|
93
|
+
if (!newOrder.delete_reason) {
|
|
94
|
+
delete newOrder.delete_reason;
|
|
95
|
+
}
|
|
96
|
+
if (!newOrder.cancel_reason) {
|
|
97
|
+
delete newOrder.cancel_reason;
|
|
98
|
+
}
|
|
99
|
+
if (!newOrder.is_reopened) {
|
|
100
|
+
delete newOrder.is_reopened;
|
|
101
|
+
}
|
|
102
|
+
if (!newOrder.staff_details) {
|
|
103
|
+
delete newOrder.staff_details;
|
|
104
|
+
}
|
|
105
|
+
if (!newOrder.gst) {
|
|
106
|
+
delete newOrder.gst;
|
|
107
|
+
delete newOrder.gst_amount;
|
|
108
|
+
delete newOrder.is_gst_inclusive;
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
if (newOrder.gst_amount === 0) {
|
|
112
|
+
delete newOrder.gst_amount;
|
|
113
|
+
}
|
|
114
|
+
if (newOrder.is_gst_inclusive === false) {
|
|
115
|
+
delete newOrder.is_gst_inclusive;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
if (newOrder.payments?.some((payment) => payment.payment_type === constants_1.PAYMENT_TYPE_ENUM.PAY_LATER && payment.payment_status === constants_1.PAYMENT_STATUS_ENUM.PENDING)) {
|
|
119
|
+
newOrder.deferred_settlement = true;
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
delete newOrder.deferred_settlement;
|
|
123
|
+
}
|
|
124
|
+
return newOrder;
|
|
125
|
+
}
|
|
126
|
+
function generateWarehousePurchaseOrderOnUpdate(partialUpdatedOrder) {
|
|
127
|
+
const partialResponseOrder = {
|
|
128
|
+
...partialUpdatedOrder,
|
|
129
|
+
};
|
|
130
|
+
const unset = {};
|
|
131
|
+
const set = {
|
|
132
|
+
...partialUpdatedOrder,
|
|
133
|
+
...(partialUpdatedOrder.iterations != null
|
|
134
|
+
? {
|
|
135
|
+
iterations: getPurchaseOrderIterations(partialUpdatedOrder.iterations),
|
|
136
|
+
}
|
|
137
|
+
: {}),
|
|
138
|
+
...(partialUpdatedOrder.payments != null
|
|
139
|
+
? {
|
|
140
|
+
payments: partialUpdatedOrder.payments.map((payment) => ({
|
|
141
|
+
...payment,
|
|
142
|
+
_id: new mongoose_1.default.Types.ObjectId(payment._id),
|
|
143
|
+
})),
|
|
144
|
+
}
|
|
145
|
+
: {}),
|
|
146
|
+
...(partialUpdatedOrder.categories != null
|
|
147
|
+
? { categories: generateWarehousePurchaseOrderCategories(partialUpdatedOrder.categories) }
|
|
148
|
+
: {}),
|
|
149
|
+
};
|
|
150
|
+
if (set.delete_reason === null) {
|
|
151
|
+
delete set.delete_reason;
|
|
152
|
+
unset['delete_reason'] = '';
|
|
153
|
+
}
|
|
154
|
+
if (set.cancel_reason === null) {
|
|
155
|
+
delete set.cancel_reason;
|
|
156
|
+
unset['cancel_reason'] = '';
|
|
157
|
+
}
|
|
158
|
+
if (set.is_reopened === false) {
|
|
159
|
+
delete set.is_reopened;
|
|
160
|
+
unset['is_reopened'] = '';
|
|
161
|
+
}
|
|
162
|
+
if (set.staff_details === null) {
|
|
163
|
+
delete set.staff_details;
|
|
164
|
+
unset['staff_details'] = '';
|
|
165
|
+
}
|
|
166
|
+
if (set.gst === 0) {
|
|
167
|
+
delete set.gst;
|
|
168
|
+
delete set.gst_amount;
|
|
169
|
+
unset['gst'] = '';
|
|
170
|
+
unset['gst_amount'] = '';
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
if (set.gst_amount === 0) {
|
|
174
|
+
delete set.gst_amount;
|
|
175
|
+
unset['gst_amount'] = '';
|
|
176
|
+
}
|
|
177
|
+
if (set.is_gst_inclusive === false) {
|
|
178
|
+
delete set.is_gst_inclusive;
|
|
179
|
+
unset['is_gst_inclusive'] = '';
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
if (set.payments != null) {
|
|
183
|
+
if (set.payments.some((payment) => payment.payment_type === constants_1.PAYMENT_TYPE_ENUM.PAY_LATER &&
|
|
184
|
+
payment.payment_status === constants_1.PAYMENT_STATUS_ENUM.PENDING)) {
|
|
185
|
+
set.deferred_settlement = true;
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
unset['deferred_settlement'] = '';
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
const updateOperation = {
|
|
192
|
+
...(Object.keys(set).length > 0 ? { $set: set } : {}),
|
|
193
|
+
...(Object.keys(unset).length > 0 ? { $unset: unset } : {}),
|
|
194
|
+
};
|
|
195
|
+
return { updateOperation, partialResponseOrder };
|
|
196
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export * from './generate-order';
|
|
2
|
-
export * from './generate-purchase-order';
|
|
3
|
-
export * from './generate-purchase-order-rfq';
|
|
4
2
|
export * from './generate-warehouse-invoice';
|
|
3
|
+
export * from './generate-warehouse-purchase-order';
|
|
4
|
+
export * from './generate-warehouse-purchase-order-rfq';
|
|
@@ -15,6 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./generate-order"), exports);
|
|
18
|
-
__exportStar(require("./generate-purchase-order"), exports);
|
|
19
|
-
__exportStar(require("./generate-purchase-order-rfq"), exports);
|
|
20
18
|
__exportStar(require("./generate-warehouse-invoice"), exports);
|
|
19
|
+
__exportStar(require("./generate-warehouse-purchase-order"), exports);
|
|
20
|
+
__exportStar(require("./generate-warehouse-purchase-order-rfq"), exports);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { IPurchaseOrderStatus,
|
|
2
|
-
import {
|
|
3
|
-
export declare function getPurchaseOrdersFetchedData(data:
|
|
4
|
-
export declare function getPurchaseOrdersPostedData(data:
|
|
5
|
-
export declare function getPurchaseOrdersUpdatedData(data:
|
|
6
|
-
export declare function getPurchaseOrdersDeletedData(data:
|
|
1
|
+
import { IPurchaseOrderStatus, WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM } from '../../constants';
|
|
2
|
+
import { WarehouseIPurchaseOrder } from '../../schemas';
|
|
3
|
+
export declare function getPurchaseOrdersFetchedData(data: WarehouseIPurchaseOrder[]): WarehouseIPurchaseOrder[];
|
|
4
|
+
export declare function getPurchaseOrdersPostedData(data: WarehouseIPurchaseOrder[], order: WarehouseIPurchaseOrder): WarehouseIPurchaseOrder[];
|
|
5
|
+
export declare function getPurchaseOrdersUpdatedData(data: WarehouseIPurchaseOrder[], order: Partial<WarehouseIPurchaseOrder>): WarehouseIPurchaseOrder[];
|
|
6
|
+
export declare function getPurchaseOrdersDeletedData(data: WarehouseIPurchaseOrder[], orderId: string): WarehouseIPurchaseOrder[];
|
|
7
7
|
interface IGetPurchaseOrderStatusInfoReturn {
|
|
8
8
|
currentOrderStatus: IPurchaseOrderStatus | null;
|
|
9
9
|
nextOrderStatus: IPurchaseOrderStatus | null;
|
|
10
10
|
orderProgress: number;
|
|
11
11
|
}
|
|
12
|
-
export declare function getPurchaseOrderStatusInfo(currentStatus:
|
|
12
|
+
export declare function getPurchaseOrderStatusInfo(currentStatus: WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM): IGetPurchaseOrderStatusInfoReturn;
|
|
13
13
|
export {};
|
|
@@ -36,7 +36,7 @@ function getPurchaseOrderStatusInfo(currentStatus) {
|
|
|
36
36
|
if (obj.status === currentStatus) {
|
|
37
37
|
info.currentOrderStatus = obj;
|
|
38
38
|
currentStatusIndex = i;
|
|
39
|
-
if (info.currentOrderStatus.status !== constants_1.
|
|
39
|
+
if (info.currentOrderStatus.status !== constants_1.WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM.CANCELLED) {
|
|
40
40
|
// Total is -2 because we don't want to count unconfrimed and cancelled
|
|
41
41
|
const total = constants_1.DEFAULT_PURCHASE_ORDER_STATUS.length - 2;
|
|
42
42
|
info.orderProgress = Math.round((obj.priority / total) * 100);
|
|
@@ -48,7 +48,7 @@ function getPurchaseOrderStatusInfo(currentStatus) {
|
|
|
48
48
|
return info;
|
|
49
49
|
}
|
|
50
50
|
const nextObj = constants_1.DEFAULT_PURCHASE_ORDER_STATUS[currentStatusIndex + 1];
|
|
51
|
-
if (!nextObj || nextObj.status === constants_1.
|
|
51
|
+
if (!nextObj || nextObj.status === constants_1.WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM.CANCELLED) {
|
|
52
52
|
return info;
|
|
53
53
|
}
|
|
54
54
|
info.nextOrderStatus = nextObj;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function getSaleOrdersFetchedData(data:
|
|
1
|
+
import { WarehouseISaleOrder } from '../../schemas';
|
|
2
|
+
export declare function getSaleOrdersFetchedData(data: WarehouseISaleOrder[]): WarehouseISaleOrder[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IPurchaseOrderStatus, WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM } from '../../constants';
|
|
2
|
+
import { IWarehousePurchaseOrder } from '../../schemas';
|
|
3
|
+
export declare function getWarehousePurchaseOrdersFetchedData(data: IWarehousePurchaseOrder[]): IWarehousePurchaseOrder[];
|
|
4
|
+
export declare function getWarehousePurchaseOrdersPostedData(data: IWarehousePurchaseOrder[], order: IWarehousePurchaseOrder): IWarehousePurchaseOrder[];
|
|
5
|
+
export declare function getWarehousePurchaseOrdersUpdatedData(data: IWarehousePurchaseOrder[], order: Partial<IWarehousePurchaseOrder>): IWarehousePurchaseOrder[];
|
|
6
|
+
export declare function getWarehousePurchaseOrdersDeletedData(data: IWarehousePurchaseOrder[], orderId: string): IWarehousePurchaseOrder[];
|
|
7
|
+
interface IGetPurchaseOrderStatusInfoReturn {
|
|
8
|
+
currentOrderStatus: IPurchaseOrderStatus | null;
|
|
9
|
+
nextOrderStatus: IPurchaseOrderStatus | null;
|
|
10
|
+
orderProgress: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function getWarehousePurchaseOrderStatusInfo(currentStatus: WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM): IGetPurchaseOrderStatusInfoReturn;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getWarehousePurchaseOrdersFetchedData = getWarehousePurchaseOrdersFetchedData;
|
|
4
|
+
exports.getWarehousePurchaseOrdersPostedData = getWarehousePurchaseOrdersPostedData;
|
|
5
|
+
exports.getWarehousePurchaseOrdersUpdatedData = getWarehousePurchaseOrdersUpdatedData;
|
|
6
|
+
exports.getWarehousePurchaseOrdersDeletedData = getWarehousePurchaseOrdersDeletedData;
|
|
7
|
+
exports.getWarehousePurchaseOrderStatusInfo = getWarehousePurchaseOrderStatusInfo;
|
|
8
|
+
const constants_1 = require("../../constants");
|
|
9
|
+
const common_order_actions_1 = require("./common-order-actions");
|
|
10
|
+
const common_warehouse_purchase_order_actions_1 = require("./common-warehouse-purchase-order-actions");
|
|
11
|
+
function getWarehousePurchaseOrdersFetchedData(data) {
|
|
12
|
+
return data.map((order) => (0, common_warehouse_purchase_order_actions_1.getWarehousePurchaseOrderWithPrice)(order, false)).sort(common_order_actions_1.sortByCreatedAt);
|
|
13
|
+
}
|
|
14
|
+
function getWarehousePurchaseOrdersPostedData(data, order) {
|
|
15
|
+
const newOrders = data.filter((item) => item._id !== order._id).concat((0, common_warehouse_purchase_order_actions_1.getWarehousePurchaseOrderWithPrice)(order));
|
|
16
|
+
return newOrders.sort(common_order_actions_1.sortByCreatedAt);
|
|
17
|
+
}
|
|
18
|
+
function getWarehousePurchaseOrdersUpdatedData(data, order) {
|
|
19
|
+
const updatedOrder = (0, common_warehouse_purchase_order_actions_1.getWarehousePurchaseOrderWithPrice)(order);
|
|
20
|
+
const newOrders = data.map((item) => item._id === updatedOrder._id ? { ...item, ...updatedOrder } : item);
|
|
21
|
+
return newOrders;
|
|
22
|
+
}
|
|
23
|
+
function getWarehousePurchaseOrdersDeletedData(data, orderId) {
|
|
24
|
+
const filteredOrders = data.filter((item) => item._id !== orderId);
|
|
25
|
+
return filteredOrders;
|
|
26
|
+
}
|
|
27
|
+
function getWarehousePurchaseOrderStatusInfo(currentStatus) {
|
|
28
|
+
const info = {
|
|
29
|
+
orderProgress: 0,
|
|
30
|
+
nextOrderStatus: null,
|
|
31
|
+
currentOrderStatus: null,
|
|
32
|
+
};
|
|
33
|
+
let currentStatusIndex;
|
|
34
|
+
for (let i = 0; i < constants_1.DEFAULT_PURCHASE_ORDER_STATUS.length; i++) {
|
|
35
|
+
const obj = constants_1.DEFAULT_PURCHASE_ORDER_STATUS[i];
|
|
36
|
+
if (obj.status === currentStatus) {
|
|
37
|
+
info.currentOrderStatus = obj;
|
|
38
|
+
currentStatusIndex = i;
|
|
39
|
+
if (info.currentOrderStatus.status !== constants_1.WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM.CANCELLED) {
|
|
40
|
+
// Total is -2 because we don't want to count unconfrimed and cancelled
|
|
41
|
+
const total = constants_1.DEFAULT_PURCHASE_ORDER_STATUS.length - 2;
|
|
42
|
+
info.orderProgress = Math.round((obj.priority / total) * 100);
|
|
43
|
+
}
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (currentStatusIndex == null) {
|
|
48
|
+
return info;
|
|
49
|
+
}
|
|
50
|
+
const nextObj = constants_1.DEFAULT_PURCHASE_ORDER_STATUS[currentStatusIndex + 1];
|
|
51
|
+
if (!nextObj || nextObj.status === constants_1.WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM.CANCELLED) {
|
|
52
|
+
return info;
|
|
53
|
+
}
|
|
54
|
+
info.nextOrderStatus = nextObj;
|
|
55
|
+
return info;
|
|
56
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getWarehouseSaleOrdersFetchedData = getWarehouseSaleOrdersFetchedData;
|
|
4
|
+
const common_order_actions_1 = require("./common-order-actions");
|
|
5
|
+
const common_warehouse_sale_order_actions_1 = require("./common-warehouse-sale-order-actions");
|
|
6
|
+
function getWarehouseSaleOrdersFetchedData(data) {
|
|
7
|
+
return data.map((order) => (0, common_warehouse_sale_order_actions_1.getWarehouseSaleOrderWithPrice)(order, false)).sort(common_order_actions_1.sortByCreatedAt);
|
|
8
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { SORT_TYPE_ENUM } from '../../constants';
|
|
2
|
-
import { IOrderPayment,
|
|
2
|
+
import { IOrderPayment, WarehouseIPurchaseOrder, WarehouseIPurchaseOrderCategory, WarehouseIPurchaseOrderItem, WarehouseIPurchaseOrderIteration } from '../../schemas';
|
|
3
3
|
import { IGeneralPurchaseOrderItem, IPurchaseOrderCartItemsObj } from '../types';
|
|
4
|
-
export declare function getPurchaseOrderIterationsWithPrice(iterations?:
|
|
4
|
+
export declare function getPurchaseOrderIterationsWithPrice(iterations?: WarehouseIPurchaseOrderIteration[] | undefined, writeable?: boolean): WarehouseIPurchaseOrderIteration[];
|
|
5
5
|
export declare function getPurchaseOrderPaymentsWithPrice(payments: IOrderPayment[] | undefined, convertToPrice: (price: number) => number): IOrderPayment[];
|
|
6
|
-
export declare function getPurchaseOrderItemsWithPrice(items:
|
|
7
|
-
export declare function getPurchaseOrderCategoriesWithPrice(categories:
|
|
8
|
-
export declare function getPurchaseOrderWithPrice<T extends Partial<
|
|
9
|
-
export declare function syncPurchaseOrderData(order:
|
|
10
|
-
export declare function skipItemMetadataFromPurchaseOrderCategories(categories:
|
|
11
|
-
export declare function getPurchaseOrderWithAllFields<T extends
|
|
6
|
+
export declare function getPurchaseOrderItemsWithPrice(items: WarehouseIPurchaseOrderItem[] | undefined, convertToPrice: (price: number) => number): WarehouseIPurchaseOrderItem[];
|
|
7
|
+
export declare function getPurchaseOrderCategoriesWithPrice(categories: WarehouseIPurchaseOrderCategory[] | undefined, convertToPrice: (price: number) => number): WarehouseIPurchaseOrderCategory[];
|
|
8
|
+
export declare function getPurchaseOrderWithPrice<T extends Partial<WarehouseIPurchaseOrder> | WarehouseIPurchaseOrder | WarehouseIPurchaseOrderIteration>(order: T, writeable?: boolean): T;
|
|
9
|
+
export declare function syncPurchaseOrderData(order: WarehouseIPurchaseOrder): WarehouseIPurchaseOrder;
|
|
10
|
+
export declare function skipItemMetadataFromPurchaseOrderCategories(categories: WarehouseIPurchaseOrder['categories'], previousCategories?: WarehouseIPurchaseOrder['categories']): WarehouseIPurchaseOrder['categories'];
|
|
11
|
+
export declare function getPurchaseOrderWithAllFields<T extends WarehouseIPurchaseOrder | Partial<WarehouseIPurchaseOrder>>(order: T, skipItemMetadata?: boolean): T;
|
|
12
12
|
export interface IGetPurchaseOrderCartItemsObjPayload {
|
|
13
|
-
currentIterationCategories:
|
|
14
|
-
previousIterationCategories:
|
|
13
|
+
currentIterationCategories: WarehouseIPurchaseOrderCategory[] | undefined;
|
|
14
|
+
previousIterationCategories: WarehouseIPurchaseOrderCategory[] | undefined;
|
|
15
15
|
mappedItems: Record<string, IGeneralPurchaseOrderItem>;
|
|
16
16
|
shouldSortItemsViaId?: boolean;
|
|
17
17
|
isAnEdit?: boolean;
|
|
@@ -19,13 +19,13 @@ export interface IGetPurchaseOrderCartItemsObjPayload {
|
|
|
19
19
|
}
|
|
20
20
|
export declare function getPurchaseOrderCartItemsObj({ currentIterationCategories, previousIterationCategories, mappedItems, shouldSortItemsViaId, isAnEdit, sortType, }: IGetPurchaseOrderCartItemsObjPayload): IPurchaseOrderCartItemsObj;
|
|
21
21
|
interface IGetVoidItemsWithReasonPurchaseOrder {
|
|
22
|
-
currentCategories:
|
|
23
|
-
iterationsFromFrontend:
|
|
24
|
-
previousCategories:
|
|
22
|
+
currentCategories: WarehouseIPurchaseOrderCategory[];
|
|
23
|
+
iterationsFromFrontend: WarehouseIPurchaseOrderIteration[] | undefined;
|
|
24
|
+
previousCategories: WarehouseIPurchaseOrderCategory[];
|
|
25
25
|
}
|
|
26
26
|
export declare function getVoidItemsWithReasonPurchaseOrder({ currentCategories, iterationsFromFrontend, previousCategories, }: IGetVoidItemsWithReasonPurchaseOrder): {
|
|
27
|
-
newIterationCategories: import("../../schemas").
|
|
28
|
-
voidOrderItems: import("../../schemas").
|
|
27
|
+
newIterationCategories: import("../../schemas").WarehouseIPurchaseOrderCommonCategoryByCategoryId[];
|
|
28
|
+
voidOrderItems: import("../../schemas").WarehouseIPurchaseOrderCommonItem[];
|
|
29
29
|
hasNewItems: boolean;
|
|
30
30
|
};
|
|
31
31
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function getSaleOrderIterationsWithPrice(iterations?:
|
|
3
|
-
export declare function getSaleOrderItemsWithPrice(items:
|
|
4
|
-
export declare function getSaleOrderCategoriesWithPrice(categories:
|
|
5
|
-
export declare function getSaleOrderWithPrice<T extends Partial<
|
|
1
|
+
import { WarehouseISaleOrder, WarehouseISaleOrderCategory, WarehouseISaleOrderItem, WarehouseISaleOrderIteration } from '../../schemas';
|
|
2
|
+
export declare function getSaleOrderIterationsWithPrice(iterations?: WarehouseISaleOrderIteration[] | undefined, writeable?: boolean): WarehouseISaleOrderIteration[];
|
|
3
|
+
export declare function getSaleOrderItemsWithPrice(items: WarehouseISaleOrderItem[] | undefined, convertToPrice: (price: number) => number): WarehouseISaleOrderItem[];
|
|
4
|
+
export declare function getSaleOrderCategoriesWithPrice(categories: WarehouseISaleOrderCategory[] | undefined, convertToPrice: (price: number) => number): WarehouseISaleOrderCategory[];
|
|
5
|
+
export declare function getSaleOrderWithPrice<T extends Partial<WarehouseISaleOrder> | WarehouseISaleOrder | WarehouseISaleOrderIteration>(order: T, writeable?: boolean): T;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { SORT_TYPE_ENUM } from '../../constants';
|
|
2
|
+
import { IOrderPayment, IWarehousePurchaseOrder, IWarehousePurchaseOrderCategory, IWarehousePurchaseOrderItem, IWarehousePurchaseOrderIteration } from '../../schemas';
|
|
3
|
+
import { IWarehouseGeneralPurchaseOrderItem, IWarehousePurchaseOrderCartItemsObj } from '../types';
|
|
4
|
+
export declare function getWarehousePurchaseOrderIterationsWithPrice(iterations?: IWarehousePurchaseOrderIteration[] | undefined, writeable?: boolean): IWarehousePurchaseOrderIteration[];
|
|
5
|
+
export declare function getWarehousePurchaseOrderPaymentsWithPrice(payments: IOrderPayment[] | undefined, convertToPrice: (price: number) => number): IOrderPayment[];
|
|
6
|
+
export declare function getWarehousePurchaseOrderItemsWithPrice(items: IWarehousePurchaseOrderItem[] | undefined, convertToPrice: (price: number) => number): IWarehousePurchaseOrderItem[];
|
|
7
|
+
export declare function getWarehousePurchaseOrderCategoriesWithPrice(categories: IWarehousePurchaseOrderCategory[] | undefined, convertToPrice: (price: number) => number): IWarehousePurchaseOrderCategory[];
|
|
8
|
+
export declare function getWarehousePurchaseOrderWithPrice<T extends Partial<IWarehousePurchaseOrder> | IWarehousePurchaseOrder | IWarehousePurchaseOrderIteration>(order: T, writeable?: boolean): T;
|
|
9
|
+
export declare function syncWarehousePurchaseOrderData(order: IWarehousePurchaseOrder): IWarehousePurchaseOrder;
|
|
10
|
+
export declare function skipItemMetadataFromWarehousePurchaseOrderCategories(categories: IWarehousePurchaseOrder['categories'], previousCategories?: IWarehousePurchaseOrder['categories']): IWarehousePurchaseOrder['categories'];
|
|
11
|
+
export declare function getWarehousePurchaseOrderWithAllFields<T extends IWarehousePurchaseOrder | Partial<IWarehousePurchaseOrder>>(order: T, skipItemMetadata?: boolean): T;
|
|
12
|
+
export interface IGetPurchaseOrderCartItemsObjPayload {
|
|
13
|
+
currentIterationCategories: IWarehousePurchaseOrderCategory[] | undefined;
|
|
14
|
+
previousIterationCategories: IWarehousePurchaseOrderCategory[] | undefined;
|
|
15
|
+
mappedItems: Record<string, IWarehouseGeneralPurchaseOrderItem>;
|
|
16
|
+
shouldSortItemsViaId?: boolean;
|
|
17
|
+
isAnEdit?: boolean;
|
|
18
|
+
sortType?: SORT_TYPE_ENUM;
|
|
19
|
+
}
|
|
20
|
+
export declare function getWarehousePurchaseOrderCartItemsObj({ currentIterationCategories, previousIterationCategories, mappedItems, shouldSortItemsViaId, isAnEdit, sortType, }: IGetPurchaseOrderCartItemsObjPayload): IWarehousePurchaseOrderCartItemsObj;
|
|
21
|
+
interface IGetVoidItemsWithReasonPurchaseOrder {
|
|
22
|
+
currentCategories: IWarehousePurchaseOrderCategory[];
|
|
23
|
+
iterationsFromFrontend: IWarehousePurchaseOrderIteration[] | undefined;
|
|
24
|
+
previousCategories: IWarehousePurchaseOrderCategory[];
|
|
25
|
+
}
|
|
26
|
+
export declare function getVoidItemsWithReasonWarehousePurchaseOrder({ currentCategories, iterationsFromFrontend, previousCategories, }: IGetVoidItemsWithReasonPurchaseOrder): {
|
|
27
|
+
newIterationCategories: import("../../schemas").IWarehousePurchaseOrderCommonCategoryByCategoryId[];
|
|
28
|
+
voidOrderItems: import("../../schemas").IWarehousePurchaseOrderCommonItem[];
|
|
29
|
+
hasNewItems: boolean;
|
|
30
|
+
};
|
|
31
|
+
export {};
|