@managesome/eposmatic-toolkit 0.4.82 → 0.4.84

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.
Files changed (28) hide show
  1. package/esm/helpers/order/generate-warehouse-purchase-order.js +90 -0
  2. package/esm/helpers/store/common-tenant-purchase-order-actions.js +18 -0
  3. package/esm/helpers/store/common-warehouse-purchase-order-actions.js +18 -0
  4. package/esm/helpers/store/tenant-purchase-orders-cart-actions.js +36 -0
  5. package/esm/helpers/store/warehouse-purchase-orders-cart-actions.js +30 -0
  6. package/esm/schemas/models/tenant_purchase_orders.js +19 -0
  7. package/esm/schemas/models/tenants.js +8 -0
  8. package/esm/schemas/models/warehouse_purchase_orders.js +72 -0
  9. package/esm/schemas/models/warehouses.js +8 -0
  10. package/lib/helpers/order/generate-warehouse-purchase-order.js +90 -0
  11. package/lib/helpers/store/common-tenant-purchase-order-actions.js +18 -0
  12. package/lib/helpers/store/common-warehouse-purchase-order-actions.js +18 -0
  13. package/lib/helpers/store/tenant-purchase-orders-cart-actions.js +36 -0
  14. package/lib/helpers/store/warehouse-purchase-orders-cart-actions.d.ts +8 -0
  15. package/lib/helpers/store/warehouse-purchase-orders-cart-actions.js +30 -0
  16. package/lib/schemas/models/tenant_purchase_orders.d.ts +96 -0
  17. package/lib/schemas/models/tenant_purchase_orders.js +19 -0
  18. package/lib/schemas/models/tenants.d.ts +6 -0
  19. package/lib/schemas/models/tenants.js +8 -0
  20. package/lib/schemas/models/warehouse_purchase_orders.d.ts +96 -0
  21. package/lib/schemas/models/warehouse_purchase_orders.js +72 -0
  22. package/lib/schemas/models/warehouses.d.ts +6 -0
  23. package/lib/schemas/models/warehouses.js +8 -0
  24. package/lib/schemas/types/tenant_purchase_orders.d.ts +8 -0
  25. package/lib/schemas/types/tenants.d.ts +2 -0
  26. package/lib/schemas/types/warehouse_purchase_orders.d.ts +8 -0
  27. package/lib/schemas/types/warehouses.d.ts +2 -0
  28. package/package.json +1 -1
