diff --git a/app/Controllers/Jobcard.php b/app/Controllers/Jobcard.php index 3466b72..551a617 100644 --- a/app/Controllers/Jobcard.php +++ b/app/Controllers/Jobcard.php @@ -53,6 +53,8 @@ class Jobcard extends BaseController public function download_jobcard_invoice($job_card_id) { + + $data['vehicle'] = $this->JobcardModel->get_jobcard_vehicle_details($job_card_id); $bus_id = $this->session->get('logged_user_business_id'); $data['job_card'] = $this->JobcardModel->where('job_card_id',$job_card_id)->findAll(); @@ -61,7 +63,6 @@ class Jobcard extends BaseController // echo json_encode($data['job_card_products']);die; - // Create an mPDF object $mpdf = new Mpdf([ 'mode' => '', @@ -79,7 +80,8 @@ class Jobcard extends BaseController - $mpdf->autoLangToFont = true; $mpdf->autoScriptToLang = true; + $mpdf->autoLangToFont = true; + $mpdf->autoScriptToLang = true; // Set PDF properties $mpdf->SetTitle('Invoice'); // $mpdf->SetAuthor($data[0]->branch_name); @@ -87,13 +89,14 @@ class Jobcard extends BaseController // Generate the PDF content (HTML) with data - $html = view('invoice_pdf_template', $data); - echo $html;die; + $html = view('invoice_pdf_template_jobcard', $data); + // echo $html;die; // Load HTML into the mPDF instance $mpdf->WriteHTML($html); // Output the PDF to the browser for download $mpdf->Output('invoice_' . date('Y-m-d H-i-s') . '.pdf', 'D'); + } diff --git a/app/Controllers/Products.php b/app/Controllers/Products.php index 70c7841..8cec418 100644 --- a/app/Controllers/Products.php +++ b/app/Controllers/Products.php @@ -138,6 +138,13 @@ class Products extends BaseController $tax= $this->request->getPost('tax')/2; // print_r($this->request->getPost());die; + + if ($this->request->getPost('per') != 'ml') { + $ml = 0; + }else{ + $ml = $this->request->getPost('ml'); + } + $data = [ 'product_name' => $this->request->getPost('productname'), 'product_category' => $this->request->getPost('productcategory'), @@ -166,7 +173,8 @@ class Products extends BaseController 'branch_id' => $this->session->get('logged_user_branch_id'), 'total_amount' => $this->session->get('total_amount'), - 'per' => $this->session->get('per') + 'per' => $this->request->getPost('per'), + 'ml' => $ml ]; $product_id = $this->request->getPost('product_id'); diff --git a/app/Controllers/Sales.php b/app/Controllers/Sales.php index 0860627..ff3a336 100644 --- a/app/Controllers/Sales.php +++ b/app/Controllers/Sales.php @@ -299,27 +299,20 @@ public function delete_sales_product() $BikemodelsModel = new BikemodelsModel(); $BikemakeModel = new BikemakeModel(); $data = $model->getSalesPdf($sales_order_id); - - + $bus_id = $this->session->get('logged_user_business_id'); + $company_address = $BusinessModel->where('business_id', $bus_id)->where('isactive', 1)->findAll(); $branch = $BranchModel->where('branch_id', $data[0]->branch_id)->first(); $business = $BusinessModel->where('business_id', $branch['business_id'])->first(); - $vehicle = $VehicleModel->where('vehicle_id',$data[0]->vehicle_id)->first(); - $bike_model = $BikemodelsModel->where('model_id',$vehicle['model'])->first(); - $bike_make = $BikemakeModel->where('make_id', $vehicle['make'])->first(); - $items = $model->getSalesOrderProductsForPdf($sales_order_id); - - $mpdf = new Mpdf([ 'mode' => '', 'format' => 'A5', 'default_font_size' => 0, - 'default_font' => '', - + 'default_font' => '', // 'margin_right' => 1, 'margin_top' => 6, 'margin_bottom' => 6, @@ -328,16 +321,12 @@ public function delete_sales_product() 'orientation' => 'P', ]); - - $mpdf->autoLangToFont = true; $mpdf->autoScriptToLang = true; // Set PDF properties $mpdf->SetTitle('Invoice'); $mpdf->SetAuthor($data[0]->branch_name); $mpdf->SetCreator(''); - - // Generate the PDF content (HTML) if ($data[0]->status === 'Draft') { // Set the watermark text and options @@ -357,7 +346,7 @@ public function delete_sales_product() // return view('invoice_pdf_template', ['sales' => $data,'items'=>$items, 'business' => $business , 'vehicle' => $vehicle,'bike_model'=>$bike_model,'bike_make'=>$bike_make]); // Generate the PDF content (HTML) with data - $html = view('invoice_pdf_template', ['sales' => $data,'items'=>$items, 'business' => $business , 'vehicle' => $vehicle,'bike_model'=>$bike_model,'bike_make'=>$bike_make]); + $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]); // Load HTML into the mPDF instance $mpdf->WriteHTML($html); diff --git a/app/Models/ProductModel.php b/app/Models/ProductModel.php index c672b12..9465db2 100644 --- a/app/Models/ProductModel.php +++ b/app/Models/ProductModel.php @@ -9,7 +9,7 @@ class ProductModel extends Model 'quality','product_name','branch_id','prefered_vendor','product_category','mfr_part_no','purchase_order_level', 'unit_price','commision_rate','sgst','cgst','purchase_cost','usage_unit','vendor','qty_stock','reorder_level', 'handler','qty_in_demand','product_image','description','specification','hsn_sac','isactive','total_amount', - 'per']; + 'per','ml']; public function getTax() diff --git a/app/Views/edit_return_order.php b/app/Views/edit_return_order.php index 7175ce7..bf6eea7 100644 --- a/app/Views/edit_return_order.php +++ b/app/Views/edit_return_order.php @@ -123,13 +123,19 @@ if ($purchasechild['isactive'] == 1) : ?> - + > + ' + ''; - - // $('#productItemTable tbody').append(newRow); - $(newRow).insertAfter($(this).closest('tr')); + // $('#productItemTable tbody').append(newRow); + $(newRow).insertAfter($(this).closest('tr')); initializeSelect2(); - - }); $('#addService').click(function() { - servicearray = ; - // console.log(servicearray); - var newRow = ' ' + + '' + + '' + + '' + + '' + + '
' + + '' + + ''; + + + $('#productItemTable tbody').append(newRow); + initializeSelect2(); + }else{ + toastr.warning("First Select Vehicle!"); } - - newRow += '' + - '' + - '' + - '' + - '' + - '
' + - '' + - ''; - - - $('#productItemTable tbody').append(newRow); - initializeSelect2(); - - }); $('#addcomplaint').click(function() { complaint = ; - // console.log(productarray); var newRow = ' ' + ''; - - - $('#productItemTable tbody').append(newRow); + $('#productItemTable tbody').append(newRow); initializeSelect2(); - - }); $('#addCustomComplaint').click(function() { complaint = ; - // console.log(productarray); var newRow = ' ' + '' + '' + @@ -1043,25 +1034,25 @@ $(document).ready(async function() { $('#productItemTable tbody').append(newRow); initializeSelect2(); - // Function to increment class name - function incrementClassName(className) { - var classNumber = parseInt(className.match(/\d+/)[0]); - return className.replace(/\d+/, classNumber + 1); - } + // Function to increment class name And this Class name for for remove the parent Custom Comlaint is remove the child to remove + function incrementClassName(className) { + var classNumber = parseInt(className.match(/\d+/)[0]); + return className.replace(/\d+/, classNumber + 1); + } - // Initial class name - var initialClassName = 'custom_complaint_class'; - var currentClassName; + // Initial class name + var initialClassName = 'custom_complaint_class'; + var currentClassName; - // Loop to check for existence of subsequent classes - for (var i = 2000; i <= 2100; i++) { - currentClassName = initialClassName + '_' + i; - if ($('.' + currentClassName).length === 0) { - // If the class doesn't exist, increment the last found class - $('.' + initialClassName).removeClass(initialClassName).addClass(currentClassName); - break; - } - } + // Loop to check for existence of subsequent classes + for (var i = 2000; i <= 2100; i++) { + currentClassName = initialClassName + '_' + i; + if ($('.' + currentClassName).length === 0) { + // If the class doesn't exist, increment the last found class + $('.' + initialClassName).removeClass(initialClassName).addClass(currentClassName); + break; + } + } }); $(document).on('input', '.item_dummy', function() { diff --git a/app/Views/product_form.php b/app/Views/product_form.php index a7aed8e..67230d0 100644 --- a/app/Views/product_form.php +++ b/app/Views/product_form.php @@ -7,11 +7,7 @@
" class="btn btn-secondary waves-effect">Cancel +
@@ -22,53 +18,49 @@

" method="post"> -

Product Details :


+

Product Details :


-
- +
' ?> + + + +
-
- - '; ?> - + + + + + + - - - -
- + + +
- - + +
@@ -76,7 +68,6 @@
-
@@ -89,24 +80,22 @@ - - + + +
- - -
- + + +
@@ -114,72 +103,67 @@
-
-
- - -
+

Pricing Information :


@@ -208,49 +192,54 @@
- - -

Stock Information :


-
+
-
-
- - -
-
- - -
-
- - -
- +
> + + +
+
+ + +
+
+ + +
+
+ + +
- - +

Description Details :


-
+
-
-
+ +
+ @@ -583,63 +572,73 @@ $('#saveMakeBtn').click(function() {