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,6 +2,7 @@
namespace App\Exports;
use App\Exports\Concerns\ForcesTextColumns;
use App\Helpers\JenjangPendidikanHelper;
use App\Models\Verifikator\JabatanFungsionalRiwayat;
use App\Models\Verifikator\JabatanPegawai;
@@ -11,6 +12,7 @@ use App\Models\Verifikator\View\Pegawai;
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;
@@ -19,10 +21,22 @@ use PhpOffice\PhpSpreadsheet\Style\Alignment;
use PhpOffice\PhpSpreadsheet\Style\Fill;
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
class P2Export implements FromCollection, ShouldAutoSize, WithColumnFormatting, WithHeadings, WithMapping, WithStyles, WithTitle
class P2Export implements FromCollection, ShouldAutoSize, WithColumnFormatting, WithCustomValueBinder, WithHeadings, WithMapping, WithStyles, WithTitle
{
use ForcesTextColumns;
private const FAKULTAS_IDS = [1, 2, 3, 4, 5, 6, 7, 8, 9];
protected function nipColumns(): array
{
return ['C'];
}
protected function alwaysTextColumns(): array
{
return ['P', 'Q'];
}
public function __construct(
private readonly ?int $periode,
private readonly mixed $unitKerjaId,
@@ -153,7 +167,7 @@ class P2Export implements FromCollection, ShouldAutoSize, WithColumnFormatting,
return (object) [
'no' => $index + 1,
'nama' => $row->nama,
'nip' => $row->nip ? "'".$cleanNip : '',
'nip' => $row->nip ? $cleanNip : '',
'pangkat' => $pangkat,
'golongan' => $golongan,
'nama_jafung' => $namaJafung,
@@ -166,8 +180,8 @@ class P2Export implements FromCollection, ShouldAutoSize, WithColumnFormatting,
'total_p2_bruto' => $row->total_p2_bruto ?? 0,
'total_p2_pajak' => $row->total_p2_pajak ?? 0,
'total_p2_netto' => $row->total_p2_netto ?? 0,
'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' => $row->nama_unit ?? '',
];
});