@managesome/eposmatic-toolkit 0.4.89 → 0.4.90

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 (34) hide show
  1. package/esm/helpers/order/generate-warehouse-internal-movement.js +3 -0
  2. package/esm/helpers/store/common-warehouse-internal-movement-actions.js +124 -4
  3. package/esm/helpers/utils/discount-amounts.js +64 -0
  4. package/esm/helpers/utils/index.js +2 -0
  5. package/esm/helpers/utils/internal-movement-items.js +30 -0
  6. package/esm/helpers/utils/tenant-purchase-order-engine.js +10 -18
  7. package/esm/helpers/utils/warehouse-purchase-order-engine.js +10 -18
  8. package/esm/schemas/models/warehouse_internal_movements.js +54 -0
  9. package/lib/helpers/order/generate-warehouse-internal-movement.js +3 -0
  10. package/lib/helpers/store/common-warehouse-internal-movement-actions.d.ts +33 -1
  11. package/lib/helpers/store/common-warehouse-internal-movement-actions.js +126 -3
  12. package/lib/helpers/utils/discount-amounts.d.ts +50 -0
  13. package/lib/helpers/utils/discount-amounts.js +69 -0
  14. package/lib/helpers/utils/index.d.ts +2 -0
  15. package/lib/helpers/utils/index.js +2 -0
  16. package/lib/helpers/utils/internal-movement-items.d.ts +35 -0
  17. package/lib/helpers/utils/internal-movement-items.js +36 -0
  18. package/lib/helpers/utils/tenant-purchase-order-engine.js +9 -17
  19. package/lib/helpers/utils/warehouse-purchase-order-engine.js +9 -17
  20. package/lib/schemas/models/inventories.d.ts +3 -3
  21. package/lib/schemas/models/inventory_transactions.d.ts +3 -3
  22. package/lib/schemas/models/item_transactions.d.ts +3 -3
  23. package/lib/schemas/models/materialized_tenant_discount_entries.d.ts +3 -3
  24. package/lib/schemas/models/materialized_tenant_prep_time_entries.d.ts +3 -3
  25. package/lib/schemas/models/orders.d.ts +120 -120
  26. package/lib/schemas/models/tenant_inventory_department_transactions.d.ts +3 -3
  27. package/lib/schemas/models/tenant_inventory_department_utilities.d.ts +3 -3
  28. package/lib/schemas/models/warehouse_internal_movements.d.ts +570 -0
  29. package/lib/schemas/models/warehouse_internal_movements.js +54 -0
  30. package/lib/schemas/models/warehouse_inventory_transactions.d.ts +3 -3
  31. package/lib/schemas/models/warehouse_item_transactions.d.ts +3 -3
  32. package/lib/schemas/models/warehouse_items.d.ts +3 -3
  33. package/lib/schemas/types/warehouse_internal_movements.d.ts +17 -1
  34. package/package.json +1 -1
@@ -19,6 +19,30 @@ const WarehouseInternalMovementActorSchema = new mongoose_1.Schema({
19
19
  _id: false,
20
20
  minimize: false,
21
21
  });
