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
+17 -5
View File
@@ -3,10 +3,12 @@
namespace App\Exports;
use App\Exports\Concerns\EnrichesJabatanData;
use App\Exports\Concerns\ForcesTextColumns;
use App\Services\DawaiService;
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\WithStyles;
@@ -14,9 +16,19 @@ use PhpOffice\PhpSpreadsheet\Style\Alignment;
use PhpOffice\PhpSpreadsheet\Style\Fill;
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
class R13Export implements FromCollection, ShouldAutoSize, WithColumnFormatting, WithHeadings, WithMapping, WithStyles
class R13Export implements FromCollection, ShouldAutoSize, WithColumnFormatting, WithCustomValueBinder, WithHeadings, WithMapping, WithStyles
{
use EnrichesJabatanData;
use EnrichesJabatanData, ForcesTextColumns;
protected function nipColumns(): array
{
return ['C'];
}
protected function alwaysTextColumns(): array
{
return ['P', 'Q'];
}
protected $jenisPegawai;
@@ -55,7 +67,7 @@ class R13Export implements FromCollection, ShouldAutoSize, WithColumnFormatting,
return (object) [
'no' => 0, // Temporary, will be set after sorting
'nip' => $item['nip'] ? "'".trim($item['nip'], "'") : '',
'nip' => $item['nip'] ? trim($item['nip'], "'") : '',
'nama' => $item['nama'] ?? $item['nama_lengkap'] ?? '',
'pangkat' => $pangkat,
'golongan' => $golongan,
@@ -69,8 +81,8 @@ class R13Export implements FromCollection, ShouldAutoSize, WithColumnFormatting,
'gaji_r13' => $totalR13,
'pajak_r13' => $totalR13 - $totalR13SetelahPajak,
'gaji_r13_bersih' => $totalR13SetelahPajak,
'npwp' => $pegawai && $pegawai->npwp ? "'".str_replace(['-', '.'], '', $pegawai->npwp) : '',
'nomor_rekening' => $pegawai && $pegawai->nomor_rekening ? "'".$pegawai->nomor_rekening : '',
'npwp' => $pegawai && $pegawai->npwp ? str_replace(['-', '.'], '', $pegawai->npwp) : '',
'nomor_rekening' => $pegawai && $pegawai->nomor_rekening ? $pegawai->nomor_rekening : '',
'nama_unit' => $item['nama_unit'] ?? '',
];
});