added audit trails
This commit is contained in:
@@ -19,6 +19,7 @@ use App\Mail\ExpenseApproved;
|
||||
use App\Mail\ExpenseRejected;
|
||||
use App\Mail\FinalApprove;
|
||||
use App\Helpers\WhatsappHelper;
|
||||
use App\Helpers\AuditTrailHelper;
|
||||
|
||||
class FormEntertainmentPresentationController extends Controller
|
||||
{
|
||||
@@ -157,6 +158,7 @@ class FormEntertainmentPresentationController extends Controller
|
||||
'status' => 'On Progress',
|
||||
]);
|
||||
|
||||
AuditTrailHelper::AddAuditTrail('Insert', 'Insert New Expense at Form Entertainment Presentation (' . $expense_number . ')');
|
||||
session()->flash('success', 'Form has been created.');
|
||||
return redirect()->back();
|
||||
}
|
||||
@@ -259,6 +261,7 @@ class FormEntertainmentPresentationController extends Controller
|
||||
'account_number' => $kategori->account_number,
|
||||
]);
|
||||
|
||||
AuditTrailHelper::AddAuditTrail('Update', 'Update Expense at Form Entertainment Presentation (' . $form->expense_number . ')');
|
||||
session()->flash('success', 'Form has been updated.');
|
||||
return redirect()->back();
|
||||
}
|
||||
@@ -309,6 +312,7 @@ class FormEntertainmentPresentationController extends Controller
|
||||
// Send bulk whatsapp
|
||||
WhatsappHelper::approveExpense($phoneNumbers, $expense_number);
|
||||
|
||||
AuditTrailHelper::AddAuditTrail('Approve', 'Approved Expense at Form Entertainment Presentation (' . $expense_number . ')');
|
||||
session()->flash('success', 'Form has been approved.');
|
||||
return redirect()->back();
|
||||
}
|
||||
@@ -364,6 +368,7 @@ class FormEntertainmentPresentationController extends Controller
|
||||
// send whatsapp message
|
||||
WhatsappHelper::finalApprove($phoneNumbers, $expense_number);
|
||||
|
||||
AuditTrailHelper::AddAuditTrail('Final Approve', 'Final Approved Expense at Form Entertainment Presentation (' . $expense_number . ')');
|
||||
session()->flash('success', 'Form has been final approved.');
|
||||
return redirect()->back();
|
||||
}
|
||||
@@ -379,6 +384,7 @@ class FormEntertainmentPresentationController extends Controller
|
||||
'status' => 'Approved'
|
||||
]);
|
||||
|
||||
AuditTrailHelper::AddAuditTrail('Open', 'Open Expense at Form Entertainment Presentation (' . $form->expense_number . ')');
|
||||
session()->flash('success', 'Form has been opened.');
|
||||
return redirect()->back();
|
||||
}
|
||||
@@ -427,6 +433,7 @@ class FormEntertainmentPresentationController extends Controller
|
||||
// Send bulk whatsapp
|
||||
WhatsappHelper::rejectExpense($phoneNumbers, $expense_number);
|
||||
|
||||
AuditTrailHelper::AddAuditTrail('Reject', 'Reject Expense at Form Entertainment Presentation (' . $expense_number . ')');
|
||||
session()->flash('success', 'Form has been rejected.');
|
||||
return redirect()->back();
|
||||
}
|
||||
@@ -436,6 +443,7 @@ class FormEntertainmentPresentationController extends Controller
|
||||
$this->checkAuthorization(auth()->user(), ['forms.entertainment.delete']);
|
||||
|
||||
$form = FormEntertaimentPresentation::findOrfail($id);
|
||||
AuditTrailHelper::AddAuditTrail('Delete', 'Delete Record at Form Entertainment Presentation (' . $form->expense_number . ')');
|
||||
$form->delete();
|
||||
|
||||
session()->flash('success', 'Form has been deleted.');
|
||||
|
||||
Reference in New Issue
Block a user