Merge branch 'staging' of https://git.putrakuningan.com/daengdeni/lpj into tender
This commit is contained in:
@@ -81,6 +81,7 @@ use Modules\Lpj\Http\Requests\SurveyorRequest;
|
||||
use Modules\Lpj\Http\Requests\FormSurveyorRequest;
|
||||
use Modules\Lpj\Emails\SendJadwalKunjunganEmail;
|
||||
use App\Helpers\Lpj;
|
||||
use Modules\Lpj\Models\Authorization;
|
||||
|
||||
class SurveyorController extends Controller
|
||||
{
|
||||
@@ -366,7 +367,7 @@ class SurveyorController extends Controller
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'message' => 'Data berhasil disimpan',
|
||||
'file' => $newFoto
|
||||
'path' => $newFoto[0]['path'],
|
||||
], 200);
|
||||
}
|
||||
|
||||
@@ -1073,7 +1074,12 @@ class SurveyorController extends Controller
|
||||
|
||||
// Pastikan input adalah array dan index valid
|
||||
if (is_array($inputValue) && isset($inputValue[$index])) {
|
||||
$pembanding[$field] = $inputValue[$index];
|
||||
$value = $inputValue[$index];
|
||||
// Format hanya untuk harga, harga_diskon, dan total
|
||||
if (in_array($field, ['harga', 'harga_diskon', 'total'])) {
|
||||
$value = preg_replace('/[^0-9]/', '', $value); // Hapus karakter non-angka
|
||||
}
|
||||
$pembanding[$field] = $value;
|
||||
} else {
|
||||
$pembanding[$field] = null;
|
||||
}
|
||||
@@ -1178,6 +1184,9 @@ class SurveyorController extends Controller
|
||||
if ($request->filled($field)) {
|
||||
$newValue = $request->input($field);
|
||||
|
||||
if (in_array($field, ['harga', 'harga_diskon', 'total'])) {
|
||||
$newValue = preg_replace('/[^0-9]/', '', $newValue);
|
||||
}
|
||||
// Fields untuk tanah
|
||||
if (in_array($field, ['luas_tanah'])) {
|
||||
// Pastikan struktur array ada sebelum diakses
|
||||
@@ -1327,7 +1336,9 @@ class SurveyorController extends Controller
|
||||
foreach ($fields as $field) {
|
||||
if ($request->filled($field)) {
|
||||
$newValue = $request->input($field);
|
||||
|
||||
if (in_array($field, ['harga', 'harga_diskon', 'total'])) {
|
||||
$newValue = preg_replace('/[^0-9]/', '', $newValue);
|
||||
}
|
||||
// Fields untuk alamat dalam asset
|
||||
if (in_array($field, ['address', 'village_code', 'district_code', 'city_code', 'province_code'])) {
|
||||
|
||||
@@ -3532,7 +3543,7 @@ class SurveyorController extends Controller
|
||||
: 'lpj::surveyor.components.print-out.main';
|
||||
|
||||
// Generate PDF
|
||||
$pdf = PDF::loadView($templateView, compact('permohonan', 'basicData', 'forminspeksi','alamat'));
|
||||
$pdf = PDF::loadView($templateView, compact('permohonan', 'basicData', 'forminspeksi', 'alamat'));
|
||||
$pdf->setPaper('A4', 'portrait');
|
||||
|
||||
// Tentukan nama file PDF
|
||||
|
||||
Reference in New Issue
Block a user