@managesome/eposmatic-toolkit 0.2.393 → 0.2.394

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,5 +1,5 @@
1
1
  import { SALES_SUMMARY_ENUM } from './ANALYTICS';
2
- import { PURCHASE_ORDER_STATUS_ENUM, SALE_ORDER_INVOICE_TYPE_ENUM, SALES_ORDER_STATUS_ENUM, WAREHOUSE_INVOICE_STATUS_ENUM } from './ENUMS';
2
+ import { PURCHASE_ORDER_STATUS_ENUM, SALE_ORDER_FIN_DOC_KIND_ENUM, SALE_ORDER_INVOICE_TYPE_ENUM, SALES_ORDER_STATUS_ENUM, WAREHOUSE_INVOICE_STATUS_ENUM } from './ENUMS';
3
3
  export declare enum WAREHOUSE_DASHBOARD_ANALYTICS_ENUM {
4
4
  PURCHASE_ORDERS = "PURCHASE_ORDERS",
5
5
  INVOICES = "INVOICES"
@@ -63,6 +63,8 @@ export interface ISaleOrderInvoiceEntry {
63
63
  invoiceType: SALE_ORDER_INVOICE_TYPE_ENUM;
64
64
  paymentType: string;
65
65
  amount: number;
66
+ /** Present for credit-note entries so the UI can show a distinguishing icon. */
67
+ docKind?: SALE_ORDER_FIN_DOC_KIND_ENUM;
66
68
  }
67
69
  export interface ISaleOrdersOverview {
68
70
  _id: string;
@@ -52,6 +52,7 @@ export * from './review-helpers';
52
52
  export * from './rider-tracking';
53
53
  export * from './riders-report-helpers';
54
54
  export * from './sale-order-x-report-helpers';
55
+ export { getSaleXReportData, getSaleXReportHtml } from './sale-x-report-helpers';
55
56
  export * from './sales-comparison-report-helpers';
56
57
  export * from './sales-comparitive-report-helpers';
57
58
  export * from './sales-overview-report-helpers';
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.getSaleXReportHtml = exports.getSaleXReportData = void 0;
17
18
  __exportStar(require("./cart-helpers"), exports);
18
19
  __exportStar(require("./cash_in_hand_transactions"), exports);
19
20
  __exportStar(require("./catalog-conversion"), exports);
@@ -68,6 +69,9 @@ __exportStar(require("./review-helpers"), exports);
68
69
  __exportStar(require("./rider-tracking"), exports);
69
70
  __exportStar(require("./riders-report-helpers"), exports);
70
71
  __exportStar(require("./sale-order-x-report-helpers"), exports);
72
+ var sale_x_report_helpers_1 = require("./sale-x-report-helpers");
73
+ Object.defineProperty(exports, "getSaleXReportData", { enumerable: true, get: function () { return sale_x_report_helpers_1.getSaleXReportData; } });
74
+ Object.defineProperty(exports, "getSaleXReportHtml", { enumerable: true, get: function () { return sale_x_report_helpers_1.getSaleXReportHtml; } });
71
75
  __exportStar(require("./sales-comparison-report-helpers"), exports);
72
76
  __exportStar(require("./sales-comparitive-report-helpers"), exports);
73
77
  __exportStar(require("./sales-overview-report-helpers"), exports);
@@ -1,7 +1,7 @@
1
1
  import { COUNTRY_ALPHA_2_ENUM, CURRENCY_SYMBOL_ENUM, ISaleOrderXReport } from '../../constants';
2
- import { IUsableInvoiceXReportChannel, IUsableInvoiceXReportSubChannel } from './invoice-x-report-helpers';
3
- export type IUsableSaleOrderXReportSubChannel = IUsableInvoiceXReportSubChannel;
4
- export type IUsableSaleOrderXReportChannel = IUsableInvoiceXReportChannel;
2
+ import { IUsableSaleXReportChannel, IUsableSaleXReportSubChannel } from './sale-x-report-helpers';
3
+ export type IUsableSaleOrderXReportSubChannel = IUsableSaleXReportSubChannel;
4
+ export type IUsableSaleOrderXReportChannel = IUsableSaleXReportChannel;
5
5
  export interface IUsableSaleOrderXReportData {
6
6
  _id: string;
7
7
  title: string;
@@ -30,14 +30,13 @@ export interface IUsableSaleOrderXReportResult {
30
30
  }
31
31
  /**
32
32
  * Transforms raw sale-order x-report aggregation output into
33
- * UI-usable data. Delegates to the shared invoice-x-report
34
- * data pipeline (ISaleOrderXReport is structurally compatible
35
- * with IInvoiceXReport).
33
+ * Delegates to the sale-x-report data pipeline which derives
34
+ * netSale from payment data and handles GST consistently.
36
35
  */
37
36
  export declare const getSaleOrderXReportData: (data: ISaleOrderXReport, currencySymbol: CURRENCY_SYMBOL_ENUM | undefined, countryAlpha2: COUNTRY_ALPHA_2_ENUM | undefined) => IUsableSaleOrderXReportResult;
38
37
  /**
39
38
  * Generates an HTML x-report for a sale order.
40
- * Delegates to the shared invoice-x-report HTML generator.
39
+ * Delegates to the sale-x-report HTML generator.
41
40
  */
42
41
  export declare const getSaleOrderXReportHtml: (props: ISaleOrderXReportProps & {
43
42
  width?: number;
@@ -1,23 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getSaleOrderXReportHtml = exports.getSaleOrderXReportData = void 0;
4
- const invoice_x_report_helpers_1 = require("./invoice-x-report-helpers");
4
+ const sale_x_report_helpers_1 = require("./sale-x-report-helpers");
5
5
  // --- Functions ---
6
6
  /**
7
7
  * Transforms raw sale-order x-report aggregation output into
8
- * UI-usable data. Delegates to the shared invoice-x-report
9
- * data pipeline (ISaleOrderXReport is structurally compatible
10
- * with IInvoiceXReport).
8
+ * Delegates to the sale-x-report data pipeline which derives
9
+ * netSale from payment data and handles GST consistently.
11
10
  */
12
11
  const getSaleOrderXReportData = (data, currencySymbol, countryAlpha2) => {
13
- return (0, invoice_x_report_helpers_1.getInvoiceXReportData)(data, currencySymbol, countryAlpha2);
12
+ return (0, sale_x_report_helpers_1.getSaleXReportData)(data, currencySymbol, countryAlpha2);
14
13
  };
15
14
  exports.getSaleOrderXReportData = getSaleOrderXReportData;
16
15
  /**
17
16
  * Generates an HTML x-report for a sale order.
18
- * Delegates to the shared invoice-x-report HTML generator.
17
+ * Delegates to the sale-x-report HTML generator.
19
18
  */
20
19
  const getSaleOrderXReportHtml = (props) => {
21
- return (0, invoice_x_report_helpers_1.getInvoiceXReportHtml)(props);
20
+ return (0, sale_x_report_helpers_1.getSaleXReportHtml)(props);
22
21
  };
23
22
  exports.getSaleOrderXReportHtml = getSaleOrderXReportHtml;
@@ -0,0 +1,58 @@
1
+ import { COUNTRY_ALPHA_2_ENUM, CURRENCY_SYMBOL_ENUM, ISaleOrderXReport } from '../../constants';
2
+ interface IFooterDetail {
3
+ amount: number;
4
+ count: number;
5
+ title: string;
6
+ sortIndex: number;
7
+ }
8
+ export interface IUsableSaleXReportSubChannel {
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 IUsableSaleXReportChannel {
19
+ _id: string;
20
+ ref: string;
21
+ title: string;
22
+ sortIndex: number;
23
+ footerDetails: IFooterDetail[];
24
+ subChannels: IUsableSaleXReportSubChannel[];
25
+ }
26
+ export interface IUsableSaleXReportData {
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: IUsableSaleXReportChannel[];
38
+ }
39
+ export interface ISaleXReportProps {
40
+ from: Date;
41
+ to: Date;
42
+ clientWiseData: IUsableSaleXReportData[];
43
+ combinedData?: IUsableSaleXReportData;
44
+ currency_symbol: CURRENCY_SYMBOL_ENUM | undefined;
45
+ warehouseName: string | undefined;
46
+ isFilterApplied: boolean;
47
+ }
48
+ interface IUsableData {
49
+ clientWiseData: IUsableSaleXReportData[];
50
+ combinedData: IUsableSaleXReportData;
51
+ }
52
+ interface IProps extends ISaleXReportProps {
53
+ width?: number;
54
+ monochrome?: boolean;
55
+ }
56
+ export declare function getSaleXReportHtml({ width, monochrome, clientWiseData, combinedData, currency_symbol, from, to, warehouseName, isFilterApplied, }: IProps): string;
57
+ export declare const getSaleXReportData: (data: ISaleOrderXReport, currencySymbol: CURRENCY_SYMBOL_ENUM | undefined, countryAlpha2: COUNTRY_ALPHA_2_ENUM | undefined) => IUsableData;
58
+ export {};