feat(webstatement): tambah fungsi nama provinsi dan perbaikan tampilan alamat customers
Perubahan yang dilakukan: - Menambahkan fungsi getProvinceCoreName di helpers.php untuk mengambil nama provinsi berdasarkan kode, menggunakan model ProvinceCore. - Menyesuaikan tampilan alamat customer di template stmt.blade.php: - Menambahkan RT/RW dari alamat rumah atau KTP jika tersedia. - Menggunakan nama provinsi dari fungsi baru agar data lebih konsisten. - Merapikan format alamat dengan menggunakan fungsi trim. - Memperbaiki struktur HTML pada bagian alamat untuk meningkatkan keterbacaan dan perawatan kode. Tujuan perubahan: - Menjamin data provinsi yang ditampilkan berasal dari referensi yang valid dan terpusat. - Meningkatkan kelengkapan dan kejelasan informasi alamat pada tampilan statement pelanggan. - Menstandarkan format alamat agar seragam dengan kebijakan internal perusahaan.
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
use Modules\Webstatement\Models\ProvinceCore;
|
||||
|
||||
if(!function_exists('calculatePeriodDates')) {
|
||||
/**
|
||||
* Fungsi untuk menghitung tanggal periode berdasarkan periode yang diberikan
|
||||
@@ -36,4 +37,11 @@ use Illuminate\Support\Facades\Log;
|
||||
'end' => $endDate,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
if(!function_exists('getProvinceCoreName')){
|
||||
function getProvinceCoreName($code){
|
||||
$province = ProvinceCore::where('code',$code)->first();
|
||||
return $province->name;
|
||||
}
|
||||
}
|
||||
@@ -363,8 +363,11 @@
|
||||
<p style="text-transform: capitalize">Kepada</p>
|
||||
<p>{{ $account->customer->name }}</p>
|
||||
<p>{{ $account->customer->address }}</p>
|
||||
<p>{{ $account->customer->district }}</p>
|
||||
<p>{{ ($account->customer->city ? $account->customer->city . ' ' : '') . ($account->customer->province ? $account->customer->province . ' ' : '') . ($account->customer->postal_code ?? '') }}
|
||||
<p>{{ $account->customer->district }}
|
||||
{{ ($account->customer->ktp_rt ?: $account->customer->home_rt) ? 'RT ' . ($account->customer->ktp_rt ?: $account->customer->home_rt) : '' }}
|
||||
{{ ($account->customer->ktp_rw ?: $account->customer->home_rw) ? 'RW ' . ($account->customer->ktp_rw ?: $account->customer->home_rw) : '' }}
|
||||
</p>
|
||||
<p>{{ trim($account->customer->city . ' ' . ($account->customer->province ? getProvinceCoreName($account->customer->province) . ' ' : '') . ($account->customer->postal_code ?? '')) }}
|
||||
</p>
|
||||
</div>
|
||||
<div style="text-transform: capitalize;" class="column">
|
||||
@@ -504,8 +507,11 @@
|
||||
<p style="text-transform: capitalize">Kepada</p>
|
||||
<p>{{ $account->customer->name }}</p>
|
||||
<p>{{ $account->customer->address }}</p>
|
||||
<p>{{ $account->customer->district }}</p>
|
||||
<p>{{ ($account->customer->city ? $account->customer->city . ' ' : '') . ($account->customer->province ? $account->customer->province . ' ' : '') . ($account->customer->postal_code ?? '') }}
|
||||
<p>{{ $account->customer->district }}
|
||||
{{ ($account->customer->ktp_rt ?: $account->customer->home_rt) ? 'RT ' . ($account->customer->ktp_rt ?: $account->customer->home_rt) : '' }}
|
||||
{{ ($account->customer->ktp_rw ?: $account->customer->home_rw) ? 'RW ' . ($account->customer->ktp_rw ?: $account->customer->home_rw) : '' }}
|
||||
</p>
|
||||
<p>{{ trim($account->customer->city . ' ' . ($account->customer->province ? getProvinceCoreName($account->customer->province) . ' ' : '') . ($account->customer->postal_code ?? '')) }}
|
||||
</p>
|
||||
</div>
|
||||
<div style="text-transform: capitalize;" class="column">
|
||||
|
||||
Reference in New Issue
Block a user