@managesome/eposmatic-toolkit 0.4.82 → 0.4.83
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/esm/helpers/order/generate-warehouse-purchase-order.js +90 -0
- package/esm/helpers/store/common-warehouse-purchase-order-actions.js +18 -0
- package/esm/helpers/store/warehouse-purchase-orders-cart-actions.js +30 -0
- package/esm/schemas/models/warehouse_purchase_orders.js +72 -0
- package/esm/schemas/models/warehouses.js +8 -0
- package/lib/helpers/order/generate-warehouse-purchase-order.js +90 -0
- package/lib/helpers/store/common-warehouse-purchase-order-actions.js +18 -0
- package/lib/helpers/store/warehouse-purchase-orders-cart-actions.d.ts +8 -0
- package/lib/helpers/store/warehouse-purchase-orders-cart-actions.js +30 -0
- package/lib/schemas/models/warehouse_purchase_orders.d.ts +96 -0
- package/lib/schemas/models/warehouse_purchase_orders.js +72 -0
- package/lib/schemas/models/warehouses.d.ts +6 -0
- package/lib/schemas/models/warehouses.js +8 -0
- package/lib/schemas/types/warehouse_purchase_orders.d.ts +8 -0
- package/lib/schemas/types/warehouses.d.ts +2 -0
- package/package.json +1 -1
|
@@ -20,6 +20,10 @@ function getCommonOptionalBoolFieldsPurchaseOrderIteration(order, partial) {
|
|
|
20
20
|
is_gst_inclusive: order.is_gst_inclusive || defaultValue,
|
|
21
21
|
exclude_discount_from_gst: order.exclude_discount_from_gst || defaultValue,
|
|
22
22
|
is_gst_percentage: order.is_gst_percentage ?? (partial ? undefined : true),
|
|
23
|
+
is_labor_charges_percentage: order.is_labor_charges_percentage ?? defaultValue,
|
|
24
|
+
is_labor_charges_taxable: order.is_labor_charges_taxable || defaultValue,
|
|
25
|
+
is_freight_charges_percentage: order.is_freight_charges_percentage ?? defaultValue,
|
|
26
|
+
is_freight_charges_taxable: order.is_freight_charges_taxable || defaultValue,
|
|
23
27
|
};
|
|
24
28
|
}
|
|
25
29
|
function getCommonOptionalNumFieldsPurchaseOrderIteration(order, partial) {
|
|
@@ -28,6 +32,10 @@ function getCommonOptionalNumFieldsPurchaseOrderIteration(order, partial) {
|
|
|
28
32
|
gst: order.gst || defaultValue,
|
|
29
33
|
gst_amount: order.gst_amount || defaultValue,
|
|
30
34
|
total_discount_applied: order.total_discount_applied || defaultValue,
|
|
35
|
+
labor_charges: order.labor_charges || defaultValue,
|
|
36
|
+
labor_charges_amount: order.labor_charges_amount || defaultValue,
|
|
37
|
+
freight_charges: order.freight_charges || defaultValue,
|
|
38
|
+
freight_charges_amount: order.freight_charges_amount || defaultValue,
|
|
31
39
|
};
|
|
32
40
|
}
|
|
33
41
|
export function generateWarehousePurchaseOrderIteration(order, partial = true, skipItemMetadata) {
|
|
@@ -111,6 +119,40 @@ export function generateWarehousePurchaseOrderOnCreate(order, withIterations) {
|
|
|
111
119
|
delete newOrder.is_gst_inclusive;
|
|
112
120
|
}
|
|
113
121
|
}
|
|
122
|
+
if (!newOrder.labor_charges) {
|
|
123
|
+
delete newOrder.labor_charges;
|
|
124
|
+
delete newOrder.labor_charges_amount;
|
|
125
|
+
delete newOrder.is_labor_charges_percentage;
|
|
126
|
+
delete newOrder.is_labor_charges_taxable;
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
if (newOrder.labor_charges_amount === 0) {
|
|
130
|
+
delete newOrder.labor_charges_amount;
|
|
131
|
+
}
|
|
132
|
+
if (newOrder.is_labor_charges_percentage === false) {
|
|
133
|
+
delete newOrder.is_labor_charges_percentage;
|
|
134
|
+
}
|
|
135
|
+
if (newOrder.is_labor_charges_taxable === false) {
|
|
136
|
+
delete newOrder.is_labor_charges_taxable;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
if (!newOrder.freight_charges) {
|
|
140
|
+
delete newOrder.freight_charges;
|
|
141
|
+
delete newOrder.freight_charges_amount;
|
|
142
|
+
delete newOrder.is_freight_charges_percentage;
|
|
143
|
+
delete newOrder.is_freight_charges_taxable;
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
if (newOrder.freight_charges_amount === 0) {
|
|
147
|
+
delete newOrder.freight_charges_amount;
|
|
148
|
+
}
|
|
149
|
+
if (newOrder.is_freight_charges_percentage === false) {
|
|
150
|
+
delete newOrder.is_freight_charges_percentage;
|
|
151
|
+
}
|
|
152
|
+
if (newOrder.is_freight_charges_taxable === false) {
|
|
153
|
+
delete newOrder.is_freight_charges_taxable;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
114
156
|
if (newOrder.payments?.some((payment) => payment.payment_type === PAYMENT_TYPE_ENUM.PAY_LATER && payment.payment_status === PAYMENT_STATUS_ENUM.PENDING)) {
|
|
115
157
|
newOrder.deferred_settlement = true;
|
|
116
158
|
}
|
|
@@ -177,6 +219,54 @@ export function generateWarehousePurchaseOrderOnUpdate(partialUpdatedOrder) {
|
|
|
177
219
|
unset['is_gst_inclusive'] = '';
|
|
178
220
|
}
|
|
179
221
|
}
|
|
222
|
+
if (set.labor_charges === 0) {
|
|
223
|
+
delete set.labor_charges;
|
|
224
|
+
delete set.labor_charges_amount;
|
|
225
|
+
delete set.is_labor_charges_percentage;
|
|
226
|
+
delete set.is_labor_charges_taxable;
|
|
227
|
+
unset['labor_charges'] = '';
|
|
228
|
+
unset['labor_charges_amount'] = '';
|
|
229
|
+
unset['is_labor_charges_percentage'] = '';
|
|
230
|
+
unset['is_labor_charges_taxable'] = '';
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
if (set.labor_charges_amount === 0) {
|
|
234
|
+
delete set.labor_charges_amount;
|
|
235
|
+
unset['labor_charges_amount'] = '';
|
|
236
|
+
}
|
|
237
|
+
if (set.is_labor_charges_percentage === false) {
|
|
238
|
+
delete set.is_labor_charges_percentage;
|
|
239
|
+
unset['is_labor_charges_percentage'] = '';
|
|
240
|
+
}
|
|
241
|
+
if (set.is_labor_charges_taxable === false) {
|
|
242
|
+
delete set.is_labor_charges_taxable;
|
|
243
|
+
unset['is_labor_charges_taxable'] = '';
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
if (set.freight_charges === 0) {
|
|
247
|
+
delete set.freight_charges;
|
|
248
|
+
delete set.freight_charges_amount;
|
|
249
|
+
delete set.is_freight_charges_percentage;
|
|
250
|
+
delete set.is_freight_charges_taxable;
|
|
251
|
+
unset['freight_charges'] = '';
|
|
252
|
+
unset['freight_charges_amount'] = '';
|
|
253
|
+
unset['is_freight_charges_percentage'] = '';
|
|
254
|
+
unset['is_freight_charges_taxable'] = '';
|
|
255
|
+
}
|
|
256
|
+
else {
|
|
257
|
+
if (set.freight_charges_amount === 0) {
|
|
258
|
+
delete set.freight_charges_amount;
|
|
259
|
+
unset['freight_charges_amount'] = '';
|
|
260
|
+
}
|
|
261
|
+
if (set.is_freight_charges_percentage === false) {
|
|
262
|
+
delete set.is_freight_charges_percentage;
|
|
263
|
+
unset['is_freight_charges_percentage'] = '';
|
|
264
|
+
}
|
|
265
|
+
if (set.is_freight_charges_taxable === false) {
|
|
266
|
+
delete set.is_freight_charges_taxable;
|
|
267
|
+
unset['is_freight_charges_taxable'] = '';
|
|
268
|
+
}
|
|
269
|
+
}
|
|
180
270
|
if (set.payments != null) {
|
|
181
271
|
if (set.payments.some((payment) => payment.payment_type === PAYMENT_TYPE_ENUM.PAY_LATER &&
|
|
182
272
|
payment.payment_status === PAYMENT_STATUS_ENUM.PENDING)) {
|
|
@@ -108,6 +108,16 @@ export function getWarehousePurchaseOrderWithPrice(order, writeable) {
|
|
|
108
108
|
...(order.total_discount_applied != null
|
|
109
109
|
? { total_discount_applied: convertToPrice(order.total_discount_applied) }
|
|
110
110
|
: {}),
|
|
111
|
+
...(order.labor_charges != null && order.is_labor_charges_percentage !== true
|
|
112
|
+
? { labor_charges: convertToPrice(order.labor_charges) }
|
|
113
|
+
: {}),
|
|
114
|
+
...(order.labor_charges_amount != null ? { labor_charges_amount: convertToPrice(order.labor_charges_amount) } : {}),
|
|
115
|
+
...(order.freight_charges != null && order.is_freight_charges_percentage !== true
|
|
116
|
+
? { freight_charges: convertToPrice(order.freight_charges) }
|
|
117
|
+
: {}),
|
|
118
|
+
...(order.freight_charges_amount != null
|
|
119
|
+
? { freight_charges_amount: convertToPrice(order.freight_charges_amount) }
|
|
120
|
+
: {}),
|
|
111
121
|
};
|
|
112
122
|
return payload;
|
|
113
123
|
}
|
|
@@ -147,6 +157,10 @@ function getCommonOptionalBoolFieldsPurchaseOrder(order, partial) {
|
|
|
147
157
|
is_gst_inclusive: order['is_gst_inclusive'] || defaultValue,
|
|
148
158
|
is_reopened: order['is_reopened'] || defaultValue,
|
|
149
159
|
is_gst_percentage: order['is_gst_percentage'] ?? (partial ? undefined : true),
|
|
160
|
+
is_labor_charges_percentage: order['is_labor_charges_percentage'] ?? defaultValue,
|
|
161
|
+
is_labor_charges_taxable: order['is_labor_charges_taxable'] || defaultValue,
|
|
162
|
+
is_freight_charges_percentage: order['is_freight_charges_percentage'] ?? defaultValue,
|
|
163
|
+
is_freight_charges_taxable: order['is_freight_charges_taxable'] || defaultValue,
|
|
150
164
|
};
|
|
151
165
|
}
|
|
152
166
|
function getCommonOptionalNumFieldsPurchaseOrder(order, partial) {
|
|
@@ -154,6 +168,10 @@ function getCommonOptionalNumFieldsPurchaseOrder(order, partial) {
|
|
|
154
168
|
return {
|
|
155
169
|
gst: order['gst'] || defaultValue,
|
|
156
170
|
gst_amount: order['gst_amount'] || defaultValue,
|
|
171
|
+
labor_charges: order['labor_charges'] || defaultValue,
|
|
172
|
+
labor_charges_amount: order['labor_charges_amount'] || defaultValue,
|
|
173
|
+
freight_charges: order['freight_charges'] || defaultValue,
|
|
174
|
+
freight_charges_amount: order['freight_charges_amount'] || defaultValue,
|
|
157
175
|
};
|
|
158
176
|
}
|
|
159
177
|
export function getWarehousePurchaseOrderWithAllFields(order, skipItemMetadata) {
|
|
@@ -84,6 +84,27 @@ export function calculateCartWarehousePurchaseOrderInfoAndSyncData(data, calcula
|
|
|
84
84
|
if (!applyGSTOnOriginalPrice) {
|
|
85
85
|
grand_total -= total_discount_applied;
|
|
86
86
|
}
|
|
87
|
+
const postDiscountSubtotal = parseNum(Math.max(0, subtotal - total_discount_applied));
|
|
88
|
+
const getOrderCharge = (value, isPercentage) => {
|
|
89
|
+
const entered = parseNum(Math.max(0, value ?? 0));
|
|
90
|
+
return {
|
|
91
|
+
entered,
|
|
92
|
+
amount: isPercentage ? parseNum(getPercentageAmount(postDiscountSubtotal, entered)) : entered,
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
const labor = getOrderCharge(data.labor_charges, data.is_labor_charges_percentage);
|
|
96
|
+
const freight = getOrderCharge(data.freight_charges, data.is_freight_charges_percentage);
|
|
97
|
+
const labor_charges = labor.entered;
|
|
98
|
+
const labor_charges_amount = labor.amount;
|
|
99
|
+
const freight_charges = freight.entered;
|
|
100
|
+
const freight_charges_amount = freight.amount;
|
|
101
|
+
const isLaborTaxable = data.is_labor_charges_taxable === true;
|
|
102
|
+
const isFreightTaxable = data.is_freight_charges_taxable === true;
|
|
103
|
+
// Taxable charges join the GST base here; untaxed ones are added further down.
|
|
104
|
+
const taxableCharges = (isLaborTaxable ? labor_charges_amount : 0) + (isFreightTaxable ? freight_charges_amount : 0);
|
|
105
|
+
if (taxableCharges > 0) {
|
|
106
|
+
grand_total += taxableCharges;
|
|
107
|
+
}
|
|
87
108
|
// GST can be entered as a percentage (default) or as a fixed amount.
|
|
88
109
|
// In both cases `gst_amount` is the computed tax total.
|
|
89
110
|
let gst_amount = 0;
|
|
@@ -115,6 +136,11 @@ export function calculateCartWarehousePurchaseOrderInfoAndSyncData(data, calcula
|
|
|
115
136
|
if (applyGSTOnOriginalPrice) {
|
|
116
137
|
grand_total -= total_discount_applied;
|
|
117
138
|
}
|
|
139
|
+
// Untaxed charges sit outside the GST base, so they are added after the tax.
|
|
140
|
+
const untaxedCharges = (isLaborTaxable ? 0 : labor_charges_amount) + (isFreightTaxable ? 0 : freight_charges_amount);
|
|
141
|
+
if (untaxedCharges > 0) {
|
|
142
|
+
grand_total += untaxedCharges;
|
|
143
|
+
}
|
|
118
144
|
// Add Card Charges to grand_total
|
|
119
145
|
const { cardCharges, amountCollected } = getCardChargesAndAmountCollected(data.payments);
|
|
120
146
|
grand_total += cardCharges;
|
|
@@ -172,6 +198,10 @@ export function calculateCartWarehousePurchaseOrderInfoAndSyncData(data, calcula
|
|
|
172
198
|
order_discount_details,
|
|
173
199
|
total_discount_applied,
|
|
174
200
|
gst_amount,
|
|
201
|
+
labor_charges,
|
|
202
|
+
labor_charges_amount,
|
|
203
|
+
freight_charges,
|
|
204
|
+
freight_charges_amount,
|
|
175
205
|
price: parseNum(subtotal),
|
|
176
206
|
grand_total,
|
|
177
207
|
};
|
|
@@ -203,6 +203,42 @@ const IterationsOrderSchema = new Schema({
|
|
|
203
203
|
type: Boolean,
|
|
204
204
|
required: false,
|
|
205
205
|
},
|
|
206
|
+
labor_charges: {
|
|
207
|
+
type: Number,
|
|
208
|
+
min: 0,
|
|
209
|
+
required: false,
|
|
210
|
+
},
|
|
211
|
+
labor_charges_amount: {
|
|
212
|
+
type: Number,
|
|
213
|
+
min: 0,
|
|
214
|
+
required: false,
|
|
215
|
+
},
|
|
216
|
+
is_labor_charges_percentage: {
|
|
217
|
+
type: Boolean,
|
|
218
|
+
required: false,
|
|
219
|
+
},
|
|
220
|
+
is_labor_charges_taxable: {
|
|
221
|
+
type: Boolean,
|
|
222
|
+
required: false,
|
|
223
|
+
},
|
|
224
|
+
freight_charges: {
|
|
225
|
+
type: Number,
|
|
226
|
+
min: 0,
|
|
227
|
+
required: false,
|
|
228
|
+
},
|
|
229
|
+
freight_charges_amount: {
|
|
230
|
+
type: Number,
|
|
231
|
+
min: 0,
|
|
232
|
+
required: false,
|
|
233
|
+
},
|
|
234
|
+
is_freight_charges_percentage: {
|
|
235
|
+
type: Boolean,
|
|
236
|
+
required: false,
|
|
237
|
+
},
|
|
238
|
+
is_freight_charges_taxable: {
|
|
239
|
+
type: Boolean,
|
|
240
|
+
required: false,
|
|
241
|
+
},
|
|
206
242
|
tax_number: {
|
|
207
243
|
type: String,
|
|
208
244
|
default: '',
|
|
@@ -336,6 +372,42 @@ export const PurchaseOrderSchema = new Schema({
|
|
|
336
372
|
type: Boolean,
|
|
337
373
|
required: false,
|
|
338
374
|
},
|
|
375
|
+
labor_charges: {
|
|
376
|
+
type: Number,
|
|
377
|
+
min: 0,
|
|
378
|
+
required: false,
|
|
379
|
+
},
|
|
380
|
+
labor_charges_amount: {
|
|
381
|
+
type: Number,
|
|
382
|
+
min: 0,
|
|
383
|
+
required: false,
|
|
384
|
+
},
|
|
385
|
+
is_labor_charges_percentage: {
|
|
386
|
+
type: Boolean,
|
|
387
|
+
required: false,
|
|
388
|
+
},
|
|
389
|
+
is_labor_charges_taxable: {
|
|
390
|
+
type: Boolean,
|
|
391
|
+
required: false,
|
|
392
|
+
},
|
|
393
|
+
freight_charges: {
|
|
394
|
+
type: Number,
|
|
395
|
+
min: 0,
|
|
396
|
+
required: false,
|
|
397
|
+
},
|
|
398
|
+
freight_charges_amount: {
|
|
399
|
+
type: Number,
|
|
400
|
+
min: 0,
|
|
401
|
+
required: false,
|
|
402
|
+
},
|
|
403
|
+
is_freight_charges_percentage: {
|
|
404
|
+
type: Boolean,
|
|
405
|
+
required: false,
|
|
406
|
+
},
|
|
407
|
+
is_freight_charges_taxable: {
|
|
408
|
+
type: Boolean,
|
|
409
|
+
required: false,
|
|
410
|
+
},
|
|
339
411
|
//
|
|
340
412
|
is_deleted: {
|
|
341
413
|
type: Boolean,
|
|
@@ -92,6 +92,14 @@ export const WarehouseSchema = new Schema({
|
|
|
92
92
|
type: Boolean,
|
|
93
93
|
required: false,
|
|
94
94
|
},
|
|
95
|
+
is_labor_charges_taxable: {
|
|
96
|
+
type: Boolean,
|
|
97
|
+
default: false,
|
|
98
|
+
},
|
|
99
|
+
is_freight_charges_taxable: {
|
|
100
|
+
type: Boolean,
|
|
101
|
+
default: false,
|
|
102
|
+
},
|
|
95
103
|
po_card_gst: {
|
|
96
104
|
type: Number,
|
|
97
105
|
default: 0,
|
|
@@ -29,6 +29,10 @@ function getCommonOptionalBoolFieldsPurchaseOrderIteration(order, partial) {
|
|
|
29
29
|
is_gst_inclusive: order.is_gst_inclusive || defaultValue,
|
|
30
30
|
exclude_discount_from_gst: order.exclude_discount_from_gst || defaultValue,
|
|
31
31
|
is_gst_percentage: order.is_gst_percentage ?? (partial ? undefined : true),
|
|
32
|
+
is_labor_charges_percentage: order.is_labor_charges_percentage ?? defaultValue,
|
|
33
|
+
is_labor_charges_taxable: order.is_labor_charges_taxable || defaultValue,
|
|
34
|
+
is_freight_charges_percentage: order.is_freight_charges_percentage ?? defaultValue,
|
|
35
|
+
is_freight_charges_taxable: order.is_freight_charges_taxable || defaultValue,
|
|
32
36
|
};
|
|
33
37
|
}
|
|
34
38
|
function getCommonOptionalNumFieldsPurchaseOrderIteration(order, partial) {
|
|
@@ -37,6 +41,10 @@ function getCommonOptionalNumFieldsPurchaseOrderIteration(order, partial) {
|
|
|
37
41
|
gst: order.gst || defaultValue,
|
|
38
42
|
gst_amount: order.gst_amount || defaultValue,
|
|
39
43
|
total_discount_applied: order.total_discount_applied || defaultValue,
|
|
44
|
+
labor_charges: order.labor_charges || defaultValue,
|
|
45
|
+
labor_charges_amount: order.labor_charges_amount || defaultValue,
|
|
46
|
+
freight_charges: order.freight_charges || defaultValue,
|
|
47
|
+
freight_charges_amount: order.freight_charges_amount || defaultValue,
|
|
40
48
|
};
|
|
41
49
|
}
|
|
42
50
|
function generateWarehousePurchaseOrderIteration(order, partial = true, skipItemMetadata) {
|
|
@@ -120,6 +128,40 @@ function generateWarehousePurchaseOrderOnCreate(order, withIterations) {
|
|
|
120
128
|
delete newOrder.is_gst_inclusive;
|
|
121
129
|
}
|
|
122
130
|
}
|
|
131
|
+
if (!newOrder.labor_charges) {
|
|
132
|
+
delete newOrder.labor_charges;
|
|
133
|
+
delete newOrder.labor_charges_amount;
|
|
134
|
+
delete newOrder.is_labor_charges_percentage;
|
|
135
|
+
delete newOrder.is_labor_charges_taxable;
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
if (newOrder.labor_charges_amount === 0) {
|
|
139
|
+
delete newOrder.labor_charges_amount;
|
|
140
|
+
}
|
|
141
|
+
if (newOrder.is_labor_charges_percentage === false) {
|
|
142
|
+
delete newOrder.is_labor_charges_percentage;
|
|
143
|
+
}
|
|
144
|
+
if (newOrder.is_labor_charges_taxable === false) {
|
|
145
|
+
delete newOrder.is_labor_charges_taxable;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
if (!newOrder.freight_charges) {
|
|
149
|
+
delete newOrder.freight_charges;
|
|
150
|
+
delete newOrder.freight_charges_amount;
|
|
151
|
+
delete newOrder.is_freight_charges_percentage;
|
|
152
|
+
delete newOrder.is_freight_charges_taxable;
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
if (newOrder.freight_charges_amount === 0) {
|
|
156
|
+
delete newOrder.freight_charges_amount;
|
|
157
|
+
}
|
|
158
|
+
if (newOrder.is_freight_charges_percentage === false) {
|
|
159
|
+
delete newOrder.is_freight_charges_percentage;
|
|
160
|
+
}
|
|
161
|
+
if (newOrder.is_freight_charges_taxable === false) {
|
|
162
|
+
delete newOrder.is_freight_charges_taxable;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
123
165
|
if (newOrder.payments?.some((payment) => payment.payment_type === constants_1.PAYMENT_TYPE_ENUM.PAY_LATER && payment.payment_status === constants_1.PAYMENT_STATUS_ENUM.PENDING)) {
|
|
124
166
|
newOrder.deferred_settlement = true;
|
|
125
167
|
}
|
|
@@ -186,6 +228,54 @@ function generateWarehousePurchaseOrderOnUpdate(partialUpdatedOrder) {
|
|
|
186
228
|
unset['is_gst_inclusive'] = '';
|
|
187
229
|
}
|
|
188
230
|
}
|
|
231
|
+
if (set.labor_charges === 0) {
|
|
232
|
+
delete set.labor_charges;
|
|
233
|
+
delete set.labor_charges_amount;
|
|
234
|
+
delete set.is_labor_charges_percentage;
|
|
235
|
+
delete set.is_labor_charges_taxable;
|
|
236
|
+
unset['labor_charges'] = '';
|
|
237
|
+
unset['labor_charges_amount'] = '';
|
|
238
|
+
unset['is_labor_charges_percentage'] = '';
|
|
239
|
+
unset['is_labor_charges_taxable'] = '';
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
if (set.labor_charges_amount === 0) {
|
|
243
|
+
delete set.labor_charges_amount;
|
|
244
|
+
unset['labor_charges_amount'] = '';
|
|
245
|
+
}
|
|
246
|
+
if (set.is_labor_charges_percentage === false) {
|
|
247
|
+
delete set.is_labor_charges_percentage;
|
|
248
|
+
unset['is_labor_charges_percentage'] = '';
|
|
249
|
+
}
|
|
250
|
+
if (set.is_labor_charges_taxable === false) {
|
|
251
|
+
delete set.is_labor_charges_taxable;
|
|
252
|
+
unset['is_labor_charges_taxable'] = '';
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
if (set.freight_charges === 0) {
|
|
256
|
+
delete set.freight_charges;
|
|
257
|
+
delete set.freight_charges_amount;
|
|
258
|
+
delete set.is_freight_charges_percentage;
|
|
259
|
+
delete set.is_freight_charges_taxable;
|
|
260
|
+
unset['freight_charges'] = '';
|
|
261
|
+
unset['freight_charges_amount'] = '';
|
|
262
|
+
unset['is_freight_charges_percentage'] = '';
|
|
263
|
+
unset['is_freight_charges_taxable'] = '';
|
|
264
|
+
}
|
|
265
|
+
else {
|
|
266
|
+
if (set.freight_charges_amount === 0) {
|
|
267
|
+
delete set.freight_charges_amount;
|
|
268
|
+
unset['freight_charges_amount'] = '';
|
|
269
|
+
}
|
|
270
|
+
if (set.is_freight_charges_percentage === false) {
|
|
271
|
+
delete set.is_freight_charges_percentage;
|
|
272
|
+
unset['is_freight_charges_percentage'] = '';
|
|
273
|
+
}
|
|
274
|
+
if (set.is_freight_charges_taxable === false) {
|
|
275
|
+
delete set.is_freight_charges_taxable;
|
|
276
|
+
unset['is_freight_charges_taxable'] = '';
|
|
277
|
+
}
|
|
278
|
+
}
|
|
189
279
|
if (set.payments != null) {
|
|
190
280
|
if (set.payments.some((payment) => payment.payment_type === constants_1.PAYMENT_TYPE_ENUM.PAY_LATER &&
|
|
191
281
|
payment.payment_status === constants_1.PAYMENT_STATUS_ENUM.PENDING)) {
|
|
@@ -124,6 +124,16 @@ function getWarehousePurchaseOrderWithPrice(order, writeable) {
|
|
|
124
124
|
...(order.total_discount_applied != null
|
|
125
125
|
? { total_discount_applied: convertToPrice(order.total_discount_applied) }
|
|
126
126
|
: {}),
|
|
127
|
+
...(order.labor_charges != null && order.is_labor_charges_percentage !== true
|
|
128
|
+
? { labor_charges: convertToPrice(order.labor_charges) }
|
|
129
|
+
: {}),
|
|
130
|
+
...(order.labor_charges_amount != null ? { labor_charges_amount: convertToPrice(order.labor_charges_amount) } : {}),
|
|
131
|
+
...(order.freight_charges != null && order.is_freight_charges_percentage !== true
|
|
132
|
+
? { freight_charges: convertToPrice(order.freight_charges) }
|
|
133
|
+
: {}),
|
|
134
|
+
...(order.freight_charges_amount != null
|
|
135
|
+
? { freight_charges_amount: convertToPrice(order.freight_charges_amount) }
|
|
136
|
+
: {}),
|
|
127
137
|
};
|
|
128
138
|
return payload;
|
|
129
139
|
}
|
|
@@ -163,6 +173,10 @@ function getCommonOptionalBoolFieldsPurchaseOrder(order, partial) {
|
|
|
163
173
|
is_gst_inclusive: order['is_gst_inclusive'] || defaultValue,
|
|
164
174
|
is_reopened: order['is_reopened'] || defaultValue,
|
|
165
175
|
is_gst_percentage: order['is_gst_percentage'] ?? (partial ? undefined : true),
|
|
176
|
+
is_labor_charges_percentage: order['is_labor_charges_percentage'] ?? defaultValue,
|
|
177
|
+
is_labor_charges_taxable: order['is_labor_charges_taxable'] || defaultValue,
|
|
178
|
+
is_freight_charges_percentage: order['is_freight_charges_percentage'] ?? defaultValue,
|
|
179
|
+
is_freight_charges_taxable: order['is_freight_charges_taxable'] || defaultValue,
|
|
166
180
|
};
|
|
167
181
|
}
|
|
168
182
|
function getCommonOptionalNumFieldsPurchaseOrder(order, partial) {
|
|
@@ -170,6 +184,10 @@ function getCommonOptionalNumFieldsPurchaseOrder(order, partial) {
|
|
|
170
184
|
return {
|
|
171
185
|
gst: order['gst'] || defaultValue,
|
|
172
186
|
gst_amount: order['gst_amount'] || defaultValue,
|
|
187
|
+
labor_charges: order['labor_charges'] || defaultValue,
|
|
188
|
+
labor_charges_amount: order['labor_charges_amount'] || defaultValue,
|
|
189
|
+
freight_charges: order['freight_charges'] || defaultValue,
|
|
190
|
+
freight_charges_amount: order['freight_charges_amount'] || defaultValue,
|
|
173
191
|
};
|
|
174
192
|
}
|
|
175
193
|
function getWarehousePurchaseOrderWithAllFields(order, skipItemMetadata) {
|
|
@@ -32,6 +32,14 @@ export declare function getUpdatedWarehousePurchaseOrderCartInfoOnInit(data: Par
|
|
|
32
32
|
is_gst_percentage?: boolean;
|
|
33
33
|
gst?: number | null;
|
|
34
34
|
gst_amount?: number | null;
|
|
35
|
+
labor_charges?: number;
|
|
36
|
+
labor_charges_amount?: number;
|
|
37
|
+
is_labor_charges_percentage?: boolean;
|
|
38
|
+
is_labor_charges_taxable?: boolean;
|
|
39
|
+
freight_charges?: number;
|
|
40
|
+
freight_charges_amount?: number;
|
|
41
|
+
is_freight_charges_percentage?: boolean;
|
|
42
|
+
is_freight_charges_taxable?: boolean;
|
|
35
43
|
special_instructions?: string | undefined;
|
|
36
44
|
price?: number | undefined;
|
|
37
45
|
amount_earned?: number | undefined;
|
|
@@ -100,6 +100,27 @@ function calculateCartWarehousePurchaseOrderInfoAndSyncData(data, calculateItemM
|
|
|
100
100
|
if (!applyGSTOnOriginalPrice) {
|
|
101
101
|
grand_total -= total_discount_applied;
|
|
102
102
|
}
|
|
103
|
+
const postDiscountSubtotal = (0, utils_1.parseNum)(Math.max(0, subtotal - total_discount_applied));
|
|
104
|
+
const getOrderCharge = (value, isPercentage) => {
|
|
105
|
+
const entered = (0, utils_1.parseNum)(Math.max(0, value ?? 0));
|
|
106
|
+
return {
|
|
107
|
+
entered,
|
|
108
|
+
amount: isPercentage ? (0, utils_1.parseNum)((0, utils_1.getPercentageAmount)(postDiscountSubtotal, entered)) : entered,
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
const labor = getOrderCharge(data.labor_charges, data.is_labor_charges_percentage);
|
|
112
|
+
const freight = getOrderCharge(data.freight_charges, data.is_freight_charges_percentage);
|
|
113
|
+
const labor_charges = labor.entered;
|
|
114
|
+
const labor_charges_amount = labor.amount;
|
|
115
|
+
const freight_charges = freight.entered;
|
|
116
|
+
const freight_charges_amount = freight.amount;
|
|
117
|
+
const isLaborTaxable = data.is_labor_charges_taxable === true;
|
|
118
|
+
const isFreightTaxable = data.is_freight_charges_taxable === true;
|
|
119
|
+
// Taxable charges join the GST base here; untaxed ones are added further down.
|
|
120
|
+
const taxableCharges = (isLaborTaxable ? labor_charges_amount : 0) + (isFreightTaxable ? freight_charges_amount : 0);
|
|
121
|
+
if (taxableCharges > 0) {
|
|
122
|
+
grand_total += taxableCharges;
|
|
123
|
+
}
|
|
103
124
|
// GST can be entered as a percentage (default) or as a fixed amount.
|
|
104
125
|
// In both cases `gst_amount` is the computed tax total.
|
|
105
126
|
let gst_amount = 0;
|
|
@@ -131,6 +152,11 @@ function calculateCartWarehousePurchaseOrderInfoAndSyncData(data, calculateItemM
|
|
|
131
152
|
if (applyGSTOnOriginalPrice) {
|
|
132
153
|
grand_total -= total_discount_applied;
|
|
133
154
|
}
|
|
155
|
+
// Untaxed charges sit outside the GST base, so they are added after the tax.
|
|
156
|
+
const untaxedCharges = (isLaborTaxable ? 0 : labor_charges_amount) + (isFreightTaxable ? 0 : freight_charges_amount);
|
|
157
|
+
if (untaxedCharges > 0) {
|
|
158
|
+
grand_total += untaxedCharges;
|
|
159
|
+
}
|
|
134
160
|
// Add Card Charges to grand_total
|
|
135
161
|
const { cardCharges, amountCollected } = (0, utils_1.getCardChargesAndAmountCollected)(data.payments);
|
|
136
162
|
grand_total += cardCharges;
|
|
@@ -188,6 +214,10 @@ function calculateCartWarehousePurchaseOrderInfoAndSyncData(data, calculateItemM
|
|
|
188
214
|
order_discount_details,
|
|
189
215
|
total_discount_applied,
|
|
190
216
|
gst_amount,
|
|
217
|
+
labor_charges,
|
|
218
|
+
labor_charges_amount,
|
|
219
|
+
freight_charges,
|
|
220
|
+
freight_charges_amount,
|
|
191
221
|
price: (0, utils_1.parseNum)(subtotal),
|
|
192
222
|
grand_total,
|
|
193
223
|
};
|
|
@@ -544,6 +544,14 @@ export declare const PurchaseOrderSchema: Schema<any, import("mongoose").Model<a
|
|
|
544
544
|
gst?: number | null | undefined;
|
|
545
545
|
gst_amount?: number | null | undefined;
|
|
546
546
|
is_gst_percentage?: boolean | null | undefined;
|
|
547
|
+
labor_charges?: number | null | undefined;
|
|
548
|
+
labor_charges_amount?: number | null | undefined;
|
|
549
|
+
is_labor_charges_percentage?: boolean | null | undefined;
|
|
550
|
+
is_labor_charges_taxable?: boolean | null | undefined;
|
|
551
|
+
freight_charges?: number | null | undefined;
|
|
552
|
+
freight_charges_amount?: number | null | undefined;
|
|
553
|
+
is_freight_charges_percentage?: boolean | null | undefined;
|
|
554
|
+
is_freight_charges_taxable?: boolean | null | undefined;
|
|
547
555
|
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
548
556
|
updatedAt: NativeDate;
|
|
549
557
|
categories: import("mongoose").Types.DocumentArray<{
|
|
@@ -854,6 +862,14 @@ export declare const PurchaseOrderSchema: Schema<any, import("mongoose").Model<a
|
|
|
854
862
|
gst?: number | null | undefined;
|
|
855
863
|
gst_amount?: number | null | undefined;
|
|
856
864
|
is_gst_percentage?: boolean | null | undefined;
|
|
865
|
+
labor_charges?: number | null | undefined;
|
|
866
|
+
labor_charges_amount?: number | null | undefined;
|
|
867
|
+
is_labor_charges_percentage?: boolean | null | undefined;
|
|
868
|
+
is_labor_charges_taxable?: boolean | null | undefined;
|
|
869
|
+
freight_charges?: number | null | undefined;
|
|
870
|
+
freight_charges_amount?: number | null | undefined;
|
|
871
|
+
is_freight_charges_percentage?: boolean | null | undefined;
|
|
872
|
+
is_freight_charges_taxable?: boolean | null | undefined;
|
|
857
873
|
}> & {
|
|
858
874
|
updatedAt: NativeDate;
|
|
859
875
|
categories: import("mongoose").Types.DocumentArray<{
|
|
@@ -1164,6 +1180,14 @@ export declare const PurchaseOrderSchema: Schema<any, import("mongoose").Model<a
|
|
|
1164
1180
|
gst?: number | null | undefined;
|
|
1165
1181
|
gst_amount?: number | null | undefined;
|
|
1166
1182
|
is_gst_percentage?: boolean | null | undefined;
|
|
1183
|
+
labor_charges?: number | null | undefined;
|
|
1184
|
+
labor_charges_amount?: number | null | undefined;
|
|
1185
|
+
is_labor_charges_percentage?: boolean | null | undefined;
|
|
1186
|
+
is_labor_charges_taxable?: boolean | null | undefined;
|
|
1187
|
+
freight_charges?: number | null | undefined;
|
|
1188
|
+
freight_charges_amount?: number | null | undefined;
|
|
1189
|
+
is_freight_charges_percentage?: boolean | null | undefined;
|
|
1190
|
+
is_freight_charges_taxable?: boolean | null | undefined;
|
|
1167
1191
|
}>;
|
|
1168
1192
|
special_instructions: string;
|
|
1169
1193
|
payments: import("mongoose").Types.DocumentArray<{
|
|
@@ -1265,6 +1289,14 @@ export declare const PurchaseOrderSchema: Schema<any, import("mongoose").Model<a
|
|
|
1265
1289
|
gst_amount?: number | null | undefined;
|
|
1266
1290
|
rfq_id?: import("mongoose").Types.ObjectId | null | undefined;
|
|
1267
1291
|
is_gst_percentage?: boolean | null | undefined;
|
|
1292
|
+
labor_charges?: number | null | undefined;
|
|
1293
|
+
labor_charges_amount?: number | null | undefined;
|
|
1294
|
+
is_labor_charges_percentage?: boolean | null | undefined;
|
|
1295
|
+
is_labor_charges_taxable?: boolean | null | undefined;
|
|
1296
|
+
freight_charges?: number | null | undefined;
|
|
1297
|
+
freight_charges_amount?: number | null | undefined;
|
|
1298
|
+
is_freight_charges_percentage?: boolean | null | undefined;
|
|
1299
|
+
is_freight_charges_taxable?: boolean | null | undefined;
|
|
1268
1300
|
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
1269
1301
|
createdAt: NativeDate;
|
|
1270
1302
|
updatedAt: NativeDate;
|
|
@@ -1805,6 +1837,14 @@ export declare const PurchaseOrderSchema: Schema<any, import("mongoose").Model<a
|
|
|
1805
1837
|
gst?: number | null | undefined;
|
|
1806
1838
|
gst_amount?: number | null | undefined;
|
|
1807
1839
|
is_gst_percentage?: boolean | null | undefined;
|
|
1840
|
+
labor_charges?: number | null | undefined;
|
|
1841
|
+
labor_charges_amount?: number | null | undefined;
|
|
1842
|
+
is_labor_charges_percentage?: boolean | null | undefined;
|
|
1843
|
+
is_labor_charges_taxable?: boolean | null | undefined;
|
|
1844
|
+
freight_charges?: number | null | undefined;
|
|
1845
|
+
freight_charges_amount?: number | null | undefined;
|
|
1846
|
+
is_freight_charges_percentage?: boolean | null | undefined;
|
|
1847
|
+
is_freight_charges_taxable?: boolean | null | undefined;
|
|
1808
1848
|
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
1809
1849
|
updatedAt: NativeDate;
|
|
1810
1850
|
categories: import("mongoose").Types.DocumentArray<{
|
|
@@ -2115,6 +2155,14 @@ export declare const PurchaseOrderSchema: Schema<any, import("mongoose").Model<a
|
|
|
2115
2155
|
gst?: number | null | undefined;
|
|
2116
2156
|
gst_amount?: number | null | undefined;
|
|
2117
2157
|
is_gst_percentage?: boolean | null | undefined;
|
|
2158
|
+
labor_charges?: number | null | undefined;
|
|
2159
|
+
labor_charges_amount?: number | null | undefined;
|
|
2160
|
+
is_labor_charges_percentage?: boolean | null | undefined;
|
|
2161
|
+
is_labor_charges_taxable?: boolean | null | undefined;
|
|
2162
|
+
freight_charges?: number | null | undefined;
|
|
2163
|
+
freight_charges_amount?: number | null | undefined;
|
|
2164
|
+
is_freight_charges_percentage?: boolean | null | undefined;
|
|
2165
|
+
is_freight_charges_taxable?: boolean | null | undefined;
|
|
2118
2166
|
}> & {
|
|
2119
2167
|
updatedAt: NativeDate;
|
|
2120
2168
|
categories: import("mongoose").Types.DocumentArray<{
|
|
@@ -2425,6 +2473,14 @@ export declare const PurchaseOrderSchema: Schema<any, import("mongoose").Model<a
|
|
|
2425
2473
|
gst?: number | null | undefined;
|
|
2426
2474
|
gst_amount?: number | null | undefined;
|
|
2427
2475
|
is_gst_percentage?: boolean | null | undefined;
|
|
2476
|
+
labor_charges?: number | null | undefined;
|
|
2477
|
+
labor_charges_amount?: number | null | undefined;
|
|
2478
|
+
is_labor_charges_percentage?: boolean | null | undefined;
|
|
2479
|
+
is_labor_charges_taxable?: boolean | null | undefined;
|
|
2480
|
+
freight_charges?: number | null | undefined;
|
|
2481
|
+
freight_charges_amount?: number | null | undefined;
|
|
2482
|
+
is_freight_charges_percentage?: boolean | null | undefined;
|
|
2483
|
+
is_freight_charges_taxable?: boolean | null | undefined;
|
|
2428
2484
|
}>;
|
|
2429
2485
|
special_instructions: string;
|
|
2430
2486
|
payments: import("mongoose").Types.DocumentArray<{
|
|
@@ -2526,6 +2582,14 @@ export declare const PurchaseOrderSchema: Schema<any, import("mongoose").Model<a
|
|
|
2526
2582
|
gst_amount?: number | null | undefined;
|
|
2527
2583
|
rfq_id?: import("mongoose").Types.ObjectId | null | undefined;
|
|
2528
2584
|
is_gst_percentage?: boolean | null | undefined;
|
|
2585
|
+
labor_charges?: number | null | undefined;
|
|
2586
|
+
labor_charges_amount?: number | null | undefined;
|
|
2587
|
+
is_labor_charges_percentage?: boolean | null | undefined;
|
|
2588
|
+
is_labor_charges_taxable?: boolean | null | undefined;
|
|
2589
|
+
freight_charges?: number | null | undefined;
|
|
2590
|
+
freight_charges_amount?: number | null | undefined;
|
|
2591
|
+
is_freight_charges_percentage?: boolean | null | undefined;
|
|
2592
|
+
is_freight_charges_taxable?: boolean | null | undefined;
|
|
2529
2593
|
}>> & import("mongoose").FlatRecord<{
|
|
2530
2594
|
createdAt: NativeDate;
|
|
2531
2595
|
updatedAt: NativeDate;
|
|
@@ -3066,6 +3130,14 @@ export declare const PurchaseOrderSchema: Schema<any, import("mongoose").Model<a
|
|
|
3066
3130
|
gst?: number | null | undefined;
|
|
3067
3131
|
gst_amount?: number | null | undefined;
|
|
3068
3132
|
is_gst_percentage?: boolean | null | undefined;
|
|
3133
|
+
labor_charges?: number | null | undefined;
|
|
3134
|
+
labor_charges_amount?: number | null | undefined;
|
|
3135
|
+
is_labor_charges_percentage?: boolean | null | undefined;
|
|
3136
|
+
is_labor_charges_taxable?: boolean | null | undefined;
|
|
3137
|
+
freight_charges?: number | null | undefined;
|
|
3138
|
+
freight_charges_amount?: number | null | undefined;
|
|
3139
|
+
is_freight_charges_percentage?: boolean | null | undefined;
|
|
3140
|
+
is_freight_charges_taxable?: boolean | null | undefined;
|
|
3069
3141
|
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
3070
3142
|
updatedAt: NativeDate;
|
|
3071
3143
|
categories: import("mongoose").Types.DocumentArray<{
|
|
@@ -3376,6 +3448,14 @@ export declare const PurchaseOrderSchema: Schema<any, import("mongoose").Model<a
|
|
|
3376
3448
|
gst?: number | null | undefined;
|
|
3377
3449
|
gst_amount?: number | null | undefined;
|
|
3378
3450
|
is_gst_percentage?: boolean | null | undefined;
|
|
3451
|
+
labor_charges?: number | null | undefined;
|
|
3452
|
+
labor_charges_amount?: number | null | undefined;
|
|
3453
|
+
is_labor_charges_percentage?: boolean | null | undefined;
|
|
3454
|
+
is_labor_charges_taxable?: boolean | null | undefined;
|
|
3455
|
+
freight_charges?: number | null | undefined;
|
|
3456
|
+
freight_charges_amount?: number | null | undefined;
|
|
3457
|
+
is_freight_charges_percentage?: boolean | null | undefined;
|
|
3458
|
+
is_freight_charges_taxable?: boolean | null | undefined;
|
|
3379
3459
|
}> & {
|
|
3380
3460
|
updatedAt: NativeDate;
|
|
3381
3461
|
categories: import("mongoose").Types.DocumentArray<{
|
|
@@ -3686,6 +3766,14 @@ export declare const PurchaseOrderSchema: Schema<any, import("mongoose").Model<a
|
|
|
3686
3766
|
gst?: number | null | undefined;
|
|
3687
3767
|
gst_amount?: number | null | undefined;
|
|
3688
3768
|
is_gst_percentage?: boolean | null | undefined;
|
|
3769
|
+
labor_charges?: number | null | undefined;
|
|
3770
|
+
labor_charges_amount?: number | null | undefined;
|
|
3771
|
+
is_labor_charges_percentage?: boolean | null | undefined;
|
|
3772
|
+
is_labor_charges_taxable?: boolean | null | undefined;
|
|
3773
|
+
freight_charges?: number | null | undefined;
|
|
3774
|
+
freight_charges_amount?: number | null | undefined;
|
|
3775
|
+
is_freight_charges_percentage?: boolean | null | undefined;
|
|
3776
|
+
is_freight_charges_taxable?: boolean | null | undefined;
|
|
3689
3777
|
}>;
|
|
3690
3778
|
special_instructions: string;
|
|
3691
3779
|
payments: import("mongoose").Types.DocumentArray<{
|
|
@@ -3787,6 +3875,14 @@ export declare const PurchaseOrderSchema: Schema<any, import("mongoose").Model<a
|
|
|
3787
3875
|
gst_amount?: number | null | undefined;
|
|
3788
3876
|
rfq_id?: import("mongoose").Types.ObjectId | null | undefined;
|
|
3789
3877
|
is_gst_percentage?: boolean | null | undefined;
|
|
3878
|
+
labor_charges?: number | null | undefined;
|
|
3879
|
+
labor_charges_amount?: number | null | undefined;
|
|
3880
|
+
is_labor_charges_percentage?: boolean | null | undefined;
|
|
3881
|
+
is_labor_charges_taxable?: boolean | null | undefined;
|
|
3882
|
+
freight_charges?: number | null | undefined;
|
|
3883
|
+
freight_charges_amount?: number | null | undefined;
|
|
3884
|
+
is_freight_charges_percentage?: boolean | null | undefined;
|
|
3885
|
+
is_freight_charges_taxable?: boolean | null | undefined;
|
|
3790
3886
|
}> & Required<{
|
|
3791
3887
|
_id: import("mongoose").Types.ObjectId;
|
|
3792
3888
|
}> & {
|
|
@@ -206,6 +206,42 @@ const IterationsOrderSchema = new mongoose_1.Schema({
|
|
|
206
206
|
type: Boolean,
|
|
207
207
|
required: false,
|
|
208
208
|
},
|
|
209
|
+
labor_charges: {
|
|
210
|
+
type: Number,
|
|
211
|
+
min: 0,
|
|
212
|
+
required: false,
|
|
213
|
+
},
|
|
214
|
+
labor_charges_amount: {
|
|
215
|
+
type: Number,
|
|
216
|
+
min: 0,
|
|
217
|
+
required: false,
|
|
218
|
+
},
|
|
219
|
+
is_labor_charges_percentage: {
|
|
220
|
+
type: Boolean,
|
|
221
|
+
required: false,
|
|
222
|
+
},
|
|
223
|
+
is_labor_charges_taxable: {
|
|
224
|
+
type: Boolean,
|
|
225
|
+
required: false,
|
|
226
|
+
},
|
|
227
|
+
freight_charges: {
|
|
228
|
+
type: Number,
|
|
229
|
+
min: 0,
|
|
230
|
+
required: false,
|
|
231
|
+
},
|
|
232
|
+
freight_charges_amount: {
|
|
233
|
+
type: Number,
|
|
234
|
+
min: 0,
|
|
235
|
+
required: false,
|
|
236
|
+
},
|
|
237
|
+
is_freight_charges_percentage: {
|
|
238
|
+
type: Boolean,
|
|
239
|
+
required: false,
|
|
240
|
+
},
|
|
241
|
+
is_freight_charges_taxable: {
|
|
242
|
+
type: Boolean,
|
|
243
|
+
required: false,
|
|
244
|
+
},
|
|
209
245
|
tax_number: {
|
|
210
246
|
type: String,
|
|
211
247
|
default: '',
|
|
@@ -339,6 +375,42 @@ exports.PurchaseOrderSchema = new mongoose_1.Schema({
|
|
|
339
375
|
type: Boolean,
|
|
340
376
|
required: false,
|
|
341
377
|
},
|
|
378
|
+
labor_charges: {
|
|
379
|
+
type: Number,
|
|
380
|
+
min: 0,
|
|
381
|
+
required: false,
|
|
382
|
+
},
|
|
383
|
+
labor_charges_amount: {
|
|
384
|
+
type: Number,
|
|
385
|
+
min: 0,
|
|
386
|
+
required: false,
|
|
387
|
+
},
|
|
388
|
+
is_labor_charges_percentage: {
|
|
389
|
+
type: Boolean,
|
|
390
|
+
required: false,
|
|
391
|
+
},
|
|
392
|
+
is_labor_charges_taxable: {
|
|
393
|
+
type: Boolean,
|
|
394
|
+
required: false,
|
|
395
|
+
},
|
|
396
|
+
freight_charges: {
|
|
397
|
+
type: Number,
|
|
398
|
+
min: 0,
|
|
399
|
+
required: false,
|
|
400
|
+
},
|
|
401
|
+
freight_charges_amount: {
|
|
402
|
+
type: Number,
|
|
403
|
+
min: 0,
|
|
404
|
+
required: false,
|
|
405
|
+
},
|
|
406
|
+
is_freight_charges_percentage: {
|
|
407
|
+
type: Boolean,
|
|
408
|
+
required: false,
|
|
409
|
+
},
|
|
410
|
+
is_freight_charges_taxable: {
|
|
411
|
+
type: Boolean,
|
|
412
|
+
required: false,
|
|
413
|
+
},
|
|
342
414
|
//
|
|
343
415
|
is_deleted: {
|
|
344
416
|
type: Boolean,
|
|
@@ -18,6 +18,8 @@ export declare const WarehouseSchema: Schema<any, import("mongoose").Model<any,
|
|
|
18
18
|
country_code: COUNTRY_CODE_ENUM;
|
|
19
19
|
currency_symbol: CURRENCY_SYMBOL_ENUM;
|
|
20
20
|
country_alpha_2: COUNTRY_ALPHA_2_ENUM;
|
|
21
|
+
is_labor_charges_taxable: boolean;
|
|
22
|
+
is_freight_charges_taxable: boolean;
|
|
21
23
|
support_email: string;
|
|
22
24
|
public_phone_numbers: string[];
|
|
23
25
|
tax_business_number: string;
|
|
@@ -72,6 +74,8 @@ export declare const WarehouseSchema: Schema<any, import("mongoose").Model<any,
|
|
|
72
74
|
country_code: COUNTRY_CODE_ENUM;
|
|
73
75
|
currency_symbol: CURRENCY_SYMBOL_ENUM;
|
|
74
76
|
country_alpha_2: COUNTRY_ALPHA_2_ENUM;
|
|
77
|
+
is_labor_charges_taxable: boolean;
|
|
78
|
+
is_freight_charges_taxable: boolean;
|
|
75
79
|
support_email: string;
|
|
76
80
|
public_phone_numbers: string[];
|
|
77
81
|
tax_business_number: string;
|
|
@@ -126,6 +130,8 @@ export declare const WarehouseSchema: Schema<any, import("mongoose").Model<any,
|
|
|
126
130
|
country_code: COUNTRY_CODE_ENUM;
|
|
127
131
|
currency_symbol: CURRENCY_SYMBOL_ENUM;
|
|
128
132
|
country_alpha_2: COUNTRY_ALPHA_2_ENUM;
|
|
133
|
+
is_labor_charges_taxable: boolean;
|
|
134
|
+
is_freight_charges_taxable: boolean;
|
|
129
135
|
support_email: string;
|
|
130
136
|
public_phone_numbers: string[];
|
|
131
137
|
tax_business_number: string;
|
|
@@ -95,6 +95,14 @@ exports.WarehouseSchema = new mongoose_1.Schema({
|
|
|
95
95
|
type: Boolean,
|
|
96
96
|
required: false,
|
|
97
97
|
},
|
|
98
|
+
is_labor_charges_taxable: {
|
|
99
|
+
type: Boolean,
|
|
100
|
+
default: false,
|
|
101
|
+
},
|
|
102
|
+
is_freight_charges_taxable: {
|
|
103
|
+
type: Boolean,
|
|
104
|
+
default: false,
|
|
105
|
+
},
|
|
98
106
|
po_card_gst: {
|
|
99
107
|
type: Number,
|
|
100
108
|
default: 0,
|
|
@@ -37,6 +37,14 @@ export interface IWarehousePurchaseOrderIteration {
|
|
|
37
37
|
is_gst_percentage?: boolean;
|
|
38
38
|
gst?: number | null;
|
|
39
39
|
gst_amount?: number | null;
|
|
40
|
+
labor_charges?: number;
|
|
41
|
+
labor_charges_amount?: number;
|
|
42
|
+
is_labor_charges_percentage?: boolean;
|
|
43
|
+
is_labor_charges_taxable?: boolean;
|
|
44
|
+
freight_charges?: number;
|
|
45
|
+
freight_charges_amount?: number;
|
|
46
|
+
is_freight_charges_percentage?: boolean;
|
|
47
|
+
is_freight_charges_taxable?: boolean;
|
|
40
48
|
special_instructions: string;
|
|
41
49
|
price: number;
|
|
42
50
|
amount_earned: number;
|
|
@@ -19,6 +19,8 @@ export interface IWarehouse {
|
|
|
19
19
|
is_gst_inclusive?: boolean;
|
|
20
20
|
hide_gst_value?: boolean;
|
|
21
21
|
exclude_discount_from_gst?: boolean;
|
|
22
|
+
is_labor_charges_taxable?: boolean;
|
|
23
|
+
is_freight_charges_taxable?: boolean;
|
|
22
24
|
po_card_gst: number;
|
|
23
25
|
po_cash_gst: number;
|
|
24
26
|
invoice_card_gst: number;
|