@managesome/eposmatic-toolkit 0.2.463 → 0.2.465
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/order/generate-warehouse-sale-order-rfq.d.ts +3 -0
- package/lib/helpers/order/generate-warehouse-sale-order-rfq.js +64 -0
- package/lib/helpers/order/index.d.ts +1 -0
- package/lib/helpers/order/index.js +1 -0
- package/lib/helpers/store/all-warehouse-sale-order-invoices-actions.d.ts +35 -0
- package/lib/helpers/store/all-warehouse-sale-order-invoices-actions.js +140 -0
- package/lib/helpers/store/all-warehouse-sale-orders-actions.d.ts +1 -0
- package/lib/helpers/store/all-warehouse-sale-orders-actions.js +6 -5
- package/lib/helpers/store/common-tenant-purchase-order-actions.js +1 -1
- package/lib/helpers/store/common-warehouse-sale-order-rfq-actions.d.ts +0 -1
- package/lib/helpers/store/common-warehouse-sale-order-rfq-actions.js +2 -88
- package/lib/helpers/store/index.d.ts +1 -0
- package/lib/helpers/store/index.js +1 -0
- package/lib/helpers/store/warehouse-sale-order-rfq-cart-actions.d.ts +1 -0
- package/lib/helpers/store/warehouse-sale-order-rfq-cart-actions.js +93 -7
- package/lib/schemas/models/warehouse_internal_movements.d.ts +3 -3
- package/lib/schemas/models/warehouse_sale_deliveries.d.ts +3 -3
- package/lib/schemas/models/warehouse_sale_invoices.d.ts +3 -3
- package/package.json +1 -1
|
@@ -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
|
+
}
|
|
@@ -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);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { WAREHOUSE_SALE_ORDER_CREDIT_NOTE_STATUS_ENUM, WAREHOUSE_SALE_ORDER_INVOICE_PAYMENT_STATUS_ENUM } from '../../constants';
|
|
2
|
+
import { IWarehouseSaleOrderFinancialDocStatus, IWarehouseSaleOrderInvoice } from '../../schemas';
|
|
3
|
+
export declare const DEFAULT_WAREHOUSE_SALE_ORDER_INVOICE_PAYMENT_STATUS: {
|
|
4
|
+
status: WAREHOUSE_SALE_ORDER_INVOICE_PAYMENT_STATUS_ENUM;
|
|
5
|
+
color: string;
|
|
6
|
+
contrast_color: string;
|
|
7
|
+
priority: number;
|
|
8
|
+
}[];
|
|
9
|
+
export declare const DEFAULT_WAREHOUSE_SALE_ORDER_CREDIT_NOTE_STATUS: {
|
|
10
|
+
status: WAREHOUSE_SALE_ORDER_CREDIT_NOTE_STATUS_ENUM;
|
|
11
|
+
color: string;
|
|
12
|
+
contrast_color: string;
|
|
13
|
+
priority: number;
|
|
14
|
+
}[];
|
|
15
|
+
export declare function getWarehouseSaleOrderInvoicesFetchedData(data: IWarehouseSaleOrderInvoice[]): IWarehouseSaleOrderInvoice[];
|
|
16
|
+
export declare function getWarehouseSaleOrderInvoicesPostedData(data: IWarehouseSaleOrderInvoice[], order: IWarehouseSaleOrderInvoice): IWarehouseSaleOrderInvoice[];
|
|
17
|
+
export declare function getWarehouseSaleOrderInvoicesUpdatedData(data: IWarehouseSaleOrderInvoice[], order: Partial<IWarehouseSaleOrderInvoice>): IWarehouseSaleOrderInvoice[];
|
|
18
|
+
export declare function getWarehouseSaleOrderInvoicesDeletedData(data: IWarehouseSaleOrderInvoice[], orderId: string): IWarehouseSaleOrderInvoice[];
|
|
19
|
+
interface IWarehouseGetSaleOrderInvoiceStatusInfoReturn {
|
|
20
|
+
currentOrderStatus: {
|
|
21
|
+
status: IWarehouseSaleOrderFinancialDocStatus;
|
|
22
|
+
color: string;
|
|
23
|
+
contrast_color: string;
|
|
24
|
+
priority: number;
|
|
25
|
+
} | null;
|
|
26
|
+
nextOrderStatus: {
|
|
27
|
+
status: IWarehouseSaleOrderFinancialDocStatus;
|
|
28
|
+
color: string;
|
|
29
|
+
contrast_color: string;
|
|
30
|
+
priority: number;
|
|
31
|
+
} | null;
|
|
32
|
+
orderProgress: number;
|
|
33
|
+
}
|
|
34
|
+
export declare function getWarehouseSaleOrderInvoiceStatusInfo(currentStatus: IWarehouseSaleOrderFinancialDocStatus): IWarehouseGetSaleOrderInvoiceStatusInfoReturn;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_WAREHOUSE_SALE_ORDER_CREDIT_NOTE_STATUS = exports.DEFAULT_WAREHOUSE_SALE_ORDER_INVOICE_PAYMENT_STATUS = void 0;
|
|
4
|
+
exports.getWarehouseSaleOrderInvoicesFetchedData = getWarehouseSaleOrderInvoicesFetchedData;
|
|
5
|
+
exports.getWarehouseSaleOrderInvoicesPostedData = getWarehouseSaleOrderInvoicesPostedData;
|
|
6
|
+
exports.getWarehouseSaleOrderInvoicesUpdatedData = getWarehouseSaleOrderInvoicesUpdatedData;
|
|
7
|
+
exports.getWarehouseSaleOrderInvoicesDeletedData = getWarehouseSaleOrderInvoicesDeletedData;
|
|
8
|
+
exports.getWarehouseSaleOrderInvoiceStatusInfo = getWarehouseSaleOrderInvoiceStatusInfo;
|
|
9
|
+
const constants_1 = require("../../constants");
|
|
10
|
+
const common_order_actions_1 = require("./common-order-actions");
|
|
11
|
+
const common_warehouse_sale_order_invoice_actions_1 = require("./common-warehouse-sale-order-invoice-actions");
|
|
12
|
+
exports.DEFAULT_WAREHOUSE_SALE_ORDER_INVOICE_PAYMENT_STATUS = [
|
|
13
|
+
{
|
|
14
|
+
status: constants_1.WAREHOUSE_SALE_ORDER_INVOICE_PAYMENT_STATUS_ENUM.DRAFT,
|
|
15
|
+
color: '#727472',
|
|
16
|
+
contrast_color: '#FFFFFF',
|
|
17
|
+
priority: 0,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
status: constants_1.WAREHOUSE_SALE_ORDER_INVOICE_PAYMENT_STATUS_ENUM.POSTED,
|
|
21
|
+
color: '#0000FF',
|
|
22
|
+
contrast_color: '#FFFFFF',
|
|
23
|
+
priority: 1,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
status: constants_1.WAREHOUSE_SALE_ORDER_INVOICE_PAYMENT_STATUS_ENUM.PARTIAL,
|
|
27
|
+
color: '#FFA500',
|
|
28
|
+
contrast_color: '#FFFFFF',
|
|
29
|
+
priority: 2,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
status: constants_1.WAREHOUSE_SALE_ORDER_INVOICE_PAYMENT_STATUS_ENUM.PAID,
|
|
33
|
+
color: '#4CC417',
|
|
34
|
+
contrast_color: '#FFFFFF',
|
|
35
|
+
priority: 3,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
status: constants_1.WAREHOUSE_SALE_ORDER_INVOICE_PAYMENT_STATUS_ENUM.CANCELLED,
|
|
39
|
+
color: '#FF0000',
|
|
40
|
+
contrast_color: '#FFFFFF',
|
|
41
|
+
priority: 4,
|
|
42
|
+
},
|
|
43
|
+
];
|
|
44
|
+
exports.DEFAULT_WAREHOUSE_SALE_ORDER_CREDIT_NOTE_STATUS = [
|
|
45
|
+
{
|
|
46
|
+
status: constants_1.WAREHOUSE_SALE_ORDER_CREDIT_NOTE_STATUS_ENUM.DRAFT,
|
|
47
|
+
color: '#727472',
|
|
48
|
+
contrast_color: '#FFFFFF',
|
|
49
|
+
priority: 0,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
status: constants_1.WAREHOUSE_SALE_ORDER_CREDIT_NOTE_STATUS_ENUM.CONFIRMED,
|
|
53
|
+
color: '#0000FF',
|
|
54
|
+
contrast_color: '#FFFFFF',
|
|
55
|
+
priority: 1,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
status: constants_1.WAREHOUSE_SALE_ORDER_CREDIT_NOTE_STATUS_ENUM.REFUND_PENDING,
|
|
59
|
+
color: '#FFA500',
|
|
60
|
+
contrast_color: '#FFFFFF',
|
|
61
|
+
priority: 2,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
status: constants_1.WAREHOUSE_SALE_ORDER_CREDIT_NOTE_STATUS_ENUM.REFUNDED,
|
|
65
|
+
color: '#4CC417',
|
|
66
|
+
contrast_color: '#FFFFFF',
|
|
67
|
+
priority: 3,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
status: constants_1.WAREHOUSE_SALE_ORDER_CREDIT_NOTE_STATUS_ENUM.CANCELLED,
|
|
71
|
+
color: '#FF0000',
|
|
72
|
+
contrast_color: '#FFFFFF',
|
|
73
|
+
priority: 4,
|
|
74
|
+
},
|
|
75
|
+
];
|
|
76
|
+
function getWarehouseSaleOrderInvoicesFetchedData(data) {
|
|
77
|
+
return data.map((order) => (0, common_warehouse_sale_order_invoice_actions_1.getWarehouseSaleOrderInvoiceWithPrice)(order, false)).sort(common_order_actions_1.sortByCreatedAt);
|
|
78
|
+
}
|
|
79
|
+
function getWarehouseSaleOrderInvoicesPostedData(data, order) {
|
|
80
|
+
const newOrders = data.filter((item) => item._id !== order._id).concat((0, common_warehouse_sale_order_invoice_actions_1.getWarehouseSaleOrderInvoiceWithPrice)(order));
|
|
81
|
+
return newOrders.sort(common_order_actions_1.sortByCreatedAt);
|
|
82
|
+
}
|
|
83
|
+
function getWarehouseSaleOrderInvoicesUpdatedData(data, order) {
|
|
84
|
+
const updatedOrder = (0, common_warehouse_sale_order_invoice_actions_1.getWarehouseSaleOrderInvoiceWithPrice)(order);
|
|
85
|
+
const newOrders = data.map((item) => item._id === updatedOrder._id ? { ...item, ...updatedOrder } : item);
|
|
86
|
+
return newOrders;
|
|
87
|
+
}
|
|
88
|
+
function getWarehouseSaleOrderInvoicesDeletedData(data, orderId) {
|
|
89
|
+
return data.filter((item) => item._id !== orderId);
|
|
90
|
+
}
|
|
91
|
+
function getStatusPriority(status) {
|
|
92
|
+
for (const entry of exports.DEFAULT_WAREHOUSE_SALE_ORDER_INVOICE_PAYMENT_STATUS) {
|
|
93
|
+
if (entry.status === status)
|
|
94
|
+
return entry.priority;
|
|
95
|
+
}
|
|
96
|
+
for (const entry of exports.DEFAULT_WAREHOUSE_SALE_ORDER_CREDIT_NOTE_STATUS) {
|
|
97
|
+
if (entry.status === status)
|
|
98
|
+
return entry.priority;
|
|
99
|
+
}
|
|
100
|
+
return undefined;
|
|
101
|
+
}
|
|
102
|
+
function isCancelledStatus(status) {
|
|
103
|
+
return (status === constants_1.WAREHOUSE_SALE_ORDER_INVOICE_PAYMENT_STATUS_ENUM.CANCELLED ||
|
|
104
|
+
status === constants_1.WAREHOUSE_SALE_ORDER_CREDIT_NOTE_STATUS_ENUM.CANCELLED);
|
|
105
|
+
}
|
|
106
|
+
function getWarehouseSaleOrderInvoiceStatusInfo(currentStatus) {
|
|
107
|
+
const info = {
|
|
108
|
+
orderProgress: 0,
|
|
109
|
+
nextOrderStatus: null,
|
|
110
|
+
currentOrderStatus: null,
|
|
111
|
+
};
|
|
112
|
+
// Determine which status array to use based on the status value
|
|
113
|
+
const isInvoiceStatus = Object.values(constants_1.WAREHOUSE_SALE_ORDER_INVOICE_PAYMENT_STATUS_ENUM).includes(currentStatus);
|
|
114
|
+
const statusArray = isInvoiceStatus
|
|
115
|
+
? exports.DEFAULT_WAREHOUSE_SALE_ORDER_INVOICE_PAYMENT_STATUS
|
|
116
|
+
: exports.DEFAULT_WAREHOUSE_SALE_ORDER_CREDIT_NOTE_STATUS;
|
|
117
|
+
let currentStatusIndex;
|
|
118
|
+
for (let i = 0; i < statusArray.length; i++) {
|
|
119
|
+
const obj = statusArray[i];
|
|
120
|
+
if (obj.status === currentStatus) {
|
|
121
|
+
info.currentOrderStatus = obj;
|
|
122
|
+
currentStatusIndex = i;
|
|
123
|
+
if (!isCancelledStatus(currentStatus)) {
|
|
124
|
+
// Total is -2 because we don't want to count draft and cancelled
|
|
125
|
+
const total = statusArray.length - 2;
|
|
126
|
+
info.orderProgress = Math.round((obj.priority / total) * 100);
|
|
127
|
+
}
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
if (currentStatusIndex == null) {
|
|
132
|
+
return info;
|
|
133
|
+
}
|
|
134
|
+
const nextObj = statusArray[currentStatusIndex + 1];
|
|
135
|
+
if (!nextObj || isCancelledStatus(nextObj.status)) {
|
|
136
|
+
return info;
|
|
137
|
+
}
|
|
138
|
+
info.nextOrderStatus = nextObj;
|
|
139
|
+
return info;
|
|
140
|
+
}
|
|
@@ -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
|
-
|
|
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
|
}
|
|
@@ -81,7 +81,7 @@ function syncTenantPurchaseOrderData(order) {
|
|
|
81
81
|
...order,
|
|
82
82
|
iterations: [],
|
|
83
83
|
};
|
|
84
|
-
const newOrder = getTenantPurchaseOrderWithPrice((0, tenant_purchase_orders_cart_actions_1.calculateCartTenantPurchaseOrderInfoAndSyncData)(getTenantPurchaseOrderWithPrice(updatedOrder
|
|
84
|
+
const newOrder = getTenantPurchaseOrderWithPrice((0, tenant_purchase_orders_cart_actions_1.calculateCartTenantPurchaseOrderInfoAndSyncData)(getTenantPurchaseOrderWithPrice(updatedOrder), true), true);
|
|
85
85
|
newOrder.iterations = order.iterations;
|
|
86
86
|
return newOrder;
|
|
87
87
|
}
|
|
@@ -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
|
}
|
|
@@ -2,6 +2,7 @@ export * from './all-orders-actions';
|
|
|
2
2
|
export * from './all-warehouse-purchase-order-rfqs-actions';
|
|
3
3
|
export * from './all-warehouse-purchase-order-vendor-return-actions';
|
|
4
4
|
export * from './all-warehouse-purchase-orders-actions';
|
|
5
|
+
export * from './all-warehouse-sale-order-invoices-actions';
|
|
5
6
|
export * from './all-warehouse-sale-order-rfqs-actions';
|
|
6
7
|
export * from './all-warehouse-sale-orders-actions';
|
|
7
8
|
export * from './cart-actions';
|
|
@@ -18,6 +18,7 @@ __exportStar(require("./all-orders-actions"), exports);
|
|
|
18
18
|
__exportStar(require("./all-warehouse-purchase-order-rfqs-actions"), exports);
|
|
19
19
|
__exportStar(require("./all-warehouse-purchase-order-vendor-return-actions"), exports);
|
|
20
20
|
__exportStar(require("./all-warehouse-purchase-orders-actions"), exports);
|
|
21
|
+
__exportStar(require("./all-warehouse-sale-order-invoices-actions"), exports);
|
|
21
22
|
__exportStar(require("./all-warehouse-sale-order-rfqs-actions"), exports);
|
|
22
23
|
__exportStar(require("./all-warehouse-sale-orders-actions"), exports);
|
|
23
24
|
__exportStar(require("./cart-actions"), exports);
|
|
@@ -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 —
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
364
|
+
return calculateCartWarehouseSaleOrderRfqOrderInfoAndSyncData({
|
|
279
365
|
...data,
|
|
280
366
|
categories: newCategories,
|
|
281
367
|
});
|
|
@@ -46,8 +46,8 @@ export declare const WarehouseInternalMovementsSchema: Schema<any, import("mongo
|
|
|
46
46
|
name: string;
|
|
47
47
|
uid: string;
|
|
48
48
|
};
|
|
49
|
-
ref_type: import("../../constants").WAREHOUSE_REF_TYPE_ENUM;
|
|
50
49
|
doc_number: string;
|
|
50
|
+
ref_type: import("../../constants").WAREHOUSE_REF_TYPE_ENUM;
|
|
51
51
|
record_type: import("../../constants").WAREHOUSE_INTERNAL_MOVEMENT_RECORD_TYPE_ENUM;
|
|
52
52
|
flow: import("../../constants").WAREHOUSE_INTERNAL_MOVEMENT_FLOW_ENUM;
|
|
53
53
|
source_id: string;
|
|
@@ -164,8 +164,8 @@ export declare const WarehouseInternalMovementsSchema: Schema<any, import("mongo
|
|
|
164
164
|
name: string;
|
|
165
165
|
uid: string;
|
|
166
166
|
};
|
|
167
|
-
ref_type: import("../../constants").WAREHOUSE_REF_TYPE_ENUM;
|
|
168
167
|
doc_number: string;
|
|
168
|
+
ref_type: import("../../constants").WAREHOUSE_REF_TYPE_ENUM;
|
|
169
169
|
record_type: import("../../constants").WAREHOUSE_INTERNAL_MOVEMENT_RECORD_TYPE_ENUM;
|
|
170
170
|
flow: import("../../constants").WAREHOUSE_INTERNAL_MOVEMENT_FLOW_ENUM;
|
|
171
171
|
source_id: string;
|
|
@@ -282,8 +282,8 @@ export declare const WarehouseInternalMovementsSchema: Schema<any, import("mongo
|
|
|
282
282
|
name: string;
|
|
283
283
|
uid: string;
|
|
284
284
|
};
|
|
285
|
-
ref_type: import("../../constants").WAREHOUSE_REF_TYPE_ENUM;
|
|
286
285
|
doc_number: string;
|
|
286
|
+
ref_type: import("../../constants").WAREHOUSE_REF_TYPE_ENUM;
|
|
287
287
|
record_type: import("../../constants").WAREHOUSE_INTERNAL_MOVEMENT_RECORD_TYPE_ENUM;
|
|
288
288
|
flow: import("../../constants").WAREHOUSE_INTERNAL_MOVEMENT_FLOW_ENUM;
|
|
289
289
|
source_id: string;
|
|
@@ -44,12 +44,12 @@ export declare const SaleOrderDeliveriesSchema: Schema<any, import("mongoose").M
|
|
|
44
44
|
name: string;
|
|
45
45
|
} | null | undefined;
|
|
46
46
|
cancelled_at?: NativeDate | null | undefined;
|
|
47
|
+
applied_to_doc_id?: import("mongoose").Types.ObjectId | null | undefined;
|
|
47
48
|
delivered_at?: NativeDate | null | undefined;
|
|
48
49
|
delivered_by?: {
|
|
49
50
|
_id: string;
|
|
50
51
|
name: string;
|
|
51
52
|
} | null | undefined;
|
|
52
|
-
applied_to_doc_id?: import("mongoose").Types.ObjectId | null | undefined;
|
|
53
53
|
inventory_restocked?: boolean | null | undefined;
|
|
54
54
|
returned_by?: {
|
|
55
55
|
_id: string;
|
|
@@ -96,12 +96,12 @@ export declare const SaleOrderDeliveriesSchema: Schema<any, import("mongoose").M
|
|
|
96
96
|
name: string;
|
|
97
97
|
} | null | undefined;
|
|
98
98
|
cancelled_at?: NativeDate | null | undefined;
|
|
99
|
+
applied_to_doc_id?: import("mongoose").Types.ObjectId | null | undefined;
|
|
99
100
|
delivered_at?: NativeDate | null | undefined;
|
|
100
101
|
delivered_by?: {
|
|
101
102
|
_id: string;
|
|
102
103
|
name: string;
|
|
103
104
|
} | null | undefined;
|
|
104
|
-
applied_to_doc_id?: import("mongoose").Types.ObjectId | null | undefined;
|
|
105
105
|
inventory_restocked?: boolean | null | undefined;
|
|
106
106
|
returned_by?: {
|
|
107
107
|
_id: string;
|
|
@@ -148,12 +148,12 @@ export declare const SaleOrderDeliveriesSchema: Schema<any, import("mongoose").M
|
|
|
148
148
|
name: string;
|
|
149
149
|
} | null | undefined;
|
|
150
150
|
cancelled_at?: NativeDate | null | undefined;
|
|
151
|
+
applied_to_doc_id?: import("mongoose").Types.ObjectId | null | undefined;
|
|
151
152
|
delivered_at?: NativeDate | null | undefined;
|
|
152
153
|
delivered_by?: {
|
|
153
154
|
_id: string;
|
|
154
155
|
name: string;
|
|
155
156
|
} | null | undefined;
|
|
156
|
-
applied_to_doc_id?: import("mongoose").Types.ObjectId | null | undefined;
|
|
157
157
|
inventory_restocked?: boolean | null | undefined;
|
|
158
158
|
returned_by?: {
|
|
159
159
|
_id: string;
|
|
@@ -35,9 +35,9 @@ export declare const WarehouseSaleOrderInvoiceSchema: Schema<any, import("mongoo
|
|
|
35
35
|
amount: number;
|
|
36
36
|
payments: any[];
|
|
37
37
|
warehouse_id: string;
|
|
38
|
-
doc_number: number;
|
|
39
38
|
doc_kind: import("../../constants").WAREHOUSE_SALE_ORDER_FIN_DOC_KIND_ENUM;
|
|
40
39
|
sale_order_id: import("mongoose").Types.ObjectId;
|
|
40
|
+
doc_number: number;
|
|
41
41
|
invoice_type: import("../../constants").WAREHOUSE_SALE_ORDER_INVOICE_TYPE_ENUM;
|
|
42
42
|
amount_paid?: number | null | undefined;
|
|
43
43
|
cancel_reason?: string | null | undefined;
|
|
@@ -107,9 +107,9 @@ export declare const WarehouseSaleOrderInvoiceSchema: Schema<any, import("mongoo
|
|
|
107
107
|
amount: number;
|
|
108
108
|
payments: any[];
|
|
109
109
|
warehouse_id: string;
|
|
110
|
-
doc_number: number;
|
|
111
110
|
doc_kind: import("../../constants").WAREHOUSE_SALE_ORDER_FIN_DOC_KIND_ENUM;
|
|
112
111
|
sale_order_id: import("mongoose").Types.ObjectId;
|
|
112
|
+
doc_number: number;
|
|
113
113
|
invoice_type: import("../../constants").WAREHOUSE_SALE_ORDER_INVOICE_TYPE_ENUM;
|
|
114
114
|
amount_paid?: number | null | undefined;
|
|
115
115
|
cancel_reason?: string | null | undefined;
|
|
@@ -179,9 +179,9 @@ export declare const WarehouseSaleOrderInvoiceSchema: Schema<any, import("mongoo
|
|
|
179
179
|
amount: number;
|
|
180
180
|
payments: any[];
|
|
181
181
|
warehouse_id: string;
|
|
182
|
-
doc_number: number;
|
|
183
182
|
doc_kind: import("../../constants").WAREHOUSE_SALE_ORDER_FIN_DOC_KIND_ENUM;
|
|
184
183
|
sale_order_id: import("mongoose").Types.ObjectId;
|
|
184
|
+
doc_number: number;
|
|
185
185
|
invoice_type: import("../../constants").WAREHOUSE_SALE_ORDER_INVOICE_TYPE_ENUM;
|
|
186
186
|
amount_paid?: number | null | undefined;
|
|
187
187
|
cancel_reason?: string | null | undefined;
|