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.
Files changed (212) hide show
  1. package/README.md +1 -0
  2. package/dist/accounting/invoice/invoice-pdf/invoice-pdf.service.js +18 -45
  3. package/dist/accounting/invoice/reports/excel/analysis-excel.service.js +17 -7
  4. package/dist/accounting/invoice/reports/excel/category-wise-item-excel.service.js +17 -7
  5. package/dist/accounting/invoice/reports/excel/cust-wise-sales-details.js +17 -7
  6. package/dist/accounting/invoice/reports/excel/cust-wise-sales-summary-excel.service.js +17 -7
  7. package/dist/accounting/invoice/reports/excel/invoice-wise-excel.service.js +17 -7
  8. package/dist/accounting/invoice/reports/excel/item-wise-doctor-sale-excel.service.js +17 -7
  9. package/dist/accounting/invoice/reports/excel/items-wise-sales-excel.service.js +17 -7
  10. package/dist/accounting/invoice/reports/excel/manf-wise-sales-excel.service.js +17 -7
  11. package/dist/accounting/invoice/reports/excel/operator-wise-details.js +17 -7
  12. package/dist/accounting/invoice/reports/excel/operator-wise-summary.js +17 -7
  13. package/dist/accounting/invoice/reports/excel/sa-wise-labor-sales-excel.service.js +17 -7
  14. package/dist/accounting/invoice/reports/excel/sa-wise-part-sales-excel.service.js +17 -7
  15. package/dist/accounting/invoice/reports/excel/sale-summary-excel.service.js +17 -7
  16. package/dist/accounting/invoice/reports/excel/sales-by-service-summary-excel.service.js +17 -7
  17. package/dist/accounting/invoice/reports/excel/scheduled-drug-summary-excel.service.js +17 -7
  18. package/dist/accounting/invoice/reports/excel/scheduled-drugs-excel.service.js +17 -7
  19. package/dist/accounting/invoice/unified-invoice-pdf.service.d.ts +1 -1
  20. package/dist/accounting/payment-receive/reports/excel/cust-balance-excel.service.js +17 -7
  21. package/dist/accounting/payment-receive/reports/excel/payment-receive-excel.service.js +17 -7
  22. package/dist/common/reports/excel/product-without-owner-excel.service.js +17 -7
  23. package/dist/gst/excel/GSTR-RO-excel.service.js +17 -7
  24. package/dist/gst/excel/GSTR1-excel.service.js +17 -7
  25. package/dist/gst/excel/GSTR2-excel.service.js +17 -7
  26. package/dist/gst/excel/hsn-summary.js +17 -7
  27. package/dist/gst/excel/tally-sales-import.service.js +17 -7
  28. package/dist/index.d.ts +1 -1
  29. package/dist/index.js +6 -6
  30. package/dist/inventory/items/reports/excel/expiring-drugs-excel.service.js +17 -7
  31. package/dist/inventory/items/reports/excel/item-wise-mout-details.js +17 -7
  32. package/dist/inventory/items/reports/excel/item-wise-mout-summary.js +17 -7
  33. package/dist/inventory/items/reports/excel/spares-issue-excel.service.js +17 -7
  34. package/dist/inventory/items/reports/excel/stock-excel.service.js +17 -7
  35. package/dist/purchases/payment-made/reports/excel/payments-made-excel.service.js +17 -7
  36. package/dist/purchases/payment-made/reports/excel/ven-balance-excel.service.js +17 -7
  37. package/dist/services/reports/excel/insurance-expire-excel.service.js +17 -7
  38. package/dist/services/reports/excel/next-service-date-excel.service.js +17 -7
  39. package/dist/services/reports/excel/repair-orders-excel.service.js +17 -7
  40. package/dist/shared/table-section/pdf-table.header.d.ts +1 -1
  41. package/dist/shared/table-section/pdf-table.header.js +14 -2
  42. package/dist/shared/table-section/pdf-table.section.js +6 -13
  43. package/dist/{accounting/invoice/invoice-pdf.service.js → shared/transactions-pdf.service.js} +15 -15
  44. package/package.json +1 -1
  45. package/src/accounting/counter-sales/auto-sales-receipt-pdf.service.ts +569 -0
  46. package/src/accounting/counter-sales/pos-receipt-pdf.ts +577 -0
  47. package/src/accounting/counter-sales/sales-receipt-pdf.service.ts +628 -0
  48. package/src/accounting/counter-sales/sales-receipt-print.service.ts +506 -0
  49. package/src/accounting/credit-note/cn-print.service.ts +264 -0
  50. package/src/accounting/credit-note/credit-note-pdf.service.ts +602 -0
  51. package/src/accounting/credit-note/credit-note-totals.service.ts +424 -0
  52. package/src/accounting/debit-note/debit-note-pdf.service.ts +681 -0
  53. package/src/accounting/debit-note/debit-note-print.service.ts +276 -0
  54. package/src/accounting/debit-note/debit-note-totals.service.ts +361 -0
  55. package/src/accounting/invoice/hc-inv-pdf.service.ts +880 -0
  56. package/src/accounting/invoice/inv-pdf.service.ts +812 -0
  57. package/src/accounting/invoice/inv-print.service.ts +532 -0
  58. package/src/accounting/invoice/invoice-landscape-pdf.service.ts +947 -0
  59. package/src/accounting/invoice/invoice-letterhead-pdf.service.ts +813 -0
  60. package/src/accounting/invoice/invoice-pdf/invoice-pdf.service.ts +359 -0
  61. package/src/accounting/invoice/invoice-portrait-pdf.ts +972 -0
  62. package/src/accounting/invoice/invoice-print.service.ts +2906 -0
  63. package/src/accounting/invoice/invoice-total.service.ts +834 -0
  64. package/src/accounting/invoice/reports/excel/analysis-excel.service.ts +291 -0
  65. package/src/accounting/invoice/reports/excel/category-wise-item-excel.service.ts +267 -0
  66. package/src/accounting/invoice/reports/excel/cust-wise-sales-details.ts +321 -0
  67. package/src/accounting/invoice/reports/excel/cust-wise-sales-summary-excel.service.ts +300 -0
  68. package/src/accounting/invoice/reports/excel/invoice-wise-excel.service.ts +859 -0
  69. package/src/accounting/invoice/reports/excel/item-wise-doctor-sale-excel.service.ts +255 -0
  70. package/src/accounting/invoice/reports/excel/items-wise-sales-excel.service.ts +312 -0
  71. package/src/accounting/invoice/reports/excel/manf-wise-sales-excel.service.ts +273 -0
  72. package/src/accounting/invoice/reports/excel/operator-wise-details.ts +258 -0
  73. package/src/accounting/invoice/reports/excel/operator-wise-summary.ts +259 -0
  74. package/src/accounting/invoice/reports/excel/sa-wise-labor-sales-excel.service.ts +230 -0
  75. package/src/accounting/invoice/reports/excel/sa-wise-part-sales-excel.service.ts +231 -0
  76. package/src/accounting/invoice/reports/excel/sale-summary-excel.service.ts +326 -0
  77. package/src/accounting/invoice/reports/excel/sales-by-service-details-excel.service.ts +0 -0
  78. package/src/accounting/invoice/reports/excel/sales-by-service-summary-excel.service.ts +432 -0
  79. package/src/accounting/invoice/reports/excel/scheduled-drug-summary-excel.service.ts +373 -0
  80. package/src/accounting/invoice/reports/excel/scheduled-drugs-excel.service.ts +372 -0
  81. package/src/accounting/invoice/reports/pdf/analysis-pdf.service.ts +113 -0
  82. package/src/accounting/invoice/reports/pdf/category-wise-item-pdf.service.ts +107 -0
  83. package/src/accounting/invoice/reports/pdf/cust-wise-sales-details-pdf.service.ts +125 -0
  84. package/src/accounting/invoice/reports/pdf/cust-wise-sales-summary-pdf.service.ts +119 -0
  85. package/src/accounting/invoice/reports/pdf/item-wise-doctor-sale-pdf.service.ts +180 -0
  86. package/src/accounting/invoice/reports/pdf/item-wise-sales-pdf.service.ts +193 -0
  87. package/src/accounting/invoice/reports/pdf/manf-wise-sales-pdf.service.ts +188 -0
  88. package/src/accounting/invoice/reports/pdf/operator-wise-details-pdf.service.ts +118 -0
  89. package/src/accounting/invoice/reports/pdf/operator-wise-summary-pdf.ts +116 -0
  90. package/src/accounting/invoice/reports/pdf/sales-by-service-pdf.service.ts +132 -0
  91. package/src/accounting/invoice/reports/pdf/scheduled-drug-pdf.service.ts +191 -0
  92. package/src/accounting/invoice/reports/pdf/scheduled-drug-summary-pdf.service.ts +202 -0
  93. package/src/accounting/invoice/shared-inv-pdf.service.ts +787 -0
  94. package/src/accounting/invoice/unified-invoice-pdf.service.ts +937 -0
  95. package/src/accounting/payment-receive/payment-pdf.service.ts +410 -0
  96. package/src/accounting/payment-receive/payment-receipt-pdf/receipt-pdf.service.ts +470 -0
  97. package/src/accounting/payment-receive/receipt-print.service.ts +71 -0
  98. package/src/accounting/payment-receive/reports/excel/cust-balance-excel.service.ts +298 -0
  99. package/src/accounting/payment-receive/reports/excel/payment-receive-excel.service.ts +221 -0
  100. package/src/accounting/payment-receive/reports/pdf/customer-balances-pdf.service.ts +182 -0
  101. package/src/accounting/payment-receive/reports/pdf/payment-report-pdf.service.ts +116 -0
  102. package/src/aggregation/aggregation.ts +58 -0
  103. package/src/appointments/appointments/appointment-total.service.ts +298 -0
  104. package/src/appointments/consultations/consultation-fee-receipt.service.ts +407 -0
  105. package/src/appointments/consultations/consultation-full-pdf.service.ts +238 -0
  106. package/src/appointments/consultations/consultation-letterhead-pdf.service.ts +430 -0
  107. package/src/appointments/consultations/consultation-pdf.service.ts +417 -0
  108. package/src/common/reports/excel/product-without-owner-excel.service.ts +308 -0
  109. package/src/common/reports/pdf/product-without-owner-pdf.service.ts +146 -0
  110. package/src/enums/cache-enums.ts +33 -0
  111. package/src/enums/code-enums.ts +291 -0
  112. package/src/enums/country-enums.ts +9 -0
  113. package/src/enums/enums.ts +364 -0
  114. package/src/enums/industry-enums.ts +26 -0
  115. package/src/enums/treatment-enums.ts +9 -0
  116. package/src/gst/excel/GSTR-RO-excel.service.ts +926 -0
  117. package/src/gst/excel/GSTR1-excel.service.ts +313 -0
  118. package/src/gst/excel/GSTR2-excel.service.ts +314 -0
  119. package/src/gst/excel/hsn-summary.ts +314 -0
  120. package/src/gst/excel/tally-sales-import.service.ts +767 -0
  121. package/src/gst/pdf/hsn-summary-pdf.ts +176 -0
  122. package/src/index.ts +194 -0
  123. package/src/inventory/items/adjustment-pdf.service.ts +177 -0
  124. package/src/inventory/items/issue-parts-pdf.service.ts +795 -0
  125. package/src/inventory/items/item-bar-code-label-pdf.ts +194 -0
  126. package/src/inventory/items/item-detais-pdf.ts +141 -0
  127. package/src/inventory/items/item-price-for-pricelist.ts +368 -0
  128. package/src/inventory/items/reports/excel/expiring-drugs-excel.service.ts +290 -0
  129. package/src/inventory/items/reports/excel/item-wise-mout-details.ts +284 -0
  130. package/src/inventory/items/reports/excel/item-wise-mout-summary.ts +279 -0
  131. package/src/inventory/items/reports/excel/spares-issue-excel.service.ts +494 -0
  132. package/src/inventory/items/reports/excel/stock-excel.service.ts +319 -0
  133. package/src/inventory/items/reports/pdf/expiring-drugs-pdf.service.ts +172 -0
  134. package/src/inventory/items/reports/pdf/item-wise-mout-details-pdf.ts +122 -0
  135. package/src/inventory/items/reports/pdf/item-wise-mout-summary-pdf.ts +115 -0
  136. package/src/inventory/items/reports/pdf/reorder-point-pdf.service.ts +163 -0
  137. package/src/inventory/material-out/mout-pdf.service.ts +545 -0
  138. package/src/inventory/transfer-order/transfer-order-pdf.service.ts +154 -0
  139. package/src/purchases/bills/bill-pdf/bill-pdf.service.ts +211 -0
  140. package/src/purchases/bills/bill-pdf.service.ts +21 -0
  141. package/src/purchases/payment-made/reports/excel/payments-made-excel.service.ts +313 -0
  142. package/src/purchases/payment-made/reports/excel/ven-balance-excel.service.ts +307 -0
  143. package/src/purchases/payment-made/reports/pdf/vendor-balances-pdf.service.ts +114 -0
  144. package/src/purchases/purchase-order/po-totals.service.ts +343 -0
  145. package/src/purchases/purchase-order/purchase-order-pdf.service.ts +1016 -0
  146. package/src/purchases/purchase-order/purchase-order-print.service.ts +279 -0
  147. package/src/purchases/purchase-order/purchase-order-totals.service.ts +637 -0
  148. package/src/purchases/vendor-credit-note/vendor-credit-note-pdf.service.ts +1055 -0
  149. package/src/purchases/vendor-credit-note/vendor-credit-note-print.service.ts +145 -0
  150. package/src/purchases/vendor-credit-note/vendor-credit-note-totals.service.ts +399 -0
  151. package/src/purchases/vendor-debit-note/vendor-debit-note-pdf.service.ts +582 -0
  152. package/src/purchases/vendor-debit-note/vendor-debit-note-print.service.ts +295 -0
  153. package/src/purchases/vendor-debit-note/vendor-debit-note-totals.service.ts +377 -0
  154. package/src/sales/delivery-challan/dc-landscape-pdf.service.ts +922 -0
  155. package/src/sales/delivery-challan/dc-landscape-without-price-pdf.service.ts +869 -0
  156. package/src/sales/delivery-challan/dc-without-price-pdf.service.ts +505 -0
  157. package/src/sales/delivery-challan/delivery-challan-pdf.service.ts +461 -0
  158. package/src/sales/delivery-challan/delivery-challan-print.service.ts +229 -0
  159. package/src/sales/delivery-challan/delivery-challan-totals.ts +466 -0
  160. package/src/sales/sales/equipment-design-pdf.service.ts +153 -0
  161. package/src/sales/sales/pack-ship-pdf.service.ts +128 -0
  162. package/src/sales/sales/pack-ship-print.service.ts +198 -0
  163. package/src/sales/sales/sales-pdf.service.ts +658 -0
  164. package/src/sales/sales/sales-print.service.ts +376 -0
  165. package/src/sales/sales/sales-totals.service.ts +500 -0
  166. package/src/sales-receive/sales-receive-pdf.service.ts +602 -0
  167. package/src/sales-receive/sales-receive-print.service.ts +242 -0
  168. package/src/sales-receive/sales-receive-totals.service.ts +651 -0
  169. package/src/services/checklist-pdf.ts +151 -0
  170. package/src/services/checklists-pdf.ts +133 -0
  171. package/src/services/est.print-service.ts +1155 -0
  172. package/src/services/reports/excel/insurance-expire-excel.service.ts +292 -0
  173. package/src/services/reports/excel/next-service-date-excel.service.ts +317 -0
  174. package/src/services/reports/excel/repair-orders-excel.service.ts +249 -0
  175. package/src/services/reports/pdf/insurance-expire-pdf.service.ts +115 -0
  176. package/src/services/reports/pdf/next-service-date-pdf.service.ts +198 -0
  177. package/src/services/reports/pdf/repair-orders-pdf.service.ts +184 -0
  178. package/src/services/ro-pdf.service.ts +1917 -0
  179. package/src/services/ro-print-service.ts +881 -0
  180. package/src/services/ro-totals.service.ts +1314 -0
  181. package/src/services/separate-wo-print.service.ts +396 -0
  182. package/src/services/service-history-pdf.service.ts +145 -0
  183. package/src/services/service-price-for-pricelist.ts +649 -0
  184. package/src/services/technician-pdf.service.ts +234 -0
  185. package/src/services/technician-print.service.ts +95 -0
  186. package/src/shared/header-footer-section/pdf-header-footer.section.ts +519 -0
  187. package/src/shared/header-footer-section/pdf-shared.utils.ts +46 -0
  188. package/src/shared/math-operations.ts +208 -0
  189. package/src/shared/party-details-section/pdf-party-details.section.ts +602 -0
  190. package/src/shared/shared-pdf.service.ts +3042 -0
  191. package/src/shared/shared-print.service.ts +879 -0
  192. package/src/shared/table-section/pdf-table.config.ts +8 -0
  193. package/src/shared/table-section/pdf-table.header.ts +396 -0
  194. package/src/shared/table-section/pdf-table.row.ts +248 -0
  195. package/src/shared/table-section/pdf-table.section.ts +447 -0
  196. package/src/shared/totals-section/pdf-totals.section.ts +921 -0
  197. package/src/shared/transactions-pdf.service.ts +191 -0
  198. package/src/shared/util.ts +101 -0
  199. package/src/tasks/meetings/meeting-pdf.ts +410 -0
  200. package/src/tasks/tasks/task-pdf.service.ts +238 -0
  201. package/src/tasks/tasks/task-reports-pdf.service.ts +313 -0
  202. package/src/tax/index.ts +86 -0
  203. package/src/tax/tax-calculator.ts +1025 -0
  204. package/src/tax/tax.types.ts +535 -0
  205. package/src/transaction-calculations/discounts-distribution.ts +343 -0
  206. package/src/transaction-calculations/index.ts +3 -0
  207. package/src/transaction-calculations/total-calculation.ts +443 -0
  208. package/src/transaction-calculations/transaction-calculation-engine.ts +903 -0
  209. package/src/utils/my-date.ts +111 -0
  210. package/src/utils/tr-utils.ts +104 -0
  211. package/tsconfig.json +2 -2
  212. /package/dist/{accounting/invoice/invoice-pdf.service.d.ts → shared/transactions-pdf.service.d.ts} +0 -0
