@managesome/eposmatic-toolkit 0.2.252 → 0.2.253

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.
@@ -1,6 +1,8 @@
1
1
  import { CURRENCY_SYMBOL_ENUM } from '../../constants';
2
2
  export interface IVoidItemsReportRow {
3
3
  platform?: string;
4
+ vendor_name?: string;
5
+ client_name?: string;
4
6
  order_number: number | null;
5
7
  quantity: number;
6
8
  subtotal: number;
@@ -11,6 +11,14 @@ const common_1 = require("./common");
11
11
  // Generate HTML template for void items report
12
12
  function getVoidItemsReportHtml(props) {
13
13
  const { data, tenantName, from, to, width = 800, monochrome = false, currency_symbol } = props;
14
+ const hasVendorName = data.some((item) => typeof item.vendor_name === 'string' && item.vendor_name.trim().length > 0);
15
+ const hasClientName = data.some((item) => typeof item.client_name === 'string' && item.client_name.trim().length > 0);
16
+ const hasPartyNameColumn = hasVendorName || hasClientName;
17
+ const partyNameColumnTitle = hasVendorName && !hasClientName
18
+ ? 'Vendor Name'
19
+ : hasClientName && !hasVendorName
20
+ ? 'Client Name'
21
+ : 'Vendor/Client Name';
14
22
  const mainStyle = width ? `style="width: ${width}px; max-width: ${width}px"` : '';
15
23
  const fromFormatted = from ? (0, moment_1.default)(from).format('MMM DD, YYYY') : 'N/A';
16
24
  const toFormatted = to ? (0, moment_1.default)(to).format('MMM DD, YYYY') : 'N/A';
@@ -239,7 +247,7 @@ function getVoidItemsReportHtml(props) {
239
247
  if (data.length === 0) {
240
248
  return `
241
249
  <tr>
242
- <td colspan="12" class="no-data">
250
+ <td colspan="${hasPartyNameColumn ? 13 : 12}" class="no-data">
243
251
  No void items data available for the selected period.
244
252
  </td>
245
253
  </tr>
@@ -261,6 +269,7 @@ function getVoidItemsReportHtml(props) {
261
269
  <span class="quantity-removed">${removedQuantity}</span>
262
270
  </td>
263
271
  <td>${item.name || 'N/A'}</td>
272
+ ${hasPartyNameColumn ? `<td>${item.vendor_name || item.client_name || 'N/A'}</td>` : ''}
264
273
  <td class="text-right">${(0, common_1.localeAmount)(currency_symbol, voidAmount)}</td>
265
274
  <td class="void-reason">${item.void_reason ? (0, common_1.getFormattedCancellationReason)(item.void_reason) : 'N/A'}</td>
266
275
  <td>${item.staff_name || 'N/A'}</td>
@@ -302,6 +311,7 @@ function getVoidItemsReportHtml(props) {
302
311
  <th>Order Number</th>
303
312
  <th>Quantity Removed</th>
304
313
  <th>Item</th>
314
+ ${hasPartyNameColumn ? `<th>${partyNameColumnTitle}</th>` : ''}
305
315
  <th>Void Amount</th>
306
316
  <th>Reason</th>
307
317
  <th>Staff Name</th>
@@ -23,6 +23,7 @@ export declare const VoidPurchaseOrderItemSchema: Schema<any, import("mongoose")
23
23
  subtotal: number;
24
24
  warehouse_id: string;
25
25
  vendor_id: import("mongoose").Types.ObjectId;
26
+ vendor_name: string;
26
27
  order_item_id: import("mongoose").Types.ObjectId;
27
28
  void_type: import("../../constants").VOID_PURCHASE_ORDER_ITEM_TYPE_ENUM;
28
29
  iteration: number;
@@ -77,6 +78,7 @@ export declare const VoidPurchaseOrderItemSchema: Schema<any, import("mongoose")
77
78
  subtotal: number;
78
79
  warehouse_id: string;
79
80
  vendor_id: import("mongoose").Types.ObjectId;
81
+ vendor_name: string;
80
82
  order_item_id: import("mongoose").Types.ObjectId;
81
83
  void_type: import("../../constants").VOID_PURCHASE_ORDER_ITEM_TYPE_ENUM;
82
84
  iteration: number;
@@ -131,6 +133,7 @@ export declare const VoidPurchaseOrderItemSchema: Schema<any, import("mongoose")
131
133
  subtotal: number;
132
134
  warehouse_id: string;
133
135
  vendor_id: import("mongoose").Types.ObjectId;
136
+ vendor_name: string;
134
137
  order_item_id: import("mongoose").Types.ObjectId;
135
138
  void_type: import("../../constants").VOID_PURCHASE_ORDER_ITEM_TYPE_ENUM;
136
139
  iteration: number;
@@ -92,6 +92,10 @@ exports.VoidPurchaseOrderItemSchema = new mongoose_1.Schema({
92
92
  required: true,
93
93
  ref: warehouse_vendors_1.WAREHOUSE_VENDORS_COLLECTION_NAME,
94
94
  },
95
+ vendor_name: {
96
+ type: String,
97
+ required: true,
98
+ },
95
99
  staff_id: {
96
100
  type: String,
97
101
  required: true,
@@ -29,6 +29,7 @@ export declare const VoidWarehouseInvoiceItemSchema: Schema<any, import("mongoos
29
29
  total_adjusted_subtotal: number;
30
30
  order_punched_at: NativeDate;
31
31
  client_id: import("mongoose").Types.ObjectId;
32
+ client_name: string;
32
33
  adjustments?: import("mongoose").Types.DocumentArray<{
33
34
  _id: import("mongoose").Types.ObjectId;
34
35
  order_id: import("mongoose").Types.ObjectId;
@@ -83,6 +84,7 @@ export declare const VoidWarehouseInvoiceItemSchema: Schema<any, import("mongoos
83
84
  total_adjusted_subtotal: number;
84
85
  order_punched_at: NativeDate;
85
86
  client_id: import("mongoose").Types.ObjectId;
87
+ client_name: string;
86
88
  adjustments?: import("mongoose").Types.DocumentArray<{
87
89
  _id: import("mongoose").Types.ObjectId;
88
90
  order_id: import("mongoose").Types.ObjectId;
@@ -137,6 +139,7 @@ export declare const VoidWarehouseInvoiceItemSchema: Schema<any, import("mongoos
137
139
  total_adjusted_subtotal: number;
138
140
  order_punched_at: NativeDate;
139
141
  client_id: import("mongoose").Types.ObjectId;
142
+ client_name: string;
140
143
  adjustments?: import("mongoose").Types.DocumentArray<{
141
144
  _id: import("mongoose").Types.ObjectId;
142
145
  order_id: import("mongoose").Types.ObjectId;
@@ -92,6 +92,10 @@ exports.VoidWarehouseInvoiceItemSchema = new mongoose_1.Schema({
92
92
  required: true,
93
93
  ref: warehouse_clients_1.WAREHOUSE_CLIENTS_COLLECTION_NAME,
94
94
  },
95
+ client_name: {
96
+ type: String,
97
+ required: true,
98
+ },
95
99
  staff_id: {
96
100
  type: String,
97
101
  required: true,
@@ -18,6 +18,7 @@ export interface IVoidPurchaseOrderItem {
18
18
  order_item_id: string;
19
19
  void_type: VOID_PURCHASE_ORDER_ITEM_TYPE_ENUM;
20
20
  vendor_id: string;
21
+ vendor_name: string;
21
22
  staff_id: string;
22
23
  staff_name: string;
23
24
  void_reason: string;
@@ -18,6 +18,7 @@ export interface IVoidWarehouseInvoiceItem {
18
18
  order_item_id: string;
19
19
  void_type: VOID_WAREHOUSE_INVOICE_ITEM_TYPE_ENUM;
20
20
  client_id: string;
21
+ client_name: string;
21
22
  staff_id: string;
22
23
  staff_name: string;
23
24
  void_reason: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managesome/eposmatic-toolkit",
3
- "version": "0.2.252",
3
+ "version": "0.2.253",
4
4
  "description": "A Toolkit Library for Eposmatic",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",