Merge branch 'main' of bitbucket.org:venbainformationtechnology/the_mechanic
This commit is contained in:
commit
a27ac0ec07
@ -140,8 +140,9 @@ $routes->get('dashboard', 'Users::dashboard');
|
||||
|
||||
// Model //
|
||||
$routes->get('bike_model_index/(:any)', 'Model::index/$1');
|
||||
$routes->post('create_model', 'Model::create_model');
|
||||
$routes->get('delete_model/(:any)', 'Model::delete_model/$1');
|
||||
$routes->post('create_model/(:any)', 'Model::create_model/$1');
|
||||
// $routes->post('create_model/(:any)', 'Model::create_model/$1');
|
||||
$routes->post('status_model', 'Model::status_model');
|
||||
// Model End's//
|
||||
|
||||
|
||||
@ -54,6 +54,27 @@ class Jobcard extends BaseController
|
||||
return view('jobs_list',$data);
|
||||
}
|
||||
|
||||
public function getCurrentFinancialYear() {
|
||||
// Get the current month and year
|
||||
$currentMonth = date('n');
|
||||
$currentYear = date('Y');
|
||||
|
||||
// Determine the start date of the financial year
|
||||
if ($currentMonth >= 4) {
|
||||
$startYear = $currentYear;
|
||||
} else {
|
||||
$startYear = $currentYear - 1;
|
||||
}
|
||||
|
||||
// Determine the end date of the financial year
|
||||
$endYear = $startYear + 1;
|
||||
|
||||
// Format the financial year string
|
||||
$financialYear = $startYear . '/' . substr($endYear, -2);
|
||||
|
||||
return $financialYear;
|
||||
}
|
||||
|
||||
public function download_jobcard_invoice($job_card_id)
|
||||
{
|
||||
$data['vehicle'] = $this->JobcardModel->get_jobcard_vehicle_details($job_card_id);
|
||||
@ -67,16 +88,18 @@ class Jobcard extends BaseController
|
||||
if($data['job_card'][0]['inv_no'] == '')
|
||||
{
|
||||
/** GENERATE INV NO */
|
||||
$uniqueId = sprintf('%06d', mt_rand(0, 999999));
|
||||
$date = date('Ymdhms');
|
||||
$invoiceNumber = 'INV' . '-' . $date . $uniqueId;
|
||||
$count = $this->JobcardModel->where('status', 'Paid')->countAllResults();
|
||||
$formattedCount = str_pad($count+1, 5, '0', STR_PAD_LEFT);
|
||||
$currentFinancialYear = $this->getCurrentFinancialYear();
|
||||
$invoiceNumber = 'MECH-' . $currentFinancialYear. '/' . $formattedCount;
|
||||
$this->JobcardModel->update($job_card_id,['inv_no' => $invoiceNumber]);
|
||||
$data['job_card'][0]['inv_no'] = $invoiceNumber;
|
||||
}
|
||||
|
||||
$servicedata = $this->JobcardModel->get_jobcard_service($job_card_id);
|
||||
$complaintdata = $this->JobcardModel->get_jobcard_complaint($job_card_id);
|
||||
$labourcost = array_merge($servicedata, $complaintdata);
|
||||
$customcomplaintdata = $this->JobcardModel->get_jobcard_custom_complaint($job_card_id);
|
||||
$labourcost = array_merge($servicedata, $complaintdata,$customcomplaintdata);
|
||||
/** CALCULATE LABOURCOST WITH TAX */
|
||||
$totalAmount = 0;
|
||||
$totalTax = 0;
|
||||
@ -129,7 +152,7 @@ class Jobcard extends BaseController
|
||||
|
||||
// Generate the PDF content (HTML) with data
|
||||
$html = view('invoice_pdf_template_jobcard', $data);
|
||||
echo $html;die;
|
||||
// echo $html;die;
|
||||
// Load HTML into the mPDF instance
|
||||
$mpdf->WriteHTML($html);
|
||||
|
||||
|
||||
@ -13,7 +13,8 @@ class Model extends BaseController
|
||||
|
||||
public $session;
|
||||
use ResponseTrait;
|
||||
|
||||
public $BikemodelsModel;
|
||||
public $BikemakeModel;
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
@ -58,7 +59,7 @@ class Model extends BaseController
|
||||
|
||||
}
|
||||
|
||||
public function create_model($model_id)
|
||||
public function create_model()
|
||||
{
|
||||
try {
|
||||
$make_id = $this->request->getPost('make_id');
|
||||
@ -70,7 +71,7 @@ class Model extends BaseController
|
||||
'model_name' => $model_name
|
||||
];
|
||||
|
||||
if (!$model_id) {
|
||||
// if (!$model_id) {
|
||||
|
||||
try {
|
||||
$inserted = $BikemodelsModel->insert($data);
|
||||
@ -80,23 +81,24 @@ class Model extends BaseController
|
||||
}
|
||||
if ($inserted) {
|
||||
$result = $data;
|
||||
$model_list = $BikemodelsModel->where('make_id',$make_id)->orderBy('make','asc')->findAll();
|
||||
$model_list = $BikemodelsModel->where('make_id',$make_id)->orderBy('make_id','asc')->findAll();
|
||||
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result,'model_list'=>$model_list],200);
|
||||
} else {
|
||||
$result = "No Match's";
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => $result],404);
|
||||
}
|
||||
}else{
|
||||
$updated = $BikemodelsModel->update($model_id ,$data);
|
||||
if ($updated) {
|
||||
$result = $data;
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result],200);
|
||||
} else {
|
||||
$result = "No Match's";
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => $result],404);
|
||||
}
|
||||
}
|
||||
// }
|
||||
// else{
|
||||
// $updated = $BikemodelsModel->update($model_id ,$data);
|
||||
// if ($updated) {
|
||||
// $result = $data;
|
||||
// return $this->respond(['status' => 'success','code' => 200,'data' => $result],200);
|
||||
// } else {
|
||||
// $result = "No Match's";
|
||||
// return $this->respond(['status' => 'failed','code' => 404,'data' => $result],404);
|
||||
// }
|
||||
// }
|
||||
|
||||
} catch (\Exception $exception) {
|
||||
return $this->respond(['status' => 'failed','code' => 500,'data' => $exception],500);
|
||||
|
||||
@ -424,7 +424,7 @@ public function delete_sales_product()
|
||||
$vehicleData = $VehicleModel->where('vehicle_id',$id)->first();
|
||||
|
||||
// If insertion succeeds, return success response
|
||||
return $this->response->setJSON(['success' => true, 'message' => 'Client saved successfully.','vehicleData'=>$vehicleData]);
|
||||
return $this->response->setJSON(['success' => true, 'message' => 'Client saved successfully.','vehicleData'=>$vehicleData, 'vehicle_id' => $id]);
|
||||
} else {
|
||||
// If insertion fails, return error response
|
||||
return $this->response->setJSON(['success' => false, 'message' => 'Failed to save client.']);
|
||||
|
||||
@ -98,6 +98,15 @@ class JobcardModel extends Model
|
||||
return $this->findAll();
|
||||
}
|
||||
|
||||
public function get_jobcard_custom_complaint($job_id)
|
||||
{
|
||||
$this->select('job_card.*, job_card_custom_complaint.*, job_card_custom_complaint.name as product_name, job_card_custom_complaint.labour_cost as labour_amount');
|
||||
$this->join('job_card_custom_complaint', 'job_card_custom_complaint.job_card_id = job_card.job_card_id');
|
||||
$this->where('job_card.isactive', 1);
|
||||
$this->where('job_card.job_card_id', $job_id);
|
||||
return $this->findAll();
|
||||
}
|
||||
|
||||
public function get_jobcard_labourcost($job_id)
|
||||
{
|
||||
$this->select('job_card.*, job_card_service.job_card_id, job_card_service.service_id, job_card_complaint.job_card_id, job_card_complaint.complaint_id, services.labour_cost, complaints.labour_charge,services.tax ,complaints.tax, services.labour_cost, complaints.labour_charge');
|
||||
|
||||
@ -241,9 +241,9 @@ p {
|
||||
</td>
|
||||
|
||||
<td style="border: 0.5px solid black;"><?= $item['product_name'] ?></td>
|
||||
<td style="border: 0.5px solid black;"><?php echo isset($item['custom_amount']) ? $item['custom_amount'] : $item['amount'] ?></td>
|
||||
<td style="border: 0.5px solid black;"><?php echo isset($item['custom_amount']) ? round($item['custom_amount']) : $item['amount'] ?></td>
|
||||
<td style="border: 0.5px solid black;"><?= $item['qty'] ?></td>
|
||||
<td style="border: 0.5px solid black;">nos</td>
|
||||
<td style="border: 0.5px solid black;"><?php echo isset($item['custom_amount']) ? '-' : $item['per'] ?></td>
|
||||
<td style="border: 0.5px solid black;"><?= $item['tax'] ?>%</td>
|
||||
<td style="border: 0.5px solid black;"><?php echo isset($item['custom_tax']) ? $item['custom_tax'] / 2: ($item['amount'] * ($item['tax'] / 2) / 100) ?></td>
|
||||
<td style="border: 0.5px solid black;"><?php echo isset($item['custom_tax']) ? $item['custom_tax'] / 2: ($item['amount'] * ($item['tax'] / 2) / 100) ?></td>
|
||||
|
||||
@ -72,8 +72,8 @@
|
||||
<input type="text" class="form-control" name="state" placeholder="State"value="<?= isset($jobs['billing_state']) ? $jobs['billing_state'] : 'Tamil Nadu' ?>" >
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label for="inputPassword4" class="col-form-label">Pin Code<span class="text-danger"></span></label>
|
||||
<input type="text" class="form-control" name="postalcode" placeholder="Pin Code"value="<?= isset($jobs['billing_postal_code']) ? $jobs['billing_postal_code'] : '' ?>" maxlength="6" minlength="6" >
|
||||
<label for="inputPassword4" class="col-form-label">PIN Code<span class="text-danger"></span></label>
|
||||
<input type="text" class="form-control" name="postalcode" placeholder="PIN Code"value="<?= isset($jobs['billing_postal_code']) ? $jobs['billing_postal_code'] : '' ?>" maxlength="6" minlength="6" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
@ -176,21 +176,12 @@
|
||||
<input type="text" class="form-control" id="invoicetax" name="invoicetax" readonly value="<?= isset($sales['tax']) ? $sales['tax'] : '' ?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="grandtotal">Total</label>
|
||||
<label for="grandtotal">Estimate</label>
|
||||
<input type="text" class="form-control" id="grandtotal" name="grand_total" readonly value="<?= isset($sales['total']) ? $sales['total'] : '' ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="header-title">Terms & Condition :</h4><br>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="inputPassword4" class="col-form-label">Terms & Condition</label>
|
||||
<textarea class="form-control" name="terms_condition" placeholder="Terms & Condition" >
|
||||
<?= isset($sales['terms_condition']) ? $sales['terms_condition'] : 'Please check the products properly before purchase. Products once sold cannot be returned.' ?>
|
||||
</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (!isset($sales['status']) || $sales['status'] !== 'Paid') : ?>
|
||||
<button type="submit" id="submit-btn" class="btn btn-primary">Submit</button>
|
||||
<?php endif; ?>
|
||||
@ -267,7 +258,7 @@
|
||||
|
||||
<div class="form-group col-md-12 select">
|
||||
<label for="clientMobile">Mobile</label>
|
||||
<input type="text" class="form-control" id="clientMobile" placeholder="Enter mobile number" maxlength="10" minlength="10"onkeypress = "return onlyNumbers(event)"required>
|
||||
<input type="text" class="form-control client_mob_no" id="clientMobile" placeholder="Enter mobile number" maxlength="10" minlength="10"onkeypress = "return onlyNumbers(event)"required>
|
||||
</div>
|
||||
|
||||
|
||||
@ -429,7 +420,7 @@ $(document).ready(async function() {
|
||||
function editlabourcost(data,cls) {
|
||||
total_wih_tax = parseInt(data.labour_cost) + (parseInt(data.labour_cost) * (data.tax / 100));
|
||||
total_tax_amt = total_wih_tax - parseInt(data.labour_cost);
|
||||
var newRow = '<tr class="'+cls+'"><td hidden style="width:10%;"><input type="number" class="form-control labour_cost" name="labour_cost"></td><td style="padding-left: 40px !important;"><i class="fa fa-caret-right" style="font-size: 20px;margin-top: 8px;position: absolute;margin-left: -18px;" aria-hidden="true"></i><input type="text" class="form-control labour_cost" value="Labour Cost"></td>' +
|
||||
var newRow = '<tr class="'+cls+'"><td hidden style="width:10%;"><input type="number" class="form-control labour_cost" name="labour_cost"></td><td style="padding-left: 40px !important;"><i class="fas fa-user-alt" style="font-size: 13px;margin-top: 8px;position: absolute;margin-left: -18px;" aria-hidden="true"></i><input type="text" class="form-control labour_cost" value="Labour Cost"></td>' +
|
||||
'<td style="width:10%;"><input type="text" class="form-control rate-d-only" value="'+data.labour_cost+'" readonly /></td>' +
|
||||
'<td style="width:10%;" hidden><input hidden type="text" class="form-control item-rate" name="unit-price[]" value="'+data.labour_cost +'" /></td>' +
|
||||
'<td style="width:10%;"><input type="number" class="form-control item-quantity-'+cls+' item-quantity" min="0" name="quantity[]" value="1" readonly /></td>' +
|
||||
@ -452,7 +443,7 @@ $(document).ready(async function() {
|
||||
console.log(total_wih_tax);
|
||||
total_tax_amt = total_wih_tax - ( parseInt(product.amount) * product.qty);
|
||||
var newRow = `<tr class="product"><td hidden style="width:10%;"><input type="number" class="form-control labour_cost" name="labour_cost"></td>
|
||||
<td style="padding-left: 40px !important;"><i class="fa fa-caret-right" style="font-size: 20px;margin-top: 8px;position: absolute;margin-left: -18px;" aria-hidden="true"></i>
|
||||
<td style="padding-left: 40px !important;"><i class="fa fa-wrench" style="font-size: 13px;margin-top: 8px;position: absolute;margin-left: -18px;" aria-hidden="true"></i>
|
||||
<select class="form-control book-select SelExample product" name="item_details[]" required data-toggle="select2" style="width: 249px !important;">`;
|
||||
|
||||
newRow += '<option value="' + product.product_id + '" selected>' + product.pname + '</option>';
|
||||
@ -476,11 +467,40 @@ $(document).ready(async function() {
|
||||
}
|
||||
});
|
||||
|
||||
$(window).on('load', function() {
|
||||
// This code will execute after the page has been reloaded
|
||||
vehicle_id = localStorage.getItem('vehicle_id');
|
||||
if(vehicle_id) {
|
||||
fetch_data(vehicle_id);
|
||||
$('#vehicle_name').val(vehicle_id);
|
||||
var vehicleId = vehicle_id;
|
||||
if (vehicleId !== '') {
|
||||
// Find the selected client in the client data
|
||||
var selectedClient = vehicles.find(function(vehicle) {
|
||||
return vehicle.vehicle_id == vehicleId;
|
||||
});
|
||||
|
||||
console.log(selectedClient);
|
||||
|
||||
$('input[name="client_id"]').val(selectedClient.client_name);
|
||||
$('input[name="billing_address"]').val(selectedClient.address);
|
||||
$('input[name="billing_address"]').val(selectedClient.address);
|
||||
$('input[name="city"]').val(selectedClient.city);
|
||||
$('input[name="state"]').val(selectedClient.state);
|
||||
$('input[name="country"]').val(selectedClient.country);
|
||||
$('input[name="mobile_no"]').val(selectedClient.mobile_no);
|
||||
$('input[name="postalcode"]').val(selectedClient.postal_code);
|
||||
}
|
||||
}
|
||||
localStorage.removeItem('vehicle_id');
|
||||
});
|
||||
|
||||
productarray = [];
|
||||
servicearray = [];
|
||||
$(document).ready(function() {
|
||||
// Event listener for vehicle selection change
|
||||
$('.vehicle-select').change(function() {
|
||||
$('#productItemTable tbody').empty();
|
||||
var vehicleId = $(this).val();
|
||||
fetch_data(vehicleId)
|
||||
});
|
||||
@ -488,8 +508,9 @@ $(document).ready(async function() {
|
||||
if($('.vehicle-select').val()) {
|
||||
fetch_data($('.vehicle-select').val())
|
||||
}
|
||||
});
|
||||
|
||||
function fetch_data(vehicleId) {
|
||||
function fetch_data(vehicleId) {
|
||||
if (vehicleId !== '') {
|
||||
// Find the selected vehicle
|
||||
var selectedVehicle = vehicles.find(function(vehicle) {
|
||||
@ -550,7 +571,6 @@ $(document).ready(async function() {
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
$product_json = isset($product_1) ? json_encode($product_1) : json_encode($product);
|
||||
@ -739,15 +759,16 @@ $(document).ready(async function() {
|
||||
data_contruction_for_save();
|
||||
$("#delete_items").val(JSON.stringify(delete_items_id));
|
||||
$('#form-submit').submit();
|
||||
$('#submit-btn').prop('disabled', true);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Event listener for product selection
|
||||
$(document).on('change', 'select[name="item_details[]"]', function() {
|
||||
var productId = $(this).val();
|
||||
// Get class name of the select element
|
||||
var className = $(this).attr('class');
|
||||
var productId = $(this).val();
|
||||
var quantity = $(this).closest('tr').find('.item-quantity').val(1);
|
||||
|
||||
if (className.includes("product")) {
|
||||
@ -929,7 +950,7 @@ $(document).ready(async function() {
|
||||
var tax = cgst + sgst;
|
||||
total_wih_tax = parseInt(product.unit_price) + (parseInt(product.unit_price) * (tax / 100));
|
||||
total_tax_amt = total_wih_tax - parseInt(product.unit_price);
|
||||
var newRow = '<tr class="product"><td hidden style="width:10%;"><input type="number" class="form-control labour_cost" name="labour_cost"></td><td style="padding-left: 40px !important;"><i class="fa fa-caret-right" style="font-size: 20px;margin-top: 8px;position: absolute;margin-left: -18px;" aria-hidden="true"></i><select class="form-control book-select SelExample product" name="item_details[]" required data-toggle="select2" style="width: 249px !important;">';
|
||||
var newRow = '<tr class="product"><td hidden style="width:10%;"><input type="number" class="form-control labour_cost" name="labour_cost"></td><td style="padding-left: 40px !important;"><i class="fa fa-wrench" style="font-size: 13px;margin-top: 8px;position: absolute;margin-left: -18px;" aria-hidden="true"></i><select class="form-control book-select SelExample product" name="item_details[]" required data-toggle="select2" style="width: 249px !important;">';
|
||||
newRow += '<option value="' + product.product_id + '">' + product.product_name + '</option>';
|
||||
newRow += '</select></td>' +
|
||||
'<td style="width:10%;"><input type="text" class="form-control rate-d-only" value="'+ product.unit_price +'" readonly /></td>' +
|
||||
@ -1050,11 +1071,21 @@ $(document).ready(async function() {
|
||||
productarray = <?php echo json_encode($product) ?>;
|
||||
console.log(productarray);
|
||||
}
|
||||
var newRow = '<tr class="product"><td hidden style="width:10%;"><input type="number" class="form-control labour_cost" name="labour_cost"></td><td style="padding-left: 40px !important;"><i class="fa fa-caret-right" style="font-size: 20px;margin-top: 8px;position: absolute;margin-left: -18px;" aria-hidden="true"></i><select class="form-control book-select SelExample product" name="item_details[]" required data-toggle="select2" style="width: 249px !important;"><option value="">Select a Product</option>';
|
||||
|
||||
selected_pr = [];
|
||||
$('tr.product').each(function() {
|
||||
var rowProductid = $(this).find('.product').val();
|
||||
selected_pr.push(rowProductid);
|
||||
});
|
||||
|
||||
var newRow = '<tr class="product"><td hidden style="width:10%;"><input type="number" class="form-control labour_cost" name="labour_cost"></td><td style="padding-left: 40px !important;"><i class="fa fa-wrench" style="font-size: 13px;margin-top: 8px;position: absolute;margin-left: -18px;" aria-hidden="true"></i><select class="form-control book-select SelExample product" name="item_details[]" required data-toggle="select2" style="width: 249px !important;"><option value="">Select a Product</option>';
|
||||
for (var i = 0; i < productarray.length; i++)
|
||||
{
|
||||
var product = productarray[i];
|
||||
newRow += '<option value="' + product.product_id + '">' + product.product_name + '</option>';
|
||||
if(!selected_pr.includes(product.product_id))
|
||||
{
|
||||
newRow += '<option value="' + product.product_id + '">' + product.product_name + '</option>';
|
||||
}
|
||||
}
|
||||
|
||||
newRow += '</select></td>' +
|
||||
@ -1076,14 +1107,27 @@ $(document).ready(async function() {
|
||||
$('#addService').click(function() {
|
||||
|
||||
if ($('#vehicle_name').val()) {
|
||||
servicearray = <?php echo isset($service_1) ? json_encode($service_1) : json_encode($service) ?>;
|
||||
// console.log(servicearray);
|
||||
|
||||
selected_pr = [];
|
||||
$('tr.service_class').each(function() {
|
||||
var rowProductid = $(this).find('.service').val();
|
||||
selected_pr.push(rowProductid);
|
||||
});
|
||||
|
||||
if(servicearray.length == 0)
|
||||
{
|
||||
servicearray = <?php echo isset($service_1) ? json_encode($service_1) : json_encode($service) ?>;
|
||||
}
|
||||
console.log(servicearray);
|
||||
var newRow = '<tr class="service_class"><td hidden style="width:10%;"> <input type="number" class="form-control labour_cost" name="labour_cost"></td><td><select class="form-control book-select SelExample service" name="service_details[]" required data-toggle="select2" style="width: 249px !important;"><option value="">Select a Service</option>';
|
||||
|
||||
for (var i = 0; i < servicearray.length; i++)
|
||||
{
|
||||
var service = servicearray[i];
|
||||
newRow += '<option value="' + service.service_id + '">' + service.service_name + '</option>';
|
||||
if(!selected_pr.includes(service.service_id))
|
||||
{
|
||||
newRow += '<option value="' + service.service_id + '">' + service.service_name + '</option>';
|
||||
}
|
||||
}
|
||||
|
||||
newRow += '</select></td>' +
|
||||
@ -1119,13 +1163,22 @@ $(document).ready(async function() {
|
||||
});
|
||||
|
||||
$('#addcomplaint').click(function() {
|
||||
selected_pr = [];
|
||||
$('tr.complaint_class').each(function() {
|
||||
var rowProductid = $(this).find('.complaint').val();
|
||||
selected_pr.push(rowProductid);
|
||||
});
|
||||
|
||||
complaint = <?php echo json_encode($complaint) ?>;
|
||||
var newRow = '<tr class="complaint_class"><td hidden style="width:10%;"> <input type="number" class="form-control labour_cost" name="labour_cost"></td><td><select class="form-control book-select SelExample complaint" id="complaint_detail" name="complaint_details[]" required data-toggle="select2" style="width: 249px !important;"><option value="">Select a Complaint</option>';
|
||||
|
||||
for (var i = 0; i < complaint.length; i++)
|
||||
{
|
||||
var complaints = complaint[i];
|
||||
newRow += '<option value="' + complaints.complaint_id + '">' + complaints.name + '</option>';
|
||||
if(!selected_pr.includes(complaints.complaint_id))
|
||||
{
|
||||
newRow += '<option value="' + complaints.complaint_id + '">' + complaints.name + '</option>';
|
||||
}
|
||||
}
|
||||
|
||||
newRow += '</select></td>' +
|
||||
@ -1165,12 +1218,12 @@ $(document).ready(async function() {
|
||||
|
||||
$('#addCustomComplaint').click(function() {
|
||||
complaint = <?php echo json_encode($complaint) ?>;
|
||||
var newRow = '<tr class="custom_complaint_class"><td hidden style="width:10%;"> <input type="number" class="form-control labour_cost" name="labour_cost"></td><td><textarea class="form-control custom-comp" id="custom_complaint_detail" rows="5"></textarea></td>' +
|
||||
var newRow = '<tr class="custom_complaint_class"><td hidden style="width:10%;"> <input type="number" class="form-control labour_cost" name="labour_cost"></td><td><textarea class="form-control custom-comp" id="custom_complaint_detail" required rows="5"></textarea></td>' +
|
||||
'<td style="width:10%;"><input hidden type="text" class="form-control rate-d-only" readonly /></td>' +
|
||||
'<td style="width:10%;" hidden><input type="text" class="form-control item-rate1" name="unit-price[]" readonly /></td>' +
|
||||
'<td style="width:10%;"><input hidden type="number" class="form-control item-quantity" min="0" value="1" name="quantity[]" readonly/></td>' +
|
||||
'<td style="width:8%;"><input hidden type="text" class="form-control item-tax" name="item-tax[]" value="18" readonly /></td>' +
|
||||
'<td style="width:12%;"><input hidden type="text" class="form-control item-amount1" name="amount[]"/></td>' +
|
||||
'<td style="width:12%;"><input hidden type="text" class="form-control item-amount1" name="amount[]" required/></td>' +
|
||||
'<td style="width:8%;"><input hidden type="text" class="form-control total-tax-amount" readonly /></td>' +
|
||||
'<td hidden><input type="hidden"></td>' +
|
||||
'<td><div style="display: inline-block;">'+
|
||||
@ -1192,7 +1245,7 @@ $(document).ready(async function() {
|
||||
'<td style="width:10%;"><input type="number" class="form-control item-quantity" min="0" name="quantity[]" value="'+1+'" readonly /></td>' +
|
||||
'<td style="width:8%;"><input type="text" class="form-control taxable-value item-tax item-tax_cc" name="item-tax[]" value="'+18+'" readonly /></td>' +
|
||||
'<td style="width:8%;"><input type="text" class="form-control total-tax-amount" value="" readonly /></td>' +
|
||||
'<td style="width:12%;"><input type="text" class="form-control item-amount item-amount_cc" name="amount1[]" value="" /></td>' +
|
||||
'<td style="width:12%;"><input type="text" class="form-control item-amount item-amount_cc" name="amount1[]" value="" required /></td>' +
|
||||
'<td hidden></td>' +
|
||||
'<td hidden></td>' +
|
||||
'</tr>';
|
||||
@ -1430,8 +1483,21 @@ $(document).ready(async function() {
|
||||
var ifStatementCondition = "createclientName !== '' && createclientMobile !== '' && createclientType !== '' && reg_no !== '' && model !== '' && make !== ''";
|
||||
}
|
||||
|
||||
if(createclientMobile) {
|
||||
var clientArray = <?php echo json_encode($client) ?>;
|
||||
console.log(clientArray);
|
||||
var mobileIdExists = clientArray.some(function(client) {
|
||||
return client.mobile_no.trim() === createclientMobile.trim();
|
||||
});
|
||||
|
||||
if(mobileIdExists) {
|
||||
toastr.warning("Mobile Number Already Added!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (reg_no) {
|
||||
$('#saveVehcileBtn').prop('disabled', true);
|
||||
$.ajax({
|
||||
url: '<?= base_url("checkRegisterNo") ?>', // URL to your controller method for fetching models
|
||||
type: 'POST',
|
||||
@ -1441,6 +1507,7 @@ $(document).ready(async function() {
|
||||
if (response) {
|
||||
$('#reg_no').val("");
|
||||
toastr.warning("Register Number Already Added!");
|
||||
$('#saveVehcileBtn').prop('disabled', false);
|
||||
}else{
|
||||
if( eval(ifStatementCondition) ){
|
||||
|
||||
@ -1464,20 +1531,24 @@ $(document).ready(async function() {
|
||||
if (response.success) {
|
||||
$('#addVehicleModal').modal('hide');
|
||||
toastr.success("Vehicle saved successfully!");
|
||||
localStorage.setItem('vehicle_id',response.vehicle_id)
|
||||
window.location.reload();
|
||||
|
||||
} else {
|
||||
toastr.warning("Failed to save vehicle. Please try again");
|
||||
$('#saveVehcileBtn').prop('disabled', false);
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error('Error occurred while saving vehicle:', error);
|
||||
toastr.warning("Failed to save vehicle. Please try again");
|
||||
$('#saveVehcileBtn').prop('disabled', false);
|
||||
}
|
||||
});
|
||||
|
||||
}else{
|
||||
toastr.warning("Please Fill All Data");
|
||||
$('#saveVehcileBtn').prop('disabled', false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1498,6 +1569,7 @@ $(document).ready(async function() {
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
<script>
|
||||
$(".SelExample").select2();
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
<h4 class="page-title">Job Card List</h4>
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class=""> <a href="<?= base_url() . "new_jobcard/0"; ?>" class="btn btn-primary waves-effect"> Add Job Card</a>
|
||||
<li class=""> <a href="<?= base_url() . "new_jobcard/0"; ?>" class="btn btn-primary waves-effect"> New Job Card</a>
|
||||
</li>
|
||||
|
||||
</ol>
|
||||
@ -40,18 +40,15 @@
|
||||
|
||||
<tr>
|
||||
<th>Order Number</th>
|
||||
<th>Reg No</th>
|
||||
<th>Client Name</th>
|
||||
<th>Client Mobile</th>
|
||||
<th>Quantity</th>
|
||||
<th>Vehicle No</th>
|
||||
<th>Client</th>
|
||||
<?php if(session()->get('logged_user_role') != 'Store Manager') { ?>
|
||||
<th>Subtotal</th>
|
||||
<th>Tax</th>
|
||||
|
||||
<?php }
|
||||
else { ?>
|
||||
<th>Issued From The Store</th>
|
||||
<?php } ?>
|
||||
<th>Total</th>
|
||||
<th>Estimate</th>
|
||||
<th>Status</th>
|
||||
<th>Actions</th>
|
||||
|
||||
@ -64,12 +61,9 @@
|
||||
<tr>
|
||||
<td><?= $value['order_number']; ?></td>
|
||||
<td><?= $value['reg_no']; ?></td>
|
||||
<td><?= $value['client_name']; ?></td>
|
||||
<td><?= $value['client_mobile_no']; ?></td>
|
||||
<td><?= $value['product_count']; ?></td>
|
||||
<td><?= $value['client_name']; ?><br><?= $value['client_mobile_no']; ?></td>
|
||||
<?php if(session()->get('logged_user_role') != 'Store Manager') { ?>
|
||||
<td><?= $value['subtotal']; ?></td>
|
||||
<td><?= $value['tax']; ?></td>
|
||||
|
||||
<?php }
|
||||
else { ?>
|
||||
<td><?php echo $value['store_item_issued'] == 0 ? "Not Issued" : "Item Issued"; ?></td>
|
||||
@ -77,11 +71,11 @@
|
||||
<td><?= $value['total']; ?></td>
|
||||
<td><?= $value['status']; ?></td>
|
||||
<td>
|
||||
<a href="<?= "new_jobcard/" . $value['job_card_id']; ?>" class="edit-button"><i class="ri-pencil-line"></i></a>
|
||||
<a href="<?= "new_jobcard/" . $value['job_card_id']; ?>" class="edit-button" title="Edit"><i class="ri-pencil-line"></i></a>
|
||||
|
||||
<a href="<?= "download_jobcard_invoice/" . $value['job_card_id']; ?>" class="edit-button"><i class="ri-file-download-line"></i></a>
|
||||
<a href="<?= "download_jobcard_invoice/" . $value['job_card_id']; ?>" class="edit-button" title="Download"><i class="ri-file-download-line"></i></a>
|
||||
|
||||
<a href="<?= "delete_jobcard/" . $value['job_card_id']; ?>" class="delete-button"><i class="ri-delete-bin-line"></i></a>
|
||||
<a href="<?= "delete_jobcard/" . $value['job_card_id']; ?>" class="delete-button" title="Delete"><i class="ri-delete-bin-line"></i></a>
|
||||
</td>
|
||||
<?php endif?>
|
||||
<?php endforeach; ?>
|
||||
|
||||
@ -114,9 +114,9 @@
|
||||
<div class="h-100" data-simplebar>
|
||||
|
||||
<!-- User box -->
|
||||
<div class="user-box text-center">
|
||||
<!-- <div class="user-box text-center">
|
||||
<p class="text-reset"><?php echo session()->get("logged_user_role") ?></p>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<!--- Sidemenu -->
|
||||
<div id="sidebar-menu">
|
||||
@ -124,7 +124,7 @@
|
||||
<ul id="side-menu">
|
||||
|
||||
|
||||
<li class="menu-title">Navigation</li>
|
||||
<!-- <li class="menu-title">Navigation</li> -->
|
||||
|
||||
|
||||
<?php if(session()->get('logged_user_role') == 'Super Admin') {
|
||||
@ -360,8 +360,10 @@
|
||||
|
||||
<span class="pro-user-name ml-1">
|
||||
<?php echo session()->get('logged_user_name'); ?><i class="mdi mdi-chevron-down"></i>
|
||||
|
||||
</span>
|
||||
</a>
|
||||
<span class="pro-user-name ml-1" style="margin-top: -27px;position: absolute;color:#c9cdce;"><?php echo session()->get("logged_user_role") ?></span>
|
||||
<div class="dropdown-menu dropdown-menu-right profile-dropdown ">
|
||||
<!-- item-->
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box page-title-box-alt">
|
||||
<h4 class="page-title">Re-order Products List </h4>
|
||||
<h4 class="page-title">Low Stock Items</h4>
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
|
||||
@ -48,7 +48,7 @@
|
||||
<td><?= $value['purchase_order_level']; ?></td> -->
|
||||
<td>
|
||||
<!-- <a href="<?= "rise_order/" . $value['product_id']; ?>" class="edit-button"><i class="ri-arrow-up-circle-fill"></i>Rise</a> -->
|
||||
<a href="<?= "rise_order/" . $value['prefered_vendor']; ?>" class="edit-button"><i class="ri-arrow-up-circle-fill"></i>Rise</a>
|
||||
<a href="<?= "rise_order/" . $value['prefered_vendor']; ?>" class="edit-button" title="Raise PO"><i class="fas fa-file-invoice"></i>Raise</a>
|
||||
</td>
|
||||
<?php endforeach; ?>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user