From f5f643eb6b84f5bc6607981a982122baf8a095f5 Mon Sep 17 00:00:00 2001 From: aadhavan valli Date: Sat, 4 May 2024 17:20:50 +0530 Subject: [PATCH] CHANGE_INVOICE_PDF_PRODUCT_LIST_MANUFACTURER_DATA_TABLE_CSS_PRODUCT_EACH_COLUMN_SEARCH : AADHAVAN --- app/Config/Routes.php | 3 + app/Controllers/Manufacturer.php | 43 +++- app/Controllers/Products.php | 35 ++- app/Controllers/Sales.php | 4 + app/Models/SalesOrderModel.php | 7 +- app/Views/bike_model_list.php | 57 ++++- app/Views/branch_edit_form.php | 18 +- app/Views/branch_list.php | 285 ++++++++++++--------- app/Views/business_form.php | 19 +- app/Views/business_list.php | 67 ++++- app/Views/client_form.php | 27 +- app/Views/client_list.php | 92 +++++-- app/Views/complaint_list.php | 56 +++- app/Views/dashboard.php | 5 - app/Views/edit_account_form.php | 256 ++++++++---------- app/Views/invoice_pdf_template.php | 77 +++--- app/Views/invoice_pdf_template_jobcard.php | 6 +- app/Views/layout/header.php | 25 +- app/Views/make_list.php | 61 ++++- app/Views/manufacturer_list.php | 7 +- app/Views/product_form.php | 94 +++++++ app/Views/product_list.php | 81 +++++- app/Views/reorder_level_list.php | 53 +++- app/Views/sales_order_form.php | 35 ++- app/Views/service_form.php | 10 +- app/Views/service_list.php | 53 +++- app/Views/user_list.php | 52 +++- app/Views/vehicle_list.php | 53 +++- app/Views/vendor_list.php | 55 +++- 29 files changed, 1187 insertions(+), 449 deletions(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 8e9bfe7..a9156e3 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -63,6 +63,7 @@ $routes->post("get_models", "Products::get_models"); $routes->get("get_makes", "Products::get_makes"); $routes->post("save_make", "Products::save_make"); $routes->post("save_model", "Products::save_model"); +$routes->post("save_manufacturer", "Products::save_manufacturer"); $routes->get("product_list_for_service", "Products::product_list_for_service"); //end products// @@ -158,6 +159,8 @@ $routes->get('dashboard', 'Users::dashboard'); //Spare manufacturer// $routes->get('spare_manufacturer_index', 'Manufacturer::index'); $routes->post('create_manufacturer/(:any)', 'Manufacturer::create_manufacturer/$1'); + $routes->post('create_manufacture_product_form', 'Manufacturer::create_manufacture_product_form'); + //Spare manufacturer End's// diff --git a/app/Controllers/Manufacturer.php b/app/Controllers/Manufacturer.php index 5740902..2e8334e 100644 --- a/app/Controllers/Manufacturer.php +++ b/app/Controllers/Manufacturer.php @@ -24,7 +24,7 @@ class Manufacturer extends BaseController if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); } $ManufacturerModel = new ManufacturerModel(); - $spare_manufacturer = $ManufacturerModel->findAll(); + $spare_manufacturer = $ManufacturerModel->where('business_id',$this->session->get('logged_user_business_id'))->findAll(); $data['manufacturer']=$spare_manufacturer; return view('manufacturer_list',$data); @@ -45,12 +45,13 @@ class Manufacturer extends BaseController ]; if (!$manufacturer_id) { + $data['business_id'] = $this->session->get('logged_user_business_id'); $inserted = $ManufacturerModel->insert($data); if ($inserted) { $result = $data; return $this->respond(['status' => 'success','code' => 200,'data' => $result],200); } else { - $result = "No Match's"; + $result = "Duplicate Match!"; return $this->respond(['status' => 'failed','code' => 404,'data' => $result],404); } } else { @@ -70,4 +71,40 @@ class Manufacturer extends BaseController } } -} \ No newline at end of file + + + public function create_manufacture_product_form() + { + try { + $manufacturer_name = $this->request->getPost('manufacturername'); + $quality = $this->request->getPost('quality'); + $ManufacturerModel = new ManufacturerModel(); + $data = [ + 'manufacturer_name' => $manufacturer_name, + 'quality' => $quality, + ]; + + $data['business_id'] = $this->session->get('logged_user_business_id'); + + $manufacturer_find = $ManufacturerModel->where('manufacturer_name',$manufacturer_name)->first(); + + if (!$manufacturer_find) { + $inserted = $ManufacturerModel->insert($data); + if ($inserted) { + $manufacturer = $ManufacturerModel->where('manufacturer_id',$inserted)->first(); + echo json_encode($manufacturer); + } + }else{ + $result = "Duplicate Match!"; + echo json_encode($result); + } + + + + + } catch (\Exception $e) { + echo json_encode($e); + } + } + +} diff --git a/app/Controllers/Products.php b/app/Controllers/Products.php index 5c4c50b..6708cfe 100644 --- a/app/Controllers/Products.php +++ b/app/Controllers/Products.php @@ -36,7 +36,7 @@ class Products extends BaseController return view('product_list',$data); } else { $ProductModel = new ProductModel(); - $products = $ProductModel->where('branch_id',$this->session->get('logged_user_branch_id'))->orderBy('product_name')->findAll(); + $products = $ProductModel->get_products($this->session->get('logged_user_branch_id')); $data['products']=$products; // echo "
";
             // print_r($products);die;
@@ -391,6 +391,39 @@ class Products extends BaseController
     }
 
 