@@ -103,6 +103,33 @@ function calculateCartTenantPurchaseOrderInfoAndSyncData(data, calculateItemMeta
103
103
  if (!applyGSTOnOriginalPrice) {
104
104
  grand_total -= total_discount_applied;
105
105
  }
106
+ // Order-level charges (labor, freight): entered per PO, either a fixed amount
107
+ // or a percentage of the post-discount items value. The matching
108
+ // `is_*_charges_taxable` flag (snapshot of the tenant setting) decides the
109
+ // placement, exactly like `is_service_fee_taxable` on a POS order: taxable =>
110
+ // added BEFORE GST so the tax applies to it (an inclusive rate treats it as
111
+ // tax-inclusive); untaxed => added after GST.
112
+ const chargesBase = (0, utils_1.parseNum)(Math.max(0, subtotal - total_discount_applied));
113
+ const getOrderCharge = (value, isPercentage) => {
114
+ const entered = (0, utils_1.parseNum)(Math.max(0, value ?? 0));
115
+ return {
116
+ entered,
117
+ amount: isPercentage ? (0, utils_1.parseNum)((0, utils_1.getPercentageAmount)(chargesBase, entered)) : entered,
118
+ };
119
+ };
120
+ const labor = getOrderCharge(data.labor_charges, data.is_labor_charges_percentage);
121
+ const freight = getOrderCharge(data.freight_charges, data.is_freight_charges_percentage);
122
+ const labor_charges = labor.entered;
123
+ const labor_charges_amount = labor.amount;
124
+ const freight_charges = freight.entered;
125
+ const freight_charges_amount = freight.amount;
126
+ const isLaborTaxable = data.is_labor_charges_taxable === true;
127
+ const isFreightTaxable = data.is_freight_charges_taxable === true;
128
+ // Taxable charges join the GST base here; untaxed ones are added further down.
129
+ const taxableCharges = (isLaborTaxable ? labor_charges_amount : 0) + (isFreightTaxable ? freight_charges_amount : 0);
130
+ if (taxableCharges > 0) {
131
+ grand_total += taxableCharges;
132
+ }
106
133
  let gst_amount = 0;
107
134
  const gst = data.gst ?? 0;
108
135
  const isGstPercentage = data.is_gst_percentage !== false;
@@ -128,6 +155,11 @@ function calculateCartTenantPurchaseOrderInfoAndSyncData(data, calculateItemMeta
128
155
  if (applyGSTOnOriginalPrice) {
129
156
  grand_total -= total_discount_applied;
130
157
  }
158
+ // Untaxed charges sit outside the GST base, so they are added after the tax.
159
+ const untaxedCharges = (isLaborTaxable ? 0 : labor_charges_amount) + (isFreightTaxable ? 0 : freight_charges_amount);
160
+ if (untaxedCharges > 0) {
161
+ grand_total += untaxedCharges;
162
+ }
131
163
  const { cardCharges, amountCollected } = (0, utils_1.getCardChargesAndAmountCollected)(data.payments);
132
164
  grand_total += cardCharges;
133
165
  grand_total = (0, utils_1.parseNum)(grand_total);
@@ -184,6 +216,10 @@ function calculateCartTenantPurchaseOrderInfoAndSyncData(data, calculateItemMeta
184
216
  order_discount_details,
185
217
  total_discount_applied,
186
218
  gst_amount,
219
+ labor_charges,
220
+ labor_charges_amount,
221
+ freight_charges,
222
+ freight_charges_amount,
187
223
  price: (0, utils_1.parseNum)(subtotal),
188
224
  grand_total,
189
225
  };
@@ -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
  };
@@ -562,6 +562,14 @@ export declare const TenantPurchaseOrderSchema: Schema<any, import("mongoose").M
562
562
  gst?: number | null | undefined;
563
563
  gst_amount?: number | null | undefined;
564
564
  is_gst_percentage?: boolean | null | undefined;
565
+ labor_charges?: number | null | undefined;
566
+ labor_charges_amount?: number | null | undefined;
567
+ is_labor_charges_percentage?: boolean | null | undefined;
568
+ is_labor_charges_taxable?: boolean | null | undefined;
569
+ freight_charges?: number | null | undefined;
570
+ freight_charges_amount?: number | null | undefined;
571
+ is_freight_charges_percentage?: boolean | null | undefined;
572
+ is_freight_charges_taxable?: boolean | null | undefined;
565
573
  }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
566
574
  updatedAt: NativeDate;
