update approval debitur
This commit is contained in:
parent
bfe89659e3
commit
670f1738da
@ -94,6 +94,7 @@
|
|||||||
'Parameter Jenis Jaminan' => 'GuaranteeType',
|
'Parameter Jenis Jaminan' => 'GuaranteeType',
|
||||||
'Parameter Jenis Fasilitas' => 'FacilityType',
|
'Parameter Jenis Fasilitas' => 'FacilityType',
|
||||||
'Parameter Jenis Pinjaman' => 'LoanType',
|
'Parameter Jenis Pinjaman' => 'LoanType',
|
||||||
|
'Parameter Debitur' => 'Debitur',
|
||||||
];
|
];
|
||||||
try {
|
try {
|
||||||
$approval = Approval::findOrFail($id);
|
$approval = Approval::findOrFail($id);
|
||||||
@ -148,7 +149,9 @@
|
|||||||
'message' => 'Approval ' . $approval->description . ' successfully . '
|
'message' => 'Approval ' . $approval->description . ' successfully . '
|
||||||
]);
|
]);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
echo json_encode(['status' => 'error', 'message' => 'Approval ' . $approval->description . ' failed . ']);
|
echo json_encode(['status' => 'error',
|
||||||
|
'message' => 'Approval ' . $approval->description . ' failed . '
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
protected $listeners = [
|
protected $listeners = [
|
||||||
'delete' => 'delete',
|
'delete' => 'delete',
|
||||||
'update' => 'update',
|
'update' => 'update',
|
||||||
'reload' => 'reload',
|
'reload' => 'reload',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function render()
|
public function render()
|
||||||
@ -56,6 +56,9 @@
|
|||||||
// Emit a success event with a message
|
// Emit a success event with a message
|
||||||
$debitur = Debitur::find($this->id);
|
$debitur = Debitur::find($this->id);
|
||||||
|
|
||||||
|
$data['updated_by'] = auth()->user()->id;
|
||||||
|
$data['updated_at'] = now();
|
||||||
|
|
||||||
$approval = [
|
$approval = [
|
||||||
'method' => 'update',
|
'method' => 'update',
|
||||||
'menu' => 'Parameter Debitur',
|
'menu' => 'Parameter Debitur',
|
||||||
@ -81,6 +84,9 @@
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Emit a success event with a message
|
// Emit a success event with a message
|
||||||
|
$data['created_by'] = auth()->user()->id;
|
||||||
|
$data['created_at'] = now();
|
||||||
|
|
||||||
$approval = [
|
$approval = [
|
||||||
'method' => 'create',
|
'method' => 'create',
|
||||||
'menu' => 'Parameter Debitur',
|
'menu' => 'Parameter Debitur',
|
||||||
@ -129,14 +135,19 @@
|
|||||||
|
|
||||||
public function delete($id)
|
public function delete($id)
|
||||||
{
|
{
|
||||||
$debitur = Debitur::find($id);
|
$old = Debitur::find($id);
|
||||||
$debitur->delete_by = auth()->user()->id;
|
unset($old->deleted_at);
|
||||||
|
unset($old->deleted_by);
|
||||||
|
|
||||||
|
$debitur = Debitur::find($id);
|
||||||
|
$debitur->delete_by = auth()->user()->id;
|
||||||
$debitur->deleted_at = now();
|
$debitur->deleted_at = now();
|
||||||
|
|
||||||
$approval = [
|
$approval = [
|
||||||
'method' => 'delete',
|
'method' => 'delete',
|
||||||
'menu' => 'Parameter Debitur',
|
'menu' => 'Parameter Debitur',
|
||||||
'old_request' => json_encode($debitur),
|
'old_request' => json_encode($old),
|
||||||
|
'new_request' => json_encode($debitur),
|
||||||
'description' => 'Delete Parameter Debitur',
|
'description' => 'Delete Parameter Debitur',
|
||||||
'status' => '0',
|
'status' => '0',
|
||||||
'ref' => $debitur->kode
|
'ref' => $debitur->kode
|
||||||
|
Loading…
Reference in New Issue
Block a user