Fix formatting issue in RGangguan_KTI.ts
This commit is contained in:
parent
78b1e0f982
commit
4c0832209d
@ -10,8 +10,10 @@ import { exportDetailToWord, exportToWord } from './doc/RGangguan_KTI_DOC'
|
|||||||
const reportName = 'Rekapitulasi Koreksi Transaksi Individual'
|
const reportName = 'Rekapitulasi Koreksi Transaksi Individual'
|
||||||
const fontSize = 5
|
const fontSize = 5
|
||||||
const detailFontSize = 3
|
const detailFontSize = 3
|
||||||
|
var metaReport: any = {}
|
||||||
|
|
||||||
const formatData = (rawData: any) => {
|
const formatData = (rawData: any) => {
|
||||||
|
const { uid, up3, posko } = metaReport
|
||||||
const formattedData: any = []
|
const formattedData: any = []
|
||||||
const total: any = {
|
const total: any = {
|
||||||
month1: 0,
|
month1: 0,
|
||||||
@ -28,7 +30,19 @@ const formatData = (rawData: any) => {
|
|||||||
month12: 0
|
month12: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
formattedData.push([{ content: 'SELURUH UNIT', colSpan: 14, styles: { fontStyle: 'bold' } }])
|
if (uid.id == 0) {
|
||||||
|
formattedData.push([{ content: 'SELURUH UNIT', colSpan: 14, styles: { fontStyle: 'bold' } }])
|
||||||
|
} else {
|
||||||
|
if (up3.id == 0) {
|
||||||
|
formattedData.push([{ content: uid.name, colSpan: 14, styles: { fontStyle: 'bold' } }])
|
||||||
|
} else {
|
||||||
|
if (posko.id == 0) {
|
||||||
|
formattedData.push([{ content: up3.name, colSpan: 14, styles: { fontStyle: 'bold' } }])
|
||||||
|
} else {
|
||||||
|
formattedData.push([{ content: posko.name, colSpan: 14, styles: { fontStyle: 'bold' } }])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
formattedData.push(
|
formattedData.push(
|
||||||
...rawData.map((item: any, i: any) => {
|
...rawData.map((item: any, i: any) => {
|
||||||
@ -114,8 +128,9 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
|
|||||||
const date = new Date().getDate()
|
const date = new Date().getDate()
|
||||||
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)
|
metaReport = reportMeta
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
|
const data = formatData(rawData)
|
||||||
const doc = new jsPDF({
|
const doc = new jsPDF({
|
||||||
orientation: 'landscape'
|
orientation: 'landscape'
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user