+
+    public function save_manufacturer(){
+        $response = []; 
+        $ManufacturerModel = new ManufacturerModel();
+        
+        $manufacturer_name = $this->request->getPost('manufacturer_name');
+        $quality = $this->request->getPost('quality');
+        if (!empty($manufacturer_name) && !empty($quality)) {
+            $modelData = [
+                'manufacturer_name' => $manufacturer_name,
+                'quality' => $quality,
+                'business_id'=> $this->session->get('logged_user_business_id')
+            ];
+
+            
+            $manufacturer_id = $ManufacturerModel->insert($modelData);
+
+            $modelData =  $ManufacturerModel->where('business_id', $this->session->get('logged_user_business_id'))->orderBy('manufacturer_name')->findAll();
+
+        
+            $response['success'] = true;
+            $response['manufacturer_id'] = $manufacturer_id;
+            $response['quality'] = $quality;
+            $response['modelData'] = $modelData;
+        } else {
+        
+            $response['success'] = false;
+        }
+
+    
+        return $this->response->setJSON($response);
+    }
+
     public function product_list_for_service(){
         $ProductModel = new ProductModel();
         $products = $ProductModel->where('branch_id',$this->session->get('logged_user_branch_id'))->findAll();
diff --git a/app/Controllers/Sales.php b/app/Controllers/Sales.php
index c6bb107..efb3265 100644
--- a/app/Controllers/Sales.php
+++ b/app/Controllers/Sales.php
@@ -155,6 +155,9 @@ public function add_sales()
     $sales_order_id = $this->request->getPost('sales_order_id');
     if (!empty($sales_order_id)) {
         // print_r("hello");die;
+        if ($this->request->getPost('status') === "Paid") {
+            $data['mode_of_payment'] = $this->request->getPost('mode_of_payment');
+        }
         $SalesOrderModel->update($sales_order_id, $data);
     } else {
         $SalesOrderModel->insert($data);
@@ -354,6 +357,7 @@ public function delete_sales_product()
         // Generate the PDF content (HTML) with data
         $html = view('invoice_pdf_template', ['sales' => $data,'company_address'=>$company_address,'items'=>$items, 'business' => $business , 'vehicle' => $vehicle,'bike_model'=>$bike_model,'bike_make'=>$bike_make]);
 
+        // echo $html;die;
         // Load HTML into the mPDF instance
         $mpdf->WriteHTML($html);
 
diff --git a/app/Models/SalesOrderModel.php b/app/Models/SalesOrderModel.php
index 2d58a55..f14cf82 100644
--- a/app/Models/SalesOrderModel.php
+++ b/app/Models/SalesOrderModel.php
@@ -5,7 +5,7 @@ class SalesOrderModel extends Model
 {
     protected $table = 'sales_order';
     protected $primaryKey = 'sales_order_id';
-    protected $allowedFields = ['sales_order_id','client_name','vehicle_id','order_number','branch_id','status','mobile_no','billing_address','billing_city','billing_state','billing_country','billing_postal_code','total','tax','subtotal','discount','terms_condition','isactive'];
+    protected $allowedFields = ['sales_order_id','client_name','vehicle_id','order_number','branch_id','status','mode_of_payment','mobile_no','billing_address','billing_city','billing_state','billing_country','billing_postal_code','total','tax','subtotal','discount','terms_condition','isactive'];
 // 
     public function getSalesPdf($sales_order_id){
         return $this->db->table('sales_order')
@@ -44,10 +44,13 @@ class SalesOrderModel extends Model
     $result = $this->db->table('sales_order_product')
         ->where('sales_order_product.sales_order_id', $sales_order_id)
         ->join('products', 'products.product_id = sales_order_product.product_id')
-        ->select('sales_order_product.*, products.product_name')
+        ->select('sales_order_product.*, products.product_name, products.per, products.ml')
         ->get()
         ->getResult();
 
+        // echo "
";
+        // print_r($result);die;
+
     return $result;
 }
 
diff --git a/app/Views/bike_model_list.php b/app/Views/bike_model_list.php
index a14b3fb..c507e48 100644
--- a/app/Views/bike_model_list.php
+++ b/app/Views/bike_model_list.php
@@ -21,7 +21,7 @@
             
- +
@@ -60,7 +60,6 @@ -
Model Name
- - - - - - - - - - - - - - - - - - - - - - - - - + +
Branch NameAddressCityStatePostal CodeMobile NoActiveUser ListAction
- - Inactive - - Active - - - " style="margin-left: 15px;">View - + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + " + class="delete-button"> + - + - - -
Branch NameAddressCityStatePostal CodeMobile NoActiveUser ListAction
+ + Inactive + + Active + + + " style="margin-left: 15px;">View + + + - - - " - class="delete-button"> -
-
- -
-
-
+
+
+
+ + - - - - \ No newline at end of file + + + + \ No newline at end of file diff --git a/app/Views/business_form.php b/app/Views/business_form.php index db5acbd..e3b29ab 100644 --- a/app/Views/business_form.php +++ b/app/Views/business_form.php @@ -1,24 +1,19 @@
-
-
-

-
- -
+
+
+

+
+
+
-
" method="post">
diff --git a/app/Views/business_list.php b/app/Views/business_list.php index cbdf085..6f7fa42 100644 --- a/app/Views/business_list.php +++ b/app/Views/business_list.php @@ -1,15 +1,13 @@
-
+
@@ -20,12 +18,7 @@
- - - - - - @@ -76,10 +69,58 @@
-
-
- \ No newline at end of file + + + + \ No newline at end of file diff --git a/app/Views/client_form.php b/app/Views/client_form.php index e962a9a..5d74b00 100644 --- a/app/Views/client_form.php +++ b/app/Views/client_form.php @@ -1,27 +1,22 @@
-
-
-
- +
" method="post"> -

Client Details :

+

Client Details :

@@ -78,9 +73,9 @@
- -
+ + \ No newline at end of file diff --git a/app/Views/complaint_list.php b/app/Views/complaint_list.php index 853569f..872b768 100644 --- a/app/Views/complaint_list.php +++ b/app/Views/complaint_list.php @@ -16,7 +16,7 @@
- +
@@ -86,6 +86,7 @@ + - \ No newline at end of file + + diff --git a/app/Views/dashboard.php b/app/Views/dashboard.php index 3355ad6..0106059 100644 --- a/app/Views/dashboard.php +++ b/app/Views/dashboard.php @@ -5,11 +5,6 @@

diff --git a/app/Views/edit_account_form.php b/app/Views/edit_account_form.php index 335426a..70b9ae3 100644 --- a/app/Views/edit_account_form.php +++ b/app/Views/edit_account_form.php @@ -10,165 +10,145 @@ - - - -
-
-
-
-

-

@

+
+
+
+

+

@

+
+
+
Name
+ + + + + + + + + + + + + - -
-
-
Full Name :
Mobile :
Email :
- - - - - - - - - - - - - - - -
Full Name :
Mobile :
Email :
-
+ +
- - - - - -
-
- -
-
-
-
-
- -
Personal Info
- -
-
-
- - -
-
-
-
- - -
-
-
-
-
-
- - - -
-
-
-
- -
-
-
- - -
- -
+
- -
-
-
-
-
- -
Change Password
- +
+
+
+
+
+
+
+
Personal Info
+
- -
- -
- - - -
-
+ +
-
- +
- -
- -
- - - -
-
+ +
-
- +
+
+
- -
- -
- - - -
-
+ + +
- -
- +
+
+ +
+ +
+ -
-
+
+ +
+
+
+
+
+ +
Change Password
+ +
+
+
+ +
+ +
+ + + +
+
+
+
+ +
+
+ +
+ +
+ + + +
+
+
+
+ +
+
+ +
+ +
+ + + +
+
+
+
+ +
+ +
+
+
+ +
+
+
- - - - - - - - - - - - + + diff --git a/app/Views/manufacturer_list.php b/app/Views/manufacturer_list.php index 6bf2244..b8069f2 100644 --- a/app/Views/manufacturer_list.php +++ b/app/Views/manufacturer_list.php @@ -68,8 +68,7 @@
- @@ -78,7 +77,7 @@
- +
@@ -96,7 +95,7 @@ - function submitMake(params) { + function submitManufacturer(params) { var formData = { manufacturername: $('#manufacturer_name').val(), quality: $('#quality').val() diff --git a/app/Views/product_form.php b/app/Views/product_form.php index 67230d0..e9bab74 100644 --- a/app/Views/product_form.php +++ b/app/Views/product_form.php @@ -53,6 +53,7 @@
+ ' ?> + +
+
+ + +
+ +
+ +
+ + +
+
+
+
+ +
@@ -21,39 +43,57 @@
- - - + - + + + + + + + + + - + + - - - + -
+ + + + + + + + + + + + + +
SKU Id Product NameManufacturer Name Category Unit Price Qty in Stock Rack No Actions
@@ -65,16 +105,13 @@ -
-
-
@@ -122,7 +159,27 @@ "language": { "search": "Search: " // Customize search label }, + // "ordering": false }); }); + + + + \ No newline at end of file diff --git a/app/Views/reorder_level_list.php b/app/Views/reorder_level_list.php index ae504a6..1153c41 100644 --- a/app/Views/reorder_level_list.php +++ b/app/Views/reorder_level_list.php @@ -22,7 +22,7 @@ - +
@@ -62,4 +62,53 @@ - \ No newline at end of file + + + \ No newline at end of file diff --git a/app/Views/sales_order_form.php b/app/Views/sales_order_form.php index 78f858a..66657c0 100644 --- a/app/Views/sales_order_form.php +++ b/app/Views/sales_order_form.php @@ -67,7 +67,7 @@ () - @@ -88,6 +88,18 @@ + + + +
> +
+
@@ -950,9 +962,20 @@ $(document).on('click', '#selectClient', function() { } \ No newline at end of file diff --git a/app/Views/service_form.php b/app/Views/service_form.php index 0a84a0d..04d8ff2 100644 --- a/app/Views/service_form.php +++ b/app/Views/service_form.php @@ -61,8 +61,8 @@
- - + + - diff --git a/app/Views/service_list.php b/app/Views/service_list.php index 8ed3e61..59d1112 100644 --- a/app/Views/service_list.php +++ b/app/Views/service_list.php @@ -19,7 +19,7 @@
-
+
@@ -64,4 +64,53 @@ - \ No newline at end of file + + + \ No newline at end of file diff --git a/app/Views/user_list.php b/app/Views/user_list.php index 736d81f..9c27518 100644 --- a/app/Views/user_list.php +++ b/app/Views/user_list.php @@ -27,7 +27,7 @@ -
Service Name
+
@@ -69,4 +69,52 @@ - \ No newline at end of file + + \ No newline at end of file diff --git a/app/Views/vehicle_list.php b/app/Views/vehicle_list.php index fab19e4..ff45730 100644 --- a/app/Views/vehicle_list.php +++ b/app/Views/vehicle_list.php @@ -17,7 +17,7 @@
-
#
@@ -58,4 +58,53 @@ - \ No newline at end of file + + + \ No newline at end of file diff --git a/app/Views/vendor_list.php b/app/Views/vendor_list.php index 7a09e1c..14d77b2 100644 --- a/app/Views/vendor_list.php +++ b/app/Views/vendor_list.php @@ -27,7 +27,7 @@ -
+
@@ -65,6 +65,53 @@ - - - \ No newline at end of file + + + \ No newline at end of file
#