mater master issue fixes
This commit is contained in:
parent
d39cd272c5
commit
e8efd970e2
@ -14,6 +14,7 @@ class rawmaterialdetails_model extends CI_Model
|
|||||||
{
|
{
|
||||||
$this->db->select('*');
|
$this->db->select('*');
|
||||||
$this->db->from('T_MaterialMaster');
|
$this->db->from('T_MaterialMaster');
|
||||||
|
$this->db->where('IsActive',1 );
|
||||||
$query = $this->db->get();
|
$query = $this->db->get();
|
||||||
$result = $query->result();
|
$result = $query->result();
|
||||||
return $result;
|
return $result;
|
||||||
|
|||||||
@ -74,10 +74,7 @@ if(!empty($materialDetails))
|
|||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<!-- general form elements -->
|
<!-- general form elements -->
|
||||||
<div class="box box-primary">
|
<div class="box box-primary">
|
||||||
<!--<div class="box-header">
|
|
||||||
<center> <h3 class="box-title"></h3></center>
|
|
||||||
</div> -->
|
|
||||||
<!-- /.box-header -->
|
|
||||||
<!-- form start -->
|
<!-- form start -->
|
||||||
|
|
||||||
<form role="form" action="<?php echo base_url() ?>rawmaterialdetails/editRawmaterial" method="post" id="editRawmaterial" role="form">
|
<form role="form" action="<?php echo base_url() ?>rawmaterialdetails/editRawmaterial" method="post" id="editRawmaterial" role="form">
|
||||||
@ -104,22 +101,6 @@ if(!empty($materialDetails))
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="MaterialType">Material Type</label>
|
<label for="MaterialType">Material Type</label>
|
||||||
<input type="text" class="form-control" readonly id="MaterialType" name="MaterialType" value="<?php echo $MaterialType;?>">
|
<input type="text" class="form-control" readonly id="MaterialType" name="MaterialType" value="<?php echo $MaterialType;?>">
|
||||||
<!-- <select class="form-control select2" id="MaterialType" name="MaterialType" readonly="true">
|
|
||||||
|
|
||||||
<option value="<?php echo $MaterialType;?> "><?php echo $MaterialType;?></option>
|
|
||||||
<?php
|
|
||||||
if(!empty($materialType))
|
|
||||||
{
|
|
||||||
foreach ($materialType as $MID)
|
|
||||||
{
|
|
||||||
?>
|
|
||||||
<option value="<?php echo $MID->ConfigValue ?>"><?php echo $MID->ConfigValue ?></option>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</select>
|
|
||||||
-->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -130,33 +111,15 @@ if(!empty($materialDetails))
|
|||||||
<input type="text" class="form-control required " required id="MaterialCategory" name="MaterialCategory" value="<?php echo $MaterialCategory;?>" maxlength="255">
|
<input type="text" class="form-control required " required id="MaterialCategory" name="MaterialCategory" value="<?php echo $MaterialCategory;?>" maxlength="255">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!-- <div class="form-group">
|
|
||||||
<label for="MaterialCategory">Material Category</label><font color="Red">*</font>
|
|
||||||
<input type="text" class="form-control required " required id="MaterialCategory" name="MaterialCategory" value="<?php echo $MaterialCategory;?>" onChange="changeTextBox();" maxlength="255">
|
|
||||||
|
|
||||||
< <select class="form-control readonly select2" id="MaterialCategory" name="MaterialCategory" onChange="changeTextBox();">
|
|
||||||
<option value="<?php echo $MaterialCategory;?> "><?php echo $MaterialCategory;?></option>
|
|
||||||
<?php
|
|
||||||
if(!empty($materialCategory))
|
|
||||||
{
|
|
||||||
foreach ($materialCategory as $MC)
|
|
||||||
{
|
|
||||||
?>
|
|
||||||
<option value="<?php echo $MC->ConfigValue ?>"><?php echo $MC->ConfigValue ?></option>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</select>
|
|
||||||
-> <!- <input type='hidden' id='mchiddenfield' name='mchiddenfield' value=''> ->
|
|
||||||
</div> -->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="UOM">Unit of Measurement</label><font color="Red">*</font>
|
<label for="UOM">Unit of Measurement</label><font color="Red">*</font>
|
||||||
|
<!-- <select class="form-control select2 required " required id="UOM" name="UOM">
|
||||||
|
<option value=" ">Select UOM</option>
|
||||||
|
</select> -->
|
||||||
<select class="form-control required select2" id="UOM" name="UOM" onchange="changeTextBox();" >
|
<select class="form-control required select2" id="UOM" name="UOM" onchange="changeTextBox();" >
|
||||||
<option value="<?php echo $UOM;?>"><?php echo $UOM;?></option>
|
<option value="<?php echo $UOM;?>"><?php echo $UOM;?></option>
|
||||||
<?php
|
<?php
|
||||||
@ -182,69 +145,38 @@ if(!empty($materialDetails))
|
|||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="assetcode">Asset Code</label>
|
<label for="assetcode">Asset Code</label>
|
||||||
<select class="form-control select2" id="Assetcode" name="Assetcode" disabled="disabled" placeholder="Select ">
|
<select class="form-control select2" id="Assetcode" name="Assetcode" disabled="disabled" >
|
||||||
<option value="<?php echo $Assetcode;?>"><?php echo $Assetcode;?></option>
|
<option value=" ">Select Asset Code</option>
|
||||||
<?php
|
|
||||||
if(!empty($assetcode))
|
|
||||||
{
|
|
||||||
|
|
||||||
foreach($assetcode as $AC)
|
|
||||||
{
|
|
||||||
?>
|
|
||||||
<option value="<?php echo $AC->AssetCode ?>"><?php echo $AC->AssetCode ?> - <?php echo $AC->AssetName ?></option>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</select>
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="costcenter">Cost Center Code</label>
|
<label for="costcenter">Cost Center Code</label>
|
||||||
<select class="form-control select2" id="Costcenter" name="Costcenter" disabled="disabled">
|
<select class="form-control select2" id="Costcenter" name="Costcenter" disabled="disabled" >
|
||||||
<option><?php echo $costcenter;?></option>
|
<option value=" ">Select Cost Center Code</option>
|
||||||
<?php
|
|
||||||
if(!empty($costcentercode))
|
|
||||||
{
|
|
||||||
foreach ($costcentercode as $CC)
|
|
||||||
{
|
|
||||||
?>
|
|
||||||
<option value="<?php echo $CC->CostCenterCode ?>"><?php echo $CC->CostCenterCode ?> - <?php echo $CC->CostCenterName?></option>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="conversionfactor">Conversion Factor</label>
|
<label for="conversionfactor">Conversion Factor</label>
|
||||||
<input type="text" class="form-control" id="conversionfactor" name="conversionfactor" maxlength="255" value="<?php echo $conversionfactor;?>" onkeypress="return isNumberKey(event);">
|
<input type="text" class="form-control" id="conversionfactor" name="conversionfactor" maxlength="255" value="<?php echo $conversionfactor;?>" onkeypress="return isNumberKey(event);">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="conversionfactorUOM">Conversion Factor UOM</label>
|
<label for="conversionfactorUOM">Conversion Factor UOM</label>
|
||||||
<select class="form-control select2" id="conversionfactorUOM" name="conversionfactorUOM">
|
<select class="form-control select2" id="conversionfactorUOM" name="conversionfactorUOM" >
|
||||||
<option value="<?php echo $conversionfactorUOM;?>"><?php echo $conversionfactorUOM;?></option>
|
<option value=" ">Select Conversion Factor UOM</option>
|
||||||
<?php
|
|
||||||
if(!empty($cfUOM))
|
|
||||||
{
|
|
||||||
foreach ($cfUOM as $cfuom)
|
|
||||||
{
|
|
||||||
?>
|
|
||||||
<option value="<?php echo $cfuom->ConfigValue; ?>"><?php echo $cfuom->ConfigValue ?>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@ -277,35 +209,7 @@ if(!empty($materialDetails))
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4">
|
|
||||||
<?php
|
|
||||||
$this->load->helper('form');
|
|
||||||
$error = $this->session->flashdata('error');
|
|
||||||
if($error)
|
|
||||||
{
|
|
||||||
?>
|
|
||||||
<div class="alert alert-danger alert-dismissable">
|
|
||||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
|
||||||
<?php echo $this->session->flashdata('error'); ?>
|
|
||||||
</div>
|
|
||||||
<?php } ?>
|
|
||||||
<?php
|
|
||||||
$success = $this->session->flashdata('success');
|
|
||||||
if($success)
|
|
||||||
{
|
|
||||||
?>
|
|
||||||
<div class="alert alert-success alert-dismissable">
|
|
||||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
|
||||||
<?php echo $this->session->flashdata('success'); ?>
|
|
||||||
</div>
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12">
|
|
||||||
<?php echo validation_errors('<div class="alert alert-danger alert-dismissable">', ' <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></div>'); ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
@ -314,17 +218,16 @@ if(!empty($materialDetails))
|
|||||||
<script>
|
<script>
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
|
||||||
//$("#MaterialType").select2();
|
|
||||||
//$("#MaterialCategory").select2();
|
|
||||||
$("#UOM").select2();
|
$("#UOM").select2();
|
||||||
$("#Assetcode").select2();
|
$("#Assetcode").select2();
|
||||||
$("#Costcenter").select2();
|
$("#Costcenter").select2();
|
||||||
$("#conversionfactorUOM").select2();
|
$("#conversionfactorUOM").select2();
|
||||||
|
/** ---- auto search code -------- */
|
||||||
$('#MaterialCategory').autocomplete({
|
$('#MaterialCategory').autocomplete({
|
||||||
|
|
||||||
onSearchStart: function (query) {
|
onSearchStart: function (query) {
|
||||||
//alert(query);
|
|
||||||
$('#MaterialCategory').autocomplete("option", "minLength", 0);
|
$('#MaterialCategory').autocomplete("option", "minLength", 0);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -335,34 +238,61 @@ $(document).ready(function(){
|
|||||||
var selectedvalue = $('input[name=MaterialCategory]').val();
|
var selectedvalue = $('input[name=MaterialCategory]').val();
|
||||||
if(selectedvalue=='Spares')
|
if(selectedvalue=='Spares')
|
||||||
{
|
{
|
||||||
//alert('good');
|
|
||||||
$('#Assetcode').prop('disabled', false);
|
$('#Assetcode').prop('disabled', false);
|
||||||
$('#Costcenter').prop('disabled', false);
|
$('#Costcenter').prop('disabled', false);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
// // alert('bad');
|
|
||||||
$('#Assetcode').prop('disabled', 'disabled');
|
$('#Assetcode').prop('disabled', 'disabled');
|
||||||
$('#Costcenter').prop('disabled', 'disabled');
|
$('#Costcenter').prop('disabled', 'disabled');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/** ---- Value are append to dropdown -------- */
|
||||||
|
//var uom = [];
|
||||||
|
var ass = [];
|
||||||
|
var cos = [];
|
||||||
|
var con = [];
|
||||||
|
|
||||||
|
//uom = <?php echo json_encode($UOMList) ?>;
|
||||||
|
ass = <?php echo json_encode($assetcode)?>;
|
||||||
|
cos = <?php echo json_encode($costcentercode)?>;
|
||||||
|
con = <?php echo json_encode($cfUOM)?>;
|
||||||
|
|
||||||
|
// $.each(uom,function(u,um){
|
||||||
|
// $("#UOM").append( $('<option></option>').val(um.ConfigValue).html(um.ConfigValue));
|
||||||
|
// });
|
||||||
|
|
||||||
|
// $('#UOM option[value="<?php echo $UOM?>"]').prop('selected', true);
|
||||||
|
|
||||||
|
$.each(ass,function(a,as){
|
||||||
|
$("#Assetcode").append( $('<option></option>').val(as.AssetCode).html(as.AssetCode+'-'+as.AssetName));
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#Assetcode option[value="<?php echo $Assetcode?>"]').prop('selected', true);
|
||||||
|
|
||||||
|
$.each(cos,function(c,cc){
|
||||||
|
$("#Costcenter").append( $('<option></option>').val(cc.CostCenterCode).html(cc.CostCenterCode+'-'+cc.CostCenterName));
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#Costcenter option[value="<?php echo $costcenter?>"]').prop('selected', true);
|
||||||
|
|
||||||
|
$.each(con,function(cn,con){
|
||||||
|
$("#conversionfactorUOM").append( $('<option></option>').val(con.ConfigValue).html(con.ConfigValue));
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#conversionfactorUOM option[value="<?php echo $conversionfactorUOM?>"]').prop('selected', true);
|
||||||
|
|
||||||
|
/** ---- if spares part matereial means -------- */
|
||||||
var x = $("#MaterialCategory").val() == 'Spares';
|
var x = $("#MaterialCategory").val() == 'Spares';
|
||||||
if(x)
|
if(x)
|
||||||
{
|
{
|
||||||
document.getElementById("Assetcode").disabled=false;
|
$('#Assetcode').prop('disabled', false);
|
||||||
document.getElementById("Costcenter").disabled=false;
|
$('#Costcenter').prop('disabled', false);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
//alert('i am a else part');
|
|
||||||
document.getElementById("Assetcode").disabled=true;
|
|
||||||
document.getElementById("Costcenter").disabled=true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
function onlyAlphabets(evt) {
|
function onlyAlphabets(evt) {
|
||||||
@ -390,13 +320,6 @@ function isNumberKey(evt)
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// $(function() {
|
|
||||||
// $('#MaterialCategory').change(function() {
|
|
||||||
// var x = $(this).val();
|
|
||||||
// alert(x);
|
|
||||||
// $('#mchiddenfield').val(x);
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
|
|
||||||
function onlyAlphabets(evt) {
|
function onlyAlphabets(evt) {
|
||||||
var charCode;
|
var charCode;
|
||||||
@ -415,22 +338,6 @@ function onlyAlphabets(evt) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function changeTextBox() {
|
|
||||||
//alert('changeTextBox entered');
|
|
||||||
var x = document.getElementById("MaterialCategory");
|
|
||||||
if(x.value=='Spares')
|
|
||||||
{
|
|
||||||
//alert('i am an if part');
|
|
||||||
document.getElementById("Assetcode").disabled=false;
|
|
||||||
document.getElementById("Costcenter").disabled=false;}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//alert('i am a else part');
|
|
||||||
document.getElementById("Assetcode").disabled=true;
|
|
||||||
document.getElementById("Costcenter").disabled=true;}
|
|
||||||
}
|
|
||||||
|
|
||||||
$('#MaterialName').change(function() {
|
$('#MaterialName').change(function() {
|
||||||
|
|
||||||
var materialname = $('#MaterialName').val();
|
var materialname = $('#MaterialName').val();
|
||||||
|
|||||||
@ -367,7 +367,7 @@ th{
|
|||||||
//alert(first);
|
//alert(first);
|
||||||
var second =parseInt(document.getElementById('today_salary'+id).textContent);
|
var second =parseInt(document.getElementById('today_salary'+id).textContent);
|
||||||
//alert(second);
|
//alert(second);
|
||||||
var cal =first/second;
|
var cal =second/first;
|
||||||
|
|
||||||
var cals =(cal).toFixed(0);
|
var cals =(cal).toFixed(0);
|
||||||
|
|
||||||
@ -490,7 +490,7 @@ th{
|
|||||||
function cal(){
|
function cal(){
|
||||||
var a= $("#pton").val();
|
var a= $("#pton").val();
|
||||||
var b= $("#today_salary").val();
|
var b= $("#today_salary").val();
|
||||||
var calc=Math.round(a/b);
|
var calc=Math.round(b/a);
|
||||||
//alert(calc);
|
//alert(calc);
|
||||||
$("#calc").val(calc) ;
|
$("#calc").val(calc) ;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user