Feature #17 : Module Permohonan

This commit is contained in:
Daeng Deni Mardaeni
2024-08-24 21:17:32 +07:00
parent 458c1b1ad5
commit fec80bfa1c
12 changed files with 774 additions and 4 deletions

View File

@@ -21,7 +21,7 @@
{
return [
$row->id,
$row->branch->name .
$row->branch->name,
$row->cif,
$row->nomor_rekening,
$row->name,

View File

@@ -0,0 +1,67 @@
<?php
namespace Modules\Lpj\Exports;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithColumnFormatting;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping;
use Modules\Lpj\Models\Debiture;
use Modules\Lpj\Models\Permohonan;
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
class PermohonanExport implements WithColumnFormatting, WithHeadings, FromCollection, withMapping
{
public function collection()
{
return Permohonan::get();
}
public function map($row)
: array
{
return [
$row->id,
$row->nomor_registrasi,
$row->tanggal_permohonan,
$row->user->name,
$row->branch->name,
$row->tujuanPenilaian->name,
$row->debiture->name,
$row->status,
$row->authorized_at,
$row->authorized_status,
$row->authorized_by,
$row->created_at
];
}
public function headings()
: array
{
return [
'ID',
'Nomor Registrasi',
'Tanggal Permohonan',
'User Pemohon',
'Branch Pemohon',
'Tujuan Penilaian',
'Debitur',
'Status',
'Tanggal Pengesahan',
'Status Pengesahan',
'Pengesah',
'Tanggal Dibuat'
];
}
public function columnFormats()
: array
{
return [
'A' => NumberFormat::FORMAT_NUMBER,
'C' => NumberFormat::FORMAT_DATE_DATETIME,
'L' => NumberFormat::FORMAT_DATE_DATETIME
];
}
}