Perbaikan laporan semua transaksi with print
This commit is contained in:
Vendored
+1
File diff suppressed because one or more lines are too long
@@ -32,7 +32,8 @@ function printPDF(data) {
|
||||
doc.setFont("helvetica", "normal");
|
||||
doc.setFontSize(9);
|
||||
doc.text("Tanggal : " + (data.vehicle.date ?? "-"), pageWidth / 2, 23, { align: "center" });
|
||||
doc.text("By : Harian", pageWidth - 14, 12, { align: "right" });
|
||||
doc.text("By : " + (data.vehicle.reportTime ?? "-"), pageWidth - 14, 12, { align: "right" });
|
||||
// doc.text("By : Harian", pageWidth - 14, 12, { align: "right" });
|
||||
|
||||
// ===== SUSUN BODY TABEL =====
|
||||
const vehicleBody = [];
|
||||
@@ -434,6 +435,11 @@ function printPDF(data) {
|
||||
doc.setFontSize(11);
|
||||
doc.text("Rekap Transaksi Per Petugas", pageWidth / 2, officerStartY - 5, { align: "center" });
|
||||
|
||||
doc.setFont("helvetica", "normal");
|
||||
doc.setFontSize(9);
|
||||
doc.text("Tanggal : " + (data.vehicle.date ?? "-"), pageWidth / 2, 23, { align: "center" });
|
||||
doc.text("By : " + (data.vehicle.reportTime ?? "-"), pageWidth - 14, 12, { align: "right" });
|
||||
|
||||
doc.autoTable({
|
||||
head: officerHead,
|
||||
body: officerBody,
|
||||
@@ -518,7 +524,7 @@ function printPDF(data) {
|
||||
rupiah(oCasual.income),
|
||||
|
||||
nLost.jumlah,
|
||||
cash.totalCashless,
|
||||
rupiah(nLost.income),
|
||||
|
||||
nMember.jumlah,
|
||||
rupiah(nMember.income),
|
||||
@@ -535,11 +541,11 @@ function printPDF(data) {
|
||||
{ content: rupiah(cashless.totalCashless), styles: { valign: "middle", fontStyle: "bold" } },
|
||||
]);
|
||||
|
||||
ptotalTunaiJml += tCasual.jumlah + tLost.jumlah + tMember.jumlah + tManual.jumlah + tMasalah.jumlah;
|
||||
ptotalTunaiNilai += cash.totalCash || 0;
|
||||
ptotalNonTunaiJml += oCasual.jumlah + nLost.jumlah + nMember.jumlah + nManual.jumlah + nMasalah.jumlah;
|
||||
ptotalNonTunaiNilai += cashless.totalCashless || 0;
|
||||
pgrandTotal += (cash.totalCash || 0) + (cashless.totalCashless || 0);
|
||||
payTotalTunaiJml += tCasual.jumlah + tLost.jumlah + tMember.jumlah + tManual.jumlah + tMasalah.jumlah;
|
||||
payTotalTunaiNilai += cash.totalCash || 0;
|
||||
payTotalNonTunaiJml += oCasual.jumlah + nLost.jumlah + nMember.jumlah + nManual.jumlah + nMasalah.jumlah;
|
||||
payTotalNonTunaiNilai += cashless.totalCashless || 0;
|
||||
payGrandTotal += (cash.totalCash || 0) + (cashless.totalCashless || 0);
|
||||
});
|
||||
|
||||
// baris TOTAL & GRAND TOTAL
|
||||
@@ -633,7 +639,12 @@ function printPDF(data) {
|
||||
// doc.addPage();
|
||||
doc.setFont("helvetica", "bold");
|
||||
doc.setFontSize(11);
|
||||
doc.text("Rekap Transaksi Per Petugas", pageWidth / 2, paymentStartY - 5, { align: "center" });
|
||||
doc.text("Rekap Transaksi Per Pembayaran", pageWidth / 2, paymentStartY - 5, { align: "center" });
|
||||
|
||||
doc.setFont("helvetica", "normal");
|
||||
doc.setFontSize(9);
|
||||
doc.text("Tanggal : " + (data.vehicle.date ?? "-"), pageWidth / 2, 23, { align: "center" });
|
||||
doc.text("By : " + (data.vehicle.reportTime ?? "-"), pageWidth - 14, 12, { align: "right" });
|
||||
|
||||
doc.autoTable({
|
||||
head: paymentHead,
|
||||
@@ -646,28 +657,6 @@ function printPDF(data) {
|
||||
columnStyles: { 0: { halign: "left" } },
|
||||
});
|
||||
|
||||
// ===== TABEL OVER NIGHT (di bawah tabel utama) =====
|
||||
// const ponBody = data.payment.overNight.map((on) => [
|
||||
// on.jenis_mobil ?? "-",
|
||||
// on.overNight,
|
||||
// on.onExpired,
|
||||
// (on.overNight || 0) + (on.onExpired || 0),
|
||||
// ]);
|
||||
|
||||
// doc.setFont("helvetica", "bold");
|
||||
// doc.setFontSize(8);
|
||||
// doc.text("Kendaraan yang masih menginap (Over Night)", 14, doc.lastAutoTable.finalY + 10);
|
||||
|
||||
// doc.autoTable({
|
||||
// phead: [["Jenis Kend", "Menginap", "ON (Expired)", "Total"]],
|
||||
// body: ponBody,
|
||||
// startY: doc.lastAutoTable.finalY + 13,
|
||||
// theme: "grid",
|
||||
// styles: { fontSize: 7, cellPadding: 1 },
|
||||
// headStyles: { fontSize: 8, fillColor: [230, 230, 230], textColor: 0 },
|
||||
// tableWidth: 100,
|
||||
// });
|
||||
|
||||
doc.save(`Rekap Harian - ${data.vehicle.date}.pdf`);
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user