diff --git a/app/Controllers/Business.php b/app/Controllers/Business.php index 37ac81d..9a437af 100644 --- a/app/Controllers/Business.php +++ b/app/Controllers/Business.php @@ -77,6 +77,20 @@ class Business extends BaseController } + $sign = $this->request->getFile('signature'); + $business_id = $this->request->getPost('business_id'); + $filePath = 'public/uploads/' . $this->request->getPost('signature'); + $signFileName = $sign->getName(); + + if($signFileName !== ""){ + + if ($sign->isValid() && !$sign->hasMoved()) { + + $sign->move(ROOTPATH . 'public/uploads', $signFileName); + } + + } + $BusinessModel = new BusinessModel(); $data = [ @@ -90,13 +104,17 @@ class Business extends BaseController 'pan_no'=>$this->request->getPost('pan_no'), 'org_reg_no'=>$this->request->getPost('org_reg_no'), 'terms'=>$this->request->getPost('bterms'), - '80G'=>$this->request->getPost('80G') + '80G'=>$this->request->getPost('80G'), ]; if($fileName !== "") { $data['business_logo'] = $fileName; } + if($signFileName !== "") + { + $data['signature'] = $signFileName; + } $business_id = $this->request->getPost('business_id'); // Get the business ID for update diff --git a/app/Controllers/Invoice.php b/app/Controllers/Invoice.php index 0383166..20f0cce 100644 --- a/app/Controllers/Invoice.php +++ b/app/Controllers/Invoice.php @@ -309,157 +309,12 @@ class Invoice extends BaseController } - public function approve_notifications($receipt_id) - { - $model = new InvoiceModel(); - $where = ['I.business_id' => (int)get_business_id(), 'I.receipt_id' => $receipt_id, 'I.isactive' => 1]; - $details = $model->getDetailForApproveNotifications($where); - $records = []; - $reference_number = ""; - $invoice_serial_number = ""; - $recipient_name = ""; - $approval_date = ""; - $approved_by = ""; - $recipient_email = ""; - $recipient_mobile = ""; - $subtotal = ""; - $tax = ""; - $total_amount = ""; - $payment_method = ""; - $business_name= ""; - $business_address= ""; - $business_city= ""; - $business_state= ""; - $business_postal_code= ""; - $business_email= ""; - $business_mobile_no= ""; - if (isset($details)) { - $this->logger->info("Invoice: approve notification Request data type = ".gettype($details)); - } - helper('notification'); - $notification = new NotificationHelper(); - foreach ($details['invoice'] as $rec) { - $reference_number = $rec['order_number']; - $invoice_serial_number = $rec['invoice_number']; - $recipient_name = $rec['customer_name']; - $approval_date = $rec['updated_on']; - $approved_by = $rec['updated_by_name']; - $recipient_email = $rec['customer_email']; - $recipient_mobile = $rec['customer_mobile']; - $subtotal = $rec['subtotal']; - $tax = $rec['tax']; - $total_amount = $rec['total_amount']; - $payment_method = $rec['payment_method']; - $business_name= $rec['business_name']; - $business_address= $rec['business_address']; - $business_city= $rec['business_city']; - $business_state= $rec['business_state']; - $business_postal_code= $rec['business_postal_code']; - $business_email= $rec['business_email']; - $business_mobile_no= $rec['business_mobile_no']; - } - $records['invoice_order_number'] = $reference_number; - $records['invoice_serial_number'] = $invoice_serial_number; - $records['recipient_name'] = $recipient_name; - $records['recipient_email'] = $recipient_email ? $recipient_email : "sanjeev.p@venbainfotech.com"; - $records['subtotal'] = $subtotal; - $records['tax'] = $tax; - $records['total_amount'] = $total_amount; - $records['payment_method'] = $payment_method; - $records['favicon'] = base_url("public/uploads/default.ico"); - $records['browser_title'] = "bbb-bp | Approve Template"; - $records['page_name'] = 'Approve Template'; - // view('approve_template',$records); - // $this->logger->info("Approve : Request data = ".json_encode($records)); - // view('approve_template',$records); - - $records['template_name'] = 'approve_template'; - $records['item'] = $details['item']; - $records['subject'] = $invoice_serial_number . " - Approval Notification"; - - $records['description'] = "VBP Approve Information -

Dear $recipient_name,

-

   We are pleased to inform you that your Invoice has been approved.

-

Details:

-
-

Best regards,

-