Fix export data lelong

This commit is contained in:
Amir
2022-11-16 10:09:25 +08:00
parent fa89519762
commit 501c46d839
+5 -3
View File
@@ -997,9 +997,8 @@ class LelongController extends Controller
foreach ($request->lelongbidmarhun as $data) { foreach ($request->lelongbidmarhun as $data) {
$lelmarhun_to_be_inserted = new LelMarhun(); $lelmarhun_to_be_inserted = new LelMarhun();
$lelmarhun_to_be_inserted->kodcaw = $request['kodcaw']; $lelmarhun_to_be_inserted->kodcaw = $request->kodcaw;
$lelmarhun_to_be_inserted->norujukan = $data['norujukan']; $lelmarhun_to_be_inserted->norujukan = $data['norujukan'];
$lelmarhun_to_be_inserted->t_gadai = $data['t_gadai'];
$lelmarhun_to_be_inserted->nota = $data['nota']; $lelmarhun_to_be_inserted->nota = $data['nota'];
$lelmarhun_to_be_inserted->batch_no = $newBatchNo; $lelmarhun_to_be_inserted->batch_no = $newBatchNo;
@@ -1008,12 +1007,15 @@ class LelongController extends Controller
LelMarhun::on($cawangan['mysql'])->insert($lelmarhun_arr); LelMarhun::on($cawangan['mysql'])->insert($lelmarhun_arr);
if ($request->tunai != null) {
$tunai = Tunai::on($cawangan['mysql'])->create([ $tunai = Tunai::on($cawangan['mysql'])->create([
'tarikh' => $request->tarikh, 'tarikh' => $request->tarikh,
'kodlaluan' => "LELONG", 'kodlaluan' => "LELONG",
'masuk' => $request->tunai, 'masuk' => $request->tunai,
]); ]);
}
if ($request->gldetail != null) {
$gldetail = GlDetail::on($cawangan['mysql'])->create([ $gldetail = GlDetail::on($cawangan['mysql'])->create([
'tarikh' => $request->tarikh, 'tarikh' => $request->tarikh,
'dtacct' => "1000/010", 'dtacct' => "1000/010",
@@ -1022,7 +1024,7 @@ class LelongController extends Controller
'descpt' => "SERAHAN LELONG ONLINE", 'descpt' => "SERAHAN LELONG ONLINE",
'amaun' => $request->gldetail 'amaun' => $request->gldetail
]); ]);
}
return response()->json("success"); return response()->json("success");
} }