@managesome/eposmatic-toolkit 0.2.251 → 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.
- package/lib/constants/ENUMS.d.ts +10 -0
- package/lib/constants/ENUMS.js +16 -2
- package/lib/helpers/utils/index.d.ts +4 -0
- package/lib/helpers/utils/index.js +4 -0
- package/lib/helpers/utils/void-items-report-helpers.d.ts +17 -2
- package/lib/helpers/utils/void-items-report-helpers.js +11 -1
- package/lib/helpers/utils/void-purchase-order-items-helpers.d.ts +3 -0
- package/lib/helpers/utils/void-purchase-order-items-helpers.js +38 -0
- package/lib/helpers/utils/void-purchase-order-items-report-helpers.d.ts +13 -0
- package/lib/helpers/utils/void-purchase-order-items-report-helpers.js +22 -0
- package/lib/helpers/utils/void-warehouse-invoice-items-helpers.d.ts +3 -0
- package/lib/helpers/utils/void-warehouse-invoice-items-helpers.js +38 -0
- package/lib/helpers/utils/void-warehouse-invoice-items-report-helpers.d.ts +13 -0
- package/lib/helpers/utils/void-warehouse-invoice-items-report-helpers.js +22 -0
- package/lib/schemas/models/index.d.ts +2 -0
- package/lib/schemas/models/index.js +2 -0
- package/lib/schemas/models/void_purchase_order_items.d.ts +176 -0
- package/lib/schemas/models/void_purchase_order_items.js +176 -0
- package/lib/schemas/models/void_warehouse_invoice_items.d.ts +176 -0
- package/lib/schemas/models/void_warehouse_invoice_items.js +176 -0
- package/lib/schemas/types/index.d.ts +2 -0
- package/lib/schemas/types/index.js +2 -0
- package/lib/schemas/types/multi_tenants.d.ts +1 -0
- package/lib/schemas/types/void_purchase_order_items.d.ts +37 -0
- package/lib/schemas/types/void_purchase_order_items.js +2 -0
- package/lib/schemas/types/void_warehouse_invoice_items.d.ts +37 -0
- package/lib/schemas/types/void_warehouse_invoice_items.js +2 -0
- package/package.json +1 -1
package/lib/constants/ENUMS.d.ts
CHANGED
|
@@ -813,6 +813,16 @@ export declare enum VOID_ORDER_ITEM_TYPE_ENUM {
|
|
|
813
813
|
ORDER_VOID = "ORDER_VOID"
|
|
814
814
|
}
|
|
815
815
|
export declare const ALL_VOID_ORDER_ITEM_TYPES: VOID_ORDER_ITEM_TYPE_ENUM[];
|
|
816
|
+
export declare enum VOID_PURCHASE_ORDER_ITEM_TYPE_ENUM {
|
|
817
|
+
ITEM_VOID = "ITEM_VOID",
|
|
818
|
+
ORDER_VOID = "ORDER_VOID"
|
|
819
|
+
}
|
|
820
|
+
export declare const ALL_VOID_PURCHASE_ORDER_ITEM_TYPES: VOID_PURCHASE_ORDER_ITEM_TYPE_ENUM[];
|
|
821
|
+
export declare enum VOID_WAREHOUSE_INVOICE_ITEM_TYPE_ENUM {
|
|
822
|
+
ITEM_VOID = "ITEM_VOID",
|
|
823
|
+
ORDER_VOID = "ORDER_VOID"
|
|
824
|
+
}
|
|
825
|
+
export declare const ALL_VOID_WAREHOUSE_INVOICE_ITEM_TYPES: VOID_WAREHOUSE_INVOICE_ITEM_TYPE_ENUM[];
|
|
816
826
|
export declare enum SUBSCRIPTION_STATUS_ENUM {
|
|
817
827
|
ACTIVE = "ACTIVE",
|
|
818
828
|
PENDING = "PENDING",
|
package/lib/constants/ENUMS.js
CHANGED
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ALL_CATEGORY_DISPLAY_TYPES = exports.CATEGORY_DISPLAY_TYPE_ENUM = exports.ALL_PAYMENT_METHOD_EXPECTED = exports.PAYMENT_METHOD_EXPECTED_ENUM = exports.ALL_WEB_UNPAID_PAYMENT_TYPES = exports.WEB_UNPAID_PAYMENT_TYPE_ENUM = exports.ALL_COUNTRY_FLAG_TYPES = exports.COUNTRY_FLAG_ENUM = exports.ALL_COUNTRY_NAME_TYPES = exports.COUNTRY_NAME_ENUM = exports.ALL_COUNTRY_ALPHA_3_TYPES = exports.COUNTRY_ALPHA_3_ENUM = exports.ALL_COUNTRY_ALPHA_2_TYPES = exports.COUNTRY_ALPHA_2_ENUM = exports.ALL_COUNTRY_CODES = exports.COUNTRY_CODE_ENUM = exports.ALL_CURRENCY_SYMBOLS = exports.CURRENCY_SYMBOL_ENUM = exports.ALL_CURRENCY_NAMES = exports.CURRENCY_NAME_ENUM = exports.ALL_CURRENCY_CODES = exports.CURRENCY_CODE_ENUM = exports.ALL_DAY_INDEX = exports.DAY_INDEX_ENUM = exports.ALL_INVENTORY_UNIT_TYPES = exports.INVENTORY_ITEM_UNIT_ENUM = exports.ALL_DIETARY_PREFERENCES = exports.ITEM_DIETARY_PREFERENCE_ENUM = exports.ALL_CAVEATS = exports.ITEM_CAVEATS_ENUM = exports.ALL_PAYMENT_STATUS = exports.PAYMENT_STATUS_ENUM = exports.ALL_ORDER_STATUS_NAMES = exports.ORDER_STATUS_ENUM = exports.ALL_PAYMENT_TYPE_NAMES = exports.PaymentTypeDescriptions = exports.PAYMENT_TYPE_ENUM = exports.ALL_API_STATUS_NAMES = exports.API_STATUS_ENUM = exports.ALL_INTEGRATIONS = exports.INTEGRATIONS_ENUM = exports.PLATFORM_NAMES = exports.PLATFORMS_BY_ORDER_FROM = exports.PLATFORMS_BY_ORDER_TYPE = exports.ALL_PLATFORMS = exports.PLATFORMS_ENUM = exports.ALL_ORDER_TYPE_NAMES = exports.ORDER_TYPE_ENUM = exports.ALL_ORDER_FROM_NAMES = exports.ORDER_FROM_ENUM = void 0;
|
|
4
4
|
exports.ORDER_ITEM_TYPE_ENUM = exports.ALL_PLATFORM_PROVIDER_IDS = exports.PLATFORM_PROVIDER_IDS_ENUM = exports.ALL_MARKETING_RECEIPIENT_TYPES = exports.MARKETING_RECEIPIENT_ENUM = exports.ALL_MARKETING_TYPES = exports.MARKETING_TYPE_ENUM = exports.ALL_TOKEN_TYPES = exports.TOKEN_TYPE_ENUM = exports.ALL_EMAIL_PROCESSING_PROVIDERS = exports.EMAIL_PROCESSING_PROVIDERS_ENUM = exports.ALL_SMS_PROCESSING_PROVIDERS = exports.SMS_PROCESSING_PROVIDERS_ENUM = exports.ALL_TERMINAL_TYPES = exports.TERMINAL_TYPE_ENUM = exports.ALL_TERMINAL_PROCESSING_PROVIDERS = exports.TERMINAL_PROCESSING_PROVIDERS_ENUM = exports.TRANSACTION_TYPE_ENUM = exports.ALL_CARD_PROCESSING_PROVIDERS = exports.CARD_PROCESSING_PROVIDERS_ENUM = exports.ALL_PAYMENT_PROVIDERS = exports.PAYMENT_PROVIDERS_ENUM = exports.ALL_SUPPORT_SPECIALIST_PERMISSIONS = exports.ALL_MODERATOR_PERMISSIONS = exports.ALL_USER_PERMISSIONS = exports.USER_PERMISSIONS_ENUM = exports.ALL_REWARDS_USAGE_REF_TYPES = exports.REWARDS_USAGE_REF_TYPE_ENUM = exports.ALL_PATHWAY_TO_UNLOCK_TYPE_ORDERS_SCOPES = exports.PATHWAY_TO_UNLOCK_TYPE_ORDERS_SCOPE_ENUM = exports.ALL_PATHWAY_TO_UNLOCK_TYPES = exports.PATHWAY_TO_UNLOCK_TYPE_ENUM = exports.ALL_MYSTERY_GIFT_POPUP_TYPES = exports.MYSTERY_GIFT_POPUP_TYPE_ENUM = exports.ALL_MYSTERY_GIFT_TYPES = exports.MYSTERY_GIFT_TYPE_ENUM = exports.ALL_GIFT_CARD_REWARD_TYPES = exports.GIFT_CARD_REWARD_TYPE_ENUM = exports.ALL_OFFER_REWARD_TYPES = exports.OFFER_REWARD_TYPE_ENUM = exports.ALL_USER_ROLES = exports.USER_ROLES_ENUM = exports.ALL_PLATFORM_TYPES = exports.PLATFORM_TYPE_ENUM = exports.ALL_ORDER_NUMBER_GROUPING_TYPES = exports.ORDER_NUMBER_GROUPING_TYPE_ENUM = exports.ALL_TRACK_ORDER_NUMBER_TYPES = exports.TRACK_ORDER_NUMBER_ENUM = exports.ALL_TABLE_TYPES = exports.TABLE_TYPE_ENUM = void 0;
|
|
5
5
|
exports.ALL_ITEM_TRANSACTION_TYPES = exports.ITEM_TRANSACTION_TYPE_ENUM = exports.INVENTORY_OUTBOUND_TRANSACTIONS = exports.INVENTORY_INBOUND_TRANSACTIONS = exports.ALL_INVENTORY_TRANSACTION_CATEGORIES = exports.INVENTORY_TRANSACTION_CATEGORY_ENUM = exports.ALL_INVENTORY_TRANSACTION_TYPES = exports.INVENTORY_TRANSACTION_TYPE_ENUM = exports.ALL_GST_TYPES = exports.GST_TYPE_ENUM = exports.ALL_EXPENSE_REACCURING_TYPES = exports.EXPENSE_REACCURING_TYPE_ENUM = exports.PAYMENT_EXTENSION_ENUM = exports.ALL_PRINTER_INTERFACES = exports.PRINTER_INTERFACE_ENUM = exports.RECEIPT_WIDTHS = exports.ALL_NUM_OF_COLUMNS = exports.NUM_OF_COLUMNS_ENUM = exports.SPLIT_SYNC_SOURCE_ENUM = exports.ALL_SPLIT_BILL_TYPES = exports.SPLIT_BILL_TYPE_ENUM = exports.ALL_RIDER_FEE_TYPES = exports.RIDER_FEE_TYPE_ENUM = exports.ALL_DELIVERY_AREAS_SEARCH_TYPES = exports.DELIVERY_AREAS_SEARCH_TYPE_ENUM = exports.ALL_WEB_AUTH_TYPES = exports.WEB_AUTH_TYPE_ENUM = exports.KITCHEN_RECEIPT_TYPE_ENUM = exports.PRINTER_EVENT_TYPE_ENUM = exports.SORT_TYPE_ENUM = exports.BLACKLISTED_SMS_COUNTRY_CODES = exports.ALL_OTP_TYPES = exports.OTP_TYPE_ENUM = exports.ALL_TAX_INVOICE_PROVIDERS = exports.TAX_INVOICE_PROVIDER_ENUM = exports.ALL_RESERVATION_STATUS_TYPES = exports.RESERVATION_STATUS_ENUM = exports.TENANT_AMOUNT_DUE_TYPE_ENUM = exports.ALL_KITCHEN_DOCKET_FONT_TYPES = exports.KITCHEN_DOCKET_FONT_TYPE_ENUM = exports.ALL_SORT_ORDER_BY_TYPES = exports.SORT_ORDER_BY_ENUM = exports.RECEIPT_IMAGE_TYPE_ENUM = exports.ALL_RECEIPT_TYPES = exports.RECEIPT_TYPE_ENUM = exports.ALL_PRINTING_PREFERENCES = exports.PRINTING_PREFERENCE_ENUM = exports.ALL_PRINTER_BRAND_TYPES = exports.PRINTER_BRAND_TYPE_ENUM = exports.ALL_ORDER_ITEM_TYPES = void 0;
|
|
6
|
-
exports.
|
|
7
|
-
exports.ALL_RECEIPT_QR_CODE_TYPES = exports.RECEIPT_QR_CODE_TYPE_ENUM = exports.ALL_INTERNAL_LEAD_STATUS = exports.INTERNAL_LEAD_STATUS_ENUM = exports.ALL_INTERNAL_LEAD_SOURCES = exports.INTERNAL_LEAD_SOURCE_ENUM = exports.ALL_CASH_DRAWER_STATUS = exports.CASH_DRAWER_STATUS_ENUM = exports.ALL_CASH_IN_HAND_TRANSACTION_CATEGORIES = exports.CASH_IN_HAND_TRANSACTION_CATEGORY_ENUM = exports.ALL_CASH_IN_HAND_TRANSACTION_TYPES = exports.CASH_IN_HAND_TRANSACTION_TYPE_ENUM = exports.ALL_CASH_IN_OUT_TYPES = exports.CASH_IN_OUT_TYPE_ENUM = exports.ALL_POS_SHIFT_STATUS = exports.POS_SHIFT_STATUS_ENUM = void 0;
|
|
6
|
+
exports.ALL_WAREHOUSE_CLIENT_TYPES = exports.WAREHOUSE_CLIENT_TYPE_ENUM = exports.ALL_ONLINE_ORDERING_DESIGN_TYPES = exports.ONLINE_ORDERING_DESIGN_TYPE_ENUM = exports.ALL_NOTIFICATION_PROVIDERS = exports.NOTIFICATION_PROVIDER_ENUM = exports.ALL_ORDER_COMPLETION_TYPES = exports.ORDER_COMPLETION_TYPE_ENUM = exports.ITEM_COMPARISON_FIELD_ENUM = exports.VOID_ITEM_STAFF_REPORT_ENUM = exports.ALL_DISCOUNT_APPLICABILITY_TYPES = exports.DISCOUNT_APPLICABILITY_ENUM = exports.ALL_DISCOUNT_TYPES = exports.DISCOUNT_TYPE_ENUM = exports.EMAIL_TEMPLATES_TYPE_ENUM = exports.ALL_ALERT_NOTIFICATIONS_TYPES = exports.ALERT_NOTIFICATIONS_TYPE_ENUM = exports.ALL_WALLET_TRANSACTION_STATUS = exports.WALLET_TRANSACTION_STATUS_ENUM = exports.ALL_WALLET_TRANSACTION_CATEGORIES = exports.WALLET_TRANSACTION_CATEGORY_ENUM = exports.ALL_WALLET_TRANSACTION_TYPES = exports.WALLET_TRANSACTION_TYPE_ENUM = exports.ALL_WAREHOUSE_SUPPORT_SPECIALIST_PERMISSIONS = exports.ALL_WAREHOUSE_MODERATOR_PERMISSIONS = exports.ALL_WAREHOUSE_USER_PERMISSIONS = exports.WAREHOUSE_USER_PERMISSIONS_ENUM = exports.ALL_WAREHOUSE_INVOICE_STATUS_NAMES = exports.WAREHOUSE_INVOICE_STATUS_ENUM = exports.ALL_PURCHASE_ORDER_STATUS_NAMES = exports.PURCHASE_ORDER_STATUS_ENUM = exports.ALL_DELIVERY_STATUS = exports.DELIVERY_STATUS_ENUM = exports.ALL_INVENTORY_ITEM_TYPES = exports.INVENTORY_ITEM_TYPE_ENUM = exports.ALL_RATING_TYPES = exports.RATING_TYPE_ENUM = exports.ALL_SUBSCRIPTION_STATUS = exports.SUBSCRIPTION_STATUS_ENUM = exports.ALL_VOID_WAREHOUSE_INVOICE_ITEM_TYPES = exports.VOID_WAREHOUSE_INVOICE_ITEM_TYPE_ENUM = exports.ALL_VOID_PURCHASE_ORDER_ITEM_TYPES = exports.VOID_PURCHASE_ORDER_ITEM_TYPE_ENUM = exports.ALL_VOID_ORDER_ITEM_TYPES = exports.VOID_ORDER_ITEM_TYPE_ENUM = exports.COMPARISON_REPORT_TYPE_ENUM = exports.ALL_MULTI_TENANT_WEBSITE_TYPES = exports.MULTI_TENANT_WEBSITE_TYPE_ENUM = exports.ALL_TIME_RANGE_ENUMS = exports.TIME_RANGE_ENUM = void 0;
|
|
7
|
+
exports.ALL_RECEIPT_QR_CODE_TYPES = exports.RECEIPT_QR_CODE_TYPE_ENUM = exports.ALL_INTERNAL_LEAD_STATUS = exports.INTERNAL_LEAD_STATUS_ENUM = exports.ALL_INTERNAL_LEAD_SOURCES = exports.INTERNAL_LEAD_SOURCE_ENUM = exports.ALL_CASH_DRAWER_STATUS = exports.CASH_DRAWER_STATUS_ENUM = exports.ALL_CASH_IN_HAND_TRANSACTION_CATEGORIES = exports.CASH_IN_HAND_TRANSACTION_CATEGORY_ENUM = exports.ALL_CASH_IN_HAND_TRANSACTION_TYPES = exports.CASH_IN_HAND_TRANSACTION_TYPE_ENUM = exports.ALL_CASH_IN_OUT_TYPES = exports.CASH_IN_OUT_TYPE_ENUM = exports.ALL_POS_SHIFT_STATUS = exports.POS_SHIFT_STATUS_ENUM = exports.ALL_POS_DAY_STATUS = exports.POS_DAY_STATUS_ENUM = exports.ALL_MODIFIER_OPTION_REF_TYPES = exports.MODIFIER_OPTION_REF_TYPE_ENUM = void 0;
|
|
8
8
|
var ORDER_FROM_ENUM;
|
|
9
9
|
(function (ORDER_FROM_ENUM) {
|
|
10
10
|
ORDER_FROM_ENUM["WEB"] = "WEB";
|
|
@@ -1411,6 +1411,20 @@ var VOID_ORDER_ITEM_TYPE_ENUM;
|
|
|
1411
1411
|
})(VOID_ORDER_ITEM_TYPE_ENUM || (exports.VOID_ORDER_ITEM_TYPE_ENUM = VOID_ORDER_ITEM_TYPE_ENUM = {}));
|
|
1412
1412
|
exports.ALL_VOID_ORDER_ITEM_TYPES = Object.values(VOID_ORDER_ITEM_TYPE_ENUM);
|
|
1413
1413
|
// ======================>> <<====================== //
|
|
1414
|
+
var VOID_PURCHASE_ORDER_ITEM_TYPE_ENUM;
|
|
1415
|
+
(function (VOID_PURCHASE_ORDER_ITEM_TYPE_ENUM) {
|
|
1416
|
+
VOID_PURCHASE_ORDER_ITEM_TYPE_ENUM["ITEM_VOID"] = "ITEM_VOID";
|
|
1417
|
+
VOID_PURCHASE_ORDER_ITEM_TYPE_ENUM["ORDER_VOID"] = "ORDER_VOID";
|
|
1418
|
+
})(VOID_PURCHASE_ORDER_ITEM_TYPE_ENUM || (exports.VOID_PURCHASE_ORDER_ITEM_TYPE_ENUM = VOID_PURCHASE_ORDER_ITEM_TYPE_ENUM = {}));
|
|
1419
|
+
exports.ALL_VOID_PURCHASE_ORDER_ITEM_TYPES = Object.values(VOID_PURCHASE_ORDER_ITEM_TYPE_ENUM);
|
|
1420
|
+
// ======================>> <<====================== //
|
|
1421
|
+
var VOID_WAREHOUSE_INVOICE_ITEM_TYPE_ENUM;
|
|
1422
|
+
(function (VOID_WAREHOUSE_INVOICE_ITEM_TYPE_ENUM) {
|
|
1423
|
+
VOID_WAREHOUSE_INVOICE_ITEM_TYPE_ENUM["ITEM_VOID"] = "ITEM_VOID";
|
|
1424
|
+
VOID_WAREHOUSE_INVOICE_ITEM_TYPE_ENUM["ORDER_VOID"] = "ORDER_VOID";
|
|
1425
|
+
})(VOID_WAREHOUSE_INVOICE_ITEM_TYPE_ENUM || (exports.VOID_WAREHOUSE_INVOICE_ITEM_TYPE_ENUM = VOID_WAREHOUSE_INVOICE_ITEM_TYPE_ENUM = {}));
|
|
1426
|
+
exports.ALL_VOID_WAREHOUSE_INVOICE_ITEM_TYPES = Object.values(VOID_WAREHOUSE_INVOICE_ITEM_TYPE_ENUM);
|
|
1427
|
+
// ======================>> <<====================== //
|
|
1414
1428
|
var SUBSCRIPTION_STATUS_ENUM;
|
|
1415
1429
|
(function (SUBSCRIPTION_STATUS_ENUM) {
|
|
1416
1430
|
SUBSCRIPTION_STATUS_ENUM["ACTIVE"] = "ACTIVE";
|
|
@@ -60,6 +60,10 @@ export * from './terminal-devices-helpers';
|
|
|
60
60
|
export * from './time-helpers';
|
|
61
61
|
export * from './void-items-report-helpers';
|
|
62
62
|
export * from './void-order-items-helpers';
|
|
63
|
+
export * from './void-purchase-order-items-helpers';
|
|
64
|
+
export * from './void-purchase-order-items-report-helpers';
|
|
65
|
+
export * from './void-warehouse-invoice-items-helpers';
|
|
66
|
+
export * from './void-warehouse-invoice-items-report-helpers';
|
|
63
67
|
export * from './voidations-summary-report-helpers';
|
|
64
68
|
export * from './wallet-helpers';
|
|
65
69
|
export * from './warehouse-catalog-conversion';
|
|
@@ -76,6 +76,10 @@ __exportStar(require("./terminal-devices-helpers"), exports);
|
|
|
76
76
|
__exportStar(require("./time-helpers"), exports);
|
|
77
77
|
__exportStar(require("./void-items-report-helpers"), exports);
|
|
78
78
|
__exportStar(require("./void-order-items-helpers"), exports);
|
|
79
|
+
__exportStar(require("./void-purchase-order-items-helpers"), exports);
|
|
80
|
+
__exportStar(require("./void-purchase-order-items-report-helpers"), exports);
|
|
81
|
+
__exportStar(require("./void-warehouse-invoice-items-helpers"), exports);
|
|
82
|
+
__exportStar(require("./void-warehouse-invoice-items-report-helpers"), exports);
|
|
79
83
|
__exportStar(require("./voidations-summary-report-helpers"), exports);
|
|
80
84
|
__exportStar(require("./wallet-helpers"), exports);
|
|
81
85
|
__exportStar(require("./warehouse-catalog-conversion"), exports);
|
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
import { CURRENCY_SYMBOL_ENUM } from '../../constants';
|
|
2
|
-
|
|
2
|
+
export interface IVoidItemsReportRow {
|
|
3
|
+
platform?: string;
|
|
4
|
+
vendor_name?: string;
|
|
5
|
+
client_name?: string;
|
|
6
|
+
order_number: number | null;
|
|
7
|
+
quantity: number;
|
|
8
|
+
subtotal: number;
|
|
9
|
+
total_adjusted_subtotal: number;
|
|
10
|
+
total_adjusted_quantity: number;
|
|
11
|
+
name: string;
|
|
12
|
+
void_reason: string;
|
|
13
|
+
staff_name: string;
|
|
14
|
+
order_punched_at: Date;
|
|
15
|
+
updatedAt: Date;
|
|
16
|
+
createdAt: Date;
|
|
17
|
+
}
|
|
3
18
|
export interface IVoidItemsReportProps {
|
|
4
|
-
data:
|
|
19
|
+
data: IVoidItemsReportRow[];
|
|
5
20
|
tenantName: string | undefined;
|
|
6
21
|
from: Date | null;
|
|
7
22
|
to: Date | null;
|
|
@@ -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>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { IVoidPurchaseOrderItem } from '../../schemas';
|
|
2
|
+
export declare function getVoidPurchaseOrderItemFromCents<T extends Partial<IVoidPurchaseOrderItem> | IVoidPurchaseOrderItem>(voidPurchaseOrderItem: T): T;
|
|
3
|
+
export declare function getFetchedVoidPurchaseOrderItems(voidItems: IVoidPurchaseOrderItem[]): IVoidPurchaseOrderItem[];
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getVoidPurchaseOrderItemFromCents = getVoidPurchaseOrderItemFromCents;
|
|
4
|
+
exports.getFetchedVoidPurchaseOrderItems = getFetchedVoidPurchaseOrderItems;
|
|
5
|
+
const common_order_actions_1 = require("../store/common-order-actions");
|
|
6
|
+
const price_conversion_1 = require("./price-conversion");
|
|
7
|
+
function getVoidPurchaseOrderItemFromCents(voidPurchaseOrderItem) {
|
|
8
|
+
return {
|
|
9
|
+
...voidPurchaseOrderItem,
|
|
10
|
+
...(typeof voidPurchaseOrderItem.subtotal === 'number'
|
|
11
|
+
? {
|
|
12
|
+
subtotal: (0, price_conversion_1.convertPriceFromCents)(voidPurchaseOrderItem.subtotal),
|
|
13
|
+
}
|
|
14
|
+
: {}),
|
|
15
|
+
...(typeof voidPurchaseOrderItem.total_adjusted_subtotal === 'number'
|
|
16
|
+
? {
|
|
17
|
+
total_adjusted_subtotal: (0, price_conversion_1.convertPriceFromCents)(voidPurchaseOrderItem.total_adjusted_subtotal),
|
|
18
|
+
}
|
|
19
|
+
: {}),
|
|
20
|
+
...(voidPurchaseOrderItem.adjustments != null
|
|
21
|
+
? {
|
|
22
|
+
adjustments: voidPurchaseOrderItem.adjustments.map((adjustment) => ({
|
|
23
|
+
...adjustment,
|
|
24
|
+
...(typeof adjustment.subtotal === 'number'
|
|
25
|
+
? {
|
|
26
|
+
subtotal: (0, price_conversion_1.convertPriceFromCents)(adjustment.subtotal),
|
|
27
|
+
}
|
|
28
|
+
: {}),
|
|
29
|
+
})),
|
|
30
|
+
}
|
|
31
|
+
: {}),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function getFetchedVoidPurchaseOrderItems(voidItems) {
|
|
35
|
+
return voidItems
|
|
36
|
+
.map((voidPurchaseOrderItem) => getVoidPurchaseOrderItemFromCents(voidPurchaseOrderItem))
|
|
37
|
+
.sort(common_order_actions_1.sortByCreatedAt);
|
|
38
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CURRENCY_SYMBOL_ENUM } from '../../constants';
|
|
2
|
+
import { IVoidPurchaseOrderItem } from '../../schemas';
|
|
3
|
+
export interface IVoidPurchaseOrderItemsReportProps {
|
|
4
|
+
data: IVoidPurchaseOrderItem[];
|
|
5
|
+
warehouseName: string | undefined;
|
|
6
|
+
from: Date | null;
|
|
7
|
+
to: Date | null;
|
|
8
|
+
width?: number;
|
|
9
|
+
monochrome?: boolean;
|
|
10
|
+
currency_symbol: CURRENCY_SYMBOL_ENUM | undefined;
|
|
11
|
+
}
|
|
12
|
+
export declare function getVoidPurchaseOrderItemsReportHtml(props: IVoidPurchaseOrderItemsReportProps): string;
|
|
13
|
+
export declare function getVoidPurchaseOrderItemsReportReceiptHtml(props: IVoidPurchaseOrderItemsReportProps): string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getVoidPurchaseOrderItemsReportHtml = getVoidPurchaseOrderItemsReportHtml;
|
|
4
|
+
exports.getVoidPurchaseOrderItemsReportReceiptHtml = getVoidPurchaseOrderItemsReportReceiptHtml;
|
|
5
|
+
const void_items_report_helpers_1 = require("./void-items-report-helpers");
|
|
6
|
+
function toCommonProps(props) {
|
|
7
|
+
return {
|
|
8
|
+
data: props.data,
|
|
9
|
+
tenantName: props.warehouseName,
|
|
10
|
+
from: props.from,
|
|
11
|
+
to: props.to,
|
|
12
|
+
width: props.width,
|
|
13
|
+
monochrome: props.monochrome,
|
|
14
|
+
currency_symbol: props.currency_symbol,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function getVoidPurchaseOrderItemsReportHtml(props) {
|
|
18
|
+
return (0, void_items_report_helpers_1.getVoidItemsReportHtml)(toCommonProps(props));
|
|
19
|
+
}
|
|
20
|
+
function getVoidPurchaseOrderItemsReportReceiptHtml(props) {
|
|
21
|
+
return (0, void_items_report_helpers_1.getVoidItemsReportReceiptHtml)(toCommonProps(props));
|
|
22
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { IVoidWarehouseInvoiceItem } from '../../schemas';
|
|
2
|
+
export declare function getVoidWarehouseInvoiceItemFromCents<T extends Partial<IVoidWarehouseInvoiceItem> | IVoidWarehouseInvoiceItem>(voidWarehouseInvoiceItem: T): T;
|
|
3
|
+
export declare function getFetchedVoidWarehouseInvoiceItems(voidItems: IVoidWarehouseInvoiceItem[]): IVoidWarehouseInvoiceItem[];
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getVoidWarehouseInvoiceItemFromCents = getVoidWarehouseInvoiceItemFromCents;
|
|
4
|
+
exports.getFetchedVoidWarehouseInvoiceItems = getFetchedVoidWarehouseInvoiceItems;
|
|
5
|
+
const common_order_actions_1 = require("../store/common-order-actions");
|
|
6
|
+
const price_conversion_1 = require("./price-conversion");
|
|
7
|
+
function getVoidWarehouseInvoiceItemFromCents(voidWarehouseInvoiceItem) {
|
|
8
|
+
return {
|
|
9
|
+
...voidWarehouseInvoiceItem,
|
|
10
|
+
...(typeof voidWarehouseInvoiceItem.subtotal === 'number'
|
|
11
|
+
? {
|
|
12
|
+
subtotal: (0, price_conversion_1.convertPriceFromCents)(voidWarehouseInvoiceItem.subtotal),
|
|
13
|
+
}
|
|
14
|
+
: {}),
|
|
15
|
+
...(typeof voidWarehouseInvoiceItem.total_adjusted_subtotal === 'number'
|
|
16
|
+
? {
|
|
17
|
+
total_adjusted_subtotal: (0, price_conversion_1.convertPriceFromCents)(voidWarehouseInvoiceItem.total_adjusted_subtotal),
|
|
18
|
+
}
|
|
19
|
+
: {}),
|
|
20
|
+
...(voidWarehouseInvoiceItem.adjustments != null
|
|
21
|
+
? {
|
|
22
|
+
adjustments: voidWarehouseInvoiceItem.adjustments.map((adjustment) => ({
|
|
23
|
+
...adjustment,
|
|
24
|
+
...(typeof adjustment.subtotal === 'number'
|
|
25
|
+
? {
|
|
26
|
+
subtotal: (0, price_conversion_1.convertPriceFromCents)(adjustment.subtotal),
|
|
27
|
+
}
|
|
28
|
+
: {}),
|
|
29
|
+
})),
|
|
30
|
+
}
|
|
31
|
+
: {}),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function getFetchedVoidWarehouseInvoiceItems(voidItems) {
|
|
35
|
+
return voidItems
|
|
36
|
+
.map((voidWarehouseInvoiceItem) => getVoidWarehouseInvoiceItemFromCents(voidWarehouseInvoiceItem))
|
|
37
|
+
.sort(common_order_actions_1.sortByCreatedAt);
|
|
38
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CURRENCY_SYMBOL_ENUM } from '../../constants';
|
|
2
|
+
import { IVoidWarehouseInvoiceItem } from '../../schemas';
|
|
3
|
+
export interface IVoidWarehouseInvoiceItemsReportProps {
|
|
4
|
+
data: IVoidWarehouseInvoiceItem[];
|
|
5
|
+
warehouseName: string | undefined;
|
|
6
|
+
from: Date | null;
|
|
7
|
+
to: Date | null;
|
|
8
|
+
width?: number;
|
|
9
|
+
monochrome?: boolean;
|
|
10
|
+
currency_symbol: CURRENCY_SYMBOL_ENUM | undefined;
|
|
11
|
+
}
|
|
12
|
+
export declare function getVoidWarehouseInvoiceItemsReportHtml(props: IVoidWarehouseInvoiceItemsReportProps): string;
|
|
13
|
+
export declare function getVoidWarehouseInvoiceItemsReportReceiptHtml(props: IVoidWarehouseInvoiceItemsReportProps): string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getVoidWarehouseInvoiceItemsReportHtml = getVoidWarehouseInvoiceItemsReportHtml;
|
|
4
|
+
exports.getVoidWarehouseInvoiceItemsReportReceiptHtml = getVoidWarehouseInvoiceItemsReportReceiptHtml;
|
|
5
|
+
const void_items_report_helpers_1 = require("./void-items-report-helpers");
|
|
6
|
+
function toCommonProps(props) {
|
|
7
|
+
return {
|
|
8
|
+
data: props.data,
|
|
9
|
+
tenantName: props.warehouseName,
|
|
10
|
+
from: props.from,
|
|
11
|
+
to: props.to,
|
|
12
|
+
width: props.width,
|
|
13
|
+
monochrome: props.monochrome,
|
|
14
|
+
currency_symbol: props.currency_symbol,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function getVoidWarehouseInvoiceItemsReportHtml(props) {
|
|
18
|
+
return (0, void_items_report_helpers_1.getVoidItemsReportHtml)(toCommonProps(props));
|
|
19
|
+
}
|
|
20
|
+
function getVoidWarehouseInvoiceItemsReportReceiptHtml(props) {
|
|
21
|
+
return (0, void_items_report_helpers_1.getVoidItemsReportReceiptHtml)(toCommonProps(props));
|
|
22
|
+
}
|
|
@@ -52,6 +52,8 @@ export * from './tokens';
|
|
|
52
52
|
export * from './track_order_number';
|
|
53
53
|
export * from './vouchers';
|
|
54
54
|
export * from './void_order_items';
|
|
55
|
+
export * from './void_purchase_order_items';
|
|
56
|
+
export * from './void_warehouse_invoice_items';
|
|
55
57
|
export * from './wallet';
|
|
56
58
|
export * from './wallet_transactions';
|
|
57
59
|
export * from './warehouse';
|
|
@@ -68,6 +68,8 @@ __exportStar(require("./tokens"), exports);
|
|
|
68
68
|
__exportStar(require("./track_order_number"), exports);
|
|
69
69
|
__exportStar(require("./vouchers"), exports);
|
|
70
70
|
__exportStar(require("./void_order_items"), exports);
|
|
71
|
+
__exportStar(require("./void_purchase_order_items"), exports);
|
|
72
|
+
__exportStar(require("./void_warehouse_invoice_items"), exports);
|
|
71
73
|
__exportStar(require("./wallet"), exports);
|
|
72
74
|
__exportStar(require("./wallet_transactions"), exports);
|
|
73
75
|
__exportStar(require("./warehouse"), exports);
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { Schema } from 'mongoose';
|
|
2
|
+
export declare const VoidPurchaseOrderItemSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
3
|
+
timestamps: true;
|
|
4
|
+
versionKey: false;
|
|
5
|
+
minimize: false;
|
|
6
|
+
}, {
|
|
7
|
+
createdAt: NativeDate;
|
|
8
|
+
updatedAt: NativeDate;
|
|
9
|
+
} & {
|
|
10
|
+
_id: import("mongoose").Types.ObjectId;
|
|
11
|
+
name: string;
|
|
12
|
+
order_id: import("mongoose").Types.ObjectId;
|
|
13
|
+
staff_id: string;
|
|
14
|
+
staff_name: string;
|
|
15
|
+
createdAt_mins: number;
|
|
16
|
+
createdAt: NativeDate;
|
|
17
|
+
updatedAt: NativeDate;
|
|
18
|
+
description: string;
|
|
19
|
+
order_number: number;
|
|
20
|
+
item_id: import("mongoose").Types.ObjectId;
|
|
21
|
+
quantity: number;
|
|
22
|
+
void_reason: string;
|
|
23
|
+
subtotal: number;
|
|
24
|
+
warehouse_id: string;
|
|
25
|
+
vendor_id: import("mongoose").Types.ObjectId;
|
|
26
|
+
vendor_name: string;
|
|
27
|
+
order_item_id: import("mongoose").Types.ObjectId;
|
|
28
|
+
void_type: import("../../constants").VOID_PURCHASE_ORDER_ITEM_TYPE_ENUM;
|
|
29
|
+
iteration: number;
|
|
30
|
+
total_adjusted_quantity: number;
|
|
31
|
+
total_adjusted_subtotal: number;
|
|
32
|
+
order_punched_at: NativeDate;
|
|
33
|
+
adjustments?: import("mongoose").Types.DocumentArray<{
|
|
34
|
+
_id: import("mongoose").Types.ObjectId;
|
|
35
|
+
order_id: import("mongoose").Types.ObjectId;
|
|
36
|
+
staff_id: string;
|
|
37
|
+
staff_name: string;
|
|
38
|
+
order_number: number;
|
|
39
|
+
quantity: number;
|
|
40
|
+
subtotal: number;
|
|
41
|
+
order_item_id: import("mongoose").Types.ObjectId;
|
|
42
|
+
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
43
|
+
_id: import("mongoose").Types.ObjectId;
|
|
44
|
+
order_id: import("mongoose").Types.ObjectId;
|
|
45
|
+
staff_id: string;
|
|
46
|
+
staff_name: string;
|
|
47
|
+
order_number: number;
|
|
48
|
+
quantity: number;
|
|
49
|
+
subtotal: number;
|
|
50
|
+
order_item_id: import("mongoose").Types.ObjectId;
|
|
51
|
+
}> & {
|
|
52
|
+
_id: import("mongoose").Types.ObjectId;
|
|
53
|
+
order_id: import("mongoose").Types.ObjectId;
|
|
54
|
+
staff_id: string;
|
|
55
|
+
staff_name: string;
|
|
56
|
+
order_number: number;
|
|
57
|
+
quantity: number;
|
|
58
|
+
subtotal: number;
|
|
59
|
+
order_item_id: import("mongoose").Types.ObjectId;
|
|
60
|
+
}> | null | undefined;
|
|
61
|
+
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
62
|
+
createdAt: NativeDate;
|
|
63
|
+
updatedAt: NativeDate;
|
|
64
|
+
} & {
|
|
65
|
+
_id: import("mongoose").Types.ObjectId;
|
|
66
|
+
name: string;
|
|
67
|
+
order_id: import("mongoose").Types.ObjectId;
|
|
68
|
+
staff_id: string;
|
|
69
|
+
staff_name: string;
|
|
70
|
+
createdAt_mins: number;
|
|
71
|
+
createdAt: NativeDate;
|
|
72
|
+
updatedAt: NativeDate;
|
|
73
|
+
description: string;
|
|
74
|
+
order_number: number;
|
|
75
|
+
item_id: import("mongoose").Types.ObjectId;
|
|
76
|
+
quantity: number;
|
|
77
|
+
void_reason: string;
|
|
78
|
+
subtotal: number;
|
|
79
|
+
warehouse_id: string;
|
|
80
|
+
vendor_id: import("mongoose").Types.ObjectId;
|
|
81
|
+
vendor_name: string;
|
|
82
|
+
order_item_id: import("mongoose").Types.ObjectId;
|
|
83
|
+
void_type: import("../../constants").VOID_PURCHASE_ORDER_ITEM_TYPE_ENUM;
|
|
84
|
+
iteration: number;
|
|
85
|
+
total_adjusted_quantity: number;
|
|
86
|
+
total_adjusted_subtotal: number;
|
|
87
|
+
order_punched_at: NativeDate;
|
|
88
|
+
adjustments?: import("mongoose").Types.DocumentArray<{
|
|
89
|
+
_id: import("mongoose").Types.ObjectId;
|
|
90
|
+
order_id: import("mongoose").Types.ObjectId;
|
|
91
|
+
staff_id: string;
|
|
92
|
+
staff_name: string;
|
|
93
|
+
order_number: number;
|
|
94
|
+
quantity: number;
|
|
95
|
+
subtotal: number;
|
|
96
|
+
order_item_id: import("mongoose").Types.ObjectId;
|
|
97
|
+
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
98
|
+
_id: import("mongoose").Types.ObjectId;
|
|
99
|
+
order_id: import("mongoose").Types.ObjectId;
|
|
100
|
+
staff_id: string;
|
|
101
|
+
staff_name: string;
|
|
102
|
+
order_number: number;
|
|
103
|
+
quantity: number;
|
|
104
|
+
subtotal: number;
|
|
105
|
+
order_item_id: import("mongoose").Types.ObjectId;
|
|
106
|
+
}> & {
|
|
107
|
+
_id: import("mongoose").Types.ObjectId;
|
|
108
|
+
order_id: import("mongoose").Types.ObjectId;
|
|
109
|
+
staff_id: string;
|
|
110
|
+
staff_name: string;
|
|
111
|
+
order_number: number;
|
|
112
|
+
quantity: number;
|
|
113
|
+
subtotal: number;
|
|
114
|
+
order_item_id: import("mongoose").Types.ObjectId;
|
|
115
|
+
}> | null | undefined;
|
|
116
|
+
}>> & import("mongoose").FlatRecord<{
|
|
117
|
+
createdAt: NativeDate;
|
|
118
|
+
updatedAt: NativeDate;
|
|
119
|
+
} & {
|
|
120
|
+
_id: import("mongoose").Types.ObjectId;
|
|
121
|
+
name: string;
|
|
122
|
+
order_id: import("mongoose").Types.ObjectId;
|
|
123
|
+
staff_id: string;
|
|
124
|
+
staff_name: string;
|
|
125
|
+
createdAt_mins: number;
|
|
126
|
+
createdAt: NativeDate;
|
|
127
|
+
updatedAt: NativeDate;
|
|
128
|
+
description: string;
|
|
129
|
+
order_number: number;
|
|
130
|
+
item_id: import("mongoose").Types.ObjectId;
|
|
131
|
+
quantity: number;
|
|
132
|
+
void_reason: string;
|
|
133
|
+
subtotal: number;
|
|
134
|
+
warehouse_id: string;
|
|
135
|
+
vendor_id: import("mongoose").Types.ObjectId;
|
|
136
|
+
vendor_name: string;
|
|
137
|
+
order_item_id: import("mongoose").Types.ObjectId;
|
|
138
|
+
void_type: import("../../constants").VOID_PURCHASE_ORDER_ITEM_TYPE_ENUM;
|
|
139
|
+
iteration: number;
|
|
140
|
+
total_adjusted_quantity: number;
|
|
141
|
+
total_adjusted_subtotal: number;
|
|
142
|
+
order_punched_at: NativeDate;
|
|
143
|
+
adjustments?: import("mongoose").Types.DocumentArray<{
|
|
144
|
+
_id: import("mongoose").Types.ObjectId;
|
|
145
|
+
order_id: import("mongoose").Types.ObjectId;
|
|
146
|
+
staff_id: string;
|
|
147
|
+
staff_name: string;
|
|
148
|
+
order_number: number;
|
|
149
|
+
quantity: number;
|
|
150
|
+
subtotal: number;
|
|
151
|
+
order_item_id: import("mongoose").Types.ObjectId;
|
|
152
|
+
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
153
|
+
_id: import("mongoose").Types.ObjectId;
|
|
154
|
+
order_id: import("mongoose").Types.ObjectId;
|
|
155
|
+
staff_id: string;
|
|
156
|
+
staff_name: string;
|
|
157
|
+
order_number: number;
|
|
158
|
+
quantity: number;
|
|
159
|
+
subtotal: number;
|
|
160
|
+
order_item_id: import("mongoose").Types.ObjectId;
|
|
161
|
+
}> & {
|
|
162
|
+
_id: import("mongoose").Types.ObjectId;
|
|
163
|
+
order_id: import("mongoose").Types.ObjectId;
|
|
164
|
+
staff_id: string;
|
|
165
|
+
staff_name: string;
|
|
166
|
+
order_number: number;
|
|
167
|
+
quantity: number;
|
|
168
|
+
subtotal: number;
|
|
169
|
+
order_item_id: import("mongoose").Types.ObjectId;
|
|
170
|
+
}> | null | undefined;
|
|
171
|
+
}> & Required<{
|
|
172
|
+
_id: import("mongoose").Types.ObjectId;
|
|
173
|
+
}> & {
|
|
174
|
+
__v: number;
|
|
175
|
+
}>;
|
|
176
|
+
export declare const VOID_PURCHASE_ORDER_ITEMS_COLLECTION_NAME = "void_purchase_order_items";
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VOID_PURCHASE_ORDER_ITEMS_COLLECTION_NAME = exports.VoidPurchaseOrderItemSchema = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const constants_1 = require("../../constants");
|
|
6
|
+
const purchase_orders_1 = require("./purchase_orders");
|
|
7
|
+
const warehouse_1 = require("./warehouse");
|
|
8
|
+
const warehouse_vendors_1 = require("./warehouse_vendors");
|
|
9
|
+
const VoidPurchaseOrderItemAdjustmentSchema = new mongoose_1.Schema({
|
|
10
|
+
_id: {
|
|
11
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
12
|
+
required: true,
|
|
13
|
+
immutable: true,
|
|
14
|
+
},
|
|
15
|
+
order_id: {
|
|
16
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
17
|
+
required: true,
|
|
18
|
+
immutable: true,
|
|
19
|
+
ref: purchase_orders_1.PURCHASE_ORDER_COLLECTION_NAME,
|
|
20
|
+
},
|
|
21
|
+
order_number: {
|
|
22
|
+
type: Number,
|
|
23
|
+
min: 0,
|
|
24
|
+
default: null,
|
|
25
|
+
},
|
|
26
|
+
order_item_id: {
|
|
27
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
28
|
+
required: true,
|
|
29
|
+
immutable: true,
|
|
30
|
+
},
|
|
31
|
+
quantity: {
|
|
32
|
+
type: Number,
|
|
33
|
+
required: true,
|
|
34
|
+
},
|
|
35
|
+
subtotal: {
|
|
36
|
+
type: Number,
|
|
37
|
+
min: 0,
|
|
38
|
+
required: true,
|
|
39
|
+
},
|
|
40
|
+
staff_id: {
|
|
41
|
+
type: String,
|
|
42
|
+
required: true,
|
|
43
|
+
},
|
|
44
|
+
staff_name: {
|
|
45
|
+
type: String,
|
|
46
|
+
required: true,
|
|
47
|
+
},
|
|
48
|
+
}, {
|
|
49
|
+
minimize: false,
|
|
50
|
+
});
|
|
51
|
+
exports.VoidPurchaseOrderItemSchema = new mongoose_1.Schema({
|
|
52
|
+
_id: {
|
|
53
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
54
|
+
required: true,
|
|
55
|
+
immutable: true,
|
|
56
|
+
},
|
|
57
|
+
warehouse_id: {
|
|
58
|
+
type: String,
|
|
59
|
+
required: true,
|
|
60
|
+
ref: warehouse_1.WAREHOUSE_SETTINGS_COLLECTION_NAME,
|
|
61
|
+
immutable: true,
|
|
62
|
+
},
|
|
63
|
+
order_id: {
|
|
64
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
65
|
+
required: true,
|
|
66
|
+
immutable: true,
|
|
67
|
+
ref: purchase_orders_1.PURCHASE_ORDER_COLLECTION_NAME,
|
|
68
|
+
},
|
|
69
|
+
order_number: {
|
|
70
|
+
type: Number,
|
|
71
|
+
min: 0,
|
|
72
|
+
default: null,
|
|
73
|
+
},
|
|
74
|
+
item_id: {
|
|
75
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
76
|
+
required: true,
|
|
77
|
+
immutable: true,
|
|
78
|
+
ref: 'items',
|
|
79
|
+
},
|
|
80
|
+
order_item_id: {
|
|
81
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
82
|
+
required: true,
|
|
83
|
+
immutable: true,
|
|
84
|
+
},
|
|
85
|
+
void_type: {
|
|
86
|
+
type: String,
|
|
87
|
+
required: true,
|
|
88
|
+
enum: constants_1.ALL_VOID_PURCHASE_ORDER_ITEM_TYPES,
|
|
89
|
+
},
|
|
90
|
+
vendor_id: {
|
|
91
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
92
|
+
required: true,
|
|
93
|
+
ref: warehouse_vendors_1.WAREHOUSE_VENDORS_COLLECTION_NAME,
|
|
94
|
+
},
|
|
95
|
+
vendor_name: {
|
|
96
|
+
type: String,
|
|
97
|
+
required: true,
|
|
98
|
+
},
|
|
99
|
+
staff_id: {
|
|
100
|
+
type: String,
|
|
101
|
+
required: true,
|
|
102
|
+
},
|
|
103
|
+
staff_name: {
|
|
104
|
+
type: String,
|
|
105
|
+
required: true,
|
|
106
|
+
},
|
|
107
|
+
void_reason: {
|
|
108
|
+
type: String,
|
|
109
|
+
required: true,
|
|
110
|
+
},
|
|
111
|
+
iteration: {
|
|
112
|
+
type: Number,
|
|
113
|
+
required: true,
|
|
114
|
+
},
|
|
115
|
+
name: {
|
|
116
|
+
type: String,
|
|
117
|
+
required: true,
|
|
118
|
+
},
|
|
119
|
+
quantity: {
|
|
120
|
+
type: Number,
|
|
121
|
+
required: true,
|
|
122
|
+
},
|
|
123
|
+
subtotal: {
|
|
124
|
+
type: Number,
|
|
125
|
+
min: 0,
|
|
126
|
+
required: true,
|
|
127
|
+
},
|
|
128
|
+
description: {
|
|
129
|
+
type: String,
|
|
130
|
+
required: true,
|
|
131
|
+
},
|
|
132
|
+
total_adjusted_quantity: {
|
|
133
|
+
type: Number,
|
|
134
|
+
required: true,
|
|
135
|
+
default: 0,
|
|
136
|
+
},
|
|
137
|
+
total_adjusted_subtotal: {
|
|
138
|
+
type: Number,
|
|
139
|
+
required: true,
|
|
140
|
+
default: 0,
|
|
141
|
+
},
|
|
142
|
+
adjustments: {
|
|
143
|
+
type: [VoidPurchaseOrderItemAdjustmentSchema],
|
|
144
|
+
required: false,
|
|
145
|
+
},
|
|
146
|
+
order_punched_at: {
|
|
147
|
+
type: mongoose_1.Schema.Types.Date,
|
|
148
|
+
required: true,
|
|
149
|
+
default: () => new Date(),
|
|
150
|
+
},
|
|
151
|
+
createdAt_mins: {
|
|
152
|
+
type: Number,
|
|
153
|
+
required: true,
|
|
154
|
+
immutable: true,
|
|
155
|
+
default: () => {
|
|
156
|
+
const date = new Date();
|
|
157
|
+
return Math.floor(date.getHours() * 60 + date.getMinutes());
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
createdAt: {
|
|
161
|
+
type: mongoose_1.Schema.Types.Date,
|
|
162
|
+
required: true,
|
|
163
|
+
default: () => new Date(),
|
|
164
|
+
immutable: true,
|
|
165
|
+
},
|
|
166
|
+
updatedAt: {
|
|
167
|
+
type: mongoose_1.Schema.Types.Date,
|
|
168
|
+
required: true,
|
|
169
|
+
default: () => new Date(),
|
|
170
|
+
},
|
|
171
|
+
}, {
|
|
172
|
+
timestamps: true,
|
|
173
|
+
versionKey: false,
|
|
174
|
+
minimize: false,
|
|
175
|
+
});
|
|
176
|
+
exports.VOID_PURCHASE_ORDER_ITEMS_COLLECTION_NAME = 'void_purchase_order_items';
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { Schema } from 'mongoose';
|
|
2
|
+
export declare const VoidWarehouseInvoiceItemSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
3
|
+
timestamps: true;
|
|
4
|
+
versionKey: false;
|
|
5
|
+
minimize: false;
|
|
6
|
+
}, {
|
|
7
|
+
createdAt: NativeDate;
|
|
8
|
+
updatedAt: NativeDate;
|
|
9
|
+
} & {
|
|
10
|
+
_id: import("mongoose").Types.ObjectId;
|
|
11
|
+
name: string;
|
|
12
|
+
order_id: import("mongoose").Types.ObjectId;
|
|
13
|
+
staff_id: string;
|
|
14
|
+
staff_name: string;
|
|
15
|
+
createdAt_mins: number;
|
|
16
|
+
createdAt: NativeDate;
|
|
17
|
+
updatedAt: NativeDate;
|
|
18
|
+
description: string;
|
|
19
|
+
order_number: number;
|
|
20
|
+
item_id: import("mongoose").Types.ObjectId;
|
|
21
|
+
quantity: number;
|
|
22
|
+
void_reason: string;
|
|
23
|
+
subtotal: number;
|
|
24
|
+
warehouse_id: string;
|
|
25
|
+
order_item_id: import("mongoose").Types.ObjectId;
|
|
26
|
+
void_type: import("../../constants").VOID_WAREHOUSE_INVOICE_ITEM_TYPE_ENUM;
|
|
27
|
+
iteration: number;
|
|
28
|
+
total_adjusted_quantity: number;
|
|
29
|
+
total_adjusted_subtotal: number;
|
|
30
|
+
order_punched_at: NativeDate;
|
|
31
|
+
client_id: import("mongoose").Types.ObjectId;
|
|
32
|
+
client_name: string;
|
|
33
|
+
adjustments?: import("mongoose").Types.DocumentArray<{
|
|
34
|
+
_id: import("mongoose").Types.ObjectId;
|
|
35
|
+
order_id: import("mongoose").Types.ObjectId;
|
|
36
|
+
staff_id: string;
|
|
37
|
+
staff_name: string;
|
|
38
|
+
order_number: number;
|
|
39
|
+
quantity: number;
|
|
40
|
+
subtotal: number;
|
|
41
|
+
order_item_id: import("mongoose").Types.ObjectId;
|
|
42
|
+
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
43
|
+
_id: import("mongoose").Types.ObjectId;
|
|
44
|
+
order_id: import("mongoose").Types.ObjectId;
|
|
45
|
+
staff_id: string;
|
|
46
|
+
staff_name: string;
|
|
47
|
+
order_number: number;
|
|
48
|
+
quantity: number;
|
|
49
|
+
subtotal: number;
|
|
50
|
+
order_item_id: import("mongoose").Types.ObjectId;
|
|
51
|
+
}> & {
|
|
52
|
+
_id: import("mongoose").Types.ObjectId;
|
|
53
|
+
order_id: import("mongoose").Types.ObjectId;
|
|
54
|
+
staff_id: string;
|
|
55
|
+
staff_name: string;
|
|
56
|
+
order_number: number;
|
|
57
|
+
quantity: number;
|
|
58
|
+
subtotal: number;
|
|
59
|
+
order_item_id: import("mongoose").Types.ObjectId;
|
|
60
|
+
}> | null | undefined;
|
|
61
|
+
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
62
|
+
createdAt: NativeDate;
|
|
63
|
+
updatedAt: NativeDate;
|
|
64
|
+
} & {
|
|
65
|
+
_id: import("mongoose").Types.ObjectId;
|
|
66
|
+
name: string;
|
|
67
|
+
order_id: import("mongoose").Types.ObjectId;
|
|
68
|
+
staff_id: string;
|
|
69
|
+
staff_name: string;
|
|
70
|
+
createdAt_mins: number;
|
|
71
|
+
createdAt: NativeDate;
|
|
72
|
+
updatedAt: NativeDate;
|
|
73
|
+
description: string;
|
|
74
|
+
order_number: number;
|
|
75
|
+
item_id: import("mongoose").Types.ObjectId;
|
|
76
|
+
quantity: number;
|
|
77
|
+
void_reason: string;
|
|
78
|
+
subtotal: number;
|
|
79
|
+
warehouse_id: string;
|
|
80
|
+
order_item_id: import("mongoose").Types.ObjectId;
|
|
81
|
+
void_type: import("../../constants").VOID_WAREHOUSE_INVOICE_ITEM_TYPE_ENUM;
|
|
82
|
+
iteration: number;
|
|
83
|
+
total_adjusted_quantity: number;
|
|
84
|
+
total_adjusted_subtotal: number;
|
|
85
|
+
order_punched_at: NativeDate;
|
|
86
|
+
client_id: import("mongoose").Types.ObjectId;
|
|
87
|
+
client_name: string;
|
|
88
|
+
adjustments?: import("mongoose").Types.DocumentArray<{
|
|
89
|
+
_id: import("mongoose").Types.ObjectId;
|
|
90
|
+
order_id: import("mongoose").Types.ObjectId;
|
|
91
|
+
staff_id: string;
|
|
92
|
+
staff_name: string;
|
|
93
|
+
order_number: number;
|
|
94
|
+
quantity: number;
|
|
95
|
+
subtotal: number;
|
|
96
|
+
order_item_id: import("mongoose").Types.ObjectId;
|
|
97
|
+
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
98
|
+
_id: import("mongoose").Types.ObjectId;
|
|
99
|
+
order_id: import("mongoose").Types.ObjectId;
|
|
100
|
+
staff_id: string;
|
|
101
|
+
staff_name: string;
|
|
102
|
+
order_number: number;
|
|
103
|
+
quantity: number;
|
|
104
|
+
subtotal: number;
|
|
105
|
+
order_item_id: import("mongoose").Types.ObjectId;
|
|
106
|
+
}> & {
|
|
107
|
+
_id: import("mongoose").Types.ObjectId;
|
|
108
|
+
order_id: import("mongoose").Types.ObjectId;
|
|
109
|
+
staff_id: string;
|
|
110
|
+
staff_name: string;
|
|
111
|
+
order_number: number;
|
|
112
|
+
quantity: number;
|
|
113
|
+
subtotal: number;
|
|
114
|
+
order_item_id: import("mongoose").Types.ObjectId;
|
|
115
|
+
}> | null | undefined;
|
|
116
|
+
}>> & import("mongoose").FlatRecord<{
|
|
117
|
+
createdAt: NativeDate;
|
|
118
|
+
updatedAt: NativeDate;
|
|
119
|
+
} & {
|
|
120
|
+
_id: import("mongoose").Types.ObjectId;
|
|
121
|
+
name: string;
|
|
122
|
+
order_id: import("mongoose").Types.ObjectId;
|
|
123
|
+
staff_id: string;
|
|
124
|
+
staff_name: string;
|
|
125
|
+
createdAt_mins: number;
|
|
126
|
+
createdAt: NativeDate;
|
|
127
|
+
updatedAt: NativeDate;
|
|
128
|
+
description: string;
|
|
129
|
+
order_number: number;
|
|
130
|
+
item_id: import("mongoose").Types.ObjectId;
|
|
131
|
+
quantity: number;
|
|
132
|
+
void_reason: string;
|
|
133
|
+
subtotal: number;
|
|
134
|
+
warehouse_id: string;
|
|
135
|
+
order_item_id: import("mongoose").Types.ObjectId;
|
|
136
|
+
void_type: import("../../constants").VOID_WAREHOUSE_INVOICE_ITEM_TYPE_ENUM;
|
|
137
|
+
iteration: number;
|
|
138
|
+
total_adjusted_quantity: number;
|
|
139
|
+
total_adjusted_subtotal: number;
|
|
140
|
+
order_punched_at: NativeDate;
|
|
141
|
+
client_id: import("mongoose").Types.ObjectId;
|
|
142
|
+
client_name: string;
|
|
143
|
+
adjustments?: import("mongoose").Types.DocumentArray<{
|
|
144
|
+
_id: import("mongoose").Types.ObjectId;
|
|
145
|
+
order_id: import("mongoose").Types.ObjectId;
|
|
146
|
+
staff_id: string;
|
|
147
|
+
staff_name: string;
|
|
148
|
+
order_number: number;
|
|
149
|
+
quantity: number;
|
|
150
|
+
subtotal: number;
|
|
151
|
+
order_item_id: import("mongoose").Types.ObjectId;
|
|
152
|
+
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
153
|
+
_id: import("mongoose").Types.ObjectId;
|
|
154
|
+
order_id: import("mongoose").Types.ObjectId;
|
|
155
|
+
staff_id: string;
|
|
156
|
+
staff_name: string;
|
|
157
|
+
order_number: number;
|
|
158
|
+
quantity: number;
|
|
159
|
+
subtotal: number;
|
|
160
|
+
order_item_id: import("mongoose").Types.ObjectId;
|
|
161
|
+
}> & {
|
|
162
|
+
_id: import("mongoose").Types.ObjectId;
|
|
163
|
+
order_id: import("mongoose").Types.ObjectId;
|
|
164
|
+
staff_id: string;
|
|
165
|
+
staff_name: string;
|
|
166
|
+
order_number: number;
|
|
167
|
+
quantity: number;
|
|
168
|
+
subtotal: number;
|
|
169
|
+
order_item_id: import("mongoose").Types.ObjectId;
|
|
170
|
+
}> | null | undefined;
|
|
171
|
+
}> & Required<{
|
|
172
|
+
_id: import("mongoose").Types.ObjectId;
|
|
173
|
+
}> & {
|
|
174
|
+
__v: number;
|
|
175
|
+
}>;
|
|
176
|
+
export declare const VOID_WAREHOUSE_INVOICE_ITEMS_COLLECTION_NAME = "void_warehouse_invoice_items";
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VOID_WAREHOUSE_INVOICE_ITEMS_COLLECTION_NAME = exports.VoidWarehouseInvoiceItemSchema = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const constants_1 = require("../../constants");
|
|
6
|
+
const warehouse_1 = require("./warehouse");
|
|
7
|
+
const warehouse_clients_1 = require("./warehouse_clients");
|
|
8
|
+
const warehouse_invoices_1 = require("./warehouse_invoices");
|
|
9
|
+
const VoidWarehouseInvoiceItemAdjustmentSchema = new mongoose_1.Schema({
|
|
10
|
+
_id: {
|
|
11
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
12
|
+
required: true,
|
|
13
|
+
immutable: true,
|
|
14
|
+
},
|
|
15
|
+
order_id: {
|
|
16
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
17
|
+
required: true,
|
|
18
|
+
immutable: true,
|
|
19
|
+
ref: warehouse_invoices_1.WAREHOUSE_INVOICES_COLLECTION_NAME,
|
|
20
|
+
},
|
|
21
|
+
order_number: {
|
|
22
|
+
type: Number,
|
|
23
|
+
min: 0,
|
|
24
|
+
default: null,
|
|
25
|
+
},
|
|
26
|
+
order_item_id: {
|
|
27
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
28
|
+
required: true,
|
|
29
|
+
immutable: true,
|
|
30
|
+
},
|
|
31
|
+
quantity: {
|
|
32
|
+
type: Number,
|
|
33
|
+
required: true,
|
|
34
|
+
},
|
|
35
|
+
subtotal: {
|
|
36
|
+
type: Number,
|
|
37
|
+
min: 0,
|
|
38
|
+
required: true,
|
|
39
|
+
},
|
|
40
|
+
staff_id: {
|
|
41
|
+
type: String,
|
|
42
|
+
required: true,
|
|
43
|
+
},
|
|
44
|
+
staff_name: {
|
|
45
|
+
type: String,
|
|
46
|
+
required: true,
|
|
47
|
+
},
|
|
48
|
+
}, {
|
|
49
|
+
minimize: false,
|
|
50
|
+
});
|
|
51
|
+
exports.VoidWarehouseInvoiceItemSchema = new mongoose_1.Schema({
|
|
52
|
+
_id: {
|
|
53
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
54
|
+
required: true,
|
|
55
|
+
immutable: true,
|
|
56
|
+
},
|
|
57
|
+
warehouse_id: {
|
|
58
|
+
type: String,
|
|
59
|
+
required: true,
|
|
60
|
+
ref: warehouse_1.WAREHOUSE_SETTINGS_COLLECTION_NAME,
|
|
61
|
+
immutable: true,
|
|
62
|
+
},
|
|
63
|
+
order_id: {
|
|
64
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
65
|
+
required: true,
|
|
66
|
+
immutable: true,
|
|
67
|
+
ref: warehouse_invoices_1.WAREHOUSE_INVOICES_COLLECTION_NAME,
|
|
68
|
+
},
|
|
69
|
+
order_number: {
|
|
70
|
+
type: Number,
|
|
71
|
+
min: 0,
|
|
72
|
+
default: null,
|
|
73
|
+
},
|
|
74
|
+
item_id: {
|
|
75
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
76
|
+
required: true,
|
|
77
|
+
immutable: true,
|
|
78
|
+
ref: 'items',
|
|
79
|
+
},
|
|
80
|
+
order_item_id: {
|
|
81
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
82
|
+
required: true,
|
|
83
|
+
immutable: true,
|
|
84
|
+
},
|
|
85
|
+
void_type: {
|
|
86
|
+
type: String,
|
|
87
|
+
required: true,
|
|
88
|
+
enum: constants_1.ALL_VOID_WAREHOUSE_INVOICE_ITEM_TYPES,
|
|
89
|
+
},
|
|
90
|
+
client_id: {
|
|
91
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
92
|
+
required: true,
|
|
93
|
+
ref: warehouse_clients_1.WAREHOUSE_CLIENTS_COLLECTION_NAME,
|
|
94
|
+
},
|
|
95
|
+
client_name: {
|
|
96
|
+
type: String,
|
|
97
|
+
required: true,
|
|
98
|
+
},
|
|
99
|
+
staff_id: {
|
|
100
|
+
type: String,
|
|
101
|
+
required: true,
|
|
102
|
+
},
|
|
103
|
+
staff_name: {
|
|
104
|
+
type: String,
|
|
105
|
+
required: true,
|
|
106
|
+
},
|
|
107
|
+
void_reason: {
|
|
108
|
+
type: String,
|
|
109
|
+
required: true,
|
|
110
|
+
},
|
|
111
|
+
iteration: {
|
|
112
|
+
type: Number,
|
|
113
|
+
required: true,
|
|
114
|
+
},
|
|
115
|
+
name: {
|
|
116
|
+
type: String,
|
|
117
|
+
required: true,
|
|
118
|
+
},
|
|
119
|
+
quantity: {
|
|
120
|
+
type: Number,
|
|
121
|
+
required: true,
|
|
122
|
+
},
|
|
123
|
+
subtotal: {
|
|
124
|
+
type: Number,
|
|
125
|
+
min: 0,
|
|
126
|
+
required: true,
|
|
127
|
+
},
|
|
128
|
+
description: {
|
|
129
|
+
type: String,
|
|
130
|
+
required: true,
|
|
131
|
+
},
|
|
132
|
+
total_adjusted_quantity: {
|
|
133
|
+
type: Number,
|
|
134
|
+
required: true,
|
|
135
|
+
default: 0,
|
|
136
|
+
},
|
|
137
|
+
total_adjusted_subtotal: {
|
|
138
|
+
type: Number,
|
|
139
|
+
required: true,
|
|
140
|
+
default: 0,
|
|
141
|
+
},
|
|
142
|
+
adjustments: {
|
|
143
|
+
type: [VoidWarehouseInvoiceItemAdjustmentSchema],
|
|
144
|
+
required: false,
|
|
145
|
+
},
|
|
146
|
+
order_punched_at: {
|
|
147
|
+
type: mongoose_1.Schema.Types.Date,
|
|
148
|
+
required: true,
|
|
149
|
+
default: () => new Date(),
|
|
150
|
+
},
|
|
151
|
+
createdAt_mins: {
|
|
152
|
+
type: Number,
|
|
153
|
+
required: true,
|
|
154
|
+
immutable: true,
|
|
155
|
+
default: () => {
|
|
156
|
+
const date = new Date();
|
|
157
|
+
return Math.floor(date.getHours() * 60 + date.getMinutes());
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
createdAt: {
|
|
161
|
+
type: mongoose_1.Schema.Types.Date,
|
|
162
|
+
required: true,
|
|
163
|
+
default: () => new Date(),
|
|
164
|
+
immutable: true,
|
|
165
|
+
},
|
|
166
|
+
updatedAt: {
|
|
167
|
+
type: mongoose_1.Schema.Types.Date,
|
|
168
|
+
required: true,
|
|
169
|
+
default: () => new Date(),
|
|
170
|
+
},
|
|
171
|
+
}, {
|
|
172
|
+
timestamps: true,
|
|
173
|
+
versionKey: false,
|
|
174
|
+
minimize: false,
|
|
175
|
+
});
|
|
176
|
+
exports.VOID_WAREHOUSE_INVOICE_ITEMS_COLLECTION_NAME = 'void_warehouse_invoice_items';
|
|
@@ -54,6 +54,8 @@ export * from './tokens';
|
|
|
54
54
|
export * from './track_order_number';
|
|
55
55
|
export * from './vouchers';
|
|
56
56
|
export * from './void_order_items';
|
|
57
|
+
export * from './void_purchase_order_items';
|
|
58
|
+
export * from './void_warehouse_invoice_items';
|
|
57
59
|
export * from './wallet';
|
|
58
60
|
export * from './wallet_transactions';
|
|
59
61
|
export * from './warehouse';
|
|
@@ -70,6 +70,8 @@ __exportStar(require("./tokens"), exports);
|
|
|
70
70
|
__exportStar(require("./track_order_number"), exports);
|
|
71
71
|
__exportStar(require("./vouchers"), exports);
|
|
72
72
|
__exportStar(require("./void_order_items"), exports);
|
|
73
|
+
__exportStar(require("./void_purchase_order_items"), exports);
|
|
74
|
+
__exportStar(require("./void_warehouse_invoice_items"), exports);
|
|
73
75
|
__exportStar(require("./wallet"), exports);
|
|
74
76
|
__exportStar(require("./wallet_transactions"), exports);
|
|
75
77
|
__exportStar(require("./warehouse"), exports);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { VOID_PURCHASE_ORDER_ITEM_TYPE_ENUM } from '../../constants';
|
|
2
|
+
export interface IVoidPurchaseOrderItemAdjustment {
|
|
3
|
+
_id: string;
|
|
4
|
+
order_id: string;
|
|
5
|
+
order_number: number | null;
|
|
6
|
+
order_item_id: string;
|
|
7
|
+
quantity: number;
|
|
8
|
+
subtotal: number;
|
|
9
|
+
staff_id: string;
|
|
10
|
+
staff_name: string;
|
|
11
|
+
}
|
|
12
|
+
export interface IVoidPurchaseOrderItem {
|
|
13
|
+
_id: string;
|
|
14
|
+
warehouse_id: string;
|
|
15
|
+
order_id: string;
|
|
16
|
+
order_number: number | null;
|
|
17
|
+
item_id: string;
|
|
18
|
+
order_item_id: string;
|
|
19
|
+
void_type: VOID_PURCHASE_ORDER_ITEM_TYPE_ENUM;
|
|
20
|
+
vendor_id: string;
|
|
21
|
+
vendor_name: string;
|
|
22
|
+
staff_id: string;
|
|
23
|
+
staff_name: string;
|
|
24
|
+
void_reason: string;
|
|
25
|
+
iteration: number;
|
|
26
|
+
name: string;
|
|
27
|
+
quantity: number;
|
|
28
|
+
subtotal: number;
|
|
29
|
+
description: string;
|
|
30
|
+
total_adjusted_quantity: number;
|
|
31
|
+
total_adjusted_subtotal: number;
|
|
32
|
+
adjustments?: IVoidPurchaseOrderItemAdjustment[] | null;
|
|
33
|
+
order_punched_at: Date;
|
|
34
|
+
createdAt_mins: number;
|
|
35
|
+
createdAt: Date;
|
|
36
|
+
updatedAt: Date;
|
|
37
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { VOID_WAREHOUSE_INVOICE_ITEM_TYPE_ENUM } from '../../constants';
|
|
2
|
+
export interface IVoidWarehouseInvoiceItemAdjustment {
|
|
3
|
+
_id: string;
|
|
4
|
+
order_id: string;
|
|
5
|
+
order_number: number | null;
|
|
6
|
+
order_item_id: string;
|
|
7
|
+
quantity: number;
|
|
8
|
+
subtotal: number;
|
|
9
|
+
staff_id: string;
|
|
10
|
+
staff_name: string;
|
|
11
|
+
}
|
|
12
|
+
export interface IVoidWarehouseInvoiceItem {
|
|
13
|
+
_id: string;
|
|
14
|
+
warehouse_id: string;
|
|
15
|
+
order_id: string;
|
|
16
|
+
order_number: number | null;
|
|
17
|
+
item_id: string;
|
|
18
|
+
order_item_id: string;
|
|
19
|
+
void_type: VOID_WAREHOUSE_INVOICE_ITEM_TYPE_ENUM;
|
|
20
|
+
client_id: string;
|
|
21
|
+
client_name: string;
|
|
22
|
+
staff_id: string;
|
|
23
|
+
staff_name: string;
|
|
24
|
+
void_reason: string;
|
|
25
|
+
iteration: number;
|
|
26
|
+
name: string;
|
|
27
|
+
quantity: number;
|
|
28
|
+
subtotal: number;
|
|
29
|
+
description: string;
|
|
30
|
+
total_adjusted_quantity: number;
|
|
31
|
+
total_adjusted_subtotal: number;
|
|
32
|
+
adjustments?: IVoidWarehouseInvoiceItemAdjustment[] | null;
|
|
33
|
+
order_punched_at: Date;
|
|
34
|
+
createdAt_mins: number;
|
|
35
|
+
createdAt: Date;
|
|
36
|
+
updatedAt: Date;
|
|
37
|
+
}
|