Merge branch 'staging' of https://git.putrakuningan.com/daengdeni/lpj into andydev
This commit is contained in:
@@ -171,7 +171,11 @@ class KJPPController extends Controller
|
|||||||
$validated['detail_nama_pic_marketing'] = $detailNamaPicMarketingJson;
|
$validated['detail_nama_pic_marketing'] = $detailNamaPicMarketingJson;
|
||||||
$validated['detail_nomor_hp_pic_marketing'] = $detailNomorHpPicMarketingJson;
|
$validated['detail_nomor_hp_pic_marketing'] = $detailNomorHpPicMarketingJson;
|
||||||
$validated['ijin_usaha_id'] = json_encode($validated['ijin_usaha_id']);
|
$validated['ijin_usaha_id'] = json_encode($validated['ijin_usaha_id']);
|
||||||
$validated['jenis_aset_id'] = json_encode($validated['jenis_aset_id']);
|
if (empty($validated['jenis_aset_id'])) {
|
||||||
|
$validated['jenis_aset_id'] = json_encode([]);
|
||||||
|
} else {
|
||||||
|
$validated['jenis_aset_id'] = json_encode($validated['jenis_aset_id']);
|
||||||
|
}
|
||||||
// Tambahkan nama file ke data yang divalidasi
|
// Tambahkan nama file ke data yang divalidasi
|
||||||
$validated['attachment'] = $filename;
|
$validated['attachment'] = $filename;
|
||||||
|
|
||||||
@@ -434,7 +438,11 @@ class KJPPController extends Controller
|
|||||||
$validated['detail_nama_pic_marketing'] = $detailNamaPicMarketingJson;
|
$validated['detail_nama_pic_marketing'] = $detailNamaPicMarketingJson;
|
||||||
$validated['detail_nomor_hp_pic_marketing'] = $detailNomorHpPicMarketingJson;
|
$validated['detail_nomor_hp_pic_marketing'] = $detailNomorHpPicMarketingJson;
|
||||||
$validated['ijin_usaha_id'] = json_encode($validated['ijin_usaha_id']);
|
$validated['ijin_usaha_id'] = json_encode($validated['ijin_usaha_id']);
|
||||||
$validated['jenis_aset_id'] = json_encode($validated['jenis_aset_id']);
|
if (empty($validated['jenis_aset_id'])) {
|
||||||
|
$validated['jenis_aset_id'] = json_encode([]);
|
||||||
|
} else {
|
||||||
|
$validated['jenis_aset_id'] = json_encode($validated['jenis_aset_id']);
|
||||||
|
}
|
||||||
|
|
||||||
// Perbarui data di database
|
// Perbarui data di database
|
||||||
KJPP::where('id', $id)->update($validated);
|
KJPP::where('id', $id)->update($validated);
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class KJPPRequest extends FormRequest
|
|||||||
'detail_nomor_hp_pic_marketing' => 'nullable',
|
'detail_nomor_hp_pic_marketing' => 'nullable',
|
||||||
'ijin_usaha_id' => 'required|array',
|
'ijin_usaha_id' => 'required|array',
|
||||||
'ijin_usaha_id.*' => 'exists:ijin_usaha,code',
|
'ijin_usaha_id.*' => 'exists:ijin_usaha,code',
|
||||||
'jenis_aset_id' => 'required|array',
|
'jenis_aset_id' => 'nullable|array',
|
||||||
'jenis_aset_id.*' => 'exists:jenis_jaminan,code',
|
'jenis_aset_id.*' => 'exists:jenis_jaminan,code',
|
||||||
'attachment' => 'nullable|mimes:pdf|max:1024'
|
'attachment' => 'nullable|mimes:pdf|max:1024'
|
||||||
];
|
];
|
||||||
@@ -98,7 +98,6 @@ class KJPPRequest extends FormRequest
|
|||||||
'nomor_hp_pic_marketing.numeric' => 'Nomor HP PIC Marketing harus berupa angka!',
|
'nomor_hp_pic_marketing.numeric' => 'Nomor HP PIC Marketing harus berupa angka!',
|
||||||
'nomor_hp_pic_marketing.digits_between' => 'Nomor HP PIC Marketing minimum 10 digit dan maksimum 15 digit!',
|
'nomor_hp_pic_marketing.digits_between' => 'Nomor HP PIC Marketing minimum 10 digit dan maksimum 15 digit!',
|
||||||
'ijin_usaha_id.required' => 'Ijin Usaha Wajib diisi!',
|
'ijin_usaha_id.required' => 'Ijin Usaha Wajib diisi!',
|
||||||
'jenis_aset_id.required' => 'Jenis Aset Wajib diisi!',
|
|
||||||
'attachment.mimes' => 'Attachment harus berformat pdf!',
|
'attachment.mimes' => 'Attachment harus berformat pdf!',
|
||||||
'attachment.max' => 'Attachment berukuran maksimum 1 MB!',
|
'attachment.max' => 'Attachment berukuran maksimum 1 MB!',
|
||||||
];
|
];
|
||||||
|
|||||||
28
database/migrations/2024_12_10_091151_update_kjpp_table.php
Normal file
28
database/migrations/2024_12_10_091151_update_kjpp_table.php
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::table('kjpp', function (Blueprint $table) {
|
||||||
|
$table->string('jenis_aset_id')->nullable()->change();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('kjpp', function (Blueprint $table) {
|
||||||
|
$table->string('jenis_aset_id')->change();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -250,7 +250,7 @@
|
|||||||
Pengalaman (Jenis Aset)
|
Pengalaman (Jenis Aset)
|
||||||
</label>
|
</label>
|
||||||
<div class="flex flex-wrap items-baseline w-full gap-1">
|
<div class="flex flex-wrap items-baseline w-full gap-1">
|
||||||
@if (isset($kjpp->jenis_aset_id))
|
@if (isset($kjpp->jenis_aset_id) && !empty(json_decode($kjpp->jenis_aset_id, true)))
|
||||||
@foreach (json_decode($kjpp->jenis_aset_id, true) as $aset_code)
|
@foreach (json_decode($kjpp->jenis_aset_id, true) as $aset_code)
|
||||||
@php
|
@php
|
||||||
$jenis_aset = $jenis_jaminan->firstWhere('code', $aset_code);
|
$jenis_aset = $jenis_jaminan->firstWhere('code', $aset_code);
|
||||||
@@ -263,8 +263,8 @@
|
|||||||
@endif
|
@endif
|
||||||
@endforeach
|
@endforeach
|
||||||
@else
|
@else
|
||||||
<span class="flex flex-row space-x-4 text-white font-medium text-sm dark-mode:text-gray-600">
|
<span class="flex flex-row space-x-4 text-gray-600 font-medium text-sm dark-mode:text-gray-600">
|
||||||
No asset type selected.
|
-
|
||||||
</span>
|
</span>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user