CHANGES_in igr list cost center name model : GWM
This commit is contained in:
parent
10256f2299
commit
dc8afc70ea
@ -258,6 +258,7 @@ $routes->post('UpdateIGR', 'Inwardgateregister::UpdateIGR');
|
||||
$routes->post('updateIGRWeight', 'Inwardgateregister::updateIGRWeight');
|
||||
$routes->post('UpdateIGRLineItem', 'Inwardgateregister::updateIGRLineItem');
|
||||
$routes->post('ViewIGRHistory', 'Inwardgateregister::ViewIGRHistory');
|
||||
$routes->post('getCostCenterData', 'Inwardgateregister::getCostCenterData');
|
||||
$routes->post('ViewIGRfile', 'Inwardgateregister::ViewIGRfile');
|
||||
$routes->post('inwardgateregister/addloadfile', 'Inwardgateregister::addloadfile');
|
||||
$routes->post('inwardgateregister/edituploadfile', 'Inwardgateregister::edituploadfile');
|
||||
|
||||
@ -589,6 +589,13 @@ function viewIGRDetails()
|
||||
$result = $this->inwardgateregister_model->ViewIGRHistory($IGRNO);
|
||||
return $this->response->setJSON($result);
|
||||
}
|
||||
function getCostCenterData()
|
||||
{
|
||||
$pono = $this->request->getPost('pono');
|
||||
$result = $this->inwardgateregister_model->getCostCenterData($pono);
|
||||
|
||||
return $this->response->setJSON($result);
|
||||
}
|
||||
|
||||
|
||||
function UpdateIGR()
|
||||
|
||||
@ -904,4 +904,22 @@ class Inwardgateregister_model extends Model
|
||||
// Pass the result to the view or return it as JSON
|
||||
// return $this->response->setJSON($result);
|
||||
}
|
||||
|
||||
public function getCostCenterData($pono)
|
||||
{
|
||||
$builder = $this->db->table('t_purchaseorder_lineitem');
|
||||
|
||||
$builder->select('t_purchaseorder_lineitem.ReqNo,reqMaster.CostCenterCode,CSMaster.CostCenterName');
|
||||
$builder->join('t_requestion_master reqMaster', 't_purchaseorder_lineitem.ReqNo = reqMaster.ReqNo', 'left');
|
||||
$builder->join('t_costcenter_master CSMaster', 'reqMaster.CostCenterCode = CSMaster.CostCenterCode', 'left');
|
||||
$builder->where('PONO', $pono);
|
||||
$builder->groupBy('t_purchaseorder_lineitem.ReqNo');
|
||||
$query = $builder->get();
|
||||
$result = $query->getResult();
|
||||
return $result;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -106,7 +106,7 @@
|
||||
$createddate = new DateTime($record->CreatedDate);
|
||||
echo $createddate->format('d-m-Y h:i A'); ?></td>
|
||||
<td><a data-toggle="modal" data-target="#Igrshow" data-id="<?php echo $index;?>" data-inx="<?php echo $index;?>" data-userid="<?php echo $record->IGRNO ?>" data-igrstatus="<?php echo $record->IGRStatus ?>"> <u><?php echo $record->IGRNO ?></u></a></td>
|
||||
<td><?php echo $record->PONO ?></td>
|
||||
<td><a target="_blank" data-toggle="modal" data-target="#CostCentershow" data-id="<%=index%>" title="Cost Center" data-igrno="<?php echo $record->IGRNO ?>" data-pono="<?php echo $record->PONO ?>"><u><?php echo $record->PONO ?></u></a></td>
|
||||
<td><?php echo $record->SupplierName ?></td>
|
||||
<td><?php echo $record->DeliveryChellanOrInvoiceNo ?></td>
|
||||
<td align="right"><?php
|
||||
@ -125,7 +125,9 @@
|
||||
<a target="_blank" data-toggle="modal" data-target="#Historyshow" data-id="<%=index%>" title="IGR History" data-igrno="<?php echo $record->IGRNO ?>" data-pono="<?php echo $record->PONO ?>">
|
||||
<i class="fa fa-history" style="text-align: center;"></i>
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<!-- <a class="a_tag_for_mrir" href="<?php echo base_url().'MRIRcontroller/igrdatavalues?IGRNO='.$record->IGRNO; ?>" target="_blank" data-id="<%=index%>" title="Generate MRIR"><i class="fa fa-external-link" style="text-align: center;"></i></a> -->
|
||||
</td>
|
||||
</tr>
|
||||
@ -357,6 +359,27 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- History modal fade closed-->
|
||||
<!-- CostCenter modal fade -->
|
||||
<div class="modal fade" id="CostCentershow" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<!-- Modal content-->
|
||||
<div class="modal-content" style="width:800px;">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<center>
|
||||
<h4>Cost Center List <span id="CCTitle"></span></h4>
|
||||
</center> <!-- IGR number should display here-->
|
||||
</div>
|
||||
|
||||
<div style="margin:20px;" id="CCStatement"></div>
|
||||
<div style="text-align: right; margin:5px;">
|
||||
<a class="btn btn-success" data-dismiss="modal" value="Close">Close</a>
|
||||
</div>
|
||||
<br />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- CostCenter modal fade closed-->
|
||||
<!-- File modal -->
|
||||
<div class="modal fade" id="Fileshow" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
@ -747,6 +770,43 @@ console.log(tableData);
|
||||
$("#HisStatement").html(output);
|
||||
}
|
||||
});
|
||||
$("#CostCentershow").on("shown.bs.modal", function(e) {
|
||||
|
||||
var pono = $(e.relatedTarget).data('pono');
|
||||
|
||||
$('#CCTitle').text(" (" + pono + ") ");
|
||||
$("#CCStatement").empty();
|
||||
|
||||
if (pono !== "") {
|
||||
$.ajax({
|
||||
data: { pono: pono },
|
||||
type: "POST",
|
||||
url: "<?php echo base_url() ?>getCostCenterData",
|
||||
success: function(data) {
|
||||
var output = '';
|
||||
if (data && data.length > 0) {
|
||||
|
||||
data.forEach(function(record) {
|
||||
|
||||
output += '<p style="font-size:16px;"> <strong>' + record.ReqNo + '</strong> : ' + record.CostCenterName + '-' + record.CostCenterCode +' </p>';
|
||||
});
|
||||
} else {
|
||||
output = '<p style="text-align: center;">No Cost Center Data Available</p>';
|
||||
}
|
||||
$("#CCStatement").html(output);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
var output = '<p style="text-align: center;">No Data Available</p>';
|
||||
$("#CCStatement").html(output);
|
||||
console.error('AJAX Error: ' + status + error);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
var output = '<p style="text-align: center;">No Data Available</p>';
|
||||
$("#CCStatement").html(output);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function constructSentence(record) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user