@@ -0,0 +1,407 @@
1
+
2
+
3
+ import { differenceInYears } from 'date-fns';
4
+ import { TrUtils } from '../../utils/tr-utils';
5
+ import { SharedPDFService } from '../../shared/shared-pdf.service';
6
+ import { MyDate } from '../../utils/my-date';
7
+ import { Add } from '../../shared/math-operations';
8
+
9
+ export class ConsultationFeeReceiptPrintService {
10
+
11
+ static GetPrint(consultationData: any) {
12
+ if (TrUtils.IsNull(consultationData.Name)) {
13
+ consultationData.Name = '';
14
+ }
15
+ let dd: any = {
16
+ info: {
17
+ title: 'Consultation',
18
+ },
19
+ footer: this.FooterContent(consultationData),
20
+
21
+ header: function (currentPage: any, pageCount: any, pageSize: any) {
22
+ return { text: currentPage.toString() + ' of ' + pageCount, alignment: 'right', marginRight: 25, fontSize: 8, marginTop: 2 };
23
+ },
24
+ pageMargins: [35, 15, 15, 435.945],
25
+ pageSize: 'A4',
26
+ content: [
27
+ this.GetMainHeaderDetails(consultationData, consultationData.Entity, consultationData.HeaderName, consultationData.Image, consultationData.HColor, consultationData.AColor, null),
28
+ this.GetItemsTable(consultationData.Items, consultationData.ShowTaxColumn),
29
+ {
30
+ columns: [{ text: '', width: '*' }, { text: this.finalReturnTotal(consultationData), width: '*', bold: true, fontSize: 10, alignment: 'center' },
31
+ this.GetTotalDeetails(consultationData)]
32
+ },
33
+ ],
34
+ styles: {
35
+ headerstyle: {
36
+ fontFamily: 'Calibri',
37
+ fontSize: 9
38
+ },
39
+ Sign: {
40
+ fontSize: 8,
41
+ margin: [0, 30, 0, 5]
42
+ },
43
+ forCompany: {
44
+ // margin: [0, 10, 30, 0],
45
+ marginRight: 5,
46
+ marginTop: 10,
47
+ fontSize: 9,
48
+ alignment: 'left'
49
+ },
50
+ tableheader: {
51
+ bold: true,
52
+ fontFamily: 'Calibri',
53
+ margin: [0, 1, 0, 5],
54
+ alignment: 'center'
55
+ },
56
+ tableheader1: {
57
+ bold: true,
58
+ fontFamily: 'Calibri',
59
+ margin: [0, 2, 0, 2],
60
+ alignment: 'center'
61
+ },
62
+ tableExample: {
63
+ fontSize: 9
64
+ }, ws_adrs_left: {
65
+ fontSize: 8,
66
+ alignment: 'left',
67
+ }
68
+ }
69
+
70
+ };
71
+ return dd;
72
+ }
73
+
74
+ static FooterContent(consultationData: any) {
75
+ if (consultationData.Entity.Header === 2) {
76
+ return {
77
+
78
+ table: {
79
+ widths: ['auto'],
80
+ body: [
81
+ [{
82
+ text:consultationData.Entity.FootText, alignment:'center', fontSize:9
83
+ }]
84
+ ]
85
+ }, margin: [25, -50, 25, 10]
86
+ }
87
+ }else{
88
+ return {
89
+
90
+ stack: [{ text: consultationData.Doc?.Name, bold: true, alignment: 'right', marginBottom: 5 }, SharedPDFService.HeaderAfterLine1(), { columns: [SharedPDFService.GetEntityAddress(consultationData.Entity)] }],
91
+
92
+ margin: [25, -50, 25, 10]
93
+ }
94
+ }
95
+ }
96
+
97
+ static GetMainHeaderDetails(CnstData: any, Entity: any, HeaderName: any, Image: any, HColor: any, AColor: any, text: any) {
98
+ return [
99
+ this.GetHeaderBasedOnCondition(CnstData, Entity, HeaderName, Image, HColor, AColor, text),
100
+
101
+ SharedPDFService.HeaderAfterLine1(),
102
+ {
103
+ columns: [{
104
+ stack: [{ text: CnstData.Pat.Name, fontSize: 10, marginTop: 5 },
105
+ { text: CnstData.Pat.Code + ' | ' + this.DifferenceInYears(CnstData.Pat.DOB, Entity.User.TZ) + ' | ' + CnstData.Pat.Sex + this.GetPhoneNumber(CnstData?.Pat?.Ph), fontSize: 10, marginBottom: 5 }]
106
+ },
107
+ {
108
+ stack: [{ text: 'Bill No : ' + CnstData.Code, style: ['headerstyle'] },
109
+ { text: 'Date : ' + MyDate.ConvertUTCDateToReadable(CnstData.CrDate), style: ['headerstyle'] }], marginTop: 5, width: 120
110
+ }
111
+ ]
112
+ }
113
+
114
+
115
+ ];
116
+ }
117
+
118
+ static GetHeaderBasedOnCondition(CnstData: any, Entity: any, HeaderName: any, Image: any, HColor: any, AColor: any, text: any) {
119
+ if (Entity.Header === 2) {
120
+ return {
121
+ columns: [
122
+ SharedPDFService.GetConsultationMainHeader(Entity, null, AColor, HColor, text), {stack:[{ text: CnstData?.Doc?.Name, fontSize: 12, bold:true, alignment: 'right' },
123
+ { text: CnstData?.Doc?.Intro1, fontSize: 9, alignment: 'right' },
124
+ { text: CnstData?.Doc?.Intro2, fontSize: 9, alignment: 'right' },
125
+ { text: CnstData?.Doc?.Intro3, fontSize: 9, alignment: 'right' },
126
+ { text: 'Registration ID- '+CnstData?.Doc?.CounReg, fontSize: 9, alignment: 'right',marginBottom:5 }], width: '40%'}]
127
+ };
128
+ } else {
129
+ return { columns: [SharedPDFService.GetImage(Image,Entity.PrLogo), {stack:[{ text: CnstData?.Doc?.Name, fontSize: 12, bold:true, alignment: 'right' },
130
+ { text: CnstData?.Doc?.Intro1, fontSize: 9, alignment: 'right' },
131
+ { text: CnstData?.Doc?.Intro2, fontSize: 9, alignment: 'right' },
132
+ { text: CnstData?.Doc?.Intro3, fontSize: 9, alignment: 'right' },
133
+ { text: 'Registration ID- '+CnstData?.Doc?.CounReg, fontSize: 9, alignment: 'right',marginBottom:5 }], width: '40%'}] };
134
+
135
+ }
136
+ }
137
+
138
+ static GetPhoneNumber(phone: any) {
139
+ if (!TrUtils.IsNull(phone)) {
140
+ return ' | ' + phone;
141
+ } else {
142
+ return '';
143
+ }
144
+ }
145
+
146
+ static getDoctorName(DocName: any) {
147
+ if (!TrUtils.IsNull(DocName)) {
148
+ return DocName;
149
+ } else {
150
+ return '';
151
+ }
152
+ }
153
+
154
+ static GetPhone(Phone: any) {
155
+ if (TrUtils.IsNull(Phone)) {
156
+ return '';
157
+ } else {
158
+ return Phone;
159
+ }
160
+ }
161
+
162
+ static DifferenceInYears(DOB: any, TZ: any) {
163
+ if (TrUtils.IsNull(DOB)) {
164
+ return 'DOB Not Specified';
165
+ }
166
+ const result = differenceInYears(MyDate.GetDateTimeNowInUTC(TZ), new Date(DOB));
167
+ return result + ' Years';
168
+ }
169
+
170
+ static HeaderLayOut() {
171
+ return {
172
+ hLineWidth: function (i:any, node:any) {
173
+
174
+ return (i === 0 || i === 1 || i === node.table.body.length) ? 1 : 0;
175
+ },
176
+ vLineWidth: function (i:any, node:any) {
177
+ return (i === 0 || i === node.table.widths.length) ? 1 : 0;
178
+ },
179
+ hLineColor: function (i: any, node: any) {
180
+ return 'gray';
181
+ },
182
+ vLineColor: function (i: any, node: any) {
183
+ return 'gray';
184
+ },
185
+ };
186
+ }
187
+
188
+ static GetHeaderInfo(consultationData: any) {
189
+ let TaxInfo: any = [];
190
+ if (!TrUtils.IsEmpty(consultationData.Entity.GSTIN)) {
191
+ TaxInfo.push({ text: 'GSTIN : ' + consultationData.Entity.GSTIN, marginTop: 2, marginLeft: 5, alignment: 'left', fontSize: 9, width: 'auto' },
192
+ );
193
+ }
194
+ if (!TrUtils.IsEmpty(consultationData.Entity.DLNo)) {
195
+ TaxInfo.push({ text: 'D.L.NO : ' + consultationData.Entity.DLNo, marginTop: 2, marginLeft: 5, alignment: 'left', fontSize: 9, width: '*' },
196
+ );
197
+ }
198
+ TaxInfo.push(this.GetBillofSupplyName(consultationData.Settings));
199
+ return TaxInfo;
200
+ }
201
+
202
+ static finalReturnTotal(consultationData: any) {
203
+ // if (!TrUtils.IsFixedZero(consultationData.CustRetRoundedTotal)) {
204
+ // return 'Returns Total : ' + consultationData.CustRetRoundedTotal
205
+ // } else {
206
+ return '';
207
+ // }
208
+ }
209
+
210
+ static GetTotalDeetails(consultationData: any) {
211
+ let TotalData: any = [];
212
+ TotalData.push({ name: 'Total', value: 500 });
213
+ return {
214
+ style: ['columnheader', 'TotalsStyles'],
215
+ lineHeight: 0.7,
216
+ marginBottom: 5,
217
+ width: 'auto',
218
+ table: {
219
+ body: this.GrandTotalTable(TotalData)
220
+ },
221
+ layout: 'noBorders'
222
+ };
223
+ }
224
+
225
+ static GrandTotalTable(data: any) {
226
+ var body: any = [];
227
+ data.forEach((row: any) => {
228
+ if (!TrUtils.IsFixedZero(row.value) || row.name === 'Total') {
229
+ var dataRow: any = [];
230
+ dataRow.push({ text: (row.name).toString(), noWrap: true, bold: true, style: ['headerstyle'], fontSize: 10 });
231
+ dataRow.push({ text: ':', style: ['headerstyle'], bold: true, fontSize: 10 });
232
+ if (!TrUtils.IsNull(row.value)) {
233
+ dataRow.push({ text: (row.value).toString(), noWrap: true, alignment: 'right', bold: true, style: ['headerstyle'], fontSize: 10, marginRight: 5 });
234
+ } else {
235
+ dataRow.push({ text: '', noWrap: true, alignment: 'right', style: ['headerstyle'] });
236
+ }
237
+ body.push(dataRow);
238
+ }
239
+ });
240
+ return body;
241
+ }
242
+
243
+ static GetBillofSupplyName(Settings: any) {
244
+ return { text: Settings?.Tax === 'BS' ? 'Bill of Supply' : null, alignment: 'right', marginRight: 5, marginTop: 2, marginBottom: 3, fontSize: 9, width: 'auto' };
245
+ }
246
+
247
+ static GetDiscountOverall(consultationData: any, DecimalsNumber: number) {
248
+ let OveralDisc: number = Add(TrUtils.SetValueToZeroIfNull(Number(consultationData.Disc)) ,
249
+ TrUtils.SetValueToZeroIfNull(Number(consultationData.CustPartsDiscTotal)));
250
+ return TrUtils.FixPriceValue(OveralDisc, DecimalsNumber);
251
+ }
252
+
253
+ static CustomerAndVehicleDetailsAfterLine(size: any) {
254
+ let length: any = 575;
255
+ if (size === 'A3') {
256
+ length = 820;
257
+ } else if (size === 'Custom') {
258
+ length = 575;
259
+ }
260
+ return {
261
+ canvas: [
262
+ {
263
+ type: 'line',
264
+ lineColor: 'gray',
265
+ x1: 0,
266
+ y1: 0,
267
+ x2: 540,
268
+ y2: 0,
269
+ lineWidth: 1
270
+ }
271
+ ]
272
+ };
273
+ }
274
+
275
+ static GetSignatures(CName: any, For: any, Type: any) {
276
+ return {
277
+ columns: [{
278
+ stack: [
279
+ this.CompanyName(CName),
280
+ // { columns: [this.Authorizedsignature(), this.SurveyorSignature(For, Type), this.CustomerSignature()] }
281
+ ]
282
+ }],
283
+ };
284
+ }
285
+
286
+ static CompanyName(CName: any) {
287
+ return {
288
+ style: 'forCompany',
289
+ text: ['For ', { text: CName, }],
290
+ };
291
+ }
292
+
293
+ static Authorizedsignature() {
294
+ return {
295
+ style: 'Sign',
296
+ text: ['Authorized Signatory'],
297
+ };
298
+ }
299
+
300
+ static CustomerSignature() {
301
+ return {
302
+ style: 'Sign',
303
+ text: ['Customer Signature'], marginLeft: 90
304
+ };
305
+ }
306
+
307
+ static GetItemsTable(Items: any, ShowTaxColumn: boolean) {
308
+ return {
309
+ style: 'tableExample',
310
+ marginTop: 3,
311
+ marginBottom: 5,
312
+ table: {
313
+ widths: this.GetWidths(ShowTaxColumn),
314
+ headerRows: 1,
315
+ body: this.BuildTableBodyForLaborAndParts(Items, ShowTaxColumn)
316
+ },
317
+ layout: {
318
+ hLineWidth: function (i:any, node:any) {
319
+
320
+ return (i === 0 || i === 1 || (i === 20) || i === node.table.body.length) ? 1 : 0;
321
+ },
322
+ vLineWidth: function (i:any, node:any) {
323
+ return (i === 0 || i === node.table.widths.length) ? 1 : 0.5;
324
+ },
325
+ // hLineStyle: function (i, node) {
326
+ // return (i === 0 || i === 1) ? { dash: { length: 5, space: 5 } } : null;
327
+ // },
328
+ hLineColor: function (i: any, node: any) {
329
+ return 'gray';
330
+ },
331
+ vLineColor: function (i: any, node: any) {
332
+ return 'gray';
333
+ },
334
+ }
335
+ };
336
+ }
337
+
338
+ static GetWidths(ShowTaxColumn: any) {
339
+ // if (ShowTaxColumn) {
340
+ return [25, '*', 50, 60, 60, 70, 60];
341
+ // } else {
342
+ // return ['*', 100, 50, 20, 50, 50];
343
+ // }
344
+ }
345
+
346
+ static GetAddress(Entity: any) {
347
+ let Addres: string = Entity.Adrs1;
348
+ if (!TrUtils.IsEmpty(Entity.Adrs2)) {
349
+ Addres = Addres + ',' + Entity.Adrs2;
350
+ }
351
+ Addres = Addres + ',' + Entity.City + SharedPDFService.getPinCode(Entity.PIN);
352
+ return {
353
+ style: 'tableExample',
354
+ table: {
355
+ widths: ['auto', '*'],
356
+ body: [
357
+ [{ text: 'Address -', bold: true }, { text: Addres }],
358
+ [{ text: 'For Appointments' }, { text: 'Call: ' + Entity.Phone + ', ' + SharedPDFService.GetEmail(Entity.Email) }],
359
+ ]
360
+ }, layout: 'noBorders',
361
+ }
362
+ }
363
+
364
+ static GetPINCode(PIN: any) {
365
+ if (TrUtils.IsNull(PIN)) {
366
+ return '';
367
+ } else {
368
+ return '-' + PIN;
369
+ }
370
+ }
371
+
372
+ static BuildTableBodyForLaborAndParts(Items: any, ShowTaxColumn: any) {
373
+ let body: any = this.GetHeaderNames(ShowTaxColumn);
374
+ let dataRow: any = [];
375
+ dataRow.push({ text: '1', });
376
+ dataRow.push({ text: 'Doctor', });
377
+ dataRow.push({ text: '43423423', });
378
+ dataRow.push({ text: '1', alignment: 'right' });
379
+ dataRow.push({ text: '500', alignment: 'right' });
380
+ dataRow.push({ text: '', alignment: 'right' });
381
+ dataRow.push({ text: '500', alignment: 'right' });
382
+ body.push(dataRow);
383
+ return body;
384
+ }
385
+
386
+ static GetHeaderNames(ShowTaxColumn: any) {
387
+ let HeadingNames: any;
388
+ // if (ShowTaxColumn) {
389
+ HeadingNames = [[{ text: 'S.No', style: 'tableheader1', Field: 'SNo', alignment: 'left', line: true },
390
+ { text: 'Services', style: 'tableheader1', Field: 'Doctor' },
391
+ { text: 'SAC', style: 'tableheader1', Field: 'SAC' },
392
+ { text: 'Qty', style: 'tableheader1', Field: 'Qty', alignment: 'right' },
393
+ { text: 'Price', style: 'tableheader1', Field: 'UnPr', alignment: 'right' },
394
+ { text: 'Discount', style: 'tableheader1', Field: 'Disc' },
395
+ { text: 'Amount', style: 'tableheader1', Field: 'Amount', alignment: 'right' }]];
396
+ // } else {
397
+ // HeadingNames = [[{ text: 'Description', style: 'tableheader1', Field: 'Desc', alignment: 'left', line: true },
398
+ // { text: 'Batches', style: 'tableheader1', Field: 'Batches', alignment: 'left' },
399
+ // { text: 'Ex.Dt', style: 'tableheader1', Field: 'ExDate', alignment: 'left' },
400
+ // { text: 'Qty', style: 'tableheader1', Field: 'Qty', alignment: 'right' },
401
+ // { text: 'Price', style: 'tableheader1', Field: 'UnPr', alignment: 'right' },
402
+ // { text: 'Line Total', style: 'tableheader1', Field: 'LineTotal', alignment: 'right' }]];
403
+ // }
404
+ return HeadingNames;
405
+ }
406
+
407
+ }
@@ -0,0 +1,238 @@
1
+
2
+ import { differenceInYears } from 'date-fns';
3
+ import { TrUtils } from '../../utils/tr-utils';
4
+ import { SharedPDFService } from '../../shared/shared-pdf.service';
5
+ import { MyDate } from '../../utils/my-date';
6
+
7
+ export class ConsultationFullPrintService {
8
+
9
+ static GetPrint(consultationData: any) {
10
+ if (TrUtils.IsNull(consultationData.Name)) {
11
+ consultationData.Name = '';
12
+ }
13
+ let dd: any = {
14
+ info: {
15
+ title: 'Consultation',
16
+ },
17
+ footer: SharedPDFService.FooterContent(consultationData),
18
+
19
+ header: function (currentPage: any, pageCount: any, pageSize: any) {
20
+ return { text: currentPage.toString() + ' of ' + pageCount, alignment: 'right', marginRight: 25, fontSize: 8, marginTop: 2 };
21
+ },
22
+ pageMargins: [35, 15, 15, 80],
23
+ pageSize: 'A4',
24
+ content: [
25
+ this.GetMainHeaderDetails(consultationData, consultationData.Entity, consultationData.HeaderName, consultationData.Image, consultationData.HColor, consultationData.AColor, null),
26
+ ],
27
+ styles: {
28
+ temp2header: {
29
+ fontSize: 15,
30
+ bold: true,
31
+ alignment: 'left',
32
+ // margin: [0, 10, 0, 0],
33
+ },
34
+ headerstyle: {
35
+ fontFamily: 'Calibri',
36
+ fontSize: 9
37
+ },
38
+ Sign: {
39
+ fontSize: 8,
40
+ margin: [0, 30, 0, 5]
41
+ },
42
+ forCompany: {
43
+ // margin: [0, 10, 30, 0],
44
+ marginRight: 5,
45
+ marginTop: 10,
46
+ fontSize: 9,
47
+ alignment: 'left'
48
+ },
49
+ tableheader: {
50
+ bold: true,
51
+ fontFamily: 'Calibri',
52
+ margin: [0, 1, 0, 5],
53
+ alignment: 'center'
54
+ },
55
+ tableheader1: {
56
+ bold: true,
57
+ fontFamily: 'Calibri',
58
+ margin: [0, 2, 0, 2],
59
+ alignment: 'center'
60
+ },
61
+ tableExample: {
62
+ fontSize: 9
63
+ },
64
+ ws_adrs_left: {
65
+ fontSize: 8,
66
+ alignment: 'left',
67
+ }
68
+ }
69
+
70
+ };
71
+ return dd;
72
+ }
73
+
74
+ static GetMainHeaderDetails(CnstData: any, Entity: any, HeaderName: any, Image: any, HColor: any, AColor: any, text: any) {
75
+ return [
76
+ this.GetHeaderBasedOnCondition(CnstData, Entity, HeaderName, Image, HColor, AColor, text),
77
+
78
+ SharedPDFService.HeaderAfterLine1(),
79
+ {
80
+ columns: [{
81
+ stack: [{ text: CnstData.Pat.Name, fontSize: 10, marginTop: 5, bold:true },
82
+ { text: CnstData.Pat.Code + ' | ' + this.DifferenceInYears(CnstData.Pat.DOB, Entity.User.TZ) + ' | ' + CnstData.Pat.Sex + this.GetPhoneNumber(CnstData?.Pat?.Ph), fontSize: 10, marginBottom: 5 }]
83
+ },
84
+ {
85
+ stack: [
86
+ { text: this.GetCnsltDate(CnstData, Entity.User), style: ['headerstyle'] }], marginTop: 5, width: 120
87
+ }
88
+ ]
89
+ }
90
+
91
+
92
+ ];
93
+ }
94
+
95
+ static GetCnsltDate(CnstData: any, User: any) {
96
+ if (!TrUtils.IsNull(CnstData.ClDate)) {
97
+ return MyDate.GetWeekDateAndTime(CnstData.ClDate, User.TZ);
98
+ } else {
99
+ return MyDate.GetWeekDateAndTime(CnstData.CrDate, User.TZ);
100
+ }
101
+ }
102
+
103
+ static GetHeaderBasedOnCondition(CnstData: any, Entity: any, HeaderName: any, Image: any, HColor: any, AColor: any, text: any) {
104
+ if (Entity.Header === 2) {
105
+ return {
106
+ columns: [
107
+ SharedPDFService.GetConsultationMainHeader(Entity, null, AColor, HColor, text),
108
+ {stack:[{ text: CnstData?.Doc?.Sltn+' '+CnstData?.Doc?.Name, fontSize: 15, bold:true, alignment: 'right' },
109
+ { text: CnstData?.Doc?.Intro1, fontSize: 9, alignment: 'right' },
110
+ { text: CnstData?.Doc?.Intro2, fontSize: 9, alignment: 'right' },
111
+ { text: CnstData?.Doc?.Intro3, fontSize: 9, alignment: 'right' },
112
+ { text: 'Registration ID- '+CnstData?.Doc?.CounReg, fontSize: 9, alignment: 'right',marginBottom:5 }], width: '40%', marginTop:15}
113
+ ]
114
+ };
115
+ } else {
116
+ return { columns: [SharedPDFService.GetImage(Image,Entity.PrLogo), {stack:[{ text: CnstData?.Doc?.Sltn+' '+CnstData?.Doc?.Name, fontSize: 15, bold:true, alignment: 'right' },
117
+ { text: CnstData?.Doc?.Intro1, fontSize: 9, alignment: 'right' },
118
+ { text: CnstData?.Doc?.Intro2, fontSize: 9, alignment: 'right' },
119
+ { text: CnstData?.Doc?.Intro3, fontSize: 9, alignment: 'right' },
120
+ { text: 'Registration ID- '+CnstData?.Doc?.CounReg, fontSize: 9, alignment: 'right',marginBottom:5 }], marginTop:25}
121
+ ] };
122
+
123
+ }
124
+ }
125
+
126
+ static GetPhoneNumber(phone: any) {
127
+ if (!TrUtils.IsNull(phone)) {
128
+ return ' | ' + phone;
129
+ } else {
130
+ return '';
131
+ }
132
+ }
133
+
134
+ static getDoctorName(DocName: any) {
135
+ if (!TrUtils.IsNull(DocName)) {
136
+ return DocName;
137
+ } else {
138
+ return '';
139
+ }
140
+ }
141
+
142
+ static GetPhone(Phone: any) {
143
+ if (TrUtils.IsNull(Phone)) {
144
+ return '';
145
+ } else {
146
+ return Phone;
147
+ }
148
+ }
149
+
150
+ static DifferenceInYears(DOB: any, TZ: any) {
151
+ if (TrUtils.IsNull(DOB)) {
152
+ return 'DOB Not Specified';
153
+ }
154
+ const result = differenceInYears(MyDate.GetDateTimeNowInUTC(TZ), new Date(DOB));
155
+ return result + ' Years';
156
+ }
157
+
158
+ static HeaderLayOut() {
159
+ return {
160
+ hLineWidth: function (i:any, node:any) {
161
+
162
+ return (i === 0 || i === 1 || i === node.table.body.length) ? 1 : 0;
163
+ },
164
+ vLineWidth: function (i:any, node:any) {
165
+ return (i === 0 || i === node.table.widths.length) ? 1 : 0;
166
+ },
167
+ // hLineStyle: function (i, node) {
168
+ // return (i === 0 || i === 1) ? { dash: { length: 5, space: 5 } } : null;
169
+ // },
170
+ hLineColor: function (i: any, node: any) {
171
+ return 'gray';
172
+ },
173
+ vLineColor: function (i: any, node: any) {
174
+ return 'gray';
175
+ },
176
+ };
177
+ }
178
+
179
+ static GetHeaderInfo(consultationData: any) {
180
+ let TaxInfo: any = [];
181
+ if (!TrUtils.IsEmpty(consultationData.Entity.GSTIN)) {
182
+ TaxInfo.push({ text: 'GSTIN : ' + consultationData.Entity.GSTIN, marginTop: 2, marginLeft: 5, alignment: 'left', fontSize: 9, width: 'auto' },
183
+ );
184
+ }
185
+ if (!TrUtils.IsEmpty(consultationData.Entity.DLNo)) {
186
+ TaxInfo.push({ text: 'D.L.NO : ' + consultationData.Entity.DLNo, marginTop: 2, marginLeft: 5, alignment: 'left', fontSize: 9, width: '*' },
187
+ );
188
+ }
189
+
190
+ TaxInfo.push(this.GetBillofSupplyName(consultationData.Settings));
191
+ return TaxInfo;
192
+ }
193
+
194
+ static finalReturnTotal(consultationData: any) {
195
+ // if (!TrUtils.IsFixedZero(consultationData.CustRetRoundedTotal)) {
196
+ // return 'Returns Total : ' + consultationData.CustRetRoundedTotal
197
+ // } else {
198
+ return '';
199
+ // }
200
+ }
201
+
202
+ static GetBillofSupplyName(Settings: any) {
203
+ return { text: Settings?.Tax === 'BS' ? 'Bill of Supply' : null, alignment: 'right', marginRight: 5, marginTop: 2, marginBottom: 3, fontSize: 9, width: 'auto' };
204
+ }
205
+
206
+ static GetSignatures(CName: any, For: any, Type: any) {
207
+ return {
208
+ columns: [{
209
+ stack: [
210
+ this.CompanyName(CName),
211
+ // { columns: [this.Authorizedsignature(), this.SurveyorSignature(For, Type), this.CustomerSignature()] }
212
+ ]
213
+ }],
214
+ };
215
+ }
216
+
217
+ static CompanyName(CName: any) {
218
+ return {
219
+ style: 'forCompany',
220
+ text: ['For ', { text: CName, }],
221
+ };
222
+ }
223
+
224
+ static Authorizedsignature() {
225
+ return {
226
+ style: 'Sign',
227
+ text: ['Authorized Signatory'],
228
+ };
229
+ }
230
+
231
+ static CustomerSignature() {
232
+ return {
233
+ style: 'Sign',
234
+ text: ['Customer Signature'], marginLeft: 90
235
+ };
236
+ }
237
+
238
+ }