diff --git a/application/config/constants.php b/application/config/constants.php
index c5927afa..744f41ee 100755
--- a/application/config/constants.php
+++ b/application/config/constants.php
@@ -335,5 +335,6 @@ define('Capital_RMCIncludingCustomers_Charge1',
define('Consumables', 'Consumables');
define('RawMaterial', 'Raw Material');
+define('Packingmaterial', 'Packing material');
/* End of file constants.php */
/* Location: ./application/config/constants.php */
diff --git a/application/config/routes.php b/application/config/routes.php
index acfc2506..a4dfb98f 100755
--- a/application/config/routes.php
+++ b/application/config/routes.php
@@ -339,3 +339,7 @@ $route['poresetview']="purchaseorder/poresetview";
$route['FinalProduct'] = "batchcard/FinalProductCalculation";
$route['MaterailAdjustment'] = "batchcard/MaterailAdjustment";
+
+$route['MaterailAdjustmentlist'] = "batchcard/MaterailAdjustmentlist";
+
+$route['EditMaterialAdjustment'] = "batchcard/EditMaterialAdjustment";
diff --git a/application/controllers/batchcard.php b/application/controllers/batchcard.php
index 42d88c17..fc429845 100755
--- a/application/controllers/batchcard.php
+++ b/application/controllers/batchcard.php
@@ -1263,7 +1263,9 @@ class batchcard extends BaseController
$data['inv_final_product'] = $this->batchcard_model->getinvoice_products();
$data['consumable_material']= $this->batchcard_model->get_consumablematerials();
$data['Raw_material'] = $this->batchcard_model->get_rawmaterials();
+ $data['Pack_material'] = $this->batchcard_model->get_packmaterials();
$data['supplier'] = $this->batchcard_model->getSupplierlist();
+
//print_r($data['allhourdata']);die();
$this->global['pageTitle'] = 'Siddharth : Final Product';
$this->loadViews("FinalProduct", $this->global,$data,NULL);
@@ -1279,6 +1281,16 @@ class batchcard extends BaseController
$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()
{
$MaterialCode = $this->input->post('materialcode');
@@ -1316,6 +1328,11 @@ class batchcard extends BaseController
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$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);
$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);
+ }
+
+
}
?>
\ No newline at end of file
diff --git a/application/models/batchcard_model.php b/application/models/batchcard_model.php
index d4344f52..296cac0e 100755
--- a/application/models/batchcard_model.php
+++ b/application/models/batchcard_model.php
@@ -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()
{
$this->db->select('MaterialCode,MaterialName,');
@@ -618,16 +628,28 @@ class batchcard_model extends CI_Model
else
{
- // echo "after Finance";
+ //echo "after Finance";
$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=?
-) 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));
+ $newdate=$year.'-'.$month.'-'.$nedt;
+
+
+// $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());
return $query->result_array();
@@ -663,6 +685,90 @@ class batchcard_model extends CI_Model
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();
+ }
}
diff --git a/application/views/FinalProduct.php b/application/views/FinalProduct.php
new file mode 100644
index 00000000..740cd1d6
--- /dev/null
+++ b/application/views/FinalProduct.php
@@ -0,0 +1,2242 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 'form-label-left final_product ','name' => 'final_product','id' => 'final_product');
+
+ echo form_open($this->config->base_url().'/batchcard/Final+Product/',$attributes);
+ ?>
+
+
+
+
+
+
+ 'Select Material');
+
+ if(!empty($inv_final_product))
+ {
+ foreach ($inv_final_product as $SID):
+
+
+ $options2[$SID->product_id] = $SID->product_id.' '.' - '.' '.$SID->product_name;
+
+ endforeach;
+ }
+
+ echo form_dropdown('DEPTFN', $options2,set_value('DEPTFN',$SupId),'id="DEPTFN"' ,'required="true"' ,'class="form-control select2');
+
+ // $data = array('name' => 'Department','value' => set_value('Department'),'id'=>'Department', 'class' => 'form-control' ,'required' => 'true');
+ // echo form_input($data);
+
+ ?>
+
+
+
+
+
+ 'Date','value' => set_value('Date',$CurrentDate),'id'=>'Date', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;');
+ echo form_input($data);
+ ?>
+
+
+
+
+
+ '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');
+ echo form_input($data);
+ ?>
+
+
+
+
+
+
+
+
+ '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');
+ echo form_input($data);
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Raw Materials
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 'Select Material Code');
+
+ if(!empty($Raw_material))
+ {
+ foreach ($Raw_material as $mat):
+ $options[$mat->MaterialCode] =$mat->MaterialCode.' '.' - '.' '.$mat->MaterialName;
+
+
+ //$RL[$SID->ReqNo] = $SID->ReqNo.' '.' - '.' '.$SID->DepartmentName;
+ endforeach;
+ }
+
+
+
+
+ echo form_dropdown('rawmaterialcode', $options,set_value('MaterialCode'),'id="rawmaterialcode"' ,'class="form-control select2"' , 'required="true"' );
+ ?>
+
+
+
+
+
+
+
+
+
+ 'Select Supplier');
+
+ if(!empty($supplier))
+ {
+ foreach ($supplier as $mat):
+ $options[$mat->SupplierID] =$mat->SupplierID.' '.' - '.' '.$mat->SupplierName;
+
+
+ //$RL[$SID->ReqNo] = $SID->ReqNo.' '.' - '.' '.$SID->DepartmentName;
+ endforeach;
+ }
+
+
+
+
+ echo form_dropdown('rawSupplier', $options,set_value('SupplierID'),'id="rawSupplier"' ,'class="form-control select2"' ,'required="true"' );
+ ?>
+
+
+
+
+
+
+
+
+
+
+ 'rawqty','value' => set_value('rawqty'),'id'=>'rawqty', 'class' => 'form-control');
+ echo form_input($data);
+ ?>
+
+
+
+
+
+
+
+
+ 'rawprice','value' => set_value('rawprice'),'id'=>'rawprice', 'class' => 'form-control');
+ echo form_input($data);
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 'Select Material Code');
+
+ if(!empty($Raw_material))
+ {
+ foreach ($Raw_material as $mat):
+ $options[$mat->MaterialCode] =$mat->MaterialCode.' '.' - '.' '.$mat->MaterialName;
+
+
+ //$RL[$SID->ReqNo] = $SID->ReqNo.' '.' - '.' '.$SID->DepartmentName;
+ endforeach;
+ }
+
+
+
+
+ echo form_dropdown('Editrawmaterialcode', $options,set_value('MaterialCode'),'id="Editrawmaterialcode"' ,'class="form-control select2"' , 'required="true"' );
+ ?>
+
+
+
+
+
+
+
+
+
+ 'Select Material Code');
+
+ if(!empty($supplier))
+ {
+ foreach ($supplier as $mat):
+ $options[$mat->SupplierID] =$mat->SupplierID.' '.' - '.' '.$mat->SupplierName;
+
+
+ //$RL[$SID->ReqNo] = $SID->ReqNo.' '.' - '.' '.$SID->DepartmentName;
+ endforeach;
+ }
+
+
+
+
+ echo form_dropdown('EditrawSupplier', $options,set_value('SupplierID'),'id="EditrawSupplier"' ,'class="form-control select2"' , 'required="true"' );
+ ?>
+
+
+
+
+
+
+
+
+
+
+ 'Editrawqty','value' => set_value('Editrawqty'),'id'=>'Editrawqty', 'class' => 'form-control');
+ echo form_input($data);
+ ?>
+
+
+
+
+
+
+
+
+ 'Editrawprice','value' => set_value('Editrawprice'),'id'=>'Editrawprice', 'class' => 'form-control');
+ echo form_input($data);
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | S.No |
+ Material |
+ Supplier |
+ Quantity |
+ Price |
+ Action |
+
+
+ |
+ |
+ |
+ |
+
+
+
+
+
+
+
+
+
+
+
+
Add Consumable Materials
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 'Select Material Code');
+
+ if(!empty($consumable_material))
+ {
+ foreach ($consumable_material as $mat):
+ $options[$mat->MaterialCode] =$mat->MaterialCode.' '.' - '.' '.$mat->MaterialName;
+
+
+ //$RL[$SID->ReqNo] = $SID->ReqNo.' '.' - '.' '.$SID->DepartmentName;
+ endforeach;
+ }
+
+
+
+
+ echo form_dropdown('consumaterialcode', $options,set_value('MaterialCode'),'id="consumaterialcode"' ,'class="form-control select2"' , 'required="true"' );
+ ?>
+
+
+
+
+
+
+
+
+
+ 'Select Supplier');
+
+ if(!empty($supplier))
+ {
+ foreach ($supplier as $mat):
+ $options[$mat->SupplierID] =$mat->SupplierID.' '.' - '.' '.$mat->SupplierName;
+
+
+ //$RL[$SID->ReqNo] = $SID->ReqNo.' '.' - '.' '.$SID->DepartmentName;
+ endforeach;
+ }
+
+
+
+
+ echo form_dropdown('consuSupplier', $options,set_value('SupplierID'),'id="consuSupplier"' ,'class="form-control select2"' , 'required="true"' );
+ ?>
+
+
+
+
+
+
+
+
+
+
+ 'consuqty','value' => set_value('consuqty'),'id'=>'consuqty', 'class' => 'form-control');
+ echo form_input($data);
+ ?>
+
+
+
+
+
+
+
+
+ 'consuprice','value' => set_value('consuprice'),'id'=>'consuprice', 'class' => 'form-control');
+ echo form_input($data);
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 'Select Material Code');
+
+ if(!empty($consumable_material))
+ {
+ foreach ($consumable_material as $mat):
+ $options[$mat->MaterialCode] =$mat->MaterialCode.' '.' - '.' '.$mat->MaterialName;
+
+
+ //$RL[$SID->ReqNo] = $SID->ReqNo.' '.' - '.' '.$SID->DepartmentName;
+ endforeach;
+ }
+
+
+
+
+ echo form_dropdown('Editconsumaterialcode', $options,set_value('MaterialCode'),'id="Editconsumaterialcode"' ,'class="form-control select2"' , 'required="true"' );
+ ?>
+
+
+
+
+
+
+
+
+
+ 'Select Material Code');
+
+ if(!empty($supplier))
+ {
+ foreach ($supplier as $mat):
+ $options[$mat->SupplierID] =$mat->SupplierID.' '.' - '.' '.$mat->SupplierName;
+
+
+ //$RL[$SID->ReqNo] = $SID->ReqNo.' '.' - '.' '.$SID->DepartmentName;
+ endforeach;
+ }
+
+
+
+
+ echo form_dropdown('EditconsuSupplier', $options,set_value('SupplierID'),'id="EditconsuSupplier"' ,'class="form-control select2"' , 'required="true"' );
+ ?>
+
+
+
+
+
+
+
+
+
+
+ 'Editconsuqty','value' => set_value('Editconsuqty'),'id'=>'Editconsuqty', 'class' => 'form-control');
+ echo form_input($data);
+ ?>
+
+
+
+
+
+
+
+
+ 'Editconsuprice','value' => set_value('Editconsuprice'),'id'=>'Editconsuprice', 'class' => 'form-control');
+ echo form_input($data);
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | S.No |
+ Material |
+ Supplier |
+ Quantity |
+ Price |
+ Action |
+
+
+ |
+ |
+ |
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
Add Packing Materials
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 'Select Material Code');
+
+ if(!empty($Pack_material))
+ {
+ foreach ($Pack_material as $mat):
+ $options[$mat->MaterialCode] =$mat->MaterialCode.' '.' - '.' '.$mat->MaterialName;
+
+
+ //$RL[$SID->ReqNo] = $SID->ReqNo.' '.' - '.' '.$SID->DepartmentName;
+ endforeach;
+ }
+
+
+
+
+ echo form_dropdown('packumaterialcode', $options,set_value('MaterialCode'),'id="packumaterialcode"' ,'class="form-control select2"' , 'required="true"' );
+ ?>
+
+
+
+
+
+
+
+
+
+ 'Select Material Code');
+
+ if(!empty($supplier))
+ {
+ foreach ($supplier as $mat):
+ $options[$mat->SupplierID] =$mat->SupplierID.' '.' - '.' '.$mat->SupplierName;
+
+
+ //$RL[$SID->ReqNo] = $SID->ReqNo.' '.' - '.' '.$SID->DepartmentName;
+ endforeach;
+ }
+
+
+
+
+ echo form_dropdown('packSupplier', $options,set_value('SupplierID'),'id="packSupplier"' ,'class="form-control select2"' , 'required="true"' );
+ ?>
+
+
+
+
+
+
+
+
+
+
+ 'packqty','value' => set_value('packqty'),'id'=>'packqty', 'class' => 'form-control');
+ echo form_input($data);
+ ?>
+
+
+
+
+
+
+
+
+ 'packprice','value' => set_value('packprice'),'id'=>'packprice', 'class' => 'form-control');
+ echo form_input($data);
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 'Select Material Code');
+
+ if(!empty($Pack_material))
+ {
+ foreach ($Pack_material as $mat):
+ $options[$mat->MaterialCode] =$mat->MaterialCode.' '.' - '.' '.$mat->MaterialName;
+
+
+ //$RL[$SID->ReqNo] = $SID->ReqNo.' '.' - '.' '.$SID->DepartmentName;
+ endforeach;
+ }
+
+
+
+
+ echo form_dropdown('Editpackumaterialcode', $options,set_value('MaterialCode'),'id="Editpackumaterialcode"' ,'class="form-control select2"' , 'required="true"' );
+ ?>
+
+
+
+
+
+
+
+
+
+ 'Select Material Code');
+
+ if(!empty($supplier))
+ {
+ foreach ($supplier as $mat):
+ $options[$mat->SupplierID] =$mat->SupplierID.' '.' - '.' '.$mat->SupplierName;
+
+
+ //$RL[$SID->ReqNo] = $SID->ReqNo.' '.' - '.' '.$SID->DepartmentName;
+ endforeach;
+ }
+
+
+
+
+ echo form_dropdown('EditpackSupplier', $options,set_value('SupplierID'),'id="EditpackSupplier"' ,'class="form-control select2"' , 'required="true"' );
+ ?>
+
+
+
+
+
+
+
+
+
+
+ 'Editpackqty','value' => set_value('Editpackqty'),'id'=>'Editpackqty', 'class' => 'form-control');
+ echo form_input($data);
+ ?>
+
+
+
+
+
+
+
+
+ 'Editpackprice','value' => set_value('Editpackprice'),'id'=>'Editpackprice', 'class' => 'form-control');
+ echo form_input($data);
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | S.No |
+ Material |
+ Supplier |
+ Quantity |
+ Price |
+ Action |
+
+
+ |
+ |
+ |
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Add Co-Products
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 'Select Material Code');
+
+ if(!empty($inv_final_product))
+ {
+ foreach ($inv_final_product as $mat):
+ $options[$mat->product_id] =$mat->product_id.' '.' - '.' '.$mat->product_name;
+
+
+ //$RL[$SID->ReqNo] = $SID->ReqNo.' '.' - '.' '.$SID->DepartmentName;
+ endforeach;
+ }
+
+
+
+
+ echo form_dropdown('coproduct_id', $options,set_value('product_id'),'id="coproduct_id"' ,'class="form-control select2"' , 'required="true"' );
+ ?>
+
+
+
+
+
+
+
+
+ 'CopDate','value' => set_value('CopDate',$CurrentDate),'id'=>'CopDate', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;');
+ echo form_input($data);
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+ 'Coqty','value' => set_value('Coqty'),'id'=>'Coqty', 'class' => 'form-control');
+ echo form_input($data);
+ ?>
+
+
+
+
+
+
+
+
+ 'Coprice','value' => set_value('Coprice'),'id'=>'Coprice', 'class' => 'form-control');
+ echo form_input($data);
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 'Select Material Code');
+
+ if(!empty($inv_final_product))
+ {
+ foreach ($inv_final_product as $mat):
+ $options[$mat->product_id] =$mat->product_id.' '.' - '.' '.$mat->product_name;
+
+
+ //$RL[$SID->ReqNo] = $SID->ReqNo.' '.' - '.' '.$SID->DepartmentName;
+ endforeach;
+ }
+
+
+
+
+ echo form_dropdown('Editcoproduct_id', $options,set_value('product_id'),'id="Editcoproduct_id"' ,'class="form-control select2"' , 'required="true"' );
+ ?>
+
+
+
+
+
+
+
+
+ 'EditCopDate','value' => set_value('EditCopDate',$CurrentDate),'id'=>'EditCopDate', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;');
+ echo form_input($data);
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+ 'EditCoqty','value' => set_value('EditCoqty'),'id'=>'EditCoqty', 'class' => 'form-control');
+ echo form_input($data);
+ ?>
+
+
+
+
+
+
+
+
+ 'EditCoprice','value' => set_value('EditCoprice'),'id'=>'EditCoprice', 'class' => 'form-control');
+ echo form_input($data);
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | S.No |
+ Material |
+ Date |
+ Quantity |
+ Price |
+ Action |
+
+
+ |
+ |
+ |
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/application/views/editmaterialadjustment.php b/application/views/editmaterialadjustment.php
new file mode 100644
index 00000000..c3c48540
--- /dev/null
+++ b/application/views/editmaterialadjustment.php
@@ -0,0 +1,443 @@
+SupplierID;
+ $materialcode = $mat->MaterialCode;
+ $date = $mat->CreatedOn;
+ // $edit_Qty_aspersystem= $mat->;
+ $edit_Actual_Qty= $mat->ActualQuantity;
+ $edit_Adjustable_qty= '';
+ $edit_Description='';
+ }
+}
+
+
+
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 'form-label-left materialadjustment','name' => 'materialadjustment','id' => 'materialadjustment');
+
+ echo form_open($this->config->base_url().'batchcard/addmaterialadjustment',$attributes);
+
+
+
+ ?>
+
+
+
+
+
+ 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"');
+ ?>
+
+
+
+
+
+
+ 'date','value' => set_value('date',$date),'id'=>'date', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;');
+ echo form_input($data);
+ ?>
+
+
+
+
+
+
+ '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"' );
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ '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);
+
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 'ActualQty','value' => set_value('ActualQty',0),'id'=>'ActualQty', 'class' => 'form-control num' ,'onchange'=>'calculateamount()');
+ echo form_input($data);
+
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 'AdjustableQty','value' => set_value('AdjustableQty',0),'id'=>'AdjustableQty', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'', 'readonly'=>'true');
+ echo form_input($data);
+
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ '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"' );
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 'Description','value' => set_value('Description'),'id'=>'Description', 'class' => 'form-control' ,'rows' => '5', 'cols' => '100','maxlength' => '250');
+ echo Form_textarea($data);
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/application/views/includes/header.php b/application/views/includes/header.php
index dc0e36ea..6729b5e5 100755
--- a/application/views/includes/header.php
+++ b/application/views/includes/header.php
@@ -400,11 +400,11 @@ display: none;
-
+
@@ -413,6 +413,12 @@ display: none;
+
+
+ Material Adjustment List
+
+
+
+
+
+
+ Final Product
+
+
+
Material Adjustment
@@ -430,9 +443,18 @@ else{
+
+
+ Material Adjustment List
+
+
+
+
-
-
+
+
+
+
diff --git a/application/views/materialadjustment.php b/application/views/materialadjustment.php
index f53a2bdf..d23957bd 100644
--- a/application/views/materialadjustment.php
+++ b/application/views/materialadjustment.php
@@ -281,6 +281,16 @@ $('.getdetails').click(function()
{
addqty = obj.Addqty;
reduceqty = obj.ReduceQty;
+
+ if(addqty == null)
+ {
+ adjustQty =0;
+ }
+
+ if(reduceqty == null)
+ {
+ reduceqty=0;
+ }
});
var resultantqty = parseFloat(addqty)- parseFloat(reduceqty);
diff --git a/application/views/materialadjustmentlist.php b/application/views/materialadjustmentlist.php
new file mode 100644
index 00000000..42d43f9e
--- /dev/null
+++ b/application/views/materialadjustmentlist.php
@@ -0,0 +1,93 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | # |
+ Material Adjustment No |
+ Material Code |
+ Supplier Name |
+ Adjusted Qty |
+ Adjustment |
+ Adjusted On |
+ Action |
+
+
+
+
+ |
+ AdjustmentId ?> |
+ MaterialCode."-".$record->MaterialName; ?> |
+ SupplierID."-".$record->SupplierName; ?> |
+ Quantity ?> |
+
+ |
+
+ CreatedOn ?> |
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+