tambah laporan ansuran keseluruhan

This commit is contained in:
BTMS2
2025-05-27 14:26:46 +08:00
parent fb43534ed5
commit 82ae6ad00c
2 changed files with 48 additions and 0 deletions
+5
View File
@@ -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;
}
}
@@ -0,0 +1,43 @@
<?php
namespace App\Exports\Ansuran;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Illuminate\Support\Collection;
class AnsuranKeseluruhanExport implements FromCollection, WithHeadings
{
protected $cawangan_detail;
protected $query;
protected $ansuranall;
public function __construct($cawangan_detail, $query, $ansuranall)
{
$this->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',
];
}
}