@managesome/eposmatic-toolkit 0.2.431 → 0.2.432
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/index.d.ts +1 -0
- package/lib/constants/index.js +1 -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 +18 -18
- 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
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WAREHOUSE_PURCHASE_ORDER_COLLECTION_NAME = exports.PurchaseOrderSchema = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const constants_1 = require("../../constants");
|
|
6
|
+
const common_models_1 = require("./common-models");
|
|
7
|
+
const warehouse_purchase_order_rfqs_1 = require("./warehouse_purchase_order_rfqs");
|
|
8
|
+
const warehouse_categories_1 = require("./warehouse_categories");
|
|
9
|
+
const warehouse_items_1 = require("./warehouse_items");
|
|
10
|
+
const warehouse_vendors_1 = require("./warehouse_vendors");
|
|
11
|
+
const warehouses_1 = require("./warehouses");
|
|
12
|
+
const StaffDetailsSchema = new mongoose_1.Schema({
|
|
13
|
+
staff_id: {
|
|
14
|
+
type: String,
|
|
15
|
+
required: true,
|
|
16
|
+
},
|
|
17
|
+
staff_name: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: '',
|
|
20
|
+
},
|
|
21
|
+
staff_mobile: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: null,
|
|
24
|
+
},
|
|
25
|
+
staff_email: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: null,
|
|
28
|
+
},
|
|
29
|
+
}, { _id: false, minimize: false });
|
|
30
|
+
const ItemsModal = new mongoose_1.Schema({
|
|
31
|
+
_id: {
|
|
32
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
33
|
+
required: true,
|
|
34
|
+
immutable: true,
|
|
35
|
+
},
|
|
36
|
+
item_id: {
|
|
37
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
38
|
+
required: true,
|
|
39
|
+
immutable: true,
|
|
40
|
+
ref: warehouse_items_1.WAREHOUSE_ITEMS_COLLECTION_NAME,
|
|
41
|
+
},
|
|
42
|
+
is_ready: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
required: false,
|
|
45
|
+
},
|
|
46
|
+
void_reason: {
|
|
47
|
+
type: String,
|
|
48
|
+
required: false,
|
|
49
|
+
},
|
|
50
|
+
name: {
|
|
51
|
+
type: String,
|
|
52
|
+
required: true,
|
|
53
|
+
},
|
|
54
|
+
price: {
|
|
55
|
+
type: Number,
|
|
56
|
+
min: 0,
|
|
57
|
+
required: true,
|
|
58
|
+
},
|
|
59
|
+
subtotal: {
|
|
60
|
+
type: Number,
|
|
61
|
+
min: 0,
|
|
62
|
+
required: true,
|
|
63
|
+
},
|
|
64
|
+
quantity: {
|
|
65
|
+
type: Number,
|
|
66
|
+
min: 0,
|
|
67
|
+
required: true,
|
|
68
|
+
},
|
|
69
|
+
_gst_amount: {
|
|
70
|
+
type: Number,
|
|
71
|
+
min: 0,
|
|
72
|
+
required: true,
|
|
73
|
+
},
|
|
74
|
+
_net_amount: {
|
|
75
|
+
type: Number,
|
|
76
|
+
min: 0,
|
|
77
|
+
required: true,
|
|
78
|
+
},
|
|
79
|
+
_gross_amount: {
|
|
80
|
+
type: Number,
|
|
81
|
+
min: 0,
|
|
82
|
+
required: true,
|
|
83
|
+
},
|
|
84
|
+
_discount_amount: {
|
|
85
|
+
type: Number,
|
|
86
|
+
min: 0,
|
|
87
|
+
required: true,
|
|
88
|
+
},
|
|
89
|
+
special_instructions: {
|
|
90
|
+
type: String,
|
|
91
|
+
default: '',
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
const CatergoriesSchema = new mongoose_1.Schema({
|
|
95
|
+
category_id: {
|
|
96
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
97
|
+
required: true,
|
|
98
|
+
immutable: true,
|
|
99
|
+
ref: warehouse_categories_1.WAREHOUSE_CATEGORY_COLLECTION_NAME,
|
|
100
|
+
},
|
|
101
|
+
name: {
|
|
102
|
+
type: String,
|
|
103
|
+
required: true,
|
|
104
|
+
},
|
|
105
|
+
items: {
|
|
106
|
+
type: [ItemsModal],
|
|
107
|
+
default: [],
|
|
108
|
+
},
|
|
109
|
+
}, {
|
|
110
|
+
_id: false,
|
|
111
|
+
minimize: false,
|
|
112
|
+
});
|
|
113
|
+
const IterationsOrderSchema = new mongoose_1.Schema({
|
|
114
|
+
categories: {
|
|
115
|
+
type: [CatergoriesSchema],
|
|
116
|
+
required: true,
|
|
117
|
+
},
|
|
118
|
+
special_instructions: {
|
|
119
|
+
type: String,
|
|
120
|
+
default: '',
|
|
121
|
+
},
|
|
122
|
+
payments: {
|
|
123
|
+
type: [common_models_1.PaymentsSchema],
|
|
124
|
+
required: true,
|
|
125
|
+
},
|
|
126
|
+
order_status: {
|
|
127
|
+
type: String,
|
|
128
|
+
enum: constants_1.ALL_WAREHOUSE_PURCHASE_ORDER_STATUS_NAMES,
|
|
129
|
+
required: true,
|
|
130
|
+
},
|
|
131
|
+
price: {
|
|
132
|
+
type: Number,
|
|
133
|
+
min: 0,
|
|
134
|
+
required: true,
|
|
135
|
+
},
|
|
136
|
+
amount_earned: {
|
|
137
|
+
type: Number,
|
|
138
|
+
min: 0,
|
|
139
|
+
required: true,
|
|
140
|
+
},
|
|
141
|
+
grand_total: {
|
|
142
|
+
type: Number,
|
|
143
|
+
min: 0,
|
|
144
|
+
required: true,
|
|
145
|
+
},
|
|
146
|
+
staff_details: {
|
|
147
|
+
type: StaffDetailsSchema,
|
|
148
|
+
required: false,
|
|
149
|
+
},
|
|
150
|
+
gst: {
|
|
151
|
+
type: Number,
|
|
152
|
+
min: 0,
|
|
153
|
+
required: false,
|
|
154
|
+
},
|
|
155
|
+
gst_amount: {
|
|
156
|
+
type: Number,
|
|
157
|
+
min: 0,
|
|
158
|
+
required: false,
|
|
159
|
+
},
|
|
160
|
+
is_gst_inclusive: {
|
|
161
|
+
type: Boolean,
|
|
162
|
+
required: false,
|
|
163
|
+
},
|
|
164
|
+
tax_number: {
|
|
165
|
+
type: String,
|
|
166
|
+
default: '',
|
|
167
|
+
},
|
|
168
|
+
updatedAt: {
|
|
169
|
+
type: mongoose_1.Schema.Types.Date,
|
|
170
|
+
required: true,
|
|
171
|
+
},
|
|
172
|
+
}, {
|
|
173
|
+
_id: false,
|
|
174
|
+
timestamps: false,
|
|
175
|
+
versionKey: false,
|
|
176
|
+
});
|
|
177
|
+
exports.PurchaseOrderSchema = new mongoose_1.Schema({
|
|
178
|
+
_id: {
|
|
179
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
180
|
+
required: true,
|
|
181
|
+
immutable: true,
|
|
182
|
+
},
|
|
183
|
+
warehouse_id: {
|
|
184
|
+
type: String,
|
|
185
|
+
required: true,
|
|
186
|
+
ref: warehouses_1.WAREHOUSE_SETTINGS_COLLECTION_NAME,
|
|
187
|
+
},
|
|
188
|
+
vendor_id: {
|
|
189
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
190
|
+
required: true,
|
|
191
|
+
ref: warehouse_vendors_1.WAREHOUSE_VENDORS_COLLECTION_NAME,
|
|
192
|
+
},
|
|
193
|
+
vendor_name: {
|
|
194
|
+
type: String,
|
|
195
|
+
default: '',
|
|
196
|
+
},
|
|
197
|
+
rfq_id: {
|
|
198
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
199
|
+
required: false,
|
|
200
|
+
ref: warehouse_purchase_order_rfqs_1.WAREHOUSE_PURCHASE_ORDER_RFQ_COLLECTION_NAME,
|
|
201
|
+
},
|
|
202
|
+
categories: {
|
|
203
|
+
type: [CatergoriesSchema],
|
|
204
|
+
default: [],
|
|
205
|
+
},
|
|
206
|
+
iterations: {
|
|
207
|
+
type: [IterationsOrderSchema],
|
|
208
|
+
default: [],
|
|
209
|
+
},
|
|
210
|
+
special_instructions: {
|
|
211
|
+
type: String,
|
|
212
|
+
default: '',
|
|
213
|
+
},
|
|
214
|
+
payments: {
|
|
215
|
+
type: [common_models_1.PaymentsSchema],
|
|
216
|
+
required: true,
|
|
217
|
+
},
|
|
218
|
+
order_status: {
|
|
219
|
+
type: String,
|
|
220
|
+
enum: constants_1.ALL_WAREHOUSE_PURCHASE_ORDER_STATUS_NAMES,
|
|
221
|
+
required: true,
|
|
222
|
+
},
|
|
223
|
+
tax_number: {
|
|
224
|
+
type: String,
|
|
225
|
+
default: '',
|
|
226
|
+
},
|
|
227
|
+
price: {
|
|
228
|
+
type: Number,
|
|
229
|
+
min: 0,
|
|
230
|
+
required: true,
|
|
231
|
+
},
|
|
232
|
+
amount_collected: {
|
|
233
|
+
type: Number,
|
|
234
|
+
min: 0,
|
|
235
|
+
required: true,
|
|
236
|
+
},
|
|
237
|
+
amount_earned: {
|
|
238
|
+
type: Number,
|
|
239
|
+
min: 0,
|
|
240
|
+
required: true,
|
|
241
|
+
},
|
|
242
|
+
grand_total: {
|
|
243
|
+
type: Number,
|
|
244
|
+
min: 0,
|
|
245
|
+
required: true,
|
|
246
|
+
},
|
|
247
|
+
order_number: {
|
|
248
|
+
type: Number,
|
|
249
|
+
min: 0,
|
|
250
|
+
default: null,
|
|
251
|
+
},
|
|
252
|
+
//
|
|
253
|
+
delete_reason: {
|
|
254
|
+
type: String,
|
|
255
|
+
required: false,
|
|
256
|
+
},
|
|
257
|
+
cancel_reason: {
|
|
258
|
+
type: String,
|
|
259
|
+
required: false,
|
|
260
|
+
},
|
|
261
|
+
// common fields
|
|
262
|
+
staff_details: {
|
|
263
|
+
type: StaffDetailsSchema,
|
|
264
|
+
required: true,
|
|
265
|
+
},
|
|
266
|
+
gst: {
|
|
267
|
+
type: Number,
|
|
268
|
+
min: 0,
|
|
269
|
+
required: false,
|
|
270
|
+
},
|
|
271
|
+
gst_amount: {
|
|
272
|
+
type: Number,
|
|
273
|
+
min: 0,
|
|
274
|
+
required: false,
|
|
275
|
+
},
|
|
276
|
+
is_gst_inclusive: {
|
|
277
|
+
type: Boolean,
|
|
278
|
+
required: false,
|
|
279
|
+
},
|
|
280
|
+
//
|
|
281
|
+
is_deleted: {
|
|
282
|
+
type: Boolean,
|
|
283
|
+
default: false,
|
|
284
|
+
},
|
|
285
|
+
order_status_updated_at: {
|
|
286
|
+
type: mongoose_1.Schema.Types.Date,
|
|
287
|
+
required: true,
|
|
288
|
+
default: () => new Date(),
|
|
289
|
+
},
|
|
290
|
+
is_reopened: {
|
|
291
|
+
type: Boolean,
|
|
292
|
+
required: false,
|
|
293
|
+
},
|
|
294
|
+
deferred_settlement: {
|
|
295
|
+
type: Boolean,
|
|
296
|
+
required: false,
|
|
297
|
+
},
|
|
298
|
+
order_settled_at: {
|
|
299
|
+
type: mongoose_1.Schema.Types.Date,
|
|
300
|
+
required: true,
|
|
301
|
+
default: () => new Date(),
|
|
302
|
+
},
|
|
303
|
+
order_settled_at_mins: {
|
|
304
|
+
type: Number,
|
|
305
|
+
required: true,
|
|
306
|
+
default: () => {
|
|
307
|
+
const date = new Date();
|
|
308
|
+
return Math.floor(date.getHours() * 60 + date.getMinutes());
|
|
309
|
+
},
|
|
310
|
+
},
|
|
311
|
+
createdAt_mins: {
|
|
312
|
+
type: Number,
|
|
313
|
+
required: true,
|
|
314
|
+
immutable: true,
|
|
315
|
+
default: () => {
|
|
316
|
+
const date = new Date();
|
|
317
|
+
return Math.floor(date.getHours() * 60 + date.getMinutes());
|
|
318
|
+
},
|
|
319
|
+
},
|
|
320
|
+
createdAt: {
|
|
321
|
+
type: mongoose_1.Schema.Types.Date,
|
|
322
|
+
required: true,
|
|
323
|
+
default: () => new Date(),
|
|
324
|
+
immutable: true,
|
|
325
|
+
},
|
|
326
|
+
updatedAt: {
|
|
327
|
+
type: mongoose_1.Schema.Types.Date,
|
|
328
|
+
required: true,
|
|
329
|
+
default: () => new Date(),
|
|
330
|
+
},
|
|
331
|
+
}, {
|
|
332
|
+
timestamps: true,
|
|
333
|
+
versionKey: false,
|
|
334
|
+
minimize: false,
|
|
335
|
+
});
|
|
336
|
+
exports.WAREHOUSE_PURCHASE_ORDER_COLLECTION_NAME = 'warehouse_purchase_orders';
|
|
@@ -13,24 +13,24 @@ export declare const SaleOrderDeliveriesSchema: Schema<any, import("mongoose").M
|
|
|
13
13
|
createdAt: NativeDate;
|
|
14
14
|
updatedAt: NativeDate;
|
|
15
15
|
items: import("mongoose").Types.DocumentArray<{
|
|
16
|
-
quantity: number;
|
|
17
16
|
item_id: import("mongoose").Types.ObjectId;
|
|
17
|
+
quantity: number;
|
|
18
18
|
item_name: string;
|
|
19
19
|
reason?: string | null | undefined;
|
|
20
20
|
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
21
|
-
quantity: number;
|
|
22
21
|
item_id: import("mongoose").Types.ObjectId;
|
|
22
|
+
quantity: number;
|
|
23
23
|
item_name: string;
|
|
24
24
|
reason?: string | null | undefined;
|
|
25
25
|
}> & {
|
|
26
|
-
quantity: number;
|
|
27
26
|
item_id: import("mongoose").Types.ObjectId;
|
|
27
|
+
quantity: number;
|
|
28
28
|
item_name: string;
|
|
29
29
|
reason?: string | null | undefined;
|
|
30
30
|
}>;
|
|
31
|
-
status: import("../../constants").
|
|
31
|
+
status: import("../../constants").WAREHOUSE_SALE_ORDER_DELIVERY_STATUS_ENUM | import("../../constants").WAREHOUSE_SALE_ORDER_DELIVERY_RETURN_STATUS_ENUM;
|
|
32
32
|
warehouse_id: string;
|
|
33
|
-
doc_kind: import("../../constants").
|
|
33
|
+
doc_kind: import("../../constants").WAREHOUSE_SALE_ORDER_PHYSICAL_DOC_KIND_ENUM;
|
|
34
34
|
sale_order_id: import("mongoose").Types.ObjectId;
|
|
35
35
|
cancel_reason?: string | null | undefined;
|
|
36
36
|
notes?: string | null | undefined;
|
|
@@ -65,24 +65,24 @@ export declare const SaleOrderDeliveriesSchema: Schema<any, import("mongoose").M
|
|
|
65
65
|
createdAt: NativeDate;
|
|
66
66
|
updatedAt: NativeDate;
|
|
67
67
|
items: import("mongoose").Types.DocumentArray<{
|
|
68
|
-
quantity: number;
|
|
69
68
|
item_id: import("mongoose").Types.ObjectId;
|
|
69
|
+
quantity: number;
|
|
70
70
|
item_name: string;
|
|
71
71
|
reason?: string | null | undefined;
|
|
72
72
|
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
73
|
-
quantity: number;
|
|
74
73
|
item_id: import("mongoose").Types.ObjectId;
|
|
74
|
+
quantity: number;
|
|
75
75
|
item_name: string;
|
|
76
76
|
reason?: string | null | undefined;
|
|
77
77
|
}> & {
|
|
78
|
-
quantity: number;
|
|
79
78
|
item_id: import("mongoose").Types.ObjectId;
|
|
79
|
+
quantity: number;
|
|
80
80
|
item_name: string;
|
|
81
81
|
reason?: string | null | undefined;
|
|
82
82
|
}>;
|
|
83
|
-
status: import("../../constants").
|
|
83
|
+
status: import("../../constants").WAREHOUSE_SALE_ORDER_DELIVERY_STATUS_ENUM | import("../../constants").WAREHOUSE_SALE_ORDER_DELIVERY_RETURN_STATUS_ENUM;
|
|
84
84
|
warehouse_id: string;
|
|
85
|
-
doc_kind: import("../../constants").
|
|
85
|
+
doc_kind: import("../../constants").WAREHOUSE_SALE_ORDER_PHYSICAL_DOC_KIND_ENUM;
|
|
86
86
|
sale_order_id: import("mongoose").Types.ObjectId;
|
|
87
87
|
cancel_reason?: string | null | undefined;
|
|
88
88
|
notes?: string | null | undefined;
|
|
@@ -117,24 +117,24 @@ export declare const SaleOrderDeliveriesSchema: Schema<any, import("mongoose").M
|
|
|
117
117
|
createdAt: NativeDate;
|
|
118
118
|
updatedAt: NativeDate;
|
|
119
119
|
items: import("mongoose").Types.DocumentArray<{
|
|
120
|
-
quantity: number;
|
|
121
120
|
item_id: import("mongoose").Types.ObjectId;
|
|
121
|
+
quantity: number;
|
|
122
122
|
item_name: string;
|
|
123
123
|
reason?: string | null | undefined;
|
|
124
124
|
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
125
|
-
quantity: number;
|
|
126
125
|
item_id: import("mongoose").Types.ObjectId;
|
|
126
|
+
quantity: number;
|
|
127
127
|
item_name: string;
|
|
128
128
|
reason?: string | null | undefined;
|
|
129
129
|
}> & {
|
|
130
|
-
quantity: number;
|
|
131
130
|
item_id: import("mongoose").Types.ObjectId;
|
|
131
|
+
quantity: number;
|
|
132
132
|
item_name: string;
|
|
133
133
|
reason?: string | null | undefined;
|
|
134
134
|
}>;
|
|
135
|
-
status: import("../../constants").
|
|
135
|
+
status: import("../../constants").WAREHOUSE_SALE_ORDER_DELIVERY_STATUS_ENUM | import("../../constants").WAREHOUSE_SALE_ORDER_DELIVERY_RETURN_STATUS_ENUM;
|
|
136
136
|
warehouse_id: string;
|
|
137
|
-
doc_kind: import("../../constants").
|
|
137
|
+
doc_kind: import("../../constants").WAREHOUSE_SALE_ORDER_PHYSICAL_DOC_KIND_ENUM;
|
|
138
138
|
sale_order_id: import("mongoose").Types.ObjectId;
|
|
139
139
|
cancel_reason?: string | null | undefined;
|
|
140
140
|
notes?: string | null | undefined;
|
|
@@ -7,7 +7,10 @@ const warehouse_items_1 = require("./warehouse_items");
|
|
|
7
7
|
const warehouse_sale_orders_1 = require("./warehouse_sale_orders");
|
|
8
8
|
const warehouses_1 = require("./warehouses");
|
|
9
9
|
exports.WAREHOUSE_SALE_DELIVERY_COLLECTION_NAME = 'warehouse_sale_deliveries';
|
|
10
|
-
const
|
|
10
|
+
const ALL_WAREHOUSE_SALE_ORDER_PHYSICAL_DOC_STATUS_NAMES = Array.from(new Set([
|
|
11
|
+
...constants_1.ALL_WAREHOUSE_SALE_ORDER_DELIVERY_STATUS_NAMES,
|
|
12
|
+
...constants_1.ALL_WAREHOUSE_SALE_ORDER_DELIVERY_RETURN_STATUS_NAMES,
|
|
13
|
+
]));
|
|
11
14
|
const SaleOrderDeliveryActorSchema = new mongoose_1.Schema({
|
|
12
15
|
_id: {
|
|
13
16
|
type: String,
|
|
@@ -52,7 +55,7 @@ exports.SaleOrderDeliveriesSchema = new mongoose_1.Schema({
|
|
|
52
55
|
},
|
|
53
56
|
doc_kind: {
|
|
54
57
|
type: String,
|
|
55
|
-
enum: constants_1.
|
|
58
|
+
enum: constants_1.ALL_WAREHOUSE_SALE_ORDER_PHYSICAL_DOC_KIND_NAMES,
|
|
56
59
|
required: true,
|
|
57
60
|
},
|
|
58
61
|
warehouse_id: {
|
|
@@ -63,7 +66,7 @@ exports.SaleOrderDeliveriesSchema = new mongoose_1.Schema({
|
|
|
63
66
|
sale_order_id: {
|
|
64
67
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
65
68
|
required: true,
|
|
66
|
-
ref: warehouse_sale_orders_1.
|
|
69
|
+
ref: warehouse_sale_orders_1.WAREHOUSE_SALE_ORDER_COLLECTION_NAME,
|
|
67
70
|
},
|
|
68
71
|
// Present for delivery-return records.
|
|
69
72
|
applied_to_doc_id: {
|
|
@@ -77,7 +80,7 @@ exports.SaleOrderDeliveriesSchema = new mongoose_1.Schema({
|
|
|
77
80
|
},
|
|
78
81
|
status: {
|
|
79
82
|
type: String,
|
|
80
|
-
enum:
|
|
83
|
+
enum: ALL_WAREHOUSE_SALE_ORDER_PHYSICAL_DOC_STATUS_NAMES,
|
|
81
84
|
required: true,
|
|
82
85
|
},
|
|
83
86
|
notes: {
|
|
@@ -13,34 +13,37 @@ export declare const SaleOrderInvoicesSchema: Schema<any, import("mongoose").Mod
|
|
|
13
13
|
createdAt: NativeDate;
|
|
14
14
|
updatedAt: NativeDate;
|
|
15
15
|
items: import("mongoose").Types.DocumentArray<{
|
|
16
|
-
quantity: number;
|
|
17
16
|
item_id: import("mongoose").Types.ObjectId;
|
|
17
|
+
quantity: number;
|
|
18
18
|
unit_price: number;
|
|
19
19
|
item_name: string;
|
|
20
20
|
reason?: string | null | undefined;
|
|
21
21
|
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
22
|
-
quantity: number;
|
|
23
22
|
item_id: import("mongoose").Types.ObjectId;
|
|
23
|
+
quantity: number;
|
|
24
24
|
unit_price: number;
|
|
25
25
|
item_name: string;
|
|
26
26
|
reason?: string | null | undefined;
|
|
27
27
|
}> & {
|
|
28
|
-
quantity: number;
|
|
29
28
|
item_id: import("mongoose").Types.ObjectId;
|
|
29
|
+
quantity: number;
|
|
30
30
|
unit_price: number;
|
|
31
31
|
item_name: string;
|
|
32
32
|
reason?: string | null | undefined;
|
|
33
33
|
}>;
|
|
34
|
-
status: import("../../constants").
|
|
34
|
+
status: import("../../constants").WAREHOUSE_SALE_ORDER_INVOICE_PAYMENT_STATUS_ENUM | import("../../constants").WAREHOUSE_SALE_ORDER_CREDIT_NOTE_STATUS_ENUM;
|
|
35
35
|
amount: number;
|
|
36
36
|
payments: any[];
|
|
37
|
-
doc_number: number;
|
|
38
|
-
invoice_type: import("../../constants").SALE_ORDER_INVOICE_TYPE_ENUM;
|
|
39
37
|
warehouse_id: string;
|
|
40
|
-
|
|
38
|
+
doc_number: number;
|
|
39
|
+
invoice_type: import("../../constants").WAREHOUSE_SALE_ORDER_INVOICE_TYPE_ENUM;
|
|
40
|
+
doc_kind: import("../../constants").WAREHOUSE_SALE_ORDER_FIN_DOC_KIND_ENUM;
|
|
41
41
|
sale_order_id: import("mongoose").Types.ObjectId;
|
|
42
42
|
amount_paid?: number | null | undefined;
|
|
43
43
|
cancel_reason?: string | null | undefined;
|
|
44
|
+
is_gst_inclusive?: boolean | null | undefined;
|
|
45
|
+
gst?: number | null | undefined;
|
|
46
|
+
gst_amount?: number | null | undefined;
|
|
44
47
|
notes?: string | null | undefined;
|
|
45
48
|
created_by?: {
|
|
46
49
|
_id: string;
|
|
@@ -51,9 +54,6 @@ export declare const SaleOrderInvoicesSchema: Schema<any, import("mongoose").Mod
|
|
|
51
54
|
_id: string;
|
|
52
55
|
name: string;
|
|
53
56
|
} | null | undefined;
|
|
54
|
-
gst?: number | null | undefined;
|
|
55
|
-
gst_amount?: number | null | undefined;
|
|
56
|
-
is_gst_inclusive?: boolean | null | undefined;
|
|
57
57
|
applied_to_doc_id?: import("mongoose").Types.ObjectId | null | undefined;
|
|
58
58
|
down_payment_value?: number | null | undefined;
|
|
59
59
|
posted_by?: {
|
|
@@ -85,34 +85,37 @@ export declare const SaleOrderInvoicesSchema: Schema<any, import("mongoose").Mod
|
|
|
85
85
|
createdAt: NativeDate;
|
|
86
86
|
updatedAt: NativeDate;
|
|
87
87
|
items: import("mongoose").Types.DocumentArray<{
|
|
88
|
-
quantity: number;
|
|
89
88
|
item_id: import("mongoose").Types.ObjectId;
|
|
89
|
+
quantity: number;
|
|
90
90
|
unit_price: number;
|
|
91
91
|
item_name: string;
|
|
92
92
|
reason?: string | null | undefined;
|
|
93
93
|
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
94
|
-
quantity: number;
|
|
95
94
|
item_id: import("mongoose").Types.ObjectId;
|
|
95
|
+
quantity: number;
|
|
96
96
|
unit_price: number;
|
|
97
97
|
item_name: string;
|
|
98
98
|
reason?: string | null | undefined;
|
|
99
99
|
}> & {
|
|
100
|
-
quantity: number;
|
|
101
100
|
item_id: import("mongoose").Types.ObjectId;
|
|
101
|
+
quantity: number;
|
|
102
102
|
unit_price: number;
|
|
103
103
|
item_name: string;
|
|
104
104
|
reason?: string | null | undefined;
|
|
105
105
|
}>;
|
|
106
|
-
status: import("../../constants").
|
|
106
|
+
status: import("../../constants").WAREHOUSE_SALE_ORDER_INVOICE_PAYMENT_STATUS_ENUM | import("../../constants").WAREHOUSE_SALE_ORDER_CREDIT_NOTE_STATUS_ENUM;
|
|
107
107
|
amount: number;
|
|
108
108
|
payments: any[];
|
|
109
|
-
doc_number: number;
|
|
110
|
-
invoice_type: import("../../constants").SALE_ORDER_INVOICE_TYPE_ENUM;
|
|
111
109
|
warehouse_id: string;
|
|
112
|
-
|
|
110
|
+
doc_number: number;
|
|
111
|
+
invoice_type: import("../../constants").WAREHOUSE_SALE_ORDER_INVOICE_TYPE_ENUM;
|
|
112
|
+
doc_kind: import("../../constants").WAREHOUSE_SALE_ORDER_FIN_DOC_KIND_ENUM;
|
|
113
113
|
sale_order_id: import("mongoose").Types.ObjectId;
|
|
114
114
|
amount_paid?: number | null | undefined;
|
|
115
115
|
cancel_reason?: string | null | undefined;
|
|
116
|
+
is_gst_inclusive?: boolean | null | undefined;
|
|
117
|
+
gst?: number | null | undefined;
|
|
118
|
+
gst_amount?: number | null | undefined;
|
|
116
119
|
notes?: string | null | undefined;
|
|
117
120
|
created_by?: {
|
|
118
121
|
_id: string;
|
|
@@ -123,9 +126,6 @@ export declare const SaleOrderInvoicesSchema: Schema<any, import("mongoose").Mod
|
|
|
123
126
|
_id: string;
|
|
124
127
|
name: string;
|
|
125
128
|
} | null | undefined;
|
|
126
|
-
gst?: number | null | undefined;
|
|
127
|
-
gst_amount?: number | null | undefined;
|
|
128
|
-
is_gst_inclusive?: boolean | null | undefined;
|
|
129
129
|
applied_to_doc_id?: import("mongoose").Types.ObjectId | null | undefined;
|
|
130
130
|
down_payment_value?: number | null | undefined;
|
|
131
131
|
posted_by?: {
|
|
@@ -157,34 +157,37 @@ export declare const SaleOrderInvoicesSchema: Schema<any, import("mongoose").Mod
|
|
|
157
157
|
createdAt: NativeDate;
|
|
158
158
|
updatedAt: NativeDate;
|
|
159
159
|
items: import("mongoose").Types.DocumentArray<{
|
|
160
|
-
quantity: number;
|
|
161
160
|
item_id: import("mongoose").Types.ObjectId;
|
|
161
|
+
quantity: number;
|
|
162
162
|
unit_price: number;
|
|
163
163
|
item_name: string;
|
|
164
164
|
reason?: string | null | undefined;
|
|
165
165
|
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
166
|
-
quantity: number;
|
|
167
166
|
item_id: import("mongoose").Types.ObjectId;
|
|
167
|
+
quantity: number;
|
|
168
168
|
unit_price: number;
|
|
169
169
|
item_name: string;
|
|
170
170
|
reason?: string | null | undefined;
|
|
171
171
|
}> & {
|
|
172
|
-
quantity: number;
|
|
173
172
|
item_id: import("mongoose").Types.ObjectId;
|
|
173
|
+
quantity: number;
|
|
174
174
|
unit_price: number;
|
|
175
175
|
item_name: string;
|
|
176
176
|
reason?: string | null | undefined;
|
|
177
177
|
}>;
|
|
178
|
-
status: import("../../constants").
|
|
178
|
+
status: import("../../constants").WAREHOUSE_SALE_ORDER_INVOICE_PAYMENT_STATUS_ENUM | import("../../constants").WAREHOUSE_SALE_ORDER_CREDIT_NOTE_STATUS_ENUM;
|
|
179
179
|
amount: number;
|
|
180
180
|
payments: any[];
|
|
181
|
-
doc_number: number;
|
|
182
|
-
invoice_type: import("../../constants").SALE_ORDER_INVOICE_TYPE_ENUM;
|
|
183
181
|
warehouse_id: string;
|
|
184
|
-
|
|
182
|
+
doc_number: number;
|
|
183
|
+
invoice_type: import("../../constants").WAREHOUSE_SALE_ORDER_INVOICE_TYPE_ENUM;
|
|
184
|
+
doc_kind: import("../../constants").WAREHOUSE_SALE_ORDER_FIN_DOC_KIND_ENUM;
|
|
185
185
|
sale_order_id: import("mongoose").Types.ObjectId;
|
|
186
186
|
amount_paid?: number | null | undefined;
|
|
187
187
|
cancel_reason?: string | null | undefined;
|
|
188
|
+
is_gst_inclusive?: boolean | null | undefined;
|
|
189
|
+
gst?: number | null | undefined;
|
|
190
|
+
gst_amount?: number | null | undefined;
|
|
188
191
|
notes?: string | null | undefined;
|
|
189
192
|
created_by?: {
|
|
190
193
|
_id: string;
|
|
@@ -195,9 +198,6 @@ export declare const SaleOrderInvoicesSchema: Schema<any, import("mongoose").Mod
|
|
|
195
198
|
_id: string;
|
|
196
199
|
name: string;
|
|
197
200
|
} | null | undefined;
|
|
198
|
-
gst?: number | null | undefined;
|
|
199
|
-
gst_amount?: number | null | undefined;
|
|
200
|
-
is_gst_inclusive?: boolean | null | undefined;
|
|
201
201
|
applied_to_doc_id?: import("mongoose").Types.ObjectId | null | undefined;
|
|
202
202
|
down_payment_value?: number | null | undefined;
|
|
203
203
|
posted_by?: {
|
|
@@ -7,7 +7,10 @@ const warehouse_items_1 = require("./warehouse_items");
|
|
|
7
7
|
const warehouse_sale_orders_1 = require("./warehouse_sale_orders");
|
|
8
8
|
const warehouses_1 = require("./warehouses");
|
|
9
9
|
exports.WAREHOUSE_SALE_INVOICE_COLLECTION_NAME = 'warehouse_sale_invoices';
|
|
10
|
-
const
|
|
10
|
+
const ALL_WAREHOUSE_SALE_ORDER_FIN_DOC_STATUS_NAMES = Array.from(new Set([
|
|
11
|
+
...constants_1.ALL_WAREHOUSE_SALE_ORDER_INVOICE_PAYMENT_STATUS_NAMES,
|
|
12
|
+
...constants_1.ALL_WAREHOUSE_SALE_ORDER_CREDIT_NOTE_STATUS_NAMES,
|
|
13
|
+
]));
|
|
11
14
|
const SaleOrderInvoiceActorSchema = new mongoose_1.Schema({
|
|
12
15
|
_id: {
|
|
13
16
|
type: String,
|
|
@@ -57,7 +60,7 @@ exports.SaleOrderInvoicesSchema = new mongoose_1.Schema({
|
|
|
57
60
|
},
|
|
58
61
|
doc_kind: {
|
|
59
62
|
type: String,
|
|
60
|
-
enum: constants_1.
|
|
63
|
+
enum: constants_1.ALL_WAREHOUSE_SALE_ORDER_FIN_DOC_KIND_NAMES,
|
|
61
64
|
required: true,
|
|
62
65
|
},
|
|
63
66
|
warehouse_id: {
|
|
@@ -68,7 +71,7 @@ exports.SaleOrderInvoicesSchema = new mongoose_1.Schema({
|
|
|
68
71
|
sale_order_id: {
|
|
69
72
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
70
73
|
required: true,
|
|
71
|
-
ref: warehouse_sale_orders_1.
|
|
74
|
+
ref: warehouse_sale_orders_1.WAREHOUSE_SALE_ORDER_COLLECTION_NAME,
|
|
72
75
|
},
|
|
73
76
|
doc_number: {
|
|
74
77
|
type: Number,
|
|
@@ -95,12 +98,12 @@ exports.SaleOrderInvoicesSchema = new mongoose_1.Schema({
|
|
|
95
98
|
},
|
|
96
99
|
status: {
|
|
97
100
|
type: String,
|
|
98
|
-
enum:
|
|
101
|
+
enum: ALL_WAREHOUSE_SALE_ORDER_FIN_DOC_STATUS_NAMES,
|
|
99
102
|
required: true,
|
|
100
103
|
},
|
|
101
104
|
invoice_type: {
|
|
102
105
|
type: String,
|
|
103
|
-
enum: constants_1.
|
|
106
|
+
enum: constants_1.ALL_WAREHOUSE_SALE_ORDER_INVOICE_TYPE_NAMES,
|
|
104
107
|
required: true,
|
|
105
108
|
},
|
|
106
109
|
amount_paid: {
|