stock issue fix

This commit is contained in:
venbatechnologies@gmail.com 2018-06-04 10:14:10 +05:30
parent fd8dfca1e9
commit 8a1f14ef39
5 changed files with 140 additions and 14 deletions

View File

@ -1540,6 +1540,9 @@ class batchcard extends BaseController
$product_value = $this->input->post('values');
$createdby = $this->session->userdata('userId');
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$createddt = $dt->format('Y-m-d H:i:s');
$final_master =array('MaterialCode'=>$final_product,'Quantity'=>$final_qty,'Price'=>$product_value,'CreatedBy'=>$createdby,'ProductDate'=>$product_date);
@ -1728,7 +1731,7 @@ class batchcard extends BaseController
echo "Updated Successfully";
}

View File

@ -1254,7 +1254,21 @@ 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 rawQty = $('#rawqty').val();
@ -1282,6 +1296,7 @@ $('.addraw').click(function()
$('#rawqty').val('');
$('#rawprice').val('')
$('#RawRow').val(temp)
}
});
@ -1329,6 +1344,22 @@ $('.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();
@ -1354,6 +1385,7 @@ $('.rootaddClick').click(function()
$('#consuqty').val('');
$('#consuprice').val('');
$('#ConsuRow').val(temp);
}
});
@ -1402,7 +1434,22 @@ $('.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();
@ -1427,6 +1474,7 @@ $('.CounteraddClick').click(function()
$('#packqty').val('');
$('#packprice').val('');
$('#PkgRow').val(temp);
}
});
@ -1485,6 +1533,14 @@ $('.CounterEditItem').click(function()
$('.CoaddClick').click(function()
{
if($('#coproduct_id').val()=='0')
{
alert('Please Select Product');
return false;
}
else{
var copmaterialcode= $('#coproduct_id').val();
var copDate = $('#CopDate').val();
@ -1511,6 +1567,7 @@ $('.CoaddClick').click(function()
$('#Coqty').val('');
$('#Coprice').val('');
$('#CopRow').val(temp);
}
});
@ -2228,6 +2285,31 @@ function EditResultantQty(materialtype)
function Save()
{
if($('#DEPTFN').val()=="0")
{
alert("Please Select Product");
return false;
}
else if($('#Date').val()=="")
{
alert("Please Select Date");
return false;
}
else if($('#Quantity').val()=="")
{
alert("Please Enter Quantity");
return false;
}
else if($('#values').val()=="")
{
alert("Please Enter Price");
return false;
}
else{
$('#content').loader('show');
$.ajax({
@ -2252,6 +2334,8 @@ function Save()
}
});
}
}

View File

@ -422,6 +422,11 @@ $(function() {
<input type="hidden" name="<?php echo 'rawSupplierID'.$index ?>" id="<?php echo 'rawSupplierID'.$index ?>" value="<?php echo $raw->SupplierID ; ?>" readonly/>
<input type="hidden" name="<?php echo 'rawSuppliername'.$index ?>" id="<?php echo 'rawSuppliername'.$index ?>" value="<?php echo $raw->SupplierName ; ?>" readonly/>
<input type="hidden" name="<?php echo 'rawQty'.$index ?>" id="<?php echo 'rawQty'.$index ?>" value="<?php echo $raw->Quantity ; ?>" readonly/>
@ -676,6 +681,10 @@ $(function() {
<input type="hidden" name="<?php echo 'consumeSupplierID'.$inde ?>" id="<?php echo 'consumeSupplierID'.$inde ?>" value="<?php echo $cou->SupplierID ; ?>" />
<input type="hidden" name="<?php echo 'consumeSuppliername'.$inde ?>" id="<?php echo 'consumeSuppliername'.$inde ?>" value="<?php echo $cou->SupplierName ; ?>" />
<input type="hidden" name="<?php echo 'consumeQty'.$inde ?>" id="<?php echo 'consumeQty'.$inde ?>" value="<?php echo $cou->Quantity ; ?>" />
<input type="hidden" name="<?php echo 'consumeprice'.$inde ?>" id="<?php echo 'consumeprice'.$inde ?>" value="<?php echo $cou->Price ; ?>" />
@ -892,7 +901,7 @@ $(function() {
<thead style="background-color: #CFCFCF;">
<th>S.No</th>
<th>Material Code</th>
<!-- <th>Material Name</th> -->
<th>Supplier</th>
<th>Quantity</th>
<th>Price</th>
@ -906,7 +915,7 @@ $(function() {
<tr id="pack<?php echo $intt;?>">
<td><?php echo $intt;?></td>
<td id="packmaterial<?php echo $intt?>"><?php echo $pac->MaterialCode?></td>
<!-- <td><?php echo $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>
@ -920,6 +929,8 @@ $(function() {
<input type="hidden" name="<?php echo 'packmaterialcode'.$intt ?>" id="<?php echo 'packmaterialcode'.$intt ?>" value="<?php echo $pac->MaterialCode ; ?>" />
<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 ; ?>" />
<input type="hidden" name="<?php echo 'packQty'.$intt ?>" id="<?php echo 'packQty'.$intt ?>" value="<?php echo $pac->Quantity ; ?>" />
@ -1153,9 +1164,18 @@ $(function() {
?>
<tr id="copr<?php echo $ind ; ?>">
<td id="<?php echo $ind?>"><?php echo $ind?></td>
<td id="Copmaterial<?php echo $ind?>"><?php echo $dis['MaterialCode'];?></td>
<td id="Copmaterial<?php echo $ind?>"><?php echo $dis['MaterialCode']."-".$dis['product_name'];?></td>
<!-- <td id="Copmaterial<?php echo $ind?>"><?php echo $dis['product_name'];?></td> -->
<td id="Copsuppliername<?php echo $ind?>"><?php echo $dis['CoDate']?></td>
<!-- <td id="Copsuppliername<?php echo $ind?>"><?php echo $dis['CoDate']?></td> -->
<td id="Copsuppliername<?php echo $ind?>"><?php echo $Cdt=new DateTime($dis['CoDate']);$CreatedDate= $Cdt->format('d-m-Y');
echo $CreatedDate; ?> </td>
<td id="CopQuantiy<?php echo $ind?>"><?php echo $dis['Quantity']?></td>
<td id="CopmaterialPrice<?php echo $ind?>"><?php echo $dis['Price']?></td>
@ -1165,6 +1185,8 @@ $(function() {
<input type="hidden" name="<?php echo 'Copmaterialcode'.$ind ?>" id="<?php echo 'Copmaterialcode'.$ind ?>" value="<?php echo $dis['MaterialCode'] ; ?>" readonly/>
<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/>
@ -1317,11 +1339,12 @@ $('.addraw').click(function()
{
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;
//alert(rawsuppliername);
// alert(suppliername);
index = parseInt(index)+1;
var temp = index
@ -1339,6 +1362,7 @@ $('.addraw').click(function()
addHidden(theForm,"rawQty"+temp,rawQty);
addHidden(theForm,"rawprice"+temp,rawprice);
addHidden(theForm,"type"+temp,"Raw Material");
addHidden(theForm,"rawSuppliername"+temp,rawsuppliername);
$('#rawmaterialcode').val('');
$('#rawSupplier').val('');
@ -1380,8 +1404,11 @@ $('.EditItem').click(function()
//alert("tr"+tr)
//var cellval = tr.cells;
var suppliername=$('#rawSuppliername'+userid).val();
//alert(suppliername);
document.getElementById('rawmaterialedit'+userid).innerHTML = rawmaterialcode;
document.getElementById('rawsuppliername'+userid).innerHTML = rawSupplierID;
document.getElementById('rawsuppliername'+userid).innerHTML = rawSupplierID+"-"+suppliername;
document.getElementById('rawQuantiy'+userid).innerHTML = rawQty;
document.getElementById('rawmaterialPrice'+userid).innerHTML = rawprice;
@ -1422,6 +1449,7 @@ $('.rootaddClick').click(function()
addHidden(theForm,"consumeQty"+temp,consuQty);
addHidden(theForm,"consumeprice"+temp,consuprice);
addHidden(theForm,"consumetype"+temp,"Consumable");
addHidden(theForm,"consumeSuppliername"+temp,rawsuppliername);
$('#consumaterialcode').val('');
$('#consuSupplier').val('');
@ -1454,6 +1482,7 @@ $('.rootEditItem').click(function()
var editrawprice = $('#Editconsuprice').val();
var tr= document.getElementById(rootuserid);
var supname = $('#consumeSuppliername'+rootuserid).val();
// var cellval = tr.cells;
// cellval[1].innerHTML = editconsumaterialcode;
// cellval[2].innerHTML = editconsuSupplierID;
@ -1462,7 +1491,7 @@ $('.rootEditItem').click(function()
document.getElementById('consumaterial'+rootuserid).innerHTML = editconsumaterialcode;
document.getElementById('consusuppliername'+rootuserid).innerHTML = editconsuSupplierID;
document.getElementById('consusuppliername'+rootuserid).innerHTML = editconsuSupplierID+"-"+supname;
document.getElementById('consuQuantiy'+rootuserid).innerHTML = editconsuQty;
document.getElementById('consumaterialPrice'+rootuserid).innerHTML = editrawprice;
@ -1497,6 +1526,7 @@ $('.CounteraddClick').click(function()
addHidden(theForm,"packQty"+temp,packQty);
addHidden(theForm,"packprice"+temp,packprice);
addHidden(theForm,"packtype"+temp,"Packaging");
addHidden(theForm,"packSuppliernamee"+temp,packsuppliername);
$('#packumaterialcode').val('');
$('#packSupplier').val('');
@ -1536,6 +1566,7 @@ $('.CounterEditItem').click(function()
var tr= document.getElementById(cuserid);
//var cellval = tr.cells;
//alert(cuserid)
var supple = $('#packSuppliernamee'+cuserid).val();
// cellval[1].innerHTML = editpackmaterialcode;
// cellval[2].innerHTML = editpacksuppliername;
@ -1545,7 +1576,7 @@ $('.CounterEditItem').click(function()
document.getElementById('packmaterial'+cuserid).innerHTML = editpackmaterialcode;
document.getElementById('packsuppliername'+cuserid).innerHTML = editpackSupplierID;
document.getElementById('packsuppliername'+cuserid).innerHTML = editpackSupplierID+"-"+supple;
document.getElementById('packQuantiy'+cuserid).innerHTML = editpackQty;
document.getElementById('packmaterialPrice'+cuserid).innerHTML = editpackprice;
@ -1581,6 +1612,7 @@ $('.CoaddClick').click(function()
addHidden(theForm,"CopQty"+temp,copQty);
addHidden(theForm,"Copprice"+temp,copprice);
addHidden(theForm,"Coptype"+temp,"CoProduct");
addHidden(theForm,"Copmaterialname"+temp,copsuppliername)
$('#coproduct_id').val('');
$('#CopDate').val('');
@ -1622,6 +1654,8 @@ $('.CoEditItem').click(function()
var tr= document.getElementById(cuserid);
//var cellval = tr.cells;
//alert(cuserid)
var prname = $('#Copmaterialname'+cuserid).val();
// cellval[1].innerHTML = editcopproduct;
// cellval[2].innerHTML = editcopdate;
@ -1629,7 +1663,7 @@ $('.CoEditItem').click(function()
// cellval[4].innerHTML = editcopprice;
document.getElementById('Copmaterial'+cuserid).innerHTML = editcoproductid;
document.getElementById('Copmaterial'+cuserid).innerHTML = editcoproductid+"-"+prname;
document.getElementById('Copsuppliername'+cuserid).innerHTML = newdate;
document.getElementById('CopQuantiy'+cuserid).innerHTML = editcopqty;
document.getElementById('CopmaterialPrice'+cuserid).innerHTML = editcopprice;

View File

@ -16,7 +16,7 @@ if(!empty($materailAdjustmentlist))
{
$editid = $mat->AdjustmentId;
$supplier = $mat->SupplierID;
$suppliername=$mat->SupplierName;
$suppliername=$mat->SupplierName;
$materialcode = $mat->MaterialCode;
$date = $mat->CreatedOn;
$editquantity= $mat->Quantity;
@ -24,6 +24,7 @@ if(!empty($materailAdjustmentlist))
// $edit_Adjustable_qty= '';
$edit_Description= $mat->Description;
$edit_reason= $mat->Reason;
}
}
@ -237,7 +238,7 @@ $(function() {
<div class="form-group">
<?php
$options = array("0"=>'Select');
$options = array("0"=>'Select',"1"=>'Stock on fire',"2"=>'Stolen goods',"3"=>'Damaged Goods',"4"=>'Stock written off',"5"=>'Stock taking results',"6"=>'Inventory revaluation');
// if(!empty($PONO))
// {
@ -304,6 +305,10 @@ $(function() {
<script type="text/javascript">
var reas= <?php echo json_encode($edit_reason, JSON_PRETTY_PRINT) ?>;
//alert(reas)
$('#reason').val(reas);
$('.getdetails').click(function()
{

View File

@ -207,7 +207,7 @@ $(function() {
// endforeach;
// }
$options = array("0"=>'Select',"1"=>'Stock on fire',"2"=>'Stolen goods',"3"=>'Damaged Goods',"4"=>'Stock written off',"5"=>'Stock taking results',"6"=>'Inventory revaluation');
echo form_dropdown('reason', $options,set_value('reason'),'id="reason"' ,'class="form-control select2"' , 'required="true"' );