print_laporan_retur_penjualan.blade.php

mail@pastecode.io avatar
unknown
php_laravel_blade
2 years ago
6.6 kB
2
Indexable
Never
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Data Transaction</title>

</head>
<style>
    /* font size */
    * {
        font-size: 11px;
        /* font-family: Verdana, Arial, sans-serif; */
    }

    /* .table-bordered {
        border: 0.5px solid black;
    } */

    .table-bordered thead tr th,
    .table-bordered tbody tr th,
    .table-bordered tfoot tr th,
    .table-bordered thead tr td,
    .table-bordered tbody tr td,
    .table-bordered tfoot tr td {
        border: 0.5px solid rgb(160, 160, 160);
    }

    .table-bordered thead tr th,
    .table-bordered tbody tr td,
    .table-bordered tfoot tr td {
        padding: 2px;
    }
</style>
<body>
    <button id="prr" onclick="this.style.display='none'; print(); this.style.display='block';"> > PRINT < </button>
    <h1><center>LAPORAN RETUR PENJUALAN</center></h1>
    <h2><center><b>PERIODE {{$tgl}}</b></center></h2>
    <table class="table table-bordered" width="100%">
        <thead>
            <tr>
                @if ($filter == 'barang')
                    <th colspan="2">
                        <center><b>Jumlah Transaksi: {{$jumlah}}</b></center>
                    </th>
                    <th colspan="2">
                        <center><b>Jumlah Pelanggan: {{$jumlah_pelanggan}}</b></center>
                    </th>
                    <th colspan="4">
                        <center><b>Jumlah Harga Total : {{number_format($total_harga, 2, ',','.')}}</b></center>
                    </th>
                    <th colspan="4">
                        <center><b>Jumlah Barang (satuan): <br>Besar : {{$dos}} Kecil : {{$pack}}</b></center>
                    </th>
                    <th colspan="4">
                        <center><b>Total Barang (satuan): <br>Besar : {{number_format($total_dos,2,',','.')}} Kecil : {{number_format($total_pack,2,',','.')}}</b></center>
                    </th>
                @else
                    <th>
                        <center><b>Jumlah Transaksi: {{$jumlah}}</b></center>
                    </th>
                    <th>
                        <center><b>Jumlah Pelanggan: {{$jumlah_pelanggan}}</b></center>
                    </th>
                    <th colspan="2">
                        <center><b>Jumlah Barang (satuan): <br>Besar : {{$dos}} Kecil : {{$pack}}</b></center>
                    </th>
                    <th>
                        <center><b>Jumlah Harga Total : {{number_format($total_harga, 2, ',','.')}}</b></center>
                    </th>
                    <th colspan="2">
                        <center><b>Total Barang (satuan): <br>Besar : {{number_format($total_dos,2,',','.')}} Kecil : {{number_format($total_pack,2,',','.')}}</b></center>
                    </th>
                @endif
            </tr>
            @if ($filter == 'barang')
                <tr>
                    <th><b>Kode Transaksi</b></th>
                    <th><b>Customer</b></th>
                    <th><b>Kode Barang</b></th>
                    <th><b>Nama Barang</b></th>
                    <th><b>Harga Barang</b></th>
                    <th><b>Jumlah</b></th>
                    <th><b>Jenis Kemasan</b></th>
                    <th><b>Total Barang</b></th>
                    <th><b>Subtotal</b></th>
                    <th><b>Total</b></th>
                    <th><b>Bayar</b></th>
                    <th><b>Status</b></th>
                    <th><b>Status Pajak</b></th>
                    <th><b>Kasir</b></th>
                    <th><b>Tanggal Buat</b></th>
                </tr>
            @else
                <tr>
                    <th><b>Kode Transaksi</b></th>
                    <th><b>Customer</b></th>
                    <th><b>Jumlah Besar</b></th>
                    <th><b>Jumlah Kecil</b></th>
                    <th><b>Total Transaksi</b></th>
                    <th><b>Kasir</b></th>
                    <th><b>Tanggal Buat</b></th>
                </tr>
            @endif
        </thead>
        <tbody>
            @if ($filter == 'barang')
                @foreach ($transaksi as $item)
                @php
                if ($item->status_pajak != null) {
                $pajak = 'PPN';
                }else{
                $pajak = 'Non PPN';
                }
                @endphp
                <tr>
                    <td>{{ $item->kode_transaksi }}</td>
                    <td>{{ $item->id_customer }}</td>
                    <td>{{ $item->kode_barang }}</td>
                    <td>{{ $item->nama_barang }}</td>
                    <td>{{ number_format($item->harga, 2, ',', '.') }}</td>
                    <td>{{ $item->jumlah }}</td>
                    <td>{{ $item->jenis_kemasan }}</td>
                    <td>{{ number_format($item->total_barang, 2, ',', '.') }}</td>
                    <td>{{ number_format($item->subtotal, 2, ',', '.') }}</td>
                    <td>{{ number_format($item->total, 2, ',', '.') }}</td>
                    <td>{{ number_format($item->bayar, 2, ',', '.') }}</td>
                    <td>{{ $item->status }}</td>
                    <td>{{ $pajak }}</td>
                    <td>{{ $item->id_kasir }}</td>
                    <td>{{ $item->created_at->format('d/M/Y H:i:s') }}</td>
                </tr>
                @endforeach
            @else
                @foreach ($per_transaksi as $item)
                <tr>
                    <td>{{ $item['kode_transaksi'] }}</td>
                    <td>{{ $item['nama_customer'] }}</td>
                    <td>{{ $item['jumlah_besar'] }}</td>
                    <td>{{ $item['jumlah_kecil'] }}</td>
                    <td>{{ $item['total'] }}</td>
                    <td>{{ $item['kasir'] }}</td>
                    <td>{{ $item['created_at']}}</td>
                </tr>
                @endforeach
            @endif
        </tbody>
    </table>
    <script>
        print(){
            window.onload = function() { 
                document.getElementById("prr").style.display='none';
                window.print(); 
            }
            window.onafterprint = window.close;
            document.getElementById("prr").style.display='block';
        };
    </script>
</body>

</html>