@managesome/eposmatic-toolkit 0.2.769 → 0.2.771

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 (57) hide show
  1. package/lib/helpers/utils/receipt-engine.js +10 -2
  2. package/lib/tests/classic-specials-quantity.test.js +7 -4
  3. package/lib/tests/receipt-engine.test.js +79 -0
  4. package/package.json +1 -1
  5. package/lib/constants/MATERIALIZED_REPORTS.d.ts +0 -44
  6. package/lib/constants/MATERIALIZED_REPORTS.js +0 -58
  7. package/lib/constants/WAREHOUSE_INVOICE.d.ts +0 -14
  8. package/lib/constants/WAREHOUSE_INVOICE.js +0 -35
  9. package/lib/helpers/offer/generate-offer.d.ts +0 -11
  10. package/lib/helpers/offer/generate-offer.js +0 -143
  11. package/lib/helpers/offer/index.d.ts +0 -1
  12. package/lib/helpers/offer/index.js +0 -17
  13. package/lib/helpers/order/generate-warehouse-invoice.d.ts +0 -11
  14. package/lib/helpers/order/generate-warehouse-invoice.js +0 -196
  15. package/lib/helpers/store/all-warehouse-invoice-actions.d.ts +0 -13
  16. package/lib/helpers/store/all-warehouse-invoice-actions.js +0 -58
  17. package/lib/helpers/store/common-warehouse-invoice-actions.d.ts +0 -31
  18. package/lib/helpers/store/common-warehouse-invoice-actions.js +0 -545
  19. package/lib/helpers/store/warehouse-invoice-cart-actions.d.ts +0 -24
  20. package/lib/helpers/store/warehouse-invoice-cart-actions.js +0 -486
  21. package/lib/helpers/types/sockets.d.ts +0 -6
  22. package/lib/helpers/types/sockets.js +0 -2
  23. package/lib/helpers/types/warehouse-invoice-cart-actions.d.ts +0 -26
  24. package/lib/helpers/types/warehouse-invoice-cart-actions.js +0 -2
  25. package/lib/helpers/utils/materialized-report-helpers.d.ts +0 -35
  26. package/lib/helpers/utils/materialized-report-helpers.js +0 -73
  27. package/lib/helpers/utils/void-warehouse-invoice-items-helpers.d.ts +0 -3
  28. package/lib/helpers/utils/void-warehouse-invoice-items-helpers.js +0 -38
  29. package/lib/helpers/utils/void-warehouse-invoice-items-report-helpers.d.ts +0 -13
  30. package/lib/helpers/utils/void-warehouse-invoice-items-report-helpers.js +0 -22
  31. package/lib/helpers/utils/warehouse-invoice-order-engine.d.ts +0 -11
  32. package/lib/helpers/utils/warehouse-invoice-order-engine.js +0 -39
  33. package/lib/helpers/utils/warehouse-invoice-x-report-helpers.d.ts +0 -58
  34. package/lib/helpers/utils/warehouse-invoice-x-report-helpers.js +0 -1432
  35. package/lib/schemas/models/inventory_department_transactions.d.ts +0 -86
  36. package/lib/schemas/models/inventory_department_transactions.js +0 -116
  37. package/lib/schemas/models/inventory_department_utilities.d.ts +0 -108
  38. package/lib/schemas/models/inventory_department_utilities.js +0 -88
  39. package/lib/schemas/models/inventory_departments.d.ts +0 -53
  40. package/lib/schemas/models/inventory_departments.js +0 -58
  41. package/lib/schemas/models/inventory_entries.d.ts +0 -152
  42. package/lib/schemas/models/inventory_entries.js +0 -142
  43. package/lib/schemas/models/materialized_reports.d.ts +0 -277
  44. package/lib/schemas/models/materialized_reports.js +0 -60
  45. package/lib/schemas/models/warehouse_invoices.d.ts +0 -2675
  46. package/lib/schemas/models/warehouse_invoices.js +0 -327
  47. package/lib/schemas/models/warehouse_void_invoice_items.d.ts +0 -176
  48. package/lib/schemas/models/warehouse_void_invoice_items.js +0 -176
  49. package/lib/schemas/types/inventory_entries.d.ts +0 -41
  50. package/lib/schemas/types/inventory_entries.js +0 -2
  51. package/lib/schemas/types/materialized_reports.d.ts +0 -82
  52. package/lib/schemas/types/materialized_reports.js +0 -2
  53. package/lib/schemas/types/warehouse_invoices.d.ts +0 -69
  54. package/lib/schemas/types/warehouse_invoices.js +0 -2
  55. package/lib/schemas/types/warehouse_void_invoice_items.d.ts +0 -37
  56. package/lib/schemas/types/warehouse_void_invoice_items.js +0 -2
  57. package/lib/tests/materialized-report-helpers.test.d.ts +0 -1
