CHANGE_jobcard_invoice_ccomplaint_addition:ss
This commit is contained in:
parent
2fb965e183
commit
cec0b4fa6c
@ -140,7 +140,7 @@ $routes->get('dashboard', 'Users::dashboard');
|
|||||||
|
|
||||||
// Model //
|
// Model //
|
||||||
$routes->get('bike_model_index/(:any)', 'Model::index/$1');
|
$routes->get('bike_model_index/(:any)', 'Model::index/$1');
|
||||||
$routes->post('create_model/(:any)', 'Model::create_model/$1');
|
$routes->post('create_model', 'Model::create_model');
|
||||||
$routes->post('status_model', 'Model::status_model');
|
$routes->post('status_model', 'Model::status_model');
|
||||||
// Model End's//
|
// Model End's//
|
||||||
|
|
||||||
|
|||||||
@ -76,7 +76,8 @@ class Jobcard extends BaseController
|
|||||||
|
|
||||||
$servicedata = $this->JobcardModel->get_jobcard_service($job_card_id);
|
$servicedata = $this->JobcardModel->get_jobcard_service($job_card_id);
|
||||||
$complaintdata = $this->JobcardModel->get_jobcard_complaint($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 */
|
/** CALCULATE LABOURCOST WITH TAX */
|
||||||
$totalAmount = 0;
|
$totalAmount = 0;
|
||||||
$totalTax = 0;
|
$totalTax = 0;
|
||||||
|
|||||||
@ -13,7 +13,8 @@ class Model extends BaseController
|
|||||||
|
|
||||||
public $session;
|
public $session;
|
||||||
use ResponseTrait;
|
use ResponseTrait;
|
||||||
|
public $BikemodelsModel;
|
||||||
|
public $BikemakeModel;
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -41,7 +42,7 @@ class Model extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function create_model($model_id)
|
public function create_model()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$make_id = $this->request->getPost('make_id');
|
$make_id = $this->request->getPost('make_id');
|
||||||
@ -53,7 +54,7 @@ class Model extends BaseController
|
|||||||
'model_name' => $model_name
|
'model_name' => $model_name
|
||||||
];
|
];
|
||||||
|
|
||||||
if (!$model_id) {
|
// if (!$model_id) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$inserted = $BikemodelsModel->insert($data);
|
$inserted = $BikemodelsModel->insert($data);
|
||||||
@ -63,23 +64,24 @@ class Model extends BaseController
|
|||||||
}
|
}
|
||||||
if ($inserted) {
|
if ($inserted) {
|
||||||
$result = $data;
|
$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);
|
return $this->respond(['status' => 'success','code' => 200,'data' => $result,'model_list'=>$model_list],200);
|
||||||
} else {
|
} else {
|
||||||
$result = "No Match's";
|
$result = "No Match's";
|
||||||
return $this->respond(['status' => 'failed','code' => 404,'data' => $result],404);
|
return $this->respond(['status' => 'failed','code' => 404,'data' => $result],404);
|
||||||
}
|
}
|
||||||
}else{
|
// }
|
||||||
$updated = $BikemodelsModel->update($model_id ,$data);
|
// else{
|
||||||
if ($updated) {
|
// $updated = $BikemodelsModel->update($model_id ,$data);
|
||||||
$result = $data;
|
// if ($updated) {
|
||||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result],200);
|
// $result = $data;
|
||||||
} else {
|
// return $this->respond(['status' => 'success','code' => 200,'data' => $result],200);
|
||||||
$result = "No Match's";
|
// } else {
|
||||||
return $this->respond(['status' => 'failed','code' => 404,'data' => $result],404);
|
// $result = "No Match's";
|
||||||
}
|
// return $this->respond(['status' => 'failed','code' => 404,'data' => $result],404);
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
} catch (\Exception $exception) {
|
} catch (\Exception $exception) {
|
||||||
return $this->respond(['status' => 'failed','code' => 500,'data' => $exception],500);
|
return $this->respond(['status' => 'failed','code' => 500,'data' => $exception],500);
|
||||||
|
|||||||
@ -98,6 +98,15 @@ class JobcardModel extends Model
|
|||||||
return $this->findAll();
|
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)
|
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');
|
$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>
|
||||||
|
|
||||||
<td style="border: 0.5px solid black;"><?= $item['product_name'] ?></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;"><?= $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;"><?= $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>
|
||||||
<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>
|
||||||
|
|||||||
@ -739,6 +739,7 @@ $(document).ready(async function() {
|
|||||||
data_contruction_for_save();
|
data_contruction_for_save();
|
||||||
$("#delete_items").val(JSON.stringify(delete_items_id));
|
$("#delete_items").val(JSON.stringify(delete_items_id));
|
||||||
$('#form-submit').submit();
|
$('#form-submit').submit();
|
||||||
|
$('#submit-btn').prop('disabled', true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user