Cost center change
This commit is contained in:
parent
d36715285d
commit
575df954ca
@ -167,15 +167,9 @@
|
||||
<label>Cost Center Name</label>
|
||||
<div class="form-group">
|
||||
|
||||
<?php
|
||||
$options = array("0"=>'Select Cost Center');
|
||||
//print_r( $options);
|
||||
|
||||
|
||||
|
||||
echo form_dropdown('CostCenter', $options,set_value('CostCenter'),'id="CostCenter"' ,'class="form-control"');
|
||||
|
||||
?>
|
||||
<?php
|
||||
$data = array('name' => 'CostCenter','value' => set_value('CostCenter'),'id'=>'CostCenter', 'class' => 'form-control' ,'readonly' => 'true');
|
||||
echo form_input($data);?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
@ -241,7 +235,11 @@
|
||||
<th>Requistion Type </th>
|
||||
<th>Requested By</th>
|
||||
<th>Requested Date</th>
|
||||
<th>Status</th>
|
||||
<th>Tot. No. Of Line Items</th>
|
||||
<th>Po Created Line Items</th>
|
||||
<th>Partial PO Created Line Items</th>
|
||||
<th>New Line Items</th>
|
||||
<th>Status</th>
|
||||
<th>Department</th>
|
||||
<th>Designation</th>
|
||||
</tr>
|
||||
@ -264,6 +262,9 @@
|
||||
$RequestedDate = $dt->format('d-m-Y');
|
||||
echo $RequestedDate;
|
||||
?></td>
|
||||
<td>1</td>
|
||||
<td>2</td>
|
||||
<td>3</td>
|
||||
<td><?php echo $record->StatusName; ?></td>
|
||||
<td><?php echo $record->DepartmentName; ?></td>
|
||||
<td><?php echo $record->Designation; ?></td>
|
||||
@ -505,8 +506,8 @@ $("#myModal").on("shown.bs.modal", function(e) {
|
||||
$("#ReqBy").val(json.Requist[0]['FirstName']);
|
||||
$("#RequistionDate").val(json.Requist[0]['ReqDate']);
|
||||
$("#Desigination").val(json.Requist[0]['Designation']);
|
||||
$("#CostCenter").empty();
|
||||
$("#CostCenter").append(json.Cost);
|
||||
$("#CostCenter").val(json.Requist[0]['CostCenterCode']);
|
||||
$("#AvlBudgetAmount").val(json.AvilBudAmount);
|
||||
|
||||
$("#tbleAppend").empty();
|
||||
$("#tbleAppend").append(json.Items);
|
||||
@ -516,51 +517,7 @@ $("#myModal").on("shown.bs.modal", function(e) {
|
||||
});
|
||||
|
||||
});
|
||||
$('#CostCenter').change(function() {
|
||||
|
||||
var id = $('#CostCenter').val();
|
||||
$("#AvlBudgetAmount").val('');
|
||||
var ReqType = $('#ReqType').val();
|
||||
if(id != '-1')
|
||||
{
|
||||
$('#content').loader('show');
|
||||
$.ajax({
|
||||
data:{id:id},
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>servicepurchaseorder/AvilBudgetAmount?ReqType="+ReqType,
|
||||
success:function(data) {
|
||||
if(data)
|
||||
{
|
||||
$('#content').loader('hide');
|
||||
$("#AvlBudgetAmount").val(data);
|
||||
if(parseFloat($("#AvlBudgetAmount").val()) <= 0)
|
||||
{
|
||||
$('#AlertImg').removeAttr("style");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#AlertImg').attr("style","display:none;");
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#content').loader('hide');
|
||||
alert("Error");
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
alert('Please select the Employee details');
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
function Validate()
|
||||
{
|
||||
var ReqNo = $('#txtReqNo').val();
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
$Designation ='';
|
||||
$DepartmentName = '';
|
||||
$Status = '';
|
||||
$CostCenterCode = '';
|
||||
|
||||
|
||||
if(!empty($ReqDetails))
|
||||
@ -19,7 +20,8 @@ if(!empty($ReqDetails))
|
||||
$FirstName =$Req->FirstName;
|
||||
$Designation =$Req->Designation;
|
||||
$DepartmentName = $Req->DepartmentName;
|
||||
$Status = $Req->Status;
|
||||
$Status = $Req->Status;
|
||||
$CostCenterCode = $Req->CostCenterCode;
|
||||
}
|
||||
}
|
||||
|
||||
@ -98,7 +100,7 @@ if(!empty($ReqDetails))
|
||||
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$Costs = array("-1"=>'Select Cost Center Name');
|
||||
$Costs = array($CostCenterCode=>$CostCenterCode);
|
||||
//print_r( $options);
|
||||
|
||||
if(!empty($CostCenter))
|
||||
@ -377,7 +379,36 @@ $(function() {
|
||||
//Initialize Select2 Elements
|
||||
$(".select2").select2();
|
||||
|
||||
|
||||
var id = '<?php echo $CostCenterCode?>';
|
||||
var ReqType = '<?php echo $ReqType?>';
|
||||
$.ajax({
|
||||
data:{id:id},
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>servicepurchaseorder/AvilBudgetAmount?ReqType="+ReqType,
|
||||
success:function(data) {
|
||||
if(data)
|
||||
{
|
||||
$('#content').loader('hide');
|
||||
$("#AvlBudgetAmount").val(data);
|
||||
|
||||
if(parseFloat($("#AvlBudgetAmount").val()) <= 0)
|
||||
{
|
||||
$('#AlertImg').removeAttr("style");
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#AlertImg').attr("style","display:none;");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#content').loader('hide');
|
||||
alert("Error");
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
$('#CostCenter').change(function() {
|
||||
|
||||
@ -395,7 +426,7 @@ $('#CostCenter').change(function() {
|
||||
if(data)
|
||||
{
|
||||
$('#content').loader('hide');
|
||||
$("#AvlBudgetAmount").val(data);
|
||||
$("#AvlBudgetAmount").val(number_format(data,2));
|
||||
|
||||
if(parseFloat($("#AvlBudgetAmount").val()) <= 0)
|
||||
{
|
||||
@ -718,12 +749,12 @@ $('.addClick').click(function(){
|
||||
var quantity = $("#Quantity").val();
|
||||
|
||||
$('#drpMaterial option[value='+materialCode+']').remove();
|
||||
|
||||
$('#Description').val('');
|
||||
$('#UOM').val('');
|
||||
$('#Quantity').val('');
|
||||
|
||||
index = parseInt(index)+1;
|
||||
|
||||
|
||||
var template = jQuery("#tempList").html();
|
||||
|
||||
@ -805,11 +836,11 @@ $('.EditClick').click(function(){
|
||||
});
|
||||
$(function () {
|
||||
$('#Items').DataTable({
|
||||
"paging": false,
|
||||
"paging": true,
|
||||
"lengthChange": true,
|
||||
"searching": false,
|
||||
"ordering": false,
|
||||
// "info": true,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": true
|
||||
|
||||
});
|
||||
|
||||
@ -326,8 +326,6 @@ $(function() {
|
||||
//Initialize Select2 Elements
|
||||
$(".select2").select2();
|
||||
|
||||
|
||||
|
||||
$('#CostCenter').change(function() {
|
||||
|
||||
var id = $('#CostCenter').val();
|
||||
@ -386,7 +384,9 @@ $('#CostCenter').change(function() {
|
||||
$("#Description").val('');
|
||||
$("#UOM").val('');
|
||||
$('#CostCenter').val("-1");
|
||||
removeHiddenRows($('#Items').find('tr').length);
|
||||
|
||||
removeHiddenRows($('#Items').find('tr').length);
|
||||
$('#tempAppend').empty();
|
||||
var id = $('#RequestType').val();
|
||||
|
||||
if(id != '-1')
|
||||
@ -476,8 +476,10 @@ var userid = '';
|
||||
function removeHiddenRows(rowcount)
|
||||
{
|
||||
var step;
|
||||
//alert(rowcount);
|
||||
for (step = 1; step < rowcount-2; step++) {
|
||||
alert(rowcount);
|
||||
if(rowcount > 2)
|
||||
{
|
||||
for (step = 1; step < rowcount ; step++) {
|
||||
var td = document.getElementById(step);
|
||||
td.parentNode.removeChild(td);
|
||||
$("#MaterialCode"+step).remove();
|
||||
@ -485,7 +487,8 @@ for (step = 1; step < rowcount-2; step++) {
|
||||
$("#UOM"+step).remove();
|
||||
$("#Quantity"+step).remove();
|
||||
index = '1';
|
||||
userid = '';
|
||||
userid = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
function Save()
|
||||
@ -500,6 +503,7 @@ function Save()
|
||||
$('#Deliverydt').focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$('#content').loader('show');
|
||||
@ -547,7 +551,12 @@ function validate()
|
||||
alert('Please Add Line Item');
|
||||
return false;
|
||||
}
|
||||
else
|
||||
else if(isExceed == 1)
|
||||
{
|
||||
alert('You dont have Budget and You cant Raise New Requisition');
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -759,7 +768,7 @@ $('.EditClick').click(function(){
|
||||
"lengthChange": true,
|
||||
"searching": false,
|
||||
"ordering": false,
|
||||
// "info": true,
|
||||
"info": false,
|
||||
"autoWidth": true
|
||||
|
||||
});
|
||||
|
||||
@ -145,12 +145,11 @@
|
||||
<div class="form-group">
|
||||
|
||||
<?php
|
||||
$options = array("0"=>'Select Cost Center');
|
||||
//print_r( $options);
|
||||
|
||||
|
||||
|
||||
$data = array('name' => 'CostCenter','value' => set_value('CostCenter'),'id'=>'CostCenter', 'class' => 'form-control' ,'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
|
||||
echo form_dropdown('CostCenter', $options,set_value('CostCenter'),'id="CostCenter"' ,'class="form-control"');
|
||||
|
||||
|
||||
?>
|
||||
</div>
|
||||
@ -167,7 +166,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
<table id="Requistion" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
|
||||
<table id="Items" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
|
||||
<div align="right" style="padding-right:10px">
|
||||
|
||||
<div class="modal fade" role="dialog">
|
||||
@ -204,12 +203,12 @@
|
||||
</div>
|
||||
|
||||
|
||||
<table id="Requisition" class="table table-bordred table-striped editableTable" style="border:1px solid #333" >
|
||||
<table id="Requisition" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
|
||||
<div align="right" style="padding-right:10px">
|
||||
<div id="content" > </div>
|
||||
<div class="modal fade" role="dialog">
|
||||
|
||||
<thead style="background-color:#fff">
|
||||
<thead style="background-color:#ddf">
|
||||
<tr>
|
||||
|
||||
<th>Requisition Number</th>
|
||||
@ -232,8 +231,11 @@
|
||||
?>
|
||||
<tr id="<?php echo $index ?>" >
|
||||
<td><a data-toggle="modal" data-target="#myModal" data-id="<%=index%>" data-userid="<?php echo $record->ReqNo ?>" ><u><?php echo $record->ReqNo ?></u></a></td>
|
||||
<td><?php echo $record->Requestedby ?></td>
|
||||
<td><?php echo $record->CreatedDate ?></td>
|
||||
<td><?php echo $record->FirstName ?></td>
|
||||
<td align="right"><?php $Cdt = new DateTime($record->CreatedDate);
|
||||
$CreatedDate = $Cdt->format('d-m-Y');
|
||||
echo $CreatedDate;
|
||||
?></td>
|
||||
<td><?php echo $record->StatusName ?></td>
|
||||
<?php if (($record->Status) == REQ_PENDING_APPROVAL)
|
||||
{
|
||||
@ -281,46 +283,7 @@
|
||||
<script>
|
||||
var startDate = '';
|
||||
var endDate = '';
|
||||
function Search()
|
||||
{
|
||||
var stat = $('#RequisitionStatus').val();
|
||||
st = '';
|
||||
var val = $('#SearchDate').val();
|
||||
DataColl = [];
|
||||
DataColl[0] = startDate;
|
||||
DataColl[1] = endDate;
|
||||
if(stat != '-1')
|
||||
{
|
||||
st =stat;
|
||||
}
|
||||
DataColl[2] = st;
|
||||
|
||||
$('#content').loader('show');
|
||||
$.ajax({
|
||||
data:{id:DataColl},
|
||||
type:"POST",
|
||||
//dataType: 'json',
|
||||
url:"<?php echo base_url() ?>requisitionform/SearchRequistList",
|
||||
//success:function(json) {
|
||||
success:function(data) {
|
||||
$('#content').loader('hide');
|
||||
alert(data);
|
||||
/*$("#ReqType").val(json.Requist[0]['ReqType']);
|
||||
$("#ReqBy").val(json.Requist[0]['Requestedby']);
|
||||
$("#ReqDate").val(json.Requist[0]['CreatedDate']);
|
||||
$("#Desigination").val(json.Requist[0]['Designation']);
|
||||
$("#CostCenter").empty();
|
||||
$("#CostCenter").append(json.Cost);
|
||||
|
||||
$("#tbleAppend").empty();
|
||||
$("#tbleAppend").append(json.Items); */
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
//
|
||||
}
|
||||
|
||||
|
||||
function Reset()
|
||||
{
|
||||
$('#RequisitionStatus').val("-1");
|
||||
@ -328,7 +291,7 @@ function Reset()
|
||||
}
|
||||
$("#myModal").on("shown.bs.modal", function(e) {
|
||||
var ReqId = $(e.relatedTarget).data('userid');
|
||||
$("#CostCenter").empty();
|
||||
$("#CostCenter").val('');
|
||||
$("#tbleAppend").empty();
|
||||
$("#ReqType").val('');
|
||||
$("#ReqBy").val('');
|
||||
@ -344,16 +307,17 @@ $("#myModal").on("shown.bs.modal", function(e) {
|
||||
dataType: 'json',
|
||||
url:"<?php echo base_url() ?>requisitionform/ViewRequest",
|
||||
success:function(json) {
|
||||
// success:function(data) {
|
||||
$('#content').loader('hide');
|
||||
|
||||
//alert(data);
|
||||
$("#ReqType").val(json.Requist[0]['ReqType']);
|
||||
$("#ReqBy").val(json.Requist[0]['Requestedby']);
|
||||
$("#ReqDate").val(json.Requist[0]['CreatedDate']);
|
||||
$("#Desigination").val(json.Requist[0]['Designation']);
|
||||
|
||||
$("#CostCenter").append(json.Cost);
|
||||
|
||||
$("#tbleAppend").append(json.Items);
|
||||
$("#CostCenter").val(json.Requist[0]['CostCenterCode']);
|
||||
$("#AvlBudgetAmount").val(json.AvilBudAmount);
|
||||
|
||||
$("#tbleAppend").append(json.Items);
|
||||
|
||||
}
|
||||
|
||||
@ -361,51 +325,6 @@ $("#myModal").on("shown.bs.modal", function(e) {
|
||||
|
||||
});
|
||||
|
||||
$('#CostCenter').change(function() {
|
||||
|
||||
var id = $('#CostCenter').val();
|
||||
$("#AvlBudgetAmount").val('');
|
||||
var ReqType = $('#ReqType').val();
|
||||
if(id != '-1')
|
||||
{
|
||||
$('#content').loader('show');
|
||||
$.ajax({
|
||||
data:{id:id},
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>servicepurchaseorder/AvilBudgetAmount?ReqType="+ReqType,
|
||||
success:function(data) {
|
||||
if(data)
|
||||
{
|
||||
$('#content').loader('hide');
|
||||
$("#AvlBudgetAmount").val(data);
|
||||
if(parseFloat($("#AvlBudgetAmount").val()) <= 0)
|
||||
{
|
||||
$('#AlertImg').removeAttr("style");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#AlertImg').attr("style","display:none;");
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#content').loader('hide');
|
||||
alert("Error");
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
alert('Please select the Employee details');
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
function saveToDatabase(editableObj,column,ReqId,Index) {
|
||||
|
||||
@ -416,15 +335,15 @@ function saveToDatabase(editableObj,column,ReqId,Index) {
|
||||
var strMsg = 'Do you want to Approve the Requisition?';
|
||||
if(Status == '3')
|
||||
{
|
||||
StatusCode = '<?php echo REQ_REJECTED; ?>';
|
||||
StatusCode = '<?php echo REQ_REJECTED; ?>';
|
||||
strMsg = 'Do you want to Reject the Requisition?'
|
||||
}
|
||||
var Remarks = $('#Remarks'+Index).val();
|
||||
if(Remarks == '')
|
||||
if(Status == '3' && Remarks == '')
|
||||
{
|
||||
alert('Please enter remarks');
|
||||
$('#status'+Index).val('1');
|
||||
return;
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
@ -480,7 +399,7 @@ $(function() {
|
||||
//$('#SearchDate').daterangepicker( );
|
||||
//Initialize Select2 Elements
|
||||
$(".select2").select2();
|
||||
|
||||
//$('#SearchDate').val('');
|
||||
$('#SearchDate').daterangepicker(
|
||||
{
|
||||
locale: {
|
||||
@ -505,6 +424,15 @@ function(start, end, label) {
|
||||
});
|
||||
$(function () {
|
||||
|
||||
$('#Items').DataTable({
|
||||
"paging": false,
|
||||
"lengthChange": true,
|
||||
"searching": false,
|
||||
"ordering": false,
|
||||
"info": false,
|
||||
"autoWidth": false
|
||||
|
||||
});
|
||||
$('#Requisition').DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": true,
|
||||
|
||||
@ -13,13 +13,7 @@
|
||||
}?>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
$('table').tableSort( {
|
||||
animation :'slide',
|
||||
speed:500
|
||||
} );
|
||||
});
|
||||
|
||||
|
||||
function DeleteRow(rowid)
|
||||
{
|
||||
@ -92,17 +86,18 @@ span.highlight {
|
||||
<?php if($DraftCount > 0 ) {?><p>
|
||||
<span class="highlight">The Requisition No <b><?php echo $ReqNo;?></b> is in Draft status.</span> Please act on the requisition.<span class="highlight">Then only you can raise New Requisition. </span>
|
||||
</p> <?php } ?>
|
||||
<div class="box-body table-responsive no-padding" >
|
||||
<table id="datatable" class="table table-hover tableSorter" >
|
||||
|
||||
<tr bgcolor="steelblue">
|
||||
|
||||
<table id="Requisition" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
|
||||
<thead style="background-color:#ddf">
|
||||
<tr>
|
||||
<th>Requisition No</th>
|
||||
<th>Requisition Type</th>
|
||||
<th>Status</th>
|
||||
<th>Requisted Date</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
</tr>
|
||||
</thead> <?php
|
||||
if(!empty($ReqList))
|
||||
{
|
||||
foreach($ReqList as $record)
|
||||
@ -112,7 +107,10 @@ span.highlight {
|
||||
<td><?php echo $record->ReqNo ?></td>
|
||||
<td><?php echo $record->ReqType ?></td>
|
||||
<td><?php echo $record->StatusName ?></td>
|
||||
<td><?php echo $record->CreatedDate ?></td>
|
||||
<td><?php $Pdt = new DateTime($record->CreatedDate );
|
||||
$PODate = $Pdt->format('Y-m-d');
|
||||
echo $PODate
|
||||
?></td>
|
||||
<td> <a data-toggle="tooltip" href="<?php echo base_url().'EditRequisition?ReqNo='.$record->ReqNo.'&ReqType='.$record->ReqType; ?>"><i class="fa fa-pencil" data-toggle="tooltip" title="<?php echo $record->ReqNo; ?> - Click here to view Requisition details"></i> </a> <a data-toggle="tooltip" onclick="DeleteRow('<?php echo $record->ReqNo; ?>' )" ><span class="glyphicon glyphicon-trash" title="<?php echo $record->ReqNo; ?> - Click here to Delete Requisition details"></span></a> </td>
|
||||
</tr>
|
||||
|
||||
@ -122,11 +120,24 @@ span.highlight {
|
||||
?>
|
||||
</table>
|
||||
|
||||
</div><!-- /.box-body -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
$('#Requisition').DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": true,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": true
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user