@managesome/eposmatic-toolkit 0.2.431 → 0.2.432
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 +0 -289
- package/lib/constants/ENUMS.js +2 -393
- package/lib/constants/PURCHASE_ORDER.d.ts +5 -3
- package/lib/constants/PURCHASE_ORDER.js +58 -20
- package/lib/constants/WAREHOUSE_ANALYTICS.d.ts +41 -41
- package/lib/constants/WAREHOUSE_ANALYTICS.js +28 -28
- package/lib/constants/WAREHOUSE_ENUMS.d.ts +289 -0
- package/lib/constants/WAREHOUSE_ENUMS.js +392 -0
- package/lib/constants/WAREHOUSE_INVOICE.js +10 -10
- package/lib/constants/index.d.ts +1 -0
- package/lib/constants/index.js +1 -0
- package/lib/helpers/order/generate-purchase-order-rfq.d.ts +3 -3
- package/lib/helpers/order/generate-purchase-order-rfq.js +2 -2
- package/lib/helpers/order/generate-purchase-order.d.ts +8 -8
- package/lib/helpers/order/generate-purchase-order.js +2 -2
- package/lib/helpers/order/generate-warehouse-purchase-order-rfq.d.ts +3 -0
- package/lib/helpers/order/generate-warehouse-purchase-order-rfq.js +64 -0
- package/lib/helpers/order/generate-warehouse-purchase-order.d.ts +11 -0
- package/lib/helpers/order/generate-warehouse-purchase-order.js +196 -0
- package/lib/helpers/order/index.d.ts +2 -2
- package/lib/helpers/order/index.js +2 -2
- package/lib/helpers/store/all-purchase-orders-actions.d.ts +7 -7
- package/lib/helpers/store/all-purchase-orders-actions.js +2 -2
- package/lib/helpers/store/all-sale-orders-actions.d.ts +2 -2
- package/lib/helpers/store/all-warehouse-purchase-orders-actions.d.ts +13 -0
- package/lib/helpers/store/all-warehouse-purchase-orders-actions.js +56 -0
- package/lib/helpers/store/all-warehouse-sale-orders-actions.d.ts +2 -0
- package/lib/helpers/store/all-warehouse-sale-orders-actions.js +8 -0
- package/lib/helpers/store/common-purchase-order-actions.d.ts +15 -15
- package/lib/helpers/store/common-sale-order-actions.d.ts +5 -5
- package/lib/helpers/store/common-warehouse-purchase-order-actions.d.ts +31 -0
- package/lib/helpers/store/common-warehouse-purchase-order-actions.js +545 -0
- package/lib/helpers/store/common-warehouse-sale-order-actions.d.ts +5 -0
- package/lib/helpers/store/common-warehouse-sale-order-actions.js +65 -0
- package/lib/helpers/store/index.d.ts +6 -6
- package/lib/helpers/store/index.js +6 -6
- package/lib/helpers/store/purchase-order-rfq-cart-actions.d.ts +11 -11
- package/lib/helpers/store/purchase-order-rfq-cart-actions.js +3 -3
- package/lib/helpers/store/purchase-orders-cart-actions.d.ts +18 -18
- package/lib/helpers/store/purchase-orders-cart-actions.js +1 -1
- package/lib/helpers/store/warehouse-purchase-order-rfq-cart-actions.d.ts +19 -0
- package/lib/helpers/store/warehouse-purchase-order-rfq-cart-actions.js +373 -0
- package/lib/helpers/store/warehouse-purchase-orders-cart-actions.d.ts +57 -0
- package/lib/helpers/store/warehouse-purchase-orders-cart-actions.js +486 -0
- package/lib/helpers/types/index.d.ts +1 -1
- package/lib/helpers/types/index.js +1 -1
- package/lib/helpers/types/purchase-order-cart-actions.d.ts +2 -2
- package/lib/helpers/types/warehouse-purchase-order-cart-actions.d.ts +26 -0
- package/lib/helpers/types/warehouse-purchase-order-cart-actions.js +2 -0
- package/lib/helpers/types/workers.d.ts +18 -18
- package/lib/helpers/utils/index.d.ts +8 -8
- package/lib/helpers/utils/index.js +8 -11
- package/lib/helpers/utils/invoice-x-report-helpers.d.ts +2 -2
- package/lib/helpers/utils/invoice-x-report-helpers.js +14 -14
- package/lib/helpers/utils/purchase-order-engine.d.ts +4 -4
- package/lib/helpers/utils/purchase-order-receipt-engine.d.ts +5 -5
- package/lib/helpers/utils/purchase-order-receipt-engine.js +2 -2
- package/lib/helpers/utils/purchase-order-x-report-helpers.js +2 -2
- package/lib/helpers/utils/sale-x-report-helpers.js +2 -2
- package/lib/helpers/utils/void-purchase-order-items-helpers.d.ts +3 -3
- package/lib/helpers/utils/void-purchase-order-items-report-helpers.d.ts +2 -2
- package/lib/helpers/utils/void-warehouse-invoice-items-helpers.d.ts +3 -3
- package/lib/helpers/utils/void-warehouse-invoice-items-helpers.js +2 -2
- package/lib/helpers/utils/void-warehouse-invoice-items-report-helpers.d.ts +5 -5
- package/lib/helpers/utils/warehouse-catalog-conversion.d.ts +3 -3
- package/lib/helpers/utils/warehouse-catalog-conversion.js +9 -7
- package/lib/helpers/utils/warehouse-invoice-order-engine.js +1 -1
- package/lib/helpers/utils/warehouse-invoice-x-report-helpers.d.ts +58 -0
- package/lib/helpers/utils/warehouse-invoice-x-report-helpers.js +1432 -0
- package/lib/helpers/utils/warehouse-purchase-order-engine.d.ts +9 -0
- package/lib/helpers/utils/warehouse-purchase-order-engine.js +34 -0
- package/lib/helpers/utils/warehouse-purchase-order-receipt-engine.d.ts +149 -0
- package/lib/helpers/utils/warehouse-purchase-order-receipt-engine.js +214 -0
- package/lib/helpers/utils/warehouse-purchase-order-x-report-helpers.d.ts +58 -0
- package/lib/helpers/utils/warehouse-purchase-order-x-report-helpers.js +1440 -0
- package/lib/helpers/utils/warehouse-sale-order-x-report-helpers.d.ts +30 -0
- package/lib/helpers/utils/warehouse-sale-order-x-report-helpers.js +2 -0
- package/lib/helpers/utils/warehouse-sale-x-report-helpers.d.ts +58 -0
- package/lib/helpers/utils/warehouse-sale-x-report-helpers.js +1456 -0
- package/lib/helpers/utils/warehouse-void-purchase-order-items-helpers.d.ts +3 -0
- package/lib/helpers/utils/warehouse-void-purchase-order-items-helpers.js +38 -0
- package/lib/helpers/utils/warehouse-void-purchase-order-items-report-helpers.d.ts +13 -0
- package/lib/helpers/utils/warehouse-void-purchase-order-items-report-helpers.js +22 -0
- package/lib/schemas/models/gift_cards.d.ts +108 -108
- package/lib/schemas/models/halfhalf_setup.d.ts +3 -3
- package/lib/schemas/models/index.d.ts +7 -7
- package/lib/schemas/models/index.js +7 -7
- package/lib/schemas/models/internal_invoices.d.ts +6 -6
- package/lib/schemas/models/inventory_lot_serial_numbers.d.ts +6 -6
- package/lib/schemas/models/inventory_transactions.d.ts +3 -3
- package/lib/schemas/models/item_transactions.d.ts +6 -6
- package/lib/schemas/models/offers.d.ts +146 -146
- package/lib/schemas/models/orders.d.ts +2573 -2573
- package/lib/schemas/models/printer_settings.d.ts +12 -12
- package/lib/schemas/models/reservations.d.ts +6 -6
- package/lib/schemas/models/rewards_usage.d.ts +6 -6
- package/lib/schemas/models/riders.d.ts +3 -3
- package/lib/schemas/models/tenants.d.ts +135 -135
- package/lib/schemas/models/void_order_items.d.ts +15 -15
- package/lib/schemas/models/void_warehouse_invoice_items.d.ts +25 -25
- package/lib/schemas/models/void_warehouse_invoice_items.js +2 -2
- package/lib/schemas/models/vouchers.d.ts +9 -9
- package/lib/schemas/models/warehouse-activity-logs.d.ts +13 -13
- package/lib/schemas/models/warehouse-activity-logs.js +4 -4
- package/lib/schemas/models/warehouse_categories.d.ts +4 -4
- package/lib/schemas/models/warehouse_categories.js +2 -2
- package/lib/schemas/models/warehouse_communications.d.ts +21 -21
- package/lib/schemas/models/warehouse_internal_movements.d.ts +33 -33
- package/lib/schemas/models/warehouse_internal_movements.js +8 -8
- package/lib/schemas/models/warehouse_inventory_lot_serial_numbers.d.ts +154 -0
- package/lib/schemas/models/warehouse_inventory_lot_serial_numbers.js +193 -0
- package/lib/schemas/models/warehouse_inventory_transactions.d.ts +6 -6
- package/lib/schemas/models/warehouse_invoices.d.ts +351 -351
- package/lib/schemas/models/warehouse_item_transactions.d.ts +9 -9
- package/lib/schemas/models/warehouse_items.d.ts +13 -13
- package/lib/schemas/models/warehouse_items.js +2 -2
- package/lib/schemas/models/warehouse_operational_roles.d.ts +3 -3
- package/lib/schemas/models/warehouse_purchase_order_receipts.d.ts +165 -0
- package/lib/schemas/models/warehouse_purchase_order_receipts.js +151 -0
- package/lib/schemas/models/warehouse_purchase_order_rfqs.d.ts +1959 -0
- package/lib/schemas/models/warehouse_purchase_order_rfqs.js +328 -0
- package/lib/schemas/models/warehouse_purchase_order_vendor_returns.d.ts +234 -0
- package/lib/schemas/models/warehouse_purchase_order_vendor_returns.js +188 -0
- package/lib/schemas/models/warehouse_purchase_orders.d.ts +2678 -0
- package/lib/schemas/models/warehouse_purchase_orders.js +336 -0
- package/lib/schemas/models/warehouse_sale_deliveries.d.ts +15 -15
- package/lib/schemas/models/warehouse_sale_deliveries.js +7 -4
- package/lib/schemas/models/warehouse_sale_invoices.d.ts +30 -30
- package/lib/schemas/models/warehouse_sale_invoices.js +8 -5
- package/lib/schemas/models/warehouse_sale_order_rfqs.d.ts +362 -362
- package/lib/schemas/models/warehouse_sale_order_rfqs.js +5 -5
- package/lib/schemas/models/warehouse_sale_orders.d.ts +367 -367
- package/lib/schemas/models/warehouse_sale_orders.js +5 -5
- package/lib/schemas/models/warehouse_void_invoice_items.d.ts +176 -0
- package/lib/schemas/models/warehouse_void_invoice_items.js +176 -0
- package/lib/schemas/models/warehouse_void_purchase_order_items.d.ts +176 -0
- package/lib/schemas/models/warehouse_void_purchase_order_items.js +177 -0
- package/lib/schemas/models/warehouses.d.ts +52 -52
- package/lib/schemas/models/warehouses.js +2 -2
- package/lib/schemas/types/index.d.ts +9 -9
- package/lib/schemas/types/index.js +9 -9
- package/lib/schemas/types/inventory_lot_serial_numbers.d.ts +5 -5
- package/lib/schemas/types/warehouse-activity-logs.d.ts +7 -7
- package/lib/schemas/types/warehouse_categories.d.ts +2 -2
- package/lib/schemas/types/warehouse_internal_movements.d.ts +9 -9
- package/lib/schemas/types/warehouse_inventory_lot_serial_numbers.d.ts +85 -0
- package/lib/schemas/types/warehouse_inventory_lot_serial_numbers.js +4 -0
- package/lib/schemas/types/warehouse_items.d.ts +2 -2
- package/lib/schemas/types/warehouse_purchase_order_common.d.ts +39 -0
- package/lib/schemas/types/warehouse_purchase_order_common.js +2 -0
- package/lib/schemas/types/warehouse_purchase_order_receipts.d.ts +39 -0
- package/lib/schemas/types/warehouse_purchase_order_receipts.js +21 -0
- package/lib/schemas/types/warehouse_purchase_order_rfqs.d.ts +33 -0
- package/lib/schemas/types/warehouse_purchase_order_rfqs.js +2 -0
- package/lib/schemas/types/warehouse_purchase_order_vendor_returns.d.ts +48 -0
- package/lib/schemas/types/warehouse_purchase_order_vendor_returns.js +2 -0
- package/lib/schemas/types/warehouse_purchase_orders.d.ts +33 -0
- package/lib/schemas/types/warehouse_purchase_orders.js +2 -0
- package/lib/schemas/types/warehouse_sale_deliveries.d.ts +29 -29
- package/lib/schemas/types/warehouse_sale_invoices.d.ts +17 -17
- package/lib/schemas/types/warehouse_sale_order_common.d.ts +39 -0
- package/lib/schemas/types/warehouse_sale_order_common.js +2 -0
- package/lib/schemas/types/warehouse_sale_order_rfqs.d.ts +7 -7
- package/lib/schemas/types/warehouse_sale_orders.d.ts +7 -7
- package/lib/schemas/types/warehouse_void_invoice_items.d.ts +37 -0
- package/lib/schemas/types/warehouse_void_invoice_items.js +2 -0
- package/lib/schemas/types/warehouse_void_purchase_order_items.d.ts +37 -0
- package/lib/schemas/types/warehouse_void_purchase_order_items.js +2 -0
- package/lib/schemas/types/warehouses.d.ts +2 -2
- package/package.json +1 -1
|
@@ -23,7 +23,7 @@ export * from './ingredients';
|
|
|
23
23
|
export * from './internal-amount-helpers';
|
|
24
24
|
export * from './inventory';
|
|
25
25
|
export * from './inventory_transactions';
|
|
26
|
-
export * from './invoice-x-report-helpers';
|
|
26
|
+
export * from './warehouse-invoice-x-report-helpers';
|
|
27
27
|
export * from './item-report-helpers';
|
|
28
28
|
export * from './items-comparison-report-helpers';
|
|
29
29
|
export * from './kds-helpers';
|
|
@@ -44,16 +44,11 @@ export * from './platform-specific-tenant-shifts';
|
|
|
44
44
|
export * from './price-conversion';
|
|
45
45
|
export * from './printer-helpers';
|
|
46
46
|
export * from './public-holidays-helpers';
|
|
47
|
-
export * from './purchase-order-engine';
|
|
48
|
-
export * from './purchase-order-receipt-engine';
|
|
49
|
-
export * from './purchase-order-x-report-helpers';
|
|
50
47
|
export * from './ratings-comparison-report-helpers';
|
|
51
48
|
export * from './receipt-engine';
|
|
52
49
|
export * from './review-helpers';
|
|
53
50
|
export * from './rider-tracking';
|
|
54
51
|
export * from './riders-report-helpers';
|
|
55
|
-
export * from './sale-order-x-report-helpers';
|
|
56
|
-
export { getSaleXReportData, getSaleXReportHtml } from './sale-x-report-helpers';
|
|
57
52
|
export * from './sales-comparison-report-helpers';
|
|
58
53
|
export * from './sales-comparitive-report-helpers';
|
|
59
54
|
export * from './sales-overview-report-helpers';
|
|
@@ -65,8 +60,6 @@ export * from './tenant-staff-helpers';
|
|
|
65
60
|
export * from './time-helpers';
|
|
66
61
|
export * from './void-items-report-helpers';
|
|
67
62
|
export * from './void-order-items-helpers';
|
|
68
|
-
export * from './void-purchase-order-items-helpers';
|
|
69
|
-
export * from './void-purchase-order-items-report-helpers';
|
|
70
63
|
export * from './void-warehouse-invoice-items-helpers';
|
|
71
64
|
export * from './void-warehouse-invoice-items-report-helpers';
|
|
72
65
|
export * from './voidations-summary-report-helpers';
|
|
@@ -75,6 +68,13 @@ export * from './wallet-redemption-helpers';
|
|
|
75
68
|
export * from './warehouse-catalog-conversion';
|
|
76
69
|
export * from './warehouse-inventory';
|
|
77
70
|
export * from './warehouse-invoice-order-engine';
|
|
71
|
+
export * from './warehouse-purchase-order-engine';
|
|
72
|
+
export * from './warehouse-purchase-order-receipt-engine';
|
|
73
|
+
export * from './warehouse-purchase-order-x-report-helpers';
|
|
74
|
+
export * from './warehouse-sale-order-x-report-helpers';
|
|
75
|
+
export * from './warehouse-sale-x-report-helpers';
|
|
78
76
|
export * from './warehouse-settings-helpers';
|
|
77
|
+
export * from './warehouse-void-purchase-order-items-helpers';
|
|
78
|
+
export * from './warehouse-void-purchase-order-items-report-helpers';
|
|
79
79
|
export * from './warehouse_inventory_transactions';
|
|
80
80
|
export * from './x-report-helpers';
|
|
@@ -14,7 +14,6 @@ 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;
|
|
18
17
|
__exportStar(require("./cart-helpers"), exports);
|
|
19
18
|
__exportStar(require("./cash_in_hand_transactions"), exports);
|
|
20
19
|
__exportStar(require("./catalog-conversion"), exports);
|
|
@@ -40,7 +39,7 @@ __exportStar(require("./ingredients"), exports);
|
|
|
40
39
|
__exportStar(require("./internal-amount-helpers"), exports);
|
|
41
40
|
__exportStar(require("./inventory"), exports);
|
|
42
41
|
__exportStar(require("./inventory_transactions"), exports);
|
|
43
|
-
__exportStar(require("./invoice-x-report-helpers"), exports);
|
|
42
|
+
__exportStar(require("./warehouse-invoice-x-report-helpers"), exports);
|
|
44
43
|
__exportStar(require("./item-report-helpers"), exports);
|
|
45
44
|
__exportStar(require("./items-comparison-report-helpers"), exports);
|
|
46
45
|
__exportStar(require("./kds-helpers"), exports);
|
|
@@ -61,18 +60,11 @@ __exportStar(require("./platform-specific-tenant-shifts"), exports);
|
|
|
61
60
|
__exportStar(require("./price-conversion"), exports);
|
|
62
61
|
__exportStar(require("./printer-helpers"), exports);
|
|
63
62
|
__exportStar(require("./public-holidays-helpers"), exports);
|
|
64
|
-
__exportStar(require("./purchase-order-engine"), exports);
|
|
65
|
-
__exportStar(require("./purchase-order-receipt-engine"), exports);
|
|
66
|
-
__exportStar(require("./purchase-order-x-report-helpers"), exports);
|
|
67
63
|
__exportStar(require("./ratings-comparison-report-helpers"), exports);
|
|
68
64
|
__exportStar(require("./receipt-engine"), exports);
|
|
69
65
|
__exportStar(require("./review-helpers"), exports);
|
|
70
66
|
__exportStar(require("./rider-tracking"), exports);
|
|
71
67
|
__exportStar(require("./riders-report-helpers"), exports);
|
|
72
|
-
__exportStar(require("./sale-order-x-report-helpers"), exports);
|
|
73
|
-
var sale_x_report_helpers_1 = require("./sale-x-report-helpers");
|
|
74
|
-
Object.defineProperty(exports, "getSaleXReportData", { enumerable: true, get: function () { return sale_x_report_helpers_1.getSaleXReportData; } });
|
|
75
|
-
Object.defineProperty(exports, "getSaleXReportHtml", { enumerable: true, get: function () { return sale_x_report_helpers_1.getSaleXReportHtml; } });
|
|
76
68
|
__exportStar(require("./sales-comparison-report-helpers"), exports);
|
|
77
69
|
__exportStar(require("./sales-comparitive-report-helpers"), exports);
|
|
78
70
|
__exportStar(require("./sales-overview-report-helpers"), exports);
|
|
@@ -84,8 +76,6 @@ __exportStar(require("./tenant-staff-helpers"), exports);
|
|
|
84
76
|
__exportStar(require("./time-helpers"), exports);
|
|
85
77
|
__exportStar(require("./void-items-report-helpers"), exports);
|
|
86
78
|
__exportStar(require("./void-order-items-helpers"), exports);
|
|
87
|
-
__exportStar(require("./void-purchase-order-items-helpers"), exports);
|
|
88
|
-
__exportStar(require("./void-purchase-order-items-report-helpers"), exports);
|
|
89
79
|
__exportStar(require("./void-warehouse-invoice-items-helpers"), exports);
|
|
90
80
|
__exportStar(require("./void-warehouse-invoice-items-report-helpers"), exports);
|
|
91
81
|
__exportStar(require("./voidations-summary-report-helpers"), exports);
|
|
@@ -94,6 +84,13 @@ __exportStar(require("./wallet-redemption-helpers"), exports);
|
|
|
94
84
|
__exportStar(require("./warehouse-catalog-conversion"), exports);
|
|
95
85
|
__exportStar(require("./warehouse-inventory"), exports);
|
|
96
86
|
__exportStar(require("./warehouse-invoice-order-engine"), exports);
|
|
87
|
+
__exportStar(require("./warehouse-purchase-order-engine"), exports);
|
|
88
|
+
__exportStar(require("./warehouse-purchase-order-receipt-engine"), exports);
|
|
89
|
+
__exportStar(require("./warehouse-purchase-order-x-report-helpers"), exports);
|
|
90
|
+
__exportStar(require("./warehouse-sale-order-x-report-helpers"), exports);
|
|
91
|
+
__exportStar(require("./warehouse-sale-x-report-helpers"), exports);
|
|
97
92
|
__exportStar(require("./warehouse-settings-helpers"), exports);
|
|
93
|
+
__exportStar(require("./warehouse-void-purchase-order-items-helpers"), exports);
|
|
94
|
+
__exportStar(require("./warehouse-void-purchase-order-items-report-helpers"), exports);
|
|
98
95
|
__exportStar(require("./warehouse_inventory_transactions"), exports);
|
|
99
96
|
__exportStar(require("./x-report-helpers"), exports);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { COUNTRY_ALPHA_2_ENUM, CURRENCY_SYMBOL_ENUM,
|
|
1
|
+
import { COUNTRY_ALPHA_2_ENUM, CURRENCY_SYMBOL_ENUM, IWarehouseInvoiceXReport } from '../../constants';
|
|
2
2
|
interface IFooterDetail {
|
|
3
3
|
amount: number;
|
|
4
4
|
count: number;
|
|
@@ -54,5 +54,5 @@ interface IProps extends IInvoiceXReportProps {
|
|
|
54
54
|
monochrome?: boolean;
|
|
55
55
|
}
|
|
56
56
|
export declare function getInvoiceXReportHtml({ width, monochrome, clientWiseData, combinedData, currency_symbol, from, to, warehouseName, isFilterApplied, }: IProps): string;
|
|
57
|
-
export declare const getInvoiceXReportData: (data:
|
|
57
|
+
export declare const getInvoiceXReportData: (data: IWarehouseInvoiceXReport, currencySymbol: CURRENCY_SYMBOL_ENUM | undefined, countryAlpha2: COUNTRY_ALPHA_2_ENUM | undefined) => IUsableData;
|
|
58
58
|
export {};
|
|
@@ -1063,7 +1063,7 @@ const getSortedUsableChannels = (channels) => {
|
|
|
1063
1063
|
subChannel.sortIndex = 100000;
|
|
1064
1064
|
subChannel.bold = true;
|
|
1065
1065
|
}
|
|
1066
|
-
else if (channel.ref === constants_1.
|
|
1066
|
+
else if (channel.ref === constants_1.WAREHOUSE_INVOICE_X_REPORT_TYPE_ENUM.TOTAL_PAYMENT_SALES) {
|
|
1067
1067
|
const paymentType = subChannel.ref;
|
|
1068
1068
|
let sortIndex = constants_1.ALL_PAYMENT_TYPE_NAMES.indexOf(paymentType);
|
|
1069
1069
|
if (sortIndex === -1) {
|
|
@@ -1071,7 +1071,7 @@ const getSortedUsableChannels = (channels) => {
|
|
|
1071
1071
|
}
|
|
1072
1072
|
subChannel.sortIndex = sortIndex;
|
|
1073
1073
|
}
|
|
1074
|
-
else if (channel.ref === constants_1.
|
|
1074
|
+
else if (channel.ref === constants_1.WAREHOUSE_INVOICE_X_REPORT_TYPE_ENUM.ORDER_STATUS) {
|
|
1075
1075
|
const status = subChannel.ref;
|
|
1076
1076
|
let sortIndex = constants_1.ALL_WAREHOUSE_INVOICE_STATUS_NAMES.indexOf(status);
|
|
1077
1077
|
if (sortIndex === -1) {
|
|
@@ -1087,7 +1087,7 @@ const getSortedUsableChannels = (channels) => {
|
|
|
1087
1087
|
}
|
|
1088
1088
|
subChannel.sortIndex = sortIndex;
|
|
1089
1089
|
}
|
|
1090
|
-
else if (channel.ref === constants_1.
|
|
1090
|
+
else if (channel.ref === constants_1.WAREHOUSE_INVOICE_X_REPORT_TYPE_ENUM.STAFF) {
|
|
1091
1091
|
// Clients are sorted by ref (client_id)
|
|
1092
1092
|
subChannel.sortIndex = j;
|
|
1093
1093
|
}
|
|
@@ -1106,14 +1106,14 @@ const generateClientWiseData = (data, currencySymbol, gstName) => {
|
|
|
1106
1106
|
const clientWiseDataMap = {};
|
|
1107
1107
|
const clientWiseTotalSalesMap = {};
|
|
1108
1108
|
const clientNamesMap = {};
|
|
1109
|
-
data[constants_1.
|
|
1109
|
+
data[constants_1.WAREHOUSE_INVOICE_X_REPORT_TYPE_ENUM.TOTAL_SALES].forEach((item) => {
|
|
1110
1110
|
const clientName = item.client_name ?? 'By Client';
|
|
1111
1111
|
const clientId = item.client_id ?? CLIENT_ID;
|
|
1112
1112
|
clientWiseTotalSalesMap[clientId] = item;
|
|
1113
1113
|
clientNamesMap[clientId] = clientName;
|
|
1114
1114
|
});
|
|
1115
1115
|
// ==========>>><<<==========
|
|
1116
|
-
data[constants_1.
|
|
1116
|
+
data[constants_1.WAREHOUSE_INVOICE_X_REPORT_TYPE_ENUM.STAFF].forEach((item) => {
|
|
1117
1117
|
const clientId = item.client_id ?? CLIENT_ID;
|
|
1118
1118
|
const clientName = clientNamesMap[clientId];
|
|
1119
1119
|
if (clientName != null) {
|
|
@@ -1123,7 +1123,7 @@ const generateClientWiseData = (data, currencySymbol, gstName) => {
|
|
|
1123
1123
|
ref: item.staff_id,
|
|
1124
1124
|
title: 'Staff',
|
|
1125
1125
|
description: item.staff_name,
|
|
1126
|
-
type: constants_1.
|
|
1126
|
+
type: constants_1.WAREHOUSE_INVOICE_X_REPORT_TYPE_ENUM.STAFF,
|
|
1127
1127
|
staff_name: clientName,
|
|
1128
1128
|
count: item.count,
|
|
1129
1129
|
amount,
|
|
@@ -1137,7 +1137,7 @@ const generateClientWiseData = (data, currencySymbol, gstName) => {
|
|
|
1137
1137
|
}
|
|
1138
1138
|
}
|
|
1139
1139
|
});
|
|
1140
|
-
data[constants_1.
|
|
1140
|
+
data[constants_1.WAREHOUSE_INVOICE_X_REPORT_TYPE_ENUM.ORDER_STATUS].forEach((item) => {
|
|
1141
1141
|
const clientId = item.client_id ?? CLIENT_ID;
|
|
1142
1142
|
const clientName = clientNamesMap[clientId];
|
|
1143
1143
|
if (clientName != null) {
|
|
@@ -1145,7 +1145,7 @@ const generateClientWiseData = (data, currencySymbol, gstName) => {
|
|
|
1145
1145
|
const obj = {
|
|
1146
1146
|
_id: clientId,
|
|
1147
1147
|
ref: item.status,
|
|
1148
|
-
type: constants_1.
|
|
1148
|
+
type: constants_1.WAREHOUSE_INVOICE_X_REPORT_TYPE_ENUM.ORDER_STATUS,
|
|
1149
1149
|
staff_name: clientName,
|
|
1150
1150
|
title: 'Order Status',
|
|
1151
1151
|
description: (0, common_1.sentenceCase)(item.status.replace(/_/g, ' ')),
|
|
@@ -1161,7 +1161,7 @@ const generateClientWiseData = (data, currencySymbol, gstName) => {
|
|
|
1161
1161
|
}
|
|
1162
1162
|
}
|
|
1163
1163
|
});
|
|
1164
|
-
data[constants_1.
|
|
1164
|
+
data[constants_1.WAREHOUSE_INVOICE_X_REPORT_TYPE_ENUM.TOTAL_PAYMENT_SALES].forEach((item) => {
|
|
1165
1165
|
const clientId = item.client_id ?? CLIENT_ID;
|
|
1166
1166
|
const clientName = clientNamesMap[clientId];
|
|
1167
1167
|
if (clientName != null) {
|
|
@@ -1169,7 +1169,7 @@ const generateClientWiseData = (data, currencySymbol, gstName) => {
|
|
|
1169
1169
|
const obj = {
|
|
1170
1170
|
_id: clientId,
|
|
1171
1171
|
ref: item.payment_type,
|
|
1172
|
-
type: constants_1.
|
|
1172
|
+
type: constants_1.WAREHOUSE_INVOICE_X_REPORT_TYPE_ENUM.TOTAL_PAYMENT_SALES,
|
|
1173
1173
|
staff_name: clientName,
|
|
1174
1174
|
title: 'Payments',
|
|
1175
1175
|
description: (0, common_1.sentenceCase)(item.payment_type.replace(/_/g, ' ')),
|
|
@@ -1185,7 +1185,7 @@ const generateClientWiseData = (data, currencySymbol, gstName) => {
|
|
|
1185
1185
|
}
|
|
1186
1186
|
}
|
|
1187
1187
|
});
|
|
1188
|
-
data[constants_1.
|
|
1188
|
+
data[constants_1.WAREHOUSE_INVOICE_X_REPORT_TYPE_ENUM.GST].forEach((item) => {
|
|
1189
1189
|
const clientId = item.client_id ?? CLIENT_ID;
|
|
1190
1190
|
const clientName = clientNamesMap[clientId];
|
|
1191
1191
|
if (clientName != null) {
|
|
@@ -1194,7 +1194,7 @@ const generateClientWiseData = (data, currencySymbol, gstName) => {
|
|
|
1194
1194
|
const obj = {
|
|
1195
1195
|
_id: clientId,
|
|
1196
1196
|
ref: gst,
|
|
1197
|
-
type: constants_1.
|
|
1197
|
+
type: constants_1.WAREHOUSE_INVOICE_X_REPORT_TYPE_ENUM.GST,
|
|
1198
1198
|
staff_name: clientName,
|
|
1199
1199
|
title: gstName,
|
|
1200
1200
|
description: `${gst}%`,
|
|
@@ -1297,10 +1297,10 @@ const getUsableData = (data, subtitles) => {
|
|
|
1297
1297
|
const subChannels = [];
|
|
1298
1298
|
for (let j = 0; j < clientWiseDataArr.length; j++) {
|
|
1299
1299
|
const d = clientWiseDataArr[j];
|
|
1300
|
-
if (d.type === constants_1.
|
|
1300
|
+
if (d.type === constants_1.WAREHOUSE_INVOICE_X_REPORT_TYPE_ENUM.GST && d.ref !== TOTAL_REF) {
|
|
1301
1301
|
totalGst += d.amount;
|
|
1302
1302
|
}
|
|
1303
|
-
else if (d.type === constants_1.
|
|
1303
|
+
else if (d.type === constants_1.WAREHOUSE_INVOICE_X_REPORT_TYPE_ENUM.TOTAL_PAYMENT_SALES && d.ref !== TOTAL_REF) {
|
|
1304
1304
|
if (String(d.description).toUpperCase() === constants_1.PAYMENT_TYPE_ENUM.UNPAID) {
|
|
1305
1305
|
unpaidOrders += d.count;
|
|
1306
1306
|
unpaidAmount += d.amount;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { WarehouseIPurchaseOrderItem, IWarehouseItem } from '../../schemas';
|
|
2
2
|
interface IConvertWarehouseItemToPurchaseOrderItemParams {
|
|
3
3
|
vendorId: string;
|
|
4
4
|
item: IWarehouseItem;
|
|
5
|
-
orderItem?:
|
|
5
|
+
orderItem?: WarehouseIPurchaseOrderItem;
|
|
6
6
|
}
|
|
7
|
-
export declare function convertWarehouseItemToPurchaseOrderItem({ vendorId, item, orderItem, }: IConvertWarehouseItemToPurchaseOrderItemParams):
|
|
8
|
-
export declare function getCurrentPurchaseOrderItemTotalPrice(orderItem:
|
|
7
|
+
export declare function convertWarehouseItemToPurchaseOrderItem({ vendorId, item, orderItem, }: IConvertWarehouseItemToPurchaseOrderItemParams): WarehouseIPurchaseOrderItem;
|
|
8
|
+
export declare function getCurrentPurchaseOrderItemTotalPrice(orderItem: WarehouseIPurchaseOrderItem): number;
|
|
9
9
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CURRENCY_SYMBOL_ENUM } from '../../constants';
|
|
2
|
-
import {
|
|
2
|
+
import { WarehouseIPurchaseOrder, WarehouseIPurchaseOrderItem, IWarehouse } from '../../schemas';
|
|
3
3
|
export interface IWarehouseReceiptProps {
|
|
4
|
-
order: Partial<
|
|
4
|
+
order: Partial<WarehouseIPurchaseOrder>;
|
|
5
5
|
warehouse_settings: {
|
|
6
6
|
image_url: IWarehouse['image_url'] | undefined;
|
|
7
7
|
name: IWarehouse['name'] | undefined;
|
|
@@ -61,7 +61,7 @@ export interface IWarehouseReceiptEngine {
|
|
|
61
61
|
cancel_reason: string | null;
|
|
62
62
|
}
|
|
63
63
|
export interface IWarehouseReceiptProps {
|
|
64
|
-
order: Partial<
|
|
64
|
+
order: Partial<WarehouseIPurchaseOrder>;
|
|
65
65
|
warehouse_settings: {
|
|
66
66
|
image_url: IWarehouse['image_url'] | undefined;
|
|
67
67
|
name: IWarehouse['name'] | undefined;
|
|
@@ -125,8 +125,8 @@ interface IWarehouseSettings {
|
|
|
125
125
|
gstName: string;
|
|
126
126
|
hide_gst_value: boolean | undefined;
|
|
127
127
|
}
|
|
128
|
-
export declare function getWarehouseReceiptEngineFooterDetails(order: Partial<
|
|
129
|
-
interface IWarehouseReceiptOrderItem extends
|
|
128
|
+
export declare function getWarehouseReceiptEngineFooterDetails(order: Partial<WarehouseIPurchaseOrder>, settings: IWarehouseSettings): IWarehouseReceiptItem[];
|
|
129
|
+
interface IWarehouseReceiptOrderItem extends WarehouseIPurchaseOrderItem {
|
|
130
130
|
image_url?: string;
|
|
131
131
|
}
|
|
132
132
|
interface IGetWarehouseOrderItemReceiptBody {
|
|
@@ -151,7 +151,7 @@ function warehouseReceiptEngine(payload) {
|
|
|
151
151
|
if (payload.order.is_deleted) {
|
|
152
152
|
payment_status = '* DELETED *';
|
|
153
153
|
}
|
|
154
|
-
else if (payload.order.order_status === constants_1.
|
|
154
|
+
else if (payload.order.order_status === constants_1.WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM.CANCELLED) {
|
|
155
155
|
payment_status = '* CANCELLED *';
|
|
156
156
|
}
|
|
157
157
|
else {
|
|
@@ -170,7 +170,7 @@ function warehouseReceiptEngine(payload) {
|
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
let cancel_reason = null;
|
|
173
|
-
if (payload.order.order_status === constants_1.
|
|
173
|
+
if (payload.order.order_status === constants_1.WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM.CANCELLED) {
|
|
174
174
|
cancel_reason = payload.order.cancel_reason ?? null;
|
|
175
175
|
}
|
|
176
176
|
let invoice_name = `Invoice #${payload.order.order_number ?? ''}`;
|
|
@@ -1081,11 +1081,11 @@ const getSortedUsableChannels = (channels) => {
|
|
|
1081
1081
|
}
|
|
1082
1082
|
else if (channel.ref === constants_1.PURCHASE_ORDER_X_REPORT_TYPE_ENUM.ORDER_STATUS) {
|
|
1083
1083
|
const status = subChannel.ref;
|
|
1084
|
-
let sortIndex = constants_1.
|
|
1084
|
+
let sortIndex = constants_1.ALL_WAREHOUSE_PURCHASE_ORDER_STATUS_NAMES.indexOf(status);
|
|
1085
1085
|
if (sortIndex === -1) {
|
|
1086
1086
|
sortIndex = 200 + j;
|
|
1087
1087
|
}
|
|
1088
|
-
if (status === constants_1.
|
|
1088
|
+
if (status === constants_1.WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM.CANCELLED) {
|
|
1089
1089
|
const totalIndex = channel.subChannels.findIndex((sc) => sc.ref === TOTAL_REF);
|
|
1090
1090
|
if (totalIndex !== -1) {
|
|
1091
1091
|
const totalAmount = channel.subChannels[totalIndex].amount;
|
|
@@ -1073,11 +1073,11 @@ const getSortedUsableChannels = (channels) => {
|
|
|
1073
1073
|
}
|
|
1074
1074
|
else if (channel.ref === constants_1.SALE_ORDER_X_REPORT_TYPE_ENUM.ORDER_STATUS) {
|
|
1075
1075
|
const status = subChannel.ref;
|
|
1076
|
-
let sortIndex = constants_1.
|
|
1076
|
+
let sortIndex = constants_1.ALL_WAREHOUSE_SALES_ORDER_STATUS_NAMES.indexOf(status);
|
|
1077
1077
|
if (sortIndex === -1) {
|
|
1078
1078
|
sortIndex = 200 + j;
|
|
1079
1079
|
}
|
|
1080
|
-
if (status === constants_1.
|
|
1080
|
+
if (status === constants_1.WAREHOUSE_SALES_ORDER_STATUS_ENUM.CANCELLED) {
|
|
1081
1081
|
const totalIndex = channel.subChannels.findIndex((sc) => sc.ref === TOTAL_REF);
|
|
1082
1082
|
if (totalIndex !== -1) {
|
|
1083
1083
|
const totalAmount = channel.subChannels[totalIndex].amount;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function getVoidPurchaseOrderItemFromCents<T extends Partial<
|
|
3
|
-
export declare function getFetchedVoidPurchaseOrderItems(voidItems:
|
|
1
|
+
import { WarehouseIVoidPurchaseOrderItem } from '../../schemas';
|
|
2
|
+
export declare function getVoidPurchaseOrderItemFromCents<T extends Partial<WarehouseIVoidPurchaseOrderItem> | WarehouseIVoidPurchaseOrderItem>(voidPurchaseOrderItem: T): T;
|
|
3
|
+
export declare function getFetchedVoidPurchaseOrderItems(voidItems: WarehouseIVoidPurchaseOrderItem[]): WarehouseIVoidPurchaseOrderItem[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CURRENCY_SYMBOL_ENUM } from '../../constants';
|
|
2
|
-
import {
|
|
2
|
+
import { WarehouseIVoidPurchaseOrderItem } from '../../schemas';
|
|
3
3
|
export interface IVoidPurchaseOrderItemsReportProps {
|
|
4
|
-
data:
|
|
4
|
+
data: WarehouseIVoidPurchaseOrderItem[];
|
|
5
5
|
warehouseName: string | undefined;
|
|
6
6
|
from: Date | null;
|
|
7
7
|
to: Date | null;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function getVoidWarehouseInvoiceItemFromCents<T extends Partial<
|
|
3
|
-
export declare function
|
|
1
|
+
import { IWarehouseVoidInvoiceItem } from '../../schemas';
|
|
2
|
+
export declare function getVoidWarehouseInvoiceItemFromCents<T extends Partial<IWarehouseVoidInvoiceItem> | IWarehouseVoidInvoiceItem>(voidWarehouseInvoiceItem: T): T;
|
|
3
|
+
export declare function getFetchedWarehouseVoidInvoiceItems(voidItems: IWarehouseVoidInvoiceItem[]): IWarehouseVoidInvoiceItem[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getVoidWarehouseInvoiceItemFromCents = getVoidWarehouseInvoiceItemFromCents;
|
|
4
|
-
exports.
|
|
4
|
+
exports.getFetchedWarehouseVoidInvoiceItems = getFetchedWarehouseVoidInvoiceItems;
|
|
5
5
|
const common_order_actions_1 = require("../store/common-order-actions");
|
|
6
6
|
const price_conversion_1 = require("./price-conversion");
|
|
7
7
|
function getVoidWarehouseInvoiceItemFromCents(voidWarehouseInvoiceItem) {
|
|
@@ -31,7 +31,7 @@ function getVoidWarehouseInvoiceItemFromCents(voidWarehouseInvoiceItem) {
|
|
|
31
31
|
: {}),
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function getFetchedWarehouseVoidInvoiceItems(voidItems) {
|
|
35
35
|
return voidItems
|
|
36
36
|
.map((voidWarehouseInvoiceItem) => getVoidWarehouseInvoiceItemFromCents(voidWarehouseInvoiceItem))
|
|
37
37
|
.sort(common_order_actions_1.sortByCreatedAt);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CURRENCY_SYMBOL_ENUM } from '../../constants';
|
|
2
|
-
import {
|
|
3
|
-
export interface
|
|
4
|
-
data:
|
|
2
|
+
import { IWarehouseVoidInvoiceItem } from '../../schemas';
|
|
3
|
+
export interface IWarehouseVoidInvoiceItemsReportProps {
|
|
4
|
+
data: IWarehouseVoidInvoiceItem[];
|
|
5
5
|
warehouseName: string | undefined;
|
|
6
6
|
from: Date | null;
|
|
7
7
|
to: Date | null;
|
|
@@ -9,5 +9,5 @@ export interface IVoidWarehouseInvoiceItemsReportProps {
|
|
|
9
9
|
monochrome?: boolean;
|
|
10
10
|
currency_symbol: CURRENCY_SYMBOL_ENUM | undefined;
|
|
11
11
|
}
|
|
12
|
-
export declare function getVoidWarehouseInvoiceItemsReportHtml(props:
|
|
13
|
-
export declare function getVoidWarehouseInvoiceItemsReportReceiptHtml(props:
|
|
12
|
+
export declare function getVoidWarehouseInvoiceItemsReportHtml(props: IWarehouseVoidInvoiceItemsReportProps): string;
|
|
13
|
+
export declare function getVoidWarehouseInvoiceItemsReportReceiptHtml(props: IWarehouseVoidInvoiceItemsReportProps): string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IGeneralPrice, IWarehouseCategory, IWarehouseItem } from '../../schemas';
|
|
2
2
|
import { IWarehouseCatalog } from '../types';
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function
|
|
3
|
+
export declare function convertWarehousePriceObjFromDecimalToInt(price: IGeneralPrice | null | undefined): IGeneralPrice | null;
|
|
4
|
+
export declare function convertWarehousePriceObjFromIntToDecimal(priceObj: IGeneralPrice | null | undefined): IGeneralPrice | null;
|
|
5
|
+
export declare function getWarehouseGeneralPriceEnum(price: IGeneralPrice | null | undefined, platform: string | null | undefined): number;
|
|
6
6
|
export declare function getPartialWarehouseItemWithPrice<T extends IWarehouseItem | Partial<IWarehouseItem>>(item: T, writeable?: boolean): T;
|
|
7
7
|
export declare function getWarehouseCatalogFetchedData(categories: IWarehouseCategory[], items: IWarehouseItem[]): IWarehouseCatalog[];
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
5
|
-
exports.
|
|
3
|
+
exports.convertWarehousePriceObjFromDecimalToInt = convertWarehousePriceObjFromDecimalToInt;
|
|
4
|
+
exports.convertWarehousePriceObjFromIntToDecimal = convertWarehousePriceObjFromIntToDecimal;
|
|
5
|
+
exports.getWarehouseGeneralPriceEnum = getWarehouseGeneralPriceEnum;
|
|
6
6
|
exports.getPartialWarehouseItemWithPrice = getPartialWarehouseItemWithPrice;
|
|
7
7
|
exports.getWarehouseCatalogFetchedData = getWarehouseCatalogFetchedData;
|
|
8
8
|
const ingredients_1 = require("./ingredients");
|
|
9
9
|
const price_conversion_1 = require("./price-conversion");
|
|
10
|
-
function
|
|
10
|
+
function convertWarehousePriceObjFromDecimalToInt(price) {
|
|
11
11
|
// Step 1: check if price is null, if so return null
|
|
12
12
|
if (!price)
|
|
13
13
|
return null;
|
|
@@ -29,20 +29,22 @@ function convertPriceObjFromDecimalToInt(price) {
|
|
|
29
29
|
}
|
|
30
30
|
return priceObjInCents;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function convertWarehousePriceObjFromIntToDecimal(priceObj) {
|
|
33
33
|
if (!priceObj)
|
|
34
34
|
return null;
|
|
35
35
|
const keys = Object.keys(priceObj);
|
|
36
36
|
return keys.reduce((obj, key) => ({ ...obj, [key]: (0, price_conversion_1.convertIntToDecimal)(priceObj[key]) }), {});
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function getWarehouseGeneralPriceEnum(price, platform) {
|
|
39
39
|
if (!price)
|
|
40
40
|
return 0;
|
|
41
41
|
const priceInCents = price[platform] ?? price.BASE_PRICE;
|
|
42
42
|
return priceInCents;
|
|
43
43
|
}
|
|
44
44
|
function getPartialWarehouseItemWithPrice(item, writeable) {
|
|
45
|
-
const convertPriceObj = writeable
|
|
45
|
+
const convertPriceObj = writeable
|
|
46
|
+
? convertWarehousePriceObjFromDecimalToInt
|
|
47
|
+
: convertWarehousePriceObjFromIntToDecimal;
|
|
46
48
|
const convertPrice = writeable ? price_conversion_1.convertDecimalToInt : price_conversion_1.convertIntToDecimal;
|
|
47
49
|
const convertIngredients = writeable ? ingredients_1.getIngredientsWithInt : ingredients_1.getIngredientsWithDecimal;
|
|
48
50
|
return {
|
|
@@ -9,7 +9,7 @@ const bson_objectid_1 = __importDefault(require("bson-objectid"));
|
|
|
9
9
|
const warehouse_catalog_conversion_1 = require("./warehouse-catalog-conversion");
|
|
10
10
|
function convertWarehouseItemToWarehouseClientInvoiceItem({ clientId, item, defaultQuantity = 1, orderItem, shouldUseAvgPrice, }) {
|
|
11
11
|
const { _id = (0, bson_objectid_1.default)().toHexString(), quantity = defaultQuantity, special_instructions = '', is_ready, } = orderItem ?? {};
|
|
12
|
-
let newPrice = (0, warehouse_catalog_conversion_1.
|
|
12
|
+
let newPrice = (0, warehouse_catalog_conversion_1.getWarehouseGeneralPriceEnum)(item.selling_price, clientId) || item.purchase_price?.BASE_PRICE || 0;
|
|
13
13
|
if (shouldUseAvgPrice && orderItem == null) {
|
|
14
14
|
newPrice = item.unit_price || newPrice;
|
|
15
15
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
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 {};
|