shareneus 1.4.73 → 1.4.75
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.
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.HCInvoiceprintService = void 0;
|
|
4
|
-
const tr_utils_1 = require("../../utils/tr-utils");
|
|
5
4
|
const shared_pdf_service_1 = require("../../shared/shared-pdf.service");
|
|
6
5
|
const shared_print_service_1 = require("../../shared/shared-print.service");
|
|
6
|
+
const tr_utils_1 = require("../../utils/tr-utils");
|
|
7
7
|
class HCInvoiceprintService {
|
|
8
8
|
constructor() {
|
|
9
9
|
this.FontSize = 8;
|
|
@@ -277,7 +277,7 @@ class HCInvoiceprintService {
|
|
|
277
277
|
Parts.forEach((part) => {
|
|
278
278
|
var dataRow = [];
|
|
279
279
|
columns.forEach((column) => {
|
|
280
|
-
if ((!tr_utils_1.TrUtils.
|
|
280
|
+
if ((!tr_utils_1.TrUtils.IsNull(part[column.Field]))
|
|
281
281
|
|| (column.text === 'Line Total')) {
|
|
282
282
|
// if (part[column.Field] === 'Medications') {
|
|
283
283
|
// dataRow.push({ text: part[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
|
|
@@ -288,13 +288,13 @@ class HCInvoiceprintService {
|
|
|
288
288
|
dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
|
|
289
289
|
}
|
|
290
290
|
else {
|
|
291
|
-
if (column.text === 'Line Total' || column.Field === 'UnPr' || column.Field === 'QtyAndUoM'
|
|
291
|
+
if (column.text === 'Line Total' || column.Field === 'UnPr' || column.Field === 'HSN' || column.Field === 'QtyAndUoM'
|
|
292
292
|
|| column.text === 'Tax' || column.Field === 'Disc' || column.Field === 'Perc' || column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt'
|
|
293
293
|
|| column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc') {
|
|
294
294
|
if (column.Field === 'Disc') {
|
|
295
295
|
if (column.type === 'percentage') {
|
|
296
296
|
if (!tr_utils_1.TrUtils.IsEmpty(part[column.Field])) {
|
|
297
|
-
dataRow.push({ text: part[column.Field].toString(), noWrap: true });
|
|
297
|
+
dataRow.push({ text: part[column.Field].toString(), noWrap: true, alignment: 'right' });
|
|
298
298
|
}
|
|
299
299
|
else {
|
|
300
300
|
dataRow.push({ text: '', noWrap: true });
|
|
@@ -302,7 +302,7 @@ class HCInvoiceprintService {
|
|
|
302
302
|
}
|
|
303
303
|
else {
|
|
304
304
|
if (!tr_utils_1.TrUtils.IsNull(part[column.Field])) {
|
|
305
|
-
dataRow.push({ text: part[column.Field].toString(), noWrap: true });
|
|
305
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(part[column.Field]).toString(), alignment: 'right', noWrap: true });
|
|
306
306
|
}
|
|
307
307
|
else {
|
|
308
308
|
dataRow.push({ text: '', noWrap: true });
|
|
@@ -399,7 +399,7 @@ class HCInvoiceprintService {
|
|
|
399
399
|
Labor.forEach((Ops) => {
|
|
400
400
|
var dataRow = [];
|
|
401
401
|
columns.forEach((column) => {
|
|
402
|
-
if ((!tr_utils_1.TrUtils.
|
|
402
|
+
if ((!tr_utils_1.TrUtils.IsNull(Ops[column.Field]))
|
|
403
403
|
|| (column.text === 'Line Total')) {
|
|
404
404
|
if (Ops[column.Field] === 'Procedures') {
|
|
405
405
|
dataRow.push({ text: Ops[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
|
|
@@ -411,13 +411,13 @@ class HCInvoiceprintService {
|
|
|
411
411
|
dataRow.push({ text: Ops[column.Field].toString(), alignment: 'center' });
|
|
412
412
|
}
|
|
413
413
|
else {
|
|
414
|
-
if (column.text === 'Line Total' || column.Field === 'Price' || column.text === 'Tax' || column.Field === 'UnPr'
|
|
414
|
+
if (column.text === 'Line Total' || column.Field === 'Price' || column.Field === 'HSN' || column.text === 'Tax' || column.Field === 'UnPr'
|
|
415
415
|
|| column.Field === 'QtyAndUoM' || column.Field === 'Disc' || column.Field === 'Perc' || column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt'
|
|
416
416
|
|| column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc') {
|
|
417
417
|
if (column.Field === 'Disc') {
|
|
418
418
|
if (column.type === 'percentage') {
|
|
419
419
|
if (!tr_utils_1.TrUtils.IsEmpty(Ops[column.Field])) {
|
|
420
|
-
dataRow.push({ text: Ops[column.Field].toString(), noWrap: true });
|
|
420
|
+
dataRow.push({ text: Ops[column.Field].toString(), alignment: 'right', noWrap: true });
|
|
421
421
|
}
|
|
422
422
|
else {
|
|
423
423
|
dataRow.push({ text: '', noWrap: true });
|
|
@@ -425,7 +425,7 @@ class HCInvoiceprintService {
|
|
|
425
425
|
}
|
|
426
426
|
else {
|
|
427
427
|
if (!tr_utils_1.TrUtils.IsNull(Ops[column.Field])) {
|
|
428
|
-
dataRow.push({ text: Ops[column.Field].toString(), noWrap: true });
|
|
428
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(Ops[column.Field]).toString(), alignment: 'right', noWrap: true });
|
|
429
429
|
}
|
|
430
430
|
else {
|
|
431
431
|
dataRow.push({ text: '', noWrap: true });
|
|
@@ -642,7 +642,7 @@ class HCInvoiceprintService {
|
|
|
642
642
|
Parts.forEach((part) => {
|
|
643
643
|
var dataRow = [];
|
|
644
644
|
columns.forEach((column) => {
|
|
645
|
-
if (!tr_utils_1.TrUtils.
|
|
645
|
+
if (!tr_utils_1.TrUtils.IsNull(part[column.Field])
|
|
646
646
|
|| column.text === 'Line Total') {
|
|
647
647
|
// if (part[column.Field] === 'Medications') {
|
|
648
648
|
// dataRow.push({ text: part[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
|
|
@@ -704,7 +704,7 @@ class HCInvoiceprintService {
|
|
|
704
704
|
Ops.forEach((labor) => {
|
|
705
705
|
var dataRow = [];
|
|
706
706
|
columns.forEach((column) => {
|
|
707
|
-
if (!tr_utils_1.TrUtils.
|
|
707
|
+
if (!tr_utils_1.TrUtils.IsNull(labor[column.Field])
|
|
708
708
|
|| column.text === 'Line Total') {
|
|
709
709
|
if (labor[column.Field] === 'Procedures') {
|
|
710
710
|
dataRow.push({ text: labor[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
|
|
@@ -796,7 +796,7 @@ class HCInvoiceprintService {
|
|
|
796
796
|
body: [[{ text: 'Paid : ' + tr_utils_1.TrUtils.FixPriceValue(Paid, DecimalsNumber) },
|
|
797
797
|
{ text: 'Due : ' + tr_utils_1.TrUtils.FixPriceValue(Due, DecimalsNumber) }]]
|
|
798
798
|
},
|
|
799
|
-
layout: shared_pdf_service_1.SharedPDFService.
|
|
799
|
+
layout: shared_pdf_service_1.SharedPDFService.LayOutLineStyle(),
|
|
800
800
|
};
|
|
801
801
|
}
|
|
802
802
|
else {
|
|
@@ -2,8 +2,8 @@ export declare class InvoicePortraitPrintService {
|
|
|
2
2
|
static TableHeaders: number;
|
|
3
3
|
static GetPrint(InvoicePDFData: any, size: string, printOptions: any, moreDiscDetails: boolean): any;
|
|
4
4
|
static LayOutStyle(): {
|
|
5
|
-
hLineColor: (i: any, node: any) => "
|
|
6
|
-
vLineColor: (i: any, node: any) => "
|
|
5
|
+
hLineColor: (i: any, node: any) => "white" | "gray";
|
|
6
|
+
vLineColor: (i: any, node: any) => "white" | "gray";
|
|
7
7
|
};
|
|
8
8
|
static InvoiceDueStatus(Type: any, Paid: any, Due: any, Status: any, isCounter: boolean, DecimalsNumber: number): any;
|
|
9
9
|
static GetMainHeaderInfo(InvoicePDFData: any): {
|
|
@@ -601,17 +601,23 @@ export declare class SharedPDFService {
|
|
|
601
601
|
}[][];
|
|
602
602
|
};
|
|
603
603
|
layout: {
|
|
604
|
-
hLineColor: (i: any, node: any) => "
|
|
605
|
-
vLineColor: (i: any, node: any) => "
|
|
604
|
+
hLineColor: (i: any, node: any) => "white" | "gray";
|
|
605
|
+
vLineColor: (i: any, node: any) => "white" | "gray";
|
|
606
606
|
};
|
|
607
607
|
};
|
|
608
608
|
static LayOutStyle(): {
|
|
609
|
-
hLineColor: (i: any, node: any) => "
|
|
610
|
-
vLineColor: (i: any, node: any) => "
|
|
609
|
+
hLineColor: (i: any, node: any) => "white" | "gray";
|
|
610
|
+
vLineColor: (i: any, node: any) => "white" | "gray";
|
|
611
|
+
};
|
|
612
|
+
static LayOutLineStyle(): {
|
|
613
|
+
hLineWidth: (i: any, node: any) => number;
|
|
614
|
+
vLineWidth: (i: any, node: any) => number;
|
|
615
|
+
hLineColor: (i: any, node: any) => "lightgray" | "white";
|
|
616
|
+
vLineColor: (i: any, node: any) => "lightgray" | "white";
|
|
611
617
|
};
|
|
612
618
|
static LayOutStyle1(): {
|
|
613
|
-
hLineColor: (i: any, node: any) => "
|
|
614
|
-
vLineColor: (i: any, node: any) => "
|
|
619
|
+
hLineColor: (i: any, node: any) => "white" | "gray";
|
|
620
|
+
vLineColor: (i: any, node: any) => "white" | "gray";
|
|
615
621
|
};
|
|
616
622
|
static GetImage(Image: any, PrLogo: boolean): {
|
|
617
623
|
image: any;
|
|
@@ -2128,7 +2128,7 @@ class SharedPDFService {
|
|
|
2128
2128
|
body: [[{ text: 'Paid : ' + tr_utils_1.TrUtils.FixPriceValue(Paid, DecimalsNumber) },
|
|
2129
2129
|
{ text: 'Due : ' + tr_utils_1.TrUtils.FixPriceValue(Due, DecimalsNumber) }]]
|
|
2130
2130
|
},
|
|
2131
|
-
layout: this.
|
|
2131
|
+
layout: this.LayOutLineStyle(),
|
|
2132
2132
|
};
|
|
2133
2133
|
}
|
|
2134
2134
|
else {
|
|
@@ -2163,6 +2163,22 @@ class SharedPDFService {
|
|
|
2163
2163
|
}
|
|
2164
2164
|
};
|
|
2165
2165
|
}
|
|
2166
|
+
static LayOutLineStyle() {
|
|
2167
|
+
return {
|
|
2168
|
+
hLineWidth: function (i, node) {
|
|
2169
|
+
return (i === 0 || i === node.table.body.length) ? 0.7 : 0.7;
|
|
2170
|
+
},
|
|
2171
|
+
vLineWidth: function (i, node) {
|
|
2172
|
+
return (i === 0 || i === node.table.widths.length) ? 0.7 : 0.7;
|
|
2173
|
+
},
|
|
2174
|
+
hLineColor: function (i, node) {
|
|
2175
|
+
return (i === 0 || i === 1 || i === 2 || i === node.table.body.length) ? 'lightgray' : 'white';
|
|
2176
|
+
},
|
|
2177
|
+
vLineColor: function (i, node) {
|
|
2178
|
+
return (i === 0 || i === node.table.widths.length) ? 'lightgray' : 'white';
|
|
2179
|
+
}
|
|
2180
|
+
};
|
|
2181
|
+
}
|
|
2166
2182
|
//Not use this function any where
|
|
2167
2183
|
static LayOutStyle1() {
|
|
2168
2184
|
return {
|
|
@@ -2574,10 +2590,10 @@ class SharedPDFService {
|
|
|
2574
2590
|
var fraction = Math.round(this.frac(value) * 100);
|
|
2575
2591
|
let f_text = '';
|
|
2576
2592
|
if (fraction > 0) {
|
|
2577
|
-
let paisa = (this.convert_number(fraction) === 'ONE') ? '
|
|
2578
|
-
f_text = '
|
|
2593
|
+
let paisa = (this.convert_number(fraction) === 'ONE') ? 'Paisa' : ' Paise';
|
|
2594
|
+
f_text = 'And ' + this.convert_number(fraction) + paisa;
|
|
2579
2595
|
}
|
|
2580
|
-
return this.convert_number(value) + '
|
|
2596
|
+
return this.convert_number(value) + ' Rupee(s) ' + f_text + ' Only';
|
|
2581
2597
|
}
|
|
2582
2598
|
static frac(f) {
|
|
2583
2599
|
return f % 1;
|
|
@@ -2598,25 +2614,25 @@ class SharedPDFService {
|
|
|
2598
2614
|
var one = Math.floor(number % 10);
|
|
2599
2615
|
var res = '';
|
|
2600
2616
|
if (Gn > 0) {
|
|
2601
|
-
res += (this.convert_number(Gn) + '
|
|
2617
|
+
res += (this.convert_number(Gn) + ' Crore');
|
|
2602
2618
|
}
|
|
2603
2619
|
if (kn > 0) {
|
|
2604
2620
|
res += (((res === '') ? '' : ' ') +
|
|
2605
|
-
this.convert_number(kn) + '
|
|
2621
|
+
this.convert_number(kn) + ' Lakh');
|
|
2606
2622
|
}
|
|
2607
2623
|
if (Hn > 0) {
|
|
2608
2624
|
res += (((res === '') ? '' : ' ') +
|
|
2609
|
-
this.convert_number(Hn) + '
|
|
2625
|
+
this.convert_number(Hn) + ' Thousand');
|
|
2610
2626
|
}
|
|
2611
2627
|
if (Dn) {
|
|
2612
2628
|
res += (((res === '') ? '' : ' ') +
|
|
2613
|
-
this.convert_number(Dn) + '
|
|
2629
|
+
this.convert_number(Dn) + ' Hundred');
|
|
2614
2630
|
}
|
|
2615
|
-
var ones = Array('', '
|
|
2616
|
-
var tens = Array('', '', '
|
|
2631
|
+
var ones = Array('', 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Eleven', 'Twelve', 'Thirteen', 'Fourteen', 'Fifteen', 'Sixteen', 'Seventeen', 'Eighteen', 'Nineteen');
|
|
2632
|
+
var tens = Array('', '', 'Twenty', 'Thirty', 'Forty', 'Fifty', 'Sixty', 'Seventy', 'Eighty', 'Ninety');
|
|
2617
2633
|
if (tn > 0 || one > 0) {
|
|
2618
2634
|
if (!(res === '')) {
|
|
2619
|
-
res += '
|
|
2635
|
+
res += ' And ';
|
|
2620
2636
|
}
|
|
2621
2637
|
if (tn < 2) {
|
|
2622
2638
|
res += ones[tn * 10 + one];
|
|
@@ -2629,7 +2645,7 @@ class SharedPDFService {
|
|
|
2629
2645
|
}
|
|
2630
2646
|
}
|
|
2631
2647
|
if (res === '') {
|
|
2632
|
-
res = '
|
|
2648
|
+
res = 'Zero';
|
|
2633
2649
|
}
|
|
2634
2650
|
return res;
|
|
2635
2651
|
}
|