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
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SaleReceiptPrintService = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
4
|
+
const aggregation_1 = require("../../aggregation/aggregation");
|
|
5
|
+
const code_enums_1 = require("../../enums/code-enums");
|
|
6
|
+
const enums_1 = require("../../enums/enums");
|
|
7
|
+
const shared_print_service_1 = require("../../shared/shared-services/shared-print.service");
|
|
8
|
+
const my_date_1 = require("../../utils/my-date");
|
|
9
|
+
const tr_utils_1 = require("../../utils/tr-utils");
|
|
10
|
+
const invoice_total_service_1 = require("../invoice/invoice-total.service");
|
|
11
11
|
class SaleReceiptPrintService {
|
|
12
12
|
static GetSaleReceiptPrintInfo(OriginalInvoiceData, OriginalEntityData, image, IncludeGST, ConsolidateGST, TaxCodes, IsProforma, OBN) {
|
|
13
13
|
var _a, _b, _c, _d;
|
|
14
|
-
let ForInsurance = !
|
|
14
|
+
let ForInsurance = !tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.BillTo) && !tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.BillTo.InsId);
|
|
15
15
|
let InvoicePrintData = {};
|
|
16
|
-
let argInvoiceData =
|
|
16
|
+
let argInvoiceData = tr_utils_1.TrUtils.Stringify(OriginalInvoiceData);
|
|
17
17
|
if (!IncludeGST) {
|
|
18
18
|
if (argInvoiceData.Settings.Tax === 'TI') {
|
|
19
19
|
argInvoiceData.Settings.Tax = 'NO';
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
InvoicePrintData.IsProforma = IsProforma;
|
|
23
|
-
InvoicePrintData.Settings =
|
|
23
|
+
InvoicePrintData.Settings = tr_utils_1.TrUtils.Stringify(argInvoiceData.Settings);
|
|
24
24
|
let SType;
|
|
25
|
-
if (!
|
|
25
|
+
if (!tr_utils_1.TrUtils.IsNull(argInvoiceData.SType)) {
|
|
26
26
|
SType = argInvoiceData.SType;
|
|
27
27
|
}
|
|
28
28
|
InvoicePrintData = this.GetPrintConditionsBasedOnInput(InvoicePrintData, IncludeGST, ConsolidateGST, ForInsurance, SType, argInvoiceData, IsProforma);
|
|
29
29
|
InvoicePrintData.Entity = shared_print_service_1.PrintSharedService.GetFormattedEntityDataForPrint(OriginalEntityData, "Invoice", OriginalInvoiceData);
|
|
30
30
|
InvoicePrintData = shared_print_service_1.PrintSharedService.GetEntityHeaderStyles(InvoicePrintData, OriginalEntityData, image);
|
|
31
31
|
InvoicePrintData = this.GetInvoiceOtherDetailsForPrint(InvoicePrintData, argInvoiceData);
|
|
32
|
-
let IsTaxable = (IncludeGST &&
|
|
33
|
-
if (
|
|
32
|
+
let IsTaxable = (IncludeGST && tr_utils_1.TrUtils.isTaxable(argInvoiceData.Settings.Tax)) ? true : false;
|
|
33
|
+
if (tr_utils_1.TrUtils.IsNull(argInvoiceData.Ops)) {
|
|
34
34
|
argInvoiceData.Ops = [];
|
|
35
35
|
}
|
|
36
36
|
let finalTotalsData = invoice_total_service_1.InvoiceTotalsService.GetTotalsValue(argInvoiceData.Ops, argInvoiceData.Items, IsTaxable, true, argInvoiceData.LDisc, argInvoiceData.LPerc, argInvoiceData.PDisc, argInvoiceData.PPerc, argInvoiceData.Disc, argInvoiceData.Perc, TaxCodes, true, argInvoiceData.Settings, argInvoiceData.Adjust, InvoicePrintData.Entity.Round);
|
|
@@ -38,7 +38,7 @@ class SaleReceiptPrintService {
|
|
|
38
38
|
finalTotalsData.CustLaborTotalBeforeDisc = finalTotalsData.CustLaborAfterTax;
|
|
39
39
|
finalTotalsData.CustPartsTotalBeforeDisc = finalTotalsData.CustPartAfterTax;
|
|
40
40
|
}
|
|
41
|
-
InvoicePrintData =
|
|
41
|
+
InvoicePrintData = tr_utils_1.TrUtils.ConcatObjects(InvoicePrintData, finalTotalsData);
|
|
42
42
|
InvoicePrintData.Ops = this.GetLaborPrintInfo(InvoicePrintData.Ops, ConsolidateGST, TaxCodes, (_b = (_a = OriginalEntityData.Entity.Settings) === null || _a === void 0 ? void 0 : _a.Acc) === null || _b === void 0 ? void 0 : _b.LTot);
|
|
43
43
|
InvoicePrintData.Items = this.GetItemsPrintInfo(InvoicePrintData.Items, ConsolidateGST, TaxCodes, OBN, (_d = (_c = OriginalEntityData.Entity.Settings) === null || _c === void 0 ? void 0 : _c.Acc) === null || _d === void 0 ? void 0 : _d.LTot);
|
|
44
44
|
// InvoicePrintData.Items = InvoicePrintData.Items.filter((item: any) => {
|
|
@@ -52,9 +52,9 @@ class SaleReceiptPrintService {
|
|
|
52
52
|
// if (argInvoiceData.Settings.DiscLvl !== 'REC') {
|
|
53
53
|
// InvoicePrintData.FixedDisc = null;
|
|
54
54
|
// }
|
|
55
|
-
InvoicePrintData.Due =
|
|
55
|
+
InvoicePrintData.Due = tr_utils_1.TrUtils.FixPriceValue(argInvoiceData.Due);
|
|
56
56
|
InvoicePrintData.Paid = argInvoiceData.Receipt ? argInvoiceData.Total : PaymentData.Paid;
|
|
57
|
-
if (!
|
|
57
|
+
if (!tr_utils_1.TrUtils.IsNull(PaymentData.Sts)) {
|
|
58
58
|
InvoicePrintData.Sts = PaymentData.Sts;
|
|
59
59
|
}
|
|
60
60
|
InvoicePrintData.Consolidate = ConsolidateGST;
|
|
@@ -76,11 +76,11 @@ class SaleReceiptPrintService {
|
|
|
76
76
|
InvoicePrintData.IncludeGST = IncludeGST;
|
|
77
77
|
InvoicePrintData.ConsolidateGST = ConsolidateGST;
|
|
78
78
|
InvoicePrintData.ShowAccParts = false;
|
|
79
|
-
InvoicePrintData.ShowIGST = (
|
|
79
|
+
InvoicePrintData.ShowIGST = (tr_utils_1.TrUtils.IsNull(SType) || (SType === 'Intra')) ? false : true;
|
|
80
80
|
InvoicePrintData.ShowTaxColumn = (IncludeGST && !ConsolidateGST) ? true : false;
|
|
81
81
|
// InvoicePrintData.ShowDiscountColumn = (!ForInsurance && !ConsolidateGST) ? true : false;
|
|
82
82
|
InvoicePrintData = this.GetInvoiceTypeHeading(InvoicePrintData, OriginalInvoiceData, IncludeGST, ConsolidateGST, IsProforma);
|
|
83
|
-
InvoicePrintData.PrDate =
|
|
83
|
+
InvoicePrintData.PrDate = tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.PrDate) ? '' : my_date_1.MyDate.ConvertUTCDateToReadable(OriginalInvoiceData.PrDate);
|
|
84
84
|
return InvoicePrintData;
|
|
85
85
|
}
|
|
86
86
|
static GetInvoiceTypeHeading(InvoicePrintData, OriginalInvoiceData, IncludeGST, ConsolidateGST, IsProforma) {
|
|
@@ -150,22 +150,22 @@ class SaleReceiptPrintService {
|
|
|
150
150
|
LaborList.forEach((Labor) => {
|
|
151
151
|
Labor.HSN = Labor.SAC;
|
|
152
152
|
if (Consolidate) {
|
|
153
|
-
Labor.UnPr =
|
|
153
|
+
Labor.UnPr = tr_utils_1.TrUtils.FixedTo(Labor.AfterLaborTax);
|
|
154
154
|
}
|
|
155
155
|
else {
|
|
156
|
-
Labor.UnPr =
|
|
156
|
+
Labor.UnPr = tr_utils_1.TrUtils.FixPriceValue(Labor.Pr);
|
|
157
157
|
}
|
|
158
|
-
Labor.CGSTAmt =
|
|
159
|
-
Labor.SGSTAmt =
|
|
160
|
-
Labor.IGSTAmt =
|
|
158
|
+
Labor.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Labor.CGST);
|
|
159
|
+
Labor.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Labor.SGST);
|
|
160
|
+
Labor.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Labor.IGST);
|
|
161
161
|
Labor.CGSTPerc = shared_print_service_1.PrintSharedService.GetCGSTValueBasedOnTaxCode(Labor.TCode, TaxCodes);
|
|
162
162
|
Labor.SGSTPerc = shared_print_service_1.PrintSharedService.GetSGSTValueBasedOnTaxCode(Labor.TCode, TaxCodes);
|
|
163
163
|
Labor.IGSTPerc = shared_print_service_1.PrintSharedService.GetIGSTValueBasedOnTaxCode(Labor.TCode, TaxCodes);
|
|
164
164
|
if (LineTotal === 'AT') {
|
|
165
|
-
Labor.LineTotal =
|
|
165
|
+
Labor.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Labor.AfterLaborTax);
|
|
166
166
|
}
|
|
167
167
|
else {
|
|
168
|
-
Labor.LineTotal =
|
|
168
|
+
Labor.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Labor.Amt, Labor.Disc));
|
|
169
169
|
}
|
|
170
170
|
});
|
|
171
171
|
return LaborList;
|
|
@@ -178,34 +178,34 @@ class SaleReceiptPrintService {
|
|
|
178
178
|
let CTaxAmtPerItem = Item.CGST / Item.Qty;
|
|
179
179
|
let STaxAmtPerItem = Item.SGST / Item.Qty;
|
|
180
180
|
let ITaxAmtPerItem = Item.IGST / Item.Qty;
|
|
181
|
-
Item.UnPr =
|
|
181
|
+
Item.UnPr = tr_utils_1.TrUtils.FixedTo(AfterDiscForEach + CTaxAmtPerItem + STaxAmtPerItem + ITaxAmtPerItem);
|
|
182
182
|
}
|
|
183
183
|
else {
|
|
184
|
-
Item.UnPr =
|
|
184
|
+
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr);
|
|
185
185
|
}
|
|
186
186
|
Item.ExDt = this.GetExpiryDate(Item);
|
|
187
187
|
Item.Batch = this.GetBatchesData(Item, OBN);
|
|
188
|
-
Item.CGSTAmt =
|
|
189
|
-
if (
|
|
188
|
+
Item.CGSTAmt = tr_utils_1.TrUtils.FixedTo(Item.CGST);
|
|
189
|
+
if (tr_utils_1.TrUtils.IsNull(Item.ConUt)) {
|
|
190
190
|
Item.ConUt = 1;
|
|
191
191
|
}
|
|
192
|
-
if (!
|
|
192
|
+
if (!tr_utils_1.TrUtils.IsNull(Item.Make)) {
|
|
193
193
|
Item.Make = (_a = Item.Make) === null || _a === void 0 ? void 0 : _a.slice(0, 4).toUpperCase();
|
|
194
194
|
}
|
|
195
|
-
Item.Qty =
|
|
196
|
-
Item.SGSTAmt =
|
|
197
|
-
Item.IGSTAmt =
|
|
195
|
+
Item.Qty = tr_utils_1.TrUtils.FixedTo(Item.Qty * Item.ConUt);
|
|
196
|
+
Item.SGSTAmt = tr_utils_1.TrUtils.FixedTo(Item.SGST);
|
|
197
|
+
Item.IGSTAmt = tr_utils_1.TrUtils.FixedTo(Item.IGST);
|
|
198
198
|
Item.CGSTPerc = shared_print_service_1.PrintSharedService.GetCGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
199
199
|
Item.SGSTPerc = shared_print_service_1.PrintSharedService.GetSGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
200
200
|
Item.TaxName = this.getTaxName(Item.TCode, TaxCodes);
|
|
201
201
|
Item.IGSTPerc = shared_print_service_1.PrintSharedService.GetIGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
202
202
|
if (LineTotal === 'AT') {
|
|
203
|
-
Item.LineTotal =
|
|
203
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax);
|
|
204
204
|
}
|
|
205
205
|
else {
|
|
206
|
-
Item.LineTotal =
|
|
206
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc));
|
|
207
207
|
}
|
|
208
|
-
if (!
|
|
208
|
+
if (!tr_utils_1.TrUtils.IsZero(Item.Qty) && !tr_utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
|
|
209
209
|
Item.QtyAndUoM = Item.Qty + ' ' + Item.UoM;
|
|
210
210
|
}
|
|
211
211
|
});
|
|
@@ -218,12 +218,12 @@ class SaleReceiptPrintService {
|
|
|
218
218
|
return (Index !== -1) ? TaxCodes[Index].Name : '';
|
|
219
219
|
}
|
|
220
220
|
static GetBatchesData(Item, OBN) {
|
|
221
|
-
if (!
|
|
221
|
+
if (!tr_utils_1.TrUtils.IsNull(Item.Batches)) {
|
|
222
222
|
let batchdata;
|
|
223
223
|
Item.Batches.forEach((batch) => {
|
|
224
224
|
if (OBN) {
|
|
225
|
-
let BN =
|
|
226
|
-
if (!
|
|
225
|
+
let BN = tr_utils_1.TrUtils.IsNull(batch.MBN) ? batch.BN : batch.MBN;
|
|
226
|
+
if (!tr_utils_1.TrUtils.IsNull(batchdata)) {
|
|
227
227
|
batchdata = batchdata + ',' + BN;
|
|
228
228
|
}
|
|
229
229
|
else {
|
|
@@ -231,7 +231,7 @@ class SaleReceiptPrintService {
|
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
else {
|
|
234
|
-
if (!
|
|
234
|
+
if (!tr_utils_1.TrUtils.IsNull(batchdata)) {
|
|
235
235
|
batchdata = batchdata + ',' + batch.BN;
|
|
236
236
|
}
|
|
237
237
|
else {
|
|
@@ -241,9 +241,9 @@ class SaleReceiptPrintService {
|
|
|
241
241
|
});
|
|
242
242
|
return batchdata;
|
|
243
243
|
}
|
|
244
|
-
else if (!
|
|
244
|
+
else if (!tr_utils_1.TrUtils.IsNull(Item.Batch)) {
|
|
245
245
|
if (OBN) {
|
|
246
|
-
let BN =
|
|
246
|
+
let BN = tr_utils_1.TrUtils.IsNull(Item.Batch.MBN) ? Item.Batch.BN : Item.Batch.MBN;
|
|
247
247
|
return BN;
|
|
248
248
|
}
|
|
249
249
|
else {
|
|
@@ -255,10 +255,10 @@ class SaleReceiptPrintService {
|
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
257
|
static GetExpiryDate(Item) {
|
|
258
|
-
if (!
|
|
258
|
+
if (!tr_utils_1.TrUtils.IsNull(Item.Batches)) {
|
|
259
259
|
let batchdata;
|
|
260
260
|
Item.Batches.forEach((batch) => {
|
|
261
|
-
if (!
|
|
261
|
+
if (!tr_utils_1.TrUtils.IsNull(batchdata)) {
|
|
262
262
|
batchdata = batchdata + ',' + my_date_1.MyDate.ConvertUTCDateToReadableExDate(batch.ExDt);
|
|
263
263
|
}
|
|
264
264
|
else {
|
|
@@ -267,7 +267,7 @@ class SaleReceiptPrintService {
|
|
|
267
267
|
});
|
|
268
268
|
return batchdata;
|
|
269
269
|
}
|
|
270
|
-
else if (!
|
|
270
|
+
else if (!tr_utils_1.TrUtils.IsNull(Item.Batch)) {
|
|
271
271
|
return my_date_1.MyDate.ConvertUTCDateToReadableExDate(Item.Batch.ExDt);
|
|
272
272
|
}
|
|
273
273
|
else {
|
|
@@ -290,15 +290,15 @@ class SaleReceiptPrintService {
|
|
|
290
290
|
return PrintInfo;
|
|
291
291
|
}
|
|
292
292
|
static GetFormattedProductDataForPrint(OriginalInvoiceData, InvoicePrintData) {
|
|
293
|
-
if (!
|
|
293
|
+
if (!tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.Prod)) {
|
|
294
294
|
InvoicePrintData.Product = OriginalInvoiceData.Prod;
|
|
295
|
-
if (
|
|
295
|
+
if (tr_utils_1.TrUtils.IsNull(InvoicePrintData.Product.VIN)) {
|
|
296
296
|
InvoicePrintData.Product.VIN = '';
|
|
297
297
|
}
|
|
298
|
-
if (
|
|
298
|
+
if (tr_utils_1.TrUtils.IsNull(InvoicePrintData.Product.RegNo)) {
|
|
299
299
|
InvoicePrintData.Product.RegNo = '';
|
|
300
300
|
}
|
|
301
|
-
if (
|
|
301
|
+
if (tr_utils_1.TrUtils.IsNull(InvoicePrintData.Product.EngNo)) {
|
|
302
302
|
InvoicePrintData.Product.EngNo = '';
|
|
303
303
|
}
|
|
304
304
|
InvoicePrintData.MIn = OriginalInvoiceData.Prod.MIn;
|
|
@@ -308,22 +308,22 @@ class SaleReceiptPrintService {
|
|
|
308
308
|
}
|
|
309
309
|
static GetBillNameForInvoicePrint(OriginalInvoiceData, InvoicePrintData) {
|
|
310
310
|
let Customer = {};
|
|
311
|
-
if (!
|
|
311
|
+
if (!tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.BillTo)) {
|
|
312
312
|
Customer.Name = OriginalInvoiceData.BillTo.Name;
|
|
313
|
-
Customer.Doctor =
|
|
313
|
+
Customer.Doctor = tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.Name) ? '' : OriginalInvoiceData.Name;
|
|
314
314
|
Customer.Adrs = [];
|
|
315
315
|
Customer.Cons = [];
|
|
316
|
-
if (!
|
|
316
|
+
if (!tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.BillTo.Adrs)) {
|
|
317
317
|
Customer.Adrs.push(OriginalInvoiceData.BillTo.Adrs.A1);
|
|
318
|
-
if (!
|
|
318
|
+
if (!tr_utils_1.TrUtils.IsEmpty(OriginalInvoiceData.BillTo.Adrs.A2)) {
|
|
319
319
|
Customer.Adrs.push(OriginalInvoiceData.BillTo.Adrs.A2);
|
|
320
320
|
}
|
|
321
|
-
if (!
|
|
321
|
+
if (!tr_utils_1.TrUtils.IsEmpty(OriginalInvoiceData.BillTo.Adrs.Ct)) {
|
|
322
322
|
Customer.Adrs.push(OriginalInvoiceData.BillTo.Adrs.Ct);
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
Customer.GSTIN = OriginalInvoiceData.BillTo.GSTIN;
|
|
326
|
-
if (!
|
|
326
|
+
if (!tr_utils_1.TrUtils.IsEmpty(OriginalInvoiceData.BillTo.Ph)) {
|
|
327
327
|
Customer.Cons = [
|
|
328
328
|
{
|
|
329
329
|
Type: 'M',
|
|
@@ -333,7 +333,7 @@ class SaleReceiptPrintService {
|
|
|
333
333
|
}
|
|
334
334
|
InvoicePrintData.Customer = Customer;
|
|
335
335
|
}
|
|
336
|
-
else if (!
|
|
336
|
+
else if (!tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.BillTo)) {
|
|
337
337
|
Customer.Name = OriginalInvoiceData.BillTo.Name;
|
|
338
338
|
Customer.Adrs = [];
|
|
339
339
|
Customer.Cons = [];
|
|
@@ -342,21 +342,21 @@ class SaleReceiptPrintService {
|
|
|
342
342
|
else {
|
|
343
343
|
InvoicePrintData.Customer = {};
|
|
344
344
|
}
|
|
345
|
-
if (!
|
|
345
|
+
if (!tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.ShipTo)) {
|
|
346
346
|
let location = {};
|
|
347
347
|
location.Adrs = shared_print_service_1.PrintSharedService.GetAddress(OriginalInvoiceData.ShipTo.Adrs);
|
|
348
348
|
let Name;
|
|
349
|
-
if (
|
|
349
|
+
if (tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.ShipTo.Name)) {
|
|
350
350
|
Name = OriginalInvoiceData.ShipTo.ConName;
|
|
351
351
|
}
|
|
352
352
|
else {
|
|
353
353
|
Name = OriginalInvoiceData.ShipTo.Name;
|
|
354
354
|
}
|
|
355
|
-
if (
|
|
355
|
+
if (tr_utils_1.TrUtils.IsNull(Name)) {
|
|
356
356
|
Name = '';
|
|
357
357
|
}
|
|
358
358
|
location.Name = Name;
|
|
359
|
-
if (!
|
|
359
|
+
if (!tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.ShipTo.ConPh)) {
|
|
360
360
|
location.Cons = [
|
|
361
361
|
{
|
|
362
362
|
Type: 'M',
|
|
@@ -372,7 +372,7 @@ class SaleReceiptPrintService {
|
|
|
372
372
|
let Customer = {};
|
|
373
373
|
Customer.Name = this.GetBillToName(OriginalInvoiceData.BillTo.Title, OriginalInvoiceData.BillTo.Name);
|
|
374
374
|
Customer.Cons = [];
|
|
375
|
-
if (!
|
|
375
|
+
if (!tr_utils_1.TrUtils.IsEmpty(OriginalInvoiceData.BillTo.Ph)) {
|
|
376
376
|
Customer.Cons = [
|
|
377
377
|
{
|
|
378
378
|
Type: 'M',
|
|
@@ -382,9 +382,9 @@ class SaleReceiptPrintService {
|
|
|
382
382
|
}
|
|
383
383
|
Customer.GSTIN = OriginalInvoiceData.BillTo.GSTIN;
|
|
384
384
|
Customer.Adrs = [];
|
|
385
|
-
if (!
|
|
385
|
+
if (!tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.BillTo.Adrs)) {
|
|
386
386
|
Customer.Adrs.push(OriginalInvoiceData.BillTo.Adrs.A1);
|
|
387
|
-
if (!
|
|
387
|
+
if (!tr_utils_1.TrUtils.IsEmpty(OriginalInvoiceData.BillTo.Adrs.A2)) {
|
|
388
388
|
Customer.Adrs.push(OriginalInvoiceData.BillTo.Adrs.A2);
|
|
389
389
|
}
|
|
390
390
|
Customer.Adrs.push(OriginalInvoiceData.BillTo.Adrs.Ct);
|
|
@@ -394,10 +394,10 @@ class SaleReceiptPrintService {
|
|
|
394
394
|
return Customer;
|
|
395
395
|
}
|
|
396
396
|
static GetBillToName(Title, Name) {
|
|
397
|
-
return
|
|
397
|
+
return tr_utils_1.TrUtils.IsEmpty(Title) ? Name : Title + ' ' + Name;
|
|
398
398
|
}
|
|
399
399
|
static GetPaymentsTotal(InvoicePayments, Total, InvoiceStatus) {
|
|
400
|
-
if (
|
|
400
|
+
if (tr_utils_1.TrUtils.IsNull(InvoicePayments)) {
|
|
401
401
|
InvoicePayments = [];
|
|
402
402
|
}
|
|
403
403
|
var i = 0;
|
|
@@ -410,7 +410,7 @@ class SaleReceiptPrintService {
|
|
|
410
410
|
Data.Due = 0;
|
|
411
411
|
}
|
|
412
412
|
else {
|
|
413
|
-
Data.Due =
|
|
413
|
+
Data.Due = tr_utils_1.TrUtils.FixedTo(Total - PaidTotal);
|
|
414
414
|
}
|
|
415
415
|
if (Data.Due < 0) {
|
|
416
416
|
Data.Due = 0;
|
|
@@ -418,7 +418,7 @@ class SaleReceiptPrintService {
|
|
|
418
418
|
if (Data.Due === 0) {
|
|
419
419
|
Data.Sts = enums_1.InvoiceStatusEnum.Closed;
|
|
420
420
|
}
|
|
421
|
-
Data.Paid =
|
|
421
|
+
Data.Paid = tr_utils_1.TrUtils.FixedTo(PaidTotal);
|
|
422
422
|
return Data;
|
|
423
423
|
}
|
|
424
424
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare class CNPrintService {
|
|
2
|
+
static GetCreditNotePrintInfo(OriginalInvoiceData: any, OriginalEntityData: any, image: any, IncludeGST: boolean, ConsolidateGST: boolean, TaxCodes: any, IsProforma: boolean): any;
|
|
3
|
+
static GetPrintConditionsBasedOnInput(InvoicePrintData: any, IncludeGST: boolean, ConsolidateGST: boolean, ForInsurance: boolean, SType: any, OriginalInvoiceData: any, IsProforma: boolean): any;
|
|
4
|
+
static GetInvoiceTypeHeading(InvoicePrintData: any, OriginalInvoiceData: any, IncludeGST: boolean, ConsolidateGST: boolean, IsProforma: boolean): any;
|
|
5
|
+
static GetInvoiceOtherDetailsForPrint(InvoicePrintData: any, OriginalInvoiceData: any): any;
|
|
6
|
+
static GetItemsPrintInfo(Items: any, Consolidate: boolean, TaxCodes: any, LineTotal: string): any;
|
|
7
|
+
static ReverseItemsForInvoicePrint(argInvoiceData: any): any;
|
|
8
|
+
static PrepareFormatForInvoicePrint(InvoicePrintData: any, ROType: any, InvoiceStatus: any): any[];
|
|
9
|
+
static GetFormattedProductDataForPrint(OriginalInvoiceData: any, InvoicePrintData: any): any;
|
|
10
|
+
static GetBillNameForInvoicePrint(OriginalInvoiceData: any, InvoicePrintData: any): any;
|
|
11
|
+
static GetCustomerDetails(OriginalInvoiceData: any): any;
|
|
12
|
+
static GetBillToName(Title: any, Name: string): string;
|
|
13
|
+
static GetPaymentsTotal(InvoicePayments: any, Total: number, InvoiceStatus: string): any;
|
|
14
|
+
}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CNPrintService = void 0;
|
|
4
|
-
const
|
|
4
|
+
const aggregation_1 = require("../../aggregation/aggregation");
|
|
5
|
+
const code_enums_1 = require("../../enums/code-enums");
|
|
6
|
+
const enums_1 = require("../../enums/enums");
|
|
7
|
+
const shared_print_service_1 = require("../../shared/shared-services/shared-print.service");
|
|
8
|
+
const my_date_1 = require("../../utils/my-date");
|
|
9
|
+
const tr_utils_1 = require("../../utils/tr-utils");
|
|
5
10
|
const credit_note_totals_service_1 = require("./credit-note-totals.service");
|
|
6
|
-
const utils_1 = require("../shared/utils");
|
|
7
|
-
const code_enums_1 = require("../enums/code-enums");
|
|
8
|
-
const enums_1 = require("../enums/enums");
|
|
9
|
-
const my_date_1 = require("../shared/my-date");
|
|
10
|
-
const aggregation_1 = require("../aggregation/aggregation");
|
|
11
11
|
class CNPrintService {
|
|
12
12
|
static GetCreditNotePrintInfo(OriginalInvoiceData, OriginalEntityData, image, IncludeGST, ConsolidateGST, TaxCodes, IsProforma) {
|
|
13
13
|
var _a, _b;
|
|
14
|
-
let ForInsurance = !
|
|
14
|
+
let ForInsurance = !tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.BillTo.InsId);
|
|
15
15
|
let InvoicePrintData = {};
|
|
16
|
-
let argInvoiceData =
|
|
16
|
+
let argInvoiceData = tr_utils_1.TrUtils.Stringify(OriginalInvoiceData);
|
|
17
17
|
if (!IncludeGST) {
|
|
18
18
|
argInvoiceData.Settings.Tax = 'NO';
|
|
19
19
|
}
|
|
20
20
|
InvoicePrintData.IsProforma = IsProforma;
|
|
21
|
-
InvoicePrintData.Settings =
|
|
21
|
+
InvoicePrintData.Settings = tr_utils_1.TrUtils.Stringify(argInvoiceData.Settings);
|
|
22
22
|
let SType;
|
|
23
|
-
if (!
|
|
23
|
+
if (!tr_utils_1.TrUtils.IsNull(argInvoiceData.SType)) {
|
|
24
24
|
SType = argInvoiceData.SType;
|
|
25
25
|
}
|
|
26
26
|
InvoicePrintData = this.GetPrintConditionsBasedOnInput(InvoicePrintData, IncludeGST, ConsolidateGST, ForInsurance, SType, argInvoiceData, IsProforma);
|
|
27
27
|
InvoicePrintData.Entity = shared_print_service_1.PrintSharedService.GetFormattedEntityDataForPrint(OriginalEntityData, "Invoice", OriginalInvoiceData);
|
|
28
28
|
InvoicePrintData = shared_print_service_1.PrintSharedService.GetEntityHeaderStyles(InvoicePrintData, OriginalEntityData, image);
|
|
29
29
|
InvoicePrintData = this.GetInvoiceOtherDetailsForPrint(InvoicePrintData, argInvoiceData);
|
|
30
|
-
let IsTaxable = (IncludeGST &&
|
|
30
|
+
let IsTaxable = (IncludeGST && tr_utils_1.TrUtils.isTaxable(argInvoiceData.Settings.Tax)) ? true : false;
|
|
31
31
|
let finalTotalsData = credit_note_totals_service_1.CreditNoteTotalsService.GetTotalsValue([], argInvoiceData.Items, IsTaxable, true, argInvoiceData.Disc, argInvoiceData.Perc, TaxCodes, true, argInvoiceData.Settings);
|
|
32
32
|
if (ConsolidateGST) {
|
|
33
33
|
finalTotalsData.CustLaborTotalBeforeDisc = finalTotalsData.CustLaborAfterTax;
|
|
34
34
|
finalTotalsData.CustPartsTotalBeforeDisc = finalTotalsData.CustPartAfterTax;
|
|
35
35
|
}
|
|
36
|
-
InvoicePrintData =
|
|
36
|
+
InvoicePrintData = tr_utils_1.TrUtils.ConcatObjects(InvoicePrintData, finalTotalsData);
|
|
37
37
|
InvoicePrintData.Items = this.GetItemsPrintInfo(InvoicePrintData.Items, ConsolidateGST, TaxCodes, (_b = (_a = OriginalEntityData.Entity.Settings) === null || _a === void 0 ? void 0 : _a.Acc) === null || _b === void 0 ? void 0 : _b.LTot);
|
|
38
38
|
argInvoiceData = this.ReverseItemsForInvoicePrint(argInvoiceData);
|
|
39
39
|
InvoicePrintData.PrintInfo = this.PrepareFormatForInvoicePrint(InvoicePrintData, code_enums_1.ROTypeEnum.Invoice, argInvoiceData.Sts);
|
|
@@ -48,11 +48,11 @@ class CNPrintService {
|
|
|
48
48
|
InvoicePrintData.IncludeGST = IncludeGST;
|
|
49
49
|
InvoicePrintData.ConsolidateGST = ConsolidateGST;
|
|
50
50
|
InvoicePrintData.ShowAccParts = false;
|
|
51
|
-
InvoicePrintData.ShowIGST = (
|
|
51
|
+
InvoicePrintData.ShowIGST = (tr_utils_1.TrUtils.IsNull(SType) || (SType === 'Intra')) ? false : true;
|
|
52
52
|
InvoicePrintData.ShowTaxColumn = (IncludeGST && !ConsolidateGST) ? true : false;
|
|
53
53
|
// InvoicePrintData.ShowDiscountColumn = (!ForInsurance && !ConsolidateGST) ? true : false;
|
|
54
54
|
InvoicePrintData = this.GetInvoiceTypeHeading(InvoicePrintData, OriginalInvoiceData, IncludeGST, ConsolidateGST, IsProforma);
|
|
55
|
-
InvoicePrintData.PrDate =
|
|
55
|
+
InvoicePrintData.PrDate = tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.PrDate) ? '' : my_date_1.MyDate.ConvertUTCDateToReadable(OriginalInvoiceData.PrDate);
|
|
56
56
|
return InvoicePrintData;
|
|
57
57
|
}
|
|
58
58
|
static GetInvoiceTypeHeading(InvoicePrintData, OriginalInvoiceData, IncludeGST, ConsolidateGST, IsProforma) {
|
|
@@ -73,24 +73,24 @@ class CNPrintService {
|
|
|
73
73
|
let CTaxAmtPerItem = (0, aggregation_1.division)(Item.CGST, Item.Qty);
|
|
74
74
|
let STaxAmtPerItem = (0, aggregation_1.division)(Item.SGST, Item.Qty);
|
|
75
75
|
let ITaxAmtPerItem = (0, aggregation_1.division)(Item.IGST, Item.Qty);
|
|
76
|
-
Item.UnPr =
|
|
76
|
+
Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem));
|
|
77
77
|
}
|
|
78
78
|
else {
|
|
79
|
-
Item.UnPr =
|
|
79
|
+
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr);
|
|
80
80
|
}
|
|
81
|
-
Item.CGSTAmt =
|
|
82
|
-
Item.SGSTAmt =
|
|
83
|
-
Item.IGSTAmt =
|
|
81
|
+
Item.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.CGST);
|
|
82
|
+
Item.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.SGST);
|
|
83
|
+
Item.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.IGST);
|
|
84
84
|
Item.CGSTPerc = shared_print_service_1.PrintSharedService.GetCGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
85
85
|
Item.SGSTPerc = shared_print_service_1.PrintSharedService.GetSGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
86
86
|
Item.IGSTPerc = shared_print_service_1.PrintSharedService.GetIGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
87
87
|
if (LineTotal === 'AT') {
|
|
88
|
-
Item.LineTotal =
|
|
88
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax);
|
|
89
89
|
}
|
|
90
90
|
else {
|
|
91
|
-
Item.LineTotal =
|
|
91
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc));
|
|
92
92
|
}
|
|
93
|
-
if (!
|
|
93
|
+
if (!tr_utils_1.TrUtils.IsZero(Item.Qty) && !tr_utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
|
|
94
94
|
Item.QtyAndUoM = Item.Qty + ' ' + Item.UoM;
|
|
95
95
|
}
|
|
96
96
|
});
|
|
@@ -112,15 +112,15 @@ class CNPrintService {
|
|
|
112
112
|
return PrintInfo;
|
|
113
113
|
}
|
|
114
114
|
static GetFormattedProductDataForPrint(OriginalInvoiceData, InvoicePrintData) {
|
|
115
|
-
if (!
|
|
115
|
+
if (!tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.Prod)) {
|
|
116
116
|
InvoicePrintData.Product = OriginalInvoiceData.Prod;
|
|
117
|
-
if (
|
|
117
|
+
if (tr_utils_1.TrUtils.IsNull(InvoicePrintData.Product.VIN)) {
|
|
118
118
|
InvoicePrintData.Product.VIN = '';
|
|
119
119
|
}
|
|
120
|
-
if (
|
|
120
|
+
if (tr_utils_1.TrUtils.IsNull(InvoicePrintData.Product.RegNo)) {
|
|
121
121
|
InvoicePrintData.Product.RegNo = '';
|
|
122
122
|
}
|
|
123
|
-
if (
|
|
123
|
+
if (tr_utils_1.TrUtils.IsNull(InvoicePrintData.Product.EngNo)) {
|
|
124
124
|
InvoicePrintData.Product.EngNo = '';
|
|
125
125
|
}
|
|
126
126
|
InvoicePrintData.MIn = OriginalInvoiceData.Prod.MIn;
|
|
@@ -133,17 +133,17 @@ class CNPrintService {
|
|
|
133
133
|
Customer.Name = OriginalInvoiceData.BillTo.Name;
|
|
134
134
|
Customer.Adrs = [];
|
|
135
135
|
Customer.Cons = [];
|
|
136
|
-
if (!
|
|
136
|
+
if (!tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.BillTo.Adrs)) {
|
|
137
137
|
Customer.Adrs.push(OriginalInvoiceData.BillTo.Adrs.A1);
|
|
138
|
-
if (!
|
|
138
|
+
if (!tr_utils_1.TrUtils.IsEmpty(OriginalInvoiceData.BillTo.Adrs.A2)) {
|
|
139
139
|
Customer.Adrs.push(OriginalInvoiceData.BillTo.Adrs.A2);
|
|
140
140
|
}
|
|
141
|
-
if (!
|
|
141
|
+
if (!tr_utils_1.TrUtils.IsEmpty(OriginalInvoiceData.BillTo.Adrs.Ct)) {
|
|
142
142
|
Customer.Adrs.push(OriginalInvoiceData.BillTo.Adrs.Ct);
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
Customer.GSTIN = OriginalInvoiceData.BillTo.GSTIN;
|
|
146
|
-
if (!
|
|
146
|
+
if (!tr_utils_1.TrUtils.IsEmpty(OriginalInvoiceData.BillTo.Ph)) {
|
|
147
147
|
Customer.Cons = [
|
|
148
148
|
{
|
|
149
149
|
Type: 'M',
|
|
@@ -152,7 +152,7 @@ class CNPrintService {
|
|
|
152
152
|
];
|
|
153
153
|
}
|
|
154
154
|
InvoicePrintData.Customer = Customer;
|
|
155
|
-
if (!
|
|
155
|
+
if (!tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.BillTo.InsId)) {
|
|
156
156
|
InvoicePrintData.Cust = this.GetCustomerDetails(OriginalInvoiceData);
|
|
157
157
|
}
|
|
158
158
|
return InvoicePrintData;
|
|
@@ -161,7 +161,7 @@ class CNPrintService {
|
|
|
161
161
|
let Customer = {};
|
|
162
162
|
Customer.Name = this.GetBillToName(OriginalInvoiceData.Cust.Title, OriginalInvoiceData.Cust.Name);
|
|
163
163
|
Customer.Cons = [];
|
|
164
|
-
if (!
|
|
164
|
+
if (!tr_utils_1.TrUtils.IsEmpty(OriginalInvoiceData.Cust.Ph)) {
|
|
165
165
|
Customer.Cons = [
|
|
166
166
|
{
|
|
167
167
|
Type: 'M',
|
|
@@ -171,9 +171,9 @@ class CNPrintService {
|
|
|
171
171
|
}
|
|
172
172
|
Customer.GSTIN = OriginalInvoiceData.Cust.GSTIN;
|
|
173
173
|
Customer.Adrs = [];
|
|
174
|
-
if (!
|
|
174
|
+
if (!tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.Cust.Adrs)) {
|
|
175
175
|
Customer.Adrs.push(OriginalInvoiceData.Cust.Adrs.A1);
|
|
176
|
-
if (!
|
|
176
|
+
if (!tr_utils_1.TrUtils.IsEmpty(OriginalInvoiceData.Cust.Adrs.A2)) {
|
|
177
177
|
Customer.Adrs.push(OriginalInvoiceData.Cust.Adrs.A2);
|
|
178
178
|
}
|
|
179
179
|
Customer.Adrs.push(OriginalInvoiceData.Cust.Adrs.Ct);
|
|
@@ -183,7 +183,7 @@ class CNPrintService {
|
|
|
183
183
|
return Customer;
|
|
184
184
|
}
|
|
185
185
|
static GetBillToName(Title, Name) {
|
|
186
|
-
return
|
|
186
|
+
return tr_utils_1.TrUtils.IsEmpty(Title) ? Name : Title + ' ' + Name;
|
|
187
187
|
}
|
|
188
188
|
static GetPaymentsTotal(InvoicePayments, Total, InvoiceStatus) {
|
|
189
189
|
var i = 0;
|
|
@@ -196,7 +196,7 @@ class CNPrintService {
|
|
|
196
196
|
Data.Due = 0;
|
|
197
197
|
}
|
|
198
198
|
else {
|
|
199
|
-
Data.Due =
|
|
199
|
+
Data.Due = tr_utils_1.TrUtils.FixedTo(Total - PaidTotal);
|
|
200
200
|
}
|
|
201
201
|
if (Data.Due < 0) {
|
|
202
202
|
Data.Due = 0;
|
|
@@ -204,7 +204,7 @@ class CNPrintService {
|
|
|
204
204
|
if (Data.Due === 0) {
|
|
205
205
|
Data.Sts = enums_1.InvoiceStatusEnum.Closed;
|
|
206
206
|
}
|
|
207
|
-
Data.Paid =
|
|
207
|
+
Data.Paid = tr_utils_1.TrUtils.FixedTo(PaidTotal);
|
|
208
208
|
return Data;
|
|
209
209
|
}
|
|
210
210
|
}
|