stock final product changes
This commit is contained in:
parent
92d2e8937a
commit
1225000b73
@ -19,6 +19,7 @@ class batchcard extends BaseController
|
|||||||
parent::__construct();
|
parent::__construct();
|
||||||
$this->load->model('batchcard_model');
|
$this->load->model('batchcard_model');
|
||||||
$this->load->model('inwardgateregister_model');
|
$this->load->model('inwardgateregister_model');
|
||||||
|
$this->load->model('rawmaterialdetails_model');
|
||||||
$this->isLoggedIn();
|
$this->isLoggedIn();
|
||||||
$this->load->helper(array('form','url'));
|
$this->load->helper(array('form','url'));
|
||||||
date_default_timezone_set('Asia/Kolkata');
|
date_default_timezone_set('Asia/Kolkata');
|
||||||
@ -1283,8 +1284,8 @@ class batchcard extends BaseController
|
|||||||
$data['Pack_material'] = $this->batchcard_model->get_packmaterials();
|
$data['Pack_material'] = $this->batchcard_model->get_packmaterials();
|
||||||
$data['supplier'] = $this->batchcard_model->getSupplierlist();
|
$data['supplier'] = $this->batchcard_model->getSupplierlist();
|
||||||
$data['stock_value'] = $this->batchcard_model->getStockValue();
|
$data['stock_value'] = $this->batchcard_model->getStockValue();
|
||||||
|
$data['Records'] = $this->rawmaterialdetails_model->reOrderListing();
|
||||||
|
|
||||||
//print_r($data['allhourdata']);die();
|
|
||||||
$this->global['pageTitle'] = 'Siddharth : Finished Product Batch Card';
|
$this->global['pageTitle'] = 'Siddharth : Finished Product Batch Card';
|
||||||
$this->loadViews("FinalProduct", $this->global,$data,NULL);
|
$this->loadViews("FinalProduct", $this->global,$data,NULL);
|
||||||
}
|
}
|
||||||
@ -1306,6 +1307,8 @@ class batchcard extends BaseController
|
|||||||
$data['supplier'] = $this->batchcard_model->getSupplierlist();
|
$data['supplier'] = $this->batchcard_model->getSupplierlist();
|
||||||
$data['stock_value'] = $this->batchcard_model->getStockValue();
|
$data['stock_value'] = $this->batchcard_model->getStockValue();
|
||||||
|
|
||||||
|
$data['Records'] = $this->rawmaterialdetails_model->reOrderListing();
|
||||||
|
|
||||||
|
|
||||||
$this->global['pageTitle'] = 'Siddharth : Finished Product Batch Card';
|
$this->global['pageTitle'] = 'Siddharth : Finished Product Batch Card';
|
||||||
$this->loadViews("editFinalProduct", $this->global,$data,NULL);
|
$this->loadViews("editFinalProduct", $this->global,$data,NULL);
|
||||||
@ -2036,16 +2039,16 @@ class batchcard extends BaseController
|
|||||||
|
|
||||||
if(count($checkpackid)>0)
|
if(count($checkpackid)>0)
|
||||||
{
|
{
|
||||||
// $this->batchcard_model->update_finalcoproduct($coparray,$coplineId);
|
$this->batchcard_model->update_finalcoproduct($coparray,$coplineId);
|
||||||
// $finalHistoryupdate = $this->batchcard_model->UpdateFinalHistory($copfinal_history,$FPID,$copmaterial);
|
$finalHistoryupdate = $this->batchcard_model->UpdateFinalHistory($copfinal_history,$FPID,$copmaterial);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
// $this->batchcard_model->save_finalcoproduct($coparray);
|
$this->batchcard_model->save_finalcoproduct($coparray);
|
||||||
// $final_cophistory_save= $this->batchcard_model->SaveFinalHistory($copfinal_history);
|
$final_cophistory_save= $this->batchcard_model->SaveFinalHistory($copfinal_history);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -727,7 +727,7 @@ and MaterialCode=? and SupplierID=? ),0) as ReduceQty from T_Material_stock_hist
|
|||||||
and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||||
|
|
||||||
$query = $this->db->query($subQuery,array($MaterialCode,$Supplier,$MaterialCode,$Supplier,$MaterialCode,$startdate,$newdate,$Supplier));
|
$query = $this->db->query($subQuery,array($MaterialCode,$Supplier,$MaterialCode,$Supplier,$MaterialCode,$startdate,$newdate,$Supplier));
|
||||||
//print_r($this->db->last_query());
|
print_r($this->db->last_query());
|
||||||
return $query->result_array();
|
return $query->result_array();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -128,35 +128,33 @@ $(function() {
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-2">
|
||||||
<label>Date</label>
|
<label>Date</label>
|
||||||
<?php
|
<?php
|
||||||
$data = array('name' => 'Date','value' => set_value('Date',$CurrentDate),'id'=>'Date', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;');
|
$data = array('name' => 'Date','value' => set_value('Date',$CurrentDate),'id'=>'Date', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;');
|
||||||
echo form_input($data);
|
echo form_input($data);
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-2">
|
||||||
|
|
||||||
<label>Quantity </label>
|
<label>Quantity </label>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<?php
|
<?php
|
||||||
// $data = array('name' => 'PlaceOforigin','value' => set_value('PlaceOforigin'),'id'=>'PlaceOforigin', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;');
|
|
||||||
// echo form_input($data);
|
$data = array('name' => 'Quantity','value' => set_value('Quantity'),'id'=>'Quantity', 'class' => 'form-control' ,'required' => 'true','onchange'=>'GetBasicvalue();');
|
||||||
$data = array('name' => 'Quantity','value' => set_value('Quantity'),'id'=>'Quantity', 'class' => 'form-control' ,'required' => 'true');
|
|
||||||
echo form_input($data);
|
echo form_input($data);
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-2">
|
||||||
|
|
||||||
<label>Value</label>
|
<label>Value</label>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<?php
|
<?php
|
||||||
// $data = array('name' => 'PlaceOforigin','value' => set_value('PlaceOforigin'),'id'=>'PlaceOforigin', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;');
|
|
||||||
// echo form_input($data);
|
$data = array('name' => 'values','value' => set_value('values'),'id'=>'values', 'class' => 'form-control' ,'required' => 'true','onchange'=>'GetBasicvalue();');
|
||||||
$data = array('name' => 'values','value' => set_value('values'),'id'=>'values', 'class' => 'form-control' ,'required' => 'true');
|
|
||||||
echo form_input($data);
|
echo form_input($data);
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
@ -165,6 +163,19 @@ $(function() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-2">
|
||||||
|
<label>Basic Value </label>
|
||||||
|
<div class="form-group">
|
||||||
|
<?php
|
||||||
|
$data = array('name' => 'basicvalue','value' => set_value('basicvalue'),'id'=>'basicvalue', 'class' => 'form-control' ,'required' => 'true');
|
||||||
|
echo form_input($data);
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -416,9 +427,12 @@ $(function() {
|
|||||||
<th>Supplier</th>
|
<th>Supplier</th>
|
||||||
<th>Quantity</th>
|
<th>Quantity</th>
|
||||||
<th>Price</th>
|
<th>Price</th>
|
||||||
|
<th>Basic Price</th>
|
||||||
<th>Action</th>
|
<th>Action</th>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody id="rawappend">
|
<tbody id="rawappend">
|
||||||
|
|
||||||
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
@ -428,6 +442,18 @@ $(function() {
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="col-md-9" style="text-align: right">
|
||||||
|
Total
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-3">
|
||||||
|
|
||||||
|
<input type="text" name="rawtotal" id="rawtotal" style="border: none" readonly="true">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
<!--second table-->
|
<!--second table-->
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div><legend>Consumables</legend></div>
|
<div><legend>Consumables</legend></div>
|
||||||
@ -668,6 +694,7 @@ $(function() {
|
|||||||
<th>Supplier</th>
|
<th>Supplier</th>
|
||||||
<th>Quantity</th>
|
<th>Quantity</th>
|
||||||
<th>Price</th>
|
<th>Price</th>
|
||||||
|
<th>Basic Price</th>
|
||||||
<th>Action</th>
|
<th>Action</th>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody id="consuappend">
|
<tbody id="consuappend">
|
||||||
@ -675,12 +702,28 @@ $(function() {
|
|||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="col-md-9" style="text-align: right">
|
||||||
|
Total
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-3">
|
||||||
|
|
||||||
|
<input type="text" name="consutotal" id="consutotal" style="border: none" readonly="true">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
<!--third table-->
|
<!--third table-->
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div><legend>Packing Material</legend></div>
|
<div><legend>Packing Material</legend></div>
|
||||||
@ -918,6 +961,7 @@ $(function() {
|
|||||||
<th>Supplier</th>
|
<th>Supplier</th>
|
||||||
<th>Quantity</th>
|
<th>Quantity</th>
|
||||||
<th>Price</th>
|
<th>Price</th>
|
||||||
|
<th>Basic Price</th>
|
||||||
<th>Action</th>
|
<th>Action</th>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody id="packappend">
|
<tbody id="packappend">
|
||||||
@ -925,12 +969,27 @@ $(function() {
|
|||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="col-md-9" style="text-align: right">
|
||||||
|
Total
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-3">
|
||||||
|
|
||||||
|
<input type="text" name="packtotal" id="packtotal" style="border: none" readonly="true">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1151,6 +1210,7 @@ $(function() {
|
|||||||
<th>Date</th>
|
<th>Date</th>
|
||||||
<th>Quantity</th>
|
<th>Quantity</th>
|
||||||
<th>Price</th>
|
<th>Price</th>
|
||||||
|
<th>Basic Price</th>
|
||||||
<th>Action</th>
|
<th>Action</th>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody id="coproductappend">
|
<tbody id="coproductappend">
|
||||||
@ -1158,6 +1218,7 @@ $(function() {
|
|||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
@ -1165,6 +1226,18 @@ $(function() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="col-md-9" style="text-align: right">
|
||||||
|
Total
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-3">
|
||||||
|
|
||||||
|
<input type="text" name="coptotal" id="coptotal" style="border: none" readonly="true">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1196,6 +1269,7 @@ $(function() {
|
|||||||
<td align="left" id="rawsuppliername<%=index%>"><%=Supplier%></td>
|
<td align="left" id="rawsuppliername<%=index%>"><%=Supplier%></td>
|
||||||
<td align="left" id="rawQuantiy<%=index%>"><%=Quantity%></td>
|
<td align="left" id="rawQuantiy<%=index%>"><%=Quantity%></td>
|
||||||
<td align="left" id="rawmaterialPrice<%=index%>"><%=Price%></td>
|
<td align="left" id="rawmaterialPrice<%=index%>"><%=Price%></td>
|
||||||
|
<td align="left" id="rawmaterialbasic<%=index%>"><%=rawBasicPrice%></td>
|
||||||
|
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
@ -1215,6 +1289,7 @@ $(function() {
|
|||||||
<td align="left" id="consusuppliername<%=rootindex%>"><%=Supplier%></td>
|
<td align="left" id="consusuppliername<%=rootindex%>"><%=Supplier%></td>
|
||||||
<td align="left" id="consuQuantiy<%=rootindex%>"><%=Quantity%></td>
|
<td align="left" id="consuQuantiy<%=rootindex%>"><%=Quantity%></td>
|
||||||
<td align="left" id="consumaterialPrice<%=rootindex%>"><%=Price%></td>
|
<td align="left" id="consumaterialPrice<%=rootindex%>"><%=Price%></td>
|
||||||
|
<td align="left" id="consumaterialbasic<%=rootindex%>"><%=consuBasicPrice%></td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<a data-target='#EditRootCausemodal' data-id="<%=rootindex%>" data-userid="<%=rootindex%>" data-toggle="modal" href="#EditRootCausemodal"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the details"></i> </a> </span></a>
|
<a data-target='#EditRootCausemodal' data-id="<%=rootindex%>" data-userid="<%=rootindex%>" data-toggle="modal" href="#EditRootCausemodal"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the details"></i> </a> </span></a>
|
||||||
@ -1231,6 +1306,7 @@ $(function() {
|
|||||||
<td align="left" id="packsuppliername<%=counterindex%>"><%=Supplier%></td>
|
<td align="left" id="packsuppliername<%=counterindex%>"><%=Supplier%></td>
|
||||||
<td align="left" id="packQuantiy<%=counterindex%>"><%=Quantity%></td>
|
<td align="left" id="packQuantiy<%=counterindex%>"><%=Quantity%></td>
|
||||||
<td align="left" id="packmaterialPrice<%=counterindex%>"><%=Price%></td>
|
<td align="left" id="packmaterialPrice<%=counterindex%>"><%=Price%></td>
|
||||||
|
<td align="left" id="packmaterialbasic<%=counterindex%>"><%=packBasicPrice%></td>
|
||||||
|
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
@ -1249,6 +1325,7 @@ $(function() {
|
|||||||
<td align="left" id="Copsuppliername<%=coproductindex%>"><%=Date%></td>
|
<td align="left" id="Copsuppliername<%=coproductindex%>"><%=Date%></td>
|
||||||
<td align="left" id="CopQuantiy<%=coproductindex%>"><%=Quantity%></td>
|
<td align="left" id="CopQuantiy<%=coproductindex%>"><%=Quantity%></td>
|
||||||
<td align="left" id="CopmaterialPrice<%=coproductindex%>"><%=Price%></td>
|
<td align="left" id="CopmaterialPrice<%=coproductindex%>"><%=Price%></td>
|
||||||
|
<td align="left" id="Copmaterialbasic<%=coproductindex%>"><%=CopBasicPrice%></td>
|
||||||
|
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
@ -1273,6 +1350,8 @@ var counteruserid = '';
|
|||||||
var stock = <?php echo json_encode($stock_value, JSON_PRETTY_PRINT) ?>;
|
var stock = <?php echo json_encode($stock_value, JSON_PRETTY_PRINT) ?>;
|
||||||
//console.log(stock);
|
//console.log(stock);
|
||||||
|
|
||||||
|
var lowstock =<?php echo json_encode($Records, JSON_PRETTY_PRINT) ?>;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function addHidden(theForm, key, value)
|
function addHidden(theForm, key, value)
|
||||||
@ -1309,7 +1388,11 @@ else if($('#rawSupplier').val()<='0')
|
|||||||
var rawprice = $('#rawprice').val();
|
var rawprice = $('#rawprice').val();
|
||||||
var rawsuppliername = rawSupplier.options[rawSupplier.selectedIndex].text;
|
var rawsuppliername = rawSupplier.options[rawSupplier.selectedIndex].text;
|
||||||
var temp = index
|
var temp = index
|
||||||
var rawmaterialname ="";
|
var rawmaterialname ="";
|
||||||
|
|
||||||
|
var rawbasic = parseFloat(rawQty) *parseFloat(rawprice);
|
||||||
|
|
||||||
|
|
||||||
// var rawmaterialname = rawmaterialcode.options[rawmaterialcode.selectedIndex].text;
|
// var rawmaterialname = rawmaterialcode.options[rawmaterialcode.selectedIndex].text;
|
||||||
//alert(rawsuppliername);
|
//alert(rawsuppliername);
|
||||||
|
|
||||||
@ -1320,7 +1403,7 @@ var rawmaterialname ="";
|
|||||||
var template = jQuery("#rawmateriallist").html();
|
var template = jQuery("#rawmateriallist").html();
|
||||||
|
|
||||||
// alert(template)
|
// alert(template)
|
||||||
$('#rawappend').append(_.template(template,{index:temp,Material:rawmaterialname,Supplier:rawsuppliername,Quantity:rawQty,Price:rawprice}));
|
$('#rawappend').append(_.template(template,{index:temp,Material:rawmaterialname,Supplier:rawsuppliername,Quantity:rawQty,Price:rawprice,rawBasicPrice:rawbasic}));
|
||||||
|
|
||||||
var theForm = $(".final_product");
|
var theForm = $(".final_product");
|
||||||
|
|
||||||
@ -1330,6 +1413,17 @@ var rawmaterialname ="";
|
|||||||
addHidden(theForm,"rawprice"+temp,rawprice);
|
addHidden(theForm,"rawprice"+temp,rawprice);
|
||||||
addHidden(theForm,"type"+temp,"Raw Material");
|
addHidden(theForm,"type"+temp,"Raw Material");
|
||||||
|
|
||||||
|
addHidden(theForm,"rawbasic"+temp,rawbasic);
|
||||||
|
var total = 0;
|
||||||
|
for(var i=1;i<=temp;i++)
|
||||||
|
{
|
||||||
|
total = parseFloat(total) + parseFloat($("#rawbasic"+i).val());
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#rawtotal').val(total);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('#rawmaterialcode').val("0");
|
$('#rawmaterialcode').val("0");
|
||||||
|
|
||||||
$('rawmaterialcode').select2("val", null);
|
$('rawmaterialcode').select2("val", null);
|
||||||
@ -1379,6 +1473,10 @@ $('.EditItem').click(function()
|
|||||||
var rawQty = $('#Editrawqty').val();
|
var rawQty = $('#Editrawqty').val();
|
||||||
var rawprice = $('#Editrawprice').val();
|
var rawprice = $('#Editrawprice').val();
|
||||||
|
|
||||||
|
var rawbasic = parseFloat(rawQty) *parseFloat(rawprice);
|
||||||
|
|
||||||
|
var rawrow = $('#RawRow').val();
|
||||||
|
|
||||||
var e = document.getElementById("Editrawmaterialcode");
|
var e = document.getElementById("Editrawmaterialcode");
|
||||||
var rawmaterialname = e.options[e.selectedIndex].text;
|
var rawmaterialname = e.options[e.selectedIndex].text;
|
||||||
|
|
||||||
@ -1393,12 +1491,30 @@ $('.EditItem').click(function()
|
|||||||
cellval[3].innerHTML = rawQty;
|
cellval[3].innerHTML = rawQty;
|
||||||
cellval[4].innerHTML = rawprice;
|
cellval[4].innerHTML = rawprice;
|
||||||
|
|
||||||
|
cellval[5].innerHTML = rawbasic;
|
||||||
|
|
||||||
|
|
||||||
$('#rawmaterialcode'+userid).val(rawmaterialcode);
|
$('#rawmaterialcode'+userid).val(rawmaterialcode);
|
||||||
$('#rawSupplierID'+userid).val(rawSupplierID);
|
$('#rawSupplierID'+userid).val(rawSupplierID);
|
||||||
$('#rawQty'+userid).val(rawQty);
|
$('#rawQty'+userid).val(rawQty);
|
||||||
$('#rawprice'+userid).val(rawprice);
|
$('#rawprice'+userid).val(rawprice);
|
||||||
|
|
||||||
|
$('#rawbasic'+userid).val(rawbasic);
|
||||||
|
|
||||||
|
var total = 0;
|
||||||
|
for(var i=1;i<=rawrow;i++)
|
||||||
|
{
|
||||||
|
total = parseFloat(total) + parseFloat($("#rawbasic"+i).val());
|
||||||
|
//console.log(total)
|
||||||
|
|
||||||
|
var aa = $('#rawbasic'+i).val();
|
||||||
|
}
|
||||||
|
|
||||||
|
// console.log(total)
|
||||||
|
$('#rawtotal').val(total);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1430,6 +1546,8 @@ $('.rootaddClick').click(function()
|
|||||||
var consuprice = $('#consuprice').val();
|
var consuprice = $('#consuprice').val();
|
||||||
var rawsuppliername = consuSupplier.options[consuSupplier.selectedIndex].text;
|
var rawsuppliername = consuSupplier.options[consuSupplier.selectedIndex].text;
|
||||||
|
|
||||||
|
var conbasic = parseFloat(consuprice) * parseFloat(consuQty);
|
||||||
|
|
||||||
var g = document.getElementById("consumaterialcode");
|
var g = document.getElementById("consumaterialcode");
|
||||||
var consumaterialname = g.options[g.selectedIndex].text;
|
var consumaterialname = g.options[g.selectedIndex].text;
|
||||||
|
|
||||||
@ -1440,7 +1558,7 @@ $('.rootaddClick').click(function()
|
|||||||
rootindex = parseInt(rootindex)+1;
|
rootindex = parseInt(rootindex)+1;
|
||||||
var template = jQuery("#consumable").html();
|
var template = jQuery("#consumable").html();
|
||||||
//alert(template)
|
//alert(template)
|
||||||
$('#consuappend').append(_.template(template,{rootindex:temp,Material:consumaterialname,Supplier:rawsuppliername,Quantity:consuQty,Price:consuprice}));
|
$('#consuappend').append(_.template(template,{rootindex:temp,Material:consumaterialname,Supplier:rawsuppliername,Quantity:consuQty,Price:consuprice,consuBasicPrice:conbasic}));
|
||||||
|
|
||||||
var theForm = $(".final_product");
|
var theForm = $(".final_product");
|
||||||
|
|
||||||
@ -1450,6 +1568,17 @@ $('.rootaddClick').click(function()
|
|||||||
addHidden(theForm,"consumeprice"+temp,consuprice);
|
addHidden(theForm,"consumeprice"+temp,consuprice);
|
||||||
addHidden(theForm,"consumetype"+temp,"Consumable");
|
addHidden(theForm,"consumetype"+temp,"Consumable");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
addHidden(theForm,"conbasic"+temp,conbasic);
|
||||||
|
var total = 0;
|
||||||
|
for(var i=1;i<=temp;i++)
|
||||||
|
{
|
||||||
|
total = parseFloat(total) + parseFloat($("#conbasic"+i).val());
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#consutotal').val(total);
|
||||||
|
|
||||||
$('#consumaterialcode').val('');
|
$('#consumaterialcode').val('');
|
||||||
$('#consuSupplier').val('');
|
$('#consuSupplier').val('');
|
||||||
$('#consuqty').val('');
|
$('#consuqty').val('');
|
||||||
@ -1498,6 +1627,9 @@ $('.rootEditItem').click(function()
|
|||||||
var editconsuQty = $('#Editconsuqty').val();
|
var editconsuQty = $('#Editconsuqty').val();
|
||||||
var editrawprice = $('#Editconsuprice').val();
|
var editrawprice = $('#Editconsuprice').val();
|
||||||
|
|
||||||
|
var consrow = $('#ConsuRow').val();
|
||||||
|
var conbasic = parseFloat(editrawprice) * parseFloat(editconsuQty);
|
||||||
|
|
||||||
|
|
||||||
var h = document.getElementById("Editconsumaterialcode");
|
var h = document.getElementById("Editconsumaterialcode");
|
||||||
var editconsumaterialname = h.options[h.selectedIndex].text;
|
var editconsumaterialname = h.options[h.selectedIndex].text;
|
||||||
@ -1517,12 +1649,28 @@ $('.rootEditItem').click(function()
|
|||||||
document.getElementById('consuQuantiy'+rootuserid).innerHTML = editconsuQty;
|
document.getElementById('consuQuantiy'+rootuserid).innerHTML = editconsuQty;
|
||||||
document.getElementById('consumaterialPrice'+rootuserid).innerHTML = editrawprice;
|
document.getElementById('consumaterialPrice'+rootuserid).innerHTML = editrawprice;
|
||||||
|
|
||||||
|
document.getElementById('consumaterialbasic'+rootuserid).innerHTML = conbasic;
|
||||||
|
|
||||||
$('#consumematerialcode'+rootuserid).val(editconsumaterialcode);
|
$('#consumematerialcode'+rootuserid).val(editconsumaterialcode);
|
||||||
$('#consumeSupplierID'+rootuserid).val(editconsuSupplierID);
|
$('#consumeSupplierID'+rootuserid).val(editconsuSupplierID);
|
||||||
$('#consumeQty'+rootuserid).val(editconsuQty);
|
$('#consumeQty'+rootuserid).val(editconsuQty);
|
||||||
$('#consumeprice'+rootuserid).val(editrawprice);
|
$('#consumeprice'+rootuserid).val(editrawprice);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$('#conbasic'+rootuserid).val(conbasic);
|
||||||
|
|
||||||
|
var total = 0;
|
||||||
|
for(var i=1;i<=consrow;i++)
|
||||||
|
{
|
||||||
|
total = parseFloat(total) + parseFloat($("#conbasic"+i).val());
|
||||||
|
//console.log(total)
|
||||||
|
}
|
||||||
|
|
||||||
|
// console.log(total)
|
||||||
|
$('#consutotal').val(total);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -1551,6 +1699,9 @@ $('.CounteraddClick').click(function()
|
|||||||
var packprice = $('#packprice').val();
|
var packprice = $('#packprice').val();
|
||||||
var packsuppliername = packSupplier.options[packSupplier.selectedIndex].text;
|
var packsuppliername = packSupplier.options[packSupplier.selectedIndex].text;
|
||||||
|
|
||||||
|
|
||||||
|
var packBasic = parseFloat(packQty)*parseFloat(packprice);
|
||||||
|
|
||||||
var j = document.getElementById("packumaterialcode");
|
var j = document.getElementById("packumaterialcode");
|
||||||
var packmaterilalname = j.options[j.selectedIndex].text;
|
var packmaterilalname = j.options[j.selectedIndex].text;
|
||||||
|
|
||||||
@ -1559,7 +1710,7 @@ $('.CounteraddClick').click(function()
|
|||||||
counterindex = parseInt(counterindex)+1;
|
counterindex = parseInt(counterindex)+1;
|
||||||
var template = jQuery("#packable").html();
|
var template = jQuery("#packable").html();
|
||||||
//alert(template)
|
//alert(template)
|
||||||
$('#packappend').append(_.template(template,{counterindex:temp,Material:packmaterilalname,Supplier:packsuppliername,Quantity:packQty,Price:packprice}));
|
$('#packappend').append(_.template(template,{counterindex:temp,Material:packmaterilalname,Supplier:packsuppliername,Quantity:packQty,Price:packprice,packBasicPrice:packBasic}));
|
||||||
|
|
||||||
var theForm = $(".final_product");
|
var theForm = $(".final_product");
|
||||||
|
|
||||||
@ -1569,6 +1720,20 @@ $('.CounteraddClick').click(function()
|
|||||||
addHidden(theForm,"packprice"+temp,packprice);
|
addHidden(theForm,"packprice"+temp,packprice);
|
||||||
addHidden(theForm,"packtype"+temp,"Packaging");
|
addHidden(theForm,"packtype"+temp,"Packaging");
|
||||||
|
|
||||||
|
|
||||||
|
addHidden(theForm,"pacbasic"+temp,packBasic);
|
||||||
|
var total = 0;
|
||||||
|
for(var i=1;i<=temp;i++)
|
||||||
|
{
|
||||||
|
total = parseFloat(total) + parseFloat($("#pacbasic"+i).val());
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#packtotal').val(total);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('#packumaterialcode').val('');
|
$('#packumaterialcode').val('');
|
||||||
$('#packSupplier').val('');
|
$('#packSupplier').val('');
|
||||||
$('#packqty').val('');
|
$('#packqty').val('');
|
||||||
@ -1620,7 +1785,12 @@ $('.CounterEditItem').click(function()
|
|||||||
var editpackprice = $('#Editpackprice').val();
|
var editpackprice = $('#Editpackprice').val();
|
||||||
var editpacksuppliername = EditpackSupplier.options[EditpackSupplier.selectedIndex].text;
|
var editpacksuppliername = EditpackSupplier.options[EditpackSupplier.selectedIndex].text;
|
||||||
|
|
||||||
|
var editpackbasic = parseFloat(editpackQty)* parseFloat(editpackprice);
|
||||||
|
|
||||||
|
var packrow = $('#PkgRow').val();
|
||||||
|
|
||||||
|
// console.log(editpackbasic);
|
||||||
|
//console.log(cuserid);
|
||||||
|
|
||||||
var k = document.getElementById("Editpackumaterialcode");
|
var k = document.getElementById("Editpackumaterialcode");
|
||||||
var editpackmaterilalname = k.options[k.selectedIndex].text;
|
var editpackmaterilalname = k.options[k.selectedIndex].text;
|
||||||
@ -1645,12 +1815,26 @@ $('.CounterEditItem').click(function()
|
|||||||
document.getElementById('packQuantiy'+cuserid).innerHTML = editpackQty;
|
document.getElementById('packQuantiy'+cuserid).innerHTML = editpackQty;
|
||||||
document.getElementById('packmaterialPrice'+cuserid).innerHTML = editpackprice;
|
document.getElementById('packmaterialPrice'+cuserid).innerHTML = editpackprice;
|
||||||
|
|
||||||
|
document.getElementById('packmaterialbasic'+cuserid).innerHTML = editpackbasic;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('#packmaterialcode'+cuserid).val(editpackmaterialcode);
|
$('#packmaterialcode'+cuserid).val(editpackmaterialcode);
|
||||||
$('#packSupplierID'+cuserid).val(editpackSupplierID);
|
$('#packSupplierID'+cuserid).val(editpackSupplierID);
|
||||||
$('#packQty'+cuserid).val(editpackQty);
|
$('#packQty'+cuserid).val(editpackQty);
|
||||||
$('#packprice'+cuserid).val(editpackprice);
|
$('#packprice'+cuserid).val(editpackprice);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$('#pacbasic'+cuserid).val(editpackbasic);
|
||||||
|
|
||||||
|
var total = 0;
|
||||||
|
for(var i=1;i<=packrow;i++)
|
||||||
|
{
|
||||||
|
total = parseFloat(total) + parseFloat($("#pacbasic"+i).val());
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#packtotal').val(total);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1670,12 +1854,14 @@ $('.CoaddClick').click(function()
|
|||||||
|
|
||||||
var copmaterialcode= $('#coproduct_id').val();
|
var copmaterialcode= $('#coproduct_id').val();
|
||||||
var copDate = $('#CopDate').val();
|
var copDate = $('#CopDate').val();
|
||||||
var newdate = copDate.split("-").reverse().join("-");
|
var newdate = copDate.split("-").reverse().join("-");
|
||||||
var copQty = $('#Coqty').val();
|
var copQty = $('#Coqty').val();
|
||||||
var copprice = $('#Coprice').val();
|
var copprice = $('#Coprice').val();
|
||||||
var copsuppliername = coproduct_id.options[coproduct_id.selectedIndex].text;
|
var copsuppliername = coproduct_id.options[coproduct_id.selectedIndex].text;
|
||||||
|
|
||||||
var m = document.getElementById("coproduct_id");
|
var copbasic = parseFloat(copQty) * parseFloat(copprice);
|
||||||
|
|
||||||
|
var m = document.getElementById("coproduct_id");
|
||||||
var copproduct = m.options[m.selectedIndex].text;
|
var copproduct = m.options[m.selectedIndex].text;
|
||||||
|
|
||||||
|
|
||||||
@ -1683,7 +1869,7 @@ var m = document.getElementById("coproduct_id");
|
|||||||
coproductindex = parseInt(coproductindex)+1;
|
coproductindex = parseInt(coproductindex)+1;
|
||||||
var template = jQuery("#coproduct").html();
|
var template = jQuery("#coproduct").html();
|
||||||
//alert(copsuppliername)
|
//alert(copsuppliername)
|
||||||
$('#coproductappend').append(_.template(template,{coproductindex:temp,Material:copproduct,Date:copDate,Quantity:copQty,Price:copprice}));
|
$('#coproductappend').append(_.template(template,{coproductindex:temp,Material:copproduct,Date:copDate,Quantity:copQty,Price:copprice,CopBasicPrice:copbasic}));
|
||||||
|
|
||||||
var theForm = $(".final_product");
|
var theForm = $(".final_product");
|
||||||
|
|
||||||
@ -1693,6 +1879,18 @@ var m = document.getElementById("coproduct_id");
|
|||||||
addHidden(theForm,"Copprice"+temp,copprice);
|
addHidden(theForm,"Copprice"+temp,copprice);
|
||||||
addHidden(theForm,"Coptype"+temp,"CoProduct");
|
addHidden(theForm,"Coptype"+temp,"CoProduct");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
addHidden(theForm,"copbasic"+temp,copbasic);
|
||||||
|
var total = 0;
|
||||||
|
for(var i=1;i<=temp;i++)
|
||||||
|
{
|
||||||
|
total = parseFloat(total) + parseFloat($("#copbasic"+i).val());
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#coptotal').val(total);
|
||||||
|
|
||||||
|
|
||||||
$('#coproduct_id').val('');
|
$('#coproduct_id').val('');
|
||||||
$('#CopDate').val('');
|
$('#CopDate').val('');
|
||||||
$('#Coqty').val('');
|
$('#Coqty').val('');
|
||||||
@ -1744,6 +1942,8 @@ $('.CoEditItem').click(function()
|
|||||||
var editcopprice = $('#EditCoprice').val();
|
var editcopprice = $('#EditCoprice').val();
|
||||||
var editcopproduct = Editcoproduct_id.options[Editcoproduct_id.selectedIndex].text;
|
var editcopproduct = Editcoproduct_id.options[Editcoproduct_id.selectedIndex].text;
|
||||||
|
|
||||||
|
var copbasic = parseFloat(editcopqty)*parseFloat(editcopprice);
|
||||||
|
var coprow = $('#CopRow').val();
|
||||||
|
|
||||||
var n = document.getElementById("Editcoproduct_id");
|
var n = document.getElementById("Editcoproduct_id");
|
||||||
var editcopproduct = n.options[n.selectedIndex].text;
|
var editcopproduct = n.options[n.selectedIndex].text;
|
||||||
@ -1762,11 +1962,26 @@ $('.CoEditItem').click(function()
|
|||||||
document.getElementById('CopQuantiy'+cuserid).innerHTML = editcopqty;
|
document.getElementById('CopQuantiy'+cuserid).innerHTML = editcopqty;
|
||||||
document.getElementById('CopmaterialPrice'+cuserid).innerHTML = editcopprice;
|
document.getElementById('CopmaterialPrice'+cuserid).innerHTML = editcopprice;
|
||||||
|
|
||||||
|
document.getElementById('Copmaterialbasic'+cuserid).innerHTML = copbasic;
|
||||||
|
|
||||||
$('#Copmaterialcode'+cuserid).val(editcoproductid);
|
$('#Copmaterialcode'+cuserid).val(editcoproductid);
|
||||||
$('#CopDate'+cuserid).val(newdate);
|
$('#CopDate'+cuserid).val(newdate);
|
||||||
$('#CopQty'+cuserid).val(editcopqty);
|
$('#CopQty'+cuserid).val(editcopqty);
|
||||||
$('#Copprice'+cuserid).val(editcopprice);
|
$('#Copprice'+cuserid).val(editcopprice);
|
||||||
|
|
||||||
|
|
||||||
|
$('#copbasic'+cuserid).val(copbasic);
|
||||||
|
|
||||||
|
var total = 0;
|
||||||
|
for(var i=1;i<=coprow;i++)
|
||||||
|
{
|
||||||
|
total = parseFloat(total) + parseFloat($("#copbasic"+i).val());
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#coptotal').val(total);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1774,49 +1989,83 @@ $('.CoEditItem').click(function()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function lowqtycheck(type)
|
||||||
|
{
|
||||||
|
//alert(type)
|
||||||
|
console.log(lowstock);
|
||||||
|
var materialcode = '';
|
||||||
|
|
||||||
|
if(type == 'rawmaterial')
|
||||||
|
{
|
||||||
|
materialcode = $('#rawmaterialcode').val();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(type == 'consumables')
|
||||||
|
{
|
||||||
|
materialcode = $('#consumaterialcode').val();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(type == 'packing')
|
||||||
|
{
|
||||||
|
materialcode = $('#packumaterialcode').val();
|
||||||
|
}
|
||||||
|
|
||||||
|
$.each(lowstock, function(id, obj) {
|
||||||
|
if(obj.MaterialCode == materialcode)
|
||||||
|
{
|
||||||
|
alert('Stock is running Low !! available Stock'+obj.Current_stock);
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('#rawmaterialcode').change(function()
|
$('#rawmaterialcode').change(function()
|
||||||
{
|
{
|
||||||
|
var rawSupplier = $('#rawSupplier').val();
|
||||||
var type = "rawmaterial";
|
var type = "rawmaterial";
|
||||||
ResultantQty(type);
|
lowqtycheck(type);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#rawSupplier').change(function()
|
// $('#rawSupplier').change(function()
|
||||||
{
|
// {
|
||||||
var type = "rawmaterial";
|
// var type = "rawmaterial";
|
||||||
ResultantQty(type);
|
// lowqtycheck(type);
|
||||||
|
|
||||||
});
|
// });
|
||||||
|
|
||||||
$('#consumaterialcode').change(function()
|
$('#consumaterialcode').change(function()
|
||||||
{
|
{
|
||||||
var type = "consumables";
|
var type = "consumables";
|
||||||
ResultantQty(type);
|
lowqtycheck(type);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#consuSupplier').change(function()
|
// $('#consuSupplier').change(function()
|
||||||
{
|
// {
|
||||||
var type = "consumables";
|
// var type = "consumables";
|
||||||
ResultantQty(type);
|
// lowqtycheck(type);
|
||||||
|
|
||||||
});
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('#packumaterialcode').change(function()
|
$('#packumaterialcode').change(function()
|
||||||
{
|
{
|
||||||
var type = "packing";
|
var type = "packing";
|
||||||
ResultantQty(type);
|
lowqtycheck(type);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#packSupplier').change(function()
|
// $('#packSupplier').change(function()
|
||||||
{
|
// {
|
||||||
var type = "packing";
|
// var type = "packing";
|
||||||
ResultantQty(type);
|
// lowqtycheck(type);
|
||||||
|
|
||||||
});
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1826,54 +2075,99 @@ $('#Editrawmaterialcode').change(function()
|
|||||||
{
|
{
|
||||||
|
|
||||||
var type = "rawmaterial";
|
var type = "rawmaterial";
|
||||||
EditResultantQty(type);
|
Editlowqtycheck(type);
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#EditrawSupplier').change(function()
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
var type = "rawmaterial";
|
|
||||||
EditResultantQty(type);
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('#EditconsuSupplier').change(function()
|
|
||||||
{
|
|
||||||
var type = "consumables";
|
|
||||||
EditResultantQty(type);
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#Editconsumaterialcode').change(function()
|
$('#Editconsumaterialcode').change(function()
|
||||||
{
|
{
|
||||||
var type = "consumables";
|
var type = "consumables";
|
||||||
EditResultantQty(type);
|
Editlowqtycheck(type);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('#EditpackSupplier').change(function()
|
|
||||||
{
|
|
||||||
var type = "packing";
|
|
||||||
EditResultantQty(type);
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#Editpackumaterialcode').change(function()
|
$('#Editpackumaterialcode').change(function()
|
||||||
{
|
{
|
||||||
var type = "packing";
|
var type = "packing";
|
||||||
EditResultantQty(type);
|
Editlowqtycheck(type);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function Editlowqtycheck(type)
|
||||||
|
{
|
||||||
|
//alert(type)
|
||||||
|
//console.log(lowstock);
|
||||||
|
var materialcode = '';
|
||||||
|
|
||||||
|
if(type == 'rawmaterial')
|
||||||
|
{
|
||||||
|
materialcode = $('#Editrawmaterialcode').val();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(type == 'consumables')
|
||||||
|
{
|
||||||
|
materialcode = $('#Editconsumaterialcode').val();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(type == 'packing')
|
||||||
|
{
|
||||||
|
materialcode = $('#Editpackumaterialcode').val();
|
||||||
|
}
|
||||||
|
|
||||||
|
$.each(lowstock, function(id, obj) {
|
||||||
|
if(obj.MaterialCode == materialcode)
|
||||||
|
{
|
||||||
|
alert('Stock is running Low !! available Stock is '+obj.Current_stock);
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// $('#EditrawSupplier').change(function()
|
||||||
|
// {
|
||||||
|
|
||||||
|
|
||||||
|
// var type = "rawmaterial";
|
||||||
|
// EditResultantQty(type);
|
||||||
|
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// $('#EditconsuSupplier').change(function()
|
||||||
|
// {
|
||||||
|
// var type = "consumables";
|
||||||
|
// EditResultantQty(type);
|
||||||
|
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// $('#EditpackSupplier').change(function()
|
||||||
|
// {
|
||||||
|
// var type = "packing";
|
||||||
|
// EditResultantQty(type);
|
||||||
|
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var today = new Date();
|
var today = new Date();
|
||||||
var dd = today.getDate();
|
var dd = today.getDate();
|
||||||
var mm = today.getMonth()+1; //January is 0!
|
var mm = today.getMonth()+1; //January is 0!
|
||||||
@ -3118,78 +3412,29 @@ else{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function rawqtycheck()
|
|
||||||
{
|
|
||||||
// alert(rawresultqty);
|
|
||||||
|
|
||||||
// var enterrawqty= $('#rawqty').val();
|
|
||||||
// if(rawresultqty < enterrawqty)
|
function GetBasicvalue()
|
||||||
// {
|
{
|
||||||
// alert("You are Exceeding the Stock Qtantity!! Avalable stock is"+rawresultqty);
|
var basic =0;
|
||||||
// }
|
var qty= $('#Quantity').val();
|
||||||
|
var val = $('#values').val();
|
||||||
|
|
||||||
|
if(qty != '' && val !='')
|
||||||
|
{
|
||||||
|
basic = parseFloat(qty)*parseFloat(val);
|
||||||
|
$('#basicvalue').val(basic);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//alert('Please Enter Quantity and Value');
|
||||||
|
$('#basicvalue').val(0);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -5,6 +5,7 @@ $qty = '';
|
|||||||
$value = '';
|
$value = '';
|
||||||
$finProduct = '';
|
$finProduct = '';
|
||||||
$FPId= '';
|
$FPId= '';
|
||||||
|
$basicvalue = '';
|
||||||
if(!empty($masterproduct))
|
if(!empty($masterproduct))
|
||||||
{
|
{
|
||||||
foreach($masterproduct as $ma)
|
foreach($masterproduct as $ma)
|
||||||
@ -16,6 +17,8 @@ if(!empty($masterproduct))
|
|||||||
$value = $ma->Price;
|
$value = $ma->Price;
|
||||||
$finProduct = $ma->MaterialCode;
|
$finProduct = $ma->MaterialCode;
|
||||||
$FPId = $ma->FPId;
|
$FPId = $ma->FPId;
|
||||||
|
$basicvalue = $qty*$value;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,33 +135,33 @@ $(function() {
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-2">
|
||||||
<label>Date</label>
|
<label>Date</label>
|
||||||
<?php
|
<?php
|
||||||
$data = array('name' => 'Date','value' => set_value('Date',$date),'id'=>'Date', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;');
|
$data = array('name' => 'Date','value' => set_value('Date',$date),'id'=>'Date', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;');
|
||||||
echo form_input($data);
|
echo form_input($data);
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-2">
|
||||||
|
|
||||||
<label>Quantity </label>
|
<label>Quantity </label>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$data = array('name' => 'Quantity','value' => set_value('Quantity',$qty),'id'=>'Quantity', 'class' => 'form-control' ,'required' => 'true');
|
$data = array('name' => 'Quantity','value' => set_value('Quantity',$qty),'id'=>'Quantity', 'class' => 'form-control' ,'required' => 'true','onchange'=>'GetBasicvalue();');
|
||||||
echo form_input($data);
|
echo form_input($data);
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-2">
|
||||||
|
|
||||||
<label>Value</label>
|
<label>Value</label>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$data = array('name' => 'values','value' => set_value('values',$value),'id'=>'values', 'class' => 'form-control' ,'required' => 'true');
|
$data = array('name' => 'values','value' => set_value('values',$value),'id'=>'values', 'class' => 'form-control' ,'required' => 'true','onchange'=>'GetBasicvalue();');
|
||||||
echo form_input($data);
|
echo form_input($data);
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
@ -168,6 +171,20 @@ $(function() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-2">
|
||||||
|
<label>Basic Value </label>
|
||||||
|
<div class="form-group">
|
||||||
|
<?php
|
||||||
|
$data = array('name' => 'basicvalue','value' => set_value('basicvalue',$basicvalue),'id'=>'basicvalue', 'class' => 'form-control' ,'required' => 'true');
|
||||||
|
echo form_input($data);
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -401,13 +418,17 @@ $(function() {
|
|||||||
<th>Supplier</th>
|
<th>Supplier</th>
|
||||||
<th>Quantity</th>
|
<th>Quantity</th>
|
||||||
<th>Price</th>
|
<th>Price</th>
|
||||||
|
<th>Basic Price</th>
|
||||||
<th>Action</th>
|
<th>Action</th>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody id="rawappend">
|
<tbody id="rawappend">
|
||||||
<?php if(!empty($rawmaterial)){
|
<?php if(!empty($rawmaterial)){
|
||||||
$index=0;
|
$index=0;
|
||||||
|
$rawtotal =0;
|
||||||
foreach($rawmaterial as $raw){
|
foreach($rawmaterial as $raw){
|
||||||
$index= $index+1; ?>
|
$index= $index+1;
|
||||||
|
$basicPrice = ($raw->Quantity)*($raw->Price);
|
||||||
|
$rawtotal = $rawtotal+$basicPrice; ?>
|
||||||
<tr id="rawmat<?php echo $index ; ?>">
|
<tr id="rawmat<?php echo $index ; ?>">
|
||||||
<td><?php echo $index;?></td>
|
<td><?php echo $index;?></td>
|
||||||
<td id="rawmaterialedit<?php echo $index?>"><?php echo $raw->MaterialCode."-".$raw->MaterialName?></td>
|
<td id="rawmaterialedit<?php echo $index?>"><?php echo $raw->MaterialCode."-".$raw->MaterialName?></td>
|
||||||
@ -416,6 +437,12 @@ $(function() {
|
|||||||
<td id="rawQuantiy<?php echo $index?>"><?php echo $raw->Quantity;?></td>
|
<td id="rawQuantiy<?php echo $index?>"><?php echo $raw->Quantity;?></td>
|
||||||
<td id="rawmaterialPrice<?php echo $index?>"><?php echo $raw->Price?></td>
|
<td id="rawmaterialPrice<?php echo $index?>"><?php echo $raw->Price?></td>
|
||||||
|
|
||||||
|
<td id="rawmaterialbasic<?php echo $index?>"><?php echo $basicPrice ?></td>
|
||||||
|
|
||||||
|
|
||||||
|
<input type="hidden" name="<?php echo 'rawbasic'.$index ?>" id="<?php echo 'rawbasic'.$index ?>" value="<?php echo $basicPrice ; ?>" readonly/>
|
||||||
|
|
||||||
|
|
||||||
<input type="hidden" name="<?php echo 'RawId'.$index ?>" id="<?php echo 'RawId'.$index ?>" value="<?php echo $raw->RawId ; ?>" readonly/>
|
<input type="hidden" name="<?php echo 'RawId'.$index ?>" id="<?php echo 'RawId'.$index ?>" value="<?php echo $raw->RawId ; ?>" readonly/>
|
||||||
|
|
||||||
<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 'rawmaterialcode'.$index ?>" id="<?php echo 'rawmaterialcode'.$index ?>" value="<?php echo $raw->MaterialCode ; ?>" readonly/>
|
||||||
@ -447,6 +474,24 @@ $(function() {
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="col-md-9" style="text-align: right">
|
||||||
|
Total
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-3">
|
||||||
|
|
||||||
|
<input type="text" name="rawtotal" id="rawtotal" value="<?php echo $rawtotal?>" style="border: none" readonly="true">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--second table-->
|
<!--second table-->
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div><legend>Consumables</legend></div>
|
<div><legend>Consumables</legend></div>
|
||||||
@ -661,14 +706,18 @@ $(function() {
|
|||||||
<th>Supplier</th>
|
<th>Supplier</th>
|
||||||
<th>Quantity</th>
|
<th>Quantity</th>
|
||||||
<th>Price</th>
|
<th>Price</th>
|
||||||
|
<th>Basic Price</th>
|
||||||
<th>Action</th>
|
<th>Action</th>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody id="consuappend">
|
<tbody id="consuappend">
|
||||||
<?php if(!empty($consumaterial)){
|
<?php if(!empty($consumaterial)){
|
||||||
// print_r($consumaterial);
|
// print_r($consumaterial);
|
||||||
$inde=0;
|
$inde=0;
|
||||||
|
$consubasicTotal =0;
|
||||||
foreach($consumaterial as $cou){
|
foreach($consumaterial as $cou){
|
||||||
$inde=$inde+1;?>
|
$inde=$inde+1;
|
||||||
|
$consubasic = ($cou->Quantity)*($cou->Price);
|
||||||
|
$consubasicTotal = $consubasicTotal+$consubasic; ?>
|
||||||
<tr id="consumable<?php echo $inde;?>">
|
<tr id="consumable<?php echo $inde;?>">
|
||||||
<td ><?php echo $inde?></td>
|
<td ><?php echo $inde?></td>
|
||||||
<td id="consumaterial<?php echo $inde?>"><?php echo $cou->MaterialCode."-".$cou->MaterialName?></td>
|
<td id="consumaterial<?php echo $inde?>"><?php echo $cou->MaterialCode."-".$cou->MaterialName?></td>
|
||||||
@ -678,6 +727,7 @@ $(function() {
|
|||||||
|
|
||||||
|
|
||||||
<td id="consumaterialPrice<?php echo $inde?>"><?php echo $cou->Price?></td>
|
<td id="consumaterialPrice<?php echo $inde?>"><?php echo $cou->Price?></td>
|
||||||
|
<td id="consumaterialbasic<?php echo $inde?>"><?php echo $consubasic;?></td>
|
||||||
<td>
|
<td>
|
||||||
|
|
||||||
<a data-target='#EditRootCausemodal' data-id="<?php echo $inde ; ?>" data-userid="<?php echo $inde ; ?>" data-toggle="modal" href="#EditRootCausemodal"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit;"></i> </a> <!-- <a href='#' onclick = "DeleteCounterRow(<?php echo $in ; ?>)" class="link" data-id="<?php echo $inde ; ?>" data-userid="<?php echo $in ; ?>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a> -->
|
<a data-target='#EditRootCausemodal' data-id="<?php echo $inde ; ?>" data-userid="<?php echo $inde ; ?>" data-toggle="modal" href="#EditRootCausemodal"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit;"></i> </a> <!-- <a href='#' onclick = "DeleteCounterRow(<?php echo $in ; ?>)" class="link" data-id="<?php echo $inde ; ?>" data-userid="<?php echo $in ; ?>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a> -->
|
||||||
@ -685,6 +735,10 @@ $(function() {
|
|||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
<input type="hidden" name="<?php echo 'conbasic'.$inde ?>" id="<?php echo 'conbasic'.$inde ?>" value="<?php echo $consubasic ; ?>" />
|
||||||
|
|
||||||
|
|
||||||
<input type="hidden" name="<?php echo 'Consumable'.$inde ?>" id="<?php echo 'Consumable'.$inde ?>" value="<?php echo $cou->ConId ; ?>" />
|
<input type="hidden" name="<?php echo 'Consumable'.$inde ?>" id="<?php echo 'Consumable'.$inde ?>" value="<?php echo $cou->ConId ; ?>" />
|
||||||
|
|
||||||
<input type="hidden" name="<?php echo 'consumematerialcode'.$inde ?>" id="<?php echo 'consumematerialcode'.$inde ?>" value="<?php echo $cou->MaterialCode ; ?>" />
|
<input type="hidden" name="<?php echo 'consumematerialcode'.$inde ?>" id="<?php echo 'consumematerialcode'.$inde ?>" value="<?php echo $cou->MaterialCode ; ?>" />
|
||||||
@ -711,6 +765,22 @@ $(function() {
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="col-md-9" style="text-align: right">
|
||||||
|
Total
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-3">
|
||||||
|
|
||||||
|
<input type="text" name="consutotal" id="consutotal" style="border: none" value="<?php echo $consubasicTotal?>" readonly="true">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--third table-->
|
<!--third table-->
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div><legend>Packing Material</legend></div>
|
<div><legend>Packing Material</legend></div>
|
||||||
@ -922,14 +992,18 @@ $(function() {
|
|||||||
<th>Supplier</th>
|
<th>Supplier</th>
|
||||||
<th>Quantity</th>
|
<th>Quantity</th>
|
||||||
<th>Price</th>
|
<th>Price</th>
|
||||||
|
<th>Basic Price</th>
|
||||||
<th>Action</th>
|
<th>Action</th>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
<tbody id="packappend">
|
<tbody id="packappend">
|
||||||
<?php if(!empty($packagematerial)){
|
<?php if(!empty($packagematerial)){
|
||||||
$intt=0;
|
$intt=0;
|
||||||
|
$packbasicTotal = 0;
|
||||||
foreach($packagematerial as $pac){
|
foreach($packagematerial as $pac){
|
||||||
$intt=$intt+1;?>
|
$intt=$intt+1;
|
||||||
|
$packbasic = ($pac->Quantity)*($pac->Price);
|
||||||
|
$packbasicTotal = $packbasicTotal+$packbasic;?>
|
||||||
|
|
||||||
|
|
||||||
<tr id="pack<?php echo $intt;?>">
|
<tr id="pack<?php echo $intt;?>">
|
||||||
@ -938,12 +1012,17 @@ $(function() {
|
|||||||
<td id="packsuppliername<?php echo $intt?>"><?php echo $pac->SupplierID."-".$pac->SupplierName?></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="packQuantiy<?php echo $intt?>"><?php echo $pac->Quantity?></td>
|
||||||
<td id="packmaterialPrice<?php echo $intt?>"><?php echo $pac->Price?></td>
|
<td id="packmaterialPrice<?php echo $intt?>"><?php echo $pac->Price?></td>
|
||||||
|
<td id="packmaterialbasic<?php echo $intt?>"><?php echo $packbasic?></td>
|
||||||
<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 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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
<input type="hidden" name="<?php echo 'pacbasic'.$intt ?>" id="<?php echo 'pacbasic'.$intt ?>" value="<?php echo $packbasic ; ?>" />
|
||||||
|
|
||||||
|
|
||||||
<input type="hidden" name="<?php echo 'packId'.$intt ?>" id="<?php echo 'packId'.$intt ?>" value="<?php echo $pac->PackId ; ?>" />
|
<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 'packmaterialcode'.$intt ?>" id="<?php echo 'packmaterialcode'.$intt ?>" value="<?php echo $pac->MaterialCode ; ?>" />
|
||||||
@ -968,7 +1047,18 @@ $(function() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="col-md-9" style="text-align: right">
|
||||||
|
Total
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-3">
|
||||||
|
|
||||||
|
<input type="text" name="packtotal" id="packtotal" style="border: none" value="<?php echo $packbasicTotal?>" readonly="true">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1175,6 +1265,7 @@ $(function() {
|
|||||||
<th>Date</th>
|
<th>Date</th>
|
||||||
<th>Quantity</th>
|
<th>Quantity</th>
|
||||||
<th>Price</th>
|
<th>Price</th>
|
||||||
|
<th>Basic Price</th>
|
||||||
<th>Action</th>
|
<th>Action</th>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody id="coproductappend">
|
<tbody id="coproductappend">
|
||||||
@ -1182,11 +1273,14 @@ $(function() {
|
|||||||
<?php
|
<?php
|
||||||
if(!empty($coproductmaterial)){
|
if(!empty($coproductmaterial)){
|
||||||
$ind=0;
|
$ind=0;
|
||||||
|
$CopBasicTotal=0;
|
||||||
foreach($coproductmaterial as $dis){//print_r($dis);
|
foreach($coproductmaterial as $dis){//print_r($dis);
|
||||||
$ind= $ind+1;
|
$ind= $ind+1;
|
||||||
|
|
||||||
$Copdt = new DateTime($dis['CoDate']);
|
$Copdt = new DateTime($dis['CoDate']);
|
||||||
$Coprdate = $Copdt->format('d-m-Y');
|
$Coprdate = $Copdt->format('d-m-Y');
|
||||||
|
$copbasic = ($dis['Quantity'])*($dis['Price']);
|
||||||
|
$CopBasicTotal = $CopBasicTotal+ $copbasic;
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@ -1206,6 +1300,11 @@ $(function() {
|
|||||||
|
|
||||||
<td id="CopQuantiy<?php echo $ind?>"><?php echo $dis['Quantity']?></td>
|
<td id="CopQuantiy<?php echo $ind?>"><?php echo $dis['Quantity']?></td>
|
||||||
<td id="CopmaterialPrice<?php echo $ind?>"><?php echo $dis['Price']?></td>
|
<td id="CopmaterialPrice<?php echo $ind?>"><?php echo $dis['Price']?></td>
|
||||||
|
<td id="Copmaterialbasic<?php echo $ind?>"><?php echo $copbasic;?></td>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<input type="hidden" name="<?php echo 'copbasic'.$ind ?>" id="<?php echo 'copbasic'.$ind ?>" value="<?php echo $copbasic ; ?>" readonly/>
|
||||||
|
|
||||||
|
|
||||||
<input type="hidden" name="<?php echo 'CopId'.$ind ?>" id="<?php echo 'CopId'.$ind ?>" value="<?php echo $dis['CoId'] ; ?>" readonly/>
|
<input type="hidden" name="<?php echo 'CopId'.$ind ?>" id="<?php echo 'CopId'.$ind ?>" value="<?php echo $dis['CoId'] ; ?>" readonly/>
|
||||||
@ -1235,6 +1334,20 @@ $(function() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="col-md-9" style="text-align: right">
|
||||||
|
Total
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-3">
|
||||||
|
|
||||||
|
<input type="text" name="coptotal" id="coptotal" style="border: none" value="<?php echo $CopBasicTotal?>" readonly="true">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1267,6 +1380,7 @@ $(function() {
|
|||||||
<td align="left" id="rawsuppliername<%=index%>"><%=Supplier%></td>
|
<td align="left" id="rawsuppliername<%=index%>"><%=Supplier%></td>
|
||||||
<td align="left" id="rawQuantiy<%=index%>"><%=Quantity%></td>
|
<td align="left" id="rawQuantiy<%=index%>"><%=Quantity%></td>
|
||||||
<td align="left" id="rawmaterialPrice<%=index%>"><%=Price%></td>
|
<td align="left" id="rawmaterialPrice<%=index%>"><%=Price%></td>
|
||||||
|
<td align="left" id="rawmaterialbasic<%=index%>"><%=rawBasicPrice%></td>
|
||||||
|
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
@ -1286,6 +1400,8 @@ $(function() {
|
|||||||
<td align="left" id="consuQuantiy<%=rootindex%>"><%=Quantity%></td>
|
<td align="left" id="consuQuantiy<%=rootindex%>"><%=Quantity%></td>
|
||||||
<td align="left" id="consumaterialPrice<%=rootindex%>"><%=Price%></td>
|
<td align="left" id="consumaterialPrice<%=rootindex%>"><%=Price%></td>
|
||||||
|
|
||||||
|
<td align="left" id="consumaterialbasic<%=rootindex%>"><%=consuBasicPrice%></td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<a data-target='#EditRootCausemodal' data-id="<%=rootindex%>" data-userid="<%=rootindex%>" data-toggle="modal" href="#EditRootCausemodal"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the details"></i> </a> </span></a>
|
<a data-target='#EditRootCausemodal' data-id="<%=rootindex%>" data-userid="<%=rootindex%>" data-toggle="modal" href="#EditRootCausemodal"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the details"></i> </a> </span></a>
|
||||||
|
|
||||||
@ -1302,6 +1418,8 @@ $(function() {
|
|||||||
<td align="left" id="packQuantiy<%=counterindex%>"><%=Quantity%></td>
|
<td align="left" id="packQuantiy<%=counterindex%>"><%=Quantity%></td>
|
||||||
<td align="left" id="packmaterialPrice<%=counterindex%>"><%=Price%></td>
|
<td align="left" id="packmaterialPrice<%=counterindex%>"><%=Price%></td>
|
||||||
|
|
||||||
|
<td align="left" id="packmaterialbasic<%=counterindex%>"><%=packBasicPrice%></td>
|
||||||
|
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<a data-target='#EditCounter' data-id="<%=counterindex%>" data-userid="<%=counterindex%>" data-toggle="modal" href="#editimportpomodel"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit details"></i> </a></span></a>
|
<a data-target='#EditCounter' data-id="<%=counterindex%>" data-userid="<%=counterindex%>" data-toggle="modal" href="#editimportpomodel"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit details"></i> </a></span></a>
|
||||||
@ -1320,6 +1438,8 @@ $(function() {
|
|||||||
<td align="left" id="CopQuantiy<%=coproductindex%>"><%=Quantity%></td>
|
<td align="left" id="CopQuantiy<%=coproductindex%>"><%=Quantity%></td>
|
||||||
<td align="left" id="CopmaterialPrice<%=coproductindex%>"><%=Price%></td>
|
<td align="left" id="CopmaterialPrice<%=coproductindex%>"><%=Price%></td>
|
||||||
|
|
||||||
|
<td align="left" id="Copmaterialbasic<%=coproductindex%>"><%=CopBasicPrice%></td>
|
||||||
|
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<a data-target='#EditCoproduct' data-id="<%=coproductindex%>" data-userid="<%=coproductindex%>" data-toggle="modal" href="#editimportpomodel"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit details"></i> </a></span></a>
|
<a data-target='#EditCoproduct' data-id="<%=coproductindex%>" data-userid="<%=coproductindex%>" data-toggle="modal" href="#editimportpomodel"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit details"></i> </a></span></a>
|
||||||
@ -1395,6 +1515,8 @@ else if($('#rawSupplier').val()=='0')
|
|||||||
var e = document.getElementById("rawmaterialcode");
|
var e = document.getElementById("rawmaterialcode");
|
||||||
var rawmaterialname = e.options[e.selectedIndex].text;
|
var rawmaterialname = e.options[e.selectedIndex].text;
|
||||||
|
|
||||||
|
var rawbasic = parseFloat(rawQty) *parseFloat(rawprice);
|
||||||
|
|
||||||
// var materialnam=rawmaterialname.substring(0, rawmaterialname.indexOf("-"));
|
// var materialnam=rawmaterialname.substring(0, rawmaterialname.indexOf("-"));
|
||||||
|
|
||||||
// alert(materialnam);
|
// alert(materialnam);
|
||||||
@ -1406,7 +1528,7 @@ else if($('#rawSupplier').val()=='0')
|
|||||||
var template = jQuery("#rawmateriallist").html();
|
var template = jQuery("#rawmateriallist").html();
|
||||||
|
|
||||||
// alert(template)
|
// alert(template)
|
||||||
$('#rawappend').append(_.template(template,{index:temp,Material:rawmaterialname,Supplier:rawsuppliername,Quantity:rawQty,Price:rawprice}));
|
$('#rawappend').append(_.template(template,{index:temp,Material:rawmaterialname,Supplier:rawsuppliername,Quantity:rawQty,Price:rawprice,rawBasicPrice:rawbasic}));
|
||||||
|
|
||||||
var theForm = $(".final_product");
|
var theForm = $(".final_product");
|
||||||
|
|
||||||
@ -1418,6 +1540,16 @@ else if($('#rawSupplier').val()=='0')
|
|||||||
addHidden(theForm,"rawSuppliername"+temp,rawsuppliername);
|
addHidden(theForm,"rawSuppliername"+temp,rawsuppliername);
|
||||||
addHidden(theForm,"rawmaterialname"+temp,rawmaterialname);
|
addHidden(theForm,"rawmaterialname"+temp,rawmaterialname);
|
||||||
|
|
||||||
|
|
||||||
|
addHidden(theForm,"rawbasic"+temp,rawbasic);
|
||||||
|
var total = 0;
|
||||||
|
for(var i=1;i<=temp;i++)
|
||||||
|
{
|
||||||
|
total = parseFloat(total) + parseFloat($("#rawbasic"+i).val());
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#rawtotal').val(total);
|
||||||
|
|
||||||
$('#rawmaterialcode').val('');
|
$('#rawmaterialcode').val('');
|
||||||
$('#rawSupplier').val('');
|
$('#rawSupplier').val('');
|
||||||
$('#rawqty').val('');
|
$('#rawqty').val('');
|
||||||
@ -1481,6 +1613,11 @@ else{
|
|||||||
var rawQty = $('#Editrawqty').val();
|
var rawQty = $('#Editrawqty').val();
|
||||||
var rawprice = $('#Editrawprice').val();
|
var rawprice = $('#Editrawprice').val();
|
||||||
|
|
||||||
|
var rawbasic = parseFloat(rawQty) *parseFloat(rawprice);
|
||||||
|
|
||||||
|
//console.log(rawbasic);
|
||||||
|
var rawrow = $('#RawRow').val();
|
||||||
|
|
||||||
var tr= document.getElementById(userid);
|
var tr= document.getElementById(userid);
|
||||||
//alert("tr"+tr)
|
//alert("tr"+tr)
|
||||||
//var cellval = tr.cells;
|
//var cellval = tr.cells;
|
||||||
@ -1496,16 +1633,37 @@ else{
|
|||||||
document.getElementById('rawQuantiy'+userid).innerHTML = rawQty;
|
document.getElementById('rawQuantiy'+userid).innerHTML = rawQty;
|
||||||
document.getElementById('rawmaterialPrice'+userid).innerHTML = rawprice;
|
document.getElementById('rawmaterialPrice'+userid).innerHTML = rawprice;
|
||||||
|
|
||||||
|
|
||||||
|
document.getElementById('rawmaterialbasic'+userid).innerHTML = rawbasic;
|
||||||
|
|
||||||
|
|
||||||
// cellval[1].innerHTML = rawmaterialcode;
|
// cellval[1].innerHTML = rawmaterialcode;
|
||||||
// cellval[2].innerHTML = rawSupplierID;
|
// cellval[2].innerHTML = rawSupplierID;
|
||||||
// cellval[3].innerHTML = rawQty;
|
// cellval[3].innerHTML = rawQty;
|
||||||
// cellval[4].innerHTML = rawprice;
|
// cellval[5].innerHTML = rawbasic;
|
||||||
|
|
||||||
|
|
||||||
$('#rawmaterialcode'+userid).val(rawmaterialcode);
|
$('#rawmaterialcode'+userid).val(rawmaterialcode);
|
||||||
$('#rawSupplierID'+userid).val(rawSupplierID);
|
$('#rawSupplierID'+userid).val(rawSupplierID);
|
||||||
$('#rawQty'+userid).val(rawQty);
|
$('#rawQty'+userid).val(rawQty);
|
||||||
$('#rawprice'+userid).val(rawprice);
|
$('#rawprice'+userid).val(rawprice);
|
||||||
|
|
||||||
|
$('#rawbasic'+userid).val(rawbasic)
|
||||||
|
|
||||||
|
|
||||||
|
var total = 0;
|
||||||
|
for(var i=1;i<=rawrow;i++)
|
||||||
|
{
|
||||||
|
total = parseFloat(total) + parseFloat($("#rawbasic"+i).val());
|
||||||
|
//console.log(total)
|
||||||
|
}
|
||||||
|
|
||||||
|
//console.log(total)
|
||||||
|
$('#rawtotal').val(total);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1537,6 +1695,8 @@ $('.rootaddClick').click(function()
|
|||||||
var consuprice = $('#consuprice').val();
|
var consuprice = $('#consuprice').val();
|
||||||
var rawsuppliername = consuSupplier.options[consuSupplier.selectedIndex].text;
|
var rawsuppliername = consuSupplier.options[consuSupplier.selectedIndex].text;
|
||||||
|
|
||||||
|
var conbasic = parseFloat(consuprice) * parseFloat(consuQty);
|
||||||
|
|
||||||
var g = document.getElementById("consumaterialcode");
|
var g = document.getElementById("consumaterialcode");
|
||||||
var consumaterialname = g.options[g.selectedIndex].text;
|
var consumaterialname = g.options[g.selectedIndex].text;
|
||||||
|
|
||||||
@ -1544,7 +1704,7 @@ $('.rootaddClick').click(function()
|
|||||||
var temp = rootindex
|
var temp = rootindex
|
||||||
var template = jQuery("#consumable").html();
|
var template = jQuery("#consumable").html();
|
||||||
//alert(template)
|
//alert(template)
|
||||||
$('#consuappend').append(_.template(template,{rootindex:temp,Material:consumaterialname,Supplier:rawsuppliername,Quantity:consuQty,Price:consuprice}));
|
$('#consuappend').append(_.template(template,{rootindex:temp,Material:consumaterialname,Supplier:rawsuppliername,Quantity:consuQty,Price:consuprice,consuBasicPrice:conbasic}));
|
||||||
|
|
||||||
var theForm = $(".final_product");
|
var theForm = $(".final_product");
|
||||||
|
|
||||||
@ -1556,6 +1716,16 @@ $('.rootaddClick').click(function()
|
|||||||
addHidden(theForm,"consumeSuppliername"+temp,rawsuppliername);
|
addHidden(theForm,"consumeSuppliername"+temp,rawsuppliername);
|
||||||
addHidden(theForm,"consumematerialname"+temp,consumaterialname);
|
addHidden(theForm,"consumematerialname"+temp,consumaterialname);
|
||||||
|
|
||||||
|
|
||||||
|
addHidden(theForm,"conbasic"+temp,conbasic);
|
||||||
|
var total = 0;
|
||||||
|
for(var i=1;i<=temp;i++)
|
||||||
|
{
|
||||||
|
total = parseFloat(total) + parseFloat($("#conbasic"+i).val());
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#consutotal').val(total);
|
||||||
|
|
||||||
$('#consumaterialcode').val('');
|
$('#consumaterialcode').val('');
|
||||||
$('#consuSupplier').val('');
|
$('#consuSupplier').val('');
|
||||||
$('#consuqty').val('');
|
$('#consuqty').val('');
|
||||||
@ -1596,6 +1766,10 @@ $('.rootEditItem').click(function()
|
|||||||
var editconsuQty = $('#Editconsuqty').val();
|
var editconsuQty = $('#Editconsuqty').val();
|
||||||
var editrawprice = $('#Editconsuprice').val();
|
var editrawprice = $('#Editconsuprice').val();
|
||||||
|
|
||||||
|
var consubasic = parseFloat(editconsuQty)*parseFloat(editrawprice);
|
||||||
|
|
||||||
|
var consurow = $('#ConsuRow').val();
|
||||||
|
|
||||||
|
|
||||||
var tr= document.getElementById(rootuserid);
|
var tr= document.getElementById(rootuserid);
|
||||||
var supname = $('#consumeSuppliername'+rootuserid).val();
|
var supname = $('#consumeSuppliername'+rootuserid).val();
|
||||||
@ -1613,12 +1787,34 @@ $('.rootEditItem').click(function()
|
|||||||
document.getElementById('consuQuantiy'+rootuserid).innerHTML = editconsuQty;
|
document.getElementById('consuQuantiy'+rootuserid).innerHTML = editconsuQty;
|
||||||
document.getElementById('consumaterialPrice'+rootuserid).innerHTML = editrawprice;
|
document.getElementById('consumaterialPrice'+rootuserid).innerHTML = editrawprice;
|
||||||
|
|
||||||
|
document.getElementById('consumaterialbasic'+rootuserid).innerHTML = consubasic;
|
||||||
|
|
||||||
// document.getElementById('rootcause'+rootuserid).innerHTML = editroot;
|
// document.getElementById('rootcause'+rootuserid).innerHTML = editroot;
|
||||||
|
|
||||||
$('#consumematerialcode'+rootuserid).val(editconsumaterialcode);
|
$('#consumematerialcode'+rootuserid).val(editconsumaterialcode);
|
||||||
$('#consumeSupplierID'+rootuserid).val(editconsuSupplierID);
|
$('#consumeSupplierID'+rootuserid).val(editconsuSupplierID);
|
||||||
$('#consumeQty'+rootuserid).val(editconsuQty);
|
$('#consumeQty'+rootuserid).val(editconsuQty);
|
||||||
$('#consumeprice'+rootuserid).val(editrawprice);
|
$('#consumeprice'+rootuserid).val(editrawprice);
|
||||||
|
|
||||||
|
// $('#consumaterialbasic'+rootuserid).val(consubasic);
|
||||||
|
|
||||||
|
$('#conbasic'+rootuserid).val(consubasic);
|
||||||
|
|
||||||
|
|
||||||
|
var total = 0;
|
||||||
|
for(var i=1;i<=consurow;i++)
|
||||||
|
{
|
||||||
|
total = parseFloat(total) + parseFloat($("#conbasic"+i).val());
|
||||||
|
//console.log(total)
|
||||||
|
}
|
||||||
|
$('#consutotal').val(total);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@ -1651,11 +1847,13 @@ $('.CounteraddClick').click(function()
|
|||||||
var h = document.getElementById("packumaterialcode");
|
var h = document.getElementById("packumaterialcode");
|
||||||
var packmaterialname = h.options[h.selectedIndex].text;
|
var packmaterialname = h.options[h.selectedIndex].text;
|
||||||
|
|
||||||
|
var packBasic = parseFloat(packQty)*parseFloat(packprice);
|
||||||
|
|
||||||
counterindex = parseInt(counterindex)+1;
|
counterindex = parseInt(counterindex)+1;
|
||||||
var temp = counterindex
|
var temp = counterindex
|
||||||
var template = jQuery("#packable").html();
|
var template = jQuery("#packable").html();
|
||||||
//alert(template)
|
//alert(template)
|
||||||
$('#packappend').append(_.template(template,{counterindex:temp,Material:packmaterialname,Supplier:packsuppliername,Quantity:packQty,Price:packprice}));
|
$('#packappend').append(_.template(template,{counterindex:temp,Material:packmaterialname,Supplier:packsuppliername,Quantity:packQty,Price:packprice,packBasicPrice:packBasic}));
|
||||||
|
|
||||||
var theForm = $(".final_product");
|
var theForm = $(".final_product");
|
||||||
|
|
||||||
@ -1668,6 +1866,18 @@ $('.CounteraddClick').click(function()
|
|||||||
|
|
||||||
addHidden(theForm,"packmaterialname"+temp,packmaterialname);
|
addHidden(theForm,"packmaterialname"+temp,packmaterialname);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
addHidden(theForm,"pacbasic"+temp,packBasic);
|
||||||
|
var total = 0;
|
||||||
|
for(var i=1;i<=temp;i++)
|
||||||
|
{
|
||||||
|
total = parseFloat(total) + parseFloat($("#pacbasic"+i).val());
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#packtotal').val(total);
|
||||||
|
|
||||||
$('#packumaterialcode').val('');
|
$('#packumaterialcode').val('');
|
||||||
$('#packSupplier').val('');
|
$('#packSupplier').val('');
|
||||||
$('#packqty').val('');
|
$('#packqty').val('');
|
||||||
@ -1713,6 +1923,12 @@ $('.CounterEditItem').click(function()
|
|||||||
var editpackprice = $('#Editpackprice').val();
|
var editpackprice = $('#Editpackprice').val();
|
||||||
//var editpacksuppliername = EditpackSupplier.options[EditpackSupplier.selectedIndex].text;
|
//var editpacksuppliername = EditpackSupplier.options[EditpackSupplier.selectedIndex].text;
|
||||||
|
|
||||||
|
var basicprice = parseFloat(editpackQty)*parseFloat(editpackprice);
|
||||||
|
|
||||||
|
var pacrow = $('#PkgRow').val();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var tr= document.getElementById(cuserid);
|
var tr= document.getElementById(cuserid);
|
||||||
//var cellval = tr.cells;
|
//var cellval = tr.cells;
|
||||||
//alert(cuserid)
|
//alert(cuserid)
|
||||||
@ -1732,11 +1948,26 @@ $('.CounterEditItem').click(function()
|
|||||||
document.getElementById('packQuantiy'+cuserid).innerHTML = editpackQty;
|
document.getElementById('packQuantiy'+cuserid).innerHTML = editpackQty;
|
||||||
document.getElementById('packmaterialPrice'+cuserid).innerHTML = editpackprice;
|
document.getElementById('packmaterialPrice'+cuserid).innerHTML = editpackprice;
|
||||||
|
|
||||||
|
document.getElementById('packmaterialbasic'+cuserid).innerHTML = basicprice;
|
||||||
|
|
||||||
$('#packmaterialcode'+cuserid).val(editpackmaterialcode);
|
$('#packmaterialcode'+cuserid).val(editpackmaterialcode);
|
||||||
$('#packSupplierID'+cuserid).val(editpackSupplierID);
|
$('#packSupplierID'+cuserid).val(editpackSupplierID);
|
||||||
$('#packQty'+cuserid).val(editpackQty);
|
$('#packQty'+cuserid).val(editpackQty);
|
||||||
$('#packprice'+cuserid).val(editpackprice);
|
$('#packprice'+cuserid).val(editpackprice);
|
||||||
|
|
||||||
|
$('#pacbasic'+cuserid).val(basicprice);
|
||||||
|
|
||||||
|
var total = 0;
|
||||||
|
for(var i=1;i<=pacrow;i++)
|
||||||
|
{
|
||||||
|
total = parseFloat(total) + parseFloat($("#pacbasic"+i).val());
|
||||||
|
//console.log(total)
|
||||||
|
}
|
||||||
|
$('#packtotal').val(total);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -1751,11 +1982,13 @@ $('.CoaddClick').click(function()
|
|||||||
var copprice = $('#Coprice').val();
|
var copprice = $('#Coprice').val();
|
||||||
var copsuppliername = coproduct_id.options[coproduct_id.selectedIndex].text;
|
var copsuppliername = coproduct_id.options[coproduct_id.selectedIndex].text;
|
||||||
|
|
||||||
|
var copbasic = parseFloat(copQty) * parseFloat(copprice);
|
||||||
|
|
||||||
coproductindex = parseInt(coproductindex)+1;
|
coproductindex = parseInt(coproductindex)+1;
|
||||||
var temp = coproductindex
|
var temp = coproductindex
|
||||||
var template = jQuery("#coproduct").html();
|
var template = jQuery("#coproduct").html();
|
||||||
//alert(copsuppliername)
|
//alert(copsuppliername)
|
||||||
$('#coproductappend').append(_.template(template,{coproductindex:temp,Material:copsuppliername,Date:copDate,Quantity:copQty,Price:copprice}));
|
$('#coproductappend').append(_.template(template,{coproductindex:temp,Material:copsuppliername,Date:copDate,Quantity:copQty,Price:copprice,CopBasicPrice:copbasic}));
|
||||||
|
|
||||||
var theForm = $(".final_product");
|
var theForm = $(".final_product");
|
||||||
|
|
||||||
@ -1764,7 +1997,18 @@ $('.CoaddClick').click(function()
|
|||||||
addHidden(theForm,"CopQty"+temp,copQty);
|
addHidden(theForm,"CopQty"+temp,copQty);
|
||||||
addHidden(theForm,"Copprice"+temp,copprice);
|
addHidden(theForm,"Copprice"+temp,copprice);
|
||||||
addHidden(theForm,"Coptype"+temp,"CoProduct");
|
addHidden(theForm,"Coptype"+temp,"CoProduct");
|
||||||
addHidden(theForm,"Copmaterialname"+temp,copsuppliername)
|
addHidden(theForm,"Copmaterialname"+temp,copsuppliername);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
addHidden(theForm,"copbasic"+temp,copbasic);
|
||||||
|
var total = 0;
|
||||||
|
for(var i=1;i<=temp;i++)
|
||||||
|
{
|
||||||
|
total = parseFloat(total) + parseFloat($("#copbasic"+i).val());
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#coptotal').val(total);
|
||||||
|
|
||||||
$('#coproduct_id').val('');
|
$('#coproduct_id').val('');
|
||||||
$('#CopDate').val('');
|
$('#CopDate').val('');
|
||||||
@ -1807,6 +2051,9 @@ $('.CoEditItem').click(function()
|
|||||||
var editcopprice = $('#EditCoprice').val();
|
var editcopprice = $('#EditCoprice').val();
|
||||||
// var editcopproduct = Editcoproduct_id.options[Editcoproduct_id.selectedIndex].text;
|
// var editcopproduct = Editcoproduct_id.options[Editcoproduct_id.selectedIndex].text;
|
||||||
|
|
||||||
|
var copbasic = parseFloat(editcopqty)*parseFloat(editcopprice);
|
||||||
|
var coprow = $('#CopRow').val();
|
||||||
|
|
||||||
var tr= document.getElementById(cuserid);
|
var tr= document.getElementById(cuserid);
|
||||||
//var cellval = tr.cells;
|
//var cellval = tr.cells;
|
||||||
//alert(editcopdate)
|
//alert(editcopdate)
|
||||||
@ -1824,83 +2071,178 @@ $('.CoEditItem').click(function()
|
|||||||
document.getElementById('CopQuantiy'+cuserid).innerHTML = editcopqty;
|
document.getElementById('CopQuantiy'+cuserid).innerHTML = editcopqty;
|
||||||
document.getElementById('CopmaterialPrice'+cuserid).innerHTML = editcopprice;
|
document.getElementById('CopmaterialPrice'+cuserid).innerHTML = editcopprice;
|
||||||
|
|
||||||
|
|
||||||
|
document.getElementById('Copmaterialbasic'+cuserid).innerHTML = copbasic;
|
||||||
|
|
||||||
$('#Copmaterialcode'+cuserid).val(editcoproductid);
|
$('#Copmaterialcode'+cuserid).val(editcoproductid);
|
||||||
$('#CopDate'+cuserid).val(editcopdate);
|
$('#CopDate'+cuserid).val(editcopdate);
|
||||||
$('#CopQty'+cuserid).val(editcopqty);
|
$('#CopQty'+cuserid).val(editcopqty);
|
||||||
$('#Copprice'+cuserid).val(editcopprice);
|
$('#Copprice'+cuserid).val(editcopprice);
|
||||||
|
|
||||||
|
$('#copbasic'+cuserid).val(copbasic);
|
||||||
|
|
||||||
|
var total = 0;
|
||||||
|
for(var i=1;i<=coprow;i++)
|
||||||
|
{
|
||||||
|
total = parseFloat(total) + parseFloat($("#copbasic"+i).val());
|
||||||
|
//console.log(total)
|
||||||
|
}
|
||||||
|
$('#coptotal').val(total);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
var lowstock =<?php echo json_encode($Records, JSON_PRETTY_PRINT) ?>;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function lowqtycheck(type)
|
||||||
|
{
|
||||||
|
//alert(type)
|
||||||
|
console.log(lowstock);
|
||||||
|
var materialcode = '';
|
||||||
|
|
||||||
|
if(type == 'rawmaterial')
|
||||||
|
{
|
||||||
|
materialcode = $('#rawmaterialcode').val();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(type == 'consumables')
|
||||||
|
{
|
||||||
|
materialcode = $('#consumaterialcode').val();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(type == 'packing')
|
||||||
|
{
|
||||||
|
materialcode = $('#packumaterialcode').val();
|
||||||
|
}
|
||||||
|
|
||||||
|
$.each(lowstock, function(id, obj) {
|
||||||
|
if(obj.MaterialCode == materialcode)
|
||||||
|
{
|
||||||
|
alert('Stock is running Low !! available Stock'+obj.Current_stock);
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('#rawmaterialcode').change(function()
|
$('#rawmaterialcode').change(function()
|
||||||
{
|
{
|
||||||
var type = "rawmaterial";
|
var type = "rawmaterial";
|
||||||
ResultantQty(type);
|
lowqtycheck(type);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#rawSupplier').change(function()
|
|
||||||
{
|
|
||||||
var type = "rawmaterial";
|
|
||||||
ResultantQty(type);
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#consumaterialcode').change(function()
|
$('#consumaterialcode').change(function()
|
||||||
{
|
{
|
||||||
var type = "consumables";
|
var type = "consumables";
|
||||||
ResultantQty(type);
|
lowqtycheck(type);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#consuSupplier').change(function()
|
|
||||||
{
|
|
||||||
var type = "consumables";
|
|
||||||
ResultantQty(type);
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('#packumaterialcode').change(function()
|
$('#packumaterialcode').change(function()
|
||||||
{
|
{
|
||||||
var type = "packing";
|
var type = "packing";
|
||||||
ResultantQty(type);
|
lowqtycheck(type);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#packSupplier').change(function()
|
// $('#rawSupplier').change(function()
|
||||||
{
|
// {
|
||||||
var type = "packing";
|
// var type = "rawmaterial";
|
||||||
ResultantQty(type);
|
// ResultantQty(type);
|
||||||
|
|
||||||
});
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// $('#consuSupplier').change(function()
|
||||||
|
// {
|
||||||
|
// var type = "consumables";
|
||||||
|
// ResultantQty(type);
|
||||||
|
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
// $('#packSupplier').change(function()
|
||||||
|
// {
|
||||||
|
// var type = "packing";
|
||||||
|
// ResultantQty(type);
|
||||||
|
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('#Editrawmaterialcode').change(function()
|
$('#Editrawmaterialcode').change(function()
|
||||||
{
|
{
|
||||||
|
|
||||||
var type = "rawmaterial";
|
var type = "rawmaterial";
|
||||||
EditResultantQty(type);
|
Editlowqtycheck(type);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#EditrawSupplier').change(function()
|
|
||||||
|
|
||||||
|
$('#Editconsumaterialcode').change(function()
|
||||||
{
|
{
|
||||||
|
var type = "consumables";
|
||||||
|
Editlowqtycheck(type);
|
||||||
var type = "rawmaterial";
|
|
||||||
EditResultantQty(type);
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$('#Editpackumaterialcode').change(function()
|
||||||
|
{
|
||||||
|
var type = "packing";
|
||||||
|
Editlowqtycheck(type);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function Editlowqtycheck(type)
|
||||||
|
{
|
||||||
|
//alert(type)
|
||||||
|
//console.log(lowstock);
|
||||||
|
var materialcode = '';
|
||||||
|
|
||||||
|
if(type == 'rawmaterial')
|
||||||
|
{
|
||||||
|
materialcode = $('#Editrawmaterialcode').val();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(type == 'consumables')
|
||||||
|
{
|
||||||
|
materialcode = $('#Editconsumaterialcode').val();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(type == 'packing')
|
||||||
|
{
|
||||||
|
materialcode = $('#Editpackumaterialcode').val();
|
||||||
|
}
|
||||||
|
|
||||||
|
$.each(lowstock, function(id, obj) {
|
||||||
|
if(obj.MaterialCode == materialcode)
|
||||||
|
{
|
||||||
|
alert('Stock is running Low !! available Stock is '+obj.Current_stock);
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var today = new Date();
|
var today = new Date();
|
||||||
@ -2839,75 +3181,28 @@ function Save()
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function rawqtycheck()
|
|
||||||
|
|
||||||
|
|
||||||
|
function GetBasicvalue()
|
||||||
{
|
{
|
||||||
// alert(rawresultqty);
|
var basic =0;
|
||||||
|
var qty= $('#Quantity').val();
|
||||||
|
var val = $('#values').val();
|
||||||
|
|
||||||
// var enterrawqty= $('#rawqty').val();
|
if(qty != '' && val !='')
|
||||||
// if(rawresultqty < enterrawqty)
|
{
|
||||||
// {
|
basic = parseFloat(qty)*parseFloat(val);
|
||||||
// alert("You are Exceeding the Stock Qtantity!! Avalable stock is"+rawresultqty);
|
$('#basicvalue').val(basic);
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function editrawqtycheck()
|
else
|
||||||
{
|
{
|
||||||
//alert(rawresultqty);
|
//alert('Please Enter Quantity and Value');
|
||||||
|
$('#basicvalue').val(0);
|
||||||
|
}
|
||||||
|
|
||||||
// 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);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user