Merge branch 'branch-jagad' into 'main'
add notif expense created See merge request fiqhpratama1/xpendify!19
This commit is contained in:
@@ -98,4 +98,34 @@ class WhatsappHelper
|
|||||||
|
|
||||||
return $response->getBody()->getContents();
|
return $response->getBody()->getContents();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function newExpense($phones, $expense_number, $url = null)
|
||||||
|
{
|
||||||
|
$client = new Client();
|
||||||
|
|
||||||
|
if ($url && !preg_match('/^https?:\/\//', $url)) {
|
||||||
|
$url = 'https://' . $url;
|
||||||
|
}
|
||||||
|
|
||||||
|
$data = [];
|
||||||
|
foreach ($phones as $phone) {
|
||||||
|
$data[] = [
|
||||||
|
'phone' => $phone,
|
||||||
|
'message' => 'Pengajuan pengeluaran baru dengan nomor *' . $expense_number . '* telah dibuat. Silahkan buka link berikut untuk melihat detailnya: ' . $url,
|
||||||
|
'source' => 'web'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$response = $client->post(env('WABLAS_HOST') . '/api/v2/send-message', [
|
||||||
|
'headers' => [
|
||||||
|
'Authorization' => env('WABLAS_TOKEN'),
|
||||||
|
'Content-Type' => 'application/json'
|
||||||
|
],
|
||||||
|
'json' => [
|
||||||
|
'data' => $data
|
||||||
|
]
|
||||||
|
]);
|
||||||
|
|
||||||
|
return $response->getBody()->getContents();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,8 +18,10 @@ use Illuminate\Support\Facades\Mail;
|
|||||||
use App\Mail\ExpenseApproved;
|
use App\Mail\ExpenseApproved;
|
||||||
use App\Mail\ExpenseRejected;
|
use App\Mail\ExpenseRejected;
|
||||||
use App\Mail\FinalApprove;
|
use App\Mail\FinalApprove;
|
||||||
|
use App\Mail\ExpenseCreated;
|
||||||
use App\Helpers\WhatsappHelper;
|
use App\Helpers\WhatsappHelper;
|
||||||
use App\Helpers\AuditTrailHelper;
|
use App\Helpers\AuditTrailHelper;
|
||||||
|
use App\Models\Admin;
|
||||||
use App\Rules\FileType;
|
use App\Rules\FileType;
|
||||||
|
|
||||||
class FormEntertainmentPresentationController extends Controller
|
class FormEntertainmentPresentationController extends Controller
|
||||||
@@ -127,7 +129,6 @@ class FormEntertainmentPresentationController extends Controller
|
|||||||
$bukti_total->getContent(),
|
$bukti_total->getContent(),
|
||||||
$filename
|
$filename
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate sequence number and expense number
|
// Generate sequence number and expense number
|
||||||
@@ -136,7 +137,7 @@ class FormEntertainmentPresentationController extends Controller
|
|||||||
$expense_number = $region->code . '-' . $cabang->code . '-ETY-' . date('ym') . $formatted_sequence_number;
|
$expense_number = $region->code . '-' . $cabang->code . '-ETY-' . date('ym') . $formatted_sequence_number;
|
||||||
|
|
||||||
// Save the form data
|
// Save the form data
|
||||||
FormEntertaimentPresentation::create([
|
$form = FormEntertaimentPresentation::create([
|
||||||
'expense_number' => $expense_number,
|
'expense_number' => $expense_number,
|
||||||
'user_id' => auth()->user()->id,
|
'user_id' => auth()->user()->id,
|
||||||
'tanggal' => $request->tanggal,
|
'tanggal' => $request->tanggal,
|
||||||
@@ -151,6 +152,40 @@ class FormEntertainmentPresentationController extends Controller
|
|||||||
'status' => 'On Progress',
|
'status' => 'On Progress',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
// Send notification to MIS and Admin Region
|
||||||
|
$roles = ['Marketing Information System', 'Admin Region'];
|
||||||
|
$recipients = [];
|
||||||
|
$phoneNumbers = [];
|
||||||
|
|
||||||
|
$name = auth()->user()->name;
|
||||||
|
$tanggal = $form->tanggal;
|
||||||
|
$total = $form->total;
|
||||||
|
|
||||||
|
// Collect all recipients (emails and phone numbers) for the specified roles
|
||||||
|
foreach ($roles as $role) {
|
||||||
|
$users = Admin::getUserByRoleName($role);
|
||||||
|
foreach ($users as $user) {
|
||||||
|
$recipients[] = $user->email;
|
||||||
|
$phoneNumbers[] = $user->phone;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove duplicate email addresses, if any
|
||||||
|
$recipients = array_unique($recipients);
|
||||||
|
|
||||||
|
// Generate URL and send WhatsApp notification
|
||||||
|
$url = route('forms.entertainment.view', $form->id);
|
||||||
|
WhatsappHelper::newExpense($phoneNumbers, $expense_number, $url);
|
||||||
|
|
||||||
|
// Send bulk email
|
||||||
|
Mail::to($recipients)->send(new ExpenseCreated(
|
||||||
|
$name,
|
||||||
|
$expense_number,
|
||||||
|
$tanggal,
|
||||||
|
$total,
|
||||||
|
$url
|
||||||
|
));
|
||||||
|
|
||||||
AuditTrailHelper::AddAuditTrail('Insert', 'Insert New Expense at Form Entertainment Presentation (' . $expense_number . ')');
|
AuditTrailHelper::AddAuditTrail('Insert', 'Insert New Expense at Form Entertainment Presentation (' . $expense_number . ')');
|
||||||
session()->flash('success', 'Form has been created.');
|
session()->flash('success', 'Form has been created.');
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
@@ -212,7 +247,6 @@ class FormEntertainmentPresentationController extends Controller
|
|||||||
$bukti_total->getContent(),
|
$bukti_total->getContent(),
|
||||||
$filename
|
$filename
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save the form data
|
// Save the form data
|
||||||
@@ -253,7 +287,7 @@ class FormEntertainmentPresentationController extends Controller
|
|||||||
$name = $form->user->name;
|
$name = $form->user->name;
|
||||||
$expense_number = $form->expense_number;
|
$expense_number = $form->expense_number;
|
||||||
$tanggal = $form->tanggal;
|
$tanggal = $form->tanggal;
|
||||||
$total = $form->total;
|
$total = $form->approved_total;
|
||||||
|
|
||||||
// Collect all recipients
|
// Collect all recipients
|
||||||
$recipients = [$form->user->email, auth()->user()->email];
|
$recipients = [$form->user->email, auth()->user()->email];
|
||||||
@@ -273,18 +307,19 @@ class FormEntertainmentPresentationController extends Controller
|
|||||||
$recipients = array_unique($recipients);
|
$recipients = array_unique($recipients);
|
||||||
$phoneNumbers = array_unique($phoneNumbers);
|
$phoneNumbers = array_unique($phoneNumbers);
|
||||||
|
|
||||||
// Send bulk email
|
|
||||||
// Mail::to($recipients)->send(new ExpenseApproved(
|
|
||||||
// $name,
|
|
||||||
// $expense_number,
|
|
||||||
// $tanggal,
|
|
||||||
// $total
|
|
||||||
// ));
|
|
||||||
|
|
||||||
// Send bulk whatsapp
|
// Send bulk whatsapp
|
||||||
$url = route('forms.entertainment.view', $form->id);
|
$url = route('forms.entertainment.view', $form->id);
|
||||||
WhatsappHelper::approveExpense($phoneNumbers, $expense_number, $url);
|
WhatsappHelper::approveExpense($phoneNumbers, $expense_number, $url);
|
||||||
|
|
||||||
|
// Send bulk email
|
||||||
|
Mail::to($recipients)->send(new ExpenseApproved(
|
||||||
|
$name,
|
||||||
|
$expense_number,
|
||||||
|
$tanggal,
|
||||||
|
$total,
|
||||||
|
$url
|
||||||
|
));
|
||||||
|
|
||||||
AuditTrailHelper::AddAuditTrail('Approve', 'Approved Expense at Form Entertainment Presentation (' . $expense_number . ')');
|
AuditTrailHelper::AddAuditTrail('Approve', 'Approved Expense at Form Entertainment Presentation (' . $expense_number . ')');
|
||||||
session()->flash('success', 'Form has been approved.');
|
session()->flash('success', 'Form has been approved.');
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
@@ -310,7 +345,7 @@ class FormEntertainmentPresentationController extends Controller
|
|||||||
$name = $form->user->name;
|
$name = $form->user->name;
|
||||||
$expense_number = $form->expense_number;
|
$expense_number = $form->expense_number;
|
||||||
$tanggal = $form->tanggal;
|
$tanggal = $form->tanggal;
|
||||||
$total = $form->total;
|
$total = $form->approved_total;
|
||||||
|
|
||||||
// Collect all recipients
|
// Collect all recipients
|
||||||
$recipients = [$form->user->email, auth()->user()->email];
|
$recipients = [$form->user->email, auth()->user()->email];
|
||||||
@@ -330,18 +365,19 @@ class FormEntertainmentPresentationController extends Controller
|
|||||||
$recipients = array_unique($recipients);
|
$recipients = array_unique($recipients);
|
||||||
$phoneNumbers = array_unique($phoneNumbers);
|
$phoneNumbers = array_unique($phoneNumbers);
|
||||||
|
|
||||||
// Send bulk email
|
|
||||||
// Mail::to($recipients)->send(new FinalApprove(
|
|
||||||
// $name,
|
|
||||||
// $expense_number,
|
|
||||||
// $tanggal,
|
|
||||||
// $total
|
|
||||||
// ));
|
|
||||||
|
|
||||||
// send whatsapp message
|
// send whatsapp message
|
||||||
$url = route('forms.entertainment.view', $form->id);
|
$url = route('forms.entertainment.view', $form->id);
|
||||||
WhatsappHelper::approveExpense($phoneNumbers, $expense_number, $url);
|
WhatsappHelper::approveExpense($phoneNumbers, $expense_number, $url);
|
||||||
|
|
||||||
|
// Send bulk email
|
||||||
|
Mail::to($recipients)->send(new FinalApprove(
|
||||||
|
$name,
|
||||||
|
$expense_number,
|
||||||
|
$tanggal,
|
||||||
|
$total,
|
||||||
|
$url
|
||||||
|
));
|
||||||
|
|
||||||
AuditTrailHelper::AddAuditTrail('Final Approve', 'Final Approved Expense at Form Entertainment Presentation (' . $expense_number . ')');
|
AuditTrailHelper::AddAuditTrail('Final Approve', 'Final Approved Expense at Form Entertainment Presentation (' . $expense_number . ')');
|
||||||
session()->flash('success', 'Form has been final approved.');
|
session()->flash('success', 'Form has been final approved.');
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
@@ -396,18 +432,19 @@ class FormEntertainmentPresentationController extends Controller
|
|||||||
$recipients = array_unique($recipients);
|
$recipients = array_unique($recipients);
|
||||||
$phoneNumbers = array_unique($phoneNumbers);
|
$phoneNumbers = array_unique($phoneNumbers);
|
||||||
|
|
||||||
// Send bulk email
|
|
||||||
// Mail::to($recipients)->send(new ExpenseRejected(
|
|
||||||
// $name,
|
|
||||||
// $expense_number,
|
|
||||||
// $tanggal,
|
|
||||||
// $total
|
|
||||||
// ));
|
|
||||||
|
|
||||||
// Send bulk whatsapp
|
// Send bulk whatsapp
|
||||||
$url = route('forms.entertainment.view', $form->id);
|
$url = route('forms.entertainment.view', $form->id);
|
||||||
WhatsappHelper::approveExpense($phoneNumbers, $expense_number, $url);
|
WhatsappHelper::approveExpense($phoneNumbers, $expense_number, $url);
|
||||||
|
|
||||||
|
// Send bulk email
|
||||||
|
Mail::to($recipients)->send(new ExpenseRejected(
|
||||||
|
$name,
|
||||||
|
$expense_number,
|
||||||
|
$tanggal,
|
||||||
|
$total,
|
||||||
|
$url
|
||||||
|
));
|
||||||
|
|
||||||
AuditTrailHelper::AddAuditTrail('Reject', 'Reject Expense at Form Entertainment Presentation (' . $expense_number . ')');
|
AuditTrailHelper::AddAuditTrail('Reject', 'Reject Expense at Form Entertainment Presentation (' . $expense_number . ')');
|
||||||
session()->flash('success', 'Form has been rejected.');
|
session()->flash('success', 'Form has been rejected.');
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
|
|||||||
@@ -17,10 +17,12 @@ use Illuminate\Support\Str;
|
|||||||
use Illuminate\Support\Facades\Mail;
|
use Illuminate\Support\Facades\Mail;
|
||||||
use App\Mail\ExpenseApproved;
|
use App\Mail\ExpenseApproved;
|
||||||
use App\Mail\ExpenseRejected;
|
use App\Mail\ExpenseRejected;
|
||||||
|
use App\Mail\ExpenseCreated;
|
||||||
use App\Mail\FinalApprove;
|
use App\Mail\FinalApprove;
|
||||||
use App\Helpers\WhatsappHelper;
|
use App\Helpers\WhatsappHelper;
|
||||||
use App\Helpers\AuditTrailHelper;
|
use App\Helpers\AuditTrailHelper;
|
||||||
use App\Rules\FileType;
|
use App\Rules\FileType;
|
||||||
|
use App\Models\Admin;
|
||||||
|
|
||||||
class FormMeetingSeminarController extends Controller
|
class FormMeetingSeminarController extends Controller
|
||||||
{
|
{
|
||||||
@@ -168,7 +170,7 @@ class FormMeetingSeminarController extends Controller
|
|||||||
];
|
];
|
||||||
|
|
||||||
// Save the form data
|
// Save the form data
|
||||||
FormMeetingSeminar::create([
|
$form = FormMeetingSeminar::create([
|
||||||
'expense_number' => $expense_number,
|
'expense_number' => $expense_number,
|
||||||
'user_id' => auth()->user()->id,
|
'user_id' => auth()->user()->id,
|
||||||
'allowance' => $data_nominal['allowance'],
|
'allowance' => $data_nominal['allowance'],
|
||||||
@@ -182,6 +184,40 @@ class FormMeetingSeminarController extends Controller
|
|||||||
'status' => 'On Progress',
|
'status' => 'On Progress',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
// Send notification to MIS and Admin Region
|
||||||
|
$roles = ['Marketing Information System', 'Admin Region'];
|
||||||
|
$recipients = [];
|
||||||
|
$phoneNumbers = [];
|
||||||
|
|
||||||
|
$name = auth()->user()->name;
|
||||||
|
$tanggal = $form->created_at;
|
||||||
|
$total = $form->total;
|
||||||
|
|
||||||
|
// Collect all recipients (emails and phone numbers) for the specified roles
|
||||||
|
foreach ($roles as $role) {
|
||||||
|
$users = Admin::getUserByRoleName($role);
|
||||||
|
foreach ($users as $user) {
|
||||||
|
$recipients[] = $user->email;
|
||||||
|
$phoneNumbers[] = $user->phone;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove duplicate email addresses, if any
|
||||||
|
$recipients = array_unique($recipients);
|
||||||
|
|
||||||
|
// Generate URL and send WhatsApp notification
|
||||||
|
$url = route('forms.meeting.view', $form->id);
|
||||||
|
WhatsappHelper::newExpense($phoneNumbers, $expense_number, $url);
|
||||||
|
|
||||||
|
// Send bulk email
|
||||||
|
Mail::to($recipients)->send(new ExpenseCreated(
|
||||||
|
$name,
|
||||||
|
$expense_number,
|
||||||
|
$tanggal,
|
||||||
|
$total,
|
||||||
|
$url
|
||||||
|
));
|
||||||
|
|
||||||
AuditTrailHelper::AddAuditTrail('Insert', 'Insert New Expense at Form Meeting Seminar (' . $expense_number . ')');
|
AuditTrailHelper::AddAuditTrail('Insert', 'Insert New Expense at Form Meeting Seminar (' . $expense_number . ')');
|
||||||
session()->flash('success', 'Form has been created.');
|
session()->flash('success', 'Form has been created.');
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
@@ -316,7 +352,7 @@ class FormMeetingSeminarController extends Controller
|
|||||||
$name = $form->user->name;
|
$name = $form->user->name;
|
||||||
$expense_number = $form->expense_number;
|
$expense_number = $form->expense_number;
|
||||||
$tanggal = $form->created_at;
|
$tanggal = $form->created_at;
|
||||||
$total = $form->total;
|
$total = $form->approved_total;
|
||||||
|
|
||||||
// Collect all recipients
|
// Collect all recipients
|
||||||
$recipients = [$form->user->email, auth()->user()->email];
|
$recipients = [$form->user->email, auth()->user()->email];
|
||||||
@@ -336,18 +372,19 @@ class FormMeetingSeminarController extends Controller
|
|||||||
$recipients = array_unique($recipients);
|
$recipients = array_unique($recipients);
|
||||||
$phoneNumbers = array_unique($phoneNumbers);
|
$phoneNumbers = array_unique($phoneNumbers);
|
||||||
|
|
||||||
// Send bulk email
|
|
||||||
// Mail::to($recipients)->send(new ExpenseApproved(
|
|
||||||
// $name,
|
|
||||||
// $expense_number,
|
|
||||||
// $tanggal,
|
|
||||||
// $total
|
|
||||||
// ));
|
|
||||||
|
|
||||||
// Send bulk WhatsApp message
|
// Send bulk WhatsApp message
|
||||||
$url = route('forms.meeting.view', $form->id);
|
$url = route('forms.meeting.view', $form->id);
|
||||||
WhatsappHelper::approveExpense($phoneNumbers, $expense_number, $url);
|
WhatsappHelper::approveExpense($phoneNumbers, $expense_number, $url);
|
||||||
|
|
||||||
|
// Send bulk email
|
||||||
|
Mail::to($recipients)->send(new ExpenseApproved(
|
||||||
|
$name,
|
||||||
|
$expense_number,
|
||||||
|
$tanggal,
|
||||||
|
$total,
|
||||||
|
$url
|
||||||
|
));
|
||||||
|
|
||||||
AuditTrailHelper::AddAuditTrail('Approve', 'Approve Expense at Form Meeting Seminar (' . $form->expense_number . ')');
|
AuditTrailHelper::AddAuditTrail('Approve', 'Approve Expense at Form Meeting Seminar (' . $form->expense_number . ')');
|
||||||
session()->flash('success', 'Form has been approved.');
|
session()->flash('success', 'Form has been approved.');
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
@@ -373,7 +410,7 @@ class FormMeetingSeminarController extends Controller
|
|||||||
$name = $form->user->name;
|
$name = $form->user->name;
|
||||||
$expense_number = $form->expense_number;
|
$expense_number = $form->expense_number;
|
||||||
$tanggal = $form->created_at;
|
$tanggal = $form->created_at;
|
||||||
$total = $form->total;
|
$total = $form->approved_total;
|
||||||
|
|
||||||
// Collect all recipients
|
// Collect all recipients
|
||||||
$recipients = [$form->user->email, auth()->user()->email];
|
$recipients = [$form->user->email, auth()->user()->email];
|
||||||
@@ -393,18 +430,19 @@ class FormMeetingSeminarController extends Controller
|
|||||||
$recipients = array_unique($recipients);
|
$recipients = array_unique($recipients);
|
||||||
$phoneNumbers = array_unique($phoneNumbers);
|
$phoneNumbers = array_unique($phoneNumbers);
|
||||||
|
|
||||||
// Send bulk email
|
|
||||||
// Mail::to($recipients)->send(new FinalApprove(
|
|
||||||
// $name,
|
|
||||||
// $expense_number,
|
|
||||||
// $tanggal,
|
|
||||||
// $total
|
|
||||||
// ));
|
|
||||||
|
|
||||||
// send whatsapp message
|
// send whatsapp message
|
||||||
$url = route('forms.meeting.view', $form->id);
|
$url = route('forms.meeting.view', $form->id);
|
||||||
WhatsappHelper::finalApprove($phoneNumbers, $expense_number, $url);
|
WhatsappHelper::finalApprove($phoneNumbers, $expense_number, $url);
|
||||||
|
|
||||||
|
// Send bulk email
|
||||||
|
Mail::to($recipients)->send(new FinalApprove(
|
||||||
|
$name,
|
||||||
|
$expense_number,
|
||||||
|
$tanggal,
|
||||||
|
$total,
|
||||||
|
$url
|
||||||
|
));
|
||||||
|
|
||||||
AuditTrailHelper::AddAuditTrail('Final Approve', 'Final Approve Expense at Form Meeting Seminar (' . $form->expense_number . ')');
|
AuditTrailHelper::AddAuditTrail('Final Approve', 'Final Approve Expense at Form Meeting Seminar (' . $form->expense_number . ')');
|
||||||
session()->flash('success', 'Form has been final approved.');
|
session()->flash('success', 'Form has been final approved.');
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
@@ -459,18 +497,19 @@ class FormMeetingSeminarController extends Controller
|
|||||||
$recipients = array_unique($recipients);
|
$recipients = array_unique($recipients);
|
||||||
$phoneNumbers = array_unique($phoneNumbers);
|
$phoneNumbers = array_unique($phoneNumbers);
|
||||||
|
|
||||||
// Send bulk email
|
|
||||||
// Mail::to($recipients)->send(new ExpenseRejected(
|
|
||||||
// $name,
|
|
||||||
// $expense_number,
|
|
||||||
// $tanggal,
|
|
||||||
// $total
|
|
||||||
// ));
|
|
||||||
|
|
||||||
// Send bulk WhatsApp message
|
// Send bulk WhatsApp message
|
||||||
$url = route('forms.meeting.view', $form->id);
|
$url = route('forms.meeting.view', $form->id);
|
||||||
WhatsappHelper::rejectExpense($phoneNumbers, $expense_number, $url);
|
WhatsappHelper::rejectExpense($phoneNumbers, $expense_number, $url);
|
||||||
|
|
||||||
|
// Send bulk email
|
||||||
|
Mail::to($recipients)->send(new ExpenseRejected(
|
||||||
|
$name,
|
||||||
|
$expense_number,
|
||||||
|
$tanggal,
|
||||||
|
$total,
|
||||||
|
$url
|
||||||
|
));
|
||||||
|
|
||||||
AuditTrailHelper::AddAuditTrail('Reject', 'Reject Expense at Form Meeting Seminar (' . $form->expense_number . ')');
|
AuditTrailHelper::AddAuditTrail('Reject', 'Reject Expense at Form Meeting Seminar (' . $form->expense_number . ')');
|
||||||
session()->flash('success', 'Form has been rejected.');
|
session()->flash('success', 'Form has been rejected.');
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
|
|||||||
@@ -18,9 +18,11 @@ use Illuminate\Support\Facades\Mail;
|
|||||||
use App\Mail\ExpenseApproved;
|
use App\Mail\ExpenseApproved;
|
||||||
use App\Mail\ExpenseRejected;
|
use App\Mail\ExpenseRejected;
|
||||||
use App\Mail\FinalApprove;
|
use App\Mail\FinalApprove;
|
||||||
|
use App\Mail\ExpenseCreated;
|
||||||
use App\Helpers\WhatsappHelper;
|
use App\Helpers\WhatsappHelper;
|
||||||
use App\Helpers\AuditTrailHelper;
|
use App\Helpers\AuditTrailHelper;
|
||||||
use App\Rules\FileType;
|
use App\Rules\FileType;
|
||||||
|
use App\Models\Admin;
|
||||||
|
|
||||||
class FormOtherController extends Controller
|
class FormOtherController extends Controller
|
||||||
{
|
{
|
||||||
@@ -135,7 +137,7 @@ class FormOtherController extends Controller
|
|||||||
$expense_number = $region->code . '-' . $cabang->code . '-OTH-' . date('ym') . $formatted_sequence_number;
|
$expense_number = $region->code . '-' . $cabang->code . '-OTH-' . date('ym') . $formatted_sequence_number;
|
||||||
|
|
||||||
// Save the form data
|
// Save the form data
|
||||||
FormOthers::create([
|
$form = FormOthers::create([
|
||||||
'expense_number' => $expense_number,
|
'expense_number' => $expense_number,
|
||||||
'user_id' => auth()->user()->id,
|
'user_id' => auth()->user()->id,
|
||||||
'kategori_id' => $request->kategori_id,
|
'kategori_id' => $request->kategori_id,
|
||||||
@@ -147,7 +149,41 @@ class FormOtherController extends Controller
|
|||||||
'status' => 'On Progress',
|
'status' => 'On Progress',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
AuditTrailHelper::AddAuditTrail('Insert', 'Insert New Expense at Form Entertainment Presentation (' . $expense_number . ')');
|
// Send notification to MIS and Admin Region
|
||||||
|
$roles = ['Marketing Information System', 'Admin Region'];
|
||||||
|
$recipients = [];
|
||||||
|
$phoneNumbers = [];
|
||||||
|
|
||||||
|
$name = auth()->user()->name;
|
||||||
|
$tanggal = $request->tanggal;
|
||||||
|
$total = $request->total;
|
||||||
|
|
||||||
|
// Collect all recipients (emails and phone numbers) for the specified roles
|
||||||
|
foreach ($roles as $role) {
|
||||||
|
$users = Admin::getUserByRoleName($role);
|
||||||
|
foreach ($users as $user) {
|
||||||
|
$recipients[] = $user->email;
|
||||||
|
$phoneNumbers[] = $user->phone;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove duplicate email addresses, if any
|
||||||
|
$recipients = array_unique($recipients);
|
||||||
|
|
||||||
|
// Generate URL and send WhatsApp notification
|
||||||
|
$url = route('forms.other.view', $form->id);
|
||||||
|
WhatsappHelper::newExpense($phoneNumbers, $expense_number, $url);
|
||||||
|
|
||||||
|
// Send bulk email
|
||||||
|
Mail::to($recipients)->send(new ExpenseCreated(
|
||||||
|
$name,
|
||||||
|
$expense_number,
|
||||||
|
$tanggal,
|
||||||
|
$total,
|
||||||
|
$url
|
||||||
|
));
|
||||||
|
|
||||||
|
AuditTrailHelper::AddAuditTrail('Insert', 'Insert New Expense at Form Other (' . $expense_number . ')');
|
||||||
session()->flash('success', 'Form has been created.');
|
session()->flash('success', 'Form has been created.');
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
@@ -218,7 +254,7 @@ class FormOtherController extends Controller
|
|||||||
'account_number' => $kategori->account_number,
|
'account_number' => $kategori->account_number,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
AuditTrailHelper::AddAuditTrail('Update', 'Update Record at Form Entertainment Presentation (' . $form->expense_number . ')');
|
AuditTrailHelper::AddAuditTrail('Update', 'Update Record at Form Other (' . $form->expense_number . ')');
|
||||||
session()->flash('success', 'Form has been updated.');
|
session()->flash('success', 'Form has been updated.');
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
@@ -244,7 +280,7 @@ class FormOtherController extends Controller
|
|||||||
$name = $form->user->name;
|
$name = $form->user->name;
|
||||||
$expense_number = $form->expense_number;
|
$expense_number = $form->expense_number;
|
||||||
$tanggal = $form->tanggal;
|
$tanggal = $form->tanggal;
|
||||||
$total = $form->total;
|
$total = $form->approved_total;
|
||||||
|
|
||||||
// Collect all recipients
|
// Collect all recipients
|
||||||
$recipients = [$form->user->email, auth()->user()->email];
|
$recipients = [$form->user->email, auth()->user()->email];
|
||||||
@@ -264,19 +300,20 @@ class FormOtherController extends Controller
|
|||||||
$recipients = array_unique($recipients);
|
$recipients = array_unique($recipients);
|
||||||
$phoneNumbers = array_unique($phoneNumbers);
|
$phoneNumbers = array_unique($phoneNumbers);
|
||||||
|
|
||||||
// Send bulk email
|
|
||||||
// Mail::to($recipients)->send(new ExpenseApproved(
|
|
||||||
// $name,
|
|
||||||
// $expense_number,
|
|
||||||
// $tanggal,
|
|
||||||
// $total
|
|
||||||
// ));
|
|
||||||
|
|
||||||
// Send bulk WhatsApp message
|
// Send bulk WhatsApp message
|
||||||
$url = route('forms.other.view', $form->id);
|
$url = route('forms.other.view', $form->id);
|
||||||
WhatsappHelper::approveExpense($phoneNumbers, $expense_number, $url);
|
WhatsappHelper::approveExpense($phoneNumbers, $expense_number, $url);
|
||||||
|
|
||||||
AuditTrailHelper::AddAuditTrail('Approve', 'Approve Expense at Form Entertainment Presentation (' . $form->expense_number . ')');
|
// Send bulk email
|
||||||
|
Mail::to($recipients)->send(new ExpenseApproved(
|
||||||
|
$name,
|
||||||
|
$expense_number,
|
||||||
|
$tanggal,
|
||||||
|
$total,
|
||||||
|
$url
|
||||||
|
));
|
||||||
|
|
||||||
|
AuditTrailHelper::AddAuditTrail('Approve', 'Approve Expense at Form Other (' . $form->expense_number . ')');
|
||||||
session()->flash('success', 'Form has been approved.');
|
session()->flash('success', 'Form has been approved.');
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
@@ -301,7 +338,7 @@ class FormOtherController extends Controller
|
|||||||
$name = $form->user->name;
|
$name = $form->user->name;
|
||||||
$expense_number = $form->expense_number;
|
$expense_number = $form->expense_number;
|
||||||
$tanggal = $form->tanggal;
|
$tanggal = $form->tanggal;
|
||||||
$total = $form->total;
|
$total = $form->approved_total;
|
||||||
|
|
||||||
// Collect all recipients
|
// Collect all recipients
|
||||||
$recipients = [$form->user->email, auth()->user()->email];
|
$recipients = [$form->user->email, auth()->user()->email];
|
||||||
@@ -321,19 +358,20 @@ class FormOtherController extends Controller
|
|||||||
$recipients = array_unique($recipients);
|
$recipients = array_unique($recipients);
|
||||||
$phoneNumbers = array_unique($phoneNumbers);
|
$phoneNumbers = array_unique($phoneNumbers);
|
||||||
|
|
||||||
// Send bulk email
|
|
||||||
// Mail::to($recipients)->send(new FinalApprove(
|
|
||||||
// $name,
|
|
||||||
// $expense_number,
|
|
||||||
// $tanggal,
|
|
||||||
// $total
|
|
||||||
// ));
|
|
||||||
|
|
||||||
// send whatsapp message
|
// send whatsapp message
|
||||||
$url = route('forms.other.view', $form->id);
|
$url = route('forms.other.view', $form->id);
|
||||||
WhatsappHelper::approveExpense($phoneNumbers, $expense_number, $url);
|
WhatsappHelper::approveExpense($phoneNumbers, $expense_number, $url);
|
||||||
|
|
||||||
AuditTrailHelper::AddAuditTrail('Final Approve', 'Final Approve Expense at Form Entertainment Presentation (' . $form->expense_number . ')');
|
// Send bulk email
|
||||||
|
Mail::to($recipients)->send(new FinalApprove(
|
||||||
|
$name,
|
||||||
|
$expense_number,
|
||||||
|
$tanggal,
|
||||||
|
$total,
|
||||||
|
$url
|
||||||
|
));
|
||||||
|
|
||||||
|
AuditTrailHelper::AddAuditTrail('Final Approve', 'Final Approve Expense at Form Other (' . $form->expense_number . ')');
|
||||||
session()->flash('success', 'Form has been final approved.');
|
session()->flash('success', 'Form has been final approved.');
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
@@ -349,7 +387,7 @@ class FormOtherController extends Controller
|
|||||||
'status' => 'Approved'
|
'status' => 'Approved'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
AuditTrailHelper::AddAuditTrail('Open', 'Open Expense at Form Entertainment Presentation (' . $form->expense_number . ')');
|
AuditTrailHelper::AddAuditTrail('Open', 'Open Expense at Form Other (' . $form->expense_number . ')');
|
||||||
session()->flash('success', 'Form has been opened.');
|
session()->flash('success', 'Form has been opened.');
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
@@ -387,19 +425,20 @@ class FormOtherController extends Controller
|
|||||||
$recipients = array_unique($recipients);
|
$recipients = array_unique($recipients);
|
||||||
$phoneNumbers = array_unique($phoneNumbers);
|
$phoneNumbers = array_unique($phoneNumbers);
|
||||||
|
|
||||||
// Send bulk email
|
|
||||||
// Mail::to($recipients)->send(new ExpenseRejected(
|
|
||||||
// $name,
|
|
||||||
// $expense_number,
|
|
||||||
// $tanggal,
|
|
||||||
// $total
|
|
||||||
// ));
|
|
||||||
|
|
||||||
// Send bulk WhatsApp message
|
// Send bulk WhatsApp message
|
||||||
$url = route('forms.other.view', $form->id);
|
$url = route('forms.other.view', $form->id);
|
||||||
WhatsappHelper::approveExpense($phoneNumbers, $expense_number, $url);
|
WhatsappHelper::approveExpense($phoneNumbers, $expense_number, $url);
|
||||||
|
|
||||||
AuditTrailHelper::AddAuditTrail('Reject', 'Reject Expense at Form Entertainment Presentation (' . $form->expense_number . ')');
|
// Send bulk email
|
||||||
|
Mail::to($recipients)->send(new ExpenseRejected(
|
||||||
|
$name,
|
||||||
|
$expense_number,
|
||||||
|
$tanggal,
|
||||||
|
$total,
|
||||||
|
$url
|
||||||
|
));
|
||||||
|
|
||||||
|
AuditTrailHelper::AddAuditTrail('Reject', 'Reject Expense at Form Other (' . $form->expense_number . ')');
|
||||||
session()->flash('success', 'Form has been rejected.');
|
session()->flash('success', 'Form has been rejected.');
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
@@ -415,7 +454,7 @@ class FormOtherController extends Controller
|
|||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
|
|
||||||
AuditTrailHelper::AddAuditTrail('Delete', 'Delete Record at Form Entertainment Presentation (' . $form->expense_number . ')');
|
AuditTrailHelper::AddAuditTrail('Delete', 'Delete Record at Form Other (' . $form->expense_number . ')');
|
||||||
|
|
||||||
$form->delete();
|
$form->delete();
|
||||||
|
|
||||||
|
|||||||
@@ -17,10 +17,12 @@ use Illuminate\Support\Facades\Mail;
|
|||||||
use App\Mail\ExpenseApproved;
|
use App\Mail\ExpenseApproved;
|
||||||
use App\Mail\ExpenseRejected;
|
use App\Mail\ExpenseRejected;
|
||||||
use App\Mail\FinalApprove;
|
use App\Mail\FinalApprove;
|
||||||
|
use App\Mail\ExpenseCreated;
|
||||||
use App\Helpers\WhatsappHelper;
|
use App\Helpers\WhatsappHelper;
|
||||||
use App\Helpers\AuditTrailHelper;
|
use App\Helpers\AuditTrailHelper;
|
||||||
use App\Helpers\NextCloudHelper;
|
use App\Helpers\NextCloudHelper;
|
||||||
use App\Rules\FileType;
|
use App\Rules\FileType;
|
||||||
|
use App\Models\Admin;
|
||||||
|
|
||||||
class FormUpCountryController extends Controller
|
class FormUpCountryController extends Controller
|
||||||
{
|
{
|
||||||
@@ -192,7 +194,7 @@ class FormUpCountryController extends Controller
|
|||||||
];
|
];
|
||||||
|
|
||||||
// Save the form data
|
// Save the form data
|
||||||
FormUpCountry::create([
|
$form = FormUpCountry::create([
|
||||||
'expense_number' => $expense_number,
|
'expense_number' => $expense_number,
|
||||||
'user_id' => auth()->user()->id,
|
'user_id' => auth()->user()->id,
|
||||||
'rayon_id' => $request->rayon_id,
|
'rayon_id' => $request->rayon_id,
|
||||||
@@ -212,7 +214,41 @@ class FormUpCountryController extends Controller
|
|||||||
'status' => 'On Progress',
|
'status' => 'On Progress',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
AuditTrailHelper::AddAuditTrail('Insert', 'Insert New Expense at Form Entertainment Presentation (' . $expense_number . ')');
|
// Send notification to MIS and Admin Region
|
||||||
|
$roles = ['Marketing Information System', 'Admin Region'];
|
||||||
|
$recipients = [];
|
||||||
|
$phoneNumbers = [];
|
||||||
|
|
||||||
|
$name = auth()->user()->name;
|
||||||
|
$tanggal = $form->tanggal;
|
||||||
|
$total = $form->total;
|
||||||
|
|
||||||
|
// Collect all recipients (emails and phone numbers) for the specified roles
|
||||||
|
foreach ($roles as $role) {
|
||||||
|
$users = Admin::getUserByRoleName($role);
|
||||||
|
foreach ($users as $user) {
|
||||||
|
$recipients[] = $user->email;
|
||||||
|
$phoneNumbers[] = $user->phone;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove duplicate email addresses, if any
|
||||||
|
$recipients = array_unique($recipients);
|
||||||
|
|
||||||
|
// Generate URL and send WhatsApp notification
|
||||||
|
$url = route('forms.up-country.view', $form->id);
|
||||||
|
WhatsappHelper::newExpense($phoneNumbers, $expense_number, $url);
|
||||||
|
|
||||||
|
// Send bulk email
|
||||||
|
Mail::to($recipients)->send(new ExpenseCreated(
|
||||||
|
$name,
|
||||||
|
$expense_number,
|
||||||
|
$tanggal,
|
||||||
|
$total,
|
||||||
|
$url
|
||||||
|
));
|
||||||
|
|
||||||
|
AuditTrailHelper::AddAuditTrail('Insert', 'Insert New Expense at Form Up Country (' . $expense_number . ')');
|
||||||
session()->flash('success', 'Form has been created.');
|
session()->flash('success', 'Form has been created.');
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
@@ -342,7 +378,7 @@ class FormUpCountryController extends Controller
|
|||||||
'account_number' => $kategori->account_number,
|
'account_number' => $kategori->account_number,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
AuditTrailHelper::AddAuditTrail('Update', 'Update Record at Form Entertainment Presentation (' . $form->expense_number . ')');
|
AuditTrailHelper::AddAuditTrail('Update', 'Update Record at Form Up Country (' . $form->expense_number . ')');
|
||||||
session()->flash('success', 'Form has been updated.');
|
session()->flash('success', 'Form has been updated.');
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
@@ -374,7 +410,7 @@ class FormUpCountryController extends Controller
|
|||||||
$name = $form->user->name;
|
$name = $form->user->name;
|
||||||
$expense_number = $form->expense_number;
|
$expense_number = $form->expense_number;
|
||||||
$tanggal = $form->tanggal;
|
$tanggal = $form->tanggal;
|
||||||
$total = $form->total;
|
$total = $form->approved_total;
|
||||||
|
|
||||||
// Collect all recipients
|
// Collect all recipients
|
||||||
$recipients = [$form->user->email, auth()->user()->email];
|
$recipients = [$form->user->email, auth()->user()->email];
|
||||||
@@ -394,19 +430,20 @@ class FormUpCountryController extends Controller
|
|||||||
$recipients = array_unique($recipients);
|
$recipients = array_unique($recipients);
|
||||||
$phoneNumbers = array_unique($phoneNumbers);
|
$phoneNumbers = array_unique($phoneNumbers);
|
||||||
|
|
||||||
// // Send bulk email
|
|
||||||
// Mail::to($recipients)->send(new ExpenseApproved(
|
|
||||||
// $name,
|
|
||||||
// $expense_number,
|
|
||||||
// $tanggal,
|
|
||||||
// $total
|
|
||||||
// ));
|
|
||||||
|
|
||||||
// send whatsapp message
|
// send whatsapp message
|
||||||
$url = route('forms.up-country.view', $form->id);
|
$url = route('forms.up-country.view', $form->id);
|
||||||
WhatsappHelper::approveExpense($phoneNumbers, $expense_number, $url);
|
WhatsappHelper::approveExpense($phoneNumbers, $expense_number, $url);
|
||||||
|
|
||||||
AuditTrailHelper::AddAuditTrail('Approve', 'Approve Expense at Form Entertainment Presentation (' . $form->expense_number . ')');
|
// // Send bulk email
|
||||||
|
Mail::to($recipients)->send(new ExpenseApproved(
|
||||||
|
$name,
|
||||||
|
$expense_number,
|
||||||
|
$tanggal,
|
||||||
|
$total,
|
||||||
|
$url
|
||||||
|
));
|
||||||
|
|
||||||
|
AuditTrailHelper::AddAuditTrail('Approve', 'Approve Expense at Form Up Country (' . $form->expense_number . ')');
|
||||||
session()->flash('success', 'Form has been approved.');
|
session()->flash('success', 'Form has been approved.');
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
@@ -444,19 +481,20 @@ class FormUpCountryController extends Controller
|
|||||||
$recipients = array_unique($recipients);
|
$recipients = array_unique($recipients);
|
||||||
$phoneNumbers = array_unique($phoneNumbers);
|
$phoneNumbers = array_unique($phoneNumbers);
|
||||||
|
|
||||||
// Send bulk email
|
|
||||||
// Mail::to($recipients)->send(new ExpenseRejected(
|
|
||||||
// $name,
|
|
||||||
// $expense_number,
|
|
||||||
// $tanggal,
|
|
||||||
// $total
|
|
||||||
// ));
|
|
||||||
|
|
||||||
// send whatsapp message
|
// send whatsapp message
|
||||||
$url = route('forms.up-country.view', $form->id);
|
$url = route('forms.up-country.view', $form->id);
|
||||||
WhatsappHelper::rejectExpense($phoneNumbers, $expense_number, $url);
|
WhatsappHelper::rejectExpense($phoneNumbers, $expense_number, $url);
|
||||||
|
|
||||||
AuditTrailHelper::AddAuditTrail('Reject', 'Reject Expense at Form Entertainment Presentation (' . $form->expense_number . ')');
|
// Send bulk email
|
||||||
|
Mail::to($recipients)->send(new ExpenseRejected(
|
||||||
|
$name,
|
||||||
|
$expense_number,
|
||||||
|
$tanggal,
|
||||||
|
$total,
|
||||||
|
$url
|
||||||
|
));
|
||||||
|
|
||||||
|
AuditTrailHelper::AddAuditTrail('Reject', 'Reject Expense at Form Up Country (' . $form->expense_number . ')');
|
||||||
session()->flash('success', 'Form has been rejected.');
|
session()->flash('success', 'Form has been rejected.');
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
@@ -481,7 +519,7 @@ class FormUpCountryController extends Controller
|
|||||||
$name = $form->user->name;
|
$name = $form->user->name;
|
||||||
$expense_number = $form->expense_number;
|
$expense_number = $form->expense_number;
|
||||||
$tanggal = $form->tanggal;
|
$tanggal = $form->tanggal;
|
||||||
$total = $form->total;
|
$total = $form->approved_total;
|
||||||
|
|
||||||
// Collect all recipients
|
// Collect all recipients
|
||||||
$recipients = [$form->user->email, auth()->user()->email];
|
$recipients = [$form->user->email, auth()->user()->email];
|
||||||
@@ -501,19 +539,20 @@ class FormUpCountryController extends Controller
|
|||||||
$recipients = array_unique($recipients);
|
$recipients = array_unique($recipients);
|
||||||
$phoneNumbers = array_unique($phoneNumbers);
|
$phoneNumbers = array_unique($phoneNumbers);
|
||||||
|
|
||||||
// Send bulk email
|
|
||||||
// Mail::to($recipients)->send(new FinalApprove(
|
|
||||||
// $name,
|
|
||||||
// $expense_number,
|
|
||||||
// $tanggal,
|
|
||||||
// $total
|
|
||||||
// ));
|
|
||||||
|
|
||||||
// send whatsapp message
|
// send whatsapp message
|
||||||
$url = route('forms.up-country.view', $form->id);
|
$url = route('forms.up-country.view', $form->id);
|
||||||
WhatsappHelper::finalApprove($phoneNumbers, $expense_number, $url);
|
WhatsappHelper::finalApprove($phoneNumbers, $expense_number, $url);
|
||||||
|
|
||||||
AuditTrailHelper::AddAuditTrail('Final Approve', 'Final Approve Expense at Form Entertainment Presentation (' . $form->expense_number . ')');
|
// Send bulk email
|
||||||
|
Mail::to($recipients)->send(new FinalApprove(
|
||||||
|
$name,
|
||||||
|
$expense_number,
|
||||||
|
$tanggal,
|
||||||
|
$total,
|
||||||
|
$url
|
||||||
|
));
|
||||||
|
|
||||||
|
AuditTrailHelper::AddAuditTrail('Final Approve', 'Final Approve Expense at Form Up Country (' . $form->expense_number . ')');
|
||||||
session()->flash('success', 'Form has been final approved.');
|
session()->flash('success', 'Form has been final approved.');
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
@@ -529,7 +568,7 @@ class FormUpCountryController extends Controller
|
|||||||
'status' => 'Approved'
|
'status' => 'Approved'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
AuditTrailHelper::AddAuditTrail('Open', 'Open Expense at Form Entertainment Presentation (' . $form->expense_number . ')');
|
AuditTrailHelper::AddAuditTrail('Open', 'Open Expense at Form Up Country (' . $form->expense_number . ')');
|
||||||
session()->flash('success', 'Form has been opened.');
|
session()->flash('success', 'Form has been opened.');
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
@@ -544,7 +583,7 @@ class FormUpCountryController extends Controller
|
|||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
|
|
||||||
AuditTrailHelper::AddAuditTrail('Delete', 'Delete Record at Form Entertainment Presentation (' . $form->expense_number . ')');
|
AuditTrailHelper::AddAuditTrail('Delete', 'Delete Record at Form Up Country (' . $form->expense_number . ')');
|
||||||
|
|
||||||
$form->delete();
|
$form->delete();
|
||||||
|
|
||||||
|
|||||||
@@ -18,9 +18,11 @@ use Illuminate\Support\Facades\Mail;
|
|||||||
use App\Mail\ExpenseApproved;
|
use App\Mail\ExpenseApproved;
|
||||||
use App\Mail\ExpenseRejected;
|
use App\Mail\ExpenseRejected;
|
||||||
use App\Mail\FinalApprove;
|
use App\Mail\FinalApprove;
|
||||||
|
use App\Mail\ExpenseCreated;
|
||||||
use App\Helpers\WhatsappHelper;
|
use App\Helpers\WhatsappHelper;
|
||||||
use App\Helpers\AuditTrailHelper;
|
use App\Helpers\AuditTrailHelper;
|
||||||
use App\Rules\FileType;
|
use App\Rules\FileType;
|
||||||
|
use App\Models\Admin;
|
||||||
|
|
||||||
class FormVehicleController extends Controller
|
class FormVehicleController extends Controller
|
||||||
{
|
{
|
||||||
@@ -136,7 +138,7 @@ class FormVehicleController extends Controller
|
|||||||
$expense_number = $region->code . '-' . $cabang->code . '-VHC-' . date('ym') . $formatted_sequence_number;
|
$expense_number = $region->code . '-' . $cabang->code . '-VHC-' . date('ym') . $formatted_sequence_number;
|
||||||
|
|
||||||
// Save the form data
|
// Save the form data
|
||||||
FormVehicleRunningCost::create([
|
$form = FormVehicleRunningCost::create([
|
||||||
'expense_number' => $expense_number,
|
'expense_number' => $expense_number,
|
||||||
'user_id' => auth()->user()->id,
|
'user_id' => auth()->user()->id,
|
||||||
'tanggal' => $request->tanggal,
|
'tanggal' => $request->tanggal,
|
||||||
@@ -151,7 +153,41 @@ class FormVehicleController extends Controller
|
|||||||
'status' => 'On Progress',
|
'status' => 'On Progress',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
AuditTrailHelper::AddAuditTrail('Insert', 'Insert New Expense at Form Entertainment Presentation (' . $expense_number . ')');
|
// Send notification to MIS and Admin Region
|
||||||
|
$roles = ['Marketing Information System', 'Admin Region'];
|
||||||
|
$recipients = [];
|
||||||
|
$phoneNumbers = [];
|
||||||
|
|
||||||
|
$name = auth()->user()->name;
|
||||||
|
$tanggal = $form->tanggal;
|
||||||
|
$total = $form->total;
|
||||||
|
|
||||||
|
// Collect all recipients (emails and phone numbers) for the specified roles
|
||||||
|
foreach ($roles as $role) {
|
||||||
|
$users = Admin::getUserByRoleName($role);
|
||||||
|
foreach ($users as $user) {
|
||||||
|
$recipients[] = $user->email;
|
||||||
|
$phoneNumbers[] = $user->phone;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove duplicate email addresses, if any
|
||||||
|
$recipients = array_unique($recipients);
|
||||||
|
|
||||||
|
// Generate URL and send WhatsApp notification
|
||||||
|
$url = route('forms.vehicle.view', $form->id);
|
||||||
|
WhatsappHelper::newExpense($phoneNumbers, $expense_number, $url);
|
||||||
|
|
||||||
|
// Send bulk email
|
||||||
|
Mail::to($recipients)->send(new ExpenseCreated(
|
||||||
|
$name,
|
||||||
|
$expense_number,
|
||||||
|
$tanggal,
|
||||||
|
$total,
|
||||||
|
$url
|
||||||
|
));
|
||||||
|
|
||||||
|
AuditTrailHelper::AddAuditTrail('Insert', 'Insert New Expense at Form Vehicle Running Cost (' . $expense_number . ')');
|
||||||
session()->flash('success', 'Form has been created.');
|
session()->flash('success', 'Form has been created.');
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
@@ -228,7 +264,7 @@ class FormVehicleController extends Controller
|
|||||||
'status' => 'On Progress',
|
'status' => 'On Progress',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
AuditTrailHelper::AddAuditTrail('Update', 'Update Record at Form Entertainment Presentation (' . $form->expense_number . ')');
|
AuditTrailHelper::AddAuditTrail('Update', 'Update Record at Form Vehicle Running Cost (' . $form->expense_number . ')');
|
||||||
session()->flash('success', 'Form has been updated.');
|
session()->flash('success', 'Form has been updated.');
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
@@ -253,7 +289,7 @@ class FormVehicleController extends Controller
|
|||||||
$name = $form->user->name;
|
$name = $form->user->name;
|
||||||
$expense_number = $form->expense_number;
|
$expense_number = $form->expense_number;
|
||||||
$tanggal = $form->tanggal;
|
$tanggal = $form->tanggal;
|
||||||
$total = $form->total;
|
$total = $form->approved_total;
|
||||||
|
|
||||||
// Collect all recipients
|
// Collect all recipients
|
||||||
$recipients = [$form->user->email, auth()->user()->email];
|
$recipients = [$form->user->email, auth()->user()->email];
|
||||||
@@ -273,19 +309,20 @@ class FormVehicleController extends Controller
|
|||||||
$recipients = array_unique($recipients);
|
$recipients = array_unique($recipients);
|
||||||
$phoneNumbers = array_unique($phoneNumbers);
|
$phoneNumbers = array_unique($phoneNumbers);
|
||||||
|
|
||||||
// Send bulk email
|
|
||||||
// Mail::to($recipients)->send(new ExpenseApproved(
|
|
||||||
// $name,
|
|
||||||
// $expense_number,
|
|
||||||
// $tanggal,
|
|
||||||
// $total
|
|
||||||
// ));
|
|
||||||
|
|
||||||
// Send bulk WhatsApp message
|
// Send bulk WhatsApp message
|
||||||
$url = route('forms.vehicle.view', $form->id);
|
$url = route('forms.vehicle.view', $form->id);
|
||||||
WhatsappHelper::approveExpense($phoneNumbers, $expense_number, $url);
|
WhatsappHelper::approveExpense($phoneNumbers, $expense_number, $url);
|
||||||
|
|
||||||
AuditTrailHelper::AddAuditTrail('Approve', 'Approve Expense at Form Entertainment Presentation (' . $form->expense_number . ')');
|
// Send bulk email
|
||||||
|
Mail::to($recipients)->send(new ExpenseApproved(
|
||||||
|
$name,
|
||||||
|
$expense_number,
|
||||||
|
$tanggal,
|
||||||
|
$total,
|
||||||
|
$url
|
||||||
|
));
|
||||||
|
|
||||||
|
AuditTrailHelper::AddAuditTrail('Approve', 'Approve Expense at Form Vehicle Running Cost (' . $form->expense_number . ')');
|
||||||
session()->flash('success', 'Form has been approved.');
|
session()->flash('success', 'Form has been approved.');
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
@@ -310,7 +347,7 @@ class FormVehicleController extends Controller
|
|||||||
$name = $form->user->name;
|
$name = $form->user->name;
|
||||||
$expense_number = $form->expense_number;
|
$expense_number = $form->expense_number;
|
||||||
$tanggal = $form->tanggal;
|
$tanggal = $form->tanggal;
|
||||||
$total = $form->total;
|
$total = $form->approved_total;
|
||||||
|
|
||||||
// Collect all recipients
|
// Collect all recipients
|
||||||
$recipients = [$form->user->email, auth()->user()->email];
|
$recipients = [$form->user->email, auth()->user()->email];
|
||||||
@@ -330,19 +367,20 @@ class FormVehicleController extends Controller
|
|||||||
$recipients = array_unique($recipients);
|
$recipients = array_unique($recipients);
|
||||||
$phoneNumbers = array_unique($phoneNumbers);
|
$phoneNumbers = array_unique($phoneNumbers);
|
||||||
|
|
||||||
// Send bulk email
|
|
||||||
// Mail::to($recipients)->send(new FinalApprove(
|
|
||||||
// $name,
|
|
||||||
// $expense_number,
|
|
||||||
// $tanggal,
|
|
||||||
// $total
|
|
||||||
// ));
|
|
||||||
|
|
||||||
// send whatsapp message
|
// send whatsapp message
|
||||||
$url = route('forms.vehicle.view', $form->id);
|
$url = route('forms.vehicle.view', $form->id);
|
||||||
WhatsappHelper::approveExpense($phoneNumbers, $expense_number, $url);
|
WhatsappHelper::approveExpense($phoneNumbers, $expense_number, $url);
|
||||||
|
|
||||||
AuditTrailHelper::AddAuditTrail('Final Approve', 'Final Approve Expense at Form Entertainment Presentation (' . $form->expense_number . ')');
|
// Send bulk email
|
||||||
|
Mail::to($recipients)->send(new FinalApprove(
|
||||||
|
$name,
|
||||||
|
$expense_number,
|
||||||
|
$tanggal,
|
||||||
|
$total,
|
||||||
|
$url
|
||||||
|
));
|
||||||
|
|
||||||
|
AuditTrailHelper::AddAuditTrail('Final Approve', 'Final Approve Expense at Form Vehicle Running Cost (' . $form->expense_number . ')');
|
||||||
session()->flash('success', 'Form has been final approved.');
|
session()->flash('success', 'Form has been final approved.');
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
@@ -358,7 +396,7 @@ class FormVehicleController extends Controller
|
|||||||
'status' => 'Approved'
|
'status' => 'Approved'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
AuditTrailHelper::AddAuditTrail('Open', 'Open Expense at Form Entertainment Presentation (' . $form->expense_number . ')');
|
AuditTrailHelper::AddAuditTrail('Open', 'Open Expense at Form Vehicle Running Cost (' . $form->expense_number . ')');
|
||||||
session()->flash('success', 'Form has been opened.');
|
session()->flash('success', 'Form has been opened.');
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
@@ -396,19 +434,20 @@ class FormVehicleController extends Controller
|
|||||||
$recipients = array_unique($recipients);
|
$recipients = array_unique($recipients);
|
||||||
$phoneNumbers = array_unique($phoneNumbers);
|
$phoneNumbers = array_unique($phoneNumbers);
|
||||||
|
|
||||||
// Send bulk email
|
|
||||||
// Mail::to($recipients)->send(new ExpenseRejected(
|
|
||||||
// $name,
|
|
||||||
// $expense_number,
|
|
||||||
// $tanggal,
|
|
||||||
// $total
|
|
||||||
// ));
|
|
||||||
|
|
||||||
// Send bulk WhatsApp message
|
// Send bulk WhatsApp message
|
||||||
$url = route('forms.vehicle.view', $form->id);
|
$url = route('forms.vehicle.view', $form->id);
|
||||||
WhatsappHelper::approveExpense($phoneNumbers, $expense_number, $url);
|
WhatsappHelper::approveExpense($phoneNumbers, $expense_number, $url);
|
||||||
|
|
||||||
AuditTrailHelper::AddAuditTrail('Reject', 'Reject Expense at Form Entertainment Presentation (' . $form->expense_number . ')');
|
// Send bulk email
|
||||||
|
Mail::to($recipients)->send(new ExpenseRejected(
|
||||||
|
$name,
|
||||||
|
$expense_number,
|
||||||
|
$tanggal,
|
||||||
|
$total,
|
||||||
|
$url
|
||||||
|
));
|
||||||
|
|
||||||
|
AuditTrailHelper::AddAuditTrail('Reject', 'Reject Expense at Form Vehicle Running Cost (' . $form->expense_number . ')');
|
||||||
session()->flash('success', 'Form has been rejected.');
|
session()->flash('success', 'Form has been rejected.');
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
@@ -424,7 +463,7 @@ class FormVehicleController extends Controller
|
|||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
|
|
||||||
AuditTrailHelper::AddAuditTrail('Delete', 'Delete Record at Form Entertainment Presentation (' . $form->expense_number . ')');
|
AuditTrailHelper::AddAuditTrail('Delete', 'Delete Record at Form Vehicle Running Cost (' . $form->expense_number . ')');
|
||||||
|
|
||||||
$form->delete();
|
$form->delete();
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ class ExpenseApproved extends Mailable
|
|||||||
protected string $expense_number,
|
protected string $expense_number,
|
||||||
protected string $tanggal,
|
protected string $tanggal,
|
||||||
protected int $total,
|
protected int $total,
|
||||||
|
protected string $url,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -45,6 +46,7 @@ class ExpenseApproved extends Mailable
|
|||||||
'expense_number' => $this->expense_number,
|
'expense_number' => $this->expense_number,
|
||||||
'tanggal' => $this->tanggal,
|
'tanggal' => $this->tanggal,
|
||||||
'total' => $this->total,
|
'total' => $this->total,
|
||||||
|
'url' => $this->url,
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,63 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Mail;
|
||||||
|
|
||||||
|
use Illuminate\Bus\Queueable;
|
||||||
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
|
use Illuminate\Mail\Mailable;
|
||||||
|
use Illuminate\Mail\Mailables\Content;
|
||||||
|
use Illuminate\Mail\Mailables\Envelope;
|
||||||
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
|
||||||
|
class ExpenseCreated extends Mailable
|
||||||
|
{
|
||||||
|
use Queueable, SerializesModels;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new message instance.
|
||||||
|
*/
|
||||||
|
public function __construct(
|
||||||
|
protected string $name,
|
||||||
|
protected string $expense_number,
|
||||||
|
protected string $tanggal,
|
||||||
|
protected int $total,
|
||||||
|
protected string $url,
|
||||||
|
) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the message envelope.
|
||||||
|
*/
|
||||||
|
public function envelope(): Envelope
|
||||||
|
{
|
||||||
|
return new Envelope(
|
||||||
|
subject: 'Expense Created',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the message content definition.
|
||||||
|
*/
|
||||||
|
public function content(): Content
|
||||||
|
{
|
||||||
|
return new Content(
|
||||||
|
view: 'mail.created',
|
||||||
|
with: [
|
||||||
|
'name' => $this->name,
|
||||||
|
'expense_number' => $this->expense_number,
|
||||||
|
'tanggal' => $this->tanggal,
|
||||||
|
'total' => $this->total,
|
||||||
|
'url' => $this->url,
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the attachments for the message.
|
||||||
|
*
|
||||||
|
* @return array<int, \Illuminate\Mail\Mailables\Attachment>
|
||||||
|
*/
|
||||||
|
public function attachments(): array
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -21,6 +21,7 @@ class ExpenseRejected extends Mailable
|
|||||||
protected string $expense_number,
|
protected string $expense_number,
|
||||||
protected string $tanggal,
|
protected string $tanggal,
|
||||||
protected int $total,
|
protected int $total,
|
||||||
|
protected string $url,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -45,6 +46,7 @@ class ExpenseRejected extends Mailable
|
|||||||
'expense_number' => $this->expense_number,
|
'expense_number' => $this->expense_number,
|
||||||
'tanggal' => $this->tanggal,
|
'tanggal' => $this->tanggal,
|
||||||
'total' => $this->total,
|
'total' => $this->total,
|
||||||
|
'url' => $this->url,
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ class FinalApprove extends Mailable
|
|||||||
protected string $expense_number,
|
protected string $expense_number,
|
||||||
protected string $tanggal,
|
protected string $tanggal,
|
||||||
protected int $total,
|
protected int $total,
|
||||||
|
protected string $url,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -45,6 +46,7 @@ class FinalApprove extends Mailable
|
|||||||
'expense_number' => $this->expense_number,
|
'expense_number' => $this->expense_number,
|
||||||
'tanggal' => $this->tanggal,
|
'tanggal' => $this->tanggal,
|
||||||
'total' => $this->total,
|
'total' => $this->total,
|
||||||
|
'url' => $this->url,
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,6 +91,7 @@
|
|||||||
<th>Jenis</th>
|
<th>Jenis</th>
|
||||||
<th>Keterangan</th>
|
<th>Keterangan</th>
|
||||||
<th>Total</th>
|
<th>Total</th>
|
||||||
|
<th>Total Approved</th>
|
||||||
<th>Bukti Total</th>
|
<th>Bukti Total</th>
|
||||||
<th>Account Number</th>
|
<th>Account Number</th>
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
@@ -118,6 +119,7 @@
|
|||||||
<td>{{ $item->kategori->name }}</td>
|
<td>{{ $item->kategori->name }}</td>
|
||||||
<td>{{ $item->keterangan }}</td>
|
<td>{{ $item->keterangan }}</td>
|
||||||
<td>{{ number_format($item->total, 0, ',', '.') }}</td>
|
<td>{{ number_format($item->total, 0, ',', '.') }}</td>
|
||||||
|
<td>{{ number_format($item->approved_total, 0, ',', '.') }}</td>
|
||||||
<td>
|
<td>
|
||||||
@if ($item->bukti_total)
|
@if ($item->bukti_total)
|
||||||
<a href="{{ NextCloudHelper::getFileUrl($item->bukti_total) }}" target="_blank">
|
<a href="{{ NextCloudHelper::getFileUrl($item->bukti_total) }}" target="_blank">
|
||||||
|
|||||||
@@ -64,9 +64,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
{{-- submit button --}}
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button type="submit" class="btn btn-primary">Filter</button>
|
<button type="submit" class="btn btn-primary">Filter</button>
|
||||||
|
<a href="{{ route('reports.entertainment') }}" class="btn btn-secondary">Reset</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -64,9 +64,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
{{-- submit button --}}
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button type="submit" class="btn btn-primary">Filter</button>
|
<button type="submit" class="btn btn-primary">Filter</button>
|
||||||
|
<a href="{{ route('reports.meeting') }}" class="btn btn-secondary">Reset</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -64,9 +64,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
{{-- submit button --}}
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button type="submit" class="btn btn-primary">Filter</button>
|
<button type="submit" class="btn btn-primary">Filter</button>
|
||||||
|
<a href="{{ route('reports.others') }}" class="btn btn-secondary">Reset</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -64,9 +64,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
{{-- submit button --}}
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button type="submit" class="btn btn-primary">Filter</button>
|
<button type="submit" class="btn btn-primary">Filter</button>
|
||||||
|
<a href="{{ route('reports.upcountry') }}" class="btn btn-secondary">Reset</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -64,9 +64,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
{{-- submit button --}}
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button type="submit" class="btn btn-primary">Filter</button>
|
<button type="submit" class="btn btn-primary">Filter</button>
|
||||||
|
<a href="{{ route('reports.vehicle') }}" class="btn btn-secondary">Reset</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -328,7 +328,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<p style="margin-top: 20px;">Silahkan login ke aplikasi untuk melihat detail status pengajuan pengeluaran Anda.</p>
|
<p style="margin-top: 20px;">Silahkan buka link berikut untuk melihat detail expense anda: <a href="{{ $url }}">{{ $url }}</a></p>
|
||||||
<p>Terima kasih.</p>
|
<p>Terima kasih.</p>
|
||||||
</td>
|
</td>
|
||||||
<!-- END MAIN CONTENT AREA -->
|
<!-- END MAIN CONTENT AREA -->
|
||||||
|
|||||||
@@ -328,7 +328,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<p style="margin-top: 20px;">Silahkan login ke aplikasi untuk melihat detail status pengajuan pengeluaran Anda.</p>
|
<p style="margin-top: 20px;">Silahkan buka link berikut untuk melihat detail expense anda: <a href="{{ $url }}">{{ $url }}</a></p>
|
||||||
<p>Terima kasih.</p>
|
<p>Terima kasih.</p>
|
||||||
</td>
|
</td>
|
||||||
<!-- END MAIN CONTENT AREA -->
|
<!-- END MAIN CONTENT AREA -->
|
||||||
|
|||||||
@@ -0,0 +1,362 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
|
<title>Expense Created</title>
|
||||||
|
<style media="all" type="text/css">
|
||||||
|
/* -------------------------------------
|
||||||
|
GLOBAL RESETS
|
||||||
|
------------------------------------- */
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: Helvetica, sans-serif;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 1.3;
|
||||||
|
-ms-text-size-adjust: 100%;
|
||||||
|
-webkit-text-size-adjust: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
table {
|
||||||
|
border-collapse: separate;
|
||||||
|
mso-table-lspace: 0pt;
|
||||||
|
mso-table-rspace: 0pt;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
table td {
|
||||||
|
font-family: Helvetica, sans-serif;
|
||||||
|
font-size: 16px;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
/* -------------------------------------
|
||||||
|
BODY & CONTAINER
|
||||||
|
------------------------------------- */
|
||||||
|
|
||||||
|
body {
|
||||||
|
background-color: #f4f5f6;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.body {
|
||||||
|
background-color: #f4f5f6;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
margin: 0 auto !important;
|
||||||
|
max-width: 600px;
|
||||||
|
padding: 0;
|
||||||
|
padding-top: 24px;
|
||||||
|
width: 600px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
box-sizing: border-box;
|
||||||
|
display: block;
|
||||||
|
margin: 0 auto;
|
||||||
|
max-width: 600px;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
/* -------------------------------------
|
||||||
|
HEADER, FOOTER, MAIN
|
||||||
|
------------------------------------- */
|
||||||
|
|
||||||
|
.main {
|
||||||
|
background: #ffffff;
|
||||||
|
border: 1px solid #eaebed;
|
||||||
|
border-radius: 16px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wrapper {
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
clear: both;
|
||||||
|
padding-top: 24px;
|
||||||
|
text-align: center;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer td,
|
||||||
|
.footer p,
|
||||||
|
.footer span,
|
||||||
|
.footer a {
|
||||||
|
color: #9a9ea6;
|
||||||
|
font-size: 16px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
/* -------------------------------------
|
||||||
|
TYPOGRAPHY
|
||||||
|
------------------------------------- */
|
||||||
|
|
||||||
|
p {
|
||||||
|
font-family: Helvetica, sans-serif;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: normal;
|
||||||
|
margin: 0;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: #0867ec;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
/* -------------------------------------
|
||||||
|
BUTTONS
|
||||||
|
------------------------------------- */
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
box-sizing: border-box;
|
||||||
|
min-width: 100% !important;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn > tbody > tr > td {
|
||||||
|
padding-bottom: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn table {
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn table td {
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-radius: 4px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn a {
|
||||||
|
background-color: #ffffff;
|
||||||
|
border: solid 2px #0867ec;
|
||||||
|
border-radius: 4px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
color: #0867ec;
|
||||||
|
cursor: pointer;
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: bold;
|
||||||
|
margin: 0;
|
||||||
|
padding: 12px 24px;
|
||||||
|
text-decoration: none;
|
||||||
|
text-transform: capitalize;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-primary table td {
|
||||||
|
background-color: #0867ec;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-primary a {
|
||||||
|
background-color: #0867ec;
|
||||||
|
border-color: #0867ec;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media all {
|
||||||
|
.btn-primary table td:hover {
|
||||||
|
background-color: #ec0867 !important;
|
||||||
|
}
|
||||||
|
.btn-primary a:hover {
|
||||||
|
background-color: #ec0867 !important;
|
||||||
|
border-color: #ec0867 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------
|
||||||
|
OTHER STYLES THAT MIGHT BE USEFUL
|
||||||
|
------------------------------------- */
|
||||||
|
|
||||||
|
.last {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.first {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.align-center {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.align-right {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.align-left {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-link {
|
||||||
|
color: #0867ec !important;
|
||||||
|
text-decoration: underline !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clear {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mt0 {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mb0 {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.preheader {
|
||||||
|
color: transparent;
|
||||||
|
display: none;
|
||||||
|
height: 0;
|
||||||
|
max-height: 0;
|
||||||
|
max-width: 0;
|
||||||
|
opacity: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
mso-hide: all;
|
||||||
|
visibility: hidden;
|
||||||
|
width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.powered-by a {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------
|
||||||
|
RESPONSIVE AND MOBILE FRIENDLY STYLES
|
||||||
|
------------------------------------- */
|
||||||
|
|
||||||
|
@media only screen and (max-width: 640px) {
|
||||||
|
.main p,
|
||||||
|
.main td,
|
||||||
|
.main span {
|
||||||
|
font-size: 16px !important;
|
||||||
|
}
|
||||||
|
.wrapper {
|
||||||
|
padding: 8px !important;
|
||||||
|
}
|
||||||
|
.content {
|
||||||
|
padding: 0 !important;
|
||||||
|
}
|
||||||
|
.container {
|
||||||
|
padding: 0 !important;
|
||||||
|
padding-top: 8px !important;
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
.main {
|
||||||
|
border-left-width: 0 !important;
|
||||||
|
border-radius: 0 !important;
|
||||||
|
border-right-width: 0 !important;
|
||||||
|
}
|
||||||
|
.btn table {
|
||||||
|
max-width: 100% !important;
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
.btn a {
|
||||||
|
font-size: 16px !important;
|
||||||
|
max-width: 100% !important;
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* -------------------------------------
|
||||||
|
PRESERVE THESE STYLES IN THE HEAD
|
||||||
|
------------------------------------- */
|
||||||
|
|
||||||
|
@media all {
|
||||||
|
.ExternalClass {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.ExternalClass,
|
||||||
|
.ExternalClass p,
|
||||||
|
.ExternalClass span,
|
||||||
|
.ExternalClass font,
|
||||||
|
.ExternalClass td,
|
||||||
|
.ExternalClass div {
|
||||||
|
line-height: 100%;
|
||||||
|
}
|
||||||
|
.apple-link a {
|
||||||
|
color: inherit !important;
|
||||||
|
font-family: inherit !important;
|
||||||
|
font-size: inherit !important;
|
||||||
|
font-weight: inherit !important;
|
||||||
|
line-height: inherit !important;
|
||||||
|
text-decoration: none !important;
|
||||||
|
}
|
||||||
|
#MessageViewBody a {
|
||||||
|
color: inherit;
|
||||||
|
text-decoration: none;
|
||||||
|
font-size: inherit;
|
||||||
|
font-family: inherit;
|
||||||
|
font-weight: inherit;
|
||||||
|
line-height: inherit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<table role="presentation" border="0" cellpadding="0" cellspacing="0" class="body">
|
||||||
|
<tr>
|
||||||
|
<td> </td>
|
||||||
|
<td class="container">
|
||||||
|
<div class="content">
|
||||||
|
<table role="presentation" border="0" cellpadding="0" cellspacing="0" class="main">
|
||||||
|
|
||||||
|
<!-- START MAIN CONTENT AREA -->
|
||||||
|
<tr>
|
||||||
|
<td class="wrapper">
|
||||||
|
<p>Halo {{ $name }},</p>
|
||||||
|
<p>Kami ingin memberitahukan bahwa terdapat pengajuan pengeluaran baru dengan detail sebagai berikut:</p>
|
||||||
|
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td align="left">
|
||||||
|
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<strong>Expense Number:</strong> {{ $expense_number }}<br>
|
||||||
|
<strong>Expense Date:</strong> {{ \Carbon\Carbon::parse($tanggal)->locale('id')->isoFormat('D MMMM Y') }}<br>
|
||||||
|
<strong>Total:</strong> Rp {{ number_format($total, 0, ',', '.') }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<p style="margin-top: 20px;">Silahkan buka link berikut untuk melihat detail expense: <a href="{{ $url }}">{{ $url }}</a></p>
|
||||||
|
<p>Terima kasih.</p>
|
||||||
|
</td>
|
||||||
|
<!-- END MAIN CONTENT AREA -->
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<!-- START FOOTER -->
|
||||||
|
<div class="footer">
|
||||||
|
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
||||||
|
<tr>
|
||||||
|
<td class="content-block">
|
||||||
|
<span class="apple-link">© PT TUNGGAL IDAMAN ABDI.</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="content-block powered-by" style="margin-bottom: 20px;">
|
||||||
|
Jl. Jend. Ahmad Yani No 7, Jakarta 13230, Indonesia.
|
||||||
|
</td>
|
||||||
|
<br>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- END FOOTER -->
|
||||||
|
|
||||||
|
<!-- END CENTERED WHITE CONTAINER --></div>
|
||||||
|
</td>
|
||||||
|
<td> </td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -328,7 +328,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<p style="margin-top: 20px;">Silahkan login ke aplikasi untuk melihat detail status pengajuan pengeluaran Anda.</p>
|
<p style="margin-top: 20px;">Silahkan buka link berikut untuk melihat detail expense anda: <a href="{{ $url }}">{{ $url }}</a></p>
|
||||||
<p>Terima kasih.</p>
|
<p>Terima kasih.</p>
|
||||||
</td>
|
</td>
|
||||||
<!-- END MAIN CONTENT AREA -->
|
<!-- END MAIN CONTENT AREA -->
|
||||||
|
|||||||
Reference in New Issue
Block a user