PRODUCT SPEC MASTER CHANGED AND PRODUCTION ISSUES FIXED
This commit is contained in:
parent
a34d74c50a
commit
8ef801e084
@ -76,36 +76,49 @@ class quality extends BaseController
|
||||
$type = $this->input->post('param4');
|
||||
|
||||
|
||||
|
||||
//echo $type;die();
|
||||
$createdby = $this->session->userdata ( 'userId' );
|
||||
$phpdata = json_decode($jsondata);
|
||||
$phpdata = json_decode($jsondata,true);
|
||||
$total = 0;
|
||||
// echo $product .'-'. $customer;
|
||||
// print_r($phpdata);die();
|
||||
//print_r($phpdata);die();
|
||||
|
||||
foreach($phpdata as $data)
|
||||
{
|
||||
$name = $data->Name;
|
||||
$name = $data['Name'];
|
||||
$name = strtoupper($name);
|
||||
$uom = $data->UOM;
|
||||
$min = $data->Min;
|
||||
$max = $data->Max;
|
||||
$temp = $data->Temp;
|
||||
$sub = $data->SubCatagory;
|
||||
$uom = $data['UOM'];
|
||||
$min = $data['Min'];
|
||||
$max = $data['Max'];
|
||||
$temp = $data['Temp'];
|
||||
$rawsandtest = $data['Raw Sand Test'];
|
||||
|
||||
$res = 0;
|
||||
if(strtolower($rawsandtest) == 'yes')
|
||||
{
|
||||
$rawsandtest = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$rawsandtest = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$isExist = $this->quality_model->checkExist($product,$customer,$name,$type);
|
||||
//echo $isExist[0]->count;die();
|
||||
if($isExist[0]->count == 0)
|
||||
{
|
||||
|
||||
$tostore = array('customer_id'=>$customer,'product_id'=>$product,'testtype'=>$name,'uom'=>$uom,'min'=>$min,'max'=>$max,'temp'=>$temp,'type'=>$type,'subtype' => $sub,'created_by'=>$createdby);
|
||||
$tostore = array('customer_id'=>$customer,'product_id'=>$product,'testtype'=>$name,'uom'=>$uom,'min'=>$min,'max'=>$max,'temp'=>$temp,'type'=>$type,'subtype' => $rawsandtest,'created_by'=>$createdby);
|
||||
//print_r($tostore);
|
||||
$res = $this->quality_model->addSpecMast($tostore);
|
||||
//echo 'i'.$res;
|
||||
}
|
||||
else if($isExist[0]->count == 1)
|
||||
{
|
||||
|
||||
$tostore = array('uom'=>$uom,'min'=>$min,'max'=>$max,'temp'=>$temp,'type'=>$type,'subtype'=>$sub,'updated_by'=>$createdby);
|
||||
$tostore = array('uom'=>$uom,'min'=>$min,'max'=>$max,'temp'=>$temp,'type'=>$type,'subtype' => $rawsandtest,'updated_by'=>$createdby);
|
||||
$res = $this->quality_model->updateSpecMast($tostore,$product,$customer,$name,$type);
|
||||
//echo 'u'.$res;
|
||||
}
|
||||
@ -223,6 +236,7 @@ class quality extends BaseController
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$res = $this->quality_model->getSpecifications($productid,$customerid);
|
||||
}
|
||||
|
||||
|
||||
@ -85,19 +85,20 @@ class Quality_model extends CI_Model
|
||||
$this->db->from('T_Prodcut_Specification_Master');
|
||||
$this->db->join('ip_products','T_Prodcut_Specification_Master.product_id=ip_products.product_id');
|
||||
$this->db->join('ip_clients','T_Prodcut_Specification_Master.customer_id=ip_clients.client_id');
|
||||
$this->db->group_by('T_Prodcut_Specification_Master.type,product_id,customer_id');
|
||||
$result = $this->db->get();
|
||||
return $result->result();
|
||||
$this->db->group_by('product_id,customer_id,T_Prodcut_Specification_Master.type');
|
||||
$result = $this->db->get();
|
||||
return $result->result();
|
||||
}
|
||||
|
||||
function getAllspecInward()
|
||||
{
|
||||
{
|
||||
$this->db->select('T_Prodcut_Specification_Master.*,T_MaterialMaster.MaterialCode,T_MaterialMaster.MaterialName,T_SupplierDetailsN.SupplierID,T_SupplierDetailsN.SupplierName,count(*) as count');
|
||||
$this->db->from('T_Prodcut_Specification_Master');
|
||||
$this->db->join('T_MaterialMaster','T_Prodcut_Specification_Master.product_id=T_MaterialMaster.MaterialCode');
|
||||
$this->db->join('T_SupplierDetailsN','T_Prodcut_Specification_Master.customer_id=T_SupplierDetailsN.SupplierID');
|
||||
$this->db->group_by('product_id,customer_id');
|
||||
$result = $this->db->get();
|
||||
return $result->result();
|
||||
$this->db->group_by('product_id,customer_id,T_Prodcut_Specification_Master.type');
|
||||
$result = $this->db->get();
|
||||
return $result->result();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ background-color:#ada5d2 ;
|
||||
$products = array(-1=>'Select Product');
|
||||
foreach($productsoutward as $rec)
|
||||
{
|
||||
$products[$rec->product_id] = $rec->product_name;
|
||||
$products[$rec->product_id] = $rec->product_description;
|
||||
}
|
||||
|
||||
$customers = array(-1=>'Select Customer');
|
||||
|
||||
@ -26,7 +26,7 @@ background-color:#ada5d2 ;
|
||||
$products = array(-1=>'Select Product');
|
||||
foreach($productsoutward as $rec)
|
||||
{
|
||||
$products[$rec->product_id] = $rec->product_name;
|
||||
$products[$rec->product_id] = $rec->product_description;
|
||||
}
|
||||
|
||||
$customers = array(-1=>'Select Customer');
|
||||
|
||||
@ -10,6 +10,7 @@ th{
|
||||
|
||||
|
||||
$products2=array(-1=>'Select Products');
|
||||
$mtypes = array(-1=>'Select Type','INWARD'=>'INWARD','OUTWARD'=>'OUTWARD','INPROCESS'=>'INPROCESS','RESINBATCHCARD'=>'RESIN BATCH CARD');
|
||||
|
||||
foreach($productsoutward as $product)
|
||||
{
|
||||
@ -65,15 +66,19 @@ foreach($customersinward as $customer)
|
||||
<div class="box-body">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-1">
|
||||
<div class="col-md-2">
|
||||
|
||||
<?php echo form_dropdown('name="product"',$mtypes,set_value('product',$mtypes[-1]),'id="mtype"' ,'class="form-control select2','style="width:200px;"');?>
|
||||
</div>
|
||||
<!-- <div class="col-md-1">
|
||||
|
||||
<input type="radio" value="1" name="type" id="OutWard" onclick="changeType(this.value);"/> OutWard
|
||||
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
<input type="radio" value="0" name="type" id="Inward" onclick="changeType(this.value);"/> InWard
|
||||
</div>
|
||||
<div class="col-md-4" id='outwardarea' >
|
||||
</div> -->
|
||||
<div class="col-md-4" id='outwardarea'>
|
||||
|
||||
<div class="col-md-6">
|
||||
|
||||
@ -85,7 +90,7 @@ foreach($customersinward as $customer)
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-4" id='inwardarea' >
|
||||
<div class="col-md-4" id='inwardarea'>
|
||||
|
||||
<div class="col-md-6">
|
||||
|
||||
@ -97,17 +102,7 @@ foreach($customersinward as $customer)
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-2" id="inprocessarea">
|
||||
<div class="col-md-1">
|
||||
<?php
|
||||
$data = array('id'=> 'inprocess','value' => 'accept','checked' => false);
|
||||
echo form_checkbox($data);
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
<div class="col-md-1">InProcess</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<input type="button" id="addspec" class="btn btn-primary" value = "Add New Specification">
|
||||
</div>
|
||||
@ -123,7 +118,8 @@ foreach($customersinward as $customer)
|
||||
<th>Min</th>
|
||||
<th>Max</th>
|
||||
<th>Temp</th>
|
||||
<th>SubCatagory</th>
|
||||
<th>Raw Sand Test</th>
|
||||
|
||||
<!-- <th>Action</th> -->
|
||||
|
||||
|
||||
@ -188,6 +184,8 @@ foreach($customersinward as $customer)
|
||||
<td style="text-align:center;padding:10px;;">Sub Category</td><td style="padding:10px;"><input type="checkbox" name="subcata" id="subcata"/> Raw Sand Test</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
</table>
|
||||
</center>
|
||||
</form>
|
||||
@ -231,7 +229,8 @@ foreach($customersinward as $customer)
|
||||
<td align="right" contenteditable="true"><%=Min%></td>
|
||||
<td align="right" contenteditable="true"><%=Max%></td>
|
||||
<td align="right" contenteditable="true"><%=Temp%></td>
|
||||
<td align="center" contenteditable="true"><%=SubCatagory%></td>
|
||||
<td align="center" contenteditable="true"><%=RawSandTest%></td>
|
||||
|
||||
<!-- <td align="center" contenteditable="false"><a data-target='#specmodel' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#specmodel"> </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> <!-- <i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit <%=index%> "></i> -->
|
||||
</script>
|
||||
@ -240,66 +239,68 @@ foreach($customersinward as $customer)
|
||||
|
||||
$(document).ready(function() {
|
||||
//alert();
|
||||
$('#OutWard').attr('checked','true');
|
||||
$('#inwardarea').hide();
|
||||
$('#outwardarea').show();
|
||||
// $('#OutWard').attr('checked','true');
|
||||
$('#inwardarea').hide();
|
||||
$('#outwardarea').show();
|
||||
});
|
||||
|
||||
function changeType(v)
|
||||
{
|
||||
var val = v
|
||||
// alert(val);
|
||||
if(val == 0)
|
||||
{
|
||||
//alert('InWard');
|
||||
$('#inwardarea').show();
|
||||
$('#outwardarea').hide();
|
||||
$('#inprocessarea').hide();
|
||||
// function changeType(v)
|
||||
// {
|
||||
// var val = v
|
||||
// // alert(val);
|
||||
// if(val == 0)
|
||||
// {
|
||||
// //alert('InWard');
|
||||
// $('#inwardarea').show();
|
||||
// $('#outwardarea').hide();
|
||||
// $('#inprocessarea').hide();
|
||||
|
||||
}
|
||||
else if(val == 1)
|
||||
{
|
||||
//alert('OutWard');
|
||||
$('#inwardarea').hide();
|
||||
$('#outwardarea').show();
|
||||
$('#inprocessarea').show();
|
||||
}
|
||||
}
|
||||
// }
|
||||
// else if(val == 1)
|
||||
// {
|
||||
// //alert('OutWard');
|
||||
// $('#inwardarea').hide();
|
||||
// $('#outwardarea').show();
|
||||
// $('#inprocessarea').show();
|
||||
// }
|
||||
// }
|
||||
$('#product').select2();
|
||||
$('#customer').select2();
|
||||
$('#productinward').select2();
|
||||
$('#customerinward').select2();
|
||||
$('#mtype').select2();
|
||||
|
||||
$('#addspec').click(function(){
|
||||
|
||||
if($('#OutWard').is(':checked'))
|
||||
|
||||
if($('#mtype').val() != -1 )
|
||||
{
|
||||
var product = $('#product').val();
|
||||
var customer = $('#customer').val();
|
||||
if(product == -1 || customer == -1)
|
||||
if($('#mtype').val() == 'INWARD')
|
||||
{
|
||||
alert('Please Select Product and Customer.');
|
||||
if($('#productinward').val() == -1 || $('#customerinward').val() == -1 )
|
||||
{
|
||||
alert('Please Select Product and Supplier..!');
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#specmodel").modal('show');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#specmodel').modal('show');
|
||||
if($('#product').val() == -1 || $('#customer').val() == -1 )
|
||||
{
|
||||
alert('Please Select Product and Customer..!');
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#specmodel").modal('show');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else//if($('#InWard').is(':checked'))
|
||||
else
|
||||
{
|
||||
//alert('kj');
|
||||
var productinward = $('#productinward').val();
|
||||
var customerinward = $('#customerinward').val();
|
||||
if(productinward == -1 || customerinward == -1)
|
||||
{
|
||||
alert('Please Select Product and Customer.');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#specmodel').modal('show');
|
||||
}
|
||||
//alert('kj');
|
||||
alert('Please Select Master Type..!');
|
||||
}
|
||||
|
||||
|
||||
@ -315,8 +316,10 @@ function addNewRow()
|
||||
var min = $('#min').val();
|
||||
var max = $('#max').val();
|
||||
var temp = $('#temp').val();
|
||||
var sub = 0;
|
||||
if($('#subcata').is(':checked')){ sub = 1;}
|
||||
var sub = 'NO';
|
||||
|
||||
if($('#subcata').is(':checked')){ sub = 'YES';}
|
||||
|
||||
|
||||
if(sname == '' || uom =='' || min == '' || max == '' || temp == '')
|
||||
{
|
||||
@ -328,7 +331,7 @@ function addNewRow()
|
||||
var rows = document.getElementById('testspecifications').rows.length;
|
||||
//rows = rows-1;
|
||||
var template = jQuery("#addList").html();
|
||||
$('#specAppend').append(_.template(template,{index:rows,Name:sname,UOM:uom,Min:min,Max:max,Temp:temp,SubCatagory:sub}));
|
||||
$('#specAppend').append(_.template(template,{index:rows,Name:sname,UOM:uom,Min:min,Max:max,Temp:temp,RawSandTest:sub}));
|
||||
|
||||
$('#spname').val('');
|
||||
$('#uom').val('');
|
||||
@ -336,6 +339,7 @@ function addNewRow()
|
||||
$('#max').val('');
|
||||
$('#temp').val('');
|
||||
$('#subcata').attr('checked',false);
|
||||
|
||||
document.getElementById('spname').focus();
|
||||
}
|
||||
}
|
||||
@ -343,9 +347,10 @@ function addNewRow()
|
||||
$("#specmodel").on("shown.bs.modal", function(e) {
|
||||
|
||||
$('#sub').hide();
|
||||
if($('#OutWard').is(':checked') && $('#inprocess').is(':checked'))
|
||||
if($('#mtype').val() == 'INPROCESS')
|
||||
{
|
||||
$('#sub').show();
|
||||
|
||||
}
|
||||
else{ $('#sub').hide(); }
|
||||
document.getElementById('spname').focus();
|
||||
@ -355,30 +360,25 @@ $("#specmodel").on("shown.bs.modal", function(e) {
|
||||
function getAllData()
|
||||
{
|
||||
|
||||
var type = '';
|
||||
var type = $('#mtype').val();
|
||||
var product = '';
|
||||
var customer = '';
|
||||
// var subtype = '';
|
||||
if($('#OutWard').is(':checked'))
|
||||
{
|
||||
type = 'OUTWARD';
|
||||
if($('#inprocess').is(':checked'))
|
||||
if(type != -1)
|
||||
{
|
||||
if(type == 'INWARD')
|
||||
{
|
||||
type = 'INPROCESS';
|
||||
// if($('#subcata').is(':checked'))
|
||||
// {
|
||||
// subtype = 1;
|
||||
// }
|
||||
product = $('#productinward').val();
|
||||
customer = $('#customerinward').val();
|
||||
|
||||
}
|
||||
product = $('#product').val();
|
||||
customer = $('#customer').val();
|
||||
}
|
||||
else
|
||||
{
|
||||
type = 'INWARD';
|
||||
product = $('#productinward').val();
|
||||
customer = $('#customerinward').val();
|
||||
}
|
||||
else
|
||||
{
|
||||
product = $('#product').val();
|
||||
customer = $('#customer').val();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -414,6 +414,31 @@ $("#specmodel").on("shown.bs.modal", function(e) {
|
||||
}
|
||||
}
|
||||
|
||||
$('#mtype').change(function(){
|
||||
|
||||
var curstatus = $('#mtype').val();
|
||||
//alert(curstatus);
|
||||
if(curstatus == -1)
|
||||
{
|
||||
alert("Please Select Master Type...!");
|
||||
}
|
||||
else
|
||||
{
|
||||
if(curstatus == 'INWARD')
|
||||
{
|
||||
$('#inwardarea').show();
|
||||
$('#outwardarea').hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#inwardarea').hide();
|
||||
$('#outwardarea').show();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
function DeleteRow(rowid)
|
||||
{
|
||||
|
||||
@ -313,9 +313,10 @@ $(document).ready(function(){
|
||||
|
||||
var productid = $('#productid').val();
|
||||
var customerid = $('#customerid').val();
|
||||
var type = 'OUTWARD';
|
||||
$('#content').loader('show');
|
||||
$.ajax({
|
||||
data:{param1:productid,param2:customerid},
|
||||
data:{param1:productid,param2:customerid,param3:type},
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>quality/getAllSpecforReport",
|
||||
success:function(data) {
|
||||
|
||||
@ -82,7 +82,8 @@ foreach($specifications as $s)
|
||||
<th>Min</th>
|
||||
<th>Max</th>
|
||||
<th>Temp</th>
|
||||
<th style="width:100px;">SubCatagory</th>
|
||||
<th style="width:100px;">Raw Sand Test</th>
|
||||
|
||||
<th>Action</th>
|
||||
|
||||
|
||||
@ -93,12 +94,14 @@ foreach($specifications as $s)
|
||||
$index = 0;
|
||||
if(!empty($specifications))
|
||||
{
|
||||
|
||||
foreach($specifications as $data)
|
||||
{
|
||||
//print_r($data);
|
||||
$index++;
|
||||
?>
|
||||
<tr id="<?php echo $index;?>"> <td><?php echo $data->testtype?></td> <td contenteditable="true"><?php echo $data->uom?></td> <td contenteditable="true" style="text-align:right;"><?php echo $data->min?></td> <td contenteditable="true" style="text-align:right;"><?php echo $data->max?></td> <td contenteditable="true" style="text-align:right;"><?php if(!empty($data->temp)){ echo $data->temp; } else { echo "-"; }?></td>
|
||||
<td <?php if($type == 'INPROCESS'){ echo "contenteditable='true'";}else {echo "contenteditable='false'";}?> style="text-align:center;"><?php echo $data->subtype;?> <td style="text-align:center;"><a href='#' onclick = "DeleteRow(this.parentNode.parentNode.id);"> <span class="glyphicon glyphicon-trash"></span></td> </tr>
|
||||
<td <?php if($type == 'INPROCESS'){ echo "contenteditable='true'";}else {echo "contenteditable='false'";}?> style="text-align:center;"><?php if($data->subtype == 0){echo 'NO';}else {echo 'YES';}?> <td style="text-align:center;"><a href='#' onclick = "DeleteRow(this.parentNode.parentNode.id);"> <span class="glyphicon glyphicon-trash"></span></td> </tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
@ -148,6 +151,9 @@ foreach($specifications as $s)
|
||||
<tr id="sub">
|
||||
<td style="text-align:center;padding:10px;;">Sub Category</td><td style="padding:10px;"><input type="checkbox" name="subcata" id="subcata"/> Raw Sand Test</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
</table>
|
||||
</center>
|
||||
</form>
|
||||
@ -194,7 +200,8 @@ foreach($specifications as $s)
|
||||
<td align="right" contenteditable="true"><%=Min%></td>
|
||||
<td align="right" contenteditable="true"><%=Max%></td>
|
||||
<td align="right" contenteditable="true"><%=Temp%></td>
|
||||
<td align="center" contenteditable="true"><%=SubCatagory%></td>
|
||||
<td align="center" contenteditable="true"><%=RawSandTest%></td>
|
||||
|
||||
<td align="center" contenteditable="false"> <a href='#' onclick = "DeleteRow(<%=index%>)" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a></td>
|
||||
</tr> <!-- <i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit <%=index%> "></i> -->
|
||||
</script>
|
||||
@ -224,8 +231,10 @@ function addNewRow()
|
||||
var min = $('#min').val();
|
||||
var max = $('#max').val();
|
||||
var temp = $('#temp').val();
|
||||
var sub = 0;
|
||||
if($('#subcata').is(':checked')){sub = 1;}
|
||||
var sub = 'NO';
|
||||
|
||||
if($('#subcata').is(':checked')){ sub = 'YES';}
|
||||
|
||||
if(sname == '' || uom =='' || min == '' || max == '' || temp == '')
|
||||
{
|
||||
alert('Please Enter all specification');
|
||||
@ -237,7 +246,7 @@ function addNewRow()
|
||||
//rows = rows-1;
|
||||
//alert(rows);
|
||||
var template = jQuery("#addList").html();
|
||||
$('#specAppend').append(_.template(template,{index:rows,Name:sname,UOM:uom,Min:min,Max:max,Temp:temp,SubCatagory:sub}));
|
||||
$('#specAppend').append(_.template(template,{index:rows,Name:sname,UOM:uom,Min:min,Max:max,Temp:temp,RawSandTest:sub}));
|
||||
|
||||
$('#spname').val('');
|
||||
$('#uom').val('');
|
||||
@ -255,8 +264,9 @@ $("#specmodel").on("shown.bs.modal", function(e) {
|
||||
if(type == 'INPROCESS')
|
||||
{
|
||||
$('#sub').show();
|
||||
|
||||
}
|
||||
else {$('#sub').hide();}
|
||||
else {$('#sub').hide(); }
|
||||
document.getElementById('spname').focus();
|
||||
|
||||
});
|
||||
@ -340,6 +350,24 @@ $("#specmodel").on("shown.bs.modal", function(e) {
|
||||
//document.getElementById('#testspecifications').removeChild(document.getElementById('#'+rowid));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$('#resbatch').change(function(){
|
||||
|
||||
var curstatus = $('#resbatch').is(':checked');
|
||||
if(curstatus == true)
|
||||
{
|
||||
document.getElementById('resintext').textContent='YES';
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
document.getElementById('resintext').textContent='NO';
|
||||
}
|
||||
//else{ $('#resintext').val('NO'); }
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user