@@ -1,13 +0,0 @@
1
- import { CURRENCY_SYMBOL_ENUM } from '../../constants';
2
- import { IWarehouseVoidInvoiceItem } from '../../schemas';
3
- export interface IWarehouseVoidInvoiceItemsReportProps {
4
- data: IWarehouseVoidInvoiceItem[];
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: IWarehouseVoidInvoiceItemsReportProps): string;
13
- export declare function getVoidWarehouseInvoiceItemsReportReceiptHtml(props: IWarehouseVoidInvoiceItemsReportProps): string;
@@ -1,22 +0,0 @@
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
- }
@@ -1,11 +0,0 @@
1
- import { IWarehouseClientInvoiceItem, IWarehouseItem } from '../../schemas';
2
- interface IConvertWarehouseItemToWarehouseClientInvoiceItemParams {
3
- clientId: string;
4
- item: IWarehouseItem;
5
- defaultQuantity?: number;
6
- orderItem?: IWarehouseClientInvoiceItem;
7
- shouldUseAvgPrice?: boolean;
8
- }
9
- export declare function convertWarehouseItemToWarehouseClientInvoiceItem({ clientId, item, defaultQuantity, orderItem, shouldUseAvgPrice, }: IConvertWarehouseItemToWarehouseClientInvoiceItemParams): IWarehouseClientInvoiceItem;
10
- export declare function getCurrentWarehouseClientInvoiceItemTotalPrice(orderItem: IWarehouseClientInvoiceItem): number;
11
- export {};
@@ -1,39 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.convertWarehouseItemToWarehouseClientInvoiceItem = convertWarehouseItemToWarehouseClientInvoiceItem;
7
- exports.getCurrentWarehouseClientInvoiceItemTotalPrice = getCurrentWarehouseClientInvoiceItemTotalPrice;
8
- const bson_objectid_1 = __importDefault(require("bson-objectid"));
9
- const warehouse_catalog_conversion_1 = require("./warehouse-catalog-conversion");
10
- function convertWarehouseItemToWarehouseClientInvoiceItem({ clientId, item, defaultQuantity = 1, orderItem, shouldUseAvgPrice, }) {
11
- const { _id = (0, bson_objectid_1.default)().toHexString(), quantity = defaultQuantity, special_instructions = '', is_ready, } = orderItem ?? {};
12
- let newPrice = (0, warehouse_catalog_conversion_1.getWarehouseGeneralPriceEnum)(item.selling_price, clientId) || item.purchase_price?.BASE_PRICE || 0;
13
- if (shouldUseAvgPrice && orderItem == null) {
14
- newPrice = item.unit_price || newPrice;
15
- }
16
- const warehouseClientInvoiceItem = {
17
- _id,
18
- item_id: item._id,
19
- name: item.name,
20
- price: newPrice,
21
- subtotal: newPrice * quantity,
22
- quantity,
23
- special_instructions,
24
- is_ready,
25
- // These values will be auto calculated
26
- _discount_amount: 0,
27
- _gross_amount: 0,
28
- _gst_amount: 0,
29
- _net_amount: 0,
30
- };
31
- return warehouseClientInvoiceItem;
32
- }
33
- // ==========================================================><====================================================
34
- function getCurrentWarehouseClientInvoiceItemTotalPrice(orderItem) {
35
- // For warehouse client invoices, total is simply price * quantity
36
- // No modifiers, discounts, etc.
37
- const total = orderItem.price * orderItem.quantity;
38
- return total;
39
- }
@@ -1,58 +0,0 @@
1
- import { COUNTRY_ALPHA_2_ENUM, CURRENCY_SYMBOL_ENUM, IWarehouseInvoiceXReport } from '../../constants';
2
- interface IWarehouseFooterDetail {
3
- amount: number;
4
- count: number;
5
- title: string;
6
- sortIndex: number;
7
- }
8
- export interface IWarehouseUsableInvoiceXReportSubChannel {
9
- _id: string;
10
- ref: string | number;
11
- title: string;
12
- count: number;
13
- amount: number;
14
- strikeThrough?: boolean;
15
- bold?: boolean;
16
- sortIndex: number;
17
- }
18
- export interface IWarehouseUsableInvoiceXReportChannel {
19
- _id: string;
20
- ref: string;
21
- title: string;
22
- sortIndex: number;
23
- footerDetails: IWarehouseFooterDetail[];
24
- subChannels: IWarehouseUsableInvoiceXReportSubChannel[];
25
- }
26
- export interface IWarehouseUsableInvoiceXReportData {
27
- _id: string;
28
- title: string;
29
- netSale: number;
30
- netWithoutGst: number;
31
- netWithoutGstSubtitle: string;
32
- totalOrders: number;
33
- unpaidOrders: number;
34
- unpaidAmount: number;
35
- amountCollected: number;
36
- itemSales: number;
37
- channels: IWarehouseUsableInvoiceXReportChannel[];
38
- }
39
- export interface IWarehouseInvoiceXReportProps {
40
- from: Date;
41
- to: Date;
42
- clientWiseData: IWarehouseUsableInvoiceXReportData[];
43
- combinedData?: IWarehouseUsableInvoiceXReportData;
44
- currency_symbol: CURRENCY_SYMBOL_ENUM | undefined;
45
- warehouseName: string | undefined;
46
- isFilterApplied: boolean;
47
- }
48
- interface IWarehouseUsableData {
49
- clientWiseData: IWarehouseUsableInvoiceXReportData[];
50
- combinedData: IWarehouseUsableInvoiceXReportData;
51
- }
52
- interface IWarehouseInvoiceXReportHtmlProps extends IWarehouseInvoiceXReportProps {
53
- width?: number;
54
- monochrome?: boolean;
55
- }
56
- export declare function getWarehouseInvoiceXReportHtml({ width, monochrome, clientWiseData, combinedData, currency_symbol, from, to, warehouseName, isFilterApplied, }: IWarehouseInvoiceXReportHtmlProps): string;
57
- export declare const getWarehouseInvoiceXReportData: (data: IWarehouseInvoiceXReport, currencySymbol: CURRENCY_SYMBOL_ENUM | undefined, countryAlpha2: COUNTRY_ALPHA_2_ENUM | undefined) => IWarehouseUsableData;
58
- export {};