invoice Notification mail Fixes : ps
This commit is contained in:
parent
6176cbba3d
commit
cad51d4c36
@ -302,9 +302,12 @@ class Invoice extends BaseController
|
||||
}
|
||||
|
||||
## Notification For Approve..
|
||||
if ($invoice_status == 'Approved' && !$invoice_id) {
|
||||
$this->logger->info($msg_flag_name.": ID = " . $invoice_id.", Status =".$invoice_status);
|
||||
if ($invoice_status == 'Approved' && $invoice_id != "") {
|
||||
$this->logger->info($msg_flag_name.": in ".$invoice_status.". ID = " . $invoice_id);
|
||||
$this->approve_notifications((int)$invoice_id);
|
||||
}
|
||||
|
||||
} catch (\Exception $e) {
|
||||
$this->logger->error($msg_flag_name.": Err Occur =" . $e->getMessage());
|
||||
session()->setFlashdata('error', 'Message: ' . $e->getMessage());
|
||||
@ -500,6 +503,7 @@ class Invoice extends BaseController
|
||||
|
||||
public function approve_notifications($invoice_id)
|
||||
{
|
||||
$this->logger->info("Approve Notifications : ID ".$invoice_id);
|
||||
$model = new InvoiceModel();
|
||||
$where = ['I.business_id' => (int)get_business_id(), 'I.invoice_id' => $invoice_id, 'I.isactive' => 1];
|
||||
$details = $model->getDetailForApproveNotifications($where);
|
||||
@ -589,12 +593,12 @@ class Invoice extends BaseController
|
||||
$params->message = $template;
|
||||
$params->instance_id = $_ENV['WAAI_INSTANCE'];
|
||||
$params->access_token = $_ENV['WAAI_TOKEN'];
|
||||
$this->logger->info("Invoice: approve notification Email Request data = ".json_encode($records));
|
||||
$this->logger->info("Approve notification Email Request data = ".json_encode($records));
|
||||
$email_result = $notification->sendEmail($records);
|
||||
$this->logger->info("Invoice: approve notification Email Response = " . json_encode($email_result));
|
||||
$this->logger->info("Invoice: approve notification Whatsapp Request data = ".json_encode($params));
|
||||
$this->logger->info("Approve notification Email Response = " . json_encode($email_result));
|
||||
$this->logger->info("Approve notification Whatsapp Request data = ".json_encode($params));
|
||||
$whatsapp_result = $notification->sendWhatsAppMessage(SEND_WAAI_URL, "POST", $params);
|
||||
$this->logger->info("Invoice: approve notification Whatsapp Response = " . json_encode($whatsapp_result));
|
||||
$this->logger->info("Approve notification Whatsapp Response = " . json_encode($whatsapp_result));
|
||||
}
|
||||
|
||||
## To Generate Invoice PDF based on invoice ID
|
||||
|
||||
Loading…
Reference in New Issue
Block a user