@managesome/eposmatic-toolkit 0.4.85 → 0.4.86

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.
@@ -17,6 +17,14 @@ export function generateWarehouseInternalMovementIteration(movement, partial = t
17
17
  is_gst_inclusive: movement.is_gst_inclusive,
18
18
  gst: movement.gst,
19
19
  gst_amount: movement.gst_amount,
20
+ labor_charges: movement.labor_charges,
21
+ labor_charges_amount: movement.labor_charges_amount,
22
+ is_labor_charges_percentage: movement.is_labor_charges_percentage,
23
+ is_labor_charges_taxable: movement.is_labor_charges_taxable,
24
+ freight_charges: movement.freight_charges,
25
+ freight_charges_amount: movement.freight_charges_amount,
26
+ is_freight_charges_percentage: movement.is_freight_charges_percentage,
27
+ is_freight_charges_taxable: movement.is_freight_charges_taxable,
20
28
  notes: movement.notes,
21
29
  status: movement.status,
22
30
  updatedAt: movement.updatedAt,
@@ -53,6 +53,16 @@ export function getWarehouseInternalMovementWithPrice(order, writeable) {
53
53
  ...(order.amount_collected != null ? { amount_collected: convertToPrice(order.amount_collected) } : {}),
54
54
  ...(order.amount_earned != null ? { amount_earned: convertToPrice(order.amount_earned) } : {}),
55
55
  ...(order.gst != null ? { gst: convertToPrice(order.gst) } : {}),
56
+ ...(order.labor_charges != null && order.is_labor_charges_percentage !== true
57
+ ? { labor_charges: convertToPrice(order.labor_charges) }
58
+ : {}),
59
+ ...(order.labor_charges_amount != null ? { labor_charges_amount: convertToPrice(order.labor_charges_amount) } : {}),
60
+ ...(order.freight_charges != null && order.is_freight_charges_percentage !== true
61
+ ? { freight_charges: convertToPrice(order.freight_charges) }
62
+ : {}),
63
+ ...(order.freight_charges_amount != null
64
+ ? { freight_charges_amount: convertToPrice(order.freight_charges_amount) }
65
+ : {}),
56
66
  ...(order.items != null
57
67
  ? {
58
68
  items: getWarehouseInternalMovementItemsWithPrice(order.items, convertToPrice),
@@ -75,6 +85,29 @@ export function calculateCartInternalMovementInfoAndSyncData(data) {
75
85
  let grand_total = subtotal;
76
86
  let gst_amount = 0;
77
87
  const gst = data.gst ?? 0;
88
+ // Order-level charges (labor, freight): entered per movement, either a fixed
89
+ // amount or a percentage of the items subtotal. `is_*_charges_taxable`
90
+ // (snapshot of the warehouse setting) decides the placement: taxable => added
91
+ // BEFORE GST, untaxed => added after it.
92
+ const getOrderCharge = (value, isPercentage) => {
93
+ const entered = parseNum(Math.max(0, value ?? 0));
94
+ return {
95
+ entered,
96
+ amount: isPercentage ? parseNum(getPercentageAmount(subtotal, entered)) : entered,
97
+ };
98
+ };
99
+ const labor = getOrderCharge(data.labor_charges, data.is_labor_charges_percentage);
100
+ const freight = getOrderCharge(data.freight_charges, data.is_freight_charges_percentage);
101
+ const labor_charges = labor.entered;
102
+ const labor_charges_amount = labor.amount;
103
+ const freight_charges = freight.entered;
104
+ const freight_charges_amount = freight.amount;
105
+ const isLaborTaxable = data.is_labor_charges_taxable === true;
106
+ const isFreightTaxable = data.is_freight_charges_taxable === true;
107
+ const taxableCharges = (isLaborTaxable ? labor_charges_amount : 0) + (isFreightTaxable ? freight_charges_amount : 0);
108
+ if (taxableCharges > 0) {
109
+ grand_total += taxableCharges;
110
+ }
78
111
  if (gst > 0 && data.is_gst_inclusive) {
79
112
  gst_amount = parseFloatCeil((grand_total * gst) / (100 + gst));
80
113
  }
@@ -82,6 +115,10 @@ export function calculateCartInternalMovementInfoAndSyncData(data) {
82
115
  gst_amount = getPercentageAmount(grand_total, gst);
83
116
  grand_total += gst_amount;
84
117
  }
118
+ const untaxedCharges = (isLaborTaxable ? 0 : labor_charges_amount) + (isFreightTaxable ? 0 : freight_charges_amount);
119
+ if (untaxedCharges > 0) {
120
+ grand_total += untaxedCharges;
121
+ }
85
122
  const { cardCharges, amountCollected } = getCardChargesAndAmountCollected(data.payments);
86
123
  grand_total += cardCharges;
87
124
  grand_total = parseNum(grand_total);
@@ -89,6 +126,10 @@ export function calculateCartInternalMovementInfoAndSyncData(data) {
89
126
  ...data,
90
127
  grand_total,
91
128
  gst_amount,
129
+ labor_charges,
130
+ labor_charges_amount,
131
+ freight_charges,
132
+ freight_charges_amount,
92
133
  amount_collected: parseNum(amountCollected),
93
134
  amount_earned: parseNum(grand_total - cardCharges),
94
135
  };
@@ -285,11 +285,10 @@ export const CUSTOMER_COLLECTION_INDEXES = {
285
285
  * and missing fields like any other value; the `$gt: ''` filter keeps those
286
286
  * documents out of the index entirely.
287
287
  *
288
- * Use these definitions whenever the indexes are created (services, migrations,
289
- * maintenance scripts) instead of re-deriving the options, so every environment
290
- * ends up with the same constraint. The legacy non-unique index on the same key
291
- * pattern must be dropped first; MongoDB rejects a second index with the same
292
- * keys and different options.
288
+ * Use these definitions as the source of truth for the indexes that must exist
289
+ * in Atlas. Creating and maintaining them is an ops/deployment concern —
290
+ * application code only hints the existing indexes (CUSTOMER_COLLECTION_INDEXES)
291
+ * and must never create or drop them.
293
292
  */
294
293
  export const CUSTOMER_COLLECTION_UNIQUE_INDEXES = {
295
294
  brand_id__phone_number: {
@@ -465,6 +465,14 @@ export const TenantSchema = new Schema({
465
465
  enum: ALL_GST_TYPES,
466
466
  required: false,
467
467
  },
468
+ is_im_labor_charges_taxable: {
469
+ type: Boolean,
470
+ default: false,
471
+ },
472
+ is_im_freight_charges_taxable: {
473
+ type: Boolean,
474
+ default: false,
475
+ },
468
476
  po_card_gst: {
469
477
  type: Number,
470
478
  required: false,
@@ -120,6 +120,14 @@ export const WarehouseInternalMovementIterationSchema = new Schema({
120
120
  min: 0,
121
121
  required: false,
122
122
  },
123
+ labor_charges: { type: Number, min: 0, required: false },
124
+ labor_charges_amount: { type: Number, min: 0, required: false },
125
+ is_labor_charges_percentage: { type: Boolean, required: false },
126
+ is_labor_charges_taxable: { type: Boolean, required: false },
127
+ freight_charges: { type: Number, min: 0, required: false },
128
+ freight_charges_amount: { type: Number, min: 0, required: false },
129
+ is_freight_charges_percentage: { type: Boolean, required: false },
130
+ is_freight_charges_taxable: { type: Boolean, required: false },
123
131
  notes: {
124
132
  type: String,
125
133
  required: false,
@@ -258,6 +266,14 @@ export const WarehouseInternalMovementsSchema = new Schema({
258
266
  min: 0,
259
267
  required: false,
260
268
  },
269
+ labor_charges: { type: Number, min: 0, required: false },
270
+ labor_charges_amount: { type: Number, min: 0, required: false },
271
+ is_labor_charges_percentage: { type: Boolean, required: false },
272
+ is_labor_charges_taxable: { type: Boolean, required: false },
273
+ freight_charges: { type: Number, min: 0, required: false },
274
+ freight_charges_amount: { type: Number, min: 0, required: false },
275
+ is_freight_charges_percentage: { type: Boolean, required: false },
276
+ is_freight_charges_taxable: { type: Boolean, required: false },
261
277
  parent_movement_id: {
262
278
  type: Schema.Types.ObjectId,
263
279
  required: false, // ID of another warehouse internal movement that this movement is a child of (e.g., a dispatched movement may have a parent requested movement)
@@ -130,6 +130,14 @@ export const WarehouseSchema = new Schema({
130
130
  type: Number,
131
131
  default: 0,
132
132
  },
133
+ is_im_labor_charges_taxable: {
134
+ type: Boolean,
135
+ default: false,
136
+ },
137
+ is_im_freight_charges_taxable: {
138
+ type: Boolean,
139
+ default: false,
140
+ },
133
141
  im_cash_gst: {
134
142
  type: Number,
135
143
  default: 0,
@@ -24,6 +24,14 @@ function generateWarehouseInternalMovementIteration(movement, partial = true) {
24
24
  is_gst_inclusive: movement.is_gst_inclusive,
25
25
  gst: movement.gst,
26
26
  gst_amount: movement.gst_amount,
27
+ labor_charges: movement.labor_charges,
28
+ labor_charges_amount: movement.labor_charges_amount,
29
+ is_labor_charges_percentage: movement.is_labor_charges_percentage,
30
+ is_labor_charges_taxable: movement.is_labor_charges_taxable,
31
+ freight_charges: movement.freight_charges,
32
+ freight_charges_amount: movement.freight_charges_amount,
33
+ is_freight_charges_percentage: movement.is_freight_charges_percentage,
34
+ is_freight_charges_taxable: movement.is_freight_charges_taxable,
27
35
  notes: movement.notes,
28
36
  status: movement.status,
29
37
  updatedAt: movement.updatedAt,
@@ -59,6 +59,16 @@ function getWarehouseInternalMovementWithPrice(order, writeable) {
59
59
  ...(order.amount_collected != null ? { amount_collected: convertToPrice(order.amount_collected) } : {}),
60
60
  ...(order.amount_earned != null ? { amount_earned: convertToPrice(order.amount_earned) } : {}),
61
61
  ...(order.gst != null ? { gst: convertToPrice(order.gst) } : {}),
62
+ ...(order.labor_charges != null && order.is_labor_charges_percentage !== true
63
+ ? { labor_charges: convertToPrice(order.labor_charges) }
64
+ : {}),
65
+ ...(order.labor_charges_amount != null ? { labor_charges_amount: convertToPrice(order.labor_charges_amount) } : {}),
66
+ ...(order.freight_charges != null && order.is_freight_charges_percentage !== true
67
+ ? { freight_charges: convertToPrice(order.freight_charges) }
68
+ : {}),
69
+ ...(order.freight_charges_amount != null
70
+ ? { freight_charges_amount: convertToPrice(order.freight_charges_amount) }
71
+ : {}),
62
72
  ...(order.items != null
63
73
  ? {
64
74
  items: getWarehouseInternalMovementItemsWithPrice(order.items, convertToPrice),
@@ -81,6 +91,29 @@ function calculateCartInternalMovementInfoAndSyncData(data) {
81
91
  let grand_total = subtotal;
82
92
  let gst_amount = 0;
83
93
  const gst = data.gst ?? 0;
94
+ // Order-level charges (labor, freight): entered per movement, either a fixed
95
+ // amount or a percentage of the items subtotal. `is_*_charges_taxable`
96
+ // (snapshot of the warehouse setting) decides the placement: taxable => added
97
+ // BEFORE GST, untaxed => added after it.
98
+ const getOrderCharge = (value, isPercentage) => {
99
+ const entered = (0, utils_1.parseNum)(Math.max(0, value ?? 0));
100
+ return {
101
+ entered,
102
+ amount: isPercentage ? (0, utils_1.parseNum)((0, utils_1.getPercentageAmount)(subtotal, entered)) : entered,
103
+ };
104
+ };
105
+ const labor = getOrderCharge(data.labor_charges, data.is_labor_charges_percentage);
106
+ const freight = getOrderCharge(data.freight_charges, data.is_freight_charges_percentage);
107
+ const labor_charges = labor.entered;
108
+ const labor_charges_amount = labor.amount;
109
+ const freight_charges = freight.entered;
110
+ const freight_charges_amount = freight.amount;
111
+ const isLaborTaxable = data.is_labor_charges_taxable === true;
112
+ const isFreightTaxable = data.is_freight_charges_taxable === true;
113
+ const taxableCharges = (isLaborTaxable ? labor_charges_amount : 0) + (isFreightTaxable ? freight_charges_amount : 0);
114
+ if (taxableCharges > 0) {
115
+ grand_total += taxableCharges;
116
+ }
84
117
  if (gst > 0 && data.is_gst_inclusive) {
85
118
  gst_amount = (0, utils_1.parseFloatCeil)((grand_total * gst) / (100 + gst));
86
119
  }
@@ -88,6 +121,10 @@ function calculateCartInternalMovementInfoAndSyncData(data) {
88
121
  gst_amount = (0, utils_1.getPercentageAmount)(grand_total, gst);
89
122
  grand_total += gst_amount;
90
123
  }
124
+ const untaxedCharges = (isLaborTaxable ? 0 : labor_charges_amount) + (isFreightTaxable ? 0 : freight_charges_amount);
125
+ if (untaxedCharges > 0) {
126
+ grand_total += untaxedCharges;
127
+ }
91
128
  const { cardCharges, amountCollected } = (0, utils_1.getCardChargesAndAmountCollected)(data.payments);
92
129
  grand_total += cardCharges;
93
130
  grand_total = (0, utils_1.parseNum)(grand_total);
@@ -95,6 +132,10 @@ function calculateCartInternalMovementInfoAndSyncData(data) {
95
132
  ...data,
96
133
  grand_total,
97
134
  gst_amount,
135
+ labor_charges,
136
+ labor_charges_amount,
137
+ freight_charges,
138
+ freight_charges_amount,
98
139
  amount_collected: (0, utils_1.parseNum)(amountCollected),
99
140
  amount_earned: (0, utils_1.parseNum)(grand_total - cardCharges),
100
141
  };
@@ -640,11 +640,10 @@ export declare const CUSTOMER_COLLECTION_INDEXES: {
640
640
  * and missing fields like any other value; the `$gt: ''` filter keeps those
641
641
  * documents out of the index entirely.
642
642
  *
643
- * Use these definitions whenever the indexes are created (services, migrations,
644
- * maintenance scripts) instead of re-deriving the options, so every environment
645
- * ends up with the same constraint. The legacy non-unique index on the same key
646
- * pattern must be dropped first; MongoDB rejects a second index with the same
647
- * keys and different options.
643
+ * Use these definitions as the source of truth for the indexes that must exist
644
+ * in Atlas. Creating and maintaining them is an ops/deployment concern —
645
+ * application code only hints the existing indexes (CUSTOMER_COLLECTION_INDEXES)
646
+ * and must never create or drop them.
648
647
  */
649
648
  export declare const CUSTOMER_COLLECTION_UNIQUE_INDEXES: {
650
649
  brand_id__phone_number: {
@@ -288,11 +288,10 @@ exports.CUSTOMER_COLLECTION_INDEXES = {
288
288
  * and missing fields like any other value; the `$gt: ''` filter keeps those
289
289
  * documents out of the index entirely.
290
290
  *
291
- * Use these definitions whenever the indexes are created (services, migrations,
292
- * maintenance scripts) instead of re-deriving the options, so every environment
293
- * ends up with the same constraint. The legacy non-unique index on the same key
294
- * pattern must be dropped first; MongoDB rejects a second index with the same
295
- * keys and different options.
291
+ * Use these definitions as the source of truth for the indexes that must exist
292
+ * in Atlas. Creating and maintaining them is an ops/deployment concern —
293
+ * application code only hints the existing indexes (CUSTOMER_COLLECTION_INDEXES)
294
+ * and must never create or drop them.
296
295
  */
297
296
  exports.CUSTOMER_COLLECTION_UNIQUE_INDEXES = {
298
297
  brand_id__phone_number: {
@@ -104,6 +104,8 @@ export declare const TenantSchema: Schema<any, import("mongoose").Model<any, any
104
104
  card_gst: number;
105
105
  cash_gst: number;
106
106
  default_gst_type: GST_TYPE_ENUM;
107
+ is_im_labor_charges_taxable: boolean;
108
+ is_im_freight_charges_taxable: boolean;
107
109
  web_cover_image: string;
108
110
  web_favicon: string;
109
111
  web_design_type: ONLINE_ORDERING_DESIGN_TYPE_ENUM;
@@ -288,6 +290,8 @@ export declare const TenantSchema: Schema<any, import("mongoose").Model<any, any
288
290
  card_gst: number;
289
291
  cash_gst: number;
290
292
  default_gst_type: GST_TYPE_ENUM;
293
+ is_im_labor_charges_taxable: boolean;
294
+ is_im_freight_charges_taxable: boolean;
291
295
  web_cover_image: string;
292
296
  web_favicon: string;
293
297
  web_design_type: ONLINE_ORDERING_DESIGN_TYPE_ENUM;
@@ -472,6 +476,8 @@ export declare const TenantSchema: Schema<any, import("mongoose").Model<any, any
472
476
  card_gst: number;
473
477
  cash_gst: number;
474
478
  default_gst_type: GST_TYPE_ENUM;
479
+ is_im_labor_charges_taxable: boolean;
480
+ is_im_freight_charges_taxable: boolean;
475
481
  web_cover_image: string;
476
482
  web_favicon: string;
477
483
  web_design_type: ONLINE_ORDERING_DESIGN_TYPE_ENUM;
@@ -468,6 +468,14 @@ exports.TenantSchema = new mongoose_1.Schema({
468
468
  enum: constants_1.ALL_GST_TYPES,
469
469
  required: false,
470
470
  },
471
+ is_im_labor_charges_taxable: {
472
+ type: Boolean,
473
+ default: false,
474
+ },
475
+ is_im_freight_charges_taxable: {
476
+ type: Boolean,
477
+ default: false,
478
+ },
471
479
  po_card_gst: {
472
480
  type: Number,
473
481
  required: false,
@@ -106,6 +106,14 @@ export declare const WarehouseInternalMovementIterationSchema: Schema<any, impor
106
106
  is_gst_inclusive?: boolean | null | undefined;
107
107
  gst?: number | null | undefined;
108
108
  gst_amount?: number | null | undefined;
109
+ labor_charges?: number | null | undefined;
110
+ labor_charges_amount?: number | null | undefined;
111
+ is_labor_charges_percentage?: boolean | null | undefined;
112
+ is_labor_charges_taxable?: boolean | null | undefined;
113
+ freight_charges?: number | null | undefined;
114
+ freight_charges_amount?: number | null | undefined;
115
+ is_freight_charges_percentage?: boolean | null | undefined;
116
+ is_freight_charges_taxable?: boolean | null | undefined;
109
117
  notes?: string | null | undefined;
110
118
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
111
119
  updatedAt: NativeDate;
@@ -210,6 +218,14 @@ export declare const WarehouseInternalMovementIterationSchema: Schema<any, impor
210
218
  is_gst_inclusive?: boolean | null | undefined;
211
219
  gst?: number | null | undefined;
212
220
  gst_amount?: number | null | undefined;
221
+ labor_charges?: number | null | undefined;
222
+ labor_charges_amount?: number | null | undefined;
223
+ is_labor_charges_percentage?: boolean | null | undefined;
224
+ is_labor_charges_taxable?: boolean | null | undefined;
225
+ freight_charges?: number | null | undefined;
226
+ freight_charges_amount?: number | null | undefined;
227
+ is_freight_charges_percentage?: boolean | null | undefined;
228
+ is_freight_charges_taxable?: boolean | null | undefined;
213
229
  notes?: string | null | undefined;
214
230
  }>> & import("mongoose").FlatRecord<{
215
231
  updatedAt: NativeDate;
@@ -314,6 +330,14 @@ export declare const WarehouseInternalMovementIterationSchema: Schema<any, impor
314
330
  is_gst_inclusive?: boolean | null | undefined;
315
331
  gst?: number | null | undefined;
316
332
  gst_amount?: number | null | undefined;
333
+ labor_charges?: number | null | undefined;
334
+ labor_charges_amount?: number | null | undefined;
335
+ is_labor_charges_percentage?: boolean | null | undefined;
336
+ is_labor_charges_taxable?: boolean | null | undefined;
337
+ freight_charges?: number | null | undefined;
338
+ freight_charges_amount?: number | null | undefined;
339
+ is_freight_charges_percentage?: boolean | null | undefined;
340
+ is_freight_charges_taxable?: boolean | null | undefined;
317
341
  notes?: string | null | undefined;
318
342
  }> & {
319
343
  _id: import("mongoose").Types.ObjectId;
@@ -468,6 +492,14 @@ export declare const WarehouseInternalMovementsSchema: Schema<any, import("mongo
468
492
  is_gst_inclusive?: boolean | null | undefined;
469
493
  gst?: number | null | undefined;
470
494
  gst_amount?: number | null | undefined;
495
+ labor_charges?: number | null | undefined;
496
+ labor_charges_amount?: number | null | undefined;
497
+ is_labor_charges_percentage?: boolean | null | undefined;
498
+ is_labor_charges_taxable?: boolean | null | undefined;
499
+ freight_charges?: number | null | undefined;
500
+ freight_charges_amount?: number | null | undefined;
501
+ is_freight_charges_percentage?: boolean | null | undefined;
502
+ is_freight_charges_taxable?: boolean | null | undefined;
471
503
  notes?: string | null | undefined;
472
504
  }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
473
505
  updatedAt: NativeDate;
@@ -572,6 +604,14 @@ export declare const WarehouseInternalMovementsSchema: Schema<any, import("mongo
572
604
  is_gst_inclusive?: boolean | null | undefined;
573
605
  gst?: number | null | undefined;
574
606
  gst_amount?: number | null | undefined;
607
+ labor_charges?: number | null | undefined;
608
+ labor_charges_amount?: number | null | undefined;
609
+ is_labor_charges_percentage?: boolean | null | undefined;
610
+ is_labor_charges_taxable?: boolean | null | undefined;
611
+ freight_charges?: number | null | undefined;
612
+ freight_charges_amount?: number | null | undefined;
613
+ is_freight_charges_percentage?: boolean | null | undefined;
614
+ is_freight_charges_taxable?: boolean | null | undefined;
575
615
  notes?: string | null | undefined;
576
616
  }> & {
577
617
  updatedAt: NativeDate;
@@ -676,6 +716,14 @@ export declare const WarehouseInternalMovementsSchema: Schema<any, import("mongo
676
716
  is_gst_inclusive?: boolean | null | undefined;
677
717
  gst?: number | null | undefined;
678
718
  gst_amount?: number | null | undefined;
719
+ labor_charges?: number | null | undefined;
720
+ labor_charges_amount?: number | null | undefined;
721
+ is_labor_charges_percentage?: boolean | null | undefined;
722
+ is_labor_charges_taxable?: boolean | null | undefined;
723
+ freight_charges?: number | null | undefined;
724
+ freight_charges_amount?: number | null | undefined;
725
+ is_freight_charges_percentage?: boolean | null | undefined;
726
+ is_freight_charges_taxable?: boolean | null | undefined;
679
727
  notes?: string | null | undefined;
680
728
  }>;
681
729
  payments: import("mongoose").Types.DocumentArray<{
@@ -763,6 +811,14 @@ export declare const WarehouseInternalMovementsSchema: Schema<any, import("mongo
763
811
  is_gst_inclusive?: boolean | null | undefined;
764
812
  gst?: number | null | undefined;
765
813
  gst_amount?: number | null | undefined;
814
+ labor_charges?: number | null | undefined;
815
+ labor_charges_amount?: number | null | undefined;
816
+ is_labor_charges_percentage?: boolean | null | undefined;
817
+ is_labor_charges_taxable?: boolean | null | undefined;
818
+ freight_charges?: number | null | undefined;
819
+ freight_charges_amount?: number | null | undefined;
820
+ is_freight_charges_percentage?: boolean | null | undefined;
821
+ is_freight_charges_taxable?: boolean | null | undefined;
766
822
  notes?: string | null | undefined;
767
823
  approved_by?: {
768
824
  name: string;
@@ -969,6 +1025,14 @@ export declare const WarehouseInternalMovementsSchema: Schema<any, import("mongo
969
1025
  is_gst_inclusive?: boolean | null | undefined;
970
1026
  gst?: number | null | undefined;
971
1027
  gst_amount?: number | null | undefined;
1028
+ labor_charges?: number | null | undefined;
1029
+ labor_charges_amount?: number | null | undefined;
1030
+ is_labor_charges_percentage?: boolean | null | undefined;
1031
+ is_labor_charges_taxable?: boolean | null | undefined;
1032
+ freight_charges?: number | null | undefined;
1033
+ freight_charges_amount?: number | null | undefined;
1034
+ is_freight_charges_percentage?: boolean | null | undefined;
1035
+ is_freight_charges_taxable?: boolean | null | undefined;
972
1036
  notes?: string | null | undefined;
973
1037
  }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
974
1038
  updatedAt: NativeDate;
@@ -1073,6 +1137,14 @@ export declare const WarehouseInternalMovementsSchema: Schema<any, import("mongo
1073
1137
  is_gst_inclusive?: boolean | null | undefined;
1074
1138
  gst?: number | null | undefined;
1075
1139
  gst_amount?: number | null | undefined;
1140
+ labor_charges?: number | null | undefined;
1141
+ labor_charges_amount?: number | null | undefined;
1142
+ is_labor_charges_percentage?: boolean | null | undefined;
1143
+ is_labor_charges_taxable?: boolean | null | undefined;
1144
+ freight_charges?: number | null | undefined;
1145
+ freight_charges_amount?: number | null | undefined;
1146
+ is_freight_charges_percentage?: boolean | null | undefined;
1147
+ is_freight_charges_taxable?: boolean | null | undefined;
1076
1148
  notes?: string | null | undefined;
1077
1149
  }> & {
1078
1150
  updatedAt: NativeDate;
@@ -1177,6 +1249,14 @@ export declare const WarehouseInternalMovementsSchema: Schema<any, import("mongo
1177
1249
  is_gst_inclusive?: boolean | null | undefined;
1178
1250
  gst?: number | null | undefined;
1179
1251
  gst_amount?: number | null | undefined;
1252
+ labor_charges?: number | null | undefined;
1253
+ labor_charges_amount?: number | null | undefined;
1254
+ is_labor_charges_percentage?: boolean | null | undefined;
1255
+ is_labor_charges_taxable?: boolean | null | undefined;
1256
+ freight_charges?: number | null | undefined;
1257
+ freight_charges_amount?: number | null | undefined;
1258
+ is_freight_charges_percentage?: boolean | null | undefined;
1259
+ is_freight_charges_taxable?: boolean | null | undefined;
1180
1260
  notes?: string | null | undefined;
1181
1261
  }>;
1182
1262
  payments: import("mongoose").Types.DocumentArray<{
@@ -1264,6 +1344,14 @@ export declare const WarehouseInternalMovementsSchema: Schema<any, import("mongo
1264
1344
  is_gst_inclusive?: boolean | null | undefined;
1265
1345
  gst?: number | null | undefined;
1266
1346
  gst_amount?: number | null | undefined;
1347
+ labor_charges?: number | null | undefined;
1348
+ labor_charges_amount?: number | null | undefined;
1349
+ is_labor_charges_percentage?: boolean | null | undefined;
1350
+ is_labor_charges_taxable?: boolean | null | undefined;
1351
+ freight_charges?: number | null | undefined;
1352
+ freight_charges_amount?: number | null | undefined;
1353
+ is_freight_charges_percentage?: boolean | null | undefined;
1354
+ is_freight_charges_taxable?: boolean | null | undefined;
1267
1355
  notes?: string | null | undefined;
1268
1356
  approved_by?: {
1269
1357
  name: string;
@@ -1470,6 +1558,14 @@ export declare const WarehouseInternalMovementsSchema: Schema<any, import("mongo
1470
1558
  is_gst_inclusive?: boolean | null | undefined;
1471
1559
  gst?: number | null | undefined;
1472
1560
  gst_amount?: number | null | undefined;
1561
+ labor_charges?: number | null | undefined;
1562
+ labor_charges_amount?: number | null | undefined;
1563
+ is_labor_charges_percentage?: boolean | null | undefined;
1564
+ is_labor_charges_taxable?: boolean | null | undefined;
1565
+ freight_charges?: number | null | undefined;
1566
+ freight_charges_amount?: number | null | undefined;
1567
+ is_freight_charges_percentage?: boolean | null | undefined;
1568
+ is_freight_charges_taxable?: boolean | null | undefined;
1473
1569
  notes?: string | null | undefined;
1474
1570
  }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
1475
1571
  updatedAt: NativeDate;
@@ -1574,6 +1670,14 @@ export declare const WarehouseInternalMovementsSchema: Schema<any, import("mongo
1574
1670
  is_gst_inclusive?: boolean | null | undefined;
1575
1671
  gst?: number | null | undefined;
1576
1672
  gst_amount?: number | null | undefined;
1673
+ labor_charges?: number | null | undefined;
1674
+ labor_charges_amount?: number | null | undefined;
1675
+ is_labor_charges_percentage?: boolean | null | undefined;
1676
+ is_labor_charges_taxable?: boolean | null | undefined;
1677
+ freight_charges?: number | null | undefined;
1678
+ freight_charges_amount?: number | null | undefined;
1679
+ is_freight_charges_percentage?: boolean | null | undefined;
1680
+ is_freight_charges_taxable?: boolean | null | undefined;
1577
1681
  notes?: string | null | undefined;
1578
1682
  }> & {
1579
1683
  updatedAt: NativeDate;
@@ -1678,6 +1782,14 @@ export declare const WarehouseInternalMovementsSchema: Schema<any, import("mongo
1678
1782
  is_gst_inclusive?: boolean | null | undefined;
1679
1783
  gst?: number | null | undefined;
1680
1784
  gst_amount?: number | null | undefined;
1785
+ labor_charges?: number | null | undefined;
1786
+ labor_charges_amount?: number | null | undefined;
1787
+ is_labor_charges_percentage?: boolean | null | undefined;
1788
+ is_labor_charges_taxable?: boolean | null | undefined;
1789
+ freight_charges?: number | null | undefined;
1790
+ freight_charges_amount?: number | null | undefined;
1791
+ is_freight_charges_percentage?: boolean | null | undefined;
1792
+ is_freight_charges_taxable?: boolean | null | undefined;
1681
1793
  notes?: string | null | undefined;
1682
1794
  }>;
1683
1795
  payments: import("mongoose").Types.DocumentArray<{
@@ -1765,6 +1877,14 @@ export declare const WarehouseInternalMovementsSchema: Schema<any, import("mongo
1765
1877
  is_gst_inclusive?: boolean | null | undefined;
1766
1878
  gst?: number | null | undefined;
1767
1879
  gst_amount?: number | null | undefined;
1880
+ labor_charges?: number | null | undefined;
1881
+ labor_charges_amount?: number | null | undefined;
1882
+ is_labor_charges_percentage?: boolean | null | undefined;
1883
+ is_labor_charges_taxable?: boolean | null | undefined;
1884
+ freight_charges?: number | null | undefined;
1885
+ freight_charges_amount?: number | null | undefined;
1886
+ is_freight_charges_percentage?: boolean | null | undefined;
1887
+ is_freight_charges_taxable?: boolean | null | undefined;
1768
1888
  notes?: string | null | undefined;
1769
1889
  approved_by?: {
1770
1890
  name: string;
@@ -123,6 +123,14 @@ exports.WarehouseInternalMovementIterationSchema = new mongoose_1.Schema({
123
123
  min: 0,
124
124
  required: false,
125
125
  },
126
+ labor_charges: { type: Number, min: 0, required: false },
127
+ labor_charges_amount: { type: Number, min: 0, required: false },
128
+ is_labor_charges_percentage: { type: Boolean, required: false },
129
+ is_labor_charges_taxable: { type: Boolean, required: false },
130
+ freight_charges: { type: Number, min: 0, required: false },
131
+ freight_charges_amount: { type: Number, min: 0, required: false },
132
+ is_freight_charges_percentage: { type: Boolean, required: false },
133
+ is_freight_charges_taxable: { type: Boolean, required: false },
126
134
  notes: {
127
135
  type: String,
128
136
  required: false,
@@ -261,6 +269,14 @@ exports.WarehouseInternalMovementsSchema = new mongoose_1.Schema({
261
269
  min: 0,
262
270
  required: false,
263
271
  },
272
+ labor_charges: { type: Number, min: 0, required: false },
273
+ labor_charges_amount: { type: Number, min: 0, required: false },
274
+ is_labor_charges_percentage: { type: Boolean, required: false },
275
+ is_labor_charges_taxable: { type: Boolean, required: false },
276
+ freight_charges: { type: Number, min: 0, required: false },
277
+ freight_charges_amount: { type: Number, min: 0, required: false },
278
+ is_freight_charges_percentage: { type: Boolean, required: false },
279
+ is_freight_charges_taxable: { type: Boolean, required: false },
264
280
  parent_movement_id: {
265
281
  type: mongoose_1.Schema.Types.ObjectId,
266
282
  required: false, // ID of another warehouse internal movement that this movement is a child of (e.g., a dispatched movement may have a parent requested movement)
@@ -35,6 +35,8 @@ export declare const WarehouseSchema: Schema<any, import("mongoose").Model<any,
35
35
  im_card_gst: number;
36
36
  im_cash_gst: number;
37
37
  default_im_gst_type: GST_TYPE_ENUM;
38
+ is_im_labor_charges_taxable: boolean;
39
+ is_im_freight_charges_taxable: boolean;
38
40
  po_card_gst: number;
39
41
  po_cash_gst: number;
40
42
  default_po_gst_type: GST_TYPE_ENUM;
@@ -91,6 +93,8 @@ export declare const WarehouseSchema: Schema<any, import("mongoose").Model<any,
91
93
  im_card_gst: number;
92
94
  im_cash_gst: number;
93
95
  default_im_gst_type: GST_TYPE_ENUM;
96
+ is_im_labor_charges_taxable: boolean;
97
+ is_im_freight_charges_taxable: boolean;
94
98
  po_card_gst: number;
95
99
  po_cash_gst: number;
96
100
  default_po_gst_type: GST_TYPE_ENUM;
@@ -147,6 +151,8 @@ export declare const WarehouseSchema: Schema<any, import("mongoose").Model<any,
147
151
  im_card_gst: number;
148
152
  im_cash_gst: number;
149
153
  default_im_gst_type: GST_TYPE_ENUM;
154
+ is_im_labor_charges_taxable: boolean;
155
+ is_im_freight_charges_taxable: boolean;
150
156
  po_card_gst: number;
151
157
  po_cash_gst: number;
152
158
  default_po_gst_type: GST_TYPE_ENUM;
@@ -133,6 +133,14 @@ exports.WarehouseSchema = new mongoose_1.Schema({
133
133
  type: Number,
134
134
  default: 0,
135
135
  },
136
+ is_im_labor_charges_taxable: {
137
+ type: Boolean,
138
+ default: false,
139
+ },
140
+ is_im_freight_charges_taxable: {
141
+ type: Boolean,
142
+ default: false,
143
+ },
136
144
  im_cash_gst: {
137
145
  type: Number,
138
146
  default: 0,
@@ -108,6 +108,8 @@ export interface ITenant {
108
108
  im_card_gst?: number;
109
109
  im_cash_gst?: number;
110
110
  default_im_gst_type?: GST_TYPE_ENUM;
111
+ is_im_labor_charges_taxable?: boolean;
112
+ is_im_freight_charges_taxable?: boolean;
111
113
  po_card_gst?: number;
112
114
  po_cash_gst?: number;
113
115
  default_po_gst_type?: GST_TYPE_ENUM;
@@ -59,6 +59,14 @@ export interface IWarehouseInternalMovementIteration {
59
59
  is_gst_inclusive?: boolean;
60
60
  gst?: number | null;
61
61
  gst_amount?: number | null;
62
+ labor_charges?: number;
63
+ labor_charges_amount?: number;
64
+ is_labor_charges_percentage?: boolean;
65
+ is_labor_charges_taxable?: boolean;
66
+ freight_charges?: number;
67
+ freight_charges_amount?: number;
68
+ is_freight_charges_percentage?: boolean;
69
+ is_freight_charges_taxable?: boolean;
62
70
  notes?: string | null;
63
71
  status: WAREHOUSE_INTERNAL_MOVEMENT_STATUS_ENUM;
64
72
  updatedAt: Date;
@@ -30,6 +30,8 @@ export interface IWarehouse {
30
30
  im_card_gst: number;
31
31
  im_cash_gst: number;
32
32
  default_im_gst_type: GST_TYPE_ENUM;
33
+ is_im_labor_charges_taxable?: boolean;
34
+ is_im_freight_charges_taxable?: boolean;
33
35
  tax_business_number: string;
34
36
  tax_invoice_provider?: TAX_INVOICE_PROVIDER_ENUM;
35
37
  tax_invoice_generation_id?: string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managesome/eposmatic-toolkit",
3
- "version": "0.4.85",
3
+ "version": "0.4.86",
4
4
  "description": "A Toolkit Library for Eposmatic",
5
5
  "main": "lib/index.js",
6
6
  "module": "esm/index.js",