shareneus 1.7.4 → 1.7.6
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/README.md +1 -0
- package/dist/accounting/invoice/invoice-pdf/invoice-pdf.service.js +18 -45
- package/dist/accounting/invoice/reports/excel/analysis-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/category-wise-item-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/cust-wise-sales-details.js +17 -7
- package/dist/accounting/invoice/reports/excel/cust-wise-sales-summary-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/invoice-wise-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/item-wise-doctor-sale-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/items-wise-sales-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/manf-wise-sales-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/operator-wise-details.js +17 -7
- package/dist/accounting/invoice/reports/excel/operator-wise-summary.js +17 -7
- package/dist/accounting/invoice/reports/excel/sa-wise-labor-sales-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/sa-wise-part-sales-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/sale-summary-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/sales-by-service-summary-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/scheduled-drug-summary-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/scheduled-drugs-excel.service.js +17 -7
- package/dist/accounting/invoice/unified-invoice-pdf.service.d.ts +1 -1
- package/dist/accounting/payment-receive/reports/excel/cust-balance-excel.service.js +17 -7
- package/dist/accounting/payment-receive/reports/excel/payment-receive-excel.service.js +17 -7
- package/dist/common/reports/excel/product-without-owner-excel.service.js +17 -7
- package/dist/gst/excel/GSTR-RO-excel.service.js +17 -7
- package/dist/gst/excel/GSTR1-excel.service.js +17 -7
- package/dist/gst/excel/GSTR2-excel.service.js +17 -7
- package/dist/gst/excel/hsn-summary.js +17 -7
- package/dist/gst/excel/tally-sales-import.service.js +17 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -6
- package/dist/inventory/items/reports/excel/expiring-drugs-excel.service.js +17 -7
- package/dist/inventory/items/reports/excel/item-wise-mout-details.js +17 -7
- package/dist/inventory/items/reports/excel/item-wise-mout-summary.js +17 -7
- package/dist/inventory/items/reports/excel/spares-issue-excel.service.js +17 -7
- package/dist/inventory/items/reports/excel/stock-excel.service.js +17 -7
- package/dist/purchases/payment-made/reports/excel/payments-made-excel.service.js +17 -7
- package/dist/purchases/payment-made/reports/excel/ven-balance-excel.service.js +17 -7
- package/dist/services/reports/excel/insurance-expire-excel.service.js +17 -7
- package/dist/services/reports/excel/next-service-date-excel.service.js +17 -7
- package/dist/services/reports/excel/repair-orders-excel.service.js +17 -7
- package/dist/shared/table-section/pdf-table.header.d.ts +1 -1
- package/dist/shared/table-section/pdf-table.header.js +14 -2
- package/dist/shared/table-section/pdf-table.section.js +6 -13
- package/dist/{accounting/invoice/invoice-pdf.service.js → shared/transactions-pdf.service.js} +15 -15
- package/package.json +1 -1
- package/src/accounting/counter-sales/auto-sales-receipt-pdf.service.ts +569 -0
- package/src/accounting/counter-sales/pos-receipt-pdf.ts +577 -0
- package/src/accounting/counter-sales/sales-receipt-pdf.service.ts +628 -0
- package/src/accounting/counter-sales/sales-receipt-print.service.ts +506 -0
- package/src/accounting/credit-note/cn-print.service.ts +264 -0
- package/src/accounting/credit-note/credit-note-pdf.service.ts +602 -0
- package/src/accounting/credit-note/credit-note-totals.service.ts +424 -0
- package/src/accounting/debit-note/debit-note-pdf.service.ts +681 -0
- package/src/accounting/debit-note/debit-note-print.service.ts +276 -0
- package/src/accounting/debit-note/debit-note-totals.service.ts +361 -0
- package/src/accounting/invoice/hc-inv-pdf.service.ts +880 -0
- package/src/accounting/invoice/inv-pdf.service.ts +812 -0
- package/src/accounting/invoice/inv-print.service.ts +532 -0
- package/src/accounting/invoice/invoice-landscape-pdf.service.ts +947 -0
- package/src/accounting/invoice/invoice-letterhead-pdf.service.ts +813 -0
- package/src/accounting/invoice/invoice-pdf/invoice-pdf.service.ts +359 -0
- package/src/accounting/invoice/invoice-portrait-pdf.ts +972 -0
- package/src/accounting/invoice/invoice-print.service.ts +2906 -0
- package/src/accounting/invoice/invoice-total.service.ts +834 -0
- package/src/accounting/invoice/reports/excel/analysis-excel.service.ts +291 -0
- package/src/accounting/invoice/reports/excel/category-wise-item-excel.service.ts +267 -0
- package/src/accounting/invoice/reports/excel/cust-wise-sales-details.ts +321 -0
- package/src/accounting/invoice/reports/excel/cust-wise-sales-summary-excel.service.ts +300 -0
- package/src/accounting/invoice/reports/excel/invoice-wise-excel.service.ts +859 -0
- package/src/accounting/invoice/reports/excel/item-wise-doctor-sale-excel.service.ts +255 -0
- package/src/accounting/invoice/reports/excel/items-wise-sales-excel.service.ts +312 -0
- package/src/accounting/invoice/reports/excel/manf-wise-sales-excel.service.ts +273 -0
- package/src/accounting/invoice/reports/excel/operator-wise-details.ts +258 -0
- package/src/accounting/invoice/reports/excel/operator-wise-summary.ts +259 -0
- package/src/accounting/invoice/reports/excel/sa-wise-labor-sales-excel.service.ts +230 -0
- package/src/accounting/invoice/reports/excel/sa-wise-part-sales-excel.service.ts +231 -0
- package/src/accounting/invoice/reports/excel/sale-summary-excel.service.ts +326 -0
- package/src/accounting/invoice/reports/excel/sales-by-service-details-excel.service.ts +0 -0
- package/src/accounting/invoice/reports/excel/sales-by-service-summary-excel.service.ts +432 -0
- package/src/accounting/invoice/reports/excel/scheduled-drug-summary-excel.service.ts +373 -0
- package/src/accounting/invoice/reports/excel/scheduled-drugs-excel.service.ts +372 -0
- package/src/accounting/invoice/reports/pdf/analysis-pdf.service.ts +113 -0
- package/src/accounting/invoice/reports/pdf/category-wise-item-pdf.service.ts +107 -0
- package/src/accounting/invoice/reports/pdf/cust-wise-sales-details-pdf.service.ts +125 -0
- package/src/accounting/invoice/reports/pdf/cust-wise-sales-summary-pdf.service.ts +119 -0
- package/src/accounting/invoice/reports/pdf/item-wise-doctor-sale-pdf.service.ts +180 -0
- package/src/accounting/invoice/reports/pdf/item-wise-sales-pdf.service.ts +193 -0
- package/src/accounting/invoice/reports/pdf/manf-wise-sales-pdf.service.ts +188 -0
- package/src/accounting/invoice/reports/pdf/operator-wise-details-pdf.service.ts +118 -0
- package/src/accounting/invoice/reports/pdf/operator-wise-summary-pdf.ts +116 -0
- package/src/accounting/invoice/reports/pdf/sales-by-service-pdf.service.ts +132 -0
- package/src/accounting/invoice/reports/pdf/scheduled-drug-pdf.service.ts +191 -0
- package/src/accounting/invoice/reports/pdf/scheduled-drug-summary-pdf.service.ts +202 -0
- package/src/accounting/invoice/shared-inv-pdf.service.ts +787 -0
- package/src/accounting/invoice/unified-invoice-pdf.service.ts +937 -0
- package/src/accounting/payment-receive/payment-pdf.service.ts +410 -0
- package/src/accounting/payment-receive/payment-receipt-pdf/receipt-pdf.service.ts +470 -0
- package/src/accounting/payment-receive/receipt-print.service.ts +71 -0
- package/src/accounting/payment-receive/reports/excel/cust-balance-excel.service.ts +298 -0
- package/src/accounting/payment-receive/reports/excel/payment-receive-excel.service.ts +221 -0
- package/src/accounting/payment-receive/reports/pdf/customer-balances-pdf.service.ts +182 -0
- package/src/accounting/payment-receive/reports/pdf/payment-report-pdf.service.ts +116 -0
- package/src/aggregation/aggregation.ts +58 -0
- package/src/appointments/appointments/appointment-total.service.ts +298 -0
- package/src/appointments/consultations/consultation-fee-receipt.service.ts +407 -0
- package/src/appointments/consultations/consultation-full-pdf.service.ts +238 -0
- package/src/appointments/consultations/consultation-letterhead-pdf.service.ts +430 -0
- package/src/appointments/consultations/consultation-pdf.service.ts +417 -0
- package/src/common/reports/excel/product-without-owner-excel.service.ts +308 -0
- package/src/common/reports/pdf/product-without-owner-pdf.service.ts +146 -0
- package/src/enums/cache-enums.ts +33 -0
- package/src/enums/code-enums.ts +291 -0
- package/src/enums/country-enums.ts +9 -0
- package/src/enums/enums.ts +364 -0
- package/src/enums/industry-enums.ts +26 -0
- package/src/enums/treatment-enums.ts +9 -0
- package/src/gst/excel/GSTR-RO-excel.service.ts +926 -0
- package/src/gst/excel/GSTR1-excel.service.ts +313 -0
- package/src/gst/excel/GSTR2-excel.service.ts +314 -0
- package/src/gst/excel/hsn-summary.ts +314 -0
- package/src/gst/excel/tally-sales-import.service.ts +767 -0
- package/src/gst/pdf/hsn-summary-pdf.ts +176 -0
- package/src/index.ts +194 -0
- package/src/inventory/items/adjustment-pdf.service.ts +177 -0
- package/src/inventory/items/issue-parts-pdf.service.ts +795 -0
- package/src/inventory/items/item-bar-code-label-pdf.ts +194 -0
- package/src/inventory/items/item-detais-pdf.ts +141 -0
- package/src/inventory/items/item-price-for-pricelist.ts +368 -0
- package/src/inventory/items/reports/excel/expiring-drugs-excel.service.ts +290 -0
- package/src/inventory/items/reports/excel/item-wise-mout-details.ts +284 -0
- package/src/inventory/items/reports/excel/item-wise-mout-summary.ts +279 -0
- package/src/inventory/items/reports/excel/spares-issue-excel.service.ts +494 -0
- package/src/inventory/items/reports/excel/stock-excel.service.ts +319 -0
- package/src/inventory/items/reports/pdf/expiring-drugs-pdf.service.ts +172 -0
- package/src/inventory/items/reports/pdf/item-wise-mout-details-pdf.ts +122 -0
- package/src/inventory/items/reports/pdf/item-wise-mout-summary-pdf.ts +115 -0
- package/src/inventory/items/reports/pdf/reorder-point-pdf.service.ts +163 -0
- package/src/inventory/material-out/mout-pdf.service.ts +545 -0
- package/src/inventory/transfer-order/transfer-order-pdf.service.ts +154 -0
- package/src/purchases/bills/bill-pdf/bill-pdf.service.ts +211 -0
- package/src/purchases/bills/bill-pdf.service.ts +21 -0
- package/src/purchases/payment-made/reports/excel/payments-made-excel.service.ts +313 -0
- package/src/purchases/payment-made/reports/excel/ven-balance-excel.service.ts +307 -0
- package/src/purchases/payment-made/reports/pdf/vendor-balances-pdf.service.ts +114 -0
- package/src/purchases/purchase-order/po-totals.service.ts +343 -0
- package/src/purchases/purchase-order/purchase-order-pdf.service.ts +1016 -0
- package/src/purchases/purchase-order/purchase-order-print.service.ts +279 -0
- package/src/purchases/purchase-order/purchase-order-totals.service.ts +637 -0
- package/src/purchases/vendor-credit-note/vendor-credit-note-pdf.service.ts +1055 -0
- package/src/purchases/vendor-credit-note/vendor-credit-note-print.service.ts +145 -0
- package/src/purchases/vendor-credit-note/vendor-credit-note-totals.service.ts +399 -0
- package/src/purchases/vendor-debit-note/vendor-debit-note-pdf.service.ts +582 -0
- package/src/purchases/vendor-debit-note/vendor-debit-note-print.service.ts +295 -0
- package/src/purchases/vendor-debit-note/vendor-debit-note-totals.service.ts +377 -0
- package/src/sales/delivery-challan/dc-landscape-pdf.service.ts +922 -0
- package/src/sales/delivery-challan/dc-landscape-without-price-pdf.service.ts +869 -0
- package/src/sales/delivery-challan/dc-without-price-pdf.service.ts +505 -0
- package/src/sales/delivery-challan/delivery-challan-pdf.service.ts +461 -0
- package/src/sales/delivery-challan/delivery-challan-print.service.ts +229 -0
- package/src/sales/delivery-challan/delivery-challan-totals.ts +466 -0
- package/src/sales/sales/equipment-design-pdf.service.ts +153 -0
- package/src/sales/sales/pack-ship-pdf.service.ts +128 -0
- package/src/sales/sales/pack-ship-print.service.ts +198 -0
- package/src/sales/sales/sales-pdf.service.ts +658 -0
- package/src/sales/sales/sales-print.service.ts +376 -0
- package/src/sales/sales/sales-totals.service.ts +500 -0
- package/src/sales-receive/sales-receive-pdf.service.ts +602 -0
- package/src/sales-receive/sales-receive-print.service.ts +242 -0
- package/src/sales-receive/sales-receive-totals.service.ts +651 -0
- package/src/services/checklist-pdf.ts +151 -0
- package/src/services/checklists-pdf.ts +133 -0
- package/src/services/est.print-service.ts +1155 -0
- package/src/services/reports/excel/insurance-expire-excel.service.ts +292 -0
- package/src/services/reports/excel/next-service-date-excel.service.ts +317 -0
- package/src/services/reports/excel/repair-orders-excel.service.ts +249 -0
- package/src/services/reports/pdf/insurance-expire-pdf.service.ts +115 -0
- package/src/services/reports/pdf/next-service-date-pdf.service.ts +198 -0
- package/src/services/reports/pdf/repair-orders-pdf.service.ts +184 -0
- package/src/services/ro-pdf.service.ts +1917 -0
- package/src/services/ro-print-service.ts +881 -0
- package/src/services/ro-totals.service.ts +1314 -0
- package/src/services/separate-wo-print.service.ts +396 -0
- package/src/services/service-history-pdf.service.ts +145 -0
- package/src/services/service-price-for-pricelist.ts +649 -0
- package/src/services/technician-pdf.service.ts +234 -0
- package/src/services/technician-print.service.ts +95 -0
- package/src/shared/header-footer-section/pdf-header-footer.section.ts +519 -0
- package/src/shared/header-footer-section/pdf-shared.utils.ts +46 -0
- package/src/shared/math-operations.ts +208 -0
- package/src/shared/party-details-section/pdf-party-details.section.ts +602 -0
- package/src/shared/shared-pdf.service.ts +3042 -0
- package/src/shared/shared-print.service.ts +879 -0
- package/src/shared/table-section/pdf-table.config.ts +8 -0
- package/src/shared/table-section/pdf-table.header.ts +396 -0
- package/src/shared/table-section/pdf-table.row.ts +248 -0
- package/src/shared/table-section/pdf-table.section.ts +447 -0
- package/src/shared/totals-section/pdf-totals.section.ts +921 -0
- package/src/shared/transactions-pdf.service.ts +191 -0
- package/src/shared/util.ts +101 -0
- package/src/tasks/meetings/meeting-pdf.ts +410 -0
- package/src/tasks/tasks/task-pdf.service.ts +238 -0
- package/src/tasks/tasks/task-reports-pdf.service.ts +313 -0
- package/src/tax/index.ts +86 -0
- package/src/tax/tax-calculator.ts +1025 -0
- package/src/tax/tax.types.ts +535 -0
- package/src/transaction-calculations/discounts-distribution.ts +343 -0
- package/src/transaction-calculations/index.ts +3 -0
- package/src/transaction-calculations/total-calculation.ts +443 -0
- package/src/transaction-calculations/transaction-calculation-engine.ts +903 -0
- package/src/utils/my-date.ts +111 -0
- package/src/utils/tr-utils.ts +104 -0
- package/tsconfig.json +2 -2
- /package/dist/{accounting/invoice/invoice-pdf.service.d.ts → shared/transactions-pdf.service.d.ts} +0 -0
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
|
|
2
|
+
import { PurchaseOrderPrintService } from "../purchases/purchase-order/purchase-order-print.service";
|
|
3
|
+
import { DCWithoutPricePdfService } from "../sales/delivery-challan/dc-without-price-pdf.service";
|
|
4
|
+
import { DeliveryChallanPdfService } from "../sales/delivery-challan/delivery-challan-pdf.service";
|
|
5
|
+
import { DeliveryChallanPrintService } from "../sales/delivery-challan/delivery-challan-print.service";
|
|
6
|
+
import { SalesPdfService } from "../sales/sales/sales-pdf.service";
|
|
7
|
+
import { SalesPrintService } from "../sales/sales/sales-print.service";
|
|
8
|
+
import { Add } from "./math-operations";
|
|
9
|
+
import { TrUtils } from "../utils/tr-utils";
|
|
10
|
+
import { PosReceiptPrintService } from "../accounting/counter-sales/pos-receipt-pdf";
|
|
11
|
+
import { SaleReceiptPrintService } from "../accounting/counter-sales/sales-receipt-print.service";
|
|
12
|
+
import { CNPrintService } from "../accounting/credit-note/cn-print.service";
|
|
13
|
+
import { CreditNotePdfService } from "../accounting/credit-note/credit-note-pdf.service";
|
|
14
|
+
import { GetInvoicePrintInfo } from "../accounting/invoice/inv-print.service";
|
|
15
|
+
import { CreateInvoicePDFService } from "../accounting/invoice/invoice-pdf/invoice-pdf.service";
|
|
16
|
+
import { GetInvoicePrint } from "../accounting/invoice/unified-invoice-pdf.service";
|
|
17
|
+
|
|
18
|
+
export function GetInvoicePDF(invoiceData: any, entityData: any, headerConfig: any, printConfig: any, taxCodes: any, image: any = null, numberofCopies: string[] = ['Original'], withPass: boolean = false, options: any = null) {
|
|
19
|
+
if (!options) {
|
|
20
|
+
options = {
|
|
21
|
+
ShowGST: (invoiceData?.Settings?.Tax === 'TI') ? true : false,
|
|
22
|
+
ConsolidateGST: false,
|
|
23
|
+
PartInvoice: true,
|
|
24
|
+
LaborInvoice: true,
|
|
25
|
+
Size: 'full',
|
|
26
|
+
MoreDiscDetails: false,
|
|
27
|
+
IsProforma: false,
|
|
28
|
+
Orientation: 'portrait'
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
const printConfigData: any = TrUtils.ConcatObjects(
|
|
32
|
+
TrUtils.Stringify(headerConfig),
|
|
33
|
+
TrUtils.Stringify(printConfig)
|
|
34
|
+
);
|
|
35
|
+
printConfigData.withPass = withPass;
|
|
36
|
+
const invoicePrintData: any = GetInvoicePrintInfo(invoiceData, entityData, image,
|
|
37
|
+
options.ShowGST, options.ConsolidateGST, taxCodes, options.IsProforma, options.PartInvoice, options.LaborInvoice);
|
|
38
|
+
let invPrint: any;
|
|
39
|
+
if (options.ConsolidateGST) {
|
|
40
|
+
invPrint = GetInvoicePrint(invoicePrintData, numberofCopies, withPass, options.Size, options.MoreDiscDetails, options.Orientation);
|
|
41
|
+
} else {
|
|
42
|
+
invoicePrintData.Round = TrUtils.FixedTo(invoiceData.Round);
|
|
43
|
+
invoicePrintData.Total = TrUtils.FixedTo(invoiceData.Total);
|
|
44
|
+
invoicePrintData.SubToal = TrUtils.FixedTo(invoiceData.SubToal);
|
|
45
|
+
invoicePrintData.TaxTotal = TrUtils.FixedTo(invoiceData.TaxTotal);
|
|
46
|
+
delete invoicePrintData.SIndTotal;
|
|
47
|
+
invPrint = CreateInvoicePDFService(invoicePrintData, printConfigData, numberofCopies);
|
|
48
|
+
}
|
|
49
|
+
return invPrint;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function GetSalesOrderPDF(salesOrderData: any, entityData: any, headerConfig: any, printConfig: any, taxCodes: any, image: any = null, numberofCopies: string[] = ['Original'], options: any = null) {
|
|
53
|
+
if (!options) {
|
|
54
|
+
options = {
|
|
55
|
+
ShowGST: (salesOrderData?.Settings?.Tax === 'TI') ? true : false,
|
|
56
|
+
ConsolidateGST: false,
|
|
57
|
+
Size: 'full',
|
|
58
|
+
isOtherIndustry: false,
|
|
59
|
+
Design: false,
|
|
60
|
+
MoreDiscDetails: false,
|
|
61
|
+
Orientation: 'portrait'
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
const printConfigData: any = TrUtils.ConcatObjects(
|
|
65
|
+
TrUtils.Stringify(headerConfig),
|
|
66
|
+
TrUtils.Stringify(printConfig)
|
|
67
|
+
);
|
|
68
|
+
const soPrintData: any = SalesPrintService.GetSalesPrintInfo(salesOrderData, entityData, image,
|
|
69
|
+
options.ShowGST, options.ConsolidateGST, taxCodes, false, options.isOtherIndustry);
|
|
70
|
+
let soPrint: any;
|
|
71
|
+
if (options.ConsolidateGST || !options.ShowGST) {
|
|
72
|
+
soPrint = SalesPdfService.GetSalesPrint(salesOrderData, numberofCopies, options.isOtherIndustry,
|
|
73
|
+
entityData, options.Design, options.SoItems, image, options.MoreDiscDetails);
|
|
74
|
+
} else {
|
|
75
|
+
soPrintData.Round = TrUtils.FixedTo(salesOrderData.Round);
|
|
76
|
+
soPrintData.Total = TrUtils.FixedTo(salesOrderData.Total);
|
|
77
|
+
soPrintData.SubToal = TrUtils.FixedTo(salesOrderData.SubToal);
|
|
78
|
+
soPrintData.TaxTotal = TrUtils.FixedTo(salesOrderData.TaxTotal);
|
|
79
|
+
soPrint = CreateInvoicePDFService(soPrintData, printConfigData, numberofCopies);
|
|
80
|
+
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return soPrint;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function GetDeliveryChallanPDF(deliveryChallanData: any, entityData: any, headerConfig: any, printConfig: any, taxCodes: any, image: any = null, numberofCopies: string[] = ['Original'], options: any = null) {
|
|
87
|
+
if (!options) {
|
|
88
|
+
options = {
|
|
89
|
+
ShowGST: (deliveryChallanData?.Settings?.Tax === 'TI') ? true : false,
|
|
90
|
+
ConsolidateGST: false,
|
|
91
|
+
Size: 'full',
|
|
92
|
+
MoreDiscDetails: false,
|
|
93
|
+
Orientation: 'portrait'
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
const printConfigData: any = TrUtils.ConcatObjects(
|
|
97
|
+
TrUtils.Stringify(headerConfig),
|
|
98
|
+
TrUtils.Stringify(printConfig)
|
|
99
|
+
);
|
|
100
|
+
const dcPrintData: any = DeliveryChallanPrintService.GetChallanDataPrintInfo(deliveryChallanData, entityData, image,
|
|
101
|
+
options.ShowGST, options.ConsolidateGST, taxCodes, false);
|
|
102
|
+
let dcPrint: any;
|
|
103
|
+
if (options.ConsolidateGST || !options.ShowGST) {
|
|
104
|
+
dcPrint = DeliveryChallanPdfService.GetDeliveryChallanPrint(deliveryChallanData, numberofCopies, false);
|
|
105
|
+
} else {
|
|
106
|
+
dcPrintData.Round = TrUtils.FixedTo(deliveryChallanData.Round);
|
|
107
|
+
dcPrintData.Total = TrUtils.FixedTo(deliveryChallanData.Total);
|
|
108
|
+
dcPrintData.SubToal = TrUtils.FixedTo(deliveryChallanData.SubToal);
|
|
109
|
+
dcPrintData.TaxTotal = TrUtils.FixedTo(deliveryChallanData.TaxTotal);
|
|
110
|
+
dcPrint = CreateInvoicePDFService(dcPrintData, printConfigData, numberofCopies);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return dcPrint;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export function GetCreditNotePDF(creditNoteData: any, entityData: any, headerConfig: any, printConfig: any, taxCodes: any, image: any = null, numberofCopies: string[] = ['Original'], options: any = null) {
|
|
117
|
+
if (!options) {
|
|
118
|
+
options = {
|
|
119
|
+
ShowGST: (creditNoteData?.Settings?.Tax === 'TI') ? true : false,
|
|
120
|
+
ConsolidateGST: false,
|
|
121
|
+
Size: 'full',
|
|
122
|
+
MoreDiscDetails: false,
|
|
123
|
+
Orientation: 'portrait'
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
const printConfigData: any = TrUtils.ConcatObjects(
|
|
127
|
+
TrUtils.Stringify(headerConfig),
|
|
128
|
+
TrUtils.Stringify(printConfig)
|
|
129
|
+
);
|
|
130
|
+
const creditNotePrintData: any = CNPrintService.GetCreditNotePrintInfo(creditNoteData, entityData, image,
|
|
131
|
+
options.ShowGST, options.ConsolidateGST, taxCodes, false);
|
|
132
|
+
let cnPrint: any;
|
|
133
|
+
if (options.ConsolidateGST || !options.ShowGST) {
|
|
134
|
+
cnPrint = CreditNotePdfService.GetInvoicePrint(creditNotePrintData, null, false);
|
|
135
|
+
} else {
|
|
136
|
+
creditNotePrintData.Round = TrUtils.FixedTo(creditNoteData.Round);
|
|
137
|
+
creditNotePrintData.Total = TrUtils.FixedTo(creditNoteData.Total);
|
|
138
|
+
creditNotePrintData.SubToal = TrUtils.FixedTo(creditNoteData.SubToal);
|
|
139
|
+
creditNotePrintData.TaxTotal = TrUtils.FixedTo(creditNoteData.TaxTotal);
|
|
140
|
+
cnPrint = CreateInvoicePDFService(creditNotePrintData, printConfigData, numberofCopies);
|
|
141
|
+
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return cnPrint;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
export function GetSalesReceiptPDF(salesReceiptData: any, entityData: any, headerConfig: any, printConfig: any, taxCodes: any, image: any = null, numberofCopies: string[] = ['Original'], withPass: boolean = false, options: any = null) {
|
|
149
|
+
if (!options) {
|
|
150
|
+
options = {
|
|
151
|
+
ShowGST: (salesReceiptData?.Settings?.Tax === 'TI') ? true : false,
|
|
152
|
+
ConsolidateGST: false,
|
|
153
|
+
PartInvoice: true,
|
|
154
|
+
LaborInvoice: true,
|
|
155
|
+
Size: 'full',
|
|
156
|
+
MoreDiscDetails: false,
|
|
157
|
+
Orientation: 'portrait',
|
|
158
|
+
OwnBatch: false
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
const printConfigData: any = TrUtils.ConcatObjects(
|
|
162
|
+
TrUtils.Stringify(headerConfig),
|
|
163
|
+
TrUtils.Stringify(printConfig)
|
|
164
|
+
);
|
|
165
|
+
printConfigData.withPass = withPass;
|
|
166
|
+
const posPrintData: any = SaleReceiptPrintService.GetSaleReceiptPrintInfo(salesReceiptData, entityData, image,
|
|
167
|
+
options.ShowGST, options.ConsolidateGST, taxCodes, false, options.OwnBatch);
|
|
168
|
+
posPrintData.TotalTax = Add(posPrintData.CustPartCGST, posPrintData.CustPartSGST, posPrintData.CustPartIGST);
|
|
169
|
+
posPrintData.Customer.Code = salesReceiptData.BillTo.Code;
|
|
170
|
+
let posPrint: any;
|
|
171
|
+
if (options.ConsolidateGST || !options.ShowGST) {
|
|
172
|
+
posPrint = PosReceiptPrintService.GetPrint(posPrintData, options.Size);
|
|
173
|
+
} else {
|
|
174
|
+
posPrint = CreateInvoicePDFService(posPrintData, printConfigData, numberofCopies);
|
|
175
|
+
}
|
|
176
|
+
return posPrint;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export function GetBillPDF(billData: any, entityData: any, headerConfig: any, printConfig: any, taxCodes: any, image: any = null) {
|
|
180
|
+
|
|
181
|
+
const printConfigData: any = TrUtils.ConcatObjects(
|
|
182
|
+
TrUtils.Stringify(headerConfig),
|
|
183
|
+
TrUtils.Stringify(printConfig)
|
|
184
|
+
);
|
|
185
|
+
|
|
186
|
+
let billPrintData: any = PurchaseOrderPrintService.GetDataForPurchaseOrderPrint(billData, entityData, image,
|
|
187
|
+
billData.BFrom, taxCodes, false);
|
|
188
|
+
let billPrint: any = CreateInvoicePDFService(billPrintData, printConfigData, ['Original']);
|
|
189
|
+
|
|
190
|
+
return billPrint;
|
|
191
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
export function GetNumber(value: any, defaultValue: number = 0): number {
|
|
2
|
+
return (value == undefined || value == null || isNaN(value)) ? defaultValue : Number(value);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export function IsNull(value: unknown): boolean {
|
|
6
|
+
// return value === null || typeof value === 'undefined';
|
|
7
|
+
return value === null || value === undefined;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function IsNotNull(value: unknown): boolean {
|
|
11
|
+
return !IsNull(value);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Returns age as a human-readable string in years, months, weeks and days.
|
|
17
|
+
* E.g. "10 years, 5 months, 1 week, 2 days".
|
|
18
|
+
* If DOB is in the future or invalid, returns "0 days".
|
|
19
|
+
*
|
|
20
|
+
* @param DOB Date or parsable date-string of birth
|
|
21
|
+
* @param referenceDate Date to calculate age against (default: now)
|
|
22
|
+
*/
|
|
23
|
+
export function GetAgeString(
|
|
24
|
+
DOB: Date | string,
|
|
25
|
+
referenceDate: Date = new Date()
|
|
26
|
+
): string {
|
|
27
|
+
// 1) Parse & validate DOB
|
|
28
|
+
const birthDate = DOB instanceof Date
|
|
29
|
+
? new Date(DOB.getTime())
|
|
30
|
+
: new Date(DOB);
|
|
31
|
+
if (isNaN(birthDate.getTime())) {
|
|
32
|
+
// invalid date
|
|
33
|
+
return '0 days';
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// 2) Normalize both dates to UTC midnight (avoid DST/timezone issues)
|
|
37
|
+
function toUtcMidnight(d: Date) {
|
|
38
|
+
return new Date(Date.UTC(d.getFullYear(), d.getMonth(), d.getDate()));
|
|
39
|
+
}
|
|
40
|
+
const start = toUtcMidnight(birthDate);
|
|
41
|
+
const end = toUtcMidnight(referenceDate);
|
|
42
|
+
|
|
43
|
+
// 3) Prevent negative intervals
|
|
44
|
+
if (start > end) {
|
|
45
|
+
return '0 days';
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// 4) Calculate full years
|
|
49
|
+
let years = end.getUTCFullYear() - start.getUTCFullYear();
|
|
50
|
+
// “Anniversary” = birthday + years
|
|
51
|
+
let anniversary = new Date(Date.UTC(
|
|
52
|
+
start.getUTCFullYear() + years,
|
|
53
|
+
start.getUTCMonth(),
|
|
54
|
+
start.getUTCDate()
|
|
55
|
+
));
|
|
56
|
+
if (anniversary > end) {
|
|
57
|
+
years--;
|
|
58
|
+
anniversary = new Date(Date.UTC(
|
|
59
|
+
start.getUTCFullYear() + years,
|
|
60
|
+
start.getUTCMonth(),
|
|
61
|
+
start.getUTCDate()
|
|
62
|
+
));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// 5) Calculate full months since last anniversary
|
|
66
|
+
let temp = new Date(anniversary);
|
|
67
|
+
let months = 0;
|
|
68
|
+
while (true) {
|
|
69
|
+
const next = new Date(Date.UTC(
|
|
70
|
+
temp.getUTCFullYear(),
|
|
71
|
+
temp.getUTCMonth() + 1,
|
|
72
|
+
temp.getUTCDate()
|
|
73
|
+
));
|
|
74
|
+
if (next <= end) {
|
|
75
|
+
months++;
|
|
76
|
+
temp = next;
|
|
77
|
+
} else {
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// 6) Calculate remaining days → weeks + days
|
|
83
|
+
const msPerDay = 24 * 60 * 60 * 1000;
|
|
84
|
+
const daysTotal = Math.floor((end.getTime() - temp.getTime()) / msPerDay);
|
|
85
|
+
const weeks = Math.floor(daysTotal / 7);
|
|
86
|
+
const days = daysTotal % 7;
|
|
87
|
+
|
|
88
|
+
// 7) Build the output, skipping zero-valued units
|
|
89
|
+
const parts: string[] = [];
|
|
90
|
+
if (years) parts.push(`${years} year${years > 1 ? 's' : ''}`);
|
|
91
|
+
if (months) parts.push(`${months} month${months > 1 ? 's' : ''}`);
|
|
92
|
+
if (weeks) parts.push(`${weeks} week${weeks > 1 ? 's' : ''}`);
|
|
93
|
+
if (days) parts.push(`${days} day${days > 1 ? 's' : ''}`);
|
|
94
|
+
|
|
95
|
+
// 8) Fallback
|
|
96
|
+
if (parts.length === 0) {
|
|
97
|
+
return '0 days';
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return parts.join(', ');
|
|
101
|
+
}
|
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
import { SharedPDFService } from '../../shared/shared-pdf.service';
|
|
2
|
+
import { MyDate } from '../../utils/my-date';
|
|
3
|
+
import { TrUtils } from '../../utils/tr-utils';
|
|
4
|
+
declare var pdfMake: any;
|
|
5
|
+
declare var document: any;
|
|
6
|
+
|
|
7
|
+
export class MeetingPdfService {
|
|
8
|
+
|
|
9
|
+
static BodySize: number = 10;
|
|
10
|
+
|
|
11
|
+
static MeetingPrintData(meetingData: any, isAgendata: boolean, EntityData: any) {
|
|
12
|
+
let Images: any;
|
|
13
|
+
SharedPDFService.convertImgToBase64URL(meetingData.image, function (base64Img: any) {
|
|
14
|
+
Images = base64Img.toString();
|
|
15
|
+
}, function (ntg: any) {
|
|
16
|
+
Images = null;
|
|
17
|
+
});
|
|
18
|
+
setTimeout(() => {
|
|
19
|
+
let dd = {
|
|
20
|
+
info: {
|
|
21
|
+
title: 'Meeting',
|
|
22
|
+
},
|
|
23
|
+
header: function (currentPage: any, pageCount: any) {
|
|
24
|
+
return { text: currentPage.toString() + ' of ' + pageCount, alignment: 'right', marginRight: 7, fontSize: 8, marginTop: 2 };
|
|
25
|
+
},
|
|
26
|
+
pageMargins: [10, 15, 10, 15],
|
|
27
|
+
content: [
|
|
28
|
+
this.HeaderContent(meetingData, isAgendata, Images),
|
|
29
|
+
SharedPDFService.HeaderAfterLine(),
|
|
30
|
+
this.GetMeetingDetails(meetingData, isAgendata),
|
|
31
|
+
SharedPDFService.HeaderAfterLine(),
|
|
32
|
+
{
|
|
33
|
+
stack: [{ text: 'Topics', bold: true, marginBottom: 7 }, this.GetTopicsAndSubTopicsAndItemsList(meetingData, meetingData.Items, isAgendata, EntityData.User.TZ)], marginTop: 10
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
styles: SharedPDFService.GetStyles()
|
|
37
|
+
};
|
|
38
|
+
// return dd;
|
|
39
|
+
pdfMake.createPdf(dd).open();
|
|
40
|
+
|
|
41
|
+
}, 400)
|
|
42
|
+
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
static HeadingforMeeting(isAgendata: any) {
|
|
46
|
+
if (isAgendata) {
|
|
47
|
+
return { text: 'AGENDA', alignment: 'center', bold: true, fontSize: 16 }
|
|
48
|
+
} else {
|
|
49
|
+
return { text: 'MINUTES', alignment: 'center', bold: true, fontSize: 16 }
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
static HeaderContent(meetingData: any, isAgendata: boolean, Images: any) {
|
|
54
|
+
if (TrUtils.IsNull(Images)) {
|
|
55
|
+
return { columns: [this.Header(meetingData, isAgendata)], width: '*', marginBottom: 5 };
|
|
56
|
+
} else {
|
|
57
|
+
return {
|
|
58
|
+
columns: [{ image: Images, width: 40 * 1 },
|
|
59
|
+
this.Header(meetingData, isAgendata),
|
|
60
|
+
], marginBottom: 5
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
static imageExists(image_url: any) {
|
|
66
|
+
|
|
67
|
+
var http = new XMLHttpRequest();
|
|
68
|
+
|
|
69
|
+
http.open('HEAD', image_url, false);
|
|
70
|
+
http.send();
|
|
71
|
+
|
|
72
|
+
return http.status != 404;
|
|
73
|
+
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
static Header(meetingData: any, isAgendata: boolean) {
|
|
77
|
+
// let Title: any;
|
|
78
|
+
// if (isAgendata) {
|
|
79
|
+
// Title = 'Agenda for ' + meetingData.Title;
|
|
80
|
+
// } else {
|
|
81
|
+
// Title = 'Minutes of ' + meetingData.Title;
|
|
82
|
+
// }
|
|
83
|
+
return { stack: [this.HeadingforMeeting(isAgendata), { text: '' + meetingData.Title + '', style: ['meetingHeader'], width: '*', marginTop: 5, alignment: 'center' }] };
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
static GetMeetingDetails(meetingData: any, isAgendata: boolean) {
|
|
87
|
+
return {
|
|
88
|
+
stack: [
|
|
89
|
+
this.GetMeetingTimeDetails(meetingData, isAgendata),
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
static GetMeetingTimeDetails(MeetingData: any, isAgendata: boolean) {
|
|
96
|
+
let MeetingFields: any = [
|
|
97
|
+
{ name: 'Date and time', value: this.getDateAndTime(MeetingData) },
|
|
98
|
+
{ name: 'Location', value: MeetingData.Loc }
|
|
99
|
+
]
|
|
100
|
+
if (isAgendata) {
|
|
101
|
+
MeetingFields.push({ name: 'Participants', value: this.getParticipantsMembers(MeetingData.Members) });
|
|
102
|
+
MeetingFields.push({ name: 'Optional', value: this.GetOptionalMembers(MeetingData.Members) });
|
|
103
|
+
MeetingFields.push({ name: 'CC', value: this.getCCMembers(MeetingData.Members) });
|
|
104
|
+
} else {
|
|
105
|
+
MeetingFields.push({ name: 'Present', value: this.getPresentMembers(MeetingData.Members) });
|
|
106
|
+
MeetingFields.push({ name: 'Absent', value: this.getAbsentMembers(MeetingData.Members) });
|
|
107
|
+
MeetingFields.push({ name: 'CC', value: this.getCCMembersAndOptionalAbsent(MeetingData.Members) })
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return this.GetDetails(MeetingFields);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
static getPresentMembers(Members: any) {
|
|
114
|
+
let Present: string = '';
|
|
115
|
+
|
|
116
|
+
let ReqMembers: any = Members.filter((member: any) => {
|
|
117
|
+
return (member.Type !== 'CC') && member.Att;
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
ReqMembers.forEach((member: any, Index: number) => {
|
|
121
|
+
Present += member.Name;
|
|
122
|
+
if (Index !== ReqMembers.length - 1) {
|
|
123
|
+
Present += ', '
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
return Present;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
static getAbsentMembers(Members: any) {
|
|
131
|
+
let Absent: string = '';
|
|
132
|
+
|
|
133
|
+
let ReqMembers: any = Members.filter((member: any) => {
|
|
134
|
+
return (member.Type !== 'CC' && member.Type !== 'OPT') && !member.Att;
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
ReqMembers.forEach((member: any, Index: number) => {
|
|
138
|
+
Absent += member.Name;
|
|
139
|
+
if (Index !== ReqMembers.length - 1) {
|
|
140
|
+
Absent += ', '
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
return Absent;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
static getDateAndTime(MeetingData: any) {
|
|
148
|
+
return MeetingData.StDate + ' to : ' + MeetingData.EnDate;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
static getParticipantsMembers(Members: any) {
|
|
152
|
+
let Invites: string = '';
|
|
153
|
+
|
|
154
|
+
let ReqMembers: any = Members.filter((member: any) => {
|
|
155
|
+
return member.Type === 'ORG' || member.Type === 'REQ';
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
ReqMembers.forEach((member: any, Index: number) => {
|
|
159
|
+
Invites += member.Name;
|
|
160
|
+
if (Index !== ReqMembers.length - 1) {
|
|
161
|
+
Invites += ', '
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
return Invites;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
static GetOptionalMembers(Members: any) {
|
|
169
|
+
let Invites: string = '';
|
|
170
|
+
|
|
171
|
+
let ReqMembers: any = Members.filter((member: any) => {
|
|
172
|
+
return member.Type === 'OPT';
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
ReqMembers.forEach((member: any, Index: number) => {
|
|
176
|
+
Invites += member.Name;
|
|
177
|
+
if (Index !== ReqMembers.length - 1) {
|
|
178
|
+
Invites += ', '
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
return Invites;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
static getCCMembers(Members: any) {
|
|
186
|
+
let Optional: string = '';
|
|
187
|
+
|
|
188
|
+
let OptMembers: any = Members.filter((member: any) => {
|
|
189
|
+
return member.Type === 'CC';
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
OptMembers.forEach((member: any, index: number) => {
|
|
193
|
+
Optional += member.Name;
|
|
194
|
+
if (index !== OptMembers.length - 1) {
|
|
195
|
+
Optional += ', '
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
return Optional;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
static getCCMembersAndOptionalAbsent(Members: any) {
|
|
203
|
+
let Optional: string = '';
|
|
204
|
+
|
|
205
|
+
let OptMembers: any = Members.filter((member: any) => {
|
|
206
|
+
return member.Type === 'CC' || (member.Type === 'OPT' && !member.Att);
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
OptMembers.forEach((member: any, index: number) => {
|
|
210
|
+
Optional += member.Name;
|
|
211
|
+
if (index !== OptMembers.length - 1) {
|
|
212
|
+
Optional += ', '
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
return Optional;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
static GetDetails(data: any) {
|
|
220
|
+
return {
|
|
221
|
+
fontSize: this.BodySize,
|
|
222
|
+
lineHeight: 1,
|
|
223
|
+
// widths:['*','*',10],
|
|
224
|
+
margin: 10,
|
|
225
|
+
table: {
|
|
226
|
+
body: this.GetDetailsTable(data)
|
|
227
|
+
},
|
|
228
|
+
layout: 'noBorders',
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
static GetDetailsTable(data: any) {
|
|
233
|
+
var body: any = [];
|
|
234
|
+
data.forEach((row: any) => {
|
|
235
|
+
if (!TrUtils.IsEmpty(row.value)) {
|
|
236
|
+
var dataRow: any = [];
|
|
237
|
+
dataRow.push({ text: (row.name).toString(), noWrap: true, bold: true });
|
|
238
|
+
dataRow.push(':');
|
|
239
|
+
dataRow.push({ text: (row.value).toString(), lineHeight: 1 });
|
|
240
|
+
body.push(dataRow);
|
|
241
|
+
} else {
|
|
242
|
+
var a: any = [];
|
|
243
|
+
a.push('');
|
|
244
|
+
a.push('');
|
|
245
|
+
a.push('');
|
|
246
|
+
body.push(a);
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
return body;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
static GetTopicsAndSubTopicsAndItemsList(meetingData: any, items: any, isAgendata: boolean, TZ: any) {
|
|
253
|
+
let tpcs: any = [];
|
|
254
|
+
meetingData.Topics.forEach((tpc: any, index: any) => {
|
|
255
|
+
let a: any;
|
|
256
|
+
if (TrUtils.IsNull(tpc.Prt)) {
|
|
257
|
+
a = { columns: [{ text: (index + 1) + ' . ', width: 20, marginTop: 5, marginBottom: 5, bold: true, fontSize: 12 }, { text: tpc.Desc, marginTop: 5, marginBottom: 5, bold: true, fontSize: 12 }] }
|
|
258
|
+
tpcs.push(a);
|
|
259
|
+
// tpcs.push({ stack: [this.SharedPrint.GetLightUnderLine(558, 'black')], marginLeft: 18 });
|
|
260
|
+
if (!isAgendata) {
|
|
261
|
+
items.forEach((item: any) => {
|
|
262
|
+
if (item.Tpc === tpc._id) {
|
|
263
|
+
this.TopicsItemView(item, meetingData, tpcs, TZ);
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
tpc.SubTopics.forEach((subtpc: any, sindex: any) => {
|
|
269
|
+
let STopic: any = {
|
|
270
|
+
columns: [{ text: (index + 1 + '-' + (sindex + 1)) + ' . ', width: 25, bold: true, marginLeft: 20, marginTop: 10, marginBottom: 5, fontSize: 11 },
|
|
271
|
+
{ text: subtpc.Desc, bold: true, marginLeft: 20, marginTop: 10, marginBottom: 5, fontSize: 11 }]
|
|
272
|
+
}
|
|
273
|
+
tpcs.push(STopic);
|
|
274
|
+
// tpcs.push({ stack: [this.SharedPrint.GetLightUnderLine(520, 'black')], marginLeft: 50 });
|
|
275
|
+
if (!isAgendata) {
|
|
276
|
+
items.forEach((item: any) => {
|
|
277
|
+
if (item.Tpc === subtpc._id) {
|
|
278
|
+
this.TopicsItemView(item, meetingData, tpcs, TZ);
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
})
|
|
283
|
+
|
|
284
|
+
}
|
|
285
|
+
})
|
|
286
|
+
return tpcs;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
static TopicsItemView(item: any, meetingData: any, tpcs: any, TZ:any) {
|
|
290
|
+
let ItemType: any = {
|
|
291
|
+
text: this.GetTypeOfItem(item.Type), marginLeft: 20, marginBottom: 5, marginTop: 5, width: 50,
|
|
292
|
+
color: this.GetColorsBasedOnType(item.Type), background: 'white', fontSize: this.BodySize,
|
|
293
|
+
};
|
|
294
|
+
let ItemDesc: any = this.GetDescrption(item, meetingData);
|
|
295
|
+
let TaskAssignees: any = this.getAssignee(item, meetingData);
|
|
296
|
+
let TaskDueDate: any = this.GetDueDate(item, meetingData, TZ);
|
|
297
|
+
|
|
298
|
+
let Item: any;
|
|
299
|
+
if (item.Type !== 'TAS') {
|
|
300
|
+
Item = {
|
|
301
|
+
columns: [ItemType, { text: ItemDesc, marginLeft: 2, marginTop: 6, marginBottom: 5, fontSize: this.BodySize }], marginTop: 5
|
|
302
|
+
}
|
|
303
|
+
} else {
|
|
304
|
+
Item = {
|
|
305
|
+
columns: [ItemType,
|
|
306
|
+
{
|
|
307
|
+
stack: [{ text: ItemDesc, marginLeft: 2, fontSize: this.BodySize },
|
|
308
|
+
|
|
309
|
+
], marginTop: 6,
|
|
310
|
+
}], marginTop: 5
|
|
311
|
+
}
|
|
312
|
+
if (!TrUtils.IsEmpty(TaskAssignees)) {
|
|
313
|
+
Item.columns[1].stack.push({
|
|
314
|
+
columns: [{ text: 'Assignee(s) ', color: 'magenta', width: 55, fontSize: this.BodySize, marginTop: 2 },
|
|
315
|
+
{ text: TaskAssignees, fontSize: this.BodySize, marginTop: 2, marginBottom: 2 }]
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
if (!TrUtils.IsEmpty(TaskDueDate)) {
|
|
320
|
+
Item.columns[1].stack.push({
|
|
321
|
+
columns: [{ text: 'Due Date ', color: 'magenta', width: 55, fontSize: this.BodySize, marginTop: 2 },
|
|
322
|
+
{ text: TaskDueDate, fontSize: this.BodySize, marginTop: 2, marginBottom: 5 }]
|
|
323
|
+
})
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
if (!TrUtils.IsEmpty(ItemDesc)) {
|
|
327
|
+
tpcs.push(Item);
|
|
328
|
+
tpcs.push({ stack: [SharedPDFService.GetLightUnderLine(525, 'lightgray')], marginLeft: 50 });
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
static GetDescrption(Item: any, MeetingData: any) {
|
|
333
|
+
if (Item.Type === 'TAS' && !TrUtils.IsNull(MeetingData.MeetingTasks)) {
|
|
334
|
+
let Index: any = MeetingData.MeetingTasks.findIndex((task: any) => {
|
|
335
|
+
return task._id === Item.T_Id;
|
|
336
|
+
})
|
|
337
|
+
if (Index !== -1) {
|
|
338
|
+
return MeetingData.MeetingTasks[Index].Name;
|
|
339
|
+
} else {
|
|
340
|
+
return '';
|
|
341
|
+
}
|
|
342
|
+
} else {
|
|
343
|
+
return Item.Desc;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
static GetDueDate(Item: any, MeetingData: any,TZ: any) {
|
|
348
|
+
if (Item.Type === 'TAS' && !TrUtils.IsNull(MeetingData.MeetingTasks)) {
|
|
349
|
+
let Index: any = MeetingData.MeetingTasks.findIndex((task: any) => {
|
|
350
|
+
return task._id === Item.T_Id;
|
|
351
|
+
})
|
|
352
|
+
if (Index !== -1) {
|
|
353
|
+
return TrUtils.IsNull(MeetingData.MeetingTasks[Index].EstEnDt) ? '' : MyDate.GetWeekAndDate(MeetingData.MeetingTasks[Index].EstEnDt, TZ);
|
|
354
|
+
} else {
|
|
355
|
+
return '';
|
|
356
|
+
}
|
|
357
|
+
} else {
|
|
358
|
+
return '';
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
static getAssignee(Item: any, MeetingData: any) {
|
|
363
|
+
if (Item.Type === 'TAS' && !TrUtils.IsNull(MeetingData.MeetingTasks)) {
|
|
364
|
+
let Index: any = MeetingData.MeetingTasks.findIndex((task: any) => {
|
|
365
|
+
return task._id === Item.T_Id;
|
|
366
|
+
})
|
|
367
|
+
if (Index !== -1) {
|
|
368
|
+
let Members: any = MeetingData.MeetingTasks[Index].Members.filter((member: any) => {
|
|
369
|
+
return !TrUtils.IsNull(member.Ass) && TrUtils.IsNull(member.EnDt);
|
|
370
|
+
});
|
|
371
|
+
let Ass: string = '';
|
|
372
|
+
Members.forEach((member: any, index: any) => {
|
|
373
|
+
if (!TrUtils.IsNull(member.Ass)) {
|
|
374
|
+
Ass = Ass + member.Name;
|
|
375
|
+
if (index !== Members.length - 1) {
|
|
376
|
+
Ass = Ass + ', ';
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
});
|
|
380
|
+
return Ass;
|
|
381
|
+
} else {
|
|
382
|
+
return '';
|
|
383
|
+
}
|
|
384
|
+
} else {
|
|
385
|
+
return '';
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
static GetTypeOfItem(type: any) {
|
|
390
|
+
if (type === 'NOT') {
|
|
391
|
+
return 'Note';
|
|
392
|
+
} else if (type === 'DEC') {
|
|
393
|
+
return 'Desc';
|
|
394
|
+
} else {
|
|
395
|
+
return 'Task';
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
static GetColorsBasedOnType(type: any) {
|
|
400
|
+
if (type === 'NOT') {
|
|
401
|
+
return '#b30000';
|
|
402
|
+
} else if (type === 'DEC') {
|
|
403
|
+
return 'blue';
|
|
404
|
+
} else {
|
|
405
|
+
return 'green';
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
}
|