Merge branch 'new_theme' of bitbucket.org:venbainformationtechnology/ria into new_theme
This commit is contained in:
commit
b0739f5837
@ -38,24 +38,9 @@ if (!empty($ReqPOType)) {
|
|||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
var serviceScheduleType = '<?php echo $serviceSchedule; ?>';
|
var serviceScheduleType = '<?php echo $serviceSchedule; ?>';
|
||||||
if (serviceScheduleType != '') {
|
if (serviceScheduleType != '') {
|
||||||
if (serviceScheduleType != 'Recurring') {
|
$('#DisplayScheduleDiv').show();
|
||||||
$('#DisplayScheduleDiv').show();
|
|
||||||
$('#ServicePeriodOption').hide();
|
|
||||||
$('#NoServices').hide();
|
|
||||||
|
|
||||||
} else {
|
|
||||||
$('#DisplayScheduleDiv').show();
|
|
||||||
$('#ServicePeriodOption').hide();
|
|
||||||
$('#NoServices').hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
document.getElementById('DisplayScheduleDiv').style.display = 'none';
|
$('#DisplayScheduleDiv').hide();
|
||||||
$('#ServicePeriodOption').hide();
|
|
||||||
$('#NoServices').hide();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -97,7 +82,6 @@ if (!empty($ReqPOType)) {
|
|||||||
$data = array('name' => 'RequestType', 'value' => set_value('RequestType', $ReqType), 'id' => 'RequestType', 'class' => 'form-control', 'readonly' => 'true');
|
$data = array('name' => 'RequestType', 'value' => set_value('RequestType', $ReqType), 'id' => 'RequestType', 'class' => 'form-control', 'readonly' => 'true');
|
||||||
echo form_input($data);
|
echo form_input($data);
|
||||||
?>
|
?>
|
||||||
<input type="hidden" name="txtReqNo" id="txtReqNo" value="<?php echo $ReqNo ?>" />
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
@ -130,55 +114,17 @@ if (!empty($ReqPOType)) {
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-3" id="DisplayScheduleDiv" style="display:none;">
|
<div class="form-group col-md-3" id="DisplayScheduleDiv" style="display:none;">
|
||||||
<label for="ScheduleType" class="col-form-label">Service Schedule Type</label>
|
<label for="ScheduleType" class="col-form-label">Service Schedule Type</label>
|
||||||
<?php
|
<?php
|
||||||
$Schdule = array("One Time", "Recurring");
|
$Schdule = array("One Time", "Recurring");
|
||||||
|
|
||||||
|
|
||||||
if (!empty($Schdule)) {
|
if (!empty($Schdule)) {
|
||||||
|
|
||||||
foreach ($Schdule as $seletedSch) :
|
|
||||||
if ($serviceSchedule == $seletedSch) {
|
|
||||||
$SchType[$seletedSch] = $seletedSch;
|
|
||||||
}
|
|
||||||
endforeach;
|
|
||||||
foreach ($Schdule as $Sch) :
|
foreach ($Schdule as $Sch) :
|
||||||
if ($serviceSchedule != $Sch) {
|
$SchType[$Sch] = $Sch;
|
||||||
$SchType[$Sch] = $Sch;
|
|
||||||
}
|
|
||||||
endforeach;
|
endforeach;
|
||||||
}
|
}
|
||||||
echo form_dropdown('ScheduleType', $SchType, set_value('ScheduleType'), 'id="ScheduleType"', 'class = "form-control"');
|
$selectedValue = set_value('ScheduleType') ? set_value('ScheduleType') : reset($SchType);
|
||||||
?>
|
echo form_dropdown('ScheduleType', $SchType, $selectedValue, 'id="ScheduleType" class = "form-control searchabledropdown" data-toggle="select2"');
|
||||||
</div>
|
|
||||||
<div class="form-group col-md-3" id="ServicePeriodOption" style="display:none;">
|
|
||||||
<label for="ServiceOptions" class="col-form-label">Service Period Option</label>
|
|
||||||
<?php
|
|
||||||
if (!empty($ServiceOption)) {
|
|
||||||
foreach ($ServiceOption as $SerOptionsel) :
|
|
||||||
|
|
||||||
if ($servicePeriod == $SerOptionsel->ConfigValue) {
|
|
||||||
|
|
||||||
$ServiceOptions[$SerOptionsel->ConfigValue] = $SerOptionsel->ConfigValue;
|
|
||||||
}
|
|
||||||
endforeach;
|
|
||||||
|
|
||||||
foreach ($ServiceOption as $SerOption) :
|
|
||||||
if ($servicePeriod != $SerOption->ConfigValue) {
|
|
||||||
$ServiceOptions[$SerOption->ConfigValue] = $SerOption->ConfigValue;
|
|
||||||
}
|
|
||||||
endforeach;
|
|
||||||
}
|
|
||||||
echo form_dropdown('ServiceOptions', $ServiceOptions, set_value('ServiceOptions'), 'id="ServiceOptions"', 'class = "form-control"');
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
<div class="form-group col-md-3" id="DisplayScheduleDiv" style="display:none;">
|
|
||||||
<label for="ServiceNo" class="col-form-label">Number of Services</label>
|
|
||||||
<?php
|
|
||||||
$data = array('name' => 'ServiceNo', 'value' => set_value('ServiceNo', $noOfService), 'id' => 'ServiceNo', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);');
|
|
||||||
echo form_input($data);
|
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -240,27 +186,50 @@ if (!empty($ReqPOType)) {
|
|||||||
<input type="hidden" name="txtDeletedRow" id="txtDeletedRow" />
|
<input type="hidden" name="txtDeletedRow" id="txtDeletedRow" />
|
||||||
<input type="hidden" name="txtRowCount" id="txtRowCount" value="<?php echo $RowCount; ?>" />
|
<input type="hidden" name="txtRowCount" id="txtRowCount" value="<?php echo $RowCount; ?>" />
|
||||||
<!-- Available Budget Amt -->
|
<!-- Available Budget Amt -->
|
||||||
<input type="hidden" name="AvlBudgetAmount" id="AvlBudgetAmount" />
|
<input type="hidden" name="txtReqNo" id="txtReqNo" value="<?php echo $ReqNo ?>" />
|
||||||
|
<?php
|
||||||
|
$data = array('name' => 'ServiceNo', 'value' => set_value('ServiceNo', $noOfService), 'id' => 'ServiceNo', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);');
|
||||||
|
echo form_hidden($data);
|
||||||
|
?>
|
||||||
|
<div style="display:none;">
|
||||||
|
<label for="ServiceOptions" class="col-form-label">Service Period Option</label>
|
||||||
|
<?php
|
||||||
|
if (!empty($ServiceOption)) {
|
||||||
|
foreach ($ServiceOption as $SerOptionsel) :
|
||||||
|
|
||||||
|
if ($servicePeriod == $SerOptionsel->ConfigValue) {
|
||||||
|
|
||||||
|
$ServiceOptions[$SerOptionsel->ConfigValue] = $SerOptionsel->ConfigValue;
|
||||||
|
}
|
||||||
|
endforeach;
|
||||||
|
|
||||||
|
foreach ($ServiceOption as $SerOption) :
|
||||||
|
if ($servicePeriod != $SerOption->ConfigValue) {
|
||||||
|
$ServiceOptions[$SerOption->ConfigValue] = $SerOption->ConfigValue;
|
||||||
|
}
|
||||||
|
endforeach;
|
||||||
|
}
|
||||||
|
echo form_dropdown('ServiceOptions', $ServiceOptions, set_value('ServiceOptions'), 'id="ServiceOptions"', 'class = "form-control"');
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row float-right">
|
<div class="form-row float-right">
|
||||||
<?php if ($Status == REQ_DRAFT) { ?>
|
<?php if ($Status == REQ_DRAFT) { ?>
|
||||||
<input type="reset" value="Reset" class="btn btn-secondary waves-effect" onclick="window.location.reload();">
|
<input type="reset" value="Reset" class="btn btn-secondary waves-effect" onclick="window.location.reload();">
|
||||||
<a class="btn-primary waves-effect Save" ID="Save" onclick="Save(0)"> <span class="bold">Save As Draft</span></a>
|
<button type="button" class="btn btn-primary waves-effect Save" onclick="Save(0)" id="Save">Save As Draft</button>
|
||||||
<a class="btn-primary waves-effect submit" ID="submit" onclick="Save(1)"> <span class="bold">Submit</span></a>
|
<button type="button" class="btn btn-primary waves-effect submit" onclick="Save(1)" id="submit">Submit</button>
|
||||||
<a class="btn-soft-primary waves-effect waves-light submit" ID="submit" onclick="Save(2)"> <span class="bold">Approve</span></a>
|
<button type="button" class="btn btn-soft-primary waves-effect waves-light submit" onclick="Save(2)" id="submit">Approve</button>
|
||||||
<?php } else if ($Status == REQ_PENDING_APPROVAL) { ?>
|
<?php } else if ($Status == REQ_PENDING_APPROVAL) { ?>
|
||||||
<input type="reset" value="Reset" class="btn btn-secondary waves-effect" onclick="window.location.reload();">
|
<input type="reset" value="Reset" class="btn btn-secondary waves-effect" onclick="window.location.reload();">
|
||||||
<a class="btn-primary waves-effect Save" ID="submit" onclick="Save(1)"> <span class="bold">Submit</span></a>
|
<button type="button" class="btn btn-primary waves-effect submit" onclick="Save(1)" id="submit">Submit</button>
|
||||||
<a class="btn-soft-primary waves-effect waves-light submit" ID="submit" onclick="Save(2)"> <span class="bold">Approve</span></a>
|
<button type="button" class="btn btn-soft-primary waves-effect waves-light submit" onclick="Save(2)" id="submit">Approve</button>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
<?php echo form_close(); ?>
|
<?php echo form_close(); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div><!-- end row -->
|
||||||
<!-- end row -->
|
|
||||||
</div> <!-- container -->
|
</div> <!-- container -->
|
||||||
<div id="add-req-modal" class="modal fade" tabindex="-1" role="dialog"
|
<div id="add-req-modal" class="modal fade" tabindex="-1" role="dialog"
|
||||||
aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
|
aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
|
||||||
@ -413,6 +382,7 @@ if (!empty($ReqPOType)) {
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
|
<input type="hidden" name="Edituserid" id="Edituserid" />
|
||||||
<button type="button" class="btn btn-secondary waves-effect"
|
<button type="button" class="btn btn-secondary waves-effect"
|
||||||
data-dismiss="modal" value="Cancel">Cancel</button>
|
data-dismiss="modal" value="Cancel">Cancel</button>
|
||||||
<button type="button"
|
<button type="button"
|
||||||
@ -470,78 +440,13 @@ if (!empty($ReqPOType)) {
|
|||||||
var id = '<?php echo $CostCenterCode ?>';
|
var id = '<?php echo $CostCenterCode ?>';
|
||||||
var ReqType = '<?php echo $strReqPOType ?>';
|
var ReqType = '<?php echo $strReqPOType ?>';
|
||||||
|
|
||||||
var urlval = '';
|
|
||||||
|
|
||||||
urlval = "<?php echo base_url() ?>serviceAvilBudgetAmount";
|
|
||||||
$('#content').loader('show');
|
|
||||||
$.ajax({
|
|
||||||
data: {
|
|
||||||
id: id,
|
|
||||||
type: ReqType
|
|
||||||
},
|
|
||||||
type: "POST",
|
|
||||||
url: urlval,
|
|
||||||
success: function(data) {
|
|
||||||
if (data) {
|
|
||||||
$('#content').loader('hide');
|
|
||||||
|
|
||||||
$("#AvlBudgetAmount").val(parseFloat(data).toFixed(2));
|
|
||||||
|
|
||||||
if (parseFloat($("#AvlBudgetAmount").val()) <= 0) {
|
|
||||||
$('#AlertImg').removeAttr("style");
|
|
||||||
} else {
|
|
||||||
$('#AlertImg').attr("style", "display:none;");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$('#content').loader('hide');
|
|
||||||
// alert("Error");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
$('#CostCenter').change(function() {
|
$('#CostCenter').change(function() {
|
||||||
|
|
||||||
var id = $('#CostCenter').val();
|
var id = $('#CostCenter').val();
|
||||||
$("#AvlBudgetAmount").val('');
|
if (id == '-1') {
|
||||||
var ReqType = '<?php echo $strReqPOType ?>';
|
alert('Please select the CostCenter details');
|
||||||
var urlval = '';
|
|
||||||
if (ReqType == '<?php echo IMPORT ?>') {
|
|
||||||
urlval = "<?php echo base_url() ?>servicepurchaseorder/GetAvailableImportBudgetAmount?ReqType=" + ReqType;
|
|
||||||
} else {
|
|
||||||
urlval = "<?php echo base_url() ?>serviceAvilBudgetAmount";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (id != '-1') {
|
|
||||||
$('#content').loader('show');
|
|
||||||
$.ajax({
|
|
||||||
data: {
|
|
||||||
id: id,
|
|
||||||
type: ReqType
|
|
||||||
},
|
|
||||||
type: "POST",
|
|
||||||
url: urlval,
|
|
||||||
success: function(data) {
|
|
||||||
if (data != '0') {
|
|
||||||
$('#content').loader('hide');
|
|
||||||
$("#AvlBudgetAmount").val(parseFloat(data).toFixed(2));
|
|
||||||
|
|
||||||
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -565,7 +470,7 @@ if (!empty($ReqPOType)) {
|
|||||||
if (id != '-1') {
|
if (id != '-1') {
|
||||||
|
|
||||||
if ((converttext != 'SERVICE')) {
|
if ((converttext != 'SERVICE')) {
|
||||||
$('#content').loader('show');
|
// $('#content').loader('show');
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
data: {
|
data: {
|
||||||
@ -575,7 +480,7 @@ if (!empty($ReqPOType)) {
|
|||||||
type: "POST",
|
type: "POST",
|
||||||
url: "<?php echo base_url(); ?>getMaterialDetails",
|
url: "<?php echo base_url(); ?>getMaterialDetails",
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
$('#content').loader('hide');
|
// $('#content').loader('hide');
|
||||||
//alert(json.MatDetail);
|
//alert(json.MatDetail);
|
||||||
$("#Description").val(json.MatDetail[0]['MaterialName']);
|
$("#Description").val(json.MatDetail[0]['MaterialName']);
|
||||||
$("#UOM").val(json.MatDetail[0]['UOM']);
|
$("#UOM").val(json.MatDetail[0]['UOM']);
|
||||||
@ -595,18 +500,6 @@ if (!empty($ReqPOType)) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<script type="text/html" id="tempList">
|
|
||||||
<tr id="<%=index%>">
|
|
||||||
<td align="left"><%=index%></td>
|
|
||||||
<td align="left"><%=MaterialCode%></td>
|
|
||||||
<td align="left"><%=MaterialName%></td>
|
|
||||||
<td align="left"><%=UOM%></td>
|
|
||||||
<td align="left"><%=Quantity%></td>
|
|
||||||
<td align="left">0.00</td>
|
|
||||||
<td align="left">NEW</td>
|
|
||||||
<td><a data-target='#edit-req-modal' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#edit-req-modal"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <%=MaterialCode%> Material details"></i> </a> <a href='#' onclick="DeleteRow(index)" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del"><span class="glyphicon glyphicon-trash"></span></a></td>
|
|
||||||
</tr>
|
|
||||||
</script>
|
|
||||||
<script>
|
<script>
|
||||||
var index = $('#txtRowCount').val();
|
var index = $('#txtRowCount').val();
|
||||||
var userid = '';
|
var userid = '';
|
||||||
@ -645,7 +538,7 @@ if (!empty($ReqPOType)) {
|
|||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
//alert(document.getElementById('Items').rows.length);
|
//alert(document.getElementById('Items').rows.length);
|
||||||
$('#content').loader('show');
|
// $('#content').loader('show');
|
||||||
$('#txtStatus').val(stat);
|
$('#txtStatus').val(stat);
|
||||||
|
|
||||||
var serviceSchedule = '';
|
var serviceSchedule = '';
|
||||||
@ -673,7 +566,7 @@ if (!empty($ReqPOType)) {
|
|||||||
url: "<?php echo base_url() ?>EditRequisition",
|
url: "<?php echo base_url() ?>EditRequisition",
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
if (data) {
|
if (data) {
|
||||||
$('#content').loader('hide');
|
// $('#content').loader('hide');
|
||||||
alert(data);
|
alert(data);
|
||||||
$('#txtRowCount').val('');
|
$('#txtRowCount').val('');
|
||||||
$('#txtDeletedRow').val('');
|
$('#txtDeletedRow').val('');
|
||||||
@ -765,7 +658,7 @@ if (!empty($ReqPOType)) {
|
|||||||
url: "<?php echo base_url() ?>DeleteRequistionForm",
|
url: "<?php echo base_url() ?>DeleteRequistionForm",
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
if (data) {
|
if (data) {
|
||||||
$('#content').loader('hide');
|
// $('#content').loader('hide');
|
||||||
alert(data);
|
alert(data);
|
||||||
} else {
|
} else {
|
||||||
alert("Error");
|
alert("Error");
|
||||||
@ -808,28 +701,28 @@ if (!empty($ReqPOType)) {
|
|||||||
|
|
||||||
index = parseInt(index) + 1;
|
index = parseInt(index) + 1;
|
||||||
|
|
||||||
|
var rowHtml = `<tr id="${temp}">
|
||||||
|
<td align="left">${temp}</td>
|
||||||
|
<td align="left">${materialCode}</td>
|
||||||
|
<td align="left">${materialName}</td>
|
||||||
|
<td align="left">${uom}</td>
|
||||||
|
<td align="left">${quantity}</td>
|
||||||
|
<td align="left">0.00</td>
|
||||||
|
<td align="left">NEW</td>
|
||||||
|
<td>
|
||||||
|
<a data-id="${temp}" data-userid="${temp}" data-target='#edit-req-modal' data-toggle="modal" href="#edit-req-modal">
|
||||||
|
<i class="ri-pencil-fill" data-toggle="tooltip" title="Click here to view/Edit the ${materialCode} Material details"></i>
|
||||||
|
|
||||||
|
</a>
|
||||||
|
<a onclick="DeleteRow(${temp})" class="link" data-id="${temp}" data-userid="${temp}" id="Del">
|
||||||
|
<span class="ri-delete-bin-7-fill"></span>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
`;
|
||||||
|
|
||||||
var template = jQuery("#tempList").html();
|
// Append the HTML to the table body
|
||||||
|
$('#tempAppend').append(rowHtml);
|
||||||
if (materialdescription == '') {
|
|
||||||
$('#tempAppend').append(_.template(template, {
|
|
||||||
index: temp,
|
|
||||||
MaterialCode: materialCode,
|
|
||||||
MaterialName: materialName,
|
|
||||||
UOM: uom,
|
|
||||||
Quantity: quantity
|
|
||||||
}));
|
|
||||||
} else {
|
|
||||||
$('#tempAppend').append(_.template(template, {
|
|
||||||
index: temp,
|
|
||||||
MaterialCode: materialCode,
|
|
||||||
MaterialName: materialdescription,
|
|
||||||
UOM: uom,
|
|
||||||
Quantity: quantity
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var theForm = $(".requistion");
|
var theForm = $(".requistion");
|
||||||
|
|
||||||
@ -897,46 +790,35 @@ if (!empty($ReqPOType)) {
|
|||||||
e.close();
|
e.close();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
$(document).ready(function() {
|
||||||
|
$("#edit-req-modal").on("shown.bs.modal", function(e) {
|
||||||
|
var $triggerElement = $(e.relatedTarget);
|
||||||
|
var userid = $triggerElement.data('userid');
|
||||||
|
var $tr = $('#' + userid);
|
||||||
|
var $cells = $tr.find('td');
|
||||||
|
var check = $cells.eq(2).text();
|
||||||
|
var upcheck = check.toUpperCase();
|
||||||
|
var decs = $('#materialdesc' + userid).val();
|
||||||
|
if (upcheck == 'SERVICE') {
|
||||||
|
$('#EditotherDescription').show();
|
||||||
|
$('#EditotherD').val(decs)
|
||||||
|
|
||||||
$("#edit-req-modal").on("shown.bs.modal", function(e) {
|
} else {
|
||||||
userid = $(e.relatedTarget).data('userid');
|
$('#EditotherDescription').hide();
|
||||||
//alert(userid);
|
$('#EditotherD').val('')
|
||||||
var tr = document.getElementById(userid);
|
|
||||||
var cellval = tr.cells;
|
|
||||||
|
|
||||||
//var desc=cellval[2].innerHTML;
|
|
||||||
var check = cellval[2].innerHTML;
|
|
||||||
var upcheck = check.toUpperCase();
|
|
||||||
|
|
||||||
// var decs= <?php echo json_encode($materialdesc, JSON_PRETTY_PRINT) ?>;
|
|
||||||
//alert(decs)
|
|
||||||
//var desc= cellval[8].innerHTML
|
|
||||||
|
|
||||||
//alert(desc)
|
|
||||||
var decs = $('#materialdesc' + userid).val();
|
|
||||||
// alert(upcheck)
|
|
||||||
|
|
||||||
if (upcheck == 'SERVICE') {
|
|
||||||
$('#EditotherDescription').show();
|
|
||||||
$('#EditotherD').val(decs)
|
|
||||||
|
|
||||||
} else {
|
|
||||||
$('#EditotherDescription').hide();
|
|
||||||
$('#EditotherD').val('')
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//alert(x[1].innerHTML);
|
|
||||||
$('#EditMaterialCode').val(cellval[1].innerHTML);
|
|
||||||
$('#EditDescription').val(cellval[2].innerHTML);
|
|
||||||
$('#EditUOM').val(cellval[3].innerHTML);
|
|
||||||
$('#EditQuantity').val(cellval[4].innerHTML);
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#EditMaterialCode').val($cells.eq(1).text());
|
||||||
|
$('#EditDescription').val($cells.eq(2).text());
|
||||||
|
$('#EditUOM').val($cells.eq(3).text());
|
||||||
|
$('#EditQuantity').val($cells.eq(4).text());
|
||||||
|
$('#Edituserid').val(userid);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$('.EditClick').click(function() {
|
$('.EditClick').click(function() {
|
||||||
var editqty = parseInt(document.getElementById('EditQuantity').value);
|
var editqty = parseInt(document.getElementById('EditQuantity').value);
|
||||||
if (isNaN(editqty) || editqty < 1) {
|
if (isNaN(editqty) || editqty < 1) {
|
||||||
@ -953,19 +835,21 @@ if (!empty($ReqPOType)) {
|
|||||||
var editDescription = $("#EditDescription").val();
|
var editDescription = $("#EditDescription").val();
|
||||||
var editUOM = $('#EditUOM').val();
|
var editUOM = $('#EditUOM').val();
|
||||||
var editQuantity = $('#EditQuantity').val();
|
var editQuantity = $('#EditQuantity').val();
|
||||||
|
var edituserid = $("#Edituserid").val();
|
||||||
|
|
||||||
var tr = document.getElementById(userid);
|
var tr = $('#' + edituserid);
|
||||||
var cellval = tr.cells;
|
var cells = tr.find('td');
|
||||||
cellval[1].innerHTML = editMaterialCode;
|
cells.eq(1).text(editMaterialCode);
|
||||||
cellval[2].innerHTML = editDescription;
|
cells.eq(2).text(editDescription);
|
||||||
cellval[3].innerHTML = editUOM;
|
cells.eq(3).text(editUOM);
|
||||||
cellval[4].innerHTML = editQuantity;
|
cells.eq(4).text(editQuantity);
|
||||||
|
|
||||||
$('#MaterialCode' + userid).val(editMaterialCode);
|
$('#MaterialCode' + edituserid).val(editMaterialCode);
|
||||||
$('#Description' + userid).val(editDescription);
|
$('#Description' + edituserid).val(editDescription);
|
||||||
$('#UOM' + userid).val(editUOM);
|
$('#UOM' + edituserid).val(editUOM);
|
||||||
$('#Quantity' + userid).val(editQuantity);
|
$('#Quantity' + edituserid).val(editQuantity);
|
||||||
|
|
||||||
|
$('#edit-req-modal').modal('hide');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -979,18 +863,6 @@ if (!empty($ReqPOType)) {
|
|||||||
"ordering": false,
|
"ordering": false,
|
||||||
"info": false,
|
"info": false,
|
||||||
"autoWidth": true
|
"autoWidth": true
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#ScheduleType").change(function() {
|
|
||||||
if ($('#ScheduleType').val().trim() != 'Recurring') {
|
|
||||||
$('#ServicePeriodOption').hide();
|
|
||||||
$('#NoServices').hide();
|
|
||||||
} else {
|
|
||||||
$('#ServicePeriodOption').hide();
|
|
||||||
$('#NoServices').hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
@ -106,27 +106,11 @@ if (!empty($Emp)) {
|
|||||||
$SchType[$Sch] = $Sch;
|
$SchType[$Sch] = $Sch;
|
||||||
endforeach;
|
endforeach;
|
||||||
}
|
}
|
||||||
echo form_dropdown('ScheduleType', $SchType, set_value('ScheduleType'), 'id="ScheduleType"', 'class = "form-control searchabledropdown"', 'data-toggle="select2"');
|
echo form_dropdown('ScheduleType', $SchType, set_value('ScheduleType'), 'id="ScheduleType" class = "form-control searchabledropdown" data-toggle="select2"');
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
<div class="form-group col-md-3" id="ServicePeriodOption" style="display:none;">
|
|
||||||
<label for="ServiceOptions" class="col-form-label">Service Period Option</label>
|
|
||||||
<?php
|
|
||||||
if (!empty($ServiceOption)) {
|
|
||||||
foreach ($ServiceOption as $SerOption) :
|
|
||||||
$ServiceOptions[$SerOption->ConfigValue] = $SerOption->ConfigValue;
|
|
||||||
endforeach;
|
|
||||||
}
|
|
||||||
echo form_dropdown('ServiceOptions', $ServiceOptions, set_value('ServiceOptions'), 'id="ServiceOptions"', 'class = "form-control searchabledropdown"', 'data-toggle="select2"');
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
<div class="form-group col-md-3" id="DisplayScheduleDiv" style="display:none;">
|
|
||||||
<label for="ServiceNo" class="col-form-label">Number of Services</label>
|
|
||||||
<?php
|
|
||||||
$data = array('name' => 'ServiceNo', 'value' => set_value('ServiceNo'), 'id' => 'ServiceNo', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);');
|
|
||||||
echo form_input($data);
|
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-12">
|
<div class="form-group col-md-12">
|
||||||
@ -146,15 +130,28 @@ if (!empty($Emp)) {
|
|||||||
<th>Action</th>
|
<th>Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
<tbody id="tempAppend"></tbody>
|
||||||
</table>
|
</table>
|
||||||
</div> <!-- end table-responsive-->
|
</div> <!-- end table-responsive-->
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<input type="hidden" name="txtRowCount" id="txtRowCount" />
|
<input type="hidden" name="txtRowCount" id="txtRowCount" />
|
||||||
<input type="hidden" name="txtDeletedRow" id="txtDeletedRow" />
|
<input type="hidden" name="txtDeletedRow" id="txtDeletedRow" />
|
||||||
<!-- Available Budget Amt -->
|
<?php
|
||||||
<input type="hidden" name="AvlBudgetAmount" id="AvlBudgetAmount" />
|
$data = array('name' => 'ServiceNo', 'value' => set_value('ServiceNo'), 'id' => 'ServiceNo', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);');
|
||||||
|
echo form_hidden($data);
|
||||||
|
?>
|
||||||
|
<div style="display:none;">
|
||||||
|
<label for="ServiceOptions" class="col-form-label">Service Period Option</label>
|
||||||
|
<?php
|
||||||
|
if (!empty($ServiceOption)) {
|
||||||
|
foreach ($ServiceOption as $SerOption) :
|
||||||
|
$ServiceOptions[$SerOption->ConfigValue] = $SerOption->ConfigValue;
|
||||||
|
endforeach;
|
||||||
|
}
|
||||||
|
echo form_dropdown('ServiceOptions', $ServiceOptions, set_value('ServiceOptions'), 'id="ServiceOptions"', 'class = "form-control searchabledropdown"', 'data-toggle="select2"');
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row float-right">
|
<div class="form-row float-right">
|
||||||
<input type="reset" value="Reset" class="btn btn-secondary waves-effect" onclick="window.location.reload();">
|
<input type="reset" value="Reset" class="btn btn-secondary waves-effect" onclick="window.location.reload();">
|
||||||
@ -320,6 +317,7 @@ if (!empty($Emp)) {
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
|
<input type="hidden" name="Edituserid" id="Edituserid" />
|
||||||
<button type="button" class="btn btn-secondary waves-effect"
|
<button type="button" class="btn btn-secondary waves-effect"
|
||||||
data-dismiss="modal" value="Cancel">Cancel</button>
|
data-dismiss="modal" value="Cancel">Cancel</button>
|
||||||
<button type="button"
|
<button type="button"
|
||||||
@ -334,8 +332,6 @@ if (!empty($Emp)) {
|
|||||||
$('#otherDescription').hide();
|
$('#otherDescription').hide();
|
||||||
$('#EditotherDescription').hide();
|
$('#EditotherDescription').hide();
|
||||||
|
|
||||||
var isExceed = 0;
|
|
||||||
|
|
||||||
function isNumberKey(evt) {
|
function isNumberKey(evt) {
|
||||||
var charCode = (evt.which) ? evt.which : evt.keyCode;
|
var charCode = (evt.which) ? evt.which : evt.keyCode;
|
||||||
if (charCode != 46 && charCode > 31 &&
|
if (charCode != 46 && charCode > 31 &&
|
||||||
@ -355,41 +351,9 @@ if (!empty($Emp)) {
|
|||||||
$('#CostCenter').change(function() {
|
$('#CostCenter').change(function() {
|
||||||
|
|
||||||
var id = $('#CostCenter').val();
|
var id = $('#CostCenter').val();
|
||||||
$("#AvlBudgetAmount").val('');
|
|
||||||
|
|
||||||
var ReqType = $('#RequestType').val();
|
var ReqType = $('#RequestType').val();
|
||||||
|
|
||||||
if (id != '-1' && ReqType != '-1') {
|
if (id == '-1' && ReqType == '-1') {
|
||||||
|
|
||||||
$('#content').loader('show');
|
|
||||||
$.ajax({
|
|
||||||
data: {
|
|
||||||
id: id,
|
|
||||||
type: ReqType
|
|
||||||
},
|
|
||||||
type: "POST",
|
|
||||||
url: "<?php echo base_url() ?>serviceAvilBudgetAmount",
|
|
||||||
success: function(data) {
|
|
||||||
if (data != '0') {
|
|
||||||
$('#content').loader('hide');
|
|
||||||
$("#AvlBudgetAmount").val(parseFloat(data).toFixed(2));
|
|
||||||
if (parseFloat($("#AvlBudgetAmount").val()) <= 0) {
|
|
||||||
$('#AlertImg').removeAttr("style");
|
|
||||||
isExceed = 1;
|
|
||||||
} else {
|
|
||||||
$('#AlertImg').attr("style", "display:none;");
|
|
||||||
isExceed = 0;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$("#AvlBudgetAmount").val(parseFloat(data).toFixed(2));
|
|
||||||
$('#content').loader('hide');
|
|
||||||
// alert("Error");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
} else {
|
|
||||||
alert('Please select the Requistion Type');
|
alert('Please select the Requistion Type');
|
||||||
$('#CostCenter').val("-1");
|
$('#CostCenter').val("-1");
|
||||||
return false;
|
return false;
|
||||||
@ -397,8 +361,6 @@ if (!empty($Emp)) {
|
|||||||
|
|
||||||
});
|
});
|
||||||
$('#RequestType').change(function() {
|
$('#RequestType').change(function() {
|
||||||
$("#AvlBudgetAmount").val('');
|
|
||||||
$('#AlertImg').attr("style", "display:none;");
|
|
||||||
$('#txtRowCount').val('');
|
$('#txtRowCount').val('');
|
||||||
$('#txtDeletedRow').val('');
|
$('#txtDeletedRow').val('');
|
||||||
$("#Description").val('');
|
$("#Description").val('');
|
||||||
@ -417,7 +379,7 @@ if (!empty($Emp)) {
|
|||||||
var id = $('#RequestType').val();
|
var id = $('#RequestType').val();
|
||||||
|
|
||||||
if (id != '-1') {
|
if (id != '-1') {
|
||||||
$('#content').loader('show');
|
// $('#content').loader('show');
|
||||||
$.ajax({
|
$.ajax({
|
||||||
data: {
|
data: {
|
||||||
id: id
|
id: id
|
||||||
@ -427,7 +389,7 @@ if (!empty($Emp)) {
|
|||||||
url: "<?php echo base_url(); ?>getMaterialCode",
|
url: "<?php echo base_url(); ?>getMaterialCode",
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
console.log(json);
|
console.log(json);
|
||||||
$('#content').loader('hide');
|
// $('#content').loader('hide');
|
||||||
|
|
||||||
$("#MaterialCode").empty();
|
$("#MaterialCode").empty();
|
||||||
$("#MaterialCode").append(json.Material);
|
$("#MaterialCode").append(json.Material);
|
||||||
@ -435,8 +397,6 @@ if (!empty($Emp)) {
|
|||||||
// $("#UOM").val(json.UOM);
|
// $("#UOM").val(json.UOM);
|
||||||
if (id != 'SERVICE') {
|
if (id != 'SERVICE') {
|
||||||
$('#DisplayScheduleDiv').hide();
|
$('#DisplayScheduleDiv').hide();
|
||||||
$('#ServicePeriodOption').hide();
|
|
||||||
$('#NoServices').hide();
|
|
||||||
} else {
|
} else {
|
||||||
$('#DisplayScheduleDiv').show();
|
$('#DisplayScheduleDiv').show();
|
||||||
}
|
}
|
||||||
@ -465,7 +425,7 @@ if (!empty($Emp)) {
|
|||||||
if (id != '-1') {
|
if (id != '-1') {
|
||||||
|
|
||||||
if ((checkanswer != 'SERVICE')) {
|
if ((checkanswer != 'SERVICE')) {
|
||||||
$('#content').loader('show');
|
// $('#content').loader('show');
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
data: {
|
data: {
|
||||||
@ -475,7 +435,7 @@ if (!empty($Emp)) {
|
|||||||
type: "POST",
|
type: "POST",
|
||||||
url: "<?php echo base_url(); ?>getMaterialDetails",
|
url: "<?php echo base_url(); ?>getMaterialDetails",
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
$('#content').loader('hide');
|
// $('#content').loader('hide');
|
||||||
//alert(json.MatDetail);
|
//alert(json.MatDetail);
|
||||||
$("#Description").val(json.MatDetail[0]['MaterialName']);
|
$("#Description").val(json.MatDetail[0]['MaterialName']);
|
||||||
$("#UOM").val(json.MatDetail[0]['UOM']);
|
$("#UOM").val(json.MatDetail[0]['UOM']);
|
||||||
@ -498,7 +458,6 @@ if (!empty($Emp)) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
var index = '1';
|
var index = '1';
|
||||||
var userid = '';
|
|
||||||
|
|
||||||
function removeHiddenRows(rowcount) {
|
function removeHiddenRows(rowcount) {
|
||||||
var step;
|
var step;
|
||||||
@ -512,35 +471,17 @@ if (!empty($Emp)) {
|
|||||||
$("#UOM" + step).remove();
|
$("#UOM" + step).remove();
|
||||||
$("#Quantity" + step).remove();
|
$("#Quantity" + step).remove();
|
||||||
index = '1';
|
index = '1';
|
||||||
userid = '';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script type="text/html" id="tempList">
|
|
||||||
<tr id="<%=index%>">
|
|
||||||
<td align="left"><%=index%></td>
|
|
||||||
<td align="left"><%=MaterialCode%></td>
|
|
||||||
|
|
||||||
<td align="left"><%=MaterialName%></td>
|
|
||||||
|
|
||||||
<td align="left"><%=UOM%></td>
|
|
||||||
|
|
||||||
<td align="left"><%=Quantity%></td>
|
|
||||||
<td>
|
|
||||||
<a class="a_tag_link" data-target='#edit-req-modal' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#edit-req-modal"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <%=MaterialCode%> Material details"></i> </a> <a class="a_tag_link" href='#' onclick="Deleterow(index)" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del"><span class="glyphicon glyphicon-trash"></span></a>
|
|
||||||
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</script>
|
|
||||||
<script>
|
<script>
|
||||||
function validateBeforeAdd() {
|
function validateBeforeAdd() {
|
||||||
// var isChecked = $('#IsOpenOrder').is(':checked');
|
// var isChecked = $('#IsOpenOrder').is(':checked');
|
||||||
// isChecked ? $('#Quantity').val(0).prop('readonly', true).prop('required', false)
|
// isChecked ? $('#Quantity').val(0).prop('readonly', true).prop('required', false)
|
||||||
// : $('#Quantity').val('').prop('readonly', false).prop('required', true);
|
// : $('#Quantity').val('').prop('readonly', false).prop('required', true);
|
||||||
|
|
||||||
if ($("option:selected", $("#RequestType")).val() == '-1') {
|
if ($("#RequestType").val() == '-1') {
|
||||||
alert('Please select the Request Type ');
|
alert('Please select the Request Type ');
|
||||||
$("#RequestType").focus();
|
$("#RequestType").focus();
|
||||||
return false;
|
return false;
|
||||||
@ -548,13 +489,7 @@ if (!empty($Emp)) {
|
|||||||
alert('Please select the Cost center');
|
alert('Please select the Cost center');
|
||||||
$("#CostCenter").focus();
|
$("#CostCenter").focus();
|
||||||
return false;
|
return false;
|
||||||
}
|
} else {
|
||||||
// else if( isExceed == '1')
|
|
||||||
// {
|
|
||||||
// alert('You dont have available Budget Amount. You cant raise new Requisition');
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
else {
|
|
||||||
$('#add-req-modal').modal('show');
|
$('#add-req-modal').modal('show');
|
||||||
$('#otherDescription').hide();
|
$('#otherDescription').hide();
|
||||||
}
|
}
|
||||||
@ -589,14 +524,14 @@ if (!empty($Emp)) {
|
|||||||
var servicePeriod = '';
|
var servicePeriod = '';
|
||||||
noOfService = '';
|
noOfService = '';
|
||||||
}
|
}
|
||||||
$('#content').loader('show');
|
// $('#content').loader('show');
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
data: $('.requistion').serialize() + "&serviceSchedule=" + serviceSchedule + "&servicePeriod=" + servicePeriod + "&noOfService=" + noOfService + "&ID=" + id,
|
data: $('.requistion').serialize() + "&serviceSchedule=" + serviceSchedule + "&servicePeriod=" + servicePeriod + "&noOfService=" + noOfService + "&ID=" + id,
|
||||||
url: "<?php echo base_url() ?>addNewRequisition",
|
url: "<?php echo base_url() ?>addNewRequisition",
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
if (data) {
|
if (data) {
|
||||||
$('#content').loader('hide');
|
// $('#content').loader('hide');
|
||||||
alert(data);
|
alert(data);
|
||||||
$('#txtRowCount').val('');
|
$('#txtRowCount').val('');
|
||||||
$('#txtDeletedRow').val('');
|
$('#txtDeletedRow').val('');
|
||||||
@ -626,13 +561,7 @@ if (!empty($Emp)) {
|
|||||||
} else if ($("#txtRowCount").val().length < 1) {
|
} else if ($("#txtRowCount").val().length < 1) {
|
||||||
alert('Please Add Line Item');
|
alert('Please Add Line Item');
|
||||||
return false;
|
return false;
|
||||||
}
|
} else {
|
||||||
// else if(isExceed == 1)
|
|
||||||
// {
|
|
||||||
// alert('You dont have Budget and You cant Raise New Requisition');
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
else {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -680,7 +609,6 @@ if (!empty($Emp)) {
|
|||||||
var quantity = $("#Quantity").val();
|
var quantity = $("#Quantity").val();
|
||||||
var materialdescription = $('#otherD').val();
|
var materialdescription = $('#otherD').val();
|
||||||
|
|
||||||
//alert(materialdescription)
|
|
||||||
|
|
||||||
$('#MaterialCode option[value=' + materialCode + ']').remove();
|
$('#MaterialCode option[value=' + materialCode + ']').remove();
|
||||||
|
|
||||||
@ -692,26 +620,31 @@ if (!empty($Emp)) {
|
|||||||
|
|
||||||
index = parseInt(index) + 1;
|
index = parseInt(index) + 1;
|
||||||
|
|
||||||
var template = jQuery("#tempList").html();
|
var rowHtml = `<tr id="${temp}">
|
||||||
|
<td align="left">${temp}</td>
|
||||||
|
<td align="left">${materialCode}</td>
|
||||||
|
<td align="left">${materialName}</td>
|
||||||
|
<td align="left">${uom}</td>
|
||||||
|
<td align="left">${quantity}</td>
|
||||||
|
<td>
|
||||||
|
<a
|
||||||
|
data-id="${temp}"
|
||||||
|
data-userid="${temp}"
|
||||||
|
data-toggle="modal"
|
||||||
|
href="#edit-req-modal"
|
||||||
|
class="edit-modal-trigger">
|
||||||
|
<i class="ri-pencil-fill" data-toggle="tooltip" title="Click here to view/Edit the ${materialCode} Material details"></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<a href='#' onclick="Deleterow(${temp})" class="link" data-id="${temp}" data-userid="${temp}" id="Del">
|
||||||
|
<span class="ri-delete-bin-7-fill"></span>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
`;
|
||||||
|
|
||||||
|
// Append the HTML to the table body
|
||||||
if (materialdescription == '') {
|
$('#tempAppend').append(rowHtml);
|
||||||
$('#tempAppend').append(_.template(template, {
|
|
||||||
index: temp,
|
|
||||||
MaterialCode: materialCode,
|
|
||||||
MaterialName: materialName,
|
|
||||||
UOM: uom,
|
|
||||||
Quantity: quantity
|
|
||||||
}));
|
|
||||||
} else {
|
|
||||||
$('#tempAppend').append(_.template(template, {
|
|
||||||
index: temp,
|
|
||||||
MaterialCode: materialCode,
|
|
||||||
MaterialName: materialdescription,
|
|
||||||
UOM: uom,
|
|
||||||
Quantity: quantity
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
var theForm = $(".requistion");
|
var theForm = $(".requistion");
|
||||||
|
|
||||||
@ -723,9 +656,7 @@ if (!empty($Emp)) {
|
|||||||
|
|
||||||
$('#txtRowCount').val(temp);
|
$('#txtRowCount').val(temp);
|
||||||
$('#add-req-modal').modal('hide');
|
$('#add-req-modal').modal('hide');
|
||||||
toastr.success('Line Item Added!', 'Success');
|
// toastr.success('Line Item Added!', 'Success');
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -752,19 +683,20 @@ if (!empty($Emp)) {
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
$("#edit-req-modal").on("shown.bs.modal", function(e) {
|
$(document).ready(function() {
|
||||||
userid = $(e.relatedTarget).data('userid');
|
$("#edit-req-modal").on("shown.bs.modal", function(e) {
|
||||||
// alert(userid);
|
var $triggerElement = $(e.relatedTarget);
|
||||||
var tr = document.getElementById(userid);
|
var userid = $triggerElement.data('userid');
|
||||||
var cellval = tr.cells;
|
var $tr = $('#' + userid);
|
||||||
//alert(x[1].innerHTML);
|
var $cells = $tr.find('td');
|
||||||
$('#EditMaterialCode').val(cellval[1].innerHTML);
|
$('#EditMaterialCode').val($cells.eq(1).text());
|
||||||
$('#EditDescription').val(cellval[2].innerHTML);
|
$('#EditDescription').val($cells.eq(2).text());
|
||||||
$('#EditUOM').val(cellval[3].innerHTML);
|
$('#EditUOM').val($cells.eq(3).text());
|
||||||
$('#EditQuantity').val(cellval[4].innerHTML);
|
$('#EditQuantity').val($cells.eq(4).text());
|
||||||
|
$('#Edituserid').val(userid);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
|
||||||
<script>
|
|
||||||
$('.EditClick').click(function() {
|
$('.EditClick').click(function() {
|
||||||
var editqty = parseInt(document.getElementById('EditQuantity').value);
|
var editqty = parseInt(document.getElementById('EditQuantity').value);
|
||||||
if (isNaN(editqty) || editqty < 1) {
|
if (isNaN(editqty) || editqty < 1) {
|
||||||
@ -773,28 +705,28 @@ if (!empty($Emp)) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($('#EditQuantity').val() != '') {
|
if ($('#EditQuantity').val() != '') {
|
||||||
|
|
||||||
|
var edituserid = $("#Edituserid").val();
|
||||||
var editMaterialCode = $("#EditMaterialCode").val();
|
var editMaterialCode = $("#EditMaterialCode").val();
|
||||||
var editDescription = $("#EditDescription").val();
|
var editDescription = $("#EditDescription").val();
|
||||||
var editUOM = $('#EditUOM').val();
|
var editUOM = $('#EditUOM').val();
|
||||||
var editQuantity = $('#EditQuantity').val();
|
var editQuantity = $('#EditQuantity').val();
|
||||||
|
|
||||||
var tr = document.getElementById(userid);
|
var tr = $('#' + edituserid);
|
||||||
var cellval = tr.cells;
|
var cells = tr.find('td');
|
||||||
cellval[1].innerHTML = editMaterialCode;
|
cells.eq(1).text(editMaterialCode);
|
||||||
cellval[2].innerHTML = editDescription;
|
cells.eq(2).text(editDescription);
|
||||||
cellval[3].innerHTML = editUOM;
|
cells.eq(3).text(editUOM);
|
||||||
cellval[4].innerHTML = editQuantity;
|
cells.eq(4).text(editQuantity);
|
||||||
|
|
||||||
$('#MaterialCode' + userid).val(editMaterialCode);
|
$('#MaterialCode' + edituserid).val(editMaterialCode);
|
||||||
$('#Description' + userid).val(editDescription);
|
$('#Description' + edituserid).val(editDescription);
|
||||||
$('#UOM' + userid).val(editUOM);
|
$('#UOM' + edituserid).val(editUOM);
|
||||||
$('#Quantity' + userid).val(editQuantity);
|
$('#Quantity' + edituserid).val(editQuantity);
|
||||||
|
|
||||||
$('#edit-req-modal').modal('hide');
|
$('#edit-req-modal').modal('hide');
|
||||||
toastr.success('Line Item Updated!', 'Success');
|
// toastr.success('Line Item Updated!', 'Success');
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -831,14 +763,14 @@ if (!empty($Emp)) {
|
|||||||
var servicePeriod = '';
|
var servicePeriod = '';
|
||||||
var noOfService = '';
|
var noOfService = '';
|
||||||
}
|
}
|
||||||
$('#content').loader('show');
|
// $('#content').loader('show');
|
||||||
$.ajax({
|
$.ajax({
|
||||||
data: $('.requistion').serialize() + "&serviceSchedule=" + serviceSchedule + "&servicePeriod=" + servicePeriod + "&noOfService=" + noOfService + "&ID=" + id,
|
data: $('.requistion').serialize() + "&serviceSchedule=" + serviceSchedule + "&servicePeriod=" + servicePeriod + "&noOfService=" + noOfService + "&ID=" + id,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "<?php echo base_url() ?>addNewRequisition",
|
url: "<?php echo base_url() ?>addNewRequisition",
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
if (data) {
|
if (data) {
|
||||||
$('#content').loader('hide');
|
// $('#content').loader('hide');
|
||||||
alert(data);
|
alert(data);
|
||||||
$('#txtRowCount').val('');
|
$('#txtRowCount').val('');
|
||||||
$('#txtDeletedRow').val('');
|
$('#txtDeletedRow').val('');
|
||||||
@ -874,12 +806,8 @@ if (!empty($Emp)) {
|
|||||||
<script>
|
<script>
|
||||||
$("#ScheduleType").change(function() {
|
$("#ScheduleType").change(function() {
|
||||||
if ($('#ScheduleType').val().trim() != 'Recurring') {
|
if ($('#ScheduleType').val().trim() != 'Recurring') {
|
||||||
$('#ServicePeriodOption').hide();
|
|
||||||
$('#NoServices').hide();
|
|
||||||
$('#ServiceNo').val('');
|
$('#ServiceNo').val('');
|
||||||
} else {
|
} else {
|
||||||
$('#ServicePeriodOption').hide();
|
|
||||||
$('#NoServices').hide();
|
|
||||||
$('#ServiceNo').val(1);
|
$('#ServiceNo').val(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -87,28 +87,18 @@ span.highlight {
|
|||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="page-title-box page-title-box-alt">
|
<div class="page-title-box page-title-box-alt">
|
||||||
<h4 class="page-title">Requisition Listing</h4>
|
<h4 class="page-title">Requisition Listing</h4>
|
||||||
|
<?php if($DraftCount == 0) { ?>
|
||||||
|
<a class="btn btn-success" href="<?php echo base_url(); ?>RequisitionForm">Raise New Requisition</a>
|
||||||
|
<?php } ?>
|
||||||
|
<?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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php if($DraftCount > 0 ) {?><p style="text-align: center;">
|
|
||||||
<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="row" style="margin-top: -63px;">
|
|
||||||
<div class="col-md-12 text-left">
|
|
||||||
<div class="form-group row">
|
|
||||||
<div class="col-md-3"></div>
|
|
||||||
<div class="col-md-5 text-right"></div>
|
|
||||||
<div class="col-md-4 text-right">
|
|
||||||
<?php if($DraftCount == 0) { ?>
|
|
||||||
<a class="btn btn-success" href="<?php echo base_url(); ?>RequisitionForm">Raise New Requisition</a>
|
|
||||||
<?php } ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user