fix: report in monalisa

This commit is contained in:
kur0nek-o 2024-04-24 15:46:21 +07:00
parent b6d289a8ca
commit 54c4d12c4f
25 changed files with 385 additions and 192 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@ -171,13 +171,26 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
const month = new Date().toLocaleString('id-ID', { month: 'long' }) const month = new Date().toLocaleString('id-ID', { month: 'long' })
const year = new Date().getFullYear() const year = new Date().getFullYear()
const data = formatData(rawData, reportMeta) const data = formatData(rawData, reportMeta)
const doc = new jsPDF({ const doc = new jsPDF({
orientation: 'landscape' orientation: 'landscape'
}) })
const img = new Image()
img.src = '/assets/images/pln-icon.png'
doc.addImage(img, 'png', 13.5, 9, 9.5, 13)
autoTable(doc, { autoTable(doc, {
head: [ head: [
['PT. PLN(Persero)', '', ''], ['PT. PLN(Persero)', '', ''],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
],
[ [
{ content: 'UNIT INDUK', styles: { cellWidth: 40 } }, { content: 'UNIT INDUK', styles: { cellWidth: 40 } },
{ content: ':', styles: { cellWidth: 1 } }, { content: ':', styles: { cellWidth: 1 } },
@ -198,13 +211,6 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
reportMeta.ulp reportMeta.ulp
? reportMeta.ulp.name.toUpperCase() ? reportMeta.ulp.name.toUpperCase()
: 'Semua Unit Layanan Pelanggan'.toUpperCase() : 'Semua Unit Layanan Pelanggan'.toUpperCase()
],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
] ]
], ],
styles: { styles: {
@ -214,7 +220,10 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
fontStyle: 'bold' fontStyle: 'bold'
}, },
theme: 'plain', theme: 'plain',
startY: 10 startY: 10,
margin: {
left: 25
}
}) })
autoTable(doc, { autoTable(doc, {

View File

@ -162,9 +162,21 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
orientation: 'landscape' orientation: 'landscape'
}) })
const img = new Image()
img.src = '/assets/images/pln-icon.png'
doc.addImage(img, 'png', 13.5, 9, 9.5, 13)
autoTable(doc, { autoTable(doc, {
head: [ head: [
['PT. PLN(Persero)', '', ''], ['PT. PLN(Persero)', '', ''],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
],
[ [
{ content: 'UNIT INDUK', styles: { cellWidth: 40 } }, { content: 'UNIT INDUK', styles: { cellWidth: 40 } },
{ content: ':', styles: { cellWidth: 1 } }, { content: ':', styles: { cellWidth: 1 } },
@ -185,13 +197,6 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
reportMeta.ulp reportMeta.ulp
? reportMeta.ulp.name.toUpperCase() ? reportMeta.ulp.name.toUpperCase()
: 'Semua Unit Layanan Pelanggan'.toUpperCase() : 'Semua Unit Layanan Pelanggan'.toUpperCase()
],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
] ]
], ],
styles: { styles: {
@ -201,7 +206,10 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
fontStyle: 'bold' fontStyle: 'bold'
}, },
theme: 'plain', theme: 'plain',
startY: 10 startY: 10,
margin: {
left: 25
}
}) })
autoTable(doc, { autoTable(doc, {

View File

@ -133,9 +133,21 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
orientation: 'landscape' orientation: 'landscape'
}) })
const img = new Image()
img.src = '/assets/images/pln-icon.png'
doc.addImage(img, 'png', 13.5, 9, 9.5, 13)
autoTable(doc, { autoTable(doc, {
head: [ head: [
['PT. PLN(Persero)', '', ''], ['PT. PLN(Persero)', '', ''],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
],
[ [
{ content: 'UNIT INDUK', styles: { cellWidth: 40 } }, { content: 'UNIT INDUK', styles: { cellWidth: 40 } },
{ content: ':', styles: { cellWidth: 1 } }, { content: ':', styles: { cellWidth: 1 } },
@ -156,13 +168,6 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
reportMeta.ulp reportMeta.ulp
? reportMeta.ulp.name.toUpperCase() ? reportMeta.ulp.name.toUpperCase()
: 'Semua Unit Layanan Pelanggan'.toUpperCase() : 'Semua Unit Layanan Pelanggan'.toUpperCase()
],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
] ]
], ],
styles: { styles: {
@ -172,7 +177,10 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
fontStyle: 'bold' fontStyle: 'bold'
}, },
theme: 'plain', theme: 'plain',
startY: 10 startY: 10,
margin: {
left: 25
}
}) })
autoTable(doc, { autoTable(doc, {

View File

@ -66,9 +66,21 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
orientation: 'landscape' orientation: 'landscape'
}) })
const img = new Image()
img.src = '/assets/images/pln-icon.png'
doc.addImage(img, 'png', 13.5, 9, 9.5, 13)
autoTable(doc, { autoTable(doc, {
head: [ head: [
['PT. PLN(Persero)', '', ''], ['PT. PLN(Persero)', '', ''],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
],
[ [
{ content: 'UNIT INDUK', styles: { cellWidth: 40 } }, { content: 'UNIT INDUK', styles: { cellWidth: 40 } },
{ content: ':', styles: { cellWidth: 1 } }, { content: ':', styles: { cellWidth: 1 } },
@ -89,13 +101,6 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
reportMeta.ulp reportMeta.ulp
? reportMeta.ulp.name.toUpperCase() ? reportMeta.ulp.name.toUpperCase()
: 'Semua Unit Layanan Pelanggan'.toUpperCase() : 'Semua Unit Layanan Pelanggan'.toUpperCase()
],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
] ]
], ],
styles: { styles: {
@ -105,7 +110,10 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
fontStyle: 'bold' fontStyle: 'bold'
}, },
theme: 'plain', theme: 'plain',
startY: 10 startY: 10,
margin: {
left: 25
}
}) })
autoTable(doc, { autoTable(doc, {

View File

@ -191,9 +191,21 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
orientation: 'landscape' orientation: 'landscape'
}) })
const img = new Image()
img.src = '/assets/images/pln-icon.png'
doc.addImage(img, 'png', 13.5, 9, 9.5, 13)
autoTable(doc, { autoTable(doc, {
head: [ head: [
['PT. PLN(Persero)', '', ''], ['PT. PLN(Persero)', '', ''],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
],
[ [
{ content: 'UNIT INDUK', styles: { cellWidth: 40 } }, { content: 'UNIT INDUK', styles: { cellWidth: 40 } },
{ content: ':', styles: { cellWidth: 1 } }, { content: ':', styles: { cellWidth: 1 } },
@ -214,13 +226,6 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
reportMeta.ulp reportMeta.ulp
? reportMeta.ulp.name.toUpperCase() ? reportMeta.ulp.name.toUpperCase()
: 'Semua Unit Layanan Pelanggan'.toUpperCase() : 'Semua Unit Layanan Pelanggan'.toUpperCase()
],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
] ]
], ],
styles: { styles: {
@ -230,7 +235,10 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
fontStyle: 'bold' fontStyle: 'bold'
}, },
theme: 'plain', theme: 'plain',
startY: 10 startY: 10,
margin: {
left: 25
}
}) })
autoTable(doc, { autoTable(doc, {

View File

@ -162,9 +162,21 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
orientation: 'landscape' orientation: 'landscape'
}) })
const img = new Image()
img.src = '/assets/images/pln-icon.png'
doc.addImage(img, 'png', 13.5, 9, 9.5, 13)
autoTable(doc, { autoTable(doc, {
head: [ head: [
['PT. PLN(Persero)', '', ''], ['PT. PLN(Persero)', '', ''],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
],
[ [
{ content: 'UNIT INDUK', styles: { cellWidth: 40 } }, { content: 'UNIT INDUK', styles: { cellWidth: 40 } },
{ content: ':', styles: { cellWidth: 1 } }, { content: ':', styles: { cellWidth: 1 } },
@ -185,13 +197,6 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
reportMeta.ulp reportMeta.ulp
? reportMeta.ulp.name.toUpperCase() ? reportMeta.ulp.name.toUpperCase()
: 'Semua Unit Layanan Pelanggan'.toUpperCase() : 'Semua Unit Layanan Pelanggan'.toUpperCase()
],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
] ]
], ],
styles: { styles: {
@ -201,7 +206,10 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
fontStyle: 'bold' fontStyle: 'bold'
}, },
theme: 'plain', theme: 'plain',
startY: 10 startY: 10,
margin: {
left: 25
}
}) })
autoTable(doc, { autoTable(doc, {

View File

@ -162,9 +162,21 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
orientation: 'landscape' orientation: 'landscape'
}) })
const img = new Image()
img.src = '/assets/images/pln-icon.png'
doc.addImage(img, 'png', 13.5, 9, 9.5, 13)
autoTable(doc, { autoTable(doc, {
head: [ head: [
['PT. PLN(Persero)', '', ''], ['PT. PLN(Persero)', '', ''],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
],
[ [
{ content: 'UNIT INDUK', styles: { cellWidth: 40 } }, { content: 'UNIT INDUK', styles: { cellWidth: 40 } },
{ content: ':', styles: { cellWidth: 1 } }, { content: ':', styles: { cellWidth: 1 } },
@ -185,13 +197,6 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
reportMeta.ulp reportMeta.ulp
? reportMeta.ulp.name.toUpperCase() ? reportMeta.ulp.name.toUpperCase()
: 'Semua Unit Layanan Pelanggan'.toUpperCase() : 'Semua Unit Layanan Pelanggan'.toUpperCase()
],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
] ]
], ],
styles: { styles: {
@ -201,7 +206,10 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
fontStyle: 'bold' fontStyle: 'bold'
}, },
theme: 'plain', theme: 'plain',
startY: 10 startY: 10,
margin: {
left: 25
}
}) })
autoTable(doc, { autoTable(doc, {

View File

@ -173,9 +173,21 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
orientation: 'landscape' orientation: 'landscape'
}) })
const img = new Image()
img.src = '/assets/images/pln-icon.png'
doc.addImage(img, 'png', 13.5, 9, 9.5, 13)
autoTable(doc, { autoTable(doc, {
head: [ head: [
['PT. PLN(Persero)', '', ''], ['PT. PLN(Persero)', '', ''],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
],
[ [
{ content: 'UNIT INDUK', styles: { cellWidth: 40 } }, { content: 'UNIT INDUK', styles: { cellWidth: 40 } },
{ content: ':', styles: { cellWidth: 1 } }, { content: ':', styles: { cellWidth: 1 } },
@ -196,13 +208,6 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
reportMeta.ulp reportMeta.ulp
? reportMeta.ulp.name.toUpperCase() ? reportMeta.ulp.name.toUpperCase()
: 'Semua Unit Layanan Pelanggan'.toUpperCase() : 'Semua Unit Layanan Pelanggan'.toUpperCase()
],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
] ]
], ],
styles: { styles: {
@ -212,7 +217,10 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
fontStyle: 'bold' fontStyle: 'bold'
}, },
theme: 'plain', theme: 'plain',
startY: 10 startY: 10,
margin: {
left: 25
}
}) })
autoTable(doc, { autoTable(doc, {

View File

@ -173,9 +173,21 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
orientation: 'landscape' orientation: 'landscape'
}) })
const img = new Image()
img.src = '/assets/images/pln-icon.png'
doc.addImage(img, 'png', 13.5, 9, 9.5, 13)
autoTable(doc, { autoTable(doc, {
head: [ head: [
['PT. PLN(Persero)', '', ''], ['PT. PLN(Persero)', '', ''],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
],
[ [
{ content: 'UNIT INDUK', styles: { cellWidth: 40 } }, { content: 'UNIT INDUK', styles: { cellWidth: 40 } },
{ content: ':', styles: { cellWidth: 1 } }, { content: ':', styles: { cellWidth: 1 } },
@ -196,13 +208,6 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
reportMeta.ulp reportMeta.ulp
? reportMeta.ulp.name.toUpperCase() ? reportMeta.ulp.name.toUpperCase()
: 'Semua Unit Layanan Pelanggan'.toUpperCase() : 'Semua Unit Layanan Pelanggan'.toUpperCase()
],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
] ]
], ],
styles: { styles: {
@ -212,7 +217,10 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
fontStyle: 'bold' fontStyle: 'bold'
}, },
theme: 'plain', theme: 'plain',
startY: 10 startY: 10,
margin: {
left: 25
}
}) })
autoTable(doc, { autoTable(doc, {

View File

@ -53,9 +53,21 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
orientation: 'landscape' orientation: 'landscape'
}) })
const img = new Image()
img.src = '/assets/images/pln-icon.png'
doc.addImage(img, 'png', 13.5, 9, 9.5, 13)
autoTable(doc, { autoTable(doc, {
head: [ head: [
['PT. PLN(Persero)', '', ''], ['PT. PLN(Persero)', '', ''],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
],
[ [
{ content: 'UNIT INDUK', styles: { cellWidth: 40 } }, { content: 'UNIT INDUK', styles: { cellWidth: 40 } },
{ content: ':', styles: { cellWidth: 1 } }, { content: ':', styles: { cellWidth: 1 } },
@ -76,13 +88,6 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
reportMeta.ulp reportMeta.ulp
? reportMeta.ulp.name.toUpperCase() ? reportMeta.ulp.name.toUpperCase()
: 'Semua Unit Layanan Pelanggan'.toUpperCase() : 'Semua Unit Layanan Pelanggan'.toUpperCase()
],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
] ]
], ],
styles: { styles: {
@ -92,7 +97,10 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
fontStyle: 'bold' fontStyle: 'bold'
}, },
theme: 'plain', theme: 'plain',
startY: 10 startY: 10,
margin: {
left: 25
}
}) })
autoTable(doc, { autoTable(doc, {

View File

@ -191,9 +191,21 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
orientation: 'landscape' orientation: 'landscape'
}) })
const img = new Image()
img.src = '/assets/images/pln-icon.png'
doc.addImage(img, 'png', 13.5, 9, 9.5, 13)
autoTable(doc, { autoTable(doc, {
head: [ head: [
['PT. PLN(Persero)', '', ''], ['PT. PLN(Persero)', '', ''],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
],
[ [
{ content: 'UNIT INDUK', styles: { cellWidth: 40 } }, { content: 'UNIT INDUK', styles: { cellWidth: 40 } },
{ content: ':', styles: { cellWidth: 1 } }, { content: ':', styles: { cellWidth: 1 } },
@ -214,13 +226,6 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
reportMeta.ulp reportMeta.ulp
? reportMeta.ulp.name.toUpperCase() ? reportMeta.ulp.name.toUpperCase()
: 'Semua Unit Layanan Pelanggan'.toUpperCase() : 'Semua Unit Layanan Pelanggan'.toUpperCase()
],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
] ]
], ],
styles: { styles: {
@ -230,7 +235,10 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
fontStyle: 'bold' fontStyle: 'bold'
}, },
theme: 'plain', theme: 'plain',
startY: 10 startY: 10,
margin: {
left: 25
}
}) })
autoTable(doc, { autoTable(doc, {

View File

@ -162,9 +162,21 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
orientation: 'landscape' orientation: 'landscape'
}) })
const img = new Image()
img.src = '/assets/images/pln-icon.png'
doc.addImage(img, 'png', 13.5, 9, 9.5, 13)
autoTable(doc, { autoTable(doc, {
head: [ head: [
['PT. PLN(Persero)', '', ''], ['PT. PLN(Persero)', '', ''],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
],
[ [
{ content: 'UNIT INDUK', styles: { cellWidth: 40 } }, { content: 'UNIT INDUK', styles: { cellWidth: 40 } },
{ content: ':', styles: { cellWidth: 1 } }, { content: ':', styles: { cellWidth: 1 } },
@ -185,13 +197,6 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
reportMeta.ulp reportMeta.ulp
? reportMeta.ulp.name.toUpperCase() ? reportMeta.ulp.name.toUpperCase()
: 'Semua Unit Layanan Pelanggan'.toUpperCase() : 'Semua Unit Layanan Pelanggan'.toUpperCase()
],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
] ]
], ],
styles: { styles: {
@ -201,7 +206,10 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
fontStyle: 'bold' fontStyle: 'bold'
}, },
theme: 'plain', theme: 'plain',
startY: 10 startY: 10,
margin: {
left: 25
}
}) })
autoTable(doc, { autoTable(doc, {

View File

@ -133,9 +133,21 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
orientation: 'landscape' orientation: 'landscape'
}) })
const img = new Image()
img.src = '/assets/images/pln-icon.png'
doc.addImage(img, 'png', 13.5, 9, 9.5, 13)
autoTable(doc, { autoTable(doc, {
head: [ head: [
['PT. PLN(Persero)', '', ''], ['PT. PLN(Persero)', '', ''],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
],
[ [
{ content: 'UNIT INDUK', styles: { cellWidth: 40 } }, { content: 'UNIT INDUK', styles: { cellWidth: 40 } },
{ content: ':', styles: { cellWidth: 1 } }, { content: ':', styles: { cellWidth: 1 } },
@ -156,13 +168,6 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
reportMeta.ulp reportMeta.ulp
? reportMeta.ulp.name.toUpperCase() ? reportMeta.ulp.name.toUpperCase()
: 'Semua Unit Layanan Pelanggan'.toUpperCase() : 'Semua Unit Layanan Pelanggan'.toUpperCase()
],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
] ]
], ],
styles: { styles: {
@ -172,7 +177,10 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
fontStyle: 'bold' fontStyle: 'bold'
}, },
theme: 'plain', theme: 'plain',
startY: 10 startY: 10,
margin: {
left: 25
}
}) })
autoTable(doc, { autoTable(doc, {

View File

@ -162,9 +162,21 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
orientation: 'landscape' orientation: 'landscape'
}) })
const img = new Image()
img.src = '/assets/images/pln-icon.png'
doc.addImage(img, 'png', 13.5, 9, 9.5, 13)
autoTable(doc, { autoTable(doc, {
head: [ head: [
['PT. PLN(Persero)', '', ''], ['PT. PLN(Persero)', '', ''],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
],
[ [
{ content: 'UNIT INDUK', styles: { cellWidth: 40 } }, { content: 'UNIT INDUK', styles: { cellWidth: 40 } },
{ content: ':', styles: { cellWidth: 1 } }, { content: ':', styles: { cellWidth: 1 } },
@ -185,13 +197,6 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
reportMeta.ulp reportMeta.ulp
? reportMeta.ulp.name.toUpperCase() ? reportMeta.ulp.name.toUpperCase()
: 'Semua Unit Layanan Pelanggan'.toUpperCase() : 'Semua Unit Layanan Pelanggan'.toUpperCase()
],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
] ]
], ],
styles: { styles: {
@ -201,7 +206,10 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
fontStyle: 'bold' fontStyle: 'bold'
}, },
theme: 'plain', theme: 'plain',
startY: 10 startY: 10,
margin: {
left: 25
}
}) })
autoTable(doc, { autoTable(doc, {

View File

@ -173,9 +173,21 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
orientation: 'landscape' orientation: 'landscape'
}) })
const img = new Image()
img.src = '/assets/images/pln-icon.png'
doc.addImage(img, 'png', 13.5, 9, 9.5, 13)
autoTable(doc, { autoTable(doc, {
head: [ head: [
['PT. PLN(Persero)', '', ''], ['PT. PLN(Persero)', '', ''],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
],
[ [
{ content: 'UNIT INDUK', styles: { cellWidth: 40 } }, { content: 'UNIT INDUK', styles: { cellWidth: 40 } },
{ content: ':', styles: { cellWidth: 1 } }, { content: ':', styles: { cellWidth: 1 } },
@ -196,13 +208,6 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
reportMeta.ulp reportMeta.ulp
? reportMeta.ulp.name.toUpperCase() ? reportMeta.ulp.name.toUpperCase()
: 'Semua Unit Layanan Pelanggan'.toUpperCase() : 'Semua Unit Layanan Pelanggan'.toUpperCase()
],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
] ]
], ],
styles: { styles: {
@ -212,7 +217,10 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
fontStyle: 'bold' fontStyle: 'bold'
}, },
theme: 'plain', theme: 'plain',
startY: 10 startY: 10,
margin: {
left: 25
}
}) })
autoTable(doc, { autoTable(doc, {

View File

@ -173,9 +173,21 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
orientation: 'landscape' orientation: 'landscape'
}) })
const img = new Image()
img.src = '/assets/images/pln-icon.png'
doc.addImage(img, 'png', 13.5, 9, 9.5, 13)
autoTable(doc, { autoTable(doc, {
head: [ head: [
['PT. PLN(Persero)', '', ''], ['PT. PLN(Persero)', '', ''],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
],
[ [
{ content: 'UNIT INDUK', styles: { cellWidth: 40 } }, { content: 'UNIT INDUK', styles: { cellWidth: 40 } },
{ content: ':', styles: { cellWidth: 1 } }, { content: ':', styles: { cellWidth: 1 } },
@ -196,13 +208,6 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
reportMeta.ulp reportMeta.ulp
? reportMeta.ulp.name.toUpperCase() ? reportMeta.ulp.name.toUpperCase()
: 'Semua Unit Layanan Pelanggan'.toUpperCase() : 'Semua Unit Layanan Pelanggan'.toUpperCase()
],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
] ]
], ],
styles: { styles: {
@ -212,7 +217,10 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
fontStyle: 'bold' fontStyle: 'bold'
}, },
theme: 'plain', theme: 'plain',
startY: 10 startY: 10,
margin: {
left: 25
}
}) })
autoTable(doc, { autoTable(doc, {

View File

@ -195,9 +195,21 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
orientation: 'landscape' orientation: 'landscape'
}) })
const img = new Image()
img.src = '/assets/images/pln-icon.png'
doc.addImage(img, 'png', 13.5, 9, 9.5, 13)
autoTable(doc, { autoTable(doc, {
head: [ head: [
['PT. PLN(Persero)', '', ''], ['PT. PLN(Persero)', '', ''],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
],
[ [
{ content: 'UNIT INDUK', styles: { cellWidth: 40 } }, { content: 'UNIT INDUK', styles: { cellWidth: 40 } },
{ content: ':', styles: { cellWidth: 1 } }, { content: ':', styles: { cellWidth: 1 } },
@ -218,13 +230,6 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
reportMeta.ulp reportMeta.ulp
? reportMeta.ulp.name.toUpperCase() ? reportMeta.ulp.name.toUpperCase()
: 'Semua Unit Layanan Pelanggan'.toUpperCase() : 'Semua Unit Layanan Pelanggan'.toUpperCase()
],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
] ]
], ],
styles: { styles: {
@ -234,7 +239,10 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
fontStyle: 'bold' fontStyle: 'bold'
}, },
theme: 'plain', theme: 'plain',
startY: 10 startY: 10,
margin: {
left: 25
}
}) })
autoTable(doc, { autoTable(doc, {

View File

@ -133,9 +133,21 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
orientation: 'landscape' orientation: 'landscape'
}) })
const img = new Image()
img.src = '/assets/images/pln-icon.png'
doc.addImage(img, 'png', 13.5, 9, 9.5, 13)
autoTable(doc, { autoTable(doc, {
head: [ head: [
['PT. PLN(Persero)', '', ''], ['PT. PLN(Persero)', '', ''],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
],
[ [
{ content: 'UNIT INDUK', styles: { cellWidth: 40 } }, { content: 'UNIT INDUK', styles: { cellWidth: 40 } },
{ content: ':', styles: { cellWidth: 1 } }, { content: ':', styles: { cellWidth: 1 } },
@ -156,13 +168,6 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
reportMeta.ulp reportMeta.ulp
? reportMeta.ulp.name.toUpperCase() ? reportMeta.ulp.name.toUpperCase()
: 'Semua Unit Layanan Pelanggan'.toUpperCase() : 'Semua Unit Layanan Pelanggan'.toUpperCase()
],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
] ]
], ],
styles: { styles: {
@ -172,7 +177,10 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
fontStyle: 'bold' fontStyle: 'bold'
}, },
theme: 'plain', theme: 'plain',
startY: 10 startY: 10,
margin: {
left: 25
}
}) })
autoTable(doc, { autoTable(doc, {

View File

@ -156,9 +156,21 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
orientation: 'landscape' orientation: 'landscape'
}) })
const img = new Image()
img.src = '/assets/images/pln-icon.png'
doc.addImage(img, 'png', 13.5, 9, 9.5, 13)
autoTable(doc, { autoTable(doc, {
head: [ head: [
['PT. PLN(Persero)', '', ''], ['PT. PLN(Persero)', '', ''],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
],
[ [
{ content: 'UNIT INDUK', styles: { cellWidth: 40 } }, { content: 'UNIT INDUK', styles: { cellWidth: 40 } },
{ content: ':', styles: { cellWidth: 1 } }, { content: ':', styles: { cellWidth: 1 } },
@ -179,13 +191,6 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
reportMeta.ulp reportMeta.ulp
? reportMeta.ulp.name.toUpperCase() ? reportMeta.ulp.name.toUpperCase()
: 'Semua Unit Layanan Pelanggan'.toUpperCase() : 'Semua Unit Layanan Pelanggan'.toUpperCase()
],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
] ]
], ],
styles: { styles: {
@ -195,7 +200,10 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
fontStyle: 'bold' fontStyle: 'bold'
}, },
theme: 'plain', theme: 'plain',
startY: 10 startY: 10,
margin: {
left: 25
}
}) })
autoTable(doc, { autoTable(doc, {

View File

@ -267,9 +267,21 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
orientation: 'landscape' orientation: 'landscape'
}) })
const img = new Image()
img.src = '/assets/images/pln-icon.png'
doc.addImage(img, 'png', 13.5, 9, 9.5, 13)
autoTable(doc, { autoTable(doc, {
head: [ head: [
['PT. PLN(Persero)', '', ''], ['PT. PLN(Persero)', '', ''],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
],
[ [
{ content: 'UNIT INDUK', styles: { cellWidth: 40 } }, { content: 'UNIT INDUK', styles: { cellWidth: 40 } },
{ content: ':', styles: { cellWidth: 1 } }, { content: ':', styles: { cellWidth: 1 } },
@ -290,13 +302,6 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
reportMeta.ulp reportMeta.ulp
? reportMeta.ulp.name.toUpperCase() ? reportMeta.ulp.name.toUpperCase()
: 'Semua Unit Layanan Pelanggan'.toUpperCase() : 'Semua Unit Layanan Pelanggan'.toUpperCase()
],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
] ]
], ],
styles: { styles: {
@ -306,7 +311,10 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
fontStyle: 'bold' fontStyle: 'bold'
}, },
theme: 'plain', theme: 'plain',
startY: 10 startY: 10,
margin: {
left: 25
}
}) })
autoTable(doc, { autoTable(doc, {

View File

@ -197,9 +197,21 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
orientation: 'landscape' orientation: 'landscape'
}) })
const img = new Image()
img.src = '/assets/images/pln-icon.png'
doc.addImage(img, 'png', 13.5, 9, 9.5, 13)
autoTable(doc, { autoTable(doc, {
head: [ head: [
['PT. PLN(Persero)', '', ''], ['PT. PLN(Persero)', '', ''],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
],
[ [
{ content: 'UNIT INDUK', styles: { cellWidth: 40 } }, { content: 'UNIT INDUK', styles: { cellWidth: 40 } },
{ content: ':', styles: { cellWidth: 1 } }, { content: ':', styles: { cellWidth: 1 } },
@ -220,13 +232,6 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
reportMeta.ulp reportMeta.ulp
? reportMeta.ulp.name.toUpperCase() ? reportMeta.ulp.name.toUpperCase()
: 'Semua Unit Layanan Pelanggan'.toUpperCase() : 'Semua Unit Layanan Pelanggan'.toUpperCase()
],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
] ]
], ],
styles: { styles: {
@ -236,7 +241,10 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
fontStyle: 'bold' fontStyle: 'bold'
}, },
theme: 'plain', theme: 'plain',
startY: 10 startY: 10,
margin: {
left: 25
}
}) })
autoTable(doc, { autoTable(doc, {

View File

@ -133,9 +133,21 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
orientation: 'landscape' orientation: 'landscape'
}) })
const img = new Image()
img.src = '/assets/images/pln-icon.png'
doc.addImage(img, 'png', 13.5, 9, 9.5, 13)
autoTable(doc, { autoTable(doc, {
head: [ head: [
['PT. PLN(Persero)', '', ''], ['PT. PLN(Persero)', '', ''],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
],
[ [
{ content: 'UNIT INDUK', styles: { cellWidth: 40 } }, { content: 'UNIT INDUK', styles: { cellWidth: 40 } },
{ content: ':', styles: { cellWidth: 1 } }, { content: ':', styles: { cellWidth: 1 } },
@ -156,13 +168,6 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
reportMeta.ulp reportMeta.ulp
? reportMeta.ulp.name.toUpperCase() ? reportMeta.ulp.name.toUpperCase()
: 'Semua Unit Layanan Pelanggan'.toUpperCase() : 'Semua Unit Layanan Pelanggan'.toUpperCase()
],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
] ]
], ],
styles: { styles: {
@ -172,7 +177,10 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
fontStyle: 'bold' fontStyle: 'bold'
}, },
theme: 'plain', theme: 'plain',
startY: 10 startY: 10,
margin: {
left: 25
}
}) })
autoTable(doc, { autoTable(doc, {

View File

@ -156,9 +156,21 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
orientation: 'landscape' orientation: 'landscape'
}) })
const img = new Image()
img.src = '/assets/images/pln-icon.png'
doc.addImage(img, 'png', 13.5, 9, 9.5, 13)
autoTable(doc, { autoTable(doc, {
head: [ head: [
['PT. PLN(Persero)', '', ''], ['PT. PLN(Persero)', '', ''],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
],
[ [
{ content: 'UNIT INDUK', styles: { cellWidth: 40 } }, { content: 'UNIT INDUK', styles: { cellWidth: 40 } },
{ content: ':', styles: { cellWidth: 1 } }, { content: ':', styles: { cellWidth: 1 } },
@ -179,13 +191,6 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
reportMeta.ulp reportMeta.ulp
? reportMeta.ulp.name.toUpperCase() ? reportMeta.ulp.name.toUpperCase()
: 'Semua Unit Layanan Pelanggan'.toUpperCase() : 'Semua Unit Layanan Pelanggan'.toUpperCase()
],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
] ]
], ],
styles: { styles: {
@ -195,7 +200,10 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
fontStyle: 'bold' fontStyle: 'bold'
}, },
theme: 'plain', theme: 'plain',
startY: 10 startY: 10,
margin: {
left: 25
}
}) })
autoTable(doc, { autoTable(doc, {

View File

@ -265,9 +265,21 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
orientation: 'landscape' orientation: 'landscape'
}) })
const img = new Image()
img.src = '/assets/images/pln-icon.png'
doc.addImage(img, 'png', 13.5, 9, 9.5, 13)
autoTable(doc, { autoTable(doc, {
head: [ head: [
['PT. PLN(Persero)', '', ''], ['PT. PLN(Persero)', '', ''],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
],
[ [
{ content: 'UNIT INDUK', styles: { cellWidth: 40 } }, { content: 'UNIT INDUK', styles: { cellWidth: 40 } },
{ content: ':', styles: { cellWidth: 1 } }, { content: ':', styles: { cellWidth: 1 } },
@ -288,13 +300,6 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
reportMeta.ulp reportMeta.ulp
? reportMeta.ulp.name.toUpperCase() ? reportMeta.ulp.name.toUpperCase()
: 'Semua Unit Layanan Pelanggan'.toUpperCase() : 'Semua Unit Layanan Pelanggan'.toUpperCase()
],
[
'REGIONAL',
':',
reportMeta.regional
? reportMeta.regional.name.toUpperCase()
: 'Semua Regional'.toUpperCase()
] ]
], ],
styles: { styles: {
@ -304,7 +309,10 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
fontStyle: 'bold' fontStyle: 'bold'
}, },
theme: 'plain', theme: 'plain',
startY: 10 startY: 10,
margin: {
left: 25
}
}) })
autoTable(doc, { autoTable(doc, {