Tambahkan pengecekan untuk pengecualian nomor dokumen

- Menambahkan variabel `$shouldExcludeNomor` untuk memeriksa apakah nomor dokumen perlu dikecualikan.
- Loop pengecekan ditambahkan untuk membandingkan `dokumen_nomor` dengan excludedDocuments.
- Hanya menampilkan nomor dokumen jika tidak masuk dalam daftar pengecualian.
This commit is contained in:
Daeng Deni Mardaeni
2025-01-01 21:35:17 +07:00
parent d665a17ded
commit 002882fe2f
2 changed files with 32 additions and 8 deletions

View File

@@ -113,6 +113,7 @@
@if ($dokumen->id== $dokumen_jaminans->id)
@php
$shouldExclude = false;
$shouldExcludeNomor = false;
foreach ($excludedDocuments as $excludedDoc) {
if (str_contains(strtolower($dokumen_jaminans->name), strtolower($excludedDoc))) {
$shouldExclude = true;
@@ -124,10 +125,21 @@
@if(!$shouldExclude)
@php $details = $dokumen_jaminans->detail; @endphp
@foreach ($details as $index => $detail)
@if($detail->dokumen_nomor)
@foreach(json_decode($detail->dokumen_nomor) as $item)
{{ $item }}<br>
@endforeach
@php
$shouldExcludeNomor = false;
foreach ($excludedDocuments as $excludedDoc) {
if (str_contains(strtolower($detail->dokumen_nomor), strtolower($excludedDoc))) {
$shouldExcludeNomor = true;
break;
}
}
@endphp
@if(!$shouldExcludeNomor)
@if($detail->dokumen_nomor)
@foreach(json_decode($detail->dokumen_nomor) as $item)
{{ $item }}<br>
@endforeach
@endif
@endif
@endforeach
@endif

View File

@@ -130,6 +130,7 @@
@if ($dokumen->id== $dokumen_jaminans->id)
@php
$shouldExclude = false;
$shouldExcludeNomor = false;
foreach ($excludedDocuments as $excludedDoc) {
if (str_contains(strtolower($dokumen_jaminans->name), strtolower($excludedDoc))) {
$shouldExclude = true;
@@ -141,10 +142,21 @@
@if(!$shouldExclude)
@php $details = $dokumen_jaminans->detail; @endphp
@foreach ($details as $index => $detail)
@if($detail->dokumen_nomor)
@foreach(json_decode($detail->dokumen_nomor) as $item)
{{ $item }}<br>
@endforeach
@php
$shouldExcludeNomor = false;
foreach ($excludedDocuments as $excludedDoc) {
if (str_contains(strtolower($detail->dokumen_nomor), strtolower($excludedDoc))) {
$shouldExcludeNomor = true;
break;
}
}
@endphp
@if(!$shouldExcludeNomor)
@if($detail->dokumen_nomor)
@foreach(json_decode($detail->dokumen_nomor) as $item)
{{ $item }}<br>
@endforeach
@endif
@endif
@endforeach
@endif