Perubahan NIP petik kolom NIP, NPWP, dan Nomor Rekening semua export excel

This commit is contained in:
Ariyutta
2026-09-21 12:41:30 +07:00
parent 80c7c0c46f
commit 977e8d7de8
12 changed files with 220 additions and 44 deletions
+18 -4
View File
@@ -2,11 +2,13 @@
namespace App\Exports;
use App\Exports\Concerns\ForcesTextColumns;
use App\Models\Rekapitulasi\P1;
use Carbon\Carbon;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
use Maatwebsite\Excel\Concerns\WithColumnFormatting;
use Maatwebsite\Excel\Concerns\WithCustomValueBinder;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping;
use Maatwebsite\Excel\Concerns\WithMultipleSheets;
@@ -50,8 +52,20 @@ class P1PerbandinganExport implements WithMultipleSheets
}
}
class P1PerbandinganMonthlySheet implements FromCollection, ShouldAutoSize, WithColumnFormatting, WithHeadings, WithMapping, WithStyles, WithTitle
class P1PerbandinganMonthlySheet implements FromCollection, ShouldAutoSize, WithColumnFormatting, WithCustomValueBinder, WithHeadings, WithMapping, WithStyles, WithTitle
{
use ForcesTextColumns;
protected function nipColumns(): array
{
return ['C'];
}
protected function alwaysTextColumns(): array
{
return ['Q', 'R'];
}
protected $jenisPegawai;
protected $tahun;
@@ -153,7 +167,7 @@ class P1PerbandinganMonthlySheet implements FromCollection, ShouldAutoSize, With
return (object) [
'no' => 0,
'nip' => "'".$cleanNip,
'nip' => $cleanNip,
'nama_lengkap' => $acuan->nama ?? '-',
'pangkat' => $acuan->pangkat ?? '-',
'golongan' => $acuan->golongan ?? '-',
@@ -168,8 +182,8 @@ class P1PerbandinganMonthlySheet implements FromCollection, ShouldAutoSize, With
'selisih_pajak' => $selisihPajak,
'selisih_netto' => $selisihNetto,
'keterangan' => $this->keteranganLabel($selisihNetto),
'npwp' => $acuan->npwp ? "'".str_replace(['-', '.'], '', $acuan->npwp) : '',
'nomor_rekening' => $acuan->nomor_rekening ? "'".$acuan->nomor_rekening : '',
'npwp' => $acuan->npwp ? str_replace(['-', '.'], '', $acuan->npwp) : '',
'nomor_rekening' => $acuan->nomor_rekening ? $acuan->nomor_rekening : '',
'nama_unit' => $acuan->nama_unit_kerja ?? '-',
];
})->filter(function ($row) {