567
575
  categories: import("mongoose").Types.DocumentArray<{
@@ -881,6 +889,14 @@ export declare const TenantPurchaseOrderSchema: Schema<any, import("mongoose").M
881
889
  gst?: number | null | undefined;
882
890
  gst_amount?: number | null | undefined;
883
891
  is_gst_percentage?: boolean | null | undefined;
892
+ labor_charges?: number | null | undefined;
893
+ labor_charges_amount?: number | null | undefined;
894
+ is_labor_charges_percentage?: boolean | null | undefined;
895
+ is_labor_charges_taxable?: boolean | null | undefined;
896
+ freight_charges?: number | null | undefined;
897
+ freight_charges_amount?: number | null | undefined;
898
+ is_freight_charges_percentage?: boolean | null | undefined;
899
+ is_freight_charges_taxable?: boolean | null | undefined;
884
900
  }> & {
885
901
  updatedAt: NativeDate;
886
902
  categories: import("mongoose").Types.DocumentArray<{
@@ -1200,6 +1216,14 @@ export declare const TenantPurchaseOrderSchema: Schema<any, import("mongoose").M
1200
1216
  gst?: number | null | undefined;
1201
1217
  gst_amount?: number | null | undefined;
1202
1218
  is_gst_percentage?: boolean | null | undefined;
1219
+ labor_charges?: number | null | undefined;
1220
+ labor_charges_amount?: number | null | undefined;
1221
+ is_labor_charges_percentage?: boolean | null | undefined;
1222
+ is_labor_charges_taxable?: boolean | null | undefined;
1223
+ freight_charges?: number | null | undefined;
1224
+ freight_charges_amount?: number | null | undefined;
1225
+ is_freight_charges_percentage?: boolean | null | undefined;
1226
+ is_freight_charges_taxable?: boolean | null | undefined;
1203
1227
  }>;
1204
1228
  special_instructions: string;
1205
1229
  payments: import("mongoose").Types.DocumentArray<{
@@ -1299,6 +1323,14 @@ export declare const TenantPurchaseOrderSchema: Schema<any, import("mongoose").M
1299
1323
  gst?: number | null | undefined;
1300
1324
  gst_amount?: number | null | undefined;
1301
1325
  is_gst_percentage?: boolean | null | undefined;
1326
+ labor_charges?: number | null | undefined;
1327
+ labor_charges_amount?: number | null | undefined;
1328
+ is_labor_charges_percentage?: boolean | null | undefined;
1329
+ is_labor_charges_taxable?: boolean | null | undefined;
1330
+ freight_charges?: number | null | undefined;
1331
+ freight_charges_amount?: number | null | undefined;
1332
+ is_freight_charges_percentage?: boolean | null | undefined;
1333
+ is_freight_charges_taxable?: boolean | null | undefined;
1302
1334
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
1303
1335
  createdAt: NativeDate;
1304
1336
  updatedAt: NativeDate;
@@ -1858,6 +1890,14 @@ export declare const TenantPurchaseOrderSchema: Schema<any, import("mongoose").M
1858
1890
  gst?: number | null | undefined;
1859
1891
  gst_amount?: number | null | undefined;
1860
1892
  is_gst_percentage?: boolean | null | undefined;
1893
+ labor_charges?: number | null | undefined;
1894
+ labor_charges_amount?: number | null | undefined;
1895
+ is_labor_charges_percentage?: boolean | null | undefined;
1896
+ is_labor_charges_taxable?: boolean | null | undefined;
1897
+ freight_charges?: number | null | undefined;
1898
+ freight_charges_amount?: number | null | undefined;
1899
+ is_freight_charges_percentage?: boolean | null | undefined;
1900
+ is_freight_charges_taxable?: boolean | null | undefined;
1861
1901
  }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
1862
1902
  updatedAt: NativeDate;
1863
1903
  categories: import("mongoose").Types.DocumentArray<{
@@ -2177,6 +2217,14 @@ export declare const TenantPurchaseOrderSchema: Schema<any, import("mongoose").M
2177
2217
  gst?: number | null | undefined;
2178
2218
  gst_amount?: number | null | undefined;
2179
2219
  is_gst_percentage?: boolean | null | undefined;
2220
+ labor_charges?: number | null | undefined;
2221
+ labor_charges_amount?: number | null | undefined;
2222
+ is_labor_charges_percentage?: boolean | null | undefined;
2223
+ is_labor_charges_taxable?: boolean | null | undefined;
2224
+ freight_charges?: number | null | undefined;
2225
+ freight_charges_amount?: number | null | undefined;
2226
+ is_freight_charges_percentage?: boolean | null | undefined;
2227
+ is_freight_charges_taxable?: boolean | null | undefined;
2180
2228
  }> & {
2181
2229
  updatedAt: NativeDate;
2182
2230
  categories: import("mongoose").Types.DocumentArray<{
@@ -2496,6 +2544,14 @@ export declare const TenantPurchaseOrderSchema: Schema<any, import("mongoose").M
2496
2544
  gst?: number | null | undefined;
2497
2545
  gst_amount?: number | null | undefined;
2498
2546
  is_gst_percentage?: boolean | null | undefined;
2547
+ labor_charges?: number | null | undefined;
2548
+ labor_charges_amount?: number | null | undefined;
2549
+ is_labor_charges_percentage?: boolean | null | undefined;
2550
+ is_labor_charges_taxable?: boolean | null | undefined;
2551
+ freight_charges?: number | null | undefined;
2552
+ freight_charges_amount?: number | null | undefined;
2553
+ is_freight_charges_percentage?: boolean | null | undefined;
2554
+ is_freight_charges_taxable?: boolean | null | undefined;
2499
2555
  }>;
2500
2556
  special_instructions: string;
2501
2557
  payments: import("mongoose").Types.DocumentArray<{
@@ -2595,6 +2651,14 @@ export declare const TenantPurchaseOrderSchema: Schema<any, import("mongoose").M
2595
2651
  gst?: number | null | undefined;
2596
2652
  gst_amount?: number | null | undefined;
2597
2653
  is_gst_percentage?: boolean | null | undefined;
2654
+ labor_charges?: number | null | undefined;
2655
+ labor_charges_amount?: number | null | undefined;
2656
+ is_labor_charges_percentage?: boolean | null | undefined;
2657
+ is_labor_charges_taxable?: boolean | null | undefined;
2658
+ freight_charges?: number | null | undefined;
2659
+ freight_charges_amount?: number | null | undefined;
2660
+ is_freight_charges_percentage?: boolean | null | undefined;
2661
+ is_freight_charges_taxable?: boolean | null | undefined;
2598
2662
  }>> & import("mongoose").FlatRecord<{
2599
2663
  createdAt: NativeDate;
2600
2664
  updatedAt: NativeDate;
@@ -3154,6 +3218,14 @@ export declare const TenantPurchaseOrderSchema: Schema<any, import("mongoose").M
3154
3218
  gst?: number | null | undefined;
3155
3219
  gst_amount?: number | null | undefined;
3156
3220
  is_gst_percentage?: boolean | null | undefined;
3221
+ labor_charges?: number | null | undefined;
3222
+ labor_charges_amount?: number | null | undefined;
3223
+ is_labor_charges_percentage?: boolean | null | undefined;
3224
+ is_labor_charges_taxable?: boolean | null | undefined;
3225
+ freight_charges?: number | null | undefined;
3226
+ freight_charges_amount?: number | null | undefined;
3227
+ is_freight_charges_percentage?: boolean | null | undefined;
3228
+ is_freight_charges_taxable?: boolean | null | undefined;
3157
3229
  }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
3158
3230
  updatedAt: NativeDate;
3159
3231
  categories: import("mongoose").Types.DocumentArray<{
@@ -3473,6 +3545,14 @@ export declare const TenantPurchaseOrderSchema: Schema<any, import("mongoose").M
3473
3545
  gst?: number | null | undefined;
3474
3546
  gst_amount?: number | null | undefined;
3475
3547
  is_gst_percentage?: boolean | null | undefined;
3548
+ labor_charges?: number | null | undefined;
3549
+ labor_charges_amount?: number | null | undefined;
3550
+ is_labor_charges_percentage?: boolean | null | undefined;
3551
+ is_labor_charges_taxable?: boolean | null | undefined;
3552
+ freight_charges?: number | null | undefined;
3553
+ freight_charges_amount?: number | null | undefined;
3554
+ is_freight_charges_percentage?: boolean | null | undefined;
3555
+ is_freight_charges_taxable?: boolean | null | undefined;
3476
3556
  }> & {
3477
3557
  updatedAt: NativeDate;
3478
3558
  categories: import("mongoose").Types.DocumentArray<{
@@ -3792,6 +3872,14 @@ export declare const TenantPurchaseOrderSchema: Schema<any, import("mongoose").M
3792
3872
  gst?: number | null | undefined;
3793
3873
  gst_amount?: number | null | undefined;
3794
3874
  is_gst_percentage?: boolean | null | undefined;
3875
+ labor_charges?: number | null | undefined;
3876
+ labor_charges_amount?: number | null | undefined;
3877
+ is_labor_charges_percentage?: boolean | null | undefined;
3878
+ is_labor_charges_taxable?: boolean | null | undefined;
3879
+ freight_charges?: number | null | undefined;
3880
+ freight_charges_amount?: number | null | undefined;
3881
+ is_freight_charges_percentage?: boolean | null | undefined;
3882
+ is_freight_charges_taxable?: boolean | null | undefined;
3795
3883
  }>;
3796
3884
  special_instructions: string;
3797
3885
  payments: import("mongoose").Types.DocumentArray<{
@@ -3891,6 +3979,14 @@ export declare const TenantPurchaseOrderSchema: Schema<any, import("mongoose").M
3891
3979
  gst?: number | null | undefined;
3892
3980
  gst_amount?: number | null | undefined;
3893
3981
  is_gst_percentage?: boolean | null | undefined;
3982
+ labor_charges?: number | null | undefined;
3983
+ labor_charges_amount?: number | null | undefined;
3984
+ is_labor_charges_percentage?: boolean | null | undefined;
3985
+ is_labor_charges_taxable?: boolean | null | undefined;
3986
+ freight_charges?: number | null | undefined;
3987
+ freight_charges_amount?: number | null | undefined;
3988
+ is_freight_charges_percentage?: boolean | null | undefined;
3989
+ is_freight_charges_taxable?: boolean | null | undefined;
3894
3990
  }> & Required<{
3895
3991
  _id: import("mongoose").Types.ObjectId;
3896
3992
  }> & {
@@ -96,6 +96,14 @@ const IterationsOrderSchema = new mongoose_1.Schema({
96
96
  gst_amount: { type: Number, min: 0, required: false },
97
97
  is_gst_inclusive: { type: Boolean, required: false },
98
98
  is_gst_percentage: { type: Boolean, required: false },
99
+ labor_charges: { type: Number, min: 0, required: false },
100
+ labor_charges_amount: { type: Number, min: 0, required: false },
101
+ is_labor_charges_percentage: { type: Boolean, required: false },
102
+ is_labor_charges_taxable: { type: Boolean, required: false },
103
+ freight_charges: { type: Number, min: 0, required: false },
104
+ freight_charges_amount: { type: Number, min: 0, required: false },
105
+ is_freight_charges_percentage: { type: Boolean, required: false },
106
+ is_freight_charges_taxable: { type: Boolean, required: false },
99
107
  tax_number: { type: String, default: '' },
100
108
  updatedAt: { type: mongoose_1.Schema.Types.Date, required: true },
101
109
  }, { _id: false, timestamps: false, versionKey: false });
@@ -137,6 +145,17 @@ exports.TenantPurchaseOrderSchema = new mongoose_1.Schema({
137
145
  is_gst_inclusive: { type: Boolean, required: false },
138
146
  // true/undefined => `gst` is a percentage, false => `gst` is a fixed amount
139
147
  is_gst_percentage: { type: Boolean, required: false },
148
+ labor_charges: { type: Number, min: 0, required: false },
149
+ labor_charges_amount: { type: Number, min: 0, required: false },
150
+ // true => `labor_charges` is a percentage of the post-discount subtotal
151
+ is_labor_charges_percentage: { type: Boolean, required: false },
152
+ // true => the labor charge is inside the GST base (added before GST)
153
+ is_labor_charges_taxable: { type: Boolean, required: false },
154
+ // freight charge, mirrors the labor fields above
155
+ freight_charges: { type: Number, min: 0, required: false },
156
+ freight_charges_amount: { type: Number, min: 0, required: false },
157
+ is_freight_charges_percentage: { type: Boolean, required: false },
158
+ is_freight_charges_taxable: { type: Boolean, required: false },
140
159
  is_deleted: { type: Boolean, default: false },
141
160
  order_status_updated_at: {
142
161
  type: mongoose_1.Schema.Types.Date,
@@ -21,6 +21,8 @@ export declare const TenantSchema: Schema<any, import("mongoose").Model<any, any
21
21
  packaging_charges: number;
22
22
  currency_symbol: CURRENCY_SYMBOL_ENUM;
23
23
  country_alpha_2: COUNTRY_ALPHA_2_ENUM;
24
+ is_labor_charges_taxable: boolean;
25
+ is_freight_charges_taxable: boolean;
24
26
  delivery_min_cost: number;
25
27
  restaurant_address: string;
26
28
  support_email: string;
@@ -203,6 +205,8 @@ export declare const TenantSchema: Schema<any, import("mongoose").Model<any, any
203
205
  packaging_charges: number;
204
206
  currency_symbol: CURRENCY_SYMBOL_ENUM;
205
207
  country_alpha_2: COUNTRY_ALPHA_2_ENUM;
208
+ is_labor_charges_taxable: boolean;
209
+ is_freight_charges_taxable: boolean;
206
210
  delivery_min_cost: number;
207
211
  restaurant_address: string;
208
212
  support_email: string;
@@ -385,6 +389,8 @@ export declare const TenantSchema: Schema<any, import("mongoose").Model<any, any
385
389
  packaging_charges: number;
386
390
  currency_symbol: CURRENCY_SYMBOL_ENUM;
387
391
  country_alpha_2: COUNTRY_ALPHA_2_ENUM;
392
+ is_labor_charges_taxable: boolean;
393
+ is_freight_charges_taxable: boolean;
388
394
  delivery_min_cost: number;
389
395
  restaurant_address: string;
390
396
  support_email: string;
@@ -481,6 +481,14 @@ exports.TenantSchema = new mongoose_1.Schema({
481
481
  enum: constants_1.ALL_GST_TYPES,
482
482
  required: false,
483
483
  },
484
+ is_labor_charges_taxable: {
485
+ type: Boolean,
486
+ default: false,
487
+ },
488
+ is_freight_charges_taxable: {
489
+ type: Boolean,
490
+ default: false,
491
+ },
484
492
  web_design_type: {
485
493
  type: String,
486
494
  enum: constants_1.ALL_ONLINE_ORDERING_DESIGN_TYPES,
@@ -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;