ExportLaporanPenjualan.php

mail@pastecode.io avatar
unknown
php_laravel_blade
2 years ago
2.0 kB
1
Indexable
Never
<?php

namespace App\Exports;

use Illuminate\Contracts\View\View;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\FromView;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;

class ExportLaporanPenjualan implements FromView,ShouldAutoSize
{
    protected $transaksi;
    protected $per_transaksi;
    protected $filter;
    protected $penjualan;
    protected $dos;
    protected $pack;
    protected $tgl;
    protected $jumlah;
    protected $jumlah_pelanggan;
    protected $jumlah_total_harga;
    protected $total_dos;
    protected $total_pack;

    public function __construct($transaksi, $per_transaksi, $filter, $penjualan, $jumlah_dos, $jumlah_pack, $tgl, $jumlah, $jumlah_pelanggan, $jumlah_total_harga, $total_dos, $total_pack)
    {
        $this->transaksi = $transaksi;
        $this->per_transaksi = $per_transaksi;
        $this->filter = $filter;
        $this->penjualan = $penjualan;
        $this->dos = $jumlah_dos;
        $this->pack = $jumlah_pack;
        $this->tgl = $tgl;
        $this->jumlah = $jumlah;
        $this->jumlah_pelanggan = $jumlah_pelanggan;
        $this->jumlah_total_harga = $jumlah_total_harga;
        $this->total_dos = $total_dos;
        $this->total_pack = $total_pack;
    }
    public function view(): View
    {
        return view('report.export_laporan_penjualan',[
            'transaksi' => $this->transaksi,
            'per_transaksi' => $this->per_transaksi,
            'filter' => $this->filter,
            'penjualan' => $this->penjualan,
            'dos' => $this->dos,
            'pack' => $this->pack,
            'tgl' => $this->tgl,
            'jumlah' => $this->jumlah,
            'jumlah_pelanggan' => $this->jumlah_pelanggan,
            'jumlah_total_harga' => $this->jumlah_total_harga,
            'total_dos' => $this->total_dos,
            'total_pack' => $this->total_pack
        ]);
    }
}