From 82ae6ad00c660449a48e4e9a8719d96aa64b6a52 Mon Sep 17 00:00:00 2001 From: BTMS2 Date: Tue, 27 May 2025 14:26:46 +0800 Subject: [PATCH] tambah laporan ansuran keseluruhan --- app/Exports/Ansuran/AnsuranExport.php | 5 +++ .../Ansuran/AnsuranKeseluruhanExport.php | 43 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 app/Exports/Ansuran/AnsuranKeseluruhanExport.php diff --git a/app/Exports/Ansuran/AnsuranExport.php b/app/Exports/Ansuran/AnsuranExport.php index cf1c819..5c0995a 100644 --- a/app/Exports/Ansuran/AnsuranExport.php +++ b/app/Exports/Ansuran/AnsuranExport.php @@ -9,6 +9,7 @@ class AnsuranExport implements WithMultipleSheets public $cawangan_detail; public $query; public $ansuran; + public $ansuranall; public $summary_ansuran; public function __construct($data) @@ -16,6 +17,7 @@ class AnsuranExport implements WithMultipleSheets $this->cawangan_detail = $data['cawangan_detail']; $this->query = $data['query']; $this->ansuran = $data['total_ansuran']; + $this->ansuranall = $data['total_ansuran_keseluruhan']; $this->summary_ansuran = $data['summary_ansuran']; } @@ -46,6 +48,9 @@ class AnsuranExport implements WithMultipleSheets $sheets[] = new AnsuranPerTellerExport($this->cawangan_detail, $this->query, $teller_with_gadaian_data); } + // Sheet Terakhir: Keseluruhan (tanpa teller) + $sheets[] = new AnsuranKeseluruhanExport($this->cawangan_detail, $this->query, $this->ansuranall); + return $sheets; } } diff --git a/app/Exports/Ansuran/AnsuranKeseluruhanExport.php b/app/Exports/Ansuran/AnsuranKeseluruhanExport.php new file mode 100644 index 0000000..89be1a9 --- /dev/null +++ b/app/Exports/Ansuran/AnsuranKeseluruhanExport.php @@ -0,0 +1,43 @@ +cawangan_detail = $cawangan_detail; + $this->query = $query; + $this->ansuranall = $ansuranall; + } + + public function title(): string + { + return 'ANSURAN ALL'; + } + + public function collection() + { + return collect($this->ansuranall); + } + + public function headings(): array + { + return [ + 'No Rujukan', + 'Nama', + 'No KP', + 'Bayaran Pembiayaan', + 'Bayaran Keuntungan', + 'Jumlah Ansuran', + ]; + } +}