CHANGE_in jc invoice and jc download,preview function: GWM
This commit is contained in:
parent
a63c86f031
commit
04bcd4b694
@ -67,85 +67,20 @@ class Jobcard extends BaseController
|
||||
return view('jobs_list',$data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function preview_jobcard_invoice($job_card_id)
|
||||
{
|
||||
$logged_user = $this->session->get('logged_user');
|
||||
try {
|
||||
|
||||
$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();
|
||||
|
||||
$data['company_address'] = $this->BranchModel->where('branch_id', $this->session->get('logged_user_branch_id'))->where('business_id', $bus_id)->where('isactive', 1)->findAll();
|
||||
// echo json_encode($data['company_address']);die;
|
||||
$productdata = $this->JobcardModel->get_jobcard_products_details($job_card_id);
|
||||
// echo json_encode($productdata);die;
|
||||
|
||||
|
||||
|
||||
$servicedata = $this->JobcardModel->get_jobcard_service($job_card_id);
|
||||
$complaintdata = $this->JobcardModel->get_jobcard_complaint($job_card_id);
|
||||
$osdata = $this->JobcardModel->get_jobcard_os($job_card_id);
|
||||
$customcomplaintdata = $this->JobcardModel->get_jobcard_custom_complaint($job_card_id);
|
||||
$labourcost = array_merge($servicedata, $complaintdata,$customcomplaintdata,$osdata);
|
||||
/** CALCULATE LABOURCOST WITH TAX */
|
||||
$totalAmount = 0;
|
||||
$totalTax = 0;
|
||||
|
||||
// Calculate total amount and total tax
|
||||
foreach ($labourcost as $product) {
|
||||
$totalAmount += $product["labour_amount"];
|
||||
$totalTax = $product["tax"];
|
||||
}
|
||||
// Calculate total
|
||||
$total = $totalAmount + $totalTax;
|
||||
|
||||
$discount = ($data['job_card'][0]['is_rework'] == 1) ? 0 : $data['job_card'][0]['discount'] ;
|
||||
$amt_with_tax = $totalAmount + ($totalAmount * $totalTax / 100);
|
||||
$totalAmount = ($amt_with_tax - (float)$discount) / (1 + ($totalTax/100));
|
||||
// Create single output array
|
||||
$labour_data[0] = [
|
||||
"name" => "Labour Cost",
|
||||
"product_name" => "Labour Cost",
|
||||
"qty" => "-",
|
||||
"per" => "-",
|
||||
"tax" => number_format($totalTax, 2),
|
||||
"amount" => number_format($totalAmount, 2),
|
||||
"custom_tax" => number_format($totalTax, 2),
|
||||
"custom_total" => number_format($total, 2)
|
||||
];
|
||||
$data['job_card_products'] = array_merge($productdata, $labour_data);
|
||||
|
||||
|
||||
|
||||
$html = view('invoice_pdf_template_jobcard', $data);
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $html],200);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
return $this->respond(['status' => 'failed','code' => 500,'data' => $e],500);
|
||||
}
|
||||
}
|
||||
|
||||
public function download_jobcard_invoice($job_card_id)
|
||||
public function getJobCardData($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();
|
||||
|
||||
$data['company_address'] = $this->BranchModel->where('branch_id', $this->session->get('logged_user_branch_id'))->where('business_id', $bus_id)->where('isactive', 1)->findAll();
|
||||
// echo json_encode($data['company_address']);die;
|
||||
$productdata = $this->JobcardModel->get_jobcard_products_details($job_card_id);
|
||||
// echo json_encode($productdata);die;
|
||||
|
||||
|
||||
|
||||
$servicedata = $this->JobcardModel->get_jobcard_service($job_card_id);
|
||||
$complaintdata = $this->JobcardModel->get_jobcard_complaint($job_card_id);
|
||||
$osdata = $this->JobcardModel->get_jobcard_os($job_card_id);
|
||||
$customcomplaintdata = $this->JobcardModel->get_jobcard_custom_complaint($job_card_id);
|
||||
$labourcost = array_merge($servicedata, $complaintdata,$customcomplaintdata,$osdata);
|
||||
$data['service'] = $this->JobcardModel->get_jobcard_service($job_card_id);
|
||||
$data['sub_service'] = $this->JobcardModel->get_jobcard_sub_service($job_card_id);
|
||||
$data['complaint'] = $this->JobcardModel->get_jobcard_complaint($job_card_id);
|
||||
$data['customcomplaint'] = $this->JobcardModel->get_jobcard_custom_complaint($job_card_id);
|
||||
$data['osdata'] = $this->JobcardModel->get_jobcard_os($job_card_id);
|
||||
$labourcost = array_merge($data['service'],$data['sub_service'],$data['complaint'],$data['customcomplaint'],$data['osdata']);
|
||||
|
||||
/** CALCULATE LABOURCOST WITH TAX */
|
||||
$totalAmount = 0;
|
||||
@ -168,12 +103,60 @@ class Jobcard extends BaseController
|
||||
"product_name" => "Labour Cost",
|
||||
"qty" => '-',
|
||||
"per" => '-',
|
||||
"tax" => number_format($totalTax, 2),
|
||||
"amount" => number_format($totalAmount, 2),
|
||||
"custom_tax" => number_format($totalTax, 2),
|
||||
"custom_total" => number_format($total, 2)
|
||||
"tax" => $totalTax,
|
||||
"amount" => $totalAmount,
|
||||
"custom_tax" => $totalTax,
|
||||
"custom_total" => $total
|
||||
];
|
||||
$data['job_card_products'] = array_merge($productdata, $labour_data);
|
||||
|
||||
$data['sum_of_tax'] = 0;
|
||||
$data['sum_of_sub_total'] = 0;
|
||||
$data['sum_of_total'] = 0;
|
||||
|
||||
foreach ($data['job_card_products'] as $key=> $value) {
|
||||
$qty = $value['qty'] == '-' ? 1 : $value['qty'];
|
||||
$amount = $value['amount'] * $qty;
|
||||
$tax = ($amount * $value['tax'] / 100);
|
||||
$total = $amount + $tax;
|
||||
|
||||
//asign values to same array
|
||||
$data['job_card_products'][$key]['tax_amount'] = $tax;
|
||||
$data['job_card_products'][$key]['total_amount'] = $total;
|
||||
|
||||
//calculate sum
|
||||
$data['sum_of_tax'] += $tax;
|
||||
$data['sum_of_sub_total'] += $amount;
|
||||
$data['sum_of_total'] += $total;
|
||||
|
||||
}
|
||||
|
||||
// dd($data);
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function preview_jobcard_invoice($job_card_id)
|
||||
{
|
||||
|
||||
try {
|
||||
|
||||
$data = $this->getJobCardData($job_card_id);
|
||||
|
||||
$html = view('invoice_pdf_template_jobcard', $data);
|
||||
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $html],200);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
return $this->respond(['status' => 'failed','code' => 500,'data' => $e],500);
|
||||
}
|
||||
}
|
||||
|
||||
public function download_jobcard_invoice($job_card_id)
|
||||
{
|
||||
|
||||
$data = $this->getJobCardData($job_card_id);
|
||||
|
||||
// Create an mPDF object
|
||||
$mpdf = new Mpdf([
|
||||
@ -181,7 +164,6 @@ class Jobcard extends BaseController
|
||||
'format' => 'A4',
|
||||
'default_font_size' => 0,
|
||||
'default_font' => '',
|
||||
|
||||
// 'margin_right' => 1,
|
||||
'margin_top' => 6,
|
||||
'margin_bottom' => 6,
|
||||
@ -194,16 +176,9 @@ class Jobcard extends BaseController
|
||||
|
||||
$mpdf->autoLangToFont = true;
|
||||
$mpdf->autoScriptToLang = true;
|
||||
// Set PDF properties
|
||||
$mpdf->SetTitle('Invoice');
|
||||
// $mpdf->SetAuthor($data[0]->branch_name);
|
||||
$mpdf->SetCreator('');
|
||||
// echo"<pre>";
|
||||
// print_r($data['job_card_products']);die;
|
||||
// Generate the PDF content (HTML) with data
|
||||
$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
|
||||
@ -214,48 +189,13 @@ class Jobcard extends BaseController
|
||||
public function preview_jobcard($job_card_id)
|
||||
{
|
||||
try {
|
||||
$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();
|
||||
$data['company_address'] = $this->BranchModel->where('branch_id', $this->session->get('logged_user_branch_id'))->where('business_id', $bus_id)->where('isactive', 1)->findAll();
|
||||
$productdata = $this->JobcardModel->get_jobcard_products_details($job_card_id);
|
||||
$data['service'] = $this->JobcardModel->get_jobcard_service($job_card_id);
|
||||
$data['complaint'] = $this->JobcardModel->get_jobcard_complaint($job_card_id);
|
||||
$data['customcomplaint'] = $this->JobcardModel->get_jobcard_custom_complaint($job_card_id);
|
||||
$data['osdata'] = $this->JobcardModel->get_jobcard_os($job_card_id);
|
||||
$labourcost = array_merge($data['service'], $data['complaint'],$data['customcomplaint'],$data['osdata']);
|
||||
|
||||
$data = $this->getJobCardData($job_card_id);
|
||||
|
||||
/** CALCULATE LABOURCOST WITH TAX */
|
||||
$totalAmount = 0;
|
||||
$totalTax = 0;
|
||||
$html = view('jobcard_pdf_template', $data);
|
||||
|
||||
// Calculate total amount and total tax
|
||||
foreach ($labourcost as $product) {
|
||||
$totalAmount += $product["labour_amount"];
|
||||
$totalTax = $product["tax"];
|
||||
}
|
||||
// Calculate total
|
||||
$total = $totalAmount + $totalTax;
|
||||
|
||||
$discount = ($data['job_card'][0]['is_rework'] == 1) ? 0 : $data['job_card'][0]['discount'] ;
|
||||
$amt_with_tax = $totalAmount + ($totalAmount * $totalTax / 100);
|
||||
$totalAmount = ($amt_with_tax - (float)$discount) / (1 + ($totalTax/100));
|
||||
// Create single output array
|
||||
$labour_data[0] = [
|
||||
"name" => "Labour Cost",
|
||||
"product_name" => "Labour Cost",
|
||||
"qty" => 0,
|
||||
"per" => '-',
|
||||
"tax" => number_format($totalTax, 2),
|
||||
"amount" => number_format($totalAmount, 2),
|
||||
"custom_tax" => number_format($totalTax, 2),
|
||||
"custom_total" => number_format($total, 2)
|
||||
];
|
||||
$data['job_card_products'] = array_merge($productdata, $labour_data);
|
||||
|
||||
|
||||
$html = view('jobcard_pdf_template', $data);
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $html],200);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
return $this->respond(['status' => 'failed','code' => 500,'data' => $e],500);
|
||||
}
|
||||
@ -263,44 +203,7 @@ class Jobcard extends BaseController
|
||||
|
||||
public function download_jobcard($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();
|
||||
$data['company_address'] = $this->BranchModel->where('branch_id', $this->session->get('logged_user_branch_id'))->where('business_id', $bus_id)->where('isactive', 1)->findAll();
|
||||
$productdata = $this->JobcardModel->get_jobcard_products_details($job_card_id);
|
||||
$data['service'] = $this->JobcardModel->get_jobcard_service($job_card_id);
|
||||
$data['complaint'] = $this->JobcardModel->get_jobcard_complaint($job_card_id);
|
||||
$data['customcomplaint'] = $this->JobcardModel->get_jobcard_custom_complaint($job_card_id);
|
||||
$data['osdata'] = $this->JobcardModel->get_jobcard_os($job_card_id);
|
||||
$labourcost = array_merge($data['service'], $data['complaint'],$data['customcomplaint'],$data['osdata']);
|
||||
|
||||
/** CALCULATE LABOURCOST WITH TAX */
|
||||
$totalAmount = 0;
|
||||
$totalTax = 0;
|
||||
|
||||
// Calculate total amount and total tax
|
||||
foreach ($labourcost as $product) {
|
||||
$totalAmount += $product["labour_amount"];
|
||||
$totalTax = $product["tax"];
|
||||
}
|
||||
// Calculate total
|
||||
$total = $totalAmount + $totalTax;
|
||||
|
||||
$discount = ($data['job_card'][0]['is_rework'] == 1) ? 0 : $data['job_card'][0]['discount'] ;
|
||||
$amt_with_tax = $totalAmount + ($totalAmount * $totalTax / 100);
|
||||
$totalAmount = ($amt_with_tax - (float)$discount) / (1 + ($totalTax/100));
|
||||
// Create single output array
|
||||
$labour_data[0] = [
|
||||
"name" => "Labour Cost",
|
||||
"product_name" => "Labour Cost",
|
||||
"qty" => 0,
|
||||
"per" => '-',
|
||||
"tax" => number_format($totalTax, 2),
|
||||
"amount" => number_format($totalAmount, 2),
|
||||
"custom_tax" => number_format($totalTax, 2),
|
||||
"custom_total" => number_format($total, 2)
|
||||
];
|
||||
$data['job_card_products'] = array_merge($productdata, $labour_data);
|
||||
$data = $this->getJobCardData($job_card_id);
|
||||
|
||||
|
||||
// Create an mPDF object
|
||||
@ -309,7 +212,6 @@ class Jobcard extends BaseController
|
||||
'format' => 'A4',
|
||||
'default_font_size' => 0,
|
||||
'default_font' => '',
|
||||
|
||||
// 'margin_right' => 1,
|
||||
'margin_top' => 6,
|
||||
'margin_bottom' => 6,
|
||||
@ -322,16 +224,8 @@ class Jobcard extends BaseController
|
||||
|
||||
$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) with data
|
||||
$html = view('jobcard_pdf_template', $data);
|
||||
// echo $html;die;
|
||||
// Load HTML into the mPDF instance
|
||||
$mpdf->WriteHTML($html);
|
||||
|
||||
// Output the PDF to the browser for download
|
||||
|
||||
@ -100,6 +100,15 @@ class JobcardModel extends Model
|
||||
$this->where('job_card.job_card_id', $job_id);
|
||||
return $this->findAll();
|
||||
}
|
||||
public function get_jobcard_sub_service($job_id)
|
||||
{
|
||||
$this->select('job_card_sub_service.*, services.service_name as product_name , services.labour_cost as labour_amount');
|
||||
$this->join('job_card_sub_service', 'job_card_sub_service.job_card_id = job_card.job_card_id');
|
||||
$this->join('services', 'services.service_id = job_card_sub_service.sub_service_id');
|
||||
$this->where('job_card.isactive', 1);
|
||||
$this->where('job_card.job_card_id', $job_id);
|
||||
return $this->findAll();
|
||||
}
|
||||
|
||||
public function get_jobcard_complaint($job_id)
|
||||
{
|
||||
|
||||
@ -102,13 +102,7 @@
|
||||
|
||||
<tbody>
|
||||
|
||||
<?php $subTotal = 0; $subTax = 0;
|
||||
foreach ($job_card_products as $key => $value)
|
||||
{
|
||||
$subTotal = $subTotal + $value['amount'];
|
||||
$tax = ($value['amount'] * $value['tax'] / 100);
|
||||
$subTax = $subTax + $tax;
|
||||
?>
|
||||
<?php foreach ($job_card_products as $key => $value) { ?>
|
||||
|
||||
<tr >
|
||||
<td style="width: 10%; height: 5px;text-align: center; font-size: small;"> <?= $key+1; ?> </td>
|
||||
@ -117,8 +111,8 @@
|
||||
<td style="width: 10%; height: 5px;text-align: center; font-size: small;"><?= $value['qty']; ?></td>
|
||||
<td style="width: 10%; height: 5px;text-align: center; font-size: small;"><?= $value['per']; ?></td>
|
||||
<td style="width: 10%; height: 5px;text-align: center; font-size: small;"><?= $value['tax']; ?></td>
|
||||
<td style="width: 10%; height: 5px;text-align: center; font-size: small;"> <?php echo number_format($tax, 2, '.', ''); ?></td>
|
||||
<td style="width: 10%; height: 5px;text-align: right; font-size: small;"><?php $tot = $value['amount'] + ($value['amount'] * $value['tax'] / 100); echo number_format($tot, 2, '.', ''); ?></td>
|
||||
<td style="width: 10%; height: 5px;text-align: center; font-size: small;"> <?php echo number_format($value['tax_amount'], 2, '.', ''); ?></td>
|
||||
<td style="width: 10%; height: 5px;text-align: right; font-size: small;"><?php echo number_format($value['total_amount'], 2, '.', ''); ?></td>
|
||||
</tr>
|
||||
|
||||
<?php } ?>
|
||||
@ -133,22 +127,22 @@
|
||||
<tr style="height: 36px;">
|
||||
<td style="width: 33.3333%; text-align: right; height: 36px;"> </td>
|
||||
<td style="width: 50.3333%; height: 36px; text-align: right; font-size: small;">Sub Total</td>
|
||||
<td style="width: 25.7946%; height: 36px; text-align: right; font-size: small;"><?= $subTotal; ?></td>
|
||||
<td style="width: 25.7946%; height: 36px; text-align: right; font-size: small;"><?= $sum_of_sub_total; ?></td>
|
||||
</tr>
|
||||
<tr style="height: 36px;">
|
||||
<td style="width: 33.3333%; height: 36px;"> </td>
|
||||
<td style="width: 33.3333%; height: 36px; text-align: right; font-size: small">CGST</td>
|
||||
<td style="width: 25.7946%; height: 36px; text-align: right; font-size: small"><?= number_format($subTax/2, 2, '.', ''); ?></td>
|
||||
<td style="width: 25.7946%; height: 36px; text-align: right; font-size: small"><?= number_format($sum_of_tax/2, 2, '.', ''); ?></td>
|
||||
</tr>
|
||||
<tr style="height: 36px;">
|
||||
<td style="width: 33.3333%; height: 36px;"> </td>
|
||||
<td style="width: 33.3333%; height: 36px; text-align: right; font-size: small">SGST</td>
|
||||
<td style="width: 25.7946%; height: 36px; text-align: right; font-size: small"><?= number_format($subTax/2, 2, '.', ''); ?></td>
|
||||
<td style="width: 25.7946%; height: 36px; text-align: right; font-size: small"><?= number_format($sum_of_tax/2, 2, '.', ''); ?></td>
|
||||
</tr>
|
||||
<tr style="height: 36px;">
|
||||
<td style="width: 33.3333%; height: 36px;"> </td>
|
||||
<td style="width: 33.3333%; height: 36px; text-align: right; font-size: small">Total</td>
|
||||
<td style="width: 25.7946%; height: 36px; text-align: right; font-size: small"><?= number_format($subTotal+$subTax, 2, '.', ''); ?></td>
|
||||
<td style="width: 25.7946%; height: 36px; text-align: right; font-size: small"><?= number_format($sum_of_total, 2, '.', ''); ?></td>
|
||||
</tr>
|
||||
<tr style="height: 21px;">
|
||||
<td style="width: 33.3333%; height: 21px;"> </td>
|
||||
@ -158,7 +152,7 @@
|
||||
<tr style="height: 36px;">
|
||||
<td style="width: 33.3333%; height: 36px;"> </td>
|
||||
<td style="width: 33.3333%; height: 36px; text-align: right; font-size: small"><strong>Grand Total</strong></td>
|
||||
<td style="width: 25.7946%; height: 36px; text-align: right; font-size: small"><strong>₹ <?php echo number_format($subTotal+$subTax, 2, '.', ''); ?></strong></td>
|
||||
<td style="width: 25.7946%; height: 36px; text-align: right; font-size: small"><strong>₹ <?php echo number_format($sum_of_total, 2, '.', ''); ?></strong></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<?php include('layout/header.php'); ?>
|
||||
|
||||
<style>
|
||||
.disabled {
|
||||
pointer-events: none;
|
||||
@ -6,6 +7,7 @@
|
||||
cursor: not-allowed;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style>
|
||||
.select2-container--default .select2-results__option--highlighted[aria-selected]{
|
||||
color:#ffffff;
|
||||
@ -21,9 +23,8 @@
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow{
|
||||
top:4px;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
<style>
|
||||
.select2-container .select2-selection--multiple .select2-selection__choice{
|
||||
padding: 5px 7px 5px 0 !important;
|
||||
@ -44,21 +45,22 @@
|
||||
border-bottom: 1px solid #747474;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box page-title-box-alt">
|
||||
<h4 class="page-title"><?php echo $page_name?></h4>
|
||||
<div class="page-title-right">
|
||||
<a href="<?= base_url() . "job_card_index"; ?>" class="btn btn-secondary waves-effect">Cancel</a>
|
||||
<a href="<?= base_url() . "job_card_index"; ?>" class="btn btn-secondary waves-effect">Cancel</a>
|
||||
<ol class="breadcrumb m-0">
|
||||
|
||||
<!-- <li class="breadcrumb-item"><a href="javascript: void(0);">Tables</a></li>
|
||||
<li class="breadcrumb-item active">Datatables</li> -->
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
@ -1659,11 +1661,11 @@ $(document).ready(function() {
|
||||
var product = productarray[i];
|
||||
if(!selected_pr.includes(product.product_id))
|
||||
{
|
||||
newRow += '<option value="' + product.product_id + '">' + product.product_name + '-' + product.manufacturer_name + '</option>';
|
||||
newRow += '<option value="' + product.product_id + '">' + product.additional_product_name + '-' + product.manufacturer_name + '</option>';
|
||||
}
|
||||
}
|
||||
|
||||
newRow += '</select></td>' +
|
||||
newRow += '</select><input type="hidden" name="product_names_id[]"></td>' +
|
||||
'<td><input type="text" class="form-control rate-d-only" readonly /></td>' +
|
||||
'<td hidden><input type="text" class="form-control item-rate" name="unit-price[]" readonly /></td>' +
|
||||
'<td><input type="number" class="form-control item-quantity" min="0" name="quantity[]"/></td>' +
|
||||
@ -1672,7 +1674,7 @@ $(document).ready(function() {
|
||||
'<td><input type="text" class="form-control item-amount" name="amount[]" onblur="floatInput(event)" /></td>' +
|
||||
'<td><center><i class="fa fa-trash remove-item"></i></center><input value="product" name="item_type" hidden></td>' +
|
||||
'<td hidden><input type="hidden" name="id"></td>' +
|
||||
'<td hidden><input value="'+product.product_name+'" name="name"></td>' +
|
||||
'<td hidden><input value="'+product.additional_product_name+'" name="name"></td>' +
|
||||
'</tr>';
|
||||
|
||||
// $('#productItemTable tbody').append(newRow);
|
||||
|
||||
@ -96,6 +96,9 @@
|
||||
<?php foreach ($service as $key => $Svalue) { ?>
|
||||
<li><?php echo $Svalue['product_name']; ?> - ₹<?php echo " ".$Svalue['labour_amount']; ?> </li>
|
||||
<?php } ?>
|
||||
<?php foreach ($sub_service as $key => $SSvalue) { ?>
|
||||
<li><?php echo $SSvalue['product_name']; ?> - ₹<?php echo " ".$SSvalue['labour_amount']; ?> </li>
|
||||
<?php } ?>
|
||||
<?php foreach ($complaint as $key => $Cvalue) { ?>
|
||||
<li><?php echo $Cvalue['product_name']; ?> - ₹<?php echo " ".$Cvalue['labour_amount']; ?> </li>
|
||||
<?php } ?>
|
||||
@ -129,22 +132,16 @@
|
||||
</table>
|
||||
<table style="border-collapse: collapse; width: 100%; height: 91px;" border="0">
|
||||
<tbody>
|
||||
<tr style="height: 18px;border: 1px solid #A9A9A9;
|
||||
background: #A9A9A9;">
|
||||
<tr style="height: 18px;border: 1px solid #A9A9A9;background: #A9A9A9;">
|
||||
<td style="width: 66.2402%; height: 18px;font-size: 15px; font-weight: 600;" colspan="2"> Products</td>
|
||||
<td style="width: 20.9947%; height: 18px;font-size: 15px; font-weight: 600;"> Estimation</td>
|
||||
</tr>
|
||||
|
||||
<?php $Total = 0;
|
||||
foreach ($job_card_products as $key => $value)
|
||||
{
|
||||
|
||||
if((int)$value['qty'] != 0 ){ $amount = ((int)$value['amount'] + ((int)$value['amount'] * (int)$value['tax'] / 100)) * (int)$value['qty']; }else{ $amount = ((int)$value['amount'] + ((int)$value['amount'] * (int)$value['tax'] / 100)) ; }
|
||||
$Total += $amount;
|
||||
?>
|
||||
<?php foreach ($job_card_products as $key => $value) { ?>
|
||||
|
||||
<tr style="height: 18px;">
|
||||
<td style="width: 66.2402%; height: 18px; border: 1px solid #A9A9A9;font-size: 15px;" colspan="2"> <?= $value['product_name']; ?></td>
|
||||
<td style="width: 16.9947%; height: 18px; border: 1px solid #A9A9A9;font-size: 15px;text-align: right;padding-right: 5px;"><?= number_format($amount, 2, '.', ''); ?></td>
|
||||
<td style="width: 16.9947%; height: 18px; border: 1px solid #A9A9A9;font-size: 15px;text-align: right;padding-right: 5px;"><?= number_format($value['total_amount'], 2, '.', ''); ?></td>
|
||||
</tr>
|
||||
|
||||
<?php } ?>
|
||||
@ -152,7 +149,7 @@
|
||||
<tr style="height: 19px;">
|
||||
<td style="width: 66.2402%; height: 19px;font-weight: 600; font-size: 15px;" colspan="2">
|
||||
Approx. Total Estimation</td>
|
||||
<td style="width: 16.9947%; height: 19px;font-size: 15px;text-align: right;padding-right: 5px;">₹ <?= number_format($Total, 2, '.', ''); ?></td>
|
||||
<td style="width: 16.9947%; height: 19px;font-size: 15px;text-align: right;padding-right: 5px;">₹ <?= number_format($sum_of_total, 2, '.', ''); ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@ -76,7 +76,7 @@
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<div class="text-center mt-2 mb-4">
|
||||
<h4 id="form_add_edit">Add Outsourcing</h4>
|
||||
<h4 id="form_add_edit">Create Out Source</h4>
|
||||
</div>
|
||||
<form id="outsource_form" class="px-3">
|
||||
<div class="form-group">
|
||||
@ -202,7 +202,7 @@
|
||||
}
|
||||
|
||||
function clearDetials(params) {
|
||||
$('#form_add_edit').text('Add Complaint');
|
||||
$('#form_add_edit').text('Create Out Source');
|
||||
$('#outsource_form')[0].reset();
|
||||
}
|
||||
|
||||
|
||||
@ -70,6 +70,7 @@
|
||||
<input type="text" class="form-control" name="client_id" placeholder="Client"
|
||||
value="<?= isset($sales['client_name']) ? $sales['client_name'] : '' ?>" readonly>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="inputPassword4" class="col-form-label">Mobile No<span
|
||||
class="text-danger">*</span></label>
|
||||
@ -116,10 +117,10 @@
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div><br>
|
||||
</div>
|
||||
|
||||
|
||||
<h4 class="header-title">Billing Address Details :</h4><br>
|
||||
<!-- <h4 class="header-title">Billing Address Details :</h4><br> -->
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="inputPassword4" class="col-form-label">Address<span
|
||||
|
||||
Loading…
Reference in New Issue
Block a user