shareneus 1.4.35 → 1.4.37
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/dist/accounting/counter-sales/auto-sales-receipt-pdf.service.d.ts +290 -0
- package/dist/{services → accounting/counter-sales}/auto-sales-receipt-pdf.service.js +26 -26
- package/dist/accounting/counter-sales/pos-receipt-pdf.d.ts +156 -0
- package/dist/{services → accounting/counter-sales}/pos-receipt-pdf.js +20 -20
- package/dist/accounting/counter-sales/sales-receipt-pdf.service.d.ts +272 -0
- package/dist/{services → accounting/counter-sales}/sales-receipt-pdf.service.js +28 -27
- package/dist/accounting/counter-sales/sales-receipt-print.service.d.ts +18 -0
- package/dist/{services → accounting/counter-sales}/sales-receipt-print.service.js +67 -67
- package/dist/accounting/credit-note/cn-print.service.d.ts +14 -0
- package/dist/{services → accounting/credit-note}/cn-print.service.js +37 -37
- package/dist/accounting/credit-note/credit-note-pdf.service.d.ts +272 -0
- package/dist/{services → accounting/credit-note}/credit-note-pdf.service.js +18 -18
- package/dist/accounting/credit-note/credit-note-totals.service.d.ts +25 -0
- package/dist/{services → accounting/credit-note}/credit-note-totals.service.js +32 -32
- package/dist/accounting/debit-note/debit-note-pdf.service.d.ts +331 -0
- package/dist/{services → accounting/debit-note}/debit-note-pdf.service.js +16 -16
- package/dist/accounting/debit-note/debit-note-print.service.d.ts +14 -0
- package/dist/{services → accounting/debit-note}/debit-note-print.service.js +37 -37
- package/dist/accounting/debit-note/debit-note-totals.service.d.ts +22 -0
- package/dist/{services → accounting/debit-note}/debit-note-totals.service.js +29 -29
- package/dist/accounting/invoice/hc-inv-pdf.service.d.ts +357 -0
- package/dist/{services → accounting/invoice}/hc-inv-pdf.service.js +44 -44
- package/dist/accounting/invoice/inv-pdf.service.d.ts +314 -0
- package/dist/{services → accounting/invoice}/inv-pdf.service.js +56 -56
- package/dist/accounting/invoice/inv-print.service.d.ts +16 -0
- package/dist/{services → accounting/invoice}/inv-print.service.js +63 -63
- package/dist/accounting/invoice/invoice-landscape-pdf.service.d.ts +416 -0
- package/dist/{services → accounting/invoice}/invoice-landscape-pdf.service.js +31 -31
- package/dist/accounting/invoice/invoice-letterhead-pdf.service.d.ts +323 -0
- package/dist/{services → accounting/invoice}/invoice-letterhead-pdf.service.js +56 -56
- package/dist/accounting/invoice/invoice-portrait-pdf.d.ts +275 -0
- package/dist/{services → accounting/invoice}/invoice-portrait-pdf.js +53 -53
- package/dist/accounting/invoice/invoice-total.service.d.ts +43 -0
- package/dist/{services → accounting/invoice}/invoice-total.service.js +79 -79
- package/dist/accounting/invoice/shared-inv-pdf.service.d.ts +303 -0
- package/dist/accounting/invoice/shared-inv-pdf.service.js +763 -0
- package/dist/accounting/payment-receive/payment-pdf.service.d.ts +618 -0
- package/dist/{services → accounting/payment-receive}/payment-pdf.service.js +5 -5
- package/dist/accounting/payment-receive/receipt-print.service.d.ts +4 -0
- package/dist/{services → accounting/payment-receive}/receipt-print.service.js +6 -6
- package/dist/accounting/payment-receive/reports/pdf/customer-balances-pdf.service.d.ts +228 -0
- package/dist/{services → accounting/payment-receive/reports/pdf}/customer-balances-pdf.service.js +8 -8
- package/dist/accounting/payment-receive/reports/pdf/payment-report-pdf.service.d.ts +228 -0
- package/dist/{services → accounting/payment-receive/reports/pdf}/payment-report-pdf.service.js +4 -4
- package/dist/aggregation/aggregation.d.ts +4 -0
- package/dist/aggregation/aggregation.js +13 -13
- package/dist/appointments/appointments/appointment-total.service.d.ts +25 -0
- package/dist/{services → appointments/appointments}/appointment-total.service.js +38 -38
- package/dist/appointments/consultations/consultation-fee-receipt.service.d.ts +318 -0
- package/dist/{services → appointments/consultations}/consultation-fee-receipt.service.js +17 -17
- package/dist/appointments/consultations/consultation-full-pdf.service.d.ts +207 -0
- package/dist/{services → appointments/consultations}/consultation-full-pdf.service.js +11 -11
- package/dist/appointments/consultations/consultation-letterhead-pdf.service.d.ts +266 -0
- package/dist/{services → appointments/consultations}/consultation-letterhead-pdf.service.js +16 -16
- package/dist/appointments/consultations/consultation-pdf.service.d.ts +306 -0
- package/dist/{services → appointments/consultations}/consultation-pdf.service.js +16 -16
- package/dist/enums/cache-enums.d.ts +33 -0
- package/dist/enums/code-enums.d.ts +266 -0
- package/dist/enums/enums.d.ts +329 -0
- package/dist/enums/industry-enums.d.ts +16 -0
- package/dist/excel-files/cust-balance-excel.service.d.ts +26 -0
- package/dist/excel-files/cust-balance-excel.service.js +5 -5
- package/dist/excel-files/expiring-drugs-excel.service.d.ts +24 -0
- package/dist/excel-files/expiring-drugs-excel.service.js +7 -7
- package/dist/excel-files/insurance-expire-excel.service.d.ts +23 -0
- package/dist/excel-files/insurance-expire-excel.service.js +4 -4
- package/dist/excel-files/invoice-wise-excel.service.d.ts +26 -0
- package/dist/excel-files/invoice-wise-excel.service.js +3 -3
- package/dist/excel-files/next-service-date-excel.service.d.ts +25 -0
- package/dist/excel-files/next-service-date-excel.service.js +5 -5
- package/dist/excel-files/payment-receive-excel.service.d.ts +25 -0
- package/dist/excel-files/payment-receive-excel.service.js +6 -6
- package/dist/excel-files/payments-made-excel.service.d.ts +25 -0
- package/dist/excel-files/payments-made-excel.service.js +6 -6
- package/dist/excel-files/repair-orders-excel.service.d.ts +24 -0
- package/dist/excel-files/repair-orders-excel.service.js +10 -10
- package/dist/excel-files/sales-by-service-details-excel.service.d.ts +0 -0
- package/dist/excel-files/sales-by-service-summary-excel.service.d.ts +24 -0
- package/dist/excel-files/sales-by-service-summary-excel.service.js +14 -14
- package/dist/excel-files/scheduled-drug-summary-excel.service.d.ts +24 -0
- package/dist/excel-files/scheduled-drug-summary-excel.service.js +8 -8
- package/dist/excel-files/scheduled-drugs-excel.service.d.ts +24 -0
- package/dist/excel-files/scheduled-drugs-excel.service.js +10 -10
- package/dist/excel-files/spares-issue-excel.service.d.ts +26 -0
- package/dist/excel-files/spares-issue-excel.service.js +14 -14
- package/dist/excel-files/stock-excel.service.d.ts +23 -0
- package/dist/excel-files/stock-excel.service.js +3 -3
- package/dist/excel-files/ven-balance-excel.service.d.ts +27 -0
- package/dist/excel-files/ven-balance-excel.service.js +3 -3
- package/dist/gst/excel/GSTR-RO-excel.service.d.ts +27 -0
- package/dist/{excel-files → gst/excel}/GSTR-RO-excel.service.js +3 -3
- package/dist/gst/excel/GSTR1-excel.service.d.ts +16 -0
- package/dist/{excel-files → gst/excel}/GSTR1-excel.service.js +7 -7
- package/dist/gst/excel/GSTR2-excel.service.d.ts +16 -0
- package/dist/{excel-files → gst/excel}/GSTR2-excel.service.js +6 -6
- package/dist/gst/excel/tally-sales-import.service.d.ts +27 -0
- package/dist/{excel-files → gst/excel}/tally-sales-import.service.js +3 -3
- package/dist/index.d.ts +124 -0
- package/dist/index.js +102 -102
- package/dist/inventory/items/issue-parts-pdf.service.d.ts +303 -0
- package/dist/{services → inventory/items}/issue-parts-pdf.service.js +45 -45
- package/dist/inventory/items/item-bar-code-label-pdf.d.ts +127 -0
- package/dist/{services → inventory/items}/item-bar-code-label-pdf.js +3 -3
- package/dist/inventory/items/item-detais-pdf.d.ts +121 -0
- package/dist/{services → inventory/items}/item-detais-pdf.js +1 -1
- package/dist/inventory/items/item-price-for-pricelist.d.ts +1 -0
- package/dist/{services → inventory/items}/item-price-for-pricelist.js +44 -50
- package/dist/inventory/items/reports/excel/item-wise-mout-details.d.ts +23 -0
- package/dist/{excel-files → inventory/items/reports/excel}/item-wise-mout-details.js +4 -4
- package/dist/inventory/items/reports/excel/item-wise-mout-summary.d.ts +23 -0
- package/dist/{excel-files → inventory/items/reports/excel}/item-wise-mout-summary.js +4 -4
- package/dist/inventory/items/reports/pdf/expiring-drugs-pdf.service.d.ts +49 -0
- package/dist/{services → inventory/items/reports/pdf}/expiring-drugs-pdf.service.js +6 -6
- package/dist/inventory/items/reports/pdf/item-wise-mout-details-pdf.d.ts +229 -0
- package/dist/{services → inventory/items/reports/pdf}/item-wise-mout-details-pdf.js +4 -4
- package/dist/inventory/items/reports/pdf/item-wise-mout-summary-pdf.d.ts +228 -0
- package/dist/{services → inventory/items/reports/pdf}/item-wise-mout-summary-pdf.js +3 -3
- package/dist/inventory/items/reports/pdf/reorder-point-pdf.service.d.ts +48 -0
- package/dist/{services → inventory/items/reports/pdf}/reorder-point-pdf.service.js +3 -3
- package/dist/inventory/material-out/mout-pdf.service.d.ts +324 -0
- package/dist/{services → inventory/material-out}/mout-pdf.service.js +19 -19
- package/dist/inventory/transfer-order/transfer-order-pdf.service.d.ts +48 -0
- package/dist/{services → inventory/transfer-order}/transfer-order-pdf.service.js +2 -2
- package/dist/purchases/payment-made/reports/pdf/vendor-balances-pdf.service.d.ts +227 -0
- package/dist/{services → purchases/payment-made/reports/pdf}/vendor-balances-pdf.service.js +7 -7
- package/dist/purchases/purchase-order/po-totals.service.d.ts +24 -0
- package/dist/{services → purchases/purchase-order}/po-totals.service.js +29 -29
- package/dist/purchases/purchase-order/purchase-order-pdf.service.d.ts +526 -0
- package/dist/{services → purchases/purchase-order}/purchase-order-pdf.service.js +42 -42
- package/dist/purchases/purchase-order/purchase-order-print.service.d.ts +8 -0
- package/dist/{services → purchases/purchase-order}/purchase-order-print.service.js +46 -46
- package/dist/purchases/purchase-order/purchase-order-totals.service.d.ts +23 -0
- package/dist/{services → purchases/purchase-order}/purchase-order-totals.service.js +55 -55
- package/dist/purchases/vendor-credit-note/vendor-credit-note-pdf.service.d.ts +491 -0
- package/dist/{services → purchases/vendor-credit-note}/vendor-credit-note-pdf.service.js +29 -29
- package/dist/purchases/vendor-credit-note/vendor-credit-note-print.service.d.ts +6 -0
- package/dist/{services → purchases/vendor-credit-note}/vendor-credit-note-print.service.js +31 -31
- package/dist/purchases/vendor-credit-note/vendor-credit-note-totals.service.d.ts +24 -0
- package/dist/{services → purchases/vendor-credit-note}/vendor-credit-note-totals.service.js +38 -38
- package/dist/purchases/vendor-debit-note/vendor-debit-note-pdf.service.d.ts +271 -0
- package/dist/{services → purchases/vendor-debit-note}/vendor-debit-note-pdf.service.js +18 -18
- package/dist/purchases/vendor-debit-note/vendor-debit-note-print.service.d.ts +14 -0
- package/dist/{services → purchases/vendor-debit-note}/vendor-debit-note-print.service.js +34 -34
- package/dist/purchases/vendor-debit-note/vendor-debit-note-totals.service.d.ts +22 -0
- package/dist/{services → purchases/vendor-debit-note}/vendor-debit-note-totals.service.js +31 -31
- package/dist/sales/delivery-challan/dc-landscape-pdf.service.d.ts +416 -0
- package/dist/{services → sales/delivery-challan}/dc-landscape-pdf.service.js +30 -30
- package/dist/sales/delivery-challan/dc-landscape-without-price-pdf.service.d.ts +400 -0
- package/dist/{services → sales/delivery-challan}/dc-landscape-without-price-pdf.service.js +26 -26
- package/dist/sales/delivery-challan/dc-without-price-pdf.service.d.ts +271 -0
- package/dist/{services → sales/delivery-challan}/dc-without-price-pdf.service.js +17 -17
- package/dist/sales/delivery-challan/delivery-challan-pdf.service.d.ts +269 -0
- package/dist/{services → sales/delivery-challan}/delivery-challan-pdf.service.js +18 -18
- package/dist/sales/delivery-challan/delivery-challan-print.service.d.ts +12 -0
- package/dist/{services → sales/delivery-challan}/delivery-challan-print.service.js +30 -30
- package/dist/sales/delivery-challan/delivery-challan-totals.d.ts +27 -0
- package/dist/{services → sales/delivery-challan}/delivery-challan-totals.js +33 -33
- package/dist/sales/reports/excel/analysis-excel.service.d.ts +23 -0
- package/dist/{excel-files → sales/reports/excel}/analysis-excel.service.js +4 -4
- package/dist/sales/reports/excel/category-wise-item-excel.service.d.ts +23 -0
- package/dist/{excel-files → sales/reports/excel}/category-wise-item-excel.service.js +10 -10
- package/dist/sales/reports/excel/cust-wise-sales-details.d.ts +25 -0
- package/dist/{excel-files → sales/reports/excel}/cust-wise-sales-details.js +5 -5
- package/dist/sales/reports/excel/cust-wise-sales-summary-excel.service.d.ts +24 -0
- package/dist/{excel-files → sales/reports/excel}/cust-wise-sales-summary-excel.service.js +5 -5
- package/dist/sales/reports/excel/item-wise-doctor-sale-excel.service.d.ts +24 -0
- package/dist/{excel-files → sales/reports/excel}/item-wise-doctor-sale-excel.service.js +7 -7
- package/dist/sales/reports/excel/items-wise-sales-excel.service.d.ts +24 -0
- package/dist/{excel-files → sales/reports/excel}/items-wise-sales-excel.service.js +10 -10
- package/dist/sales/reports/excel/manf-wise-sales-excel.service.d.ts +24 -0
- package/dist/{excel-files → sales/reports/excel}/manf-wise-sales-excel.service.js +4 -4
- package/dist/sales/reports/excel/operator-wise-details.d.ts +23 -0
- package/dist/{excel-files → sales/reports/excel}/operator-wise-details.js +4 -4
- package/dist/sales/reports/excel/operator-wise-summary.d.ts +23 -0
- package/dist/{excel-files → sales/reports/excel}/operator-wise-summary.js +4 -4
- package/dist/sales/reports/excel/sa-wise-labor-sales-excel.service.d.ts +23 -0
- package/dist/{excel-files → sales/reports/excel}/sa-wise-labor-sales-excel.service.js +6 -6
- package/dist/sales/reports/excel/sa-wise-part-sales-excel.service.d.ts +23 -0
- package/dist/{excel-files → sales/reports/excel}/sa-wise-part-sales-excel.service.js +6 -6
- package/dist/sales/reports/excel/sale-summary-excel.service.d.ts +25 -0
- package/dist/{excel-files → sales/reports/excel}/sale-summary-excel.service.js +3 -3
- package/dist/sales/reports/pdf/analysis-pdf.service.d.ts +228 -0
- package/dist/{services → sales/reports/pdf}/analysis-pdf.service.js +9 -9
- package/dist/sales/reports/pdf/category-wise-item-pdf.service.d.ts +228 -0
- package/dist/{services → sales/reports/pdf}/category-wise-item-pdf.service.js +7 -7
- package/dist/sales/reports/pdf/cust-wise-sales-details-pdf.service.d.ts +228 -0
- package/dist/{services → sales/reports/pdf}/cust-wise-sales-details-pdf.service.js +9 -9
- package/dist/sales/reports/pdf/cust-wise-sales-summary-pdf.service.d.ts +228 -0
- package/dist/{services → sales/reports/pdf}/cust-wise-sales-summary-pdf.service.js +8 -9
- package/dist/sales/reports/pdf/item-wise-doctor-sale-pdf.service.d.ts +228 -0
- package/dist/{services → sales/reports/pdf}/item-wise-doctor-sale-pdf.service.js +4 -4
- package/dist/sales/reports/pdf/item-wise-sales-pdf.service.d.ts +228 -0
- package/dist/{services → sales/reports/pdf}/item-wise-sales-pdf.service.js +7 -8
- package/dist/sales/reports/pdf/manf-wise-sales-pdf.service.d.ts +228 -0
- package/dist/{services → sales/reports/pdf}/manf-wise-sales-pdf.service.js +6 -6
- package/dist/sales/reports/pdf/operator-wise-details-pdf.service.d.ts +228 -0
- package/dist/{services → sales/reports/pdf}/operator-wise-details-pdf.service.js +9 -9
- package/dist/sales/reports/pdf/operator-wise-summary-pdf.d.ts +228 -0
- package/dist/{services → sales/reports/pdf}/operator-wise-summary-pdf.js +8 -8
- package/dist/sales/reports/pdf/sales-by-service-pdf.service.d.ts +228 -0
- package/dist/{services → sales/reports/pdf}/sales-by-service-pdf.service.js +7 -7
- package/dist/sales/reports/pdf/scheduled-drug-pdf.service.d.ts +228 -0
- package/dist/{services → sales/reports/pdf}/scheduled-drug-pdf.service.js +8 -8
- package/dist/sales/reports/pdf/scheduled-drug-summary-pdf.service.d.ts +228 -0
- package/dist/{services → sales/reports/pdf}/scheduled-drug-summary-pdf.service.js +5 -5
- package/dist/sales/sales/equipment-design-pdf.service.d.ts +121 -0
- package/dist/{services → sales/sales}/equipment-design-pdf.service.js +12 -12
- package/dist/sales/sales/pack-ship-pdf.service.d.ts +262 -0
- package/dist/{services → sales/sales}/pack-ship-pdf.service.js +5 -5
- package/dist/sales/sales/pack-ship-print.service.d.ts +11 -0
- package/dist/{services → sales/sales}/pack-ship-print.service.js +27 -27
- package/dist/sales/sales/sales-pdf.service.d.ts +275 -0
- package/dist/{services → sales/sales}/sales-pdf.service.js +25 -25
- package/dist/sales/sales/sales-print.service.d.ts +15 -0
- package/dist/{services → sales/sales}/sales-print.service.js +58 -58
- package/dist/sales/sales/sales-totals.service.d.ts +27 -0
- package/dist/{services → sales/sales}/sales-totals.service.js +34 -34
- package/dist/services/checklist-pdf.d.ts +57 -0
- package/dist/services/checklist-pdf.js +5 -5
- package/dist/services/checklists-pdf.d.ts +12 -0
- package/dist/services/checklists-pdf.js +1 -1
- package/dist/services/est.print-service.d.ts +64 -0
- package/dist/services/est.print-service.js +151 -151
- package/dist/services/next-service-date-pdf.service.d.ts +228 -0
- package/dist/services/next-service-date-pdf.service.js +2 -2
- package/dist/services/reports/insurance-expire-pdf.service.d.ts +227 -0
- package/dist/services/{insurance-expire-pdf.service.js → reports/insurance-expire-pdf.service.js} +2 -2
- package/dist/services/reports/repair-orders-pdf.service.d.ts +229 -0
- package/dist/services/{repair-orders-pdf.service.js → reports/repair-orders-pdf.service.js} +4 -4
- package/dist/services/ro-pdf.service.d.ts +1060 -0
- package/dist/services/ro-pdf.service.js +82 -82
- package/dist/services/ro-print-service.d.ts +45 -0
- package/dist/services/ro-print-service.js +88 -88
- package/dist/services/ro-totals.service.d.ts +65 -0
- package/dist/services/ro-totals.service.js +123 -123
- package/dist/services/separate-wo-print.service.d.ts +494 -0
- package/dist/services/separate-wo-print.service.js +10 -10
- package/dist/services/shared-inv-pdf.service.d.ts +303 -0
- package/dist/services/shared-inv-pdf.service.js +46 -46
- package/dist/services/technician-pdf.service.d.ts +221 -0
- package/dist/services/technician-pdf.service.js +11 -11
- package/dist/services/technician-print.service.d.ts +5 -0
- package/dist/services/technician-print.service.js +10 -10
- package/dist/shared/math-operations.d.ts +53 -0
- package/dist/shared/math-operations.js +184 -0
- package/dist/shared/shared-services/shared-pdf.service.d.ts +926 -0
- package/dist/{services → shared/shared-services}/shared-pdf.service.js +120 -120
- package/dist/shared/shared-services/shared-print.service.d.ts +49 -0
- package/dist/{services → shared/shared-services}/shared-print.service.js +68 -68
- package/dist/shared/util.d.ts +3 -0
- package/dist/shared/util.js +15 -0
- package/dist/tasks/meetings/meeting-pdf.d.ts +107 -0
- package/dist/{services → tasks/meetings}/meeting-pdf.js +15 -15
- package/dist/tasks/tasks/task-pdf.service.d.ts +127 -0
- package/dist/{services → tasks/tasks}/task-pdf.service.js +12 -12
- package/dist/tasks/tasks/task-reports-pdf.service.d.ts +94 -0
- package/dist/{services → tasks/tasks}/task-reports-pdf.service.js +11 -11
- package/dist/utils/my-date.d.ts +104 -0
- package/dist/{shared → utils}/my-date.js +31 -31
- package/dist/utils/tr-utils.d.ts +41 -0
- package/dist/{shared/utils.js → utils/tr-utils.js} +0 -8
- package/package.json +2 -1
- package/tsconfig.json +1 -0
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
export declare class TechnicianpdfService {
|
|
2
|
+
static GetTechnicianPrint(RepairOrder: any, isOtherIndustry: boolean): {
|
|
3
|
+
info: {
|
|
4
|
+
title: string;
|
|
5
|
+
};
|
|
6
|
+
header: (currentPage: any, pageCount: any) => {
|
|
7
|
+
text: string;
|
|
8
|
+
alignment: string;
|
|
9
|
+
marginRight: number;
|
|
10
|
+
fontSize: number;
|
|
11
|
+
marginTop: number;
|
|
12
|
+
};
|
|
13
|
+
pageMargins: number[];
|
|
14
|
+
content: any[];
|
|
15
|
+
styles: {
|
|
16
|
+
temp2header: {
|
|
17
|
+
fontSize: number;
|
|
18
|
+
bold: boolean;
|
|
19
|
+
alignment: string;
|
|
20
|
+
};
|
|
21
|
+
tableheader1: {
|
|
22
|
+
bold: boolean;
|
|
23
|
+
fontFamily: string;
|
|
24
|
+
margin: number[];
|
|
25
|
+
alignment: string;
|
|
26
|
+
};
|
|
27
|
+
header: {
|
|
28
|
+
fontSize: number;
|
|
29
|
+
bold: boolean;
|
|
30
|
+
alignment: string;
|
|
31
|
+
};
|
|
32
|
+
meetingHeader: {
|
|
33
|
+
fontSize: number;
|
|
34
|
+
bold: boolean;
|
|
35
|
+
};
|
|
36
|
+
Receiptheader: {
|
|
37
|
+
fontSize: number;
|
|
38
|
+
bold: boolean;
|
|
39
|
+
alignment: string;
|
|
40
|
+
margin: number[];
|
|
41
|
+
};
|
|
42
|
+
InlineHeader: {
|
|
43
|
+
fontSize: number;
|
|
44
|
+
bold: boolean;
|
|
45
|
+
alignment: string;
|
|
46
|
+
margin: number[];
|
|
47
|
+
};
|
|
48
|
+
TaskHeading: {
|
|
49
|
+
fontSize: number;
|
|
50
|
+
bold: boolean;
|
|
51
|
+
margin: number[];
|
|
52
|
+
};
|
|
53
|
+
lettersSize: {
|
|
54
|
+
fontSize: number;
|
|
55
|
+
margin: number[];
|
|
56
|
+
};
|
|
57
|
+
tablexample: {
|
|
58
|
+
margin: number[];
|
|
59
|
+
};
|
|
60
|
+
hedstyl: {
|
|
61
|
+
margin: number[];
|
|
62
|
+
};
|
|
63
|
+
header2: {
|
|
64
|
+
fontSize: number;
|
|
65
|
+
bold: boolean;
|
|
66
|
+
alignment: string;
|
|
67
|
+
margin: number[];
|
|
68
|
+
};
|
|
69
|
+
header1: {
|
|
70
|
+
fontSize: number;
|
|
71
|
+
bold: boolean;
|
|
72
|
+
alignment: string;
|
|
73
|
+
decoration: string;
|
|
74
|
+
margin: number[];
|
|
75
|
+
};
|
|
76
|
+
ws_adrs_center: {
|
|
77
|
+
fontSize: number;
|
|
78
|
+
alignment: string;
|
|
79
|
+
};
|
|
80
|
+
ws_adrs_center1: {
|
|
81
|
+
fontSize: number;
|
|
82
|
+
alignment: string;
|
|
83
|
+
};
|
|
84
|
+
ws_adrs_left: {
|
|
85
|
+
fontSize: number;
|
|
86
|
+
alignment: string;
|
|
87
|
+
};
|
|
88
|
+
ws_adrs_left1: {
|
|
89
|
+
fontSize: number;
|
|
90
|
+
alignment: string;
|
|
91
|
+
};
|
|
92
|
+
columnheader: {
|
|
93
|
+
margin: number[];
|
|
94
|
+
};
|
|
95
|
+
tableExample: {
|
|
96
|
+
margin: number[];
|
|
97
|
+
fontSize: number;
|
|
98
|
+
};
|
|
99
|
+
tableExamplemargin: {
|
|
100
|
+
margin: number[];
|
|
101
|
+
fontSize: number;
|
|
102
|
+
};
|
|
103
|
+
textcust: {
|
|
104
|
+
fontSize: number;
|
|
105
|
+
margin: number[];
|
|
106
|
+
};
|
|
107
|
+
column: {
|
|
108
|
+
margin: number[];
|
|
109
|
+
};
|
|
110
|
+
tableheader: {
|
|
111
|
+
bold: boolean;
|
|
112
|
+
fontSize: number;
|
|
113
|
+
margin: number[];
|
|
114
|
+
alignment: string;
|
|
115
|
+
};
|
|
116
|
+
tableheader2: {
|
|
117
|
+
fontSize: number;
|
|
118
|
+
margin: number[];
|
|
119
|
+
alignment: string;
|
|
120
|
+
opacity: number;
|
|
121
|
+
};
|
|
122
|
+
hed: {
|
|
123
|
+
fontSize: number;
|
|
124
|
+
bold: boolean;
|
|
125
|
+
};
|
|
126
|
+
hed2: {
|
|
127
|
+
fontSize: number;
|
|
128
|
+
};
|
|
129
|
+
TotalsStyles: {
|
|
130
|
+
marginTop: number;
|
|
131
|
+
lineHeight: number;
|
|
132
|
+
fontSize: number;
|
|
133
|
+
margin: number[];
|
|
134
|
+
};
|
|
135
|
+
colum1: {
|
|
136
|
+
fontSize: number;
|
|
137
|
+
lineHeight: number;
|
|
138
|
+
};
|
|
139
|
+
colum2: {
|
|
140
|
+
fontSize: number;
|
|
141
|
+
lineHeight: number;
|
|
142
|
+
margin: number[];
|
|
143
|
+
};
|
|
144
|
+
colum3: {
|
|
145
|
+
lineHeight: number;
|
|
146
|
+
};
|
|
147
|
+
Receiptheader1: {
|
|
148
|
+
fontSize: number;
|
|
149
|
+
bold: boolean;
|
|
150
|
+
alignment: string;
|
|
151
|
+
margin: number[];
|
|
152
|
+
};
|
|
153
|
+
Row1: {
|
|
154
|
+
fontSize: number;
|
|
155
|
+
margin: number[];
|
|
156
|
+
};
|
|
157
|
+
rowdata: {
|
|
158
|
+
margin: number[];
|
|
159
|
+
fontSize: number;
|
|
160
|
+
};
|
|
161
|
+
forCompany: {
|
|
162
|
+
margin: number[];
|
|
163
|
+
fontSize: string;
|
|
164
|
+
};
|
|
165
|
+
forCompany1: {
|
|
166
|
+
margin: number[];
|
|
167
|
+
fontSize: string;
|
|
168
|
+
};
|
|
169
|
+
Rupees: {
|
|
170
|
+
margin: number[];
|
|
171
|
+
fontSize: string;
|
|
172
|
+
};
|
|
173
|
+
Signature: {
|
|
174
|
+
margin: number[];
|
|
175
|
+
alignment: string;
|
|
176
|
+
fontSize: string;
|
|
177
|
+
};
|
|
178
|
+
withApp: {
|
|
179
|
+
alignment: string;
|
|
180
|
+
lineHeight: number;
|
|
181
|
+
};
|
|
182
|
+
withOutApp: {
|
|
183
|
+
alignment: string;
|
|
184
|
+
lineHeight: number;
|
|
185
|
+
};
|
|
186
|
+
Sign: {
|
|
187
|
+
fontSize: number;
|
|
188
|
+
margin: number[];
|
|
189
|
+
};
|
|
190
|
+
Sign1: {
|
|
191
|
+
fontSize: number;
|
|
192
|
+
margin: number[];
|
|
193
|
+
};
|
|
194
|
+
'margin-all': {
|
|
195
|
+
margin: number[];
|
|
196
|
+
};
|
|
197
|
+
'margin-top': {
|
|
198
|
+
margin: number[];
|
|
199
|
+
};
|
|
200
|
+
'margin-bottom': {
|
|
201
|
+
margin: number[];
|
|
202
|
+
};
|
|
203
|
+
fontSize: {
|
|
204
|
+
fontSize: number;
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
static GetIndHeading(CollItems: any): any;
|
|
209
|
+
static getLine(Comps: any): any;
|
|
210
|
+
static GetCollisionItems(CollItems: any, Parts: any, Labors: any): any;
|
|
211
|
+
static GetCollisionItemsBody(CollItems: any, Parts: any, Labors: any): any;
|
|
212
|
+
static CheckPrice(Labor: any): "" | "Yes" | undefined;
|
|
213
|
+
static GetCollisionItemsHeader(): {
|
|
214
|
+
text: string;
|
|
215
|
+
Field: string;
|
|
216
|
+
style: string[];
|
|
217
|
+
}[];
|
|
218
|
+
static getComplaintsAndServices(Comps: any, Ops: any): any;
|
|
219
|
+
static getOnlyServices(Ops: any): any;
|
|
220
|
+
static EmptyReturnValue(): string;
|
|
221
|
+
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TechnicianpdfService = void 0;
|
|
4
4
|
const enums_1 = require("../enums/enums");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const shared_pdf_service_1 = require("../shared/shared-services/shared-pdf.service");
|
|
6
|
+
const tr_utils_1 = require("../utils/tr-utils");
|
|
7
7
|
class TechnicianpdfService {
|
|
8
8
|
static GetTechnicianPrint(RepairOrder, isOtherIndustry) {
|
|
9
9
|
var dd = {
|
|
@@ -37,7 +37,7 @@ class TechnicianpdfService {
|
|
|
37
37
|
// });
|
|
38
38
|
}
|
|
39
39
|
static GetIndHeading(CollItems) {
|
|
40
|
-
if (!
|
|
40
|
+
if (!tr_utils_1.TrUtils.IsNull(CollItems) && CollItems.length !== 0) {
|
|
41
41
|
return [{ text: 'Accidental Repairs :', fontSize: 12, marginTop: 5, bold: true, decoration: 'underline' }];
|
|
42
42
|
}
|
|
43
43
|
else {
|
|
@@ -55,7 +55,7 @@ class TechnicianpdfService {
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
static GetCollisionItems(CollItems, Parts, Labors) {
|
|
58
|
-
if (!
|
|
58
|
+
if (!tr_utils_1.TrUtils.IsNull(CollItems) && CollItems.length !== 0) {
|
|
59
59
|
return {
|
|
60
60
|
style: 'tableExample',
|
|
61
61
|
marginTop: 10,
|
|
@@ -145,7 +145,7 @@ class TechnicianpdfService {
|
|
|
145
145
|
if (column.Field === 'Desc') {
|
|
146
146
|
let DescData = [];
|
|
147
147
|
DescData.push(CollItem[column.Field].toString());
|
|
148
|
-
if (!
|
|
148
|
+
if (!tr_utils_1.TrUtils.IsEmpty(CollItem['EDesc'])) {
|
|
149
149
|
DescData.push({ text: CollItem['EDesc'].toString(), color: 'grey' });
|
|
150
150
|
}
|
|
151
151
|
dataRow.push({ stack: DescData });
|
|
@@ -160,7 +160,7 @@ class TechnicianpdfService {
|
|
|
160
160
|
}
|
|
161
161
|
static CheckPrice(Labor) {
|
|
162
162
|
if (Labor.PBy === enums_1.PayTypeEnum.Insurance) {
|
|
163
|
-
if (!
|
|
163
|
+
if (!tr_utils_1.TrUtils.IsZero(Labor.AssPr)) {
|
|
164
164
|
return 'Yes';
|
|
165
165
|
}
|
|
166
166
|
else {
|
|
@@ -168,7 +168,7 @@ class TechnicianpdfService {
|
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
if (Labor.PBy === enums_1.PayTypeEnum.Customer) {
|
|
171
|
-
if (!
|
|
171
|
+
if (!tr_utils_1.TrUtils.IsZero(Labor.Pr)) {
|
|
172
172
|
return 'Yes';
|
|
173
173
|
}
|
|
174
174
|
else {
|
|
@@ -176,7 +176,7 @@ class TechnicianpdfService {
|
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
if (Labor.PBy === enums_1.PayTypeEnum.Shared) {
|
|
179
|
-
if (!
|
|
179
|
+
if (!tr_utils_1.TrUtils.IsZero(Labor.AssPr) && !tr_utils_1.TrUtils.IsZero(Labor.Pr)) {
|
|
180
180
|
return 'Yes';
|
|
181
181
|
}
|
|
182
182
|
else {
|
|
@@ -195,7 +195,7 @@ class TechnicianpdfService {
|
|
|
195
195
|
}
|
|
196
196
|
static getComplaintsAndServices(Comps, Ops) {
|
|
197
197
|
var List = [];
|
|
198
|
-
if (!
|
|
198
|
+
if (!tr_utils_1.TrUtils.IsNull(Comps) && Comps.length !== 0) {
|
|
199
199
|
List.push({ text: 'Complaints :', fontSize: 12, marginTop: 5, bold: true, decoration: 'underline' });
|
|
200
200
|
for (var i = 0; i < Comps.length; i++) {
|
|
201
201
|
List.push({ ul: [{ text: Comps[i].Desc, fontSize: 10, bold: true, marginLeft: 10, marginTop: 5 }] });
|
|
@@ -214,9 +214,9 @@ class TechnicianpdfService {
|
|
|
214
214
|
static getOnlyServices(Ops) {
|
|
215
215
|
let List = [];
|
|
216
216
|
let isTrue = false;
|
|
217
|
-
if (!
|
|
217
|
+
if (!tr_utils_1.TrUtils.IsNull(Ops) && Ops.length !== 0) {
|
|
218
218
|
for (var i = 0; i < Ops.length; i++) {
|
|
219
|
-
if (
|
|
219
|
+
if (tr_utils_1.TrUtils.IsNull(Ops[i].CompId) && tr_utils_1.TrUtils.IsNull(Ops[i].CollId)) {
|
|
220
220
|
isTrue = true;
|
|
221
221
|
List.push({ ul: [{ text: Ops[i].Desc, fontSize: 10, bold: true, marginLeft: 10, marginTop: 5 }] });
|
|
222
222
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare class TechnicianPrintService {
|
|
2
|
+
static GetTechnicianPrintData(OriginalROData: any, OriginalCustomerData: any, OriginalVehicleData: any, EntityData: any, image: any): any;
|
|
3
|
+
static GetItemsForTechnicianPrint(argROData: any): any;
|
|
4
|
+
static ReverseItemsForTechnicianPrint(argROData: any): any;
|
|
5
|
+
}
|
|
@@ -2,28 +2,28 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TechnicianPrintService = void 0;
|
|
4
4
|
const enums_1 = require("../enums/enums");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
5
|
+
const shared_print_service_1 = require("../shared/shared-services/shared-print.service");
|
|
6
|
+
const my_date_1 = require("../utils/my-date");
|
|
7
|
+
const tr_utils_1 = require("../utils/tr-utils");
|
|
8
8
|
class TechnicianPrintService {
|
|
9
9
|
static GetTechnicianPrintData(OriginalROData, OriginalCustomerData, OriginalVehicleData, EntityData, image) {
|
|
10
10
|
let TechnicianPrintData = {};
|
|
11
11
|
TechnicianPrintData.Entity = shared_print_service_1.PrintSharedService.GetFormattedEntityDataForPrint(EntityData, "Technician Copy", OriginalROData);
|
|
12
12
|
TechnicianPrintData = shared_print_service_1.PrintSharedService.GetEntityHeaderStyles(TechnicianPrintData, EntityData, image);
|
|
13
|
-
if (
|
|
13
|
+
if (tr_utils_1.TrUtils.IsNull(OriginalROData.Comps)) {
|
|
14
14
|
OriginalROData.Comps = [];
|
|
15
15
|
}
|
|
16
|
-
if (
|
|
16
|
+
if (tr_utils_1.TrUtils.IsNull(OriginalROData.Ops)) {
|
|
17
17
|
OriginalROData.Ops = [];
|
|
18
18
|
}
|
|
19
|
-
if (
|
|
19
|
+
if (tr_utils_1.TrUtils.IsNull(OriginalROData.Parts)) {
|
|
20
20
|
OriginalROData.Parts = [];
|
|
21
21
|
}
|
|
22
|
-
if (
|
|
22
|
+
if (tr_utils_1.TrUtils.IsNull(OriginalROData.Colli)) {
|
|
23
23
|
OriginalROData.Colli = [];
|
|
24
24
|
}
|
|
25
25
|
// Gets ROData From Service And Filters Only Valid Data
|
|
26
|
-
let argROData =
|
|
26
|
+
let argROData = tr_utils_1.TrUtils.Stringify(OriginalROData);
|
|
27
27
|
argROData = this.GetItemsForTechnicianPrint(argROData);
|
|
28
28
|
argROData = this.ReverseItemsForTechnicianPrint(argROData);
|
|
29
29
|
TechnicianPrintData.Comps = argROData.Comps;
|
|
@@ -52,7 +52,7 @@ class TechnicianPrintService {
|
|
|
52
52
|
Labor.Sts = enums_1.LaborStatusEnum.New;
|
|
53
53
|
});
|
|
54
54
|
argROData.Parts.forEach((Part) => {
|
|
55
|
-
if (!
|
|
55
|
+
if (!tr_utils_1.TrUtils.IsNull(Part.CollId)) {
|
|
56
56
|
Part.Sts = enums_1.LaborStatusEnum.New;
|
|
57
57
|
}
|
|
58
58
|
});
|
|
@@ -64,7 +64,7 @@ class TechnicianPrintService {
|
|
|
64
64
|
return Labor.Sts !== enums_1.LaborStatusEnum.Cancelled && Labor.Sts !== enums_1.LaborStatusEnum.Declined;
|
|
65
65
|
});
|
|
66
66
|
argROData.Parts = argROData.Parts.filter((Part) => {
|
|
67
|
-
if (!
|
|
67
|
+
if (!tr_utils_1.TrUtils.IsNull(Part.CollId)) {
|
|
68
68
|
return Part.Sts !== enums_1.LaborStatusEnum.Cancelled && Part.Sts !== enums_1.LaborStatusEnum.Declined;
|
|
69
69
|
}
|
|
70
70
|
else {
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adds multiple numbers with high precision using Big.js
|
|
3
|
+
* @param numbers - Array of numbers to add
|
|
4
|
+
* @returns The sum as a number
|
|
5
|
+
*/
|
|
6
|
+
export declare function Add(...numbers: number[]): number;
|
|
7
|
+
/**
|
|
8
|
+
* Subtracts multiple numbers with high precision using Big.js
|
|
9
|
+
* @param numbers - Array of numbers where the first is subtracted by all others
|
|
10
|
+
* @returns The subtraction result as a number
|
|
11
|
+
*/
|
|
12
|
+
export declare function Subtract(...numbers: number[]): number;
|
|
13
|
+
/**
|
|
14
|
+
* Multiplies multiple numbers with high precision using Big.js
|
|
15
|
+
* @param numbers - Array of numbers to multiply
|
|
16
|
+
* @returns The product as a number
|
|
17
|
+
*/
|
|
18
|
+
export declare function Multiply(...numbers: number[]): number;
|
|
19
|
+
/**
|
|
20
|
+
* Divides multiple numbers with high precision using Big.js
|
|
21
|
+
* @param numbers - Array of numbers where the first is divided by all others
|
|
22
|
+
* @returns The division result as a number
|
|
23
|
+
*/
|
|
24
|
+
export declare function Divide(...numbers: number[]): number;
|
|
25
|
+
/**
|
|
26
|
+
* Calculates discounted or marked-up price based on a percentage
|
|
27
|
+
* @param originalPrice - The starting price
|
|
28
|
+
* @param discountPercentage - Percentage to apply (discount or markup)
|
|
29
|
+
* @param markUp - When true, adds the percentage; when false, subtracts it
|
|
30
|
+
* @returns The final price after discount/markup as a number
|
|
31
|
+
*/
|
|
32
|
+
export declare function CalcDiscPrice(originalPrice: number, discountPercentage: number, markUp?: boolean): number;
|
|
33
|
+
/**
|
|
34
|
+
* Calculates a price with markup applied
|
|
35
|
+
* @param originalPrice - The starting price
|
|
36
|
+
* @param markupPercentage - Percentage to mark up by
|
|
37
|
+
* @returns The final marked-up price as a number
|
|
38
|
+
*/
|
|
39
|
+
export declare function CalcMarkup(originalPrice: number, markupPercentage: number): number;
|
|
40
|
+
/**
|
|
41
|
+
* Calculates a price with markdown (discount) applied
|
|
42
|
+
* @param originalPrice - The starting price
|
|
43
|
+
* @param markdownPercentage - Percentage to mark down by
|
|
44
|
+
* @returns The final marked-down price as a number
|
|
45
|
+
*/
|
|
46
|
+
export declare function CalcMarkdown(originalPrice: number, markdownPercentage: number): number;
|
|
47
|
+
/**
|
|
48
|
+
* Calculates the margin value as a percentage based on price and cost
|
|
49
|
+
* @param price - The selling price of the item
|
|
50
|
+
* @param cost - The cost of the item
|
|
51
|
+
* @returns The margin value as a percentage
|
|
52
|
+
*/
|
|
53
|
+
export declare function GetMarginValue(price: number, cost: number): number;
|
|
@@ -0,0 +1,184 @@
|
|
|
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.Add = Add;
|
|
7
|
+
exports.Subtract = Subtract;
|
|
8
|
+
exports.Multiply = Multiply;
|
|
9
|
+
exports.Divide = Divide;
|
|
10
|
+
exports.CalcDiscPrice = CalcDiscPrice;
|
|
11
|
+
exports.CalcMarkup = CalcMarkup;
|
|
12
|
+
exports.CalcMarkdown = CalcMarkdown;
|
|
13
|
+
exports.GetMarginValue = GetMarginValue;
|
|
14
|
+
// Import Big.js for precise decimal arithmetic
|
|
15
|
+
const big_js_1 = __importDefault(require("big.js"));
|
|
16
|
+
// Import utility function for handling number conversions
|
|
17
|
+
const util_js_1 = require("./util.js");
|
|
18
|
+
/**
|
|
19
|
+
* Adds multiple numbers with high precision using Big.js
|
|
20
|
+
* @param numbers - Array of numbers to add
|
|
21
|
+
* @returns The sum as a number
|
|
22
|
+
*/
|
|
23
|
+
function Add(...numbers) {
|
|
24
|
+
// Convert potential null/undefined values to numbers
|
|
25
|
+
numbers = numbers.map(util_js_1.GetNumber);
|
|
26
|
+
if (numbers.length === 0)
|
|
27
|
+
return 0;
|
|
28
|
+
// Initialize result with the first number
|
|
29
|
+
let result = new big_js_1.default(numbers[0]);
|
|
30
|
+
// Add each subsequent number to the result using a for loop
|
|
31
|
+
for (let i = 1; i < numbers.length; i++) {
|
|
32
|
+
const bigNumber = new big_js_1.default(numbers[i]);
|
|
33
|
+
result = result.plus(bigNumber);
|
|
34
|
+
}
|
|
35
|
+
// Convert back to JavaScript number type
|
|
36
|
+
return result.toNumber();
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Subtracts multiple numbers with high precision using Big.js
|
|
40
|
+
* @param numbers - Array of numbers where the first is subtracted by all others
|
|
41
|
+
* @returns The subtraction result as a number
|
|
42
|
+
*/
|
|
43
|
+
function Subtract(...numbers) {
|
|
44
|
+
// Convert potential null/undefined values to numbers
|
|
45
|
+
numbers = numbers.map(util_js_1.GetNumber);
|
|
46
|
+
if (numbers.length === 0)
|
|
47
|
+
return 0;
|
|
48
|
+
// Initialize result with the first number
|
|
49
|
+
let result = new big_js_1.default(numbers[0]);
|
|
50
|
+
// Subtract each subsequent number from the result using a for loop
|
|
51
|
+
for (let i = 1; i < numbers.length; i++) {
|
|
52
|
+
const bigNumber = new big_js_1.default(numbers[i]);
|
|
53
|
+
result = result.minus(bigNumber);
|
|
54
|
+
}
|
|
55
|
+
// Convert back to JavaScript number type
|
|
56
|
+
return result.toNumber();
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Multiplies multiple numbers with high precision using Big.js
|
|
60
|
+
* @param numbers - Array of numbers to multiply
|
|
61
|
+
* @returns The product as a number
|
|
62
|
+
*/
|
|
63
|
+
function Multiply(...numbers) {
|
|
64
|
+
// Convert potential null/undefined values to numbers
|
|
65
|
+
numbers = numbers.map(util_js_1.GetNumber);
|
|
66
|
+
if (numbers.length === 0)
|
|
67
|
+
return 0;
|
|
68
|
+
if (numbers.length === 1)
|
|
69
|
+
return numbers[0];
|
|
70
|
+
// Initialize result with the first number
|
|
71
|
+
let result = new big_js_1.default(numbers[0]);
|
|
72
|
+
// Multiply each subsequent number with the result using a for loop
|
|
73
|
+
for (let i = 1; i < numbers.length; i++) {
|
|
74
|
+
const bigNumber = new big_js_1.default(numbers[i]);
|
|
75
|
+
result = result.mul(bigNumber);
|
|
76
|
+
}
|
|
77
|
+
// Convert back to JavaScript number type
|
|
78
|
+
return result.toNumber();
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Divides multiple numbers with high precision using Big.js
|
|
82
|
+
* @param numbers - Array of numbers where the first is divided by all others
|
|
83
|
+
* @returns The division result as a number
|
|
84
|
+
*/
|
|
85
|
+
function Divide(...numbers) {
|
|
86
|
+
// Convert potential null/undefined values to numbers
|
|
87
|
+
numbers = numbers.map(util_js_1.GetNumber);
|
|
88
|
+
if (numbers.length === 0)
|
|
89
|
+
return 0;
|
|
90
|
+
if (numbers.length === 1)
|
|
91
|
+
return numbers[0];
|
|
92
|
+
// Initialize result with the first number
|
|
93
|
+
let result = new big_js_1.default(numbers[0]);
|
|
94
|
+
// Divide the result by each subsequent number using a for loop
|
|
95
|
+
for (let i = 1; i < numbers.length; i++) {
|
|
96
|
+
// Check for division by zero
|
|
97
|
+
if (numbers[i] === 0) {
|
|
98
|
+
throw new Error('Division by zero is not allowed');
|
|
99
|
+
}
|
|
100
|
+
const bigNumber = new big_js_1.default(numbers[i]);
|
|
101
|
+
result = result.div(bigNumber);
|
|
102
|
+
}
|
|
103
|
+
// Convert back to JavaScript number type
|
|
104
|
+
return result.toNumber();
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Calculates discounted or marked-up price based on a percentage
|
|
108
|
+
* @param originalPrice - The starting price
|
|
109
|
+
* @param discountPercentage - Percentage to apply (discount or markup)
|
|
110
|
+
* @param markUp - When true, adds the percentage; when false, subtracts it
|
|
111
|
+
* @returns The final price after discount/markup as a number
|
|
112
|
+
*/
|
|
113
|
+
function CalcDiscPrice(originalPrice, discountPercentage, markUp = false) {
|
|
114
|
+
console.log("DiscountedPrice");
|
|
115
|
+
console.log(originalPrice);
|
|
116
|
+
console.log(discountPercentage);
|
|
117
|
+
// Convert inputs to Big.js objects for precision
|
|
118
|
+
const price = new big_js_1.default((0, util_js_1.GetNumber)(originalPrice));
|
|
119
|
+
const percentage = new big_js_1.default((0, util_js_1.GetNumber)(discountPercentage)).div(100);
|
|
120
|
+
// Calculate the amount to add or subtract
|
|
121
|
+
const discountAmount = price.mul(percentage);
|
|
122
|
+
console.log(discountAmount.toNumber());
|
|
123
|
+
console.log(markUp);
|
|
124
|
+
// Calculate final price directly with Big.js
|
|
125
|
+
let result;
|
|
126
|
+
if (markUp) {
|
|
127
|
+
// Perform markup calculation (add the calculated amount)
|
|
128
|
+
result = price.plus(discountAmount);
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
// Perform discount calculation (subtract the calculated amount)
|
|
132
|
+
result = price.minus(discountAmount);
|
|
133
|
+
}
|
|
134
|
+
const finalPrice = result.toNumber();
|
|
135
|
+
console.log(finalPrice);
|
|
136
|
+
return finalPrice;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Calculates a price with markup applied
|
|
140
|
+
* @param originalPrice - The starting price
|
|
141
|
+
* @param markupPercentage - Percentage to mark up by
|
|
142
|
+
* @returns The final marked-up price as a number
|
|
143
|
+
*/
|
|
144
|
+
function CalcMarkup(originalPrice, markupPercentage) {
|
|
145
|
+
// Convert inputs to Big.js objects for precision
|
|
146
|
+
const price = new big_js_1.default((0, util_js_1.GetNumber)(originalPrice));
|
|
147
|
+
const percentage = new big_js_1.default((0, util_js_1.GetNumber)(markupPercentage)).div(100);
|
|
148
|
+
// Calculate markup amount based on percentage of original price
|
|
149
|
+
const markupAmount = price.mul(percentage);
|
|
150
|
+
// Add markup amount to original price
|
|
151
|
+
const result = price.plus(markupAmount);
|
|
152
|
+
return result.toNumber();
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Calculates a price with markdown (discount) applied
|
|
156
|
+
* @param originalPrice - The starting price
|
|
157
|
+
* @param markdownPercentage - Percentage to mark down by
|
|
158
|
+
* @returns The final marked-down price as a number
|
|
159
|
+
*/
|
|
160
|
+
function CalcMarkdown(originalPrice, markdownPercentage) {
|
|
161
|
+
// Convert inputs to Big.js objects for precision
|
|
162
|
+
const price = new big_js_1.default((0, util_js_1.GetNumber)(originalPrice));
|
|
163
|
+
const percentage = new big_js_1.default((0, util_js_1.GetNumber)(markdownPercentage)).div(100);
|
|
164
|
+
// Calculate markdown amount based on percentage of original price
|
|
165
|
+
const markdownAmount = price.mul(percentage);
|
|
166
|
+
// Subtract markdown amount from original price
|
|
167
|
+
const result = price.minus(markdownAmount);
|
|
168
|
+
return result.toNumber();
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Calculates the margin value as a percentage based on price and cost
|
|
172
|
+
* @param price - The selling price of the item
|
|
173
|
+
* @param cost - The cost of the item
|
|
174
|
+
* @returns The margin value as a percentage
|
|
175
|
+
*/
|
|
176
|
+
function GetMarginValue(price, cost) {
|
|
177
|
+
// Ensure inputs are valid numbers using GetNumber utility
|
|
178
|
+
const validPrice = (0, util_js_1.GetNumber)(price);
|
|
179
|
+
const validCost = (0, util_js_1.GetNumber)(cost);
|
|
180
|
+
// Calculate margin percentage: ((price - cost) / price) * 100
|
|
181
|
+
const margin = Multiply(Divide(Subtract(validPrice, validCost), validPrice), 100);
|
|
182
|
+
// Return the calculated margin
|
|
183
|
+
return margin;
|
|
184
|
+
}
|