From 8000f261b6daa4b78154645443bf83ac5a810c36 Mon Sep 17 00:00:00 2001 From: heama Date: Fri, 9 Feb 2024 17:25:58 +0530 Subject: [PATCH] vbp tracker item --- app/Config/Routes.php | 8 + app/Controllers/BaseController.php | 3 +- app/Controllers/Invoice.php | 214 +++++++++++++++++--- app/Controllers/Notifications.php | 3 +- app/Controllers/Scheme.php | 1 + app/Controllers/Subscription.php | 51 +++-- app/Controllers/Users.php | 10 + app/Controllers/email_temp.php | 33 +++ app/Models/InvoiceModel.php | 99 +++++++-- app/Models/SchemeModel.php | 7 +- app/Models/SubscriptionModel.php | 195 +++++++++++++++++- app/Models/UsersModel.php | 13 +- app/Views/business_form.php | 4 + app/Views/email_temp.php | 30 +++ app/Views/invoice_pdf_template.php | 31 +-- app/Views/notifications_form.php | 72 ++++--- app/Views/print_addresses_form.php | 56 +++++- app/Views/report_book_publish.php | 265 +++++++++++++++++++++++++ app/Views/report_expired_customers.php | 169 ++++++++++++++++ app/Views/report_general_invoice.php | 136 +++++++++++-- app/Views/scheme_form.php | 4 + app/Views/scheme_list.php | 2 +- app/Views/subscribers_list.php | 45 ++++- app/Views/template/header.php | 51 +++-- app/Views/template/topbar.php | 10 +- app/Views/user_form.php | 86 +++++++- public/uploads/avatar.png | Bin 5786 -> 0 bytes 27 files changed, 1416 insertions(+), 182 deletions(-) create mode 100644 app/Controllers/email_temp.php create mode 100644 app/Views/email_temp.php create mode 100644 app/Views/report_book_publish.php create mode 100644 app/Views/report_expired_customers.php delete mode 100644 public/uploads/avatar.png diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 04000705..75a760cf 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -51,6 +51,8 @@ $routes->get('dashboard/', 'Home::index'); $routes->get("user_list/", "Users::index"); $routes->get("user_page/(:any)", "Users::user_page/$1"); $routes->post("insert_users", "Users::insert_users"); +$routes->get('users/fetch_event_names', 'Users::fetch_event_names'); + $routes->get("delete_user/(:any)", "Users::delete_user/$1"); # Books Routes @@ -114,6 +116,9 @@ $routes->post("insert_invoice_number_format", "Event::insert_invoice_number_form $routes->get("invoice_list/", "Invoice::index"); $routes->get("new_book_invoice/(:any)", "Invoice::new_book_invoice/$1"); $routes->get("new_subscription_invoice/(:any)", "Invoice::new_subscription_invoice/$1"); +// $routes->get("download_invoice_pdf/(:num)",'Invoice::download_invoice_pdf/$1'); +$routes->get("download_invoice_pdf/(:any)", 'Invoice::download_invoice_pdf/$1'); + $routes->post("get_customer_billing_details", "Invoice::get_customer_billing_details"); @@ -128,6 +133,9 @@ $routes->get('print_address/(:num)', 'Invoice::print_address/$1'); $routes->match(['get','post'],'/general_inv_rp','Invoice::general_inv_rp'); $routes->match(['get','post'],'/mem_inv_rp','Invoice::general_membership_inv_rp'); $routes->match(['get','post'],'/itemwise_report','Invoice::itemwise_report'); +$routes->match(['get','post'],'/expired_customer_report','Invoice::expired_customer_report'); +$routes->match(['get','post'],'/book_publishwise_Report','Invoice::book_publishwise_Report'); + # Notifications Routes diff --git a/app/Controllers/BaseController.php b/app/Controllers/BaseController.php index 83cddded..1806c7d4 100644 --- a/app/Controllers/BaseController.php +++ b/app/Controllers/BaseController.php @@ -65,7 +65,8 @@ abstract class BaseController extends Controller echo "This is a command-line request."; // echo $requestedRoute; } else { - if ($requestedRoute !== '/login' && $requestedRoute !== '/authenticate' && $uri->getSegment(1) != 'getExpCustomerDetail') { + + if ($requestedRoute !== '/login' && $requestedRoute !== '/authenticate' && $uri->getSegment(1) != 'getExpCustomerDetail'&& $uri->getSegment(1) != 'download_invoice_pdf') { $this->authData = $this->session_log(); } } diff --git a/app/Controllers/Invoice.php b/app/Controllers/Invoice.php index 68df5ee3..37cb69e5 100644 --- a/app/Controllers/Invoice.php +++ b/app/Controllers/Invoice.php @@ -541,6 +541,8 @@ class Invoice extends BaseController $recipient_mobile = $rec['customer_mobile']; $subtotal = $rec['subtotal']; $tax = $rec['tax']; + $invoiceDate=$rec['invoice_date']; + $total_amount = $rec['total_amount']; $payment_method = $rec['payment_method']; $business_name= $rec['business_name']; @@ -549,7 +551,8 @@ class Invoice extends BaseController $business_state= $rec['business_state']; $business_postal_code= $rec['business_postal_code']; $business_email= $rec['business_email']; - $business_mobile_no= $rec['business_mobile_no']; + $business_mobile_no= $rec['business_mobile_no']; + } $records['invoice_order_number'] = $reference_number; $records['invoice_serial_number'] = $invoice_serial_number; @@ -568,24 +571,49 @@ class Invoice extends BaseController $records['template_name'] = 'approve_template'; $records['item'] = $details['item']; + // print_r($records['item']);die; + $lineitem_html=""; + foreach ($records['item'] as $inv) { + // print_r($item->title);die; + $lineitem_html.='

'.$inv->title. ' x ' .$inv->quantity .' => ' .$inv->subtotal.'

'; + + + } + // print_r($title);die; $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,

-