stock updation
This commit is contained in:
parent
80560ca704
commit
e9290d81a1
@ -1358,18 +1358,38 @@ class batchcard extends BaseController
|
||||
|
||||
|
||||
|
||||
// function displaying_stockvalues()
|
||||
// {
|
||||
// $MaterialCode = $this->input->post('MaterialCode');
|
||||
// $date = $this->input->post('date');
|
||||
|
||||
// $Qtyarray = $this->batchcard_model->GettotalQty($MaterialCode,$date);
|
||||
// //print_r($Qtyarray);
|
||||
// $obj=json_encode($Qtyarray);
|
||||
// echo $obj;
|
||||
|
||||
// }
|
||||
|
||||
|
||||
function displaying_stockvalues()
|
||||
{
|
||||
$MaterialCode = $this->input->post('MaterialCode');
|
||||
$date = $this->input->post('date');
|
||||
$AdjustmentId = $this->input->post('AdjustmentId');
|
||||
$historydetais = $this->batchcard_model->GetMaterialHistory($AdjustmentId);
|
||||
$SupplierID='';
|
||||
// if(!empty($historydetais))
|
||||
// {
|
||||
// foreach($historydetais as $hi)
|
||||
// {
|
||||
// $SupplierID = $hi->SupplierID;
|
||||
// }
|
||||
// }
|
||||
|
||||
$Qtyarray = $this->batchcard_model->GettotalQty($MaterialCode,$date);
|
||||
//print_r($Qtyarray);
|
||||
$obj=json_encode($Qtyarray);
|
||||
$obj=json_encode($historydetais);
|
||||
echo $obj;
|
||||
|
||||
}
|
||||
|
||||
|
||||
function addNewMaterialHistory()
|
||||
{
|
||||
$supplier = $this->input->post('supplier');
|
||||
@ -1717,6 +1737,7 @@ class batchcard extends BaseController
|
||||
|
||||
$copmaterial = $this->input->post('Copmaterialcode'.$i);
|
||||
$codate =$this->input->post('CopDate'.$i);
|
||||
$cddt = date("Y-m-d", strtotime($codate) );
|
||||
$copqty = $this->input->post('CopQty'.$i);
|
||||
$copvalue = $this->input->post('Copprice'.$i);
|
||||
$coplineId = $this->input->post('CopId'.$i);
|
||||
@ -1728,7 +1749,7 @@ class batchcard extends BaseController
|
||||
else
|
||||
{
|
||||
|
||||
$coparray =array('FPId'=>$FPID,'MaterialCode'=>$copmaterial,'CoDate'=>$codate,'Quantity'=>$copqty,'Price'=>$copvalue,'CreatedBy'=>$createdby,'CreatedDate'=>$createddt);
|
||||
$coparray =array('FPId'=>$FPID,'MaterialCode'=>$copmaterial,'CoDate'=>$cddt,'Quantity'=>$copqty,'Price'=>$copvalue,'CreatedBy'=>$createdby,'CreatedDate'=>$createddt);
|
||||
|
||||
$checkpackid=$this->batchcard_model->Getcopid($coplineId);
|
||||
// print_r($coparray);
|
||||
|
||||
3064
application/controllers/user.php
Executable file → Normal file
3064
application/controllers/user.php
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
@ -722,6 +722,21 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
}
|
||||
|
||||
|
||||
function GetMaterialHistory($AdjustmentId)
|
||||
{
|
||||
$this->db->select('T_Material_Adjustment.*,SupplierName,MaterialName');
|
||||
$this->db->from('T_Material_Adjustment');
|
||||
$this->db->join('T_SupplierDetailsN',"T_SupplierDetailsN.SupplierID=T_Material_Adjustment.SupplierID");
|
||||
$this->db->join('T_MaterialMaster',"T_MaterialMaster.MaterialCode=T_Material_Adjustment.MaterialCode");
|
||||
$this->db->where('T_Material_Adjustment.AdjustmentId',$AdjustmentId);
|
||||
$supp = $this->db->get();
|
||||
return $supp->result();
|
||||
|
||||
join("T_Machine_Master mm", "bm.Machine_Code = mm.Machine_Code", "left");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function AddmaterialAdjustment($adjustmentaarray)
|
||||
{
|
||||
|
||||
@ -82,11 +82,11 @@ $sql="select EmpID,CONCAT(FirstName,' ',LastName) as name FROM T_Employee_Detai
|
||||
// $sql="select EmpID,".$WH." from T_Attendance where Month_Year = ? and EmpID in (select EmpID from T_Attendance)" ;
|
||||
|
||||
$yes_date = date('Y-m-d',strtotime("-1 days"));
|
||||
$sql="select att.EmpID,".$WH.",a.FirstName from T_Attendance as att
|
||||
$sql="select att.EmpID,ifnull(".$WH.",0)".$WH.",a.FirstName from T_Attendance as att
|
||||
join T_Employee_Details as a on a.EmpID= att.EmpID
|
||||
where Month_Year = ? and att.EmpID in (select EmpID from T_Attendance) and ".$WH."=0 and date(a.Created_date) <= '".$yes_date."' and isActive=1";
|
||||
where Month_Year = ? and att.EmpID in (select EmpID from T_Attendance) and date(a.Created_date) <= '".$yes_date."' and isActive=1";
|
||||
$query = $this->db->query($sql,array($date));
|
||||
//print_r($query->result_array());die;
|
||||
// print_r($query->result_array());die;
|
||||
//echo count($query->result());
|
||||
return $query->result_array();
|
||||
}
|
||||
|
||||
@ -11,6 +11,16 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<style type="text/css">
|
||||
.select2
|
||||
{
|
||||
width: 100% ! important;
|
||||
}
|
||||
.num{
|
||||
text-align:right;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
|
||||
@ -38,6 +48,27 @@ $(function() {
|
||||
//maxDate : 'now',
|
||||
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
|
||||
});
|
||||
|
||||
|
||||
$("#DEPTFN").select2();
|
||||
|
||||
$("#rawmaterialcode").select2();
|
||||
//$("#Editrawmaterialcode").select2();
|
||||
$("#rawSupplier").select2();
|
||||
//$("#EditrawSupplier").select2();
|
||||
|
||||
$("#consumaterialcode").select2();
|
||||
//$("#Editconsumaterialcode").select2();
|
||||
$("#consuSupplier").select2();
|
||||
//$("#EditconsuSupplier").select2();
|
||||
|
||||
$("#packumaterialcode").select2();
|
||||
//$("#Editpackumaterialcode").select2();
|
||||
$("#packSupplier").select2();
|
||||
//$("#EditpackSupplier").select2();
|
||||
|
||||
$("#coproduct_id").select2();
|
||||
//$("#Editcoproduct_id").select2();
|
||||
|
||||
|
||||
});
|
||||
@ -227,7 +258,7 @@ $(function() {
|
||||
<label>Quantity</label>
|
||||
<div>
|
||||
<?php
|
||||
$data = array('name' => 'rawqty','value' => set_value('rawqty'),'id'=>'rawqty', 'class' => 'form-control');
|
||||
$data = array('name' => 'rawqty','value' => set_value('rawqty'),'id'=>'rawqty', 'class' => 'form-control', 'onchange'=>'rawqtycheck()');
|
||||
echo form_input($data);
|
||||
?>
|
||||
|
||||
@ -339,7 +370,7 @@ $(function() {
|
||||
<label>Quantity</label>
|
||||
<div>
|
||||
<?php
|
||||
$data = array('name' => 'Editrawqty','value' => set_value('Editrawqty'),'id'=>'Editrawqty', 'class' => 'form-control');
|
||||
$data = array('name' => 'Editrawqty','value' => set_value('Editrawqty'),'id'=>'Editrawqty', 'class' => 'form-control' , 'onchange'=>'editrawqtycheck()');
|
||||
echo form_input($data);
|
||||
?>
|
||||
|
||||
@ -479,7 +510,7 @@ $(function() {
|
||||
<label>Quantity</label>
|
||||
<div>
|
||||
<?php
|
||||
$data = array('name' => 'consuqty','value' => set_value('consuqty'),'id'=>'consuqty', 'class' => 'form-control');
|
||||
$data = array('name' => 'consuqty','value' => set_value('consuqty'),'id'=>'consuqty', 'class' => 'form-control','onchange'=>'consuqtycheck()');
|
||||
echo form_input($data);
|
||||
?>
|
||||
|
||||
@ -588,7 +619,7 @@ $(function() {
|
||||
<label>Quantity</label>
|
||||
<div>
|
||||
<?php
|
||||
$data = array('name' => 'Editconsuqty','value' => set_value('Editconsuqty'),'id'=>'Editconsuqty', 'class' => 'form-control');
|
||||
$data = array('name' => 'Editconsuqty','value' => set_value('Editconsuqty'),'id'=>'Editconsuqty', 'class' => 'form-control','onchange'=>'Editconsuqtycheck()');
|
||||
echo form_input($data);
|
||||
?>
|
||||
|
||||
@ -732,7 +763,7 @@ $(function() {
|
||||
<label>Quantity</label>
|
||||
<div>
|
||||
<?php
|
||||
$data = array('name' => 'packqty','value' => set_value('packqty'),'id'=>'packqty', 'class' => 'form-control');
|
||||
$data = array('name' => 'packqty','value' => set_value('packqty'),'id'=>'packqty', 'class' => 'form-control','onchange'=>"packqtycheck()");
|
||||
echo form_input($data);
|
||||
?>
|
||||
|
||||
@ -841,7 +872,7 @@ $(function() {
|
||||
<label>Quantity</label>
|
||||
<div>
|
||||
<?php
|
||||
$data = array('name' => 'Editpackqty','value' => set_value('Editpackqty'),'id'=>'Editpackqty', 'class' => 'form-control');
|
||||
$data = array('name' => 'Editpackqty','value' => set_value('Editpackqty'),'id'=>'Editpackqty', 'class' => 'form-control','onchange'=>"Editpackqtycheck()");
|
||||
echo form_input($data);
|
||||
?>
|
||||
|
||||
@ -1055,7 +1086,7 @@ $(function() {
|
||||
<div class="col-md-6">
|
||||
<label>Date</label>
|
||||
<?php
|
||||
$data = array('name' => 'EditCopDate','value' => set_value('EditCopDate',$CurrentDate),'id'=>'EditCopDate', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;');
|
||||
$data = array('name' => 'EditCopDate','value' => set_value('EditCopDate'),'id'=>'EditCopDate', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
@ -1256,13 +1287,13 @@ function addHidden(theForm, key, value)
|
||||
$('.addraw').click(function()
|
||||
{
|
||||
|
||||
if($('#rawmaterialcode').val()=='0')
|
||||
if($('#rawmaterialcode').val()<='0')
|
||||
{
|
||||
alert("Please Select Material");
|
||||
return false;
|
||||
}
|
||||
|
||||
else if($('#rawSupplier').val()=='0')
|
||||
else if($('#rawSupplier').val()<='0')
|
||||
{
|
||||
alert("Please Select Supplier");
|
||||
return false;
|
||||
@ -1275,13 +1306,18 @@ else if($('#rawSupplier').val()=='0')
|
||||
var rawprice = $('#rawprice').val();
|
||||
var rawsuppliername = rawSupplier.options[rawSupplier.selectedIndex].text;
|
||||
var temp = index
|
||||
var rawmaterialname ="";
|
||||
// var rawmaterialname = rawmaterialcode.options[rawmaterialcode.selectedIndex].text;
|
||||
//alert(rawsuppliername);
|
||||
|
||||
var e = document.getElementById("rawmaterialcode");
|
||||
var rawmaterialname = e.options[e.selectedIndex].text;
|
||||
|
||||
index = parseInt(index)+1;
|
||||
var template = jQuery("#rawmateriallist").html();
|
||||
|
||||
// alert(template)
|
||||
$('#rawappend').append(_.template(template,{index:temp,Material:rawmaterialcode,Supplier:rawsuppliername,Quantity:rawQty,Price:rawprice}));
|
||||
$('#rawappend').append(_.template(template,{index:temp,Material:rawmaterialname,Supplier:rawsuppliername,Quantity:rawQty,Price:rawprice}));
|
||||
|
||||
var theForm = $(".final_product");
|
||||
|
||||
@ -1291,7 +1327,9 @@ else if($('#rawSupplier').val()=='0')
|
||||
addHidden(theForm,"rawprice"+temp,rawprice);
|
||||
addHidden(theForm,"type"+temp,"Raw Material");
|
||||
|
||||
$('#rawmaterialcode').val('');
|
||||
$('#rawmaterialcode').val("0");
|
||||
|
||||
$('rawmaterialcode').select2("val", null);
|
||||
$('#rawSupplier').val('');
|
||||
$('#rawqty').val('');
|
||||
$('#rawprice').val('')
|
||||
@ -1319,16 +1357,36 @@ $("#EditItem").on("shown.bs.modal", function(e)
|
||||
|
||||
$('.EditItem').click(function()
|
||||
{
|
||||
if($('#Editrawmaterialcode').val()<="0")
|
||||
{
|
||||
alert("Please Select Material");
|
||||
return false;
|
||||
}
|
||||
else if($('#EditrawSupplier').val()<='0')
|
||||
{
|
||||
alert("Please Select Supplier");
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
var rawmaterialcode= $('#Editrawmaterialcode').val();
|
||||
var rawSupplierID = $('#EditrawSupplier').val();
|
||||
var rawQty = $('#Editrawqty').val();
|
||||
var rawprice = $('#Editrawprice').val();
|
||||
|
||||
var e = document.getElementById("Editrawmaterialcode");
|
||||
var rawmaterialname = e.options[e.selectedIndex].text;
|
||||
|
||||
var f = document.getElementById("EditrawSupplier");
|
||||
var rawsuppliername = f.options[f.selectedIndex].text;
|
||||
|
||||
var tr= document.getElementById(userid);
|
||||
var cellval = tr.cells;
|
||||
|
||||
cellval[1].innerHTML = rawmaterialcode;
|
||||
cellval[2].innerHTML = rawSupplierID;
|
||||
cellval[1].innerHTML = rawmaterialname;
|
||||
cellval[2].innerHTML = rawsuppliername;
|
||||
cellval[3].innerHTML = rawQty;
|
||||
cellval[4].innerHTML = rawprice;
|
||||
|
||||
@ -1337,6 +1395,8 @@ $('.EditItem').click(function()
|
||||
$('#rawSupplierID'+userid).val(rawSupplierID);
|
||||
$('#rawQty'+userid).val(rawQty);
|
||||
$('#rawprice'+userid).val(rawprice);
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
@ -1344,13 +1404,13 @@ $('.EditItem').click(function()
|
||||
|
||||
$('.rootaddClick').click(function()
|
||||
{
|
||||
if($('#consumaterialcode').val()=='0')
|
||||
if($('#consumaterialcode').val()<='0')
|
||||
{
|
||||
alert("Please Select Material");
|
||||
return false;
|
||||
}
|
||||
|
||||
else if($('#consuSupplier').val()=='0')
|
||||
else if($('#consuSupplier').val()<='0')
|
||||
{
|
||||
alert("Please Select Suppliers");
|
||||
return false;
|
||||
@ -1366,11 +1426,18 @@ $('.rootaddClick').click(function()
|
||||
var consuQty = $('#consuqty').val();
|
||||
var consuprice = $('#consuprice').val();
|
||||
var rawsuppliername = consuSupplier.options[consuSupplier.selectedIndex].text;
|
||||
|
||||
var g = document.getElementById("consumaterialcode");
|
||||
var consumaterialname = g.options[g.selectedIndex].text;
|
||||
|
||||
|
||||
|
||||
|
||||
var temp = rootindex
|
||||
rootindex = parseInt(rootindex)+1;
|
||||
var template = jQuery("#consumable").html();
|
||||
//alert(template)
|
||||
$('#consuappend').append(_.template(template,{rootindex:temp,Material:consumaterialcode,Supplier:rawsuppliername,Quantity:consuQty,Price:consuprice}));
|
||||
$('#consuappend').append(_.template(template,{rootindex:temp,Material:consumaterialname,Supplier:rawsuppliername,Quantity:consuQty,Price:consuprice}));
|
||||
|
||||
var theForm = $(".final_product");
|
||||
|
||||
@ -1408,11 +1475,33 @@ $('.rootEditItem').click(function()
|
||||
{
|
||||
|
||||
//alert()
|
||||
|
||||
if($('#Editconsumaterialcode').val()<='0')
|
||||
{
|
||||
alert("Please Select Material");
|
||||
return false;
|
||||
}
|
||||
|
||||
else if($('#EditconsuSupplier').val()<='0')
|
||||
{
|
||||
alert("Please Select Supplier");
|
||||
return false;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
var editconsumaterialcode= $('#Editconsumaterialcode').val();
|
||||
var editconsuSupplierID = $('#EditconsuSupplier').val();
|
||||
var editconsuQty = $('#Editconsuqty').val();
|
||||
var editrawprice = $('#Editconsuprice').val();
|
||||
|
||||
|
||||
var h = document.getElementById("Editconsumaterialcode");
|
||||
var editconsumaterialname = h.options[h.selectedIndex].text;
|
||||
|
||||
var i = document.getElementById("EditconsuSupplier");
|
||||
var editconsusuppliername = i.options[i.selectedIndex].text;
|
||||
|
||||
// var tr= document.getElementById(rootuserid);
|
||||
// var cellval = tr.cells;
|
||||
// cellval[1].innerHTML = editconsumaterialcode;
|
||||
@ -1420,8 +1509,8 @@ $('.rootEditItem').click(function()
|
||||
// cellval[3].innerHTML = editconsuQty;
|
||||
// cellval[4].innerHTML = editrawprice;
|
||||
|
||||
document.getElementById('consumaterial'+rootuserid).innerHTML = editconsumaterialcode;
|
||||
document.getElementById('consusuppliername'+rootuserid).innerHTML = editconsuSupplierID;
|
||||
document.getElementById('consumaterial'+rootuserid).innerHTML = editconsumaterialname;
|
||||
document.getElementById('consusuppliername'+rootuserid).innerHTML = editconsusuppliername;
|
||||
document.getElementById('consuQuantiy'+rootuserid).innerHTML = editconsuQty;
|
||||
document.getElementById('consumaterialPrice'+rootuserid).innerHTML = editrawprice;
|
||||
|
||||
@ -1429,19 +1518,22 @@ $('.rootEditItem').click(function()
|
||||
$('#consumeSupplierID'+rootuserid).val(editconsuSupplierID);
|
||||
$('#consumeQty'+rootuserid).val(editconsuQty);
|
||||
$('#consumeprice'+rootuserid).val(editrawprice);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('.CounteraddClick').click(function()
|
||||
{
|
||||
|
||||
if($('#packumaterialcode').val()=='0')
|
||||
if($('#packumaterialcode').val()<='0')
|
||||
{
|
||||
alert("Please Select Material");
|
||||
return true;
|
||||
}
|
||||
|
||||
else if($('#packSupplier').val()=='0')
|
||||
else if($('#packSupplier').val()<='0')
|
||||
{
|
||||
alert("Please Select Supplier");
|
||||
return true;
|
||||
@ -1455,11 +1547,16 @@ $('.CounteraddClick').click(function()
|
||||
var packQty = $('#packqty').val();
|
||||
var packprice = $('#packprice').val();
|
||||
var packsuppliername = packSupplier.options[packSupplier.selectedIndex].text;
|
||||
|
||||
var j = document.getElementById("packumaterialcode");
|
||||
var packmaterilalname = j.options[j.selectedIndex].text;
|
||||
|
||||
|
||||
var temp = counterindex
|
||||
counterindex = parseInt(counterindex)+1;
|
||||
var template = jQuery("#packable").html();
|
||||
//alert(template)
|
||||
$('#packappend').append(_.template(template,{counterindex:temp,Material:packmaterialcode,Supplier:packsuppliername,Quantity:packQty,Price:packprice}));
|
||||
$('#packappend').append(_.template(template,{counterindex:temp,Material:packmaterilalname,Supplier:packsuppliername,Quantity:packQty,Price:packprice}));
|
||||
|
||||
var theForm = $(".final_product");
|
||||
|
||||
@ -1499,11 +1596,36 @@ $("#EditCounter").on("shown.bs.modal", function(e)
|
||||
$('.CounterEditItem').click(function()
|
||||
{
|
||||
|
||||
if($('#Editpackumaterialcode').val()<='0')
|
||||
{
|
||||
alert('Please Select Material');
|
||||
return false;
|
||||
}
|
||||
|
||||
else if($('#EditpackSupplier').val()<='0')
|
||||
{
|
||||
alert('Please Select Supplier');
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
else
|
||||
{
|
||||
var editpackmaterialcode= $('#Editpackumaterialcode').val();
|
||||
var editpackSupplierID = $('#EditpackSupplier').val();
|
||||
var editpackQty = $('#Editpackqty').val();
|
||||
var editpackprice = $('#Editpackprice').val();
|
||||
var editpacksuppliername = EditpackSupplier.options[EditpackSupplier.selectedIndex].text;
|
||||
|
||||
|
||||
|
||||
var k = document.getElementById("Editpackumaterialcode");
|
||||
var editpackmaterilalname = k.options[k.selectedIndex].text;
|
||||
|
||||
|
||||
var l = document.getElementById("EditpackSupplier");
|
||||
var editpacksuppliernameee = l.options[l.selectedIndex].text;
|
||||
|
||||
|
||||
var tr= document.getElementById(cuserid);
|
||||
//var cellval = tr.cells;
|
||||
@ -1515,8 +1637,8 @@ $('.CounterEditItem').click(function()
|
||||
// cellval[4].innerHTML = editpackprice;
|
||||
|
||||
|
||||
document.getElementById('packmaterial'+cuserid).innerHTML = editpackmaterialcode;
|
||||
document.getElementById('packsuppliername'+cuserid).innerHTML = editpackSupplierID;
|
||||
document.getElementById('packmaterial'+cuserid).innerHTML = editpackmaterilalname;
|
||||
document.getElementById('packsuppliername'+cuserid).innerHTML = editpacksuppliernameee;
|
||||
document.getElementById('packQuantiy'+cuserid).innerHTML = editpackQty;
|
||||
document.getElementById('packmaterialPrice'+cuserid).innerHTML = editpackprice;
|
||||
|
||||
@ -1526,6 +1648,7 @@ $('.CounterEditItem').click(function()
|
||||
$('#packSupplierID'+cuserid).val(editpackSupplierID);
|
||||
$('#packQty'+cuserid).val(editpackQty);
|
||||
$('#packprice'+cuserid).val(editpackprice);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
@ -1534,7 +1657,7 @@ $('.CounterEditItem').click(function()
|
||||
$('.CoaddClick').click(function()
|
||||
{
|
||||
|
||||
if($('#coproduct_id').val()=='0')
|
||||
if($('#coproduct_id').val()<='0')
|
||||
{
|
||||
alert('Please Select Product');
|
||||
return false;
|
||||
@ -1548,11 +1671,16 @@ $('.CoaddClick').click(function()
|
||||
var copQty = $('#Coqty').val();
|
||||
var copprice = $('#Coprice').val();
|
||||
var copsuppliername = coproduct_id.options[coproduct_id.selectedIndex].text;
|
||||
|
||||
var m = document.getElementById("coproduct_id");
|
||||
var copproduct = m.options[m.selectedIndex].text;
|
||||
|
||||
|
||||
var temp = coproductindex
|
||||
coproductindex = parseInt(coproductindex)+1;
|
||||
var template = jQuery("#coproduct").html();
|
||||
//alert(copsuppliername)
|
||||
$('#coproductappend').append(_.template(template,{coproductindex:temp,Material:copsuppliername,Date:copDate,Quantity:copQty,Price:copprice}));
|
||||
$('#coproductappend').append(_.template(template,{coproductindex:temp,Material:copproduct,Date:copDate,Quantity:copQty,Price:copprice}));
|
||||
|
||||
var theForm = $(".final_product");
|
||||
|
||||
@ -1581,8 +1709,12 @@ $("#EditCoproduct").on("shown.bs.modal", function(e)
|
||||
|
||||
var tr= document.getElementById(cuserid);
|
||||
|
||||
|
||||
var coproductdate= $('#CopDate'+cuserid).val();
|
||||
//alert(coproductdate)
|
||||
var revdate = coproductdate.split("-").reverse().join("-");
|
||||
$('#Editcoproduct_id').val($('#Copmaterialcode'+cuserid).val());
|
||||
$('#EditCopDate').val($('#CopDate'+cuserid).val());
|
||||
$('#EditCopDate').val(revdate);
|
||||
$('#EditCoqty').val($('#CopQty'+cuserid).val());
|
||||
$('#EditCoprice').val($('#Copprice'+cuserid).val());
|
||||
|
||||
@ -1592,13 +1724,26 @@ $("#EditCoproduct").on("shown.bs.modal", function(e)
|
||||
|
||||
$('.CoEditItem').click(function()
|
||||
{
|
||||
|
||||
if($('#Editcoproduct_id').val()<='0')
|
||||
{
|
||||
alert('Please Select Product');
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
else{
|
||||
var editcoproductid = $('#Editcoproduct_id').val();
|
||||
var editcopdate = $('#EditCopDate').val();
|
||||
var newdate = editcopdate.split("-").reverse().join("-");
|
||||
var editcopqty = $('#EditCoqty').val();
|
||||
var editcopprice = $('#EditCoprice').val();
|
||||
var editcopproduct = Editcoproduct_id.options[Editcoproduct_id.selectedIndex].text;
|
||||
|
||||
|
||||
var n = document.getElementById("Editcoproduct_id");
|
||||
var editcopproduct = n.options[n.selectedIndex].text;
|
||||
|
||||
var tr= document.getElementById(cuserid);
|
||||
//var cellval = tr.cells;
|
||||
@ -1609,8 +1754,8 @@ $('.CoEditItem').click(function()
|
||||
// cellval[3].innerHTML = editcopqty;
|
||||
// cellval[4].innerHTML = editcopprice;
|
||||
|
||||
document.getElementById('Copmaterial'+cuserid).innerHTML = editcoproductid;
|
||||
document.getElementById('Copsuppliername'+cuserid).innerHTML = newdate;
|
||||
document.getElementById('Copmaterial'+cuserid).innerHTML = editcopproduct;
|
||||
document.getElementById('Copsuppliername'+cuserid).innerHTML = editcopdate;
|
||||
document.getElementById('CopQuantiy'+cuserid).innerHTML = editcopqty;
|
||||
document.getElementById('CopmaterialPrice'+cuserid).innerHTML = editcopprice;
|
||||
|
||||
@ -1618,6 +1763,8 @@ $('.CoEditItem').click(function()
|
||||
$('#CopDate'+cuserid).val(newdate);
|
||||
$('#CopQty'+cuserid).val(editcopqty);
|
||||
$('#Copprice'+cuserid).val(editcopprice);
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
@ -1692,7 +1839,9 @@ $('#EditrawSupplier').change(function()
|
||||
|
||||
|
||||
|
||||
|
||||
var rawresultqty = 0;
|
||||
var consuresultant = 0;
|
||||
var packresultant = 0;
|
||||
|
||||
|
||||
function ResultantQty(materialtype)
|
||||
@ -1773,17 +1922,19 @@ function ResultantQty(materialtype)
|
||||
// console.log(reduceqty)
|
||||
|
||||
var resultantqty = parseFloat(addqty)- parseFloat(reduceqty);
|
||||
|
||||
|
||||
//console.log(resultantqty);
|
||||
|
||||
if(isNaN(resultantqty))
|
||||
{
|
||||
$('#rawqty').val(0);
|
||||
rawresultqty = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$('#rawqty').val(resultantqty);
|
||||
rawresultqty = parseFloat(resultantqty);
|
||||
|
||||
}
|
||||
|
||||
@ -1867,15 +2018,18 @@ function ResultantQty(materialtype)
|
||||
});
|
||||
|
||||
var resultantqty = parseFloat(addqty)- parseFloat(reduceqty);
|
||||
|
||||
|
||||
if(isNaN(resultantqty))
|
||||
{
|
||||
$('#consuqty').val(0);
|
||||
consuresultant =0;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$('#consuqty').val(resultantqty);
|
||||
consuresultant = parseFloat(resultantqty);
|
||||
|
||||
}
|
||||
|
||||
@ -1965,11 +2119,13 @@ function ResultantQty(materialtype)
|
||||
if(isNaN(resultantqty))
|
||||
{
|
||||
$('#packqty').val(0);
|
||||
packresultant = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$('#packqty').val(resultantqty);
|
||||
$('#packqty').val(resultantqty);
|
||||
packresultant =parseFloat(resultantqty);
|
||||
|
||||
}
|
||||
|
||||
@ -2339,6 +2495,78 @@ else{
|
||||
}
|
||||
|
||||
|
||||
function rawqtycheck()
|
||||
{
|
||||
// alert(rawresultqty);
|
||||
|
||||
// var enterrawqty= $('#rawqty').val();
|
||||
// if(rawresultqty < enterrawqty)
|
||||
// {
|
||||
// alert("You are Exceeding the Stock Qtantity!! Avalable stock is"+rawresultqty);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
function editrawqtycheck()
|
||||
{
|
||||
//alert(rawresultqty);
|
||||
|
||||
// var editenterrawqty= $('#Editrawqty').val();
|
||||
// if(rawresultqty < editenterrawqty)
|
||||
// {
|
||||
// alert("You are Exceeding the Stock Qtantity!! Avalable stock is"+rawresultqty);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
function consuqtycheck()
|
||||
{
|
||||
// alert(rawresultqty);
|
||||
|
||||
// var enterconsuqty= $('#consuqty').val();
|
||||
// if(consuresultant < enterconsuqty)
|
||||
// {
|
||||
// alert("You are Exceeding the Stock Qtantity!! Avalable stock is"+consuresultant);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
function Editconsuqtycheck()
|
||||
{
|
||||
// var editenterconsuqty= $('#Editconsuqty').val();
|
||||
// if(consuresultant < editenterconsuqty)
|
||||
// {
|
||||
// alert("You are Exceeding the Stock Qtantity!! Avalable stock is"+consuresultant);
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
function packqtycheck()
|
||||
{
|
||||
// alert(rawresultqty);
|
||||
|
||||
// var enterpackqty= $('#packqty').val();
|
||||
// if(packresultant < enterpackqty)
|
||||
// {
|
||||
// alert("You are Exceeding the Stock Qtantity!! Avalable stock is"+packresultant);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
function Editpackqtycheck()
|
||||
{
|
||||
// var entereditpackqty = $('#Editpackqty').val();
|
||||
// if(packresultant < entereditpackqty)
|
||||
// {
|
||||
// alert("You are Exceeding the Stock Qtantity!! Avalable stock is"+packresultant);
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@ -260,7 +260,7 @@ $(function() {
|
||||
<label>Quantity</label>
|
||||
<div>
|
||||
<?php
|
||||
$data = array('name' => 'rawqty','value' => set_value('rawqty'),'id'=>'rawqty', 'class' => 'form-control');
|
||||
$data = array('name' => 'rawqty','value' => set_value('rawqty'),'id'=>'rawqty', 'class' => 'form-control','onchange'=>'rawqtycheck()');
|
||||
echo form_input($data);
|
||||
?>
|
||||
|
||||
@ -353,7 +353,7 @@ $(function() {
|
||||
<label>Quantity</label>
|
||||
<div>
|
||||
<?php
|
||||
$data = array('name' => 'Editrawqty','value' => set_value('Editrawqty'),'id'=>'Editrawqty', 'class' => 'form-control');
|
||||
$data = array('name' => 'Editrawqty','value' => set_value('Editrawqty'),'id'=>'Editrawqty', 'class' => 'form-control','onchange'=>'editrawqtycheck()');
|
||||
echo form_input($data);
|
||||
?>
|
||||
|
||||
@ -410,7 +410,7 @@ $(function() {
|
||||
$index= $index+1; ?>
|
||||
<tr id="rawmat<?php echo $index ; ?>">
|
||||
<td><?php echo $index;?></td>
|
||||
<td id="rawmaterialedit<?php echo $index?>"><?php echo $raw->MaterialCode?></td>
|
||||
<td id="rawmaterialedit<?php echo $index?>"><?php echo $raw->MaterialCode."-".$raw->MaterialName?></td>
|
||||
<!-- <td id="rawmaterialnameedit<?php echo $index?>"><?php echo $raw->MaterialName?></td> -->
|
||||
<td id="rawsuppliername<?php echo $index?>"><?php echo $raw->SupplierID."-".$raw->SupplierName?></td>
|
||||
<td id="rawQuantiy<?php echo $index?>"><?php echo $raw->Quantity;?></td>
|
||||
@ -420,6 +420,11 @@ $(function() {
|
||||
|
||||
<input type="hidden" name="<?php echo 'rawmaterialcode'.$index ?>" id="<?php echo 'rawmaterialcode'.$index ?>" value="<?php echo $raw->MaterialCode ; ?>" readonly/>
|
||||
|
||||
|
||||
<input type="hidden" name="<?php echo 'rawmaterialname'.$index ?>" id="<?php echo 'rawmaterialname'.$index ?>" value="<?php echo $raw->MaterialName ; ?>" readonly/>
|
||||
|
||||
|
||||
|
||||
<input type="hidden" name="<?php echo 'rawSupplierID'.$index ?>" id="<?php echo 'rawSupplierID'.$index ?>" value="<?php echo $raw->SupplierID ; ?>" readonly/>
|
||||
|
||||
|
||||
@ -522,7 +527,7 @@ $(function() {
|
||||
<label>Quantity</label>
|
||||
<div>
|
||||
<?php
|
||||
$data = array('name' => 'consuqty','value' => set_value('consuqty'),'id'=>'consuqty', 'class' => 'form-control');
|
||||
$data = array('name' => 'consuqty','value' => set_value('consuqty'),'id'=>'consuqty', 'class' => 'form-control','onchange'=>'consuqtycheck()');
|
||||
echo form_input($data);
|
||||
?>
|
||||
|
||||
@ -604,7 +609,7 @@ $(function() {
|
||||
<label>Quantity</label>
|
||||
<div>
|
||||
<?php
|
||||
$data = array('name' => 'Editconsuqty','value' => set_value('Editconsuqty'),'id'=>'Editconsuqty', 'class' => 'form-control',);
|
||||
$data = array('name' => 'Editconsuqty','value' => set_value('Editconsuqty'),'id'=>'Editconsuqty', 'class' => 'form-control','onchange'=>'Editconsuqtycheck()');
|
||||
echo form_input($data);
|
||||
?>
|
||||
|
||||
@ -658,12 +663,13 @@ $(function() {
|
||||
</thead>
|
||||
<tbody id="consuappend">
|
||||
<?php if(!empty($consumaterial)){
|
||||
// print_r($consumaterial);
|
||||
$inde=0;
|
||||
foreach($consumaterial as $cou){
|
||||
$inde=$inde+1;?>
|
||||
<tr id="consumable<?php echo $inde;?>">
|
||||
<td ><?php echo $inde?></td>
|
||||
<td id="consumaterial<?php echo $inde?>"><?php echo $cou->MaterialCode?></td>
|
||||
<td id="consumaterial<?php echo $inde?>"><?php echo $cou->MaterialCode."-".$cou->MaterialName?></td>
|
||||
<!-- <td id="consumaterialname<?php echo $inde?>"><?php echo $cou->MaterialName?></td> -->
|
||||
<td id="consusuppliername<?php echo $inde?>"><?php echo $cou->SupplierID."-".$cou->SupplierName?></td>
|
||||
<td id="consuQuantiy<?php echo $inde?>"><?php echo $cou->Quantity?></td>
|
||||
@ -679,6 +685,10 @@ $(function() {
|
||||
|
||||
<input type="hidden" name="<?php echo 'consumematerialcode'.$inde ?>" id="<?php echo 'consumematerialcode'.$inde ?>" value="<?php echo $cou->MaterialCode ; ?>" />
|
||||
|
||||
|
||||
|
||||
<input type="hidden" name="<?php echo 'consumematerialname'.$inde ?>" id="<?php echo 'consumematerialname'.$inde ?>" value="<?php echo $cou->MaterialName ; ?>" />
|
||||
|
||||
<input type="hidden" name="<?php echo 'consumeSupplierID'.$inde ?>" id="<?php echo 'consumeSupplierID'.$inde ?>" value="<?php echo $cou->SupplierID ; ?>" />
|
||||
|
||||
|
||||
@ -776,7 +786,7 @@ $(function() {
|
||||
<label>Quantity</label>
|
||||
<div>
|
||||
<?php
|
||||
$data = array('name' => 'packqty','value' => set_value('packqty'),'id'=>'packqty', 'class' => 'form-control');
|
||||
$data = array('name' => 'packqty','value' => set_value('packqty'),'id'=>'packqty', 'class' => 'form-control','onchange'=>"packqtycheck()");
|
||||
echo form_input($data);
|
||||
?>
|
||||
|
||||
@ -858,7 +868,7 @@ $(function() {
|
||||
<label>Quantity</label>
|
||||
<div>
|
||||
<?php
|
||||
$data = array('name' => 'Editpackqty','value' => set_value('Editpackqty'),'id'=>'Editpackqty', 'class' => 'form-control');
|
||||
$data = array('name' => 'Editpackqty','value' => set_value('Editpackqty'),'id'=>'Editpackqty', 'class' => 'form-control','onchange'=>"Editpackqtycheck()");
|
||||
echo form_input($data);
|
||||
?>
|
||||
|
||||
@ -907,28 +917,33 @@ $(function() {
|
||||
<th>Price</th>
|
||||
<th>Action</th>
|
||||
</thead>
|
||||
|
||||
<tbody id="packappend">
|
||||
<?php if(!empty($packagematerial)){
|
||||
$intt=0;
|
||||
foreach($packagematerial as $pac){
|
||||
$intt=$intt+1;?>
|
||||
<tbody id="packappend">
|
||||
<tr id="pack<?php echo $intt;?>">
|
||||
<td><?php echo $intt;?></td>
|
||||
<td id="packmaterial<?php echo $intt?>"><?php echo $pac->MaterialCode?></td>
|
||||
|
||||
<td id="packsuppliername<?php echo $intt?>"><?php echo $pac->SupplierID."-".$pac->SupplierName?></td>
|
||||
<td id="packQuantiy<?php echo $intt?>"><?php echo $pac->Quantity?></td>
|
||||
<td id="packmaterialPrice<?php echo $intt?>"><?php echo $pac->Price?></td>
|
||||
<td>
|
||||
|
||||
<a data-target='#EditCounter' data-id="<?php echo $intt ; ?>" data-userid="<?php echo $intt ; ?>" data-toggle="modal" href="#EditCounter"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit;"></i> </a> <!-- <a href='#' onclick = "DeleteCounterRow(<?php echo $intt ; ?>)" class="link" data-id="<?php echo $intt ; ?>" data-userid="<?php echo $intt ; ?>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a> -->
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<input type="hidden" name="<?php echo 'packId'.$intt ?>" id="<?php echo 'packId'.$intt ?>" value="<?php echo $pac->PackId ; ?>" />
|
||||
|
||||
<tr id="pack<?php echo $intt;?>">
|
||||
<td><?php echo $intt;?></td>
|
||||
<td id="packmaterial<?php echo $intt?>"><?php echo $pac->MaterialCode."-".$pac->MaterialName?></td>
|
||||
<td id="packsuppliername<?php echo $intt?>"><?php echo $pac->SupplierID."-".$pac->SupplierName?></td>
|
||||
<td id="packQuantiy<?php echo $intt?>"><?php echo $pac->Quantity?></td>
|
||||
<td id="packmaterialPrice<?php echo $intt?>"><?php echo $pac->Price?></td>
|
||||
<td>
|
||||
|
||||
<a data-target='#EditCounter' data-id="<?php echo $intt ; ?>" data-userid="<?php echo $intt ; ?>" data-toggle="modal" href="#EditCounter"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit;"></i> </a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<input type="hidden" name="<?php echo 'packId'.$intt ?>" id="<?php echo 'packId'.$intt ?>" value="<?php echo $pac->PackId ; ?>" />
|
||||
|
||||
<input type="hidden" name="<?php echo 'packmaterialcode'.$intt ?>" id="<?php echo 'packmaterialcode'.$intt ?>" value="<?php echo $pac->MaterialCode ; ?>" />
|
||||
|
||||
|
||||
<input type="hidden" name="<?php echo 'packmaterialname'.$intt ?>" id="<?php echo 'packmaterialname'.$intt ?>" value="<?php echo $pac->MaterialName ; ?>" />
|
||||
|
||||
<input type="hidden" name="<?php echo 'packSuppliernamee'.$intt ?>" id="<?php echo 'packSuppliernamee'.$intt ?>" value="<?php echo $pac->SupplierName ; ?>" />
|
||||
|
||||
<input type="hidden" name="<?php echo 'packSupplierID'.$intt ?>" id="<?php echo 'packSupplierID'.$intt ?>" value="<?php echo $pac->SupplierID ; ?>" />
|
||||
@ -937,7 +952,7 @@ $(function() {
|
||||
|
||||
<input type="hidden" name="<?php echo 'packprice'.$intt ?>" id="<?php echo 'packprice'.$intt ?>" value="<?php echo $pac->Price ; ?>" />
|
||||
|
||||
<?php }}?>
|
||||
<?php }}?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@ -1003,7 +1018,7 @@ $(function() {
|
||||
<div class="col-md-6">
|
||||
<label>Date</label>
|
||||
<?php
|
||||
$data = array('name' => 'CopDate','value' => set_value('CopDate',$CurrentDate),'id'=>'CopDate', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;');
|
||||
$data = array('name' => 'CopDate','value' => set_value('CopDate'),'id'=>'CopDate', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
@ -1084,7 +1099,7 @@ $(function() {
|
||||
<div class="col-md-6">
|
||||
<label>Date</label>
|
||||
<?php
|
||||
$data = array('name' => 'EditCopDate','value' => set_value('EditCopDate',$CurrentDate),'id'=>'EditCopDate', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;');
|
||||
$data = array('name' => 'EditCopDate','value' => set_value('EditCopDate'),'id'=>'EditCopDate', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
@ -1159,6 +1174,9 @@ $(function() {
|
||||
$ind=0;
|
||||
foreach($coproductmaterial as $dis){//print_r($dis);
|
||||
$ind= $ind+1;
|
||||
|
||||
$Copdt = new DateTime($dis['CoDate']);
|
||||
$Coprdate = $Copdt->format('d-m-Y');
|
||||
|
||||
|
||||
?>
|
||||
@ -1187,7 +1205,9 @@ $(function() {
|
||||
|
||||
<input type="hidden" name="<?php echo 'Copmaterialname'.$ind ?>" id="<?php echo 'Copmaterialname'.$ind ?>" value="<?php echo $dis['product_name'] ; ?>" readonly/>
|
||||
|
||||
<input type="hidden" name="<?php echo 'CopDate'.$ind ?>" id="<?php echo 'CopDate'.$ind ?>" value="<?php echo $dis['CoDate'] ; ?>" readonly/>
|
||||
<input type="hidden" name="<?php echo 'CopDate'.$ind ?>" id="<?php echo 'CopDate'.$ind ?>" value="<?php echo $Coprdate; ?>" readonly/>
|
||||
|
||||
|
||||
|
||||
|
||||
<input type="hidden" name="<?php echo 'CopQty'.$ind ?>" id="<?php echo 'CopQty'.$ind ?>" value="<?php echo $dis['Quantity'] ; ?>" readonly/>
|
||||
@ -1251,7 +1271,6 @@ $(function() {
|
||||
<script type="text/html" id="consumable">
|
||||
<tr id="consumable<%=rootindex%>">
|
||||
<td align="left"><%=rootindex%></td>
|
||||
|
||||
<td align="left" id="consumaterial<%=rootindex%>"><%=Material%></td>
|
||||
<td align="left" id="consusuppliername<%=rootindex%>"><%=Supplier%></td>
|
||||
<td align="left" id="consuQuantiy<%=rootindex%>"><%=Quantity%></td>
|
||||
@ -1337,14 +1356,35 @@ function addHidden(theForm, key, value)
|
||||
|
||||
$('.addraw').click(function()
|
||||
{
|
||||
|
||||
if($('#rawmaterialcode').val()=='0')
|
||||
{
|
||||
alert("Please Select Material");
|
||||
return false;
|
||||
}
|
||||
|
||||
else if($('#rawSupplier').val()=='0')
|
||||
{
|
||||
alert("Please Select Supplier");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
else{
|
||||
var rawmaterialcode= $('#rawmaterialcode').val();
|
||||
var rawSupplierID = $('#rawSupplier').val();
|
||||
//var suppliername = $('#rawsuppliername').val();
|
||||
var rawQty = $('#rawqty').val();
|
||||
var rawprice = $('#rawprice').val();
|
||||
var rawsuppliername = rawSupplier.options[rawSupplier.selectedIndex].text;
|
||||
|
||||
var e = document.getElementById("rawmaterialcode");
|
||||
var rawmaterialname = e.options[e.selectedIndex].text;
|
||||
|
||||
// var materialnam=rawmaterialname.substring(0, rawmaterialname.indexOf("-"));
|
||||
|
||||
// alert(suppliername);
|
||||
// alert(materialnam);
|
||||
|
||||
index = parseInt(index)+1;
|
||||
var temp = index
|
||||
@ -1353,7 +1393,7 @@ $('.addraw').click(function()
|
||||
var template = jQuery("#rawmateriallist").html();
|
||||
|
||||
// alert(template)
|
||||
$('#rawappend').append(_.template(template,{index:temp,Material:rawmaterialcode,Supplier:rawsuppliername,Quantity:rawQty,Price:rawprice}));
|
||||
$('#rawappend').append(_.template(template,{index:temp,Material:rawmaterialname,Supplier:rawsuppliername,Quantity:rawQty,Price:rawprice}));
|
||||
|
||||
var theForm = $(".final_product");
|
||||
|
||||
@ -1363,12 +1403,15 @@ $('.addraw').click(function()
|
||||
addHidden(theForm,"rawprice"+temp,rawprice);
|
||||
addHidden(theForm,"type"+temp,"Raw Material");
|
||||
addHidden(theForm,"rawSuppliername"+temp,rawsuppliername);
|
||||
addHidden(theForm,"rawmaterialname"+temp,rawmaterialname);
|
||||
|
||||
$('#rawmaterialcode').val('');
|
||||
$('#rawSupplier').val('');
|
||||
$('#rawqty').val('');
|
||||
$('#rawprice').val('')
|
||||
$('#RawRow').val(temp)
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
@ -1395,6 +1438,22 @@ $('.EditItem').click(function()
|
||||
{
|
||||
// alert(userid)
|
||||
|
||||
if($('#Editrawmaterialcode').val()<="0")
|
||||
{
|
||||
alert("Please Select Material");
|
||||
return false;
|
||||
}
|
||||
else if($('#EditrawSupplier').val()<='0')
|
||||
{
|
||||
alert("Please Select Supplier");
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
else{
|
||||
|
||||
var rawmaterialcode= $('#Editrawmaterialcode').val();
|
||||
var rawSupplierID = $('#EditrawSupplier').val();
|
||||
var rawQty = $('#Editrawqty').val();
|
||||
@ -1407,7 +1466,10 @@ $('.EditItem').click(function()
|
||||
var suppliername=$('#rawSuppliername'+userid).val();
|
||||
//alert(suppliername);
|
||||
|
||||
document.getElementById('rawmaterialedit'+userid).innerHTML = rawmaterialcode;
|
||||
var rawMaterialName =$('#rawmaterialname'+userid).val();
|
||||
//alert(rawMaterialName)
|
||||
|
||||
document.getElementById('rawmaterialedit'+userid).innerHTML = rawmaterialcode+"-"+rawMaterialName;
|
||||
document.getElementById('rawsuppliername'+userid).innerHTML = rawSupplierID+"-"+suppliername;
|
||||
document.getElementById('rawQuantiy'+userid).innerHTML = rawQty;
|
||||
document.getElementById('rawmaterialPrice'+userid).innerHTML = rawprice;
|
||||
@ -1422,6 +1484,7 @@ $('.EditItem').click(function()
|
||||
$('#rawSupplierID'+userid).val(rawSupplierID);
|
||||
$('#rawQty'+userid).val(rawQty);
|
||||
$('#rawprice'+userid).val(rawprice);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
@ -1430,17 +1493,36 @@ $('.EditItem').click(function()
|
||||
$('.rootaddClick').click(function()
|
||||
{
|
||||
|
||||
|
||||
if($('#consumaterialcode').val()=='0')
|
||||
{
|
||||
alert("Please Select Material");
|
||||
return false;
|
||||
}
|
||||
|
||||
else if($('#consuSupplier').val()=='0')
|
||||
{
|
||||
alert("Please Select Suppliers");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
else
|
||||
{
|
||||
var consumaterialcode= $('#consumaterialcode').val();
|
||||
var consuSupplierID = $('#consuSupplier').val();
|
||||
var consuQty = $('#consuqty').val();
|
||||
var consuprice = $('#consuprice').val();
|
||||
var rawsuppliername = consuSupplier.options[consuSupplier.selectedIndex].text;
|
||||
|
||||
var g = document.getElementById("consumaterialcode");
|
||||
var consumaterialname = g.options[g.selectedIndex].text;
|
||||
|
||||
rootindex = parseInt(rootindex)+1;
|
||||
var temp = rootindex
|
||||
var template = jQuery("#consumable").html();
|
||||
//alert(template)
|
||||
$('#consuappend').append(_.template(template,{rootindex:temp,Material:consumaterialcode,Supplier:rawsuppliername,Quantity:consuQty,Price:consuprice}));
|
||||
$('#consuappend').append(_.template(template,{rootindex:temp,Material:consumaterialname,Supplier:rawsuppliername,Quantity:consuQty,Price:consuprice}));
|
||||
|
||||
var theForm = $(".final_product");
|
||||
|
||||
@ -1450,6 +1532,7 @@ $('.rootaddClick').click(function()
|
||||
addHidden(theForm,"consumeprice"+temp,consuprice);
|
||||
addHidden(theForm,"consumetype"+temp,"Consumable");
|
||||
addHidden(theForm,"consumeSuppliername"+temp,rawsuppliername);
|
||||
addHidden(theForm,"consumematerialname"+temp,consumaterialname);
|
||||
|
||||
$('#consumaterialcode').val('');
|
||||
$('#consuSupplier').val('');
|
||||
@ -1457,6 +1540,7 @@ $('.rootaddClick').click(function()
|
||||
$('#consuprice').val('');
|
||||
$('#ConsuRow').val(temp);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -1481,8 +1565,11 @@ $('.rootEditItem').click(function()
|
||||
var editconsuQty = $('#Editconsuqty').val();
|
||||
var editrawprice = $('#Editconsuprice').val();
|
||||
|
||||
|
||||
var tr= document.getElementById(rootuserid);
|
||||
var supname = $('#consumeSuppliername'+rootuserid).val();
|
||||
|
||||
var editconsumaterialname = $('#consumematerialname'+rootuserid).val();
|
||||
// var cellval = tr.cells;
|
||||
// cellval[1].innerHTML = editconsumaterialcode;
|
||||
// cellval[2].innerHTML = editconsuSupplierID;
|
||||
@ -1490,7 +1577,7 @@ $('.rootEditItem').click(function()
|
||||
// cellval[4].innerHTML = editrawprice;
|
||||
|
||||
|
||||
document.getElementById('consumaterial'+rootuserid).innerHTML = editconsumaterialcode;
|
||||
document.getElementById('consumaterial'+rootuserid).innerHTML = editconsumaterialcode+"-"+editconsumaterialname;
|
||||
document.getElementById('consusuppliername'+rootuserid).innerHTML = editconsuSupplierID+"-"+supname;
|
||||
document.getElementById('consuQuantiy'+rootuserid).innerHTML = editconsuQty;
|
||||
document.getElementById('consumaterialPrice'+rootuserid).innerHTML = editrawprice;
|
||||
@ -1507,17 +1594,37 @@ $('.rootEditItem').click(function()
|
||||
$('.CounteraddClick').click(function()
|
||||
{
|
||||
|
||||
|
||||
if($('#packumaterialcode').val()=='0')
|
||||
{
|
||||
alert("Please Select Material");
|
||||
return true;
|
||||
}
|
||||
|
||||
else if($('#packSupplier').val()=='0')
|
||||
{
|
||||
alert("Please Select Supplier");
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
else
|
||||
{
|
||||
var packmaterialcode= $('#packumaterialcode').val();
|
||||
var packSupplierID = $('#packSupplier').val();
|
||||
var packQty = $('#packqty').val();
|
||||
var packprice = $('#packprice').val();
|
||||
var packsuppliername = packSupplier.options[packSupplier.selectedIndex].text;
|
||||
|
||||
var h = document.getElementById("packumaterialcode");
|
||||
var packmaterialname = h.options[h.selectedIndex].text;
|
||||
|
||||
counterindex = parseInt(counterindex)+1;
|
||||
var temp = counterindex
|
||||
var template = jQuery("#packable").html();
|
||||
//alert(template)
|
||||
$('#packappend').append(_.template(template,{counterindex:temp,Material:packmaterialcode,Supplier:packsuppliername,Quantity:packQty,Price:packprice}));
|
||||
$('#packappend').append(_.template(template,{counterindex:temp,Material:packmaterialname,Supplier:packsuppliername,Quantity:packQty,Price:packprice}));
|
||||
|
||||
var theForm = $(".final_product");
|
||||
|
||||
@ -1528,11 +1635,14 @@ $('.CounteraddClick').click(function()
|
||||
addHidden(theForm,"packtype"+temp,"Packaging");
|
||||
addHidden(theForm,"packSuppliernamee"+temp,packsuppliername);
|
||||
|
||||
addHidden(theForm,"packmaterialname"+temp,packmaterialname);
|
||||
|
||||
$('#packumaterialcode').val('');
|
||||
$('#packSupplier').val('');
|
||||
$('#packqty').val('');
|
||||
$('#packprice').val('');
|
||||
$('#PkgRow').val(temp);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@ -1567,6 +1677,8 @@ $('.CounterEditItem').click(function()
|
||||
//var cellval = tr.cells;
|
||||
//alert(cuserid)
|
||||
var supple = $('#packSuppliernamee'+cuserid).val();
|
||||
|
||||
var editpackmaterialname = $('#packmaterialname'+cuserid).val();
|
||||
|
||||
// cellval[1].innerHTML = editpackmaterialcode;
|
||||
// cellval[2].innerHTML = editpacksuppliername;
|
||||
@ -1575,7 +1687,7 @@ $('.CounterEditItem').click(function()
|
||||
|
||||
|
||||
|
||||
document.getElementById('packmaterial'+cuserid).innerHTML = editpackmaterialcode;
|
||||
document.getElementById('packmaterial'+cuserid).innerHTML = editpackmaterialcode+"-"+editpackmaterialname;
|
||||
document.getElementById('packsuppliername'+cuserid).innerHTML = editpackSupplierID+"-"+supple;
|
||||
document.getElementById('packQuantiy'+cuserid).innerHTML = editpackQty;
|
||||
document.getElementById('packmaterialPrice'+cuserid).innerHTML = editpackprice;
|
||||
@ -1653,7 +1765,7 @@ $('.CoEditItem').click(function()
|
||||
|
||||
var tr= document.getElementById(cuserid);
|
||||
//var cellval = tr.cells;
|
||||
//alert(cuserid)
|
||||
//alert(editcopdate)
|
||||
|
||||
var prname = $('#Copmaterialname'+cuserid).val();
|
||||
|
||||
@ -1664,12 +1776,12 @@ $('.CoEditItem').click(function()
|
||||
|
||||
|
||||
document.getElementById('Copmaterial'+cuserid).innerHTML = editcoproductid+"-"+prname;
|
||||
document.getElementById('Copsuppliername'+cuserid).innerHTML = newdate;
|
||||
document.getElementById('Copsuppliername'+cuserid).innerHTML = editcopdate;
|
||||
document.getElementById('CopQuantiy'+cuserid).innerHTML = editcopqty;
|
||||
document.getElementById('CopmaterialPrice'+cuserid).innerHTML = editcopprice;
|
||||
|
||||
$('#Copmaterialcode'+cuserid).val(editcoproductid);
|
||||
$('#CopDate'+cuserid).val(newdate);
|
||||
$('#CopDate'+cuserid).val(editcopdate);
|
||||
$('#CopQty'+cuserid).val(editcopqty);
|
||||
$('#Copprice'+cuserid).val(editcopprice);
|
||||
|
||||
@ -1745,7 +1857,9 @@ $('#EditrawSupplier').change(function()
|
||||
|
||||
|
||||
|
||||
|
||||
var rawresultqty = 0;
|
||||
var consuresultant = 0;
|
||||
var packresultant = 0;
|
||||
|
||||
|
||||
|
||||
@ -1827,17 +1941,19 @@ function ResultantQty(materialtype)
|
||||
// console.log(reduceqty)
|
||||
|
||||
var resultantqty = parseFloat(addqty)- parseFloat(reduceqty);
|
||||
|
||||
|
||||
//console.log(resultantqty);
|
||||
|
||||
if(isNaN(resultantqty))
|
||||
{
|
||||
$('#rawqty').val(0);
|
||||
rawresultqty =0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$('#rawqty').val(resultantqty);
|
||||
rawresultqty = parseFloat(resultantqty);
|
||||
|
||||
}
|
||||
|
||||
@ -1921,15 +2037,17 @@ function ResultantQty(materialtype)
|
||||
});
|
||||
|
||||
var resultantqty = parseFloat(addqty)- parseFloat(reduceqty);
|
||||
|
||||
|
||||
if(isNaN(resultantqty))
|
||||
{
|
||||
$('#consuqty').val(0);
|
||||
consuresultant = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$('#consuqty').val(resultantqty);
|
||||
consuresultant = parseFloat(resultantqty);
|
||||
|
||||
}
|
||||
|
||||
@ -2019,11 +2137,13 @@ function ResultantQty(materialtype)
|
||||
if(isNaN(resultantqty))
|
||||
{
|
||||
$('#packqty').val(0);
|
||||
packresultant =0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$('#packqty').val(resultantqty);
|
||||
packresultant = parseFloat(resultantqty);
|
||||
|
||||
}
|
||||
|
||||
@ -2367,6 +2487,78 @@ function Save()
|
||||
});
|
||||
}
|
||||
|
||||
function rawqtycheck()
|
||||
{
|
||||
// alert(rawresultqty);
|
||||
|
||||
// var enterrawqty= $('#rawqty').val();
|
||||
// if(rawresultqty < enterrawqty)
|
||||
// {
|
||||
// alert("You are Exceeding the Stock Qtantity!! Avalable stock is"+rawresultqty);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
function editrawqtycheck()
|
||||
{
|
||||
//alert(rawresultqty);
|
||||
|
||||
// var editenterrawqty= $('#Editrawqty').val();
|
||||
// if(rawresultqty < editenterrawqty)
|
||||
// {
|
||||
// alert("You are Exceeding the Stock Qtantity!! Avalable stock is"+rawresultqty);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
function consuqtycheck()
|
||||
{
|
||||
// alert(rawresultqty);
|
||||
|
||||
// var enterconsuqty= $('#consuqty').val();
|
||||
// if(consuresultant < enterconsuqty)
|
||||
// {
|
||||
// alert("You are Exceeding the Stock Qtantity!! Avalable stock is"+consuresultant);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
function Editconsuqtycheck()
|
||||
{
|
||||
// var editenterconsuqty= $('#Editconsuqty').val();
|
||||
// if(consuresultant < editenterconsuqty)
|
||||
// {
|
||||
// alert("You are Exceeding the Stock Qtantity!! Avalable stock is"+consuresultant);
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
function packqtycheck()
|
||||
{
|
||||
// alert(rawresultqty);
|
||||
|
||||
// var enterpackqty= $('#packqty').val();
|
||||
// if(packresultant < enterpackqty)
|
||||
// {
|
||||
// alert("You are Exceeding the Stock Qtantity!! Avalable stock is"+packresultant);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
function Editpackqtycheck()
|
||||
{
|
||||
// var entereditpackqty = $('#Editpackqty').val();
|
||||
// if(packresultant < entereditpackqty)
|
||||
// {
|
||||
// alert("You are Exceeding the Stock Qtantity!! Avalable stock is"+packresultant);
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
<th>Adjusted Qty</th>
|
||||
<!-- <th>Adjustment</th> -->
|
||||
<th>Adjusted On</th>
|
||||
<th>Action</th>
|
||||
<!-- <th>Action</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><?php
|
||||
@ -42,20 +42,20 @@
|
||||
<tr id="<?php echo $index ; ?>">
|
||||
<td><?php echo $index ; ?></td>
|
||||
<td><?php echo "Adj".$record->AdjustmentId ?></td>
|
||||
<td><a data-toggle="modal" data-target="#materialreport" data-userid="<?php echo $record->MaterialCode ?>" data-id="<%=index%>" data-dismiss="modal"><?php echo $record->MaterialCode."-".$record->MaterialName; ?></a></td>
|
||||
<td><a data-toggle="modal" data-target="#materialreport" data-userid="<?php echo $record->AdjustmentId?>" data-id="<%=index%>" data-dismiss="modal"><?php echo $record->MaterialCode."-".$record->MaterialName; ?></a></td>
|
||||
<td><?php echo $record->SupplierID."-".$record->SupplierName; ?></td>
|
||||
<td><?php echo $record->Quantity ?></td>
|
||||
|
||||
<td><?php echo "Adjust"; ?></td>
|
||||
<!-- <td><?php echo "Adjust"; ?></td> -->
|
||||
|
||||
<td><?php echo $record->CreatedOn ?></td>
|
||||
|
||||
|
||||
|
||||
<!--
|
||||
<td> <a data-toggle="tooltip" href="<?php echo base_url().'EditMaterialAdjustment?AdjustmentId='.$record->AdjustmentId;?>&date=<?php echo $record->CreatedOn?>&mc=<?php echo $record->MaterialCode?>
|
||||
&sn=<?php echo $record->SupplierID?>" ><i class="fa fa-pencil" data-toggle="tooltip" title="<?php echo $record->AdjustmentId; ?> - Click here to Edit details"></i> </a>
|
||||
<a data-toggle="tooltip" href="<?php echo base_url().'batchcard/Deletequantity?AdjustmentId='.$record->AdjustmentId; ?>" ><i class="fa fa-trash" data-toggle="tooltip" title="<?php echo $record->AdjustmentId; ?> - Click here to Delete details"></i> </a>
|
||||
</td>
|
||||
</td> -->
|
||||
|
||||
</tr>
|
||||
<?php
|
||||
@ -91,9 +91,7 @@
|
||||
<center><h4>Material Adjustment Report</h4></center>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<!-- <div class="col-md-3">
|
||||
<label>Material :</label>
|
||||
</div> -->
|
||||
|
||||
<div class="col-md-3">
|
||||
<label>Material :</label>
|
||||
<?php
|
||||
@ -104,14 +102,24 @@
|
||||
|
||||
|
||||
</div>
|
||||
<!-- <div class="col-md-3">
|
||||
<label> Purchase Order Number:</label>
|
||||
</div> -->
|
||||
<div class="col-md-3">
|
||||
<label> Inward Quantity:</label>
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
<label> Supplier:</label>
|
||||
<?php
|
||||
|
||||
$data = array('name' => 'Outqty','value' => set_value('Outqty'),'id'=>'Outqty', 'class' => 'form-control','readonly'=>'true');
|
||||
$data = array('name' => 'Supplier','value' => set_value('Supplier'),'id'=>'Supplier', 'class' => 'form-control','readonly'=>'true');
|
||||
echo form_input($data);echo"<br>";
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<label> Actual Quantity:</label>
|
||||
<?php
|
||||
|
||||
$data = array('name' => 'Actqty','value' => set_value('Actqty'),'id'=>'Actqty', 'class' => 'form-control','readonly'=>'true');
|
||||
echo form_input($data);echo"<br>";
|
||||
?>
|
||||
|
||||
@ -119,19 +127,28 @@
|
||||
</div>
|
||||
|
||||
|
||||
<!-- <div class="col-md-3">
|
||||
<label> Purchase Order Number:</label>
|
||||
</div> -->
|
||||
<div class="col-md-3">
|
||||
<label> Outward Quantity:</label>
|
||||
<label> Adjusted Quantity:</label>
|
||||
<?php
|
||||
|
||||
$data = array('name' => 'invqty','value' => set_value('invqty'),'id'=>'invqty', 'class' => 'form-control','readonly'=>'true');
|
||||
$data = array('name' => 'Adjqty','value' => set_value('Adjqty'),'id'=>'Adjqty', 'class' => 'form-control','readonly'=>'true');
|
||||
echo form_input($data);echo"<br>";
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
<label> Quantity Before Adjustment:</label>
|
||||
<?php
|
||||
|
||||
$data = array('name' => 'befAdjqty','value' => set_value('befAdjqty'),'id'=>'befAdjqty', 'class' => 'form-control','readonly'=>'true');
|
||||
echo form_input($data);echo"<br>";
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -177,7 +194,7 @@
|
||||
|
||||
$("#materialreport").on("shown.bs.modal", function(e)
|
||||
{
|
||||
var MaterialCode = $(e.relatedTarget).data('userid');
|
||||
var AdjustmentId = $(e.relatedTarget).data('userid');
|
||||
//var date =
|
||||
|
||||
var today = new Date();
|
||||
@ -202,7 +219,7 @@ today = yyyy + '-' + mm + '-' + dd;
|
||||
|
||||
$.ajax({
|
||||
|
||||
data:{MaterialCode:MaterialCode,date:today},
|
||||
data:{AdjustmentId:AdjustmentId,date:today},
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>batchcard/displaying_stockvalues",
|
||||
success:function(data){
|
||||
@ -211,9 +228,15 @@ $.ajax({
|
||||
|
||||
$.each(JSON.parse(data),function (i,item) {
|
||||
|
||||
$('#Outqty').val(item.Addqty);
|
||||
$('#invqty').val(item.ReduceQty);
|
||||
// $('#Outqty').val(item.Addqty);
|
||||
// $('#invqty').val(item.ReduceQty);
|
||||
$('#material').val(item.MaterialCode+"-"+item.MaterialName);
|
||||
$('#Adjqty').val(item.Quantity);
|
||||
$('#Actqty').val(item.ActualQuantity);
|
||||
$('#Supplier').val(item.SupplierName);
|
||||
|
||||
var beforeqty =parseFloat(item.Quantity)+parseFloat(item.ActualQuantity);
|
||||
$('#befAdjqty').val(beforeqty);
|
||||
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user