Merge branch 'main' of bitbucket.org:venbainformationtechnology/the_mechanic into main
This commit is contained in:
commit
7d1e8d9db1
@ -481,6 +481,7 @@ class Jobcard extends BaseController
|
|||||||
public function new_jobcard($job_card_id,$rework = null)
|
public function new_jobcard($job_card_id,$rework = null)
|
||||||
{
|
{
|
||||||
if ($job_card_id === '0') {
|
if ($job_card_id === '0') {
|
||||||
|
|
||||||
$data['page_name']="Create Job Card";
|
$data['page_name']="Create Job Card";
|
||||||
$data['jobs'] = [];
|
$data['jobs'] = [];
|
||||||
$data['jobcardfiles'] = [];
|
$data['jobcardfiles'] = [];
|
||||||
@ -684,13 +685,14 @@ class Jobcard extends BaseController
|
|||||||
$data['logged_user_role'] = $this->session->get('logged_user_role');
|
$data['logged_user_role'] = $this->session->get('logged_user_role');
|
||||||
if($rework == 're-work') { $data['rework']= true; }
|
if($rework == 're-work') { $data['rework']= true; }
|
||||||
|
|
||||||
if($this->session->get('logged_user_role') == "Floor Manager")
|
|
||||||
{
|
|
||||||
$RoleModel = new RoleModel();
|
|
||||||
$data['workers'] = $RoleModel->get_workers($this->session->get('logged_user_branch_id'));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
$RoleModel = new RoleModel();
|
||||||
|
$data['workers'] = $RoleModel->get_workers($this->session->get('logged_user_branch_id'));
|
||||||
$data['job_card_id'] = $job_card_id;
|
$data['job_card_id'] = $job_card_id;
|
||||||
$bikeMakeModel = new BikeMakeModel();
|
$bikeMakeModel = new BikeMakeModel();
|
||||||
$data['makeData'] =$bikeMakeModel->findAll();
|
$data['makeData'] =$bikeMakeModel->findAll();
|
||||||
@ -703,13 +705,8 @@ class Jobcard extends BaseController
|
|||||||
|
|
||||||
public function add_jobs()
|
public function add_jobs()
|
||||||
{
|
{
|
||||||
// echo $this->request->getPost('issued_items');die;
|
|
||||||
// echo $this->request->getPost('products');die;
|
// dd($this->request->getPost());
|
||||||
// echo $this->request->getPost('delete_items');die;
|
|
||||||
// echo $this->request->getPost('issued_items');die;
|
|
||||||
// echo json_encode($this->request->getPost());die;
|
|
||||||
// echo "<pre>";
|
|
||||||
// print_r($this->request->getPost());die;
|
|
||||||
$JobcardModel = new JobcardModel();
|
$JobcardModel = new JobcardModel();
|
||||||
if($this->session->get('logged_user_role') == "Store Manager") {
|
if($this->session->get('logged_user_role') == "Store Manager") {
|
||||||
$data['status'] = $this->request->getPost('status');
|
$data['status'] = $this->request->getPost('status');
|
||||||
@ -749,14 +746,14 @@ class Jobcard extends BaseController
|
|||||||
'note'=> $this->request->getPost('note'),
|
'note'=> $this->request->getPost('note'),
|
||||||
'status'=> $this->request->getPost('status'),
|
'status'=> $this->request->getPost('status'),
|
||||||
'assigned_to'=> json_encode($this->request->getPost('assigned_to')),
|
'assigned_to'=> json_encode($this->request->getPost('assigned_to')),
|
||||||
'subtotal'=> $this->request->getPost('sub_total'), // (isset($rework) ? 0 : $this->request->getPost('sub_total') ),
|
'trial_mechanic'=> $this->request->getPost('trial_mechanic'),
|
||||||
'tax'=> $this->request->getPost('invoicetax'), //(isset($rework) ? 0 : $this->request->getPost('invoicetax') ),
|
'subtotal'=> $this->request->getPost('sub_total'),
|
||||||
'discount'=> $this->request->getPost('discount'), //($this->request->getPost('discount')) == '' ? 0 : $this->request->getPost('discount'),
|
'tax'=> $this->request->getPost('invoicetax'),
|
||||||
'total'=> $this->request->getPost('grand_total'), //(isset($rework) ? 0 : $this->request->getPost('grand_total') ),
|
'discount'=> $this->request->getPost('discount'),
|
||||||
|
'total'=> $this->request->getPost('grand_total'),
|
||||||
'isactive' => 1
|
'isactive' => 1
|
||||||
];
|
];
|
||||||
// echo "<pre>";
|
|
||||||
// print_r($job_card_data);die;
|
|
||||||
$status = $this->request->getPost('status');
|
$status = $this->request->getPost('status');
|
||||||
// Insert or update sales order
|
// Insert or update sales order
|
||||||
$job_card_id = $this->request->getPost('job_card_id');
|
$job_card_id = $this->request->getPost('job_card_id');
|
||||||
@ -784,17 +781,13 @@ class Jobcard extends BaseController
|
|||||||
$orderNumber = 'JC-' . date('md') . '-' . str_pad($job_card_id, 5, '0', STR_PAD_LEFT);
|
$orderNumber = 'JC-' . date('md') . '-' . str_pad($job_card_id, 5, '0', STR_PAD_LEFT);
|
||||||
$JobcardModel->update($job_card_id, ['order_number' => $orderNumber]);
|
$JobcardModel->update($job_card_id, ['order_number' => $orderNumber]);
|
||||||
}
|
}
|
||||||
// print_r($orderNumber);die;
|
|
||||||
// Update sales order with generated order number
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/********** INSERT SERVICE DATA ************/
|
/********** INSERT SERVICE DATA ************/
|
||||||
$data = json_decode($_POST['products']);
|
$data = json_decode($_POST['products']);
|
||||||
$service_data = $data[0]->service;
|
$service_data = $data[0]->service;
|
||||||
|
|
||||||
// echo "<pre>";
|
|
||||||
// print_r($service_data);die;
|
|
||||||
|
|
||||||
foreach ($service_data as $item) {
|
foreach ($service_data as $item) {
|
||||||
// Insert into the service table
|
// Insert into the service table
|
||||||
$service['job_card_id'] = $job_card_id;
|
$service['job_card_id'] = $job_card_id;
|
||||||
@ -1148,10 +1141,10 @@ class Jobcard extends BaseController
|
|||||||
$product = $JobcardProductModel->find($product_id);
|
$product = $JobcardProductModel->find($product_id);
|
||||||
$qty = isset($product['issued_qty']) ? $product['issued_qty'] : 0;
|
$qty = isset($product['issued_qty']) ? $product['issued_qty'] : 0;
|
||||||
if ($status == 'Issued') {
|
if ($status == 'Issued') {
|
||||||
// $this->updateProductQuantity($ProductModel, $product['product_id'], $qty);
|
// $this->subractProductQuantity($ProductModel, $product['product_id'], $qty);
|
||||||
}elseif ($status == 'Cancelled'){
|
}elseif ($status == 'Cancelled'){
|
||||||
|
|
||||||
$this->addBackProductQuantity($ProductModel, $product['product_id'], $qty);
|
$this->subractProductQuantity($ProductModel, $product['product_id'], $qty);
|
||||||
$data['status'] = 0;
|
$data['status'] = 0;
|
||||||
// echo $product['job_card_product_id'];die;
|
// echo $product['job_card_product_id'];die;
|
||||||
// $JobcardProductModel->where('job_card_product_id',$product['job_card_product_id'])->update($data);
|
// $JobcardProductModel->where('job_card_product_id',$product['job_card_product_id'])->update($data);
|
||||||
@ -1164,26 +1157,41 @@ class Jobcard extends BaseController
|
|||||||
{
|
{
|
||||||
// Fetch current product quantity
|
// Fetch current product quantity
|
||||||
$product = $ProductModel->find($product_id);
|
$product = $ProductModel->find($product_id);
|
||||||
$current_qty = $product['qty_stock'];
|
|
||||||
|
|
||||||
// Calculate updated quantity
|
$data['qty_stock'] = $product['qty_stock'] + $sold_qty;
|
||||||
$new_qty = $current_qty + $sold_qty;
|
|
||||||
|
|
||||||
// Update quantity in Product table
|
if($product['per'] == 'barrel')
|
||||||
$ProductModel->update($product_id, ['qty_stock' => $new_qty]);
|
{
|
||||||
|
$data['barrel'] = $data['qty_stock'] / $product['ltr_per_barrel'];
|
||||||
|
}
|
||||||
|
else if($product['per'] == 'box')
|
||||||
|
{
|
||||||
|
$data['box'] = $data['qty_stock'] / $product['qty_per_box'];
|
||||||
}
|
}
|
||||||
|
|
||||||
private function updateProductQuantity($ProductModel, $product_id, $sold_qty)
|
// Update quantity in Product table
|
||||||
|
$ProductModel->update($product_id, $data );
|
||||||
|
}
|
||||||
|
|
||||||
|
private function subractProductQuantity($ProductModel, $product_id, $sold_qty)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Fetch current product quantity
|
// Fetch current product quantity
|
||||||
$product = $ProductModel->find($product_id);
|
$product = $ProductModel->find($product_id);
|
||||||
$current_qty = $product['qty_stock'];
|
|
||||||
|
|
||||||
// Calculate updated quantity
|
$data['qty_stock'] = $product['qty_stock'] - $sold_qty;
|
||||||
$new_qty = $current_qty - $sold_qty;
|
|
||||||
|
if($product['per'] == 'barrel')
|
||||||
|
{
|
||||||
|
$data['barrel'] = $data['qty_stock'] / $product['ltr_per_barrel'];
|
||||||
|
}
|
||||||
|
else if($product['per'] == 'box')
|
||||||
|
{
|
||||||
|
$data['box'] = $data['qty_stock'] / $product['qty_per_box'];
|
||||||
|
}
|
||||||
|
|
||||||
// Update quantity in Product table
|
// Update quantity in Product table
|
||||||
$ProductModel->update($product_id, ['qty_stock' => $new_qty]);
|
$ProductModel->update($product_id, $data );
|
||||||
}
|
}
|
||||||
|
|
||||||
public function delete_sales_product()
|
public function delete_sales_product()
|
||||||
|
|||||||
@ -151,12 +151,15 @@ class Products extends BaseController
|
|||||||
$ProductModel = new ProductModel();
|
$ProductModel = new ProductModel();
|
||||||
|
|
||||||
$tax= $this->request->getPost('tax')/2;
|
$tax= $this->request->getPost('tax')/2;
|
||||||
// print_r($this->request->getPost());die;
|
$ml = 0; $box = 0; $qty_per_box = 0; $barrel = 0; $ltr_per_barrel = 0;
|
||||||
|
if ($this->request->getPost('per') == 'ml') {
|
||||||
if ($this->request->getPost('per') != 'ml') {
|
|
||||||
$ml = 0;
|
|
||||||
}else{
|
|
||||||
$ml = $this->request->getPost('ml');
|
$ml = $this->request->getPost('ml');
|
||||||
|
}else if ($this->request->getPost('per') == 'box'){
|
||||||
|
$box = $this->request->getPost('box');
|
||||||
|
$qty_per_box = $this->request->getPost('qty_per_box');
|
||||||
|
}else if ($this->request->getPost('per') == 'barrel'){
|
||||||
|
$barrel = $this->request->getPost('barrel');
|
||||||
|
$ltr_per_barrel = $this->request->getPost('ltr_per_barrel');
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
@ -170,7 +173,6 @@ class Products extends BaseController
|
|||||||
'cgst' => $tax,
|
'cgst' => $tax,
|
||||||
'purchase_cost' => $this->request->getPost('purchase_cost'),
|
'purchase_cost' => $this->request->getPost('purchase_cost'),
|
||||||
'qty_stock'=> $this->request->getPost('qty_in_stock'),
|
'qty_stock'=> $this->request->getPost('qty_in_stock'),
|
||||||
'qty_in_demand'=> $this->request->getPost('qty_in_demand'),
|
|
||||||
'description' => $this->request->getPost('description'),
|
'description' => $this->request->getPost('description'),
|
||||||
'vendor' =>json_encode( $this->request->getPost('vendor')),
|
'vendor' =>json_encode( $this->request->getPost('vendor')),
|
||||||
'purchase_order_level' => $this->request->getPost('purchase_order_level'),
|
'purchase_order_level' => $this->request->getPost('purchase_order_level'),
|
||||||
@ -188,7 +190,11 @@ class Products extends BaseController
|
|||||||
|
|
||||||
'total_amount' => $this->request->getPost('total_amount'),
|
'total_amount' => $this->request->getPost('total_amount'),
|
||||||
'per' => $this->request->getPost('per'),
|
'per' => $this->request->getPost('per'),
|
||||||
'ml' => $ml
|
'ml' => $ml,
|
||||||
|
'box' => $box,
|
||||||
|
'qty_per_box' => $qty_per_box,
|
||||||
|
'barrel' => $barrel,
|
||||||
|
'ltr_per_barrel' => $ltr_per_barrel
|
||||||
];
|
];
|
||||||
|
|
||||||
$product_id = $this->request->getPost('product_id');
|
$product_id = $this->request->getPost('product_id');
|
||||||
|
|||||||
@ -328,16 +328,22 @@ class Purchase extends BaseController
|
|||||||
|
|
||||||
private function addBackProductQuantity($ProductModel, $product_id, $sold_qty)
|
private function addBackProductQuantity($ProductModel, $product_id, $sold_qty)
|
||||||
{
|
{
|
||||||
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
|
|
||||||
// Fetch current product quantity
|
// Fetch current product quantity
|
||||||
$product = $ProductModel->find($product_id);
|
$product = $ProductModel->find($product_id);
|
||||||
$current_qty = $product['qty_stock'];
|
|
||||||
|
|
||||||
// Calculate updated quantity
|
$data['qty_stock'] = $product['qty_stock'] + $sold_qty;
|
||||||
$new_qty = $current_qty + $sold_qty;
|
|
||||||
|
if($product['per'] == 'barrel')
|
||||||
|
{
|
||||||
|
$data['barrel'] = $data['qty_stock'] / $product['ltr_per_barrel'];
|
||||||
|
}
|
||||||
|
else if($product['per'] == 'box')
|
||||||
|
{
|
||||||
|
$data['box'] = $data['qty_stock'] / $product['qty_per_box'];
|
||||||
|
}
|
||||||
|
|
||||||
// Update quantity in Product table
|
// Update quantity in Product table
|
||||||
$ProductModel->update($product_id, ['qty_stock' => $new_qty]);
|
$ProductModel->update($product_id, $data );
|
||||||
}
|
}
|
||||||
|
|
||||||
public function delete_purchase($purchase_order_id)
|
public function delete_purchase($purchase_order_id)
|
||||||
|
|||||||
@ -243,16 +243,22 @@ class ReturnOrder extends BaseController
|
|||||||
|
|
||||||
private function addBackProductQuantity($ProductModel, $product_id, $sold_qty)
|
private function addBackProductQuantity($ProductModel, $product_id, $sold_qty)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Fetch current product quantity
|
// Fetch current product quantity
|
||||||
$product = $ProductModel->find($product_id);
|
$product = $ProductModel->find($product_id);
|
||||||
$current_qty = $product['qty_stock'];
|
|
||||||
|
|
||||||
// Calculate updated quantity
|
$data['qty_stock'] = $product['qty_stock'] + $sold_qty;
|
||||||
$new_qty = $current_qty + $sold_qty;
|
|
||||||
|
if($product['per'] == 'barrel')
|
||||||
|
{
|
||||||
|
$data['barrel'] = $data['qty_stock'] / $product['ltr_per_barrel'];
|
||||||
|
}
|
||||||
|
else if($product['per'] == 'box')
|
||||||
|
{
|
||||||
|
$data['box'] = $data['qty_stock'] / $product['qty_per_box'];
|
||||||
|
}
|
||||||
|
|
||||||
// Update quantity in Product table
|
// Update quantity in Product table
|
||||||
$ProductModel->update($product_id, ['qty_stock' => $new_qty]);
|
$ProductModel->update($product_id, $data );
|
||||||
}
|
}
|
||||||
|
|
||||||
public function delete_purchase($purchase_order_id)
|
public function delete_purchase($purchase_order_id)
|
||||||
|
|||||||
@ -146,6 +146,8 @@ class Sales extends BaseController
|
|||||||
$ProductModel = new ProductModel();
|
$ProductModel = new ProductModel();
|
||||||
$SalesOrderProductModel = new SalesOrderProductModel(); // Assuming you have a model for sales_order_product
|
$SalesOrderProductModel = new SalesOrderProductModel(); // Assuming you have a model for sales_order_product
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Prepare data for sales order
|
// Prepare data for sales order
|
||||||
$data = [
|
$data = [
|
||||||
'client_name' => $this->request->getPost('client_id'),
|
'client_name' => $this->request->getPost('client_id'),
|
||||||
@ -169,7 +171,6 @@ class Sales extends BaseController
|
|||||||
// Insert or update sales order
|
// Insert or update sales order
|
||||||
$sales_order_id = $this->request->getPost('sales_order_id');
|
$sales_order_id = $this->request->getPost('sales_order_id');
|
||||||
if (!empty($sales_order_id)) {
|
if (!empty($sales_order_id)) {
|
||||||
// print_r("hello");die;
|
|
||||||
if ($this->request->getPost('status') === "Paid") {
|
if ($this->request->getPost('status') === "Paid") {
|
||||||
$data['mode_of_payment'] = $this->request->getPost('mode_of_payment');
|
$data['mode_of_payment'] = $this->request->getPost('mode_of_payment');
|
||||||
}
|
}
|
||||||
@ -177,12 +178,13 @@ class Sales extends BaseController
|
|||||||
} else {
|
} else {
|
||||||
$SalesOrderModel->insert($data);
|
$SalesOrderModel->insert($data);
|
||||||
$sales_order_id = $SalesOrderModel->getInsertID(); // Get the last inserted ID
|
$sales_order_id = $SalesOrderModel->getInsertID(); // Get the last inserted ID
|
||||||
}
|
|
||||||
|
|
||||||
$orderNumber = 'SO-' . date('md') . '-' . str_pad($sales_order_id, 5, '0', STR_PAD_LEFT);
|
|
||||||
|
|
||||||
// Update sales order with generated order number
|
// Update sales order with generated order number
|
||||||
|
$orderNumber = 'SO-' . date('md') . '-' . str_pad($sales_order_id, 5, '0', STR_PAD_LEFT);
|
||||||
$SalesOrderModel->update($sales_order_id, ['order_number' => $orderNumber]);
|
$SalesOrderModel->update($sales_order_id, ['order_number' => $orderNumber]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Prepare data for sales order product
|
// Prepare data for sales order product
|
||||||
$product_ids = $this->request->getPost('item_details');
|
$product_ids = $this->request->getPost('item_details');
|
||||||
@ -200,12 +202,8 @@ class Sales extends BaseController
|
|||||||
foreach ($product_ids as $key => $product_id) {
|
foreach ($product_ids as $key => $product_id) {
|
||||||
$qty = isset($quantities[$key]) ? $quantities[$key] : 0;
|
$qty = isset($quantities[$key]) ? $quantities[$key] : 0;
|
||||||
if ($status == 'Created') {
|
if ($status == 'Created') {
|
||||||
// echo "hello";die;
|
$this->subractProductQuantity($ProductModel, $product_id, $qty);
|
||||||
$this->updateProductQuantity($ProductModel, $product_id, $qty);
|
|
||||||
}elseif ($status == 'Cancelled'){
|
}elseif ($status == 'Cancelled'){
|
||||||
// echo "cancel";die;
|
|
||||||
|
|
||||||
// echo"hello";die;
|
|
||||||
$this->addBackProductQuantity($ProductModel, $product_id, $qty);
|
$this->addBackProductQuantity($ProductModel, $product_id, $qty);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -247,29 +245,43 @@ class Sales extends BaseController
|
|||||||
|
|
||||||
private function addBackProductQuantity($ProductModel, $product_id, $sold_qty)
|
private function addBackProductQuantity($ProductModel, $product_id, $sold_qty)
|
||||||
{
|
{
|
||||||
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
|
|
||||||
// Fetch current product quantity
|
// Fetch current product quantity
|
||||||
$product = $ProductModel->find($product_id);
|
$product = $ProductModel->find($product_id);
|
||||||
$current_qty = $product['qty_stock'];
|
|
||||||
|
|
||||||
// Calculate updated quantity
|
$data['qty_stock'] = $product['qty_stock'] + $sold_qty;
|
||||||
$new_qty = $current_qty + $sold_qty;
|
|
||||||
|
|
||||||
// Update quantity in Product table
|
if($product['per'] == 'barrel')
|
||||||
$ProductModel->update($product_id, ['qty_stock' => $new_qty]);
|
|
||||||
}
|
|
||||||
private function updateProductQuantity($ProductModel, $product_id, $sold_qty)
|
|
||||||
{
|
{
|
||||||
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
|
$data['barrel'] = $data['qty_stock'] / $product['ltr_per_barrel'];
|
||||||
// Fetch current product quantity
|
}
|
||||||
$product = $ProductModel->find($product_id);
|
else if($product['per'] == 'box')
|
||||||
$current_qty = $product['qty_stock'];
|
{
|
||||||
|
$data['box'] = $data['qty_stock'] / $product['qty_per_box'];
|
||||||
// Calculate updated quantity
|
}
|
||||||
$new_qty = $current_qty - $sold_qty;
|
|
||||||
|
|
||||||
// Update quantity in Product table
|
// Update quantity in Product table
|
||||||
$ProductModel->update($product_id, ['qty_stock' => $new_qty]);
|
$ProductModel->update($product_id, $data );
|
||||||
|
}
|
||||||
|
|
||||||
|
private function subractProductQuantity($ProductModel, $product_id, $sold_qty)
|
||||||
|
{
|
||||||
|
|
||||||
|
// Fetch current product quantity
|
||||||
|
$product = $ProductModel->find($product_id);
|
||||||
|
|
||||||
|
$data['qty_stock'] = $product['qty_stock'] - $sold_qty;
|
||||||
|
|
||||||
|
if($product['per'] == 'barrel')
|
||||||
|
{
|
||||||
|
$data['barrel'] = $data['qty_stock'] / $product['ltr_per_barrel'];
|
||||||
|
}
|
||||||
|
else if($product['per'] == 'box')
|
||||||
|
{
|
||||||
|
$data['box'] = $data['qty_stock'] / $product['qty_per_box'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update quantity in Product table
|
||||||
|
$ProductModel->update($product_id, $data );
|
||||||
}
|
}
|
||||||
|
|
||||||
public function delete_sales_product()
|
public function delete_sales_product()
|
||||||
|
|||||||
@ -9,7 +9,7 @@ class JobcardModel extends Model
|
|||||||
'order_number','client_mobile_no','client_name',
|
'order_number','client_mobile_no','client_name',
|
||||||
'billing_address','billing_city','billing_state','billing_country',
|
'billing_address','billing_city','billing_state','billing_country',
|
||||||
'billing_postal_code','fuel_qty', 'meter', 'delivery_date', 'note',
|
'billing_postal_code','fuel_qty', 'meter', 'delivery_date', 'note',
|
||||||
'status','assigned_to', 'is_rework','subtotal','tax', 'discount','total','isactive','mode_of_payment'];
|
'status','assigned_to', 'is_rework','subtotal','tax', 'discount','total','isactive','mode_of_payment','trial_mechanic'];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,7 @@ class ProductModel extends Model
|
|||||||
'quality','product_name','branch_id','prefered_vendor','product_category','mfr_part_no','purchase_order_level',
|
'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',
|
'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',
|
'handler','qty_in_demand','product_image','description','specification','hsn_sac','isactive','total_amount',
|
||||||
'per','ml'];
|
'per','ml','box','qty_per_box','barrel','ltr_per_barrel'];
|
||||||
|
|
||||||
|
|
||||||
public function getTax()
|
public function getTax()
|
||||||
|
|||||||
@ -21,7 +21,7 @@ class RoleModel extends Model
|
|||||||
$this->join('users', 'users.role = roles.role_id');
|
$this->join('users', 'users.role = roles.role_id');
|
||||||
$this->where('roles.isactive', 1);
|
$this->where('roles.isactive', 1);
|
||||||
$this->where('users.isactive', 1);
|
$this->where('users.isactive', 1);
|
||||||
$this->whereIn('roles.roles', ['Mechanic','Helper']);
|
$this->whereIn('roles.roles', ['Senior Mechanic','Mechanic','Helper']);
|
||||||
$this ->where('users.branch_id',$logged_user_branch_id);
|
$this ->where('users.branch_id',$logged_user_branch_id);
|
||||||
return $this->findAll();
|
return $this->findAll();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,15 +22,26 @@
|
|||||||
top:4px;
|
top:4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.select2-container .select2-selection--multiple{
|
|
||||||
height: 36px;
|
</style>
|
||||||
border:1px solid #ced4da;
|
<style>
|
||||||
|
.select2-container .select2-selection--multiple .select2-selection__choice{
|
||||||
|
padding: 5px 7px 5px 0 !important;
|
||||||
|
color: #000000;
|
||||||
|
|
||||||
}
|
}
|
||||||
.select2-container--default .select2-selection--multiple .select2-selection__rendered{
|
.select2-container--default .select2-results__option--highlighted[aria-selected]{
|
||||||
line-height: 36px;
|
color:#ffffff;
|
||||||
|
background-color: #526dee;
|
||||||
}
|
}
|
||||||
.select2-container--default .select2-selection--multiple .select2-selection__arrow{
|
.select2-container--default .select2-results__option{
|
||||||
top:4px;
|
border-bottom: 1px solid #dddddd;
|
||||||
|
}
|
||||||
|
.select2-container--default .select2-results__option[aria-selected=true]{
|
||||||
|
color: #000000;
|
||||||
|
background-color: #3efba4;
|
||||||
|
font-weight: 500;
|
||||||
|
border-bottom: 1px solid #747474;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -153,20 +164,36 @@
|
|||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<?php if(isset($workers) && $jobs['status'] == 'Created') { ?>
|
<?php if(isset($workers)) { ?>
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="inputPassword4" class="col-form-label">Assign To</label>
|
<label for="inputPassword4" class="col-form-label">Assign To</label>
|
||||||
<select class="form-control SelExample" name="assigned_to[]" id="assigned_to" multiple>
|
<select class="form-control SelExample" name="assigned_to[]" id="assigned_to" data-toggle="select2" multiple>
|
||||||
<?= isset($jobs['assigned_to']) ? '' : '<option value="">Select a Make</option>' ?>
|
<?= isset($jobs['assigned_to']) ? '' : '<option value="">Select a Mechanic</option>' ?>
|
||||||
<?php foreach ($workers as $value) : ?>
|
<?php foreach ($workers as $value) : ?>
|
||||||
<?php if ((int)$value["isactive"] === 1) : ?>
|
<?php if ((int)$value["isactive"] === 1) : ?>
|
||||||
<option value="<?= $value["user_id"] ?>" <?= isset($jobs['assigned_to']) && is_array(json_decode($jobs['assigned_to'])) && in_array($value["user_id"], json_decode($jobs['assigned_to'])) ? 'selected' : ''; ?>>
|
<option value="<?= $value["user_id"] ?>" <?= isset($jobs['assigned_to']) && is_array(json_decode($jobs['assigned_to'])) && in_array($value["user_id"], json_decode($jobs['assigned_to'])) ? 'selected' : ''; ?>>
|
||||||
<?= $value["name"]; ?>
|
<?= $value["name"]." - ".$value['roles']; ?>
|
||||||
</option>
|
</option>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group col-md-3">
|
||||||
|
<label for="inputPassword4" class="col-form-label">Trial Mechanic</label>
|
||||||
|
<select class="form-control SelExample" name="trial_mechanic" id="trial_mechanic" data-toggle="select2" >
|
||||||
|
<?= isset($jobs['trial_mechanic']) ? '' : '<option value="">Select a Mechanic</option>' ?>
|
||||||
|
<?php foreach ($workers as $value) : ?>
|
||||||
|
<?php if ((int)$value["isactive"] === 1) : ?>
|
||||||
|
<option value="<?= $value["user_id"] ?>" <?= isset($jobs['trial_mechanic']) && $value["user_id"] = $jobs['trial_mechanic'] ? 'selected' : ''; ?>>
|
||||||
|
<?= $value["name"]." - ".$value['roles']; ?>
|
||||||
|
</option>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="inputPassword4" class="col-form-label">Note<span class="text-danger"></span></label>
|
<label for="inputPassword4" class="col-form-label">Note<span class="text-danger"></span></label>
|
||||||
|
|||||||
@ -1,5 +1,56 @@
|
|||||||
|
|
||||||
|
|
||||||
|
<!-- <div class="loader" style="display:none;">
|
||||||
|
<div class="loader-inner" >
|
||||||
|
<div class="gear">
|
||||||
|
<div class="center"></div>
|
||||||
|
<div class="bar"></div>
|
||||||
|
<div class="bar"></div>
|
||||||
|
<div class="bar"></div>
|
||||||
|
<div class="bar"></div>
|
||||||
|
</div>
|
||||||
|
<div class="gear gear-two">
|
||||||
|
<div class="center"></div>
|
||||||
|
<div class="bar"></div>
|
||||||
|
<div class="bar"></div>
|
||||||
|
<div class="bar"></div>
|
||||||
|
<div class="bar"></div>
|
||||||
|
</div>
|
||||||
|
<div class="gear gear-three">
|
||||||
|
<div class="center"></div>
|
||||||
|
<div class="bar"></div>
|
||||||
|
<div class="bar"></div>
|
||||||
|
<div class="bar"></div>
|
||||||
|
<div class="bar"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div> -->
|
||||||
|
|
||||||
|
<div id="loader" style="display:none;">
|
||||||
|
|
||||||
|
<div class="gear">
|
||||||
|
<div class="center"></div>
|
||||||
|
<div class="bar"></div>
|
||||||
|
<div class="bar"></div>
|
||||||
|
<div class="bar"></div>
|
||||||
|
<div class="bar"></div>
|
||||||
|
</div>
|
||||||
|
<!-- <div class="gear gear-two">
|
||||||
|
<div class="center"></div>
|
||||||
|
<div class="bar"></div>
|
||||||
|
<div class="bar"></div>
|
||||||
|
<div class="bar"></div>
|
||||||
|
<div class="bar"></div>
|
||||||
|
</div>
|
||||||
|
<div class="gear gear-three">
|
||||||
|
<div class="center"></div>
|
||||||
|
<div class="bar"></div>
|
||||||
|
<div class="bar"></div>
|
||||||
|
<div class="bar"></div>
|
||||||
|
<div class="bar"></div>
|
||||||
|
</div> -->
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!-- Footer Start -->
|
<!-- Footer Start -->
|
||||||
|
|||||||
@ -71,6 +71,135 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.gear {
|
||||||
|
position: absolute;
|
||||||
|
width: 80px;
|
||||||
|
height: 80px;
|
||||||
|
margin: auto;
|
||||||
|
background: #198;
|
||||||
|
border-radius: 50%;
|
||||||
|
animation-name: spin;
|
||||||
|
animation-duration:6s;
|
||||||
|
animation-iteration-count: infinite;
|
||||||
|
animation-timing-function: linear;
|
||||||
|
top: 50%;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
.gear .center {
|
||||||
|
position: absolute;
|
||||||
|
top: 20px;
|
||||||
|
left: 20px;
|
||||||
|
z-index: 10;
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bar {
|
||||||
|
position: absolute;
|
||||||
|
top: -10px;
|
||||||
|
left: 28px;
|
||||||
|
z-index: 1;
|
||||||
|
width: 22px;
|
||||||
|
height: 100px;
|
||||||
|
background: #198;
|
||||||
|
}
|
||||||
|
.bar:nth-child(2) {
|
||||||
|
transform: rotate(45deg);
|
||||||
|
}
|
||||||
|
.bar:nth-child(3) {
|
||||||
|
transform: rotate(90deg);
|
||||||
|
}
|
||||||
|
.bar:nth-child(4) {
|
||||||
|
transform: rotate(135deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.gear-two {
|
||||||
|
left: -90px;
|
||||||
|
top: 68px;
|
||||||
|
width: 55px;
|
||||||
|
height: 55px;
|
||||||
|
background: #f58bb6;
|
||||||
|
animation-name: spin-reverse;
|
||||||
|
}
|
||||||
|
.gear-two .bar {
|
||||||
|
background: #f58bb6;
|
||||||
|
width: 14px;
|
||||||
|
height: 70px;
|
||||||
|
left: 20px;
|
||||||
|
top: -8px;
|
||||||
|
}
|
||||||
|
.gear-two .center {
|
||||||
|
width: 28px;
|
||||||
|
height: 28px;
|
||||||
|
left: 13px;
|
||||||
|
top: 13px;
|
||||||
|
}
|
||||||
|
.gear-three {
|
||||||
|
left: 90px;
|
||||||
|
top: 68px;
|
||||||
|
width: 55px;
|
||||||
|
height: 55px;
|
||||||
|
background: #576e81;
|
||||||
|
animation-name: spin-reverse;
|
||||||
|
}
|
||||||
|
.gear-three .bar {
|
||||||
|
background: #576e81;
|
||||||
|
width: 14px;
|
||||||
|
height: 70px;
|
||||||
|
left: 20px;
|
||||||
|
top: -8px;
|
||||||
|
}
|
||||||
|
.gear-three .center {
|
||||||
|
width: 28px;
|
||||||
|
height: 28px;
|
||||||
|
left: 13px;
|
||||||
|
top: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@-webkit-keyframes spin {
|
||||||
|
50% {
|
||||||
|
-webkit-transform: rotate(360deg);
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes spin {
|
||||||
|
50% {
|
||||||
|
-webkit-transform: rotate(360deg);
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@-webkit-keyframes spin-reverse {
|
||||||
|
50% {
|
||||||
|
-webkit-transform: rotate(-360deg);
|
||||||
|
transform: rotate(-360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@keyframes spin-reverse {
|
||||||
|
50% {
|
||||||
|
-webkit-transform: rotate(-360deg);
|
||||||
|
transform: rotate(-360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#loader {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-color: rgb(0 0 0 / 5%);
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
z-index: 9999; /* Ensure it appears on top of other content */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
toastr.options = {
|
toastr.options = {
|
||||||
|
|||||||
@ -434,7 +434,7 @@ $(document).ready(function() {
|
|||||||
$('#makeSelectMessage').hide();
|
$('#makeSelectMessage').hide();
|
||||||
|
|
||||||
// AJAX request to get models based on the selected make ID
|
// AJAX request to get models based on the selected make ID
|
||||||
// $('.loader-section').show();
|
$('#loader').show();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '<?php echo base_url('get_models') ?>', // URL to your CodeIgniter controller method
|
url: '<?php echo base_url('get_models') ?>', // URL to your CodeIgniter controller method
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
@ -464,7 +464,7 @@ $(document).ready(function() {
|
|||||||
// Handle case when no models are found
|
// Handle case when no models are found
|
||||||
$('#model').empty().append('<option value="">No models found</option>');
|
$('#model').empty().append('<option value="">No models found</option>');
|
||||||
}
|
}
|
||||||
// $('.loader-section').hide();
|
$('#loader').hide();
|
||||||
},
|
},
|
||||||
error: function(xhr, status, error) {
|
error: function(xhr, status, error) {
|
||||||
// Handle error
|
// Handle error
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user