stock screens
This commit is contained in:
parent
90c97c00d4
commit
7478eeba3a
@ -335,5 +335,6 @@ define('Capital_RMCIncludingCustomers_Charge1',
|
|||||||
|
|
||||||
define('Consumables', 'Consumables');
|
define('Consumables', 'Consumables');
|
||||||
define('RawMaterial', 'Raw Material');
|
define('RawMaterial', 'Raw Material');
|
||||||
|
define('Packingmaterial', 'Packing material');
|
||||||
/* End of file constants.php */
|
/* End of file constants.php */
|
||||||
/* Location: ./application/config/constants.php */
|
/* Location: ./application/config/constants.php */
|
||||||
|
|||||||
@ -339,3 +339,7 @@ $route['poresetview']="purchaseorder/poresetview";
|
|||||||
$route['FinalProduct'] = "batchcard/FinalProductCalculation";
|
$route['FinalProduct'] = "batchcard/FinalProductCalculation";
|
||||||
|
|
||||||
$route['MaterailAdjustment'] = "batchcard/MaterailAdjustment";
|
$route['MaterailAdjustment'] = "batchcard/MaterailAdjustment";
|
||||||
|
|
||||||
|
$route['MaterailAdjustmentlist'] = "batchcard/MaterailAdjustmentlist";
|
||||||
|
|
||||||
|
$route['EditMaterialAdjustment'] = "batchcard/EditMaterialAdjustment";
|
||||||
|
|||||||
@ -1263,7 +1263,9 @@ class batchcard extends BaseController
|
|||||||
$data['inv_final_product'] = $this->batchcard_model->getinvoice_products();
|
$data['inv_final_product'] = $this->batchcard_model->getinvoice_products();
|
||||||
$data['consumable_material']= $this->batchcard_model->get_consumablematerials();
|
$data['consumable_material']= $this->batchcard_model->get_consumablematerials();
|
||||||
$data['Raw_material'] = $this->batchcard_model->get_rawmaterials();
|
$data['Raw_material'] = $this->batchcard_model->get_rawmaterials();
|
||||||
|
$data['Pack_material'] = $this->batchcard_model->get_packmaterials();
|
||||||
$data['supplier'] = $this->batchcard_model->getSupplierlist();
|
$data['supplier'] = $this->batchcard_model->getSupplierlist();
|
||||||
|
|
||||||
//print_r($data['allhourdata']);die();
|
//print_r($data['allhourdata']);die();
|
||||||
$this->global['pageTitle'] = 'Siddharth : Final Product';
|
$this->global['pageTitle'] = 'Siddharth : Final Product';
|
||||||
$this->loadViews("FinalProduct", $this->global,$data,NULL);
|
$this->loadViews("FinalProduct", $this->global,$data,NULL);
|
||||||
@ -1279,6 +1281,16 @@ class batchcard extends BaseController
|
|||||||
$this->loadViews("materialadjustment", $this->global,$data,NULL);
|
$this->loadViews("materialadjustment", $this->global,$data,NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function MaterailAdjustmentlist()
|
||||||
|
{
|
||||||
|
$data['materailAdjustmentlist'] = $this->batchcard_model->getAllMaterialAdjustments();
|
||||||
|
|
||||||
|
$this->global['pageTitle'] = 'Siddharth : Material Adjustment';
|
||||||
|
$this->loadViews("materialadjustmentlist", $this->global,$data,NULL);
|
||||||
|
}
|
||||||
|
|
||||||
function getQuantity()
|
function getQuantity()
|
||||||
{
|
{
|
||||||
$MaterialCode = $this->input->post('materialcode');
|
$MaterialCode = $this->input->post('materialcode');
|
||||||
@ -1316,6 +1328,11 @@ class batchcard extends BaseController
|
|||||||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||||
$createddt = $dt->format('Y-m-d H:i:s');
|
$createddt = $dt->format('Y-m-d H:i:s');
|
||||||
|
|
||||||
|
//echo $dt;
|
||||||
|
|
||||||
|
// echo $createddt;
|
||||||
|
// die();
|
||||||
|
|
||||||
$adjustmentaarray = array('MaterialCode'=>$materialcode,'ActualQuantity'=>$ActualQty,'Quantity'=>$absaluteQty,'SupplierID'=>$supplier,'Reason'=>$reason,'Description'=>$Description,'CreatedOn'=>$createddt,'CreatedBy'=>$CreatedBy);
|
$adjustmentaarray = array('MaterialCode'=>$materialcode,'ActualQuantity'=>$ActualQty,'Quantity'=>$absaluteQty,'SupplierID'=>$supplier,'Reason'=>$reason,'Description'=>$Description,'CreatedOn'=>$createddt,'CreatedBy'=>$CreatedBy);
|
||||||
|
|
||||||
$materialadjust = $this->batchcard_model->AddmaterialAdjustment($adjustmentaarray);
|
$materialadjust = $this->batchcard_model->AddmaterialAdjustment($adjustmentaarray);
|
||||||
@ -1347,5 +1364,122 @@ class batchcard extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function Final_Product_Save()
|
||||||
|
{
|
||||||
|
$final_product = $this->input->post('DEPTFN');
|
||||||
|
$final_qty = $this->input->post('Quantity');
|
||||||
|
$product_date = $this->input->post('Date');
|
||||||
|
//$pdt = $product_date->format('Y-m-d');
|
||||||
|
$pdt = date("Y-m-d", strtotime($product_date));
|
||||||
|
$product_value = $this->input->post('values');
|
||||||
|
$createdby = $this->session->userdata('userId');
|
||||||
|
|
||||||
|
$final_master =array('MaterialCode'=>$final_product,'Quantity'=>$final_qty,'Price'=>$product_value,'CreatedBy'=>$createdby,'ProductDate'=>$pdt);
|
||||||
|
|
||||||
|
$final_master_save =$this->batchcard_model->insert_final_product($final_master);
|
||||||
|
|
||||||
|
// $final_product_id= $final_master_save[0]['PId'];
|
||||||
|
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||||
|
$createddt = $dt->format('Y-m-d H:i:s');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if(!empty($final_master_save))
|
||||||
|
{
|
||||||
|
foreach($final_master_save as $pm)
|
||||||
|
{
|
||||||
|
$final_product_id = $pm->PId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$rawilne = $this->input->post('RawRow');
|
||||||
|
$consuline = $this->input->post('ConsuRow');
|
||||||
|
$packline = $this->input->post('PkgRow');
|
||||||
|
$coproline = $this->input->post('CopRow');
|
||||||
|
|
||||||
|
//echo $coproline;
|
||||||
|
|
||||||
|
for($i=1;$i<=$rawilne;$i++)
|
||||||
|
{
|
||||||
|
$rawmaterial = $this->input->post('rawmaterialcode'.$i);
|
||||||
|
$rawsupplier =$this->input->post('rawSupplierID'.$i);
|
||||||
|
$rawqty = $this->input->post('rawQty'.$i);
|
||||||
|
$rawvalue = $this->input->post('rawprice'.$i);
|
||||||
|
|
||||||
|
$rawarray =array('FPId'=>$final_product_id,'MaterialCode'=>$rawmaterial,'SupplierID'=>$rawsupplier,'Quantity'=>$rawqty,'Price'=>$rawvalue,'CreatedBy'=>$createdby,'CreatedDate'=>$createddt);
|
||||||
|
|
||||||
|
//print_r($rawarray);
|
||||||
|
|
||||||
|
$this->batchcard_model->save_finalraw($rawarray);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
for($i=1;$i<=$consuline;$i++)
|
||||||
|
{
|
||||||
|
$conmaterial = $this->input->post('consumematerialcode'.$i);
|
||||||
|
$consupplier =$this->input->post('consumeSupplierID'.$i);
|
||||||
|
$conqty = $this->input->post('consumeQty'.$i);
|
||||||
|
$convalue = $this->input->post('consumeprice'.$i);
|
||||||
|
|
||||||
|
$conarray =array('FPId'=>$final_product_id,'MaterialCode'=>$conmaterial,'SupplierID'=>$consupplier,'Quantity'=>$conqty,'Price'=>$convalue,'CreatedBy'=>$createdby,'CreatedDate'=>$createddt);
|
||||||
|
|
||||||
|
$this->batchcard_model->save_finalcon($conarray);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
for($i=1;$i<=$packline;$i++)
|
||||||
|
{
|
||||||
|
$packmaterial = $this->input->post('packmaterialcode'.$i);
|
||||||
|
$packsupplier =$this->input->post('packSupplierID'.$i);
|
||||||
|
$packqty = $this->input->post('packQty'.$i);
|
||||||
|
$packvalue = $this->input->post('packprice'.$i);
|
||||||
|
|
||||||
|
$packarray =array('FPId'=>$final_product_id,'MaterialCode'=>$packmaterial,'SupplierID'=>$packsupplier,'Quantity'=>$packqty,'Price'=>$packvalue,'CreatedBy'=>$createdby,'CreatedDate'=>$createddt);
|
||||||
|
|
||||||
|
$this->batchcard_model->save_finalpacking($packarray);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
for($i=1;$i<=$coproline;$i++)
|
||||||
|
{
|
||||||
|
|
||||||
|
$copmaterial = $this->input->post('Copmaterialcode'.$i);
|
||||||
|
$codate =$this->input->post('CopDate'.$i);
|
||||||
|
$copqty = $this->input->post('CopQty'.$i);
|
||||||
|
$copvalue = $this->input->post('Copprice'.$i);
|
||||||
|
|
||||||
|
$coparray =array('FPId'=>$final_product_id,'MaterialCode'=>$copmaterial,'CoDate'=>$codate,'Quantity'=>$copqty,'Price'=>$copvalue,'CreatedBy'=>$createdby,'CreatedDate'=>$createddt);
|
||||||
|
|
||||||
|
// print_r($coparray);
|
||||||
|
|
||||||
|
$this->batchcard_model->save_finalcoproduct($coparray);
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "Details Saved Successfully";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function EditMaterialAdjustment()
|
||||||
|
{
|
||||||
|
|
||||||
|
$AdjustmentId = $_GET['AdjustmentId'];
|
||||||
|
$data['materailAdjustmentlist'] = $this->batchcard_model->getEditMaterialAdjustments($AdjustmentId);
|
||||||
|
|
||||||
|
$data['materiallist'] = $this->batchcard_model->getMaterial();
|
||||||
|
|
||||||
|
$data['getSupplierlist'] = $this->batchcard_model->getSupplierlist();
|
||||||
|
|
||||||
|
// print_r($data['materailAdjustmentlist']);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$this->global['pageTitle'] = 'Siddharth : Material Adjustment';
|
||||||
|
$this->loadViews("editmaterialadjustment", $this->global,$data,NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@ -590,6 +590,16 @@ class batchcard_model extends CI_Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function get_packmaterials()
|
||||||
|
{
|
||||||
|
$this->db->select('MaterialCode,MaterialName,');
|
||||||
|
$this->db->from('T_MaterialMaster');
|
||||||
|
$this->db->where('T_MaterialMaster.Category',Packingmaterial);
|
||||||
|
$supp = $this->db->get();
|
||||||
|
return $supp->result();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function getMaterial()
|
function getMaterial()
|
||||||
{
|
{
|
||||||
$this->db->select('MaterialCode,MaterialName,');
|
$this->db->select('MaterialCode,MaterialName,');
|
||||||
@ -618,16 +628,28 @@ class batchcard_model extends CI_Model
|
|||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// echo "after Finance";
|
//echo "after Finance";
|
||||||
$startdate = $year.'-'.'04'.'-'.'01';
|
$startdate = $year.'-'.'04'.'-'.'01';
|
||||||
//echo $startdate;
|
// echo $startdate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$nedt= $dt+1;
|
||||||
|
|
||||||
$subQuery='select (select sum(Quantity) as AddQty from T_Material_stock_history where Transaction_type = "Add" and MaterialCode=?
|
$newdate=$year.'-'.$month.'-'.$nedt;
|
||||||
) as Addqty,(select sum(Quantity) as ReduceQty from T_Material_stock_history where Transaction_type = "Reduce" and MaterialCode=?
|
|
||||||
) as ReduceQty from T_Material_stock_history where MaterialCode=? and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
|
||||||
$query = $this->db->query($subQuery,array($MaterialCode,$MaterialCode,$MaterialCode,$startdate,$date,$Supplier));
|
// $subQuery='select (select sum(Quantity) as AddQty from T_Material_stock_history where Transaction_type = "Add" and MaterialCode=?
|
||||||
|
// ) as Addqty,(select sum(Quantity) as ReduceQty from T_Material_stock_history where Transaction_type = "Reduce" and MaterialCode=?
|
||||||
|
// ) as ReduceQty from T_Material_stock_history where MaterialCode=? and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||||
|
|
||||||
|
|
||||||
|
$subQuery='select ifnull((select ifnull(sum(Quantity),0) as AddQty from T_Material_stock_history
|
||||||
|
where Transaction_type = "Add" and MaterialCode=? and SupplierID=? ),0) as Addqty,
|
||||||
|
ifnull((select ifnull(sum(Quantity),0) as ReduceQty from T_Material_stock_history where Transaction_type = "Reduce"
|
||||||
|
and MaterialCode=? and SupplierID=? ),0) as ReduceQty from T_Material_stock_history where MaterialCode=?
|
||||||
|
and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||||
|
|
||||||
|
$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();
|
||||||
|
|
||||||
@ -663,6 +685,90 @@ class batchcard_model extends CI_Model
|
|||||||
return $insert_id;
|
return $insert_id;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function insert_final_product($final_master)
|
||||||
|
{
|
||||||
|
$this->db->trans_start();
|
||||||
|
$this->db->insert('T_FinalProduct_Master',$final_master);
|
||||||
|
$insert_id = $this->db->affected_rows();
|
||||||
|
$this->db->trans_complete();
|
||||||
|
// print_r($this->db->last_query());
|
||||||
|
//print_r($insert_id);
|
||||||
|
if($insert_id>0)
|
||||||
|
{
|
||||||
|
$subQuery = 'select max(FPId) as PId from T_FinalProduct_Master';
|
||||||
|
$query = $this->db->query($subQuery);
|
||||||
|
|
||||||
|
return $query->result();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function save_finalraw($rawarray)
|
||||||
|
{
|
||||||
|
$this->db->trans_start();
|
||||||
|
$this->db->insert('T_FinalProduct_RawMaterials',$rawarray);
|
||||||
|
$insert_id = $this->db->affected_rows();
|
||||||
|
$this->db->trans_complete();
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function save_finalcon($conarray)
|
||||||
|
{
|
||||||
|
$this->db->trans_start();
|
||||||
|
$this->db->insert('T_FinalProduct_ConsumableMaterials',$conarray);
|
||||||
|
$insert_id = $this->db->affected_rows();
|
||||||
|
$this->db->trans_complete();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function save_finalpacking($packarray)
|
||||||
|
{
|
||||||
|
$this->db->trans_start();
|
||||||
|
$this->db->insert('T_FinalProduct_PackingMaterials',$packarray);
|
||||||
|
$insert_id = $this->db->affected_rows();
|
||||||
|
$this->db->trans_complete();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function save_finalcoproduct($coparray)
|
||||||
|
{
|
||||||
|
|
||||||
|
//print_r($coparray);
|
||||||
|
$this->db->trans_start();
|
||||||
|
$this->db->insert('T_FinalProduct_CoProduct_Materials',$coparray);
|
||||||
|
$insert_id = $this->db->affected_rows();
|
||||||
|
$this->db->trans_complete();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getAllMaterialAdjustments()
|
||||||
|
{
|
||||||
|
$this->db->select('T_Material_Adjustment.*,SupplierName,MaterialName');
|
||||||
|
$this->db->from('T_Material_Adjustment');
|
||||||
|
$this->db->join('T_SupplierDetailsN', 'T_Material_Adjustment.SupplierID = T_SupplierDetailsN.SupplierID');
|
||||||
|
$this->db->join('T_MaterialMaster', 'T_MaterialMaster.MaterialCode = T_Material_Adjustment.MaterialCode');
|
||||||
|
$res = $this->db->get();
|
||||||
|
return $res->result();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getEditMaterialAdjustments($AdjustmentId)
|
||||||
|
{
|
||||||
|
|
||||||
|
$this->db->select('T_Material_Adjustment.*,SupplierName,MaterialName');
|
||||||
|
$this->db->from('T_Material_Adjustment');
|
||||||
|
$this->db->join('T_SupplierDetailsN', 'T_Material_Adjustment.SupplierID = T_SupplierDetailsN.SupplierID');
|
||||||
|
$this->db->join('T_MaterialMaster', 'T_MaterialMaster.MaterialCode = T_Material_Adjustment.MaterialCode');
|
||||||
|
$this->db->where('T_Material_Adjustment.AdjustmentId',$AdjustmentId);
|
||||||
|
$res = $this->db->get();
|
||||||
|
return $res->result();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2242
application/views/FinalProduct.php
Normal file
2242
application/views/FinalProduct.php
Normal file
File diff suppressed because it is too large
Load Diff
443
application/views/editmaterialadjustment.php
Normal file
443
application/views/editmaterialadjustment.php
Normal file
@ -0,0 +1,443 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$date ='';
|
||||||
|
$edit_Qty_aspersystem='';
|
||||||
|
$edit_Actual_Qty= '';
|
||||||
|
$edit_Adjustable_qty= '';
|
||||||
|
$edit_Description='';
|
||||||
|
|
||||||
|
if(!empty($materailAdjustmentlist))
|
||||||
|
{
|
||||||
|
foreach($materailAdjustmentlist as $mat)
|
||||||
|
{
|
||||||
|
|
||||||
|
$supplier = $mat->SupplierID;
|
||||||
|
$materialcode = $mat->MaterialCode;
|
||||||
|
$date = $mat->CreatedOn;
|
||||||
|
// $edit_Qty_aspersystem= $mat->;
|
||||||
|
$edit_Actual_Qty= $mat->ActualQuantity;
|
||||||
|
$edit_Adjustable_qty= '';
|
||||||
|
$edit_Description='';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(function() {
|
||||||
|
//Initialize Select2 Elements
|
||||||
|
$("#MaterialCode").select2();
|
||||||
|
$('#supplier').select2();
|
||||||
|
$('#reason').select2();
|
||||||
|
|
||||||
|
$("#date").datepicker({
|
||||||
|
|
||||||
|
//maxDate : 'now',
|
||||||
|
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
.content {
|
||||||
|
Padding:0% ! important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.num{
|
||||||
|
text-align:right;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div class="content-wrapper" style="min-height:537">
|
||||||
|
<!-- Content Header (Page header) -->
|
||||||
|
<section class="content-header">
|
||||||
|
|
||||||
|
<h1>
|
||||||
|
<center>Siddharth Industries - Material Adjustment</center>
|
||||||
|
|
||||||
|
</h1>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
</br>
|
||||||
|
</br>
|
||||||
|
<section class="content">
|
||||||
|
<div id="content"></div>
|
||||||
|
<?php
|
||||||
|
$attributes = array('class' => 'form-label-left materialadjustment','name' => 'materialadjustment','id' => 'materialadjustment');
|
||||||
|
|
||||||
|
echo form_open($this->config->base_url().'batchcard/addmaterialadjustment',$attributes);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="row" style="padding:0% 2%">
|
||||||
|
<div class="col-md-12" >
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label>Material Code</label>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
if(!empty($materiallist))
|
||||||
|
{
|
||||||
|
|
||||||
|
foreach ($materiallist as $material)
|
||||||
|
{
|
||||||
|
if($materialcode==$material->MaterialCode)
|
||||||
|
{
|
||||||
|
$options1[$material->MaterialCode] = $material->MaterialCode.' '.' - '.' '.$material->MaterialName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
foreach ($materiallist as $materiall)
|
||||||
|
{
|
||||||
|
if($materialcode != $material->MaterialCode)
|
||||||
|
{
|
||||||
|
|
||||||
|
$options1[$materiall->MaterialCode] = $materiall->MaterialCode.' '.' - '.' '.$materiall->MaterialName;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
echo form_dropdown('MaterialCode', $options1,set_value('MaterialCode',$materialcode),'id="MaterialCode"','class="form-control select2"' , 'required="true"');
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label>Date</label>
|
||||||
|
<div class="form-group">
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$data = array('name' => 'date','value' => set_value('date',$date),'id'=>'date', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;');
|
||||||
|
echo form_input($data);
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label>Supplier</label>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$options = array("0"=>'Select Supplier');
|
||||||
|
|
||||||
|
if(!empty($Supplier))
|
||||||
|
{
|
||||||
|
foreach ($Supplier as $PO):
|
||||||
|
$options[$PO->SupplierID] =$PO->SupplierID.' '.' - '.' '.$PO->SupplierName;
|
||||||
|
|
||||||
|
|
||||||
|
//$RL[$SID->ReqNo] = $SID->ReqNo.' '.' - '.' '.$SID->DepartmentName;
|
||||||
|
endforeach;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
echo form_dropdown('supplier', $options,set_value('SupplierID'),'id="supplier"' ,'class="form-control select2"' , 'required="true"' );
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-offset-8">
|
||||||
|
|
||||||
|
<a class="btn btn-primary font getdetails" ID="getdetails" > <span class="bold">Get Details</span></a>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</br>
|
||||||
|
</br>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-8">
|
||||||
|
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="col-md-6">
|
||||||
|
|
||||||
|
<label><?php echo "Quantity As Per System";?></label>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<?php
|
||||||
|
$data = array('name' => 'Qty_aspersystem','value' => set_value('Qty_aspersystem',0),'id'=>'Qty_aspersystem', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'', 'readonly'=>'true');
|
||||||
|
echo form_input($data);
|
||||||
|
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="col-md-6">
|
||||||
|
|
||||||
|
<label><?php echo "Actual Quantity";?></label>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<?php
|
||||||
|
$data = array('name' => 'ActualQty','value' => set_value('ActualQty',0),'id'=>'ActualQty', 'class' => 'form-control num' ,'onchange'=>'calculateamount()');
|
||||||
|
echo form_input($data);
|
||||||
|
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="col-md-6">
|
||||||
|
|
||||||
|
<label><?php echo "Adjustable Quantity";?></label>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<?php
|
||||||
|
$data = array('name' => 'AdjustableQty','value' => set_value('AdjustableQty',0),'id'=>'AdjustableQty', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'', 'readonly'=>'true');
|
||||||
|
echo form_input($data);
|
||||||
|
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</br>
|
||||||
|
</br>
|
||||||
|
</br>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="col-md-6">
|
||||||
|
|
||||||
|
<label><?php echo "Reason";?></label>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$options = array("0"=>'Select');
|
||||||
|
|
||||||
|
// if(!empty($PONO))
|
||||||
|
// {
|
||||||
|
// foreach ($PONO as $PO):
|
||||||
|
// $options[$PO->PONO] =$PO->PONO.' '.' - '.' '.$PO->POType;
|
||||||
|
|
||||||
|
|
||||||
|
// //$RL[$SID->ReqNo] = $SID->ReqNo.' '.' - '.' '.$SID->DepartmentName;
|
||||||
|
// endforeach;
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
echo form_dropdown('reason', $options,set_value('reason'),'id="reason"' ,'class="form-control select2"' , 'required="true"' );
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="col-md-6">
|
||||||
|
|
||||||
|
<label><?php echo "Description";?></label>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<?php
|
||||||
|
$data = array('name' => 'Description','value' => set_value('Description'),'id'=>'Description', 'class' => 'form-control' ,'rows' => '5', 'cols' => '100','maxlength' => '250');
|
||||||
|
echo Form_textarea($data);
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<input type="hidden" name="transtatus" id="transtatus">
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- <div class="col-md-9" align = "right"><br/>
|
||||||
|
<input type="Submit" class="btn btn-primary" value="Save" style="margin-right:28px" onclick="validate();" />
|
||||||
|
</div> -->
|
||||||
|
|
||||||
|
<div class="col-md-1 col-md-offset-8" id="save"><br><br><br>
|
||||||
|
<a class="btn btn-primary Save" ID="Save" onclick="Save" > <span class="bold">Save</span></a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
|
||||||
|
$('.getdetails').click(function()
|
||||||
|
{
|
||||||
|
var materialcode =$('#materialcode').val();
|
||||||
|
var date = $('#date').val();
|
||||||
|
var Supplier = $('#supplier').val();
|
||||||
|
$('#content').loader('show');
|
||||||
|
$.ajax({
|
||||||
|
|
||||||
|
data:{materialcode:materialcode,date:date,Supplier:Supplier},
|
||||||
|
type:"POST",
|
||||||
|
url:"<?php echo base_url();?>batchcard/getQuantity",
|
||||||
|
success:function(data)
|
||||||
|
{
|
||||||
|
$('#content').loader('hide');
|
||||||
|
//console.log(data);
|
||||||
|
var addqty = '';
|
||||||
|
var reduceqty = '';
|
||||||
|
$.each(JSON.parse(data),function(i,obj)
|
||||||
|
{
|
||||||
|
addqty = obj.Addqty;
|
||||||
|
reduceqty = obj.ReduceQty;
|
||||||
|
|
||||||
|
if(addqty == null)
|
||||||
|
{
|
||||||
|
adjustQty =0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(reduceqty == null)
|
||||||
|
{
|
||||||
|
reduceqty=0;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var resultantqty = parseFloat(addqty)- parseFloat(reduceqty);
|
||||||
|
|
||||||
|
if(isNaN(resultantqty))
|
||||||
|
{
|
||||||
|
$('#Qty_aspersystem').val(0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
$('#Qty_aspersystem').val(resultantqty);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function calculateamount()
|
||||||
|
{
|
||||||
|
var actualqty = $('#ActualQty').val();
|
||||||
|
var resultant = $('#Qty_aspersystem').val();
|
||||||
|
var adjustQty = parseFloat(actualqty) - parseFloat(resultant);
|
||||||
|
if(adjustQty<0)
|
||||||
|
{
|
||||||
|
var status = "Reduce";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var status = "Add";
|
||||||
|
}
|
||||||
|
|
||||||
|
var absalutevale = Math.abs(adjustQty);
|
||||||
|
|
||||||
|
$('#transtatus').val(status);
|
||||||
|
|
||||||
|
if(isNaN(adjustQty))
|
||||||
|
{
|
||||||
|
$('#AdjustableQty').val(0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
//$('#AdjustableQty').val(status+" "+absalutevale);
|
||||||
|
|
||||||
|
$('#AdjustableQty').val(adjustQty);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$('.Save').click(function()
|
||||||
|
{
|
||||||
|
|
||||||
|
if($('#materialcode').val()==0)
|
||||||
|
{
|
||||||
|
alert("Please Select Material");
|
||||||
|
}
|
||||||
|
|
||||||
|
else if($('#date').val()=="")
|
||||||
|
{
|
||||||
|
alert("Please Select Date");
|
||||||
|
}
|
||||||
|
|
||||||
|
else if($('#supplier').val()==0)
|
||||||
|
{
|
||||||
|
alert("Please Select Supplier");
|
||||||
|
}
|
||||||
|
|
||||||
|
else if($('#ActualQty').val()=="")
|
||||||
|
{
|
||||||
|
alert("Please Enter the Quantity to Adjust")
|
||||||
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
$('#content').loader('show');
|
||||||
|
$.ajax({
|
||||||
|
|
||||||
|
data:$('.materialadjustment').serialize(),
|
||||||
|
type:"POST",
|
||||||
|
url:"<?php echo base_url() ?>batchcard/addNewMaterialHistory",
|
||||||
|
|
||||||
|
success:function(data)
|
||||||
|
{
|
||||||
|
$('#content').loader('hide');
|
||||||
|
alert(data);
|
||||||
|
location.reload();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
@ -400,11 +400,11 @@ display: none;
|
|||||||
<?php if(empty($DepAccesslist)){?>
|
<?php if(empty($DepAccesslist)){?>
|
||||||
<?php if($DEPCode == PRODUCTION){?>
|
<?php if($DEPCode == PRODUCTION){?>
|
||||||
|
|
||||||
<!-- <li>
|
<li>
|
||||||
<a href="<?php echo base_url(); ?>FinalProduct">
|
<a href="<?php echo base_url(); ?>FinalProduct">
|
||||||
<i class="fa fa-dashboard"></i> <span>Final Product</span>
|
<i class="fa fa-dashboard"></i> <span>Final Product</span>
|
||||||
</a>
|
</a>
|
||||||
</li> -->
|
</li>
|
||||||
|
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
@ -413,6 +413,12 @@ display: none;
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="<?php echo base_url(); ?>MaterailAdjustmentlist">
|
||||||
|
<i class="fa fa-dashboard"></i> <span>Material Adjustment List</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
<?php } }
|
<?php } }
|
||||||
|
|
||||||
@ -423,6 +429,13 @@ else{
|
|||||||
if($assd == PRODUCTION || $DEPCode == PRODUCTION){
|
if($assd == PRODUCTION || $DEPCode == PRODUCTION){
|
||||||
$check25 =1
|
$check25 =1
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="<?php echo base_url(); ?>FinalProduct">
|
||||||
|
<i class="fa fa-dashboard"></i> <span>Final Product</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<a href="<?php echo base_url(); ?>MaterailAdjustment">
|
<a href="<?php echo base_url(); ?>MaterailAdjustment">
|
||||||
<i class="fa fa-dashboard"></i> <span>Material Adjustment</span>
|
<i class="fa fa-dashboard"></i> <span>Material Adjustment</span>
|
||||||
@ -430,9 +443,18 @@ else{
|
|||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="<?php echo base_url(); ?>MaterailAdjustmentlist">
|
||||||
|
<i class="fa fa-dashboard"></i> <span>Material Adjustment List</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
<?php } if($check25 == 1){break;} } } ?>
|
<?php } if($check25 == 1){break;} } } ?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- INPROCESS MODULE-->
|
<!-- INPROCESS MODULE-->
|
||||||
<?php if(empty($DepAccesslist)){?>
|
<?php if(empty($DepAccesslist)){?>
|
||||||
<?php if($DEPCode == QUALITY){?>
|
<?php if($DEPCode == QUALITY){?>
|
||||||
|
|||||||
@ -281,6 +281,16 @@ $('.getdetails').click(function()
|
|||||||
{
|
{
|
||||||
addqty = obj.Addqty;
|
addqty = obj.Addqty;
|
||||||
reduceqty = obj.ReduceQty;
|
reduceqty = obj.ReduceQty;
|
||||||
|
|
||||||
|
if(addqty == null)
|
||||||
|
{
|
||||||
|
adjustQty =0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(reduceqty == null)
|
||||||
|
{
|
||||||
|
reduceqty=0;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var resultantqty = parseFloat(addqty)- parseFloat(reduceqty);
|
var resultantqty = parseFloat(addqty)- parseFloat(reduceqty);
|
||||||
|
|||||||
93
application/views/materialadjustmentlist.php
Normal file
93
application/views/materialadjustmentlist.php
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
|
||||||
|
<style>
|
||||||
|
.pagination {
|
||||||
|
margin:0px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
<div class="content-wrapper">
|
||||||
|
<!-- Content Header (Page header) -->
|
||||||
|
|
||||||
|
<!-- Main content -->
|
||||||
|
<section class="content">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="box">
|
||||||
|
<div class="box-header">
|
||||||
|
<center><h3 class="box-title">Siddharth Industries - Material Adjustment List</h3></center>
|
||||||
|
</div>
|
||||||
|
<!-- /.box-header -->
|
||||||
|
<div class="box-body">
|
||||||
|
<table id="dataTableHistoriek" class="table table-bordered table-hover editableTable" style="font-size:12px;">
|
||||||
|
<thead>
|
||||||
|
<tr style="background-color:#ddf">
|
||||||
|
<th>#</th>
|
||||||
|
<th>Material Adjustment No</th>
|
||||||
|
<th>Material Code</th>
|
||||||
|
<th>Supplier Name</th>
|
||||||
|
<th>Adjusted Qty</th>
|
||||||
|
<th>Adjustment</th>
|
||||||
|
<th>Adjusted On</th>
|
||||||
|
<th>Action</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody><?php
|
||||||
|
if(!empty($materailAdjustmentlist))
|
||||||
|
{
|
||||||
|
$index = 0;
|
||||||
|
foreach($materailAdjustmentlist as $record)
|
||||||
|
{
|
||||||
|
$index = $index + 1;
|
||||||
|
?>
|
||||||
|
<tr id="<?php echo $index ; ?>">
|
||||||
|
<td><?php echo $index ; ?></td>
|
||||||
|
<td><?php echo "Adj".$record->AdjustmentId ?></td>
|
||||||
|
<td><?php echo $record->MaterialCode."-".$record->MaterialName; ?></td>
|
||||||
|
<td><?php echo $record->SupplierID."-".$record->SupplierName; ?></td>
|
||||||
|
<td><?php echo $record->Quantity ?></td>
|
||||||
|
|
||||||
|
<td><?php echo "Adjust"; ?></td>
|
||||||
|
|
||||||
|
<td><?php echo $record->CreatedOn ?></td>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<td> <a data-toggle="tooltip" href="<?php echo base_url().'EditMaterialAdjustment?AdjustmentId='.$record->AdjustmentId; ?>" ><i class="fa fa-pencil" data-toggle="tooltip" title="<?php echo $record->AdjustmentId; ?> - Click here to Edit details"></i> </a> </td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</tbody>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- /.box-body -->
|
||||||
|
</div>
|
||||||
|
<!-- /.box -->
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- /.col -->
|
||||||
|
</div>
|
||||||
|
<!-- /.row -->
|
||||||
|
</section>
|
||||||
|
<!-- /.content -->
|
||||||
|
</div>
|
||||||
|
<!-- /.content-wrapper -->
|
||||||
|
<script src="https://cdn.datatables.net/plug-ins/1.10.11/sorting/date-eu.js"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
|
||||||
|
$('#dataTableHistoriek').DataTable({
|
||||||
|
"paging" : true,
|
||||||
|
"ordering" : true,
|
||||||
|
"scrollCollapse" : true,
|
||||||
|
"searching" : true,
|
||||||
|
"columnDefs" : [{"targets":3, "type":"date-eu"}],
|
||||||
|
"bInfo": true
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue
Block a user