Melengkapi laporan semua transaksi

This commit is contained in:
2026-07-31 08:09:50 +07:00
parent 8bd2d0c542
commit d2e6f70bf6
12 changed files with 2252 additions and 689 deletions
@@ -75,23 +75,23 @@
</div>
</div>
<div class="col-sm-1 d-flex justify-content-center align-items-center">
<button type="button" id="btnProses"
<button type="button" id="btnProses"
class="btn btn-light btn-lg w-100">
Proses
</button>
</div>
<div class="col-sm-1">
<div class="col-sm-1">
</div>
<div class="col-sm-2">
<div class="col-sm-2">
<div class="form-group">
<p>Jumlah Pendapatan : </p> <h3 id="pendapatan"></h3><br>
<p>Jumlah Transaksi : </p> <h3 id="jmlTrans"></h3>
</div>
</div>
<div class="col-sm-1">
<div class="col-sm-1">
<button type="button" class="btn btn-info btn-icon-text btn-export-pdf">
Print
<i class="mdi mdi-printer btn-icon-append"></i>
<i class="mdi mdi-printer btn-icon-append"></i>
</button>
</div>
{{-- {{ dd($filterSelect['softsetting']) }} --}}
@@ -145,7 +145,7 @@ class="btn btn-light btn-lg w-100">
$(document).ready(function () {
let location = @json(collect($locationSettings ?? [])->except('logo'));
console.log(location?.namaperusahaan);
let awal = '';
let akhir = '';
let pendapatan = 0;
@@ -163,7 +163,7 @@ class="btn btn-light btn-lg w-100">
const jenisStiker = $('#jenisStiker').val();
const nama = $('#cari_data').val();
const nopol = $('#cari_nopol').val();
awal = $('#tanggalMulai').val();
akhir = $('#tanggalSelesai').val();
@@ -225,7 +225,7 @@ class="btn btn-light btn-lg w-100">
// `);
// });
// initDataTable();
// initDataTable();
// 🔥 sortable aktif
if (!response.success) return;
@@ -447,8 +447,8 @@ function rupiah(angka) {
doc.text(`Jumlah Pendapatan : ${rupiah(pendapatan)}`, marginLeft, 38);
doc.text(
`Jumlah Transaksi : ${rupiah(jmlTrans)}`,
pageWidth - marginRight,
`Jumlah Transaksi : ${rupiah(jmlTrans)}`,
pageWidth - marginRight,
38,
{ align: 'right'}
);
@@ -472,69 +472,69 @@ function rupiah(angka) {
doc.save('Rekap_Harian.pdf');
});
});
// $('.btn-export-pdf').on('click', async function () {
// const { jsPDF } = window.jspdf;
// const doc = new jsPDF({
// orientation: 'portrait',
// unit: 'mm',
// format: 'a4'
// });
// const element = document.getElementById('cetak');
// const canvas = await html2canvas(element, {
// scale: 2,
// useCORS: true
// });
// const imgData = canvas.toDataURL('image/png');
// const pageWidth = doc.internal.pageSize.getWidth();
// const pageHeight = doc.internal.pageSize.getHeight();
// const marginTop = 20;
// const marginBottom = 20;
// const marginLeft = 10;
// const marginRight = 10;
// const headerHeight = 45; // ⬅️ ruang judul
// const contentHeight = pageHeight - headerHeight - marginBottom;
// const imgWidth = pageWidth - marginLeft - marginRight;
// const imgHeight = (canvas.height * imgWidth) / canvas.width;
// let renderedHight = 0;
// let page = 1;
// let renderedHeight = 0;
// while (renderedHeight < imgHeight) {
// if (page > 1) doc.addPage();
// doc.setFont('helvetica', 'bold');
// doc.setFontSize(14);
// doc.text('LAPORAN STIKER HARIAN', pageWidth / 2, 15, { align: 'center' });
// // SUB JUDUL
// doc.setFontSize(10);
// doc.setFont('helvetica', 'normal');
// doc.text('PT PARKIR MAJU JAYA', pageWidth / 2, 22, { align: 'center' });
// doc.setFontSize(9);
// doc.text(`Periode : ${awal} s/d ${akhir}`, marginLeft, 32);
// doc.text(`Dicetak : ${new Date().toLocaleDateString('id-ID')}`, pageWidth - marginRight, 32, {
// align: 'right'
// });
// doc.setFontSize(9);
// doc.text(`Jumlah Pendapatan : ${pendapatan}`, marginLeft, 38);
// doc.text(`Jumlah Pendapatan : 15`, pageWidth - marginRight, 38, {
// align: 'right'
// });
// doc.addImage(
// imgData,
// 'PNG',
@@ -543,7 +543,7 @@ function rupiah(angka) {
// imgWidth,
// imgHeight
// );
// renderedHeight += contentHeight;
// page++;
// }
@@ -583,4 +583,4 @@ function rupiah(angka) {
// doc.save(`Rekap Harian.pdf`);
// });
</script>
@endsection
@endsection