22
+ const WarehouseInternalMovementDiscountDetailsSchema = new mongoose_1.Schema({
23
+ special_discount: {
24
+ type: Number,
25
+ },
26
+ special_discount_id: {
27
+ type: String,
28
+ },
29
+ special_discount_name: {
30
+ type: String,
31
+ },
32
+ is_special_discount_percentage: {
33
+ type: Boolean,
34
+ },
35
+ special_discount_reason: {
36
+ type: String,
37
+ },
38
+ special_reference_number: {
39
+ type: String,
40
+ },
41
+ total_discount: {
42
+ type: Number,
43
+ required: true,
44
+ },
45
+ }, { _id: false, minimize: false });
22
46
  const WarehouseInternalMovementItemSchema = new mongoose_1.Schema({
23
47
  _id: {
24
48
  type: mongoose_1.Schema.Types.ObjectId,
@@ -60,6 +84,10 @@ const WarehouseInternalMovementItemSchema = new mongoose_1.Schema({
60
84
  min: 0,
61
85
  required: false,
62
86
  },
87
+ item_discount_details: {
88
+ type: WarehouseInternalMovementDiscountDetailsSchema,
89
+ default: null,
90
+ },
63
91
  notes: {
64
92
  type: String,
65
93
  required: false,
@@ -123,6 +151,19 @@ exports.WarehouseInternalMovementIterationSchema = new mongoose_1.Schema({
123
151
  min: 0,
124
152
  required: false,
125
153
  },
154
+ order_discount_details: {
155
+ type: WarehouseInternalMovementDiscountDetailsSchema,
156
+ required: false,
157
+ },
158
+ total_discount_applied: {
159
+ type: Number,
160
+ min: 0,
161
+ required: false,
162
+ },
163
+ exclude_discount_from_gst: {
164
+ type: Boolean,
165
+ required: false,
166
+ },
126
167
  labor_charges: { type: Number, min: 0, required: false },
127
168
  labor_charges_amount: { type: Number, min: 0, required: false },
128
169
  is_labor_charges_percentage: { type: Boolean, required: false },
@@ -269,6 +310,19 @@ exports.WarehouseInternalMovementsSchema = new mongoose_1.Schema({
269
310
  min: 0,
270
311
  required: false,
271
312
  },
313
+ order_discount_details: {
314
+ type: WarehouseInternalMovementDiscountDetailsSchema,
315
+ required: false,
316
+ },
317
+ total_discount_applied: {
318
+ type: Number,
319
+ min: 0,
320
+ required: false,
321
+ },
322
+ exclude_discount_from_gst: {
323
+ type: Boolean,
324
+ required: false,
325
+ },
272
326
  labor_charges: { type: Number, min: 0, required: false },
273
327
  labor_charges_amount: { type: Number, min: 0, required: false },
274
328
  is_labor_charges_percentage: { type: Boolean, required: false },
@@ -13,8 +13,8 @@ export declare const WarehouseInventoryTransactionsSchema: Schema<any, import("m
13
13
  inventory_code: string;
14
14
  createdAt_mins: number;
15
15
  warehouse_id: string;
16
- quantity_left: number;
17
16
  unit_price: number;
17
+ quantity_left: number;
18
18
  remaining_stock_price: number;
19
19
  previous_quantity_left: number;
20
20
  previous_unit_price: number;
@@ -38,8 +38,8 @@ export declare const WarehouseInventoryTransactionsSchema: Schema<any, import("m
38
38
  inventory_code: string;
39
39
  createdAt_mins: number;
40
40
  warehouse_id: string;
41
- quantity_left: number;
42
41
  unit_price: number;
42
+ quantity_left: number;
43
43
  remaining_stock_price: number;
44
44
  previous_quantity_left: number;
45
45
  previous_unit_price: number;
@@ -63,8 +63,8 @@ export declare const WarehouseInventoryTransactionsSchema: Schema<any, import("m
63
63
  inventory_code: string;
64
64
  createdAt_mins: number;
65
65
  warehouse_id: string;
66
- quantity_left: number;
67
66
  unit_price: number;
67
+ quantity_left: number;
68
68
  remaining_stock_price: number;
69
69
  previous_quantity_left: number;
70
70
  previous_unit_price: number;
@@ -17,9 +17,9 @@ export declare const WarehouseItemTransactionsSchema: Schema<any, import("mongoo
17
17
  warehouse_id: string;
18
18
  item_id: import("mongoose").Types.ObjectId;
19
19
  quantity: number;
20
+ item_name: string;
20
21
  transaction_type: import("../../constants").ITEM_TRANSACTION_TYPE_ENUM;
21
22
  selling_price: number;
22
- item_name: string;
23
23
  category_name: string;
24
24
  cost_price: number;
25
25
  description?: string | null | undefined;
@@ -38,9 +38,9 @@ export declare const WarehouseItemTransactionsSchema: Schema<any, import("mongoo
38
38
  warehouse_id: string;
39
39
  item_id: import("mongoose").Types.ObjectId;
40
40
  quantity: number;
41
+ item_name: string;
41
42
  transaction_type: import("../../constants").ITEM_TRANSACTION_TYPE_ENUM;
42
43
  selling_price: number;
43
- item_name: string;
44
44
  category_name: string;
45
45
  cost_price: number;
46
46
  description?: string | null | undefined;
@@ -59,9 +59,9 @@ export declare const WarehouseItemTransactionsSchema: Schema<any, import("mongoo
59
59
  warehouse_id: string;
60
60
  item_id: import("mongoose").Types.ObjectId;
61
61
  quantity: number;
62
+ item_name: string;
62
63
  transaction_type: import("../../constants").ITEM_TRANSACTION_TYPE_ENUM;
63
64
  selling_price: number;
64
- item_name: string;
65
65
  category_name: string;
66
66
  cost_price: number;
67
67
  description?: string | null | undefined;
@@ -35,10 +35,10 @@ export declare const WarehouseItemSchema: Schema<any, import("mongoose").Model<a
35
35
  hide_name: boolean;
36
36
  keywords: string[];
37
37
  warehouse_id: string;
38
+ unit_price: number;
38
39
  unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
39
40
  threshold_quantity: number;
40
41
  quantity_left: number;
41
- unit_price: number;
42
42
  remaining_stock_price: number;
43
43
  purchase_price: {
44
44
  BASE_PRICE: number;
@@ -84,10 +84,10 @@ export declare const WarehouseItemSchema: Schema<any, import("mongoose").Model<a
84
84
  hide_name: boolean;
85
85
  keywords: string[];
86
86
  warehouse_id: string;
87
+ unit_price: number;
87
88
  unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
88
89
  threshold_quantity: number;
89
90
  quantity_left: number;
90
- unit_price: number;
91
91
  remaining_stock_price: number;
92
92
  purchase_price: {
93
93
  BASE_PRICE: number;
@@ -133,10 +133,10 @@ export declare const WarehouseItemSchema: Schema<any, import("mongoose").Model<a
133
133
  hide_name: boolean;
134
134
  keywords: string[];
135
135
  warehouse_id: string;
136
+ unit_price: number;
136
137
  unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
137
138
  threshold_quantity: number;
138
139
  quantity_left: number;
139
- unit_price: number;
140
140
  remaining_stock_price: number;
141
141
  purchase_price: {
142
142
  BASE_PRICE: number;
@@ -1,9 +1,21 @@
1
1
  import { WAREHOUSE_INTERNAL_MOVEMENT_EDIT_REQUEST_STATUS_ENUM, WAREHOUSE_INTERNAL_MOVEMENT_FLOW_ENUM, WAREHOUSE_INTERNAL_MOVEMENT_LOCATION_TYPE_ENUM, WAREHOUSE_INTERNAL_MOVEMENT_RECORD_TYPE_ENUM, WAREHOUSE_INTERNAL_MOVEMENT_STATUS_ENUM, WAREHOUSE_REF_TYPE_ENUM } from '../../constants';
2
- import { IOrderPayment } from './orders';
2
+ import { IDiscountDetails, IOrderPayment } from './orders';
3
3
  export interface IWarehouseInternalMovementActorRef {
4
4
  uid: string;
5
5
  name: string;
6
6
  }
7
+ /**
8
+ * Order-level discount on an internal movement.
9
+ */
10
+ export interface IWarehouseInternalMovementDiscountDetails {
11
+ special_discount?: number;
12
+ special_discount_id?: string;
13
+ special_discount_name?: string;
14
+ is_special_discount_percentage?: boolean;
15
+ special_discount_reason?: string;
16
+ special_reference_number?: string;
17
+ total_discount: number;
18
+ }
7
19
  export interface IWarehouseInternalMovementItem {
8
20
  _id: string;
9
21
  item_id: string;
@@ -13,6 +25,7 @@ export interface IWarehouseInternalMovementItem {
13
25
  dispatched_qty?: number | null;
14
26
  received_qty: number;
15
27
  unit_price?: number;
28
+ item_discount_details?: IDiscountDetails | null;
16
29
  notes?: string | null;
17
30
  }
18
31
  export interface IWarehouseInternalMovementStatusMeta {
@@ -59,6 +72,9 @@ export interface IWarehouseInternalMovementIteration {
59
72
  is_gst_inclusive?: boolean;
60
73
  gst?: number | null;
61
74
  gst_amount?: number | null;
75
+ order_discount_details?: IWarehouseInternalMovementDiscountDetails | null;
76
+ total_discount_applied?: number;
77
+ exclude_discount_from_gst?: boolean;
62
78
  labor_charges?: number;
63
79
  labor_charges_amount?: number;
64
80
  is_labor_charges_percentage?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managesome/eposmatic-toolkit",
3
- "version": "0.4.89",
3
+ "version": "0.4.90",
4
4
  "description": "A Toolkit Library for Eposmatic",
5
5
  "main": "lib/index.js",
6
6
  "module": "esm/index.js",