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
|
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ROTotalsService = void 0;
|
|
4
4
|
const aggregation_1 = require("../aggregation/aggregation");
|
|
5
5
|
const enums_1 = require("../enums/enums");
|
|
6
|
-
const
|
|
6
|
+
const tr_utils_1 = require("../utils/tr-utils");
|
|
7
7
|
class ROTotalsService {
|
|
8
8
|
static GetTotalsValue(OriRecordData, TaxCodes, isWorkOrder, detailedInfo, withItems, isRoundable) {
|
|
9
|
-
let dupRecordData =
|
|
9
|
+
let dupRecordData = tr_utils_1.TrUtils.Stringify(OriRecordData);
|
|
10
10
|
let argRecordData = {};
|
|
11
|
-
dupRecordData.Ops = this.CalculateLaborValues(dupRecordData.Ops, isWorkOrder,
|
|
12
|
-
dupRecordData.Parts = this.CalculatePartValues(dupRecordData.Parts, dupRecordData.Ops, isWorkOrder,
|
|
11
|
+
dupRecordData.Ops = this.CalculateLaborValues(dupRecordData.Ops, isWorkOrder, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax));
|
|
12
|
+
dupRecordData.Parts = this.CalculatePartValues(dupRecordData.Parts, dupRecordData.Ops, isWorkOrder, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax));
|
|
13
13
|
argRecordData = this.GetROTotalsData(argRecordData, dupRecordData, TaxCodes, withItems, detailedInfo, isWorkOrder, isRoundable);
|
|
14
14
|
return argRecordData;
|
|
15
15
|
}
|
|
@@ -34,23 +34,23 @@ class ROTotalsService {
|
|
|
34
34
|
return opCodesList;
|
|
35
35
|
}
|
|
36
36
|
static ResetLaborValueIfInvalid(Operation, isWorkOrder) {
|
|
37
|
-
Operation.Perc =
|
|
38
|
-
Operation.Disc =
|
|
39
|
-
Operation.Pr =
|
|
40
|
-
Operation.AssPr =
|
|
41
|
-
Operation.ACGST =
|
|
42
|
-
Operation.ASGST =
|
|
43
|
-
Operation.AIGST =
|
|
44
|
-
Operation.CCGST =
|
|
45
|
-
Operation.CSGST =
|
|
46
|
-
Operation.CIGST =
|
|
47
|
-
Operation.NetAmt =
|
|
48
|
-
Operation.RecDisc =
|
|
37
|
+
Operation.Perc = tr_utils_1.TrUtils.SetPercToStringIfNull(Operation.Perc);
|
|
38
|
+
Operation.Disc = tr_utils_1.TrUtils.SetValueToZeroIfNull(Operation.Disc);
|
|
39
|
+
Operation.Pr = tr_utils_1.TrUtils.SetValueToZeroIfNull(Operation.Pr);
|
|
40
|
+
Operation.AssPr = tr_utils_1.TrUtils.SetValueToZeroIfNull(Operation.AssPr);
|
|
41
|
+
Operation.ACGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Operation.ACGST);
|
|
42
|
+
Operation.ASGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Operation.ASGST);
|
|
43
|
+
Operation.AIGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Operation.AIGST);
|
|
44
|
+
Operation.CCGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Operation.CCGST);
|
|
45
|
+
Operation.CSGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Operation.CSGST);
|
|
46
|
+
Operation.CIGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Operation.CIGST);
|
|
47
|
+
Operation.NetAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(Operation.NetAmt);
|
|
48
|
+
Operation.RecDisc = tr_utils_1.TrUtils.SetValueToZeroIfNull(Operation.RecDisc);
|
|
49
49
|
if (!isWorkOrder) {
|
|
50
|
-
Operation.EstPr =
|
|
51
|
-
Operation.ECGST =
|
|
52
|
-
Operation.ESGST =
|
|
53
|
-
Operation.EIGST =
|
|
50
|
+
Operation.EstPr = tr_utils_1.TrUtils.SetValueToZeroIfNull(Operation.EstPr);
|
|
51
|
+
Operation.ECGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Operation.ECGST);
|
|
52
|
+
Operation.ESGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Operation.ESGST);
|
|
53
|
+
Operation.EIGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Operation.EIGST);
|
|
54
54
|
}
|
|
55
55
|
return Operation;
|
|
56
56
|
}
|
|
@@ -159,7 +159,7 @@ class ROTotalsService {
|
|
|
159
159
|
}
|
|
160
160
|
static FilterValidPartItems(PartsList) {
|
|
161
161
|
PartsList = PartsList.filter((Part) => {
|
|
162
|
-
if (
|
|
162
|
+
if (tr_utils_1.TrUtils.IsNull(Part.CollId)) {
|
|
163
163
|
return Part;
|
|
164
164
|
}
|
|
165
165
|
else {
|
|
@@ -175,32 +175,32 @@ class ROTotalsService {
|
|
|
175
175
|
return PartsList;
|
|
176
176
|
}
|
|
177
177
|
static ResetPartValueIfInvalid(Part, isWorkOrder) {
|
|
178
|
-
Part.Perc =
|
|
179
|
-
Part.Disc =
|
|
180
|
-
Part.UnPr =
|
|
181
|
-
Part.AssPr =
|
|
182
|
-
Part.ACGST =
|
|
183
|
-
Part.ASGST =
|
|
184
|
-
Part.AIGST =
|
|
185
|
-
Part.CCGST =
|
|
186
|
-
Part.CSGST =
|
|
187
|
-
Part.CIGST =
|
|
188
|
-
Part.UnAmt =
|
|
189
|
-
Part.AssAmt =
|
|
190
|
-
Part.NetAmt =
|
|
191
|
-
Part.RecDisc =
|
|
178
|
+
Part.Perc = tr_utils_1.TrUtils.SetPercToStringIfNull(Part.Perc);
|
|
179
|
+
Part.Disc = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.Disc);
|
|
180
|
+
Part.UnPr = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.UnPr);
|
|
181
|
+
Part.AssPr = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.AssPr);
|
|
182
|
+
Part.ACGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.ACGST);
|
|
183
|
+
Part.ASGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.ASGST);
|
|
184
|
+
Part.AIGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.AIGST);
|
|
185
|
+
Part.CCGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.CCGST);
|
|
186
|
+
Part.CSGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.CSGST);
|
|
187
|
+
Part.CIGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.CIGST);
|
|
188
|
+
Part.UnAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.UnAmt);
|
|
189
|
+
Part.AssAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.AssAmt);
|
|
190
|
+
Part.NetAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.NetAmt);
|
|
191
|
+
Part.RecDisc = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.RecDisc);
|
|
192
192
|
if (!isWorkOrder) {
|
|
193
|
-
Part.EstPr =
|
|
194
|
-
Part.ECGST =
|
|
195
|
-
Part.ESGST =
|
|
196
|
-
Part.EIGST =
|
|
197
|
-
Part.EstAmt =
|
|
193
|
+
Part.EstPr = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.EstPr);
|
|
194
|
+
Part.ECGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.ECGST);
|
|
195
|
+
Part.ESGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.ESGST);
|
|
196
|
+
Part.EIGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.EIGST);
|
|
197
|
+
Part.EstAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.EstAmt);
|
|
198
198
|
}
|
|
199
199
|
return Part;
|
|
200
200
|
}
|
|
201
201
|
static GetPartsDiscountPrice(PartsList, LaborList, isWorkOrder) {
|
|
202
202
|
PartsList.forEach((Part) => {
|
|
203
|
-
if (
|
|
203
|
+
if (tr_utils_1.TrUtils.IsNull(Part.CollId)) {
|
|
204
204
|
if (isWorkOrder) {
|
|
205
205
|
Part.CustDiscountedPrice = (0, aggregation_1.addition)(Part.Disc, Part.RecDisc);
|
|
206
206
|
}
|
|
@@ -231,7 +231,7 @@ class ROTotalsService {
|
|
|
231
231
|
return PartsList;
|
|
232
232
|
}
|
|
233
233
|
static GetPartParentStatus(Part, LaborList) {
|
|
234
|
-
if (!
|
|
234
|
+
if (!tr_utils_1.TrUtils.IsNull(Part.OpId)) {
|
|
235
235
|
let index = LaborList.findIndex((Labor) => {
|
|
236
236
|
return Labor._id === Part.OpId;
|
|
237
237
|
});
|
|
@@ -243,12 +243,12 @@ class ROTotalsService {
|
|
|
243
243
|
}
|
|
244
244
|
static GetPartsAfterDiscount(PartsList, LaborList, isWorkOrder) {
|
|
245
245
|
PartsList.forEach((Part) => {
|
|
246
|
-
if (
|
|
246
|
+
if (tr_utils_1.TrUtils.IsNull(Part.CollId)) {
|
|
247
247
|
let CustAfterPartDisc = 0;
|
|
248
248
|
let InsAfterPartDisc = 0;
|
|
249
249
|
if (isWorkOrder) {
|
|
250
250
|
CustAfterPartDisc = Part.NetAmt;
|
|
251
|
-
if (
|
|
251
|
+
if (tr_utils_1.TrUtils.IsNull(Part.OpId)) {
|
|
252
252
|
InsAfterPartDisc = Part.AssAmt;
|
|
253
253
|
}
|
|
254
254
|
}
|
|
@@ -259,7 +259,7 @@ class ROTotalsService {
|
|
|
259
259
|
}
|
|
260
260
|
else {
|
|
261
261
|
CustAfterPartDisc = Part.NetAmt;
|
|
262
|
-
if (
|
|
262
|
+
if (tr_utils_1.TrUtils.IsNull(Part.OpId)) {
|
|
263
263
|
InsAfterPartDisc = Part.AssAmt;
|
|
264
264
|
}
|
|
265
265
|
}
|
|
@@ -311,10 +311,10 @@ class ROTotalsService {
|
|
|
311
311
|
Part.InsAfterTax = Part.InsAfterPartDisc;
|
|
312
312
|
}
|
|
313
313
|
else {
|
|
314
|
-
if (
|
|
314
|
+
if (tr_utils_1.TrUtils.IsNull(Part.CollId)) {
|
|
315
315
|
if (isWorkOrder) {
|
|
316
316
|
Part.CustAfterTax = (0, aggregation_1.addition)(Part.CustAfterPartDisc, Part.CCGST, Part.CSGST, Part.CIGST);
|
|
317
|
-
if (
|
|
317
|
+
if (tr_utils_1.TrUtils.IsNull(Part.OpId)) {
|
|
318
318
|
Part.InsAfterTax = (0, aggregation_1.addition)(Part.InsAfterPartDisc, Part.ACGST, Part.ASGST, Part.AIGST);
|
|
319
319
|
}
|
|
320
320
|
}
|
|
@@ -325,7 +325,7 @@ class ROTotalsService {
|
|
|
325
325
|
}
|
|
326
326
|
else {
|
|
327
327
|
Part.CustAfterTax = (0, aggregation_1.addition)(Part.CustAfterPartDisc, Part.CCGST, Part.CSGST, Part.CIGST);
|
|
328
|
-
if (
|
|
328
|
+
if (tr_utils_1.TrUtils.IsNull(Part.OpId)) {
|
|
329
329
|
Part.InsAfterTax = (0, aggregation_1.addition)(Part.InsAfterPartDisc, Part.ACGST, Part.ASGST, Part.AIGST);
|
|
330
330
|
}
|
|
331
331
|
}
|
|
@@ -391,12 +391,12 @@ class ROTotalsService {
|
|
|
391
391
|
return argRecordData;
|
|
392
392
|
}
|
|
393
393
|
static ResetDiscountValuesIfInvalid(dupRecordData) {
|
|
394
|
-
dupRecordData.LPerc =
|
|
395
|
-
dupRecordData.PPerc =
|
|
396
|
-
dupRecordData.Perc =
|
|
397
|
-
dupRecordData.LDisc =
|
|
398
|
-
dupRecordData.PDisc =
|
|
399
|
-
dupRecordData.Disc =
|
|
394
|
+
dupRecordData.LPerc = tr_utils_1.TrUtils.SetPercToStringIfNull(dupRecordData.LPerc);
|
|
395
|
+
dupRecordData.PPerc = tr_utils_1.TrUtils.SetPercToStringIfNull(dupRecordData.PPerc);
|
|
396
|
+
dupRecordData.Perc = tr_utils_1.TrUtils.SetPercToStringIfNull(dupRecordData.Perc);
|
|
397
|
+
dupRecordData.LDisc = tr_utils_1.TrUtils.SetValueToZeroIfNull(dupRecordData.LDisc);
|
|
398
|
+
dupRecordData.PDisc = tr_utils_1.TrUtils.SetValueToZeroIfNull(dupRecordData.PDisc);
|
|
399
|
+
dupRecordData.Disc = tr_utils_1.TrUtils.SetValueToZeroIfNull(dupRecordData.Disc);
|
|
400
400
|
return dupRecordData;
|
|
401
401
|
}
|
|
402
402
|
static SetMainDiscountValues(argRecordData, dupRecordData, detailedInfo) {
|
|
@@ -415,27 +415,27 @@ class ROTotalsService {
|
|
|
415
415
|
}
|
|
416
416
|
static GetFinalCustomerTotalsData(argRecordData, dupRecordData, isWorkOrder, detailedInfo, isRoundable) {
|
|
417
417
|
let CustomerAfterDiscTotals = this.GetCustSubTotal(dupRecordData.Ops, dupRecordData.Parts);
|
|
418
|
-
let CustLaborTaxTotal = this.GetCustLaborTaxTotal(dupRecordData.Ops,
|
|
419
|
-
let CustPartTaxTotal = this.GetCustPartsTaxTotal(dupRecordData.Ops, dupRecordData.Parts,
|
|
420
|
-
let CustLaborDiscTotal = this.GetCustLaborDiscountedTotal(dupRecordData.Ops,
|
|
421
|
-
let CustPartsDiscTotal = this.GetCustPartDiscountedTotal(dupRecordData.Parts,
|
|
418
|
+
let CustLaborTaxTotal = this.GetCustLaborTaxTotal(dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
419
|
+
let CustPartTaxTotal = this.GetCustPartsTaxTotal(dupRecordData.Ops, dupRecordData.Parts, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
420
|
+
let CustLaborDiscTotal = this.GetCustLaborDiscountedTotal(dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), dupRecordData);
|
|
421
|
+
let CustPartsDiscTotal = this.GetCustPartDiscountedTotal(dupRecordData.Parts, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), dupRecordData);
|
|
422
422
|
let CustLaborTotalAfterDisc = this.GetCustLaborTotalAfterDiscount(dupRecordData.Ops);
|
|
423
423
|
let CustPartsTotalAfterDisc = this.GetCustPartsTotalAfterDiscount(dupRecordData.Parts);
|
|
424
424
|
argRecordData.STotal = (0, aggregation_1.addition)(CustLaborDiscTotal, CustPartsDiscTotal, CustLaborTotalAfterDisc, CustPartsTotalAfterDisc);
|
|
425
425
|
argRecordData.CustLaborTotalBeforeDisc = (0, aggregation_1.addition)(argRecordData.CustLaborTotalAfterDisc, argRecordData.CustLaborDiscTotal);
|
|
426
426
|
argRecordData.CustPartsTotalBeforeDisc = (0, aggregation_1.addition)(argRecordData.CustPartsTotalAfterDisc, argRecordData.CustPartsDiscTotal);
|
|
427
|
-
argRecordData.SubTotal =
|
|
428
|
-
let CustTotal = this.GetCustomerTotalBasedOnTaxType(dupRecordData, CustLaborTaxTotal, CustPartTaxTotal, dupRecordData.Ops, dupRecordData.Parts,
|
|
427
|
+
argRecordData.SubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals);
|
|
428
|
+
let CustTotal = this.GetCustomerTotalBasedOnTaxType(dupRecordData, CustLaborTaxTotal, CustPartTaxTotal, dupRecordData.Ops, dupRecordData.Parts, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax));
|
|
429
429
|
if (detailedInfo) {
|
|
430
|
-
argRecordData.FixedSubTotal =
|
|
431
|
-
argRecordData.FixedTotal =
|
|
430
|
+
argRecordData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals);
|
|
431
|
+
argRecordData.FixedTotal = tr_utils_1.TrUtils.FixedTo(CustTotal);
|
|
432
432
|
}
|
|
433
433
|
if (isRoundable) {
|
|
434
434
|
argRecordData.Round = (0, aggregation_1.subtraction)(Math.round(CustTotal), CustTotal);
|
|
435
435
|
argRecordData.Total = Math.round(CustTotal);
|
|
436
436
|
}
|
|
437
437
|
else {
|
|
438
|
-
argRecordData.Total =
|
|
438
|
+
argRecordData.Total = tr_utils_1.TrUtils.FixedTo(CustTotal);
|
|
439
439
|
}
|
|
440
440
|
return argRecordData;
|
|
441
441
|
}
|
|
@@ -489,7 +489,7 @@ class ROTotalsService {
|
|
|
489
489
|
let TotalTaxAmt = 0;
|
|
490
490
|
if (IsTaxable) {
|
|
491
491
|
PartsList.forEach((Part) => {
|
|
492
|
-
if (!
|
|
492
|
+
if (!tr_utils_1.TrUtils.IsNull(Part.CollId)) {
|
|
493
493
|
if (isWorkOrder) {
|
|
494
494
|
if ((Part.PBy === enums_1.PayTypeEnum.Customer || Part.PBy === enums_1.PayTypeEnum.Shared)) {
|
|
495
495
|
TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Part.CCGST, Part.CSGST, Part.CIGST);
|
|
@@ -551,12 +551,12 @@ class ROTotalsService {
|
|
|
551
551
|
}
|
|
552
552
|
static GetFinalInsuranceTotalsData(argRecordData, dupRecordData, detailedInfo, isWorkOrder) {
|
|
553
553
|
let InsuranceAfterDiscTotals = this.GetInsSubTotal(dupRecordData.Ops, dupRecordData.Parts);
|
|
554
|
-
let InsLaborTaxTotal = this.GetInsLaborTaxTotal(dupRecordData.Ops,
|
|
555
|
-
let InsPartTaxTotal = this.GetInsPartsTaxTotal(dupRecordData.Parts,
|
|
556
|
-
let InsTotal = this.GetInsuranceTotalBasedOnTaxType(InsuranceAfterDiscTotals, InsLaborTaxTotal, InsPartTaxTotal,
|
|
557
|
-
argRecordData.InsTotal =
|
|
554
|
+
let InsLaborTaxTotal = this.GetInsLaborTaxTotal(dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
555
|
+
let InsPartTaxTotal = this.GetInsPartsTaxTotal(dupRecordData.Parts, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
556
|
+
let InsTotal = this.GetInsuranceTotalBasedOnTaxType(InsuranceAfterDiscTotals, InsLaborTaxTotal, InsPartTaxTotal, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax));
|
|
557
|
+
argRecordData.InsTotal = tr_utils_1.TrUtils.FixedTo(InsTotal);
|
|
558
558
|
if (detailedInfo) {
|
|
559
|
-
argRecordData.FixedInsTotal =
|
|
559
|
+
argRecordData.FixedInsTotal = tr_utils_1.TrUtils.FixedTo(InsTotal);
|
|
560
560
|
}
|
|
561
561
|
return argRecordData;
|
|
562
562
|
}
|
|
@@ -606,7 +606,7 @@ class ROTotalsService {
|
|
|
606
606
|
let TotalTaxAmt = 0;
|
|
607
607
|
if (IsTaxable) {
|
|
608
608
|
PartsList.forEach((Part) => {
|
|
609
|
-
if (!
|
|
609
|
+
if (!tr_utils_1.TrUtils.IsNull(Part.CollId) || Part.PBy === enums_1.PayTypeEnum.Insurance || Part.PBy === enums_1.PayTypeEnum.Shared) {
|
|
610
610
|
if (isWorkOrder) {
|
|
611
611
|
if ((Part.PBy === enums_1.PayTypeEnum.Insurance || Part.PBy === enums_1.PayTypeEnum.Shared)) {
|
|
612
612
|
TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Part.ACGST, Part.ASGST, Part.AIGST);
|
|
@@ -644,30 +644,30 @@ class ROTotalsService {
|
|
|
644
644
|
argRecordData.InsPartsTotalAfterDisc = this.GetInsPartsTotalAfterDiscount(dupRecordData.Parts);
|
|
645
645
|
argRecordData.InsLaborTotalBeforeDisc = (0, aggregation_1.addition)(argRecordData.InsLaborTotalAfterDisc, argRecordData.InsLaborDiscTotal);
|
|
646
646
|
argRecordData.InsPartsTotalBeforeDisc = (0, aggregation_1.addition)(argRecordData.InsPartsTotalAfterDisc, argRecordData.InsPartsDiscTotal);
|
|
647
|
-
argRecordData.InsLaborITax = this.GetInsLaborTaxTotal(dupRecordData.Ops,
|
|
648
|
-
argRecordData.InsLaborCGST = this.GetInsLaborCGSTTaxTotal(dupRecordData.Ops,
|
|
649
|
-
argRecordData.InsLaborIGST = this.GetInsLaborIGSTTaxTotal(dupRecordData.Ops,
|
|
650
|
-
argRecordData.InsLaborSGST = this.GetInsLaborSGSTTaxTotal(dupRecordData.Ops,
|
|
651
|
-
argRecordData.InsPartITax = this.GetInsPartsTaxTotal(dupRecordData.Parts,
|
|
652
|
-
argRecordData.InsPartCGST = this.GetInsPartCGSTTaxTotal(dupRecordData.Parts,
|
|
653
|
-
argRecordData.InsPartIGST = this.GetInsPartIGSTTaxTotal(dupRecordData.Parts,
|
|
654
|
-
argRecordData.InsPartSGST = this.GetInsPartSGSTTaxTotal(dupRecordData.Parts,
|
|
647
|
+
argRecordData.InsLaborITax = this.GetInsLaborTaxTotal(dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
648
|
+
argRecordData.InsLaborCGST = this.GetInsLaborCGSTTaxTotal(dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
649
|
+
argRecordData.InsLaborIGST = this.GetInsLaborIGSTTaxTotal(dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
650
|
+
argRecordData.InsLaborSGST = this.GetInsLaborSGSTTaxTotal(dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
651
|
+
argRecordData.InsPartITax = this.GetInsPartsTaxTotal(dupRecordData.Parts, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
652
|
+
argRecordData.InsPartCGST = this.GetInsPartCGSTTaxTotal(dupRecordData.Parts, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
653
|
+
argRecordData.InsPartIGST = this.GetInsPartIGSTTaxTotal(dupRecordData.Parts, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
654
|
+
argRecordData.InsPartSGST = this.GetInsPartSGSTTaxTotal(dupRecordData.Parts, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
655
655
|
argRecordData.InsLaborTotalAfterTax = (0, aggregation_1.addition)(argRecordData.InsLaborTotalAfterDisc, argRecordData.InsLaborITax);
|
|
656
656
|
argRecordData.InsPartsTotalAfterTax = (0, aggregation_1.addition)(argRecordData.InsPartsTotalAfterDisc, argRecordData.InsPartITax);
|
|
657
|
-
argRecordData.CustLaborDiscTotal = this.GetCustLaborDiscountedTotal(dupRecordData.Ops,
|
|
658
|
-
argRecordData.CustPartsDiscTotal = this.GetCustPartDiscountedTotal(dupRecordData.Parts,
|
|
657
|
+
argRecordData.CustLaborDiscTotal = this.GetCustLaborDiscountedTotal(dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), dupRecordData);
|
|
658
|
+
argRecordData.CustPartsDiscTotal = this.GetCustPartDiscountedTotal(dupRecordData.Parts, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), dupRecordData);
|
|
659
659
|
argRecordData.CustLaborTotalAfterDisc = this.GetCustLaborTotalAfterDiscount(dupRecordData.Ops);
|
|
660
660
|
argRecordData.CustPartsTotalAfterDisc = this.GetCustPartsTotalAfterDiscount(dupRecordData.Parts);
|
|
661
661
|
argRecordData.CustLaborTotalBeforeDisc = (0, aggregation_1.addition)(argRecordData.CustLaborTotalAfterDisc, argRecordData.CustLaborDiscTotal);
|
|
662
662
|
argRecordData.CustPartsTotalBeforeDisc = (0, aggregation_1.addition)(argRecordData.CustPartsTotalAfterDisc, argRecordData.CustPartsDiscTotal);
|
|
663
|
-
argRecordData.CustLaborITax = this.GetCustLaborTaxTotal(dupRecordData.Ops,
|
|
664
|
-
argRecordData.CustLaborSGST = this.GetCustLaborSGSTTaxTotal(dupRecordData.Ops,
|
|
665
|
-
argRecordData.CustLaborCGST = this.GetCustLaborCGSTTaxTotal(dupRecordData.Ops,
|
|
666
|
-
argRecordData.CustLaborIGST = this.GetCustLaborIGSTTaxTotal(dupRecordData.Ops,
|
|
667
|
-
argRecordData.CustPartITax = this.GetCustPartsTaxTotal(dupRecordData.Ops, dupRecordData.Parts,
|
|
668
|
-
argRecordData.CustPartCGST = this.GetCustPartCGSTTaxTotal(dupRecordData.Ops, dupRecordData.Parts,
|
|
669
|
-
argRecordData.CustPartIGST = this.GetCustPartIGSTTaxTotal(dupRecordData.Ops, dupRecordData.Parts,
|
|
670
|
-
argRecordData.CustPartSGST = this.GetCustPartSGSTTaxTotal(dupRecordData.Ops, dupRecordData.Parts,
|
|
663
|
+
argRecordData.CustLaborITax = this.GetCustLaborTaxTotal(dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
664
|
+
argRecordData.CustLaborSGST = this.GetCustLaborSGSTTaxTotal(dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
665
|
+
argRecordData.CustLaborCGST = this.GetCustLaborCGSTTaxTotal(dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
666
|
+
argRecordData.CustLaborIGST = this.GetCustLaborIGSTTaxTotal(dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
667
|
+
argRecordData.CustPartITax = this.GetCustPartsTaxTotal(dupRecordData.Ops, dupRecordData.Parts, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
668
|
+
argRecordData.CustPartCGST = this.GetCustPartCGSTTaxTotal(dupRecordData.Ops, dupRecordData.Parts, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
669
|
+
argRecordData.CustPartIGST = this.GetCustPartIGSTTaxTotal(dupRecordData.Ops, dupRecordData.Parts, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
670
|
+
argRecordData.CustPartSGST = this.GetCustPartSGSTTaxTotal(dupRecordData.Ops, dupRecordData.Parts, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
671
671
|
argRecordData.CustLaborLDiscAmount = this.GetLaborLDiscAmount(argRecordData.CustLaborTotalAfterDisc, argRecordData.LDisc);
|
|
672
672
|
argRecordData.CustPartsPDiscAmount = this.GetPartsPDiscAmount(argRecordData.CustPartsTotalAfterDisc, argRecordData.PDisc);
|
|
673
673
|
argRecordData.CustLaborAfterLDisc = argRecordData.CustLaborTotalAfterDisc;
|
|
@@ -677,7 +677,7 @@ class ROTotalsService {
|
|
|
677
677
|
argRecordData.CustTaxGroupData = this.GetCustPartsTaxGrouping(dupRecordData.Parts, TaxCodes, isWorkOrder);
|
|
678
678
|
argRecordData.InsTaxGroupData = this.GetInsPartsTaxGrouping(dupRecordData.Parts, TaxCodes);
|
|
679
679
|
argRecordData.CustTotalRoundedBy = argRecordData.Round;
|
|
680
|
-
argRecordData.InsTotalRoundedBy =
|
|
680
|
+
argRecordData.InsTotalRoundedBy = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.subtraction)(Math.round(argRecordData.InsTotal), argRecordData.InsTotal));
|
|
681
681
|
argRecordData.CustRoundedTotal = argRecordData.Total;
|
|
682
682
|
argRecordData.InsRoundedTotal = Math.round(argRecordData.InsTotal);
|
|
683
683
|
for (var key in argRecordData) {
|
|
@@ -685,7 +685,7 @@ class ROTotalsService {
|
|
|
685
685
|
key !== 'LDisc' && key !== 'LPerc' && key !== 'PDisc' &&
|
|
686
686
|
key !== 'PPerc' && key !== 'Disc' && key !== 'Perc' && key !== 'Tax'
|
|
687
687
|
&& typeof argRecordData[key] === 'number') {
|
|
688
|
-
argRecordData[key] =
|
|
688
|
+
argRecordData[key] = tr_utils_1.TrUtils.FixPriceValue(argRecordData[key]);
|
|
689
689
|
}
|
|
690
690
|
}
|
|
691
691
|
return argRecordData;
|
|
@@ -694,7 +694,7 @@ class ROTotalsService {
|
|
|
694
694
|
let LaborDiscountedTotal = 0;
|
|
695
695
|
let overallLaborDisc = 0;
|
|
696
696
|
if (!isTaxable) {
|
|
697
|
-
overallLaborDisc =
|
|
697
|
+
overallLaborDisc = tr_utils_1.TrUtils.SetValueToZeroIfNull(finalTotalsData.LDisc);
|
|
698
698
|
}
|
|
699
699
|
LaborList.forEach((Labor) => {
|
|
700
700
|
LaborDiscountedTotal = (0, aggregation_1.addition)(LaborDiscountedTotal, Labor.CustDiscountedPrice);
|
|
@@ -705,7 +705,7 @@ class ROTotalsService {
|
|
|
705
705
|
let PartsDiscountedTotal = 0;
|
|
706
706
|
let overallPartDisc = 0;
|
|
707
707
|
if (!isTaxable) {
|
|
708
|
-
overallPartDisc =
|
|
708
|
+
overallPartDisc = tr_utils_1.TrUtils.SetValueToZeroIfNull(finalTotalsData.PDisc);
|
|
709
709
|
}
|
|
710
710
|
PartsList.forEach((Part) => {
|
|
711
711
|
PartsDiscountedTotal = (0, aggregation_1.addition)(PartsDiscountedTotal, Part.CustDiscountedPrice);
|
|
@@ -779,7 +779,7 @@ class ROTotalsService {
|
|
|
779
779
|
let TotalTaxAmt = 0;
|
|
780
780
|
if (IsTaxable) {
|
|
781
781
|
PartsList.forEach((Part) => {
|
|
782
|
-
if (!
|
|
782
|
+
if (!tr_utils_1.TrUtils.IsNull(Part.CollId)) {
|
|
783
783
|
if (isWorkOrder) {
|
|
784
784
|
TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Part.CCGST);
|
|
785
785
|
}
|
|
@@ -823,7 +823,7 @@ class ROTotalsService {
|
|
|
823
823
|
let TotalTaxAmt = 0;
|
|
824
824
|
if (IsTaxable) {
|
|
825
825
|
PartsList.forEach((Part) => {
|
|
826
|
-
if (!
|
|
826
|
+
if (!tr_utils_1.TrUtils.IsNull(Part.CollId)) {
|
|
827
827
|
if (isWorkOrder) {
|
|
828
828
|
TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Part.CIGST);
|
|
829
829
|
}
|
|
@@ -867,7 +867,7 @@ class ROTotalsService {
|
|
|
867
867
|
let TotalTaxAmt = 0;
|
|
868
868
|
if (IsTaxable) {
|
|
869
869
|
PartsList.forEach((Part) => {
|
|
870
|
-
if (!
|
|
870
|
+
if (!tr_utils_1.TrUtils.IsNull(Part.CollId)) {
|
|
871
871
|
if (isWorkOrder) {
|
|
872
872
|
TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Part.CSGST);
|
|
873
873
|
}
|
|
@@ -974,7 +974,7 @@ class ROTotalsService {
|
|
|
974
974
|
let TotalTaxAmt = 0;
|
|
975
975
|
if (IsTaxable) {
|
|
976
976
|
PartsList.forEach((Part) => {
|
|
977
|
-
if (!
|
|
977
|
+
if (!tr_utils_1.TrUtils.IsNull(Part.CollId) || Part.PBy === enums_1.PayTypeEnum.Insurance || Part.PBy === enums_1.PayTypeEnum.Shared) {
|
|
978
978
|
if (isWorkOrder) {
|
|
979
979
|
TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Part.ACGST);
|
|
980
980
|
}
|
|
@@ -997,7 +997,7 @@ class ROTotalsService {
|
|
|
997
997
|
let TotalTaxAmt = 0;
|
|
998
998
|
if (IsTaxable) {
|
|
999
999
|
PartsList.forEach((Part) => {
|
|
1000
|
-
if (!
|
|
1000
|
+
if (!tr_utils_1.TrUtils.IsNull(Part.CollId) || Part.PBy === enums_1.PayTypeEnum.Insurance || Part.PBy === enums_1.PayTypeEnum.Shared) {
|
|
1001
1001
|
if (isWorkOrder) {
|
|
1002
1002
|
TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Part.AIGST);
|
|
1003
1003
|
}
|
|
@@ -1020,7 +1020,7 @@ class ROTotalsService {
|
|
|
1020
1020
|
let TotalTaxAmt = 0;
|
|
1021
1021
|
if (IsTaxable) {
|
|
1022
1022
|
PartsList.forEach((Part) => {
|
|
1023
|
-
if (!
|
|
1023
|
+
if (!tr_utils_1.TrUtils.IsNull(Part.CollId) || Part.PBy === enums_1.PayTypeEnum.Insurance || Part.PBy === enums_1.PayTypeEnum.Shared) {
|
|
1024
1024
|
if (isWorkOrder) {
|
|
1025
1025
|
TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Part.ASGST);
|
|
1026
1026
|
}
|
|
@@ -1041,14 +1041,14 @@ class ROTotalsService {
|
|
|
1041
1041
|
}
|
|
1042
1042
|
static GetLaborLDiscAmount(LaborTotalAfterDisc, LDisc) {
|
|
1043
1043
|
let LaborLDiscAmt = 0;
|
|
1044
|
-
if (!
|
|
1044
|
+
if (!tr_utils_1.TrUtils.IsZero(LaborTotalAfterDisc)) {
|
|
1045
1045
|
LaborLDiscAmt = LDisc;
|
|
1046
1046
|
}
|
|
1047
1047
|
return LaborLDiscAmt;
|
|
1048
1048
|
}
|
|
1049
1049
|
static GetPartsPDiscAmount(PartsTotalAfterDisc, PDisc) {
|
|
1050
1050
|
let PartsPDiscAmt = 0;
|
|
1051
|
-
if (!
|
|
1051
|
+
if (!tr_utils_1.TrUtils.IsZero(PartsTotalAfterDisc)) {
|
|
1052
1052
|
PartsPDiscAmt = PDisc;
|
|
1053
1053
|
}
|
|
1054
1054
|
return PartsPDiscAmt;
|
|
@@ -1078,30 +1078,30 @@ class ROTotalsService {
|
|
|
1078
1078
|
let HSN = MatchedPart[0].HSN;
|
|
1079
1079
|
TaxInfo.CombinedTaxPercentage = MatchedPart[0].CombinedTaxPercentage;
|
|
1080
1080
|
MatchedPart.forEach((argMatchedGSTPart) => {
|
|
1081
|
-
TaxOnAmount = (0, aggregation_1.addition)(TaxOnAmount,
|
|
1081
|
+
TaxOnAmount = (0, aggregation_1.addition)(TaxOnAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CustAfterPartDisc));
|
|
1082
1082
|
if (isWorkOrder) {
|
|
1083
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount,
|
|
1084
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount,
|
|
1085
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount,
|
|
1083
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CCGST));
|
|
1084
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CIGST));
|
|
1085
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CSGST));
|
|
1086
1086
|
}
|
|
1087
1087
|
else {
|
|
1088
1088
|
if (argMatchedGSTPart.Sts !== enums_1.LaborStatusEnum.New && argMatchedGSTPart.Sts !== enums_1.LaborStatusEnum.WtngForAppr) {
|
|
1089
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount,
|
|
1090
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount,
|
|
1091
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount,
|
|
1089
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CCGST));
|
|
1090
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CIGST));
|
|
1091
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CSGST));
|
|
1092
1092
|
}
|
|
1093
1093
|
else {
|
|
1094
1094
|
if (argMatchedGSTPart.PBy === enums_1.PayTypeEnum.Customer) {
|
|
1095
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount,
|
|
1096
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount,
|
|
1097
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount,
|
|
1095
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.ECGST));
|
|
1096
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.EIGST));
|
|
1097
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.ESGST));
|
|
1098
1098
|
}
|
|
1099
1099
|
}
|
|
1100
1100
|
}
|
|
1101
1101
|
});
|
|
1102
1102
|
TaxInfo.HSN = HSN;
|
|
1103
|
-
TaxInfo.TotalTaxableAmount =
|
|
1104
|
-
TaxInfo.TotalTaxAmount =
|
|
1103
|
+
TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount);
|
|
1104
|
+
TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount);
|
|
1105
1105
|
TaxInfo.PartsCount = MatchedPart.length;
|
|
1106
1106
|
let GSTValues = this.GetGSTValueBasedOnTaxCode(MatchedPart[0].TCode, TaxCodes);
|
|
1107
1107
|
TaxInfo.CGST = GSTValues[0];
|
|
@@ -1138,23 +1138,23 @@ class ROTotalsService {
|
|
|
1138
1138
|
let HSN = MatchedPart[0].HSN;
|
|
1139
1139
|
TaxInfo.CombinedTaxPercentage = MatchedPart[0].CombinedTaxPercentage;
|
|
1140
1140
|
MatchedPart.forEach((argMatchedGSTPart) => {
|
|
1141
|
-
TaxOnAmount = (0, aggregation_1.addition)(TaxOnAmount,
|
|
1141
|
+
TaxOnAmount = (0, aggregation_1.addition)(TaxOnAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.InsAfterPartDisc));
|
|
1142
1142
|
if (argMatchedGSTPart.PBy === enums_1.PayTypeEnum.Insurance || argMatchedGSTPart.PBy === enums_1.PayTypeEnum.Shared) {
|
|
1143
1143
|
if (argMatchedGSTPart.Sts !== enums_1.LaborStatusEnum.New && argMatchedGSTPart.Sts !== enums_1.LaborStatusEnum.WtngForAppr) {
|
|
1144
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount,
|
|
1145
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount,
|
|
1146
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount,
|
|
1144
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.ACGST));
|
|
1145
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.AIGST));
|
|
1146
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.ASGST));
|
|
1147
1147
|
}
|
|
1148
1148
|
else {
|
|
1149
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount,
|
|
1150
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount,
|
|
1151
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount,
|
|
1149
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.ECGST));
|
|
1150
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.EIGST));
|
|
1151
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.ESGST));
|
|
1152
1152
|
}
|
|
1153
1153
|
}
|
|
1154
1154
|
});
|
|
1155
1155
|
TaxInfo.HSN = HSN;
|
|
1156
|
-
TaxInfo.TotalTaxableAmount =
|
|
1157
|
-
TaxInfo.TotalTaxAmount =
|
|
1156
|
+
TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount);
|
|
1157
|
+
TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount);
|
|
1158
1158
|
TaxInfo.PartsCount = MatchedPart.length;
|
|
1159
1159
|
let GSTValues = this.GetGSTValueBasedOnTaxCode(MatchedPart[0].TCode, TaxCodes);
|
|
1160
1160
|
TaxInfo.CGST = GSTValues[0];
|
|
@@ -1170,7 +1170,7 @@ class ROTotalsService {
|
|
|
1170
1170
|
let CGST = 0;
|
|
1171
1171
|
let SGST = 0;
|
|
1172
1172
|
let IGST = 0;
|
|
1173
|
-
if (
|
|
1173
|
+
if (tr_utils_1.TrUtils.IsNull(TCode)) {
|
|
1174
1174
|
return [CGST, SGST, IGST];
|
|
1175
1175
|
}
|
|
1176
1176
|
let TCodeIndex = TaxCodes.findIndex((TaxCode) => {
|
|
@@ -1200,7 +1200,7 @@ class ROTotalsService {
|
|
|
1200
1200
|
}
|
|
1201
1201
|
static ResetPartsHSNIfInvalid(Parts) {
|
|
1202
1202
|
Parts.forEach((Part) => {
|
|
1203
|
-
if (
|
|
1203
|
+
if (tr_utils_1.TrUtils.IsNull(Part.HSN)) {
|
|
1204
1204
|
Part.HSN = '';
|
|
1205
1205
|
}
|
|
1206
1206
|
});
|