Perubahan NIP petik kolom NIP, NPWP, dan Nomor Rekening semua export excel
This commit is contained in:
@@ -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'] ?? '',
|
||||
];
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user