final product
This commit is contained in:
parent
5401329c77
commit
69efd99d28
@ -336,5 +336,7 @@ define('Capital_RMCIncludingCustomers_Charge1',
|
||||
define('Consumables', 'Consumables');
|
||||
define('RawMaterial', 'Raw Material');
|
||||
define('Packingmaterial', 'Packing material');
|
||||
define('FinalProduct', 'Final Product');
|
||||
|
||||
/* End of file constants.php */
|
||||
/* Location: ./application/config/constants.php */
|
||||
|
||||
@ -334,12 +334,17 @@ $route['DeliveryPerformance']="user/deliver_perform";
|
||||
$route['poresetview']="purchaseorder/poresetview";
|
||||
|
||||
|
||||
//stock
|
||||
//stock
|
||||
|
||||
$route['FinalProduct'] = "batchcard/FinalProductCalculation";
|
||||
|
||||
$route['FinalProductlisting'] = "batchcard/FinalProductlisting";
|
||||
|
||||
$route['MaterailAdjustment'] = "batchcard/MaterailAdjustment";
|
||||
|
||||
$route['MaterailAdjustmentlist'] = "batchcard/MaterailAdjustmentlist";
|
||||
|
||||
$route['EditMaterialAdjustment'] = "batchcard/EditMaterialAdjustment";
|
||||
|
||||
$route['EditFinalProduct'] = "batchcard/EditFinalProduct";
|
||||
|
||||
|
||||
@ -1272,6 +1272,39 @@ class batchcard extends BaseController
|
||||
}
|
||||
|
||||
|
||||
function EditFinalProduct()
|
||||
{
|
||||
|
||||
$FPId = $_GET['FPId'];
|
||||
$data['masterproduct'] = $this->batchcard_model->getmasterProductDetails($FPId);
|
||||
$data['rawmaterial'] = $this->batchcard_model->getrawmaterialDetails($FPId);
|
||||
$data['consumaterial'] = $this->batchcard_model->getconsumaterialDetails($FPId);
|
||||
$data['packagematerial'] = $this->batchcard_model->getpackagematerialDetails($FPId);
|
||||
$data['coproductmaterial'] = $this->batchcard_model->getcoproductmaterial($FPId);
|
||||
$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();
|
||||
|
||||
|
||||
$this->global['pageTitle'] = 'Siddharth : Final Product';
|
||||
$this->loadViews("editFinalProduct", $this->global,$data,NULL);
|
||||
// $this->loadViews("finaledit", $this->global,$data,NULL);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function FinalProductlisting()
|
||||
{
|
||||
$data['final_product'] = $this->batchcard_model->getFinalProductDetaisl();
|
||||
|
||||
$this->global['pageTitle'] = 'Siddharth : Final Product';
|
||||
$this->loadViews("FinalProductlisting", $this->global,$data,NULL);
|
||||
}
|
||||
|
||||
|
||||
function MaterailAdjustment()
|
||||
{
|
||||
$data['MaterialCode'] = $this->batchcard_model->getMaterial();
|
||||
@ -1408,6 +1441,11 @@ class batchcard extends BaseController
|
||||
|
||||
$rawarray =array('FPId'=>$final_product_id,'MaterialCode'=>$rawmaterial,'SupplierID'=>$rawsupplier,'Quantity'=>$rawqty,'Price'=>$rawvalue,'CreatedBy'=>$createdby,'CreatedDate'=>$createddt);
|
||||
|
||||
$rawmaterialhistory= array('MaterialCode'=>$rawmaterial,'Transaction_type'=>'Reduce','Ref_Type'=>'Final Product','Ref_No'=>$final_product_id,'SupplierID'=>$rawsupplier,'Quantity'=>$rawqty,'ItemValue'=>$rawvalue,'CreatedBy'=>$CreatedBy,'CreatedOn'=>$createddt);
|
||||
|
||||
|
||||
$this->batchcard_model->save_rawmaterialto_materialHistory($rawmaterialhistory);
|
||||
|
||||
//print_r($rawarray);
|
||||
|
||||
$this->batchcard_model->save_finalraw($rawarray);
|
||||
@ -1423,6 +1461,10 @@ class batchcard extends BaseController
|
||||
|
||||
$conarray =array('FPId'=>$final_product_id,'MaterialCode'=>$conmaterial,'SupplierID'=>$consupplier,'Quantity'=>$conqty,'Price'=>$convalue,'CreatedBy'=>$createdby,'CreatedDate'=>$createddt);
|
||||
|
||||
$consuhistory= array('MaterialCode'=>$conmaterial,'Transaction_type'=>'Reduce','Ref_Type'=>'Final Product','Ref_No'=>$final_product_id,'SupplierID'=>$consupplier,'Quantity'=>$conqty,'ItemValue'=>$convalue,'CreatedBy'=>$CreatedBy,'CreatedOn'=>$createddt);
|
||||
|
||||
$this->batchcard_model->save_rawmaterialto_materialHistory($consuhistory);
|
||||
|
||||
$this->batchcard_model->save_finalcon($conarray);
|
||||
}
|
||||
|
||||
@ -1436,6 +1478,10 @@ class batchcard extends BaseController
|
||||
|
||||
$packarray =array('FPId'=>$final_product_id,'MaterialCode'=>$packmaterial,'SupplierID'=>$packsupplier,'Quantity'=>$packqty,'Price'=>$packvalue,'CreatedBy'=>$createdby,'CreatedDate'=>$createddt);
|
||||
|
||||
$packmathistory= array('MaterialCode'=>$packmaterial,'Transaction_type'=>'Reduce','Ref_Type'=>'Final Product','Ref_No'=>$final_product_id,'SupplierID'=>$packsupplier,'Quantity'=>$packqty,'ItemValue'=>$packvalue,'CreatedBy'=>$CreatedBy,'CreatedOn'=>$createddt);
|
||||
|
||||
$this->batchcard_model->save_rawmaterialto_materialHistory($packmathistory);
|
||||
|
||||
$this->batchcard_model->save_finalpacking($packarray);
|
||||
}
|
||||
|
||||
@ -1459,6 +1505,234 @@ class batchcard extends BaseController
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function UpdateFinal_Product_Save()
|
||||
{
|
||||
|
||||
|
||||
$FPID = $this->input->post('FPId');
|
||||
$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 H:i:s');
|
||||
//$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'=>$product_date);
|
||||
|
||||
// / print_r($final_master);
|
||||
|
||||
$final_master_save =$this->batchcard_model->update_final_product($final_master,$FPID);
|
||||
$lastId='';
|
||||
|
||||
|
||||
|
||||
$rawilne = $this->input->post('RawRow');
|
||||
$consuline = $this->input->post('ConsuRow');
|
||||
$packline = $this->input->post('PkgRow');
|
||||
$coproline = $this->input->post('CopRow');
|
||||
|
||||
|
||||
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);
|
||||
$rawilneno = $this->input->post('RawId'.$i);
|
||||
//echo $rawilneno;
|
||||
if($rawmaterial == '' && $rawsupplier == '' & $rawqty == '')
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
|
||||
$rawarray =array('FPId'=>$FPID,'MaterialCode'=>$rawmaterial,'SupplierID'=>$rawsupplier,'Quantity'=>$rawqty,'Price'=>$rawvalue,'CreatedBy'=>$createdby,'CreatedDate'=>$createddt);
|
||||
|
||||
|
||||
|
||||
|
||||
$rawmaterialhistory= array('MaterialCode'=>$rawmaterial,'Transaction_type'=>'Reduce','Ref_Type'=>'Final Product','Ref_No'=>$FPID,'SupplierID'=>$rawsupplier,'Quantity'=>$rawqty,'ItemValue'=>$rawvalue,'CreatedBy'=>$CreatedBy,'CreatedOn'=>$createddt);
|
||||
|
||||
|
||||
$checkrawid=$this->batchcard_model->GetRawid($rawilneno);
|
||||
|
||||
$checkrawhistory = $this->batchcard_model->GetRawCheck($rawmaterial,$FPID);
|
||||
|
||||
// echo $checkrawhistory;
|
||||
|
||||
|
||||
if(count($checkrawid)==0)
|
||||
{
|
||||
$this->batchcard_model->save_finalraw($rawarray);
|
||||
$this->batchcard_model->save_rawmaterialto_materialHistory($rawmaterialhistory);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$this->batchcard_model->update_finalraw($rawarray,$rawilneno);
|
||||
$this->batchcard_model->update_rawmaterialto_materialHistory($rawmaterialhistory,$rawmaterial,$FPID);
|
||||
//$this->batchcard_model->save_rawmaterialto_materialHistory($rawmaterialhistory);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
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);
|
||||
$consuline = $this->input->post('Consumable'.$i);
|
||||
|
||||
if($conmaterial == '' && $consupplier == '' & $conqty == '')
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
|
||||
$conarray =array('FPId'=>$FPID,'MaterialCode'=>$conmaterial,'SupplierID'=>$consupplier,'Quantity'=>$conqty,'Price'=>$convalue,'CreatedBy'=>$createdby,'CreatedDate'=>$createddt);
|
||||
|
||||
$consuhistory= array('MaterialCode'=>$conmaterial,'Transaction_type'=>'Reduce','Ref_Type'=>'Final Product','Ref_No'=>$FPID,'SupplierID'=>$consupplier,'Quantity'=>$conqty,'ItemValue'=>$convalue,'CreatedBy'=>$CreatedBy,'CreatedOn'=>$createddt);
|
||||
|
||||
|
||||
$checkconsuid=$this->batchcard_model->Getconsuid($consuline);
|
||||
|
||||
if(count($checkconsuid)>0)
|
||||
{
|
||||
$this->batchcard_model->update_finalconsu($conarray,$consuline);
|
||||
$this->batchcard_model->update_rawmaterialto_materialHistory($consuhistory,$conmaterial,$FPID);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$this->batchcard_model->save_finalcon($conarray);
|
||||
$this->batchcard_model->save_rawmaterialto_materialHistory($consuhistory);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
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);
|
||||
$packlineId = $this->input->post('packId'.$i);
|
||||
|
||||
if($packmaterial == '' && $packsupplier == '' & $packqty == '')
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
else{
|
||||
|
||||
$packarray =array('FPId'=>$FPID,'MaterialCode'=>$packmaterial,'SupplierID'=>$packsupplier,'Quantity'=>$packqty,'Price'=>$packvalue,'CreatedBy'=>$createdby,'CreatedDate'=>$createddt);
|
||||
|
||||
//print_r($packarray);
|
||||
$packmathistory= array('MaterialCode'=>$packmaterial,'Transaction_type'=>'Reduce','Ref_Type'=>'Final Product','Ref_No'=>$FPID,'SupplierID'=>$packsupplier,'Quantity'=>$packqty,'ItemValue'=>$packvalue,'CreatedBy'=>$CreatedBy,'CreatedOn'=>$createddt);
|
||||
|
||||
$checkpackid=$this->batchcard_model->Getpackid($packlineId);
|
||||
|
||||
if(count($checkpackid)>0)
|
||||
{
|
||||
$this->batchcard_model->update_finalpacking($packarray,$packlineId);
|
||||
|
||||
$this->batchcard_model->update_rawmaterialto_materialHistory($packmathistory,$packmaterial,$FPID);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
|
||||
$this->batchcard_model->save_rawmaterialto_materialHistory($packmathistory);
|
||||
|
||||
$this->batchcard_model->save_finalpacking($packarray);
|
||||
}
|
||||
}
|
||||
//echo "Updated";
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
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);
|
||||
$coplineId = $this->input->post('CopId'.$i);
|
||||
|
||||
if($copmaterial == '' && $codate == '' & $copqty == '')
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$coparray =array('FPId'=>$FPID,'MaterialCode'=>$copmaterial,'CoDate'=>$codate,'Quantity'=>$copqty,'Price'=>$copvalue,'CreatedBy'=>$createdby,'CreatedDate'=>$createddt);
|
||||
|
||||
$checkpackid=$this->batchcard_model->Getcopid($coplineId);
|
||||
// print_r($coparray);
|
||||
|
||||
if(count($checkpackid)>0)
|
||||
{
|
||||
$this->batchcard_model->update_finalcoproduct($coparray,$coplineId);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$this->batchcard_model->save_finalcoproduct($coparray);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
echo "Updated";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -769,6 +769,208 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
$res = $this->db->get();
|
||||
return $res->result();
|
||||
}
|
||||
|
||||
|
||||
function save_rawmaterialto_materialHistory($materialhistory)
|
||||
{
|
||||
$this->db->trans_start();
|
||||
$this->db->insert('T_Material_stock_history',$materialhistory);
|
||||
$insert_id = $this->db->affected_rows();
|
||||
$this->db->trans_complete();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
function getFinalProductDetaisl()
|
||||
{
|
||||
$this->db->select('T_FinalProduct_Master.*,product_name,product_description');
|
||||
$this->db->from('T_FinalProduct_Master');
|
||||
$this->db->join('ip_products','ip_products.product_id=T_FinalProduct_Master.MaterialCode');
|
||||
$res = $this->db->get();
|
||||
return $res->result();
|
||||
|
||||
}
|
||||
|
||||
|
||||
function getmasterProductDetails($FPId)
|
||||
{
|
||||
$this->db->select('T_FinalProduct_Master.*,product_name,product_description');
|
||||
$this->db->from('T_FinalProduct_Master');
|
||||
$this->db->join('ip_products','ip_products.product_id=T_FinalProduct_Master.MaterialCode');
|
||||
$this->db->where('T_FinalProduct_Master.FPId',$FPId);
|
||||
$res = $this->db->get();
|
||||
return $res->result();
|
||||
}
|
||||
|
||||
|
||||
function getrawmaterialDetails($FPId)
|
||||
{
|
||||
$this->db->select('T_FinalProduct_RawMaterials.*,SupplierName,MaterialName');
|
||||
$this->db->from('T_FinalProduct_RawMaterials');
|
||||
$this->db->join('T_MaterialMaster','T_MaterialMaster.MaterialCode=T_FinalProduct_RawMaterials.MaterialCode');
|
||||
$this->db->join('T_SupplierDetailsN','T_SupplierDetailsN.SupplierID=T_FinalProduct_RawMaterials.SupplierID');
|
||||
$this->db->where('T_FinalProduct_RawMaterials.FPId',$FPId);
|
||||
$res = $this->db->get();
|
||||
return $res->result();
|
||||
}
|
||||
|
||||
|
||||
function getconsumaterialDetails($FPId)
|
||||
{
|
||||
$this->db->select('T_FinalProduct_ConsumableMaterials.*,SupplierName,MaterialName');
|
||||
$this->db->from('T_FinalProduct_ConsumableMaterials');
|
||||
$this->db->join('T_MaterialMaster','T_MaterialMaster.MaterialCode=T_FinalProduct_ConsumableMaterials.MaterialCode');
|
||||
$this->db->join('T_SupplierDetailsN','T_SupplierDetailsN.SupplierID=T_FinalProduct_ConsumableMaterials.SupplierID');
|
||||
$this->db->where('T_FinalProduct_ConsumableMaterials.FPId',$FPId);
|
||||
$res = $this->db->get();
|
||||
return $res->result();
|
||||
}
|
||||
|
||||
|
||||
function getpackagematerialDetails($FPId)
|
||||
{
|
||||
$this->db->select('T_FinalProduct_PackingMaterials.*,SupplierName,MaterialName');
|
||||
$this->db->from('T_FinalProduct_PackingMaterials');
|
||||
$this->db->join('T_MaterialMaster','T_MaterialMaster.MaterialCode=T_FinalProduct_PackingMaterials.MaterialCode');
|
||||
$this->db->join('T_SupplierDetailsN','T_SupplierDetailsN.SupplierID=T_FinalProduct_PackingMaterials.SupplierID');
|
||||
$this->db->where('T_FinalProduct_PackingMaterials.FPId',$FPId);
|
||||
$res = $this->db->get();
|
||||
return $res->result();
|
||||
}
|
||||
|
||||
|
||||
function getcoproductmaterial($FPId)
|
||||
{
|
||||
$subQuery ='select T_FinalProduct_CoProduct_Materials.*,product_name
|
||||
from T_FinalProduct_CoProduct_Materials
|
||||
join ip_products on ip_products.product_id = T_FinalProduct_CoProduct_Materials.MaterialCode
|
||||
where T_FinalProduct_CoProduct_Materials.FPId=?';
|
||||
|
||||
$query = $this->db->query($subQuery,array($FPId));
|
||||
|
||||
return $query->result_array();
|
||||
|
||||
}
|
||||
|
||||
|
||||
function update_final_product($final_master,$FPId)
|
||||
{
|
||||
//print_r($final_master);
|
||||
$this->db->where('FPId', $FPId);
|
||||
$this->db->update('T_FinalProduct_Master', $final_master);
|
||||
$insert_id = $this->db->affected_rows();
|
||||
//return TRUE;
|
||||
if($insert_id>0)
|
||||
{
|
||||
$subQuery = 'select max(FPId) as FPId from T_FinalProduct_Master';
|
||||
|
||||
$query = $this->db->query($subQuery,array());
|
||||
|
||||
return $query->result_array();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function GetRawid($rawilneno)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('T_FinalProduct_RawMaterials');
|
||||
$this->db->where('RawId',$rawilneno);
|
||||
$query = $this->db->get();
|
||||
//print_r($this->db->last_query());
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function Getconsuid($consuline)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('T_FinalProduct_ConsumableMaterials');
|
||||
$this->db->where('ConId',$consuline);
|
||||
$query = $this->db->get();
|
||||
//print_r($this->db->last_query());
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
|
||||
function Getpackid($packlineId)
|
||||
{
|
||||
|
||||
$this->db->select('*');
|
||||
$this->db->from('T_FinalProduct_PackingMaterials');
|
||||
$this->db->where('PackId',$packlineId);
|
||||
$query = $this->db->get();
|
||||
//print_r($this->db->last_query());
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
|
||||
function Getcopid($coplineId)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('T_FinalProduct_CoProduct_Materials');
|
||||
$this->db->where('CoId',$coplineId);
|
||||
$query = $this->db->get();
|
||||
//print_r($this->db->last_query());
|
||||
return $query->result();
|
||||
|
||||
}
|
||||
|
||||
|
||||
function update_finalraw($rawarray,$rawilneno)
|
||||
{
|
||||
$this->db->where('RawId', $rawilneno);
|
||||
$this->db->update('T_FinalProduct_RawMaterials', $rawarray);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
function GetRawCheck($rawmaterial,$final_product_id)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('T_Material_stock_history');
|
||||
$this->db->where('MaterialCode',$rawmaterial);
|
||||
$this->db->where('Ref_No',$final_product_id);
|
||||
$this->db->where('Ref_Type',FinalProduct);
|
||||
$query = $this->db->get();
|
||||
//print_r($this->db->last_query());
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
|
||||
function update_rawmaterialto_materialHistory($rawmaterialhistory,$rawmaterial,$FPID)
|
||||
{
|
||||
$this->db->where('Ref_No', $FPID);
|
||||
$this->db->where('MaterialCode', $rawmaterial);
|
||||
$this->db->update('T_Material_stock_history', $rawmaterialhistory);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
function update_finalconsu($conarray,$consuline)
|
||||
{
|
||||
$this->db->where('ConId', $consuline);
|
||||
$this->db->update('T_FinalProduct_ConsumableMaterials', $conarray);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
function update_finalpacking($conarray,$packlineId)
|
||||
{
|
||||
$this->db->where('PackId', $packlineId);
|
||||
$this->db->update('T_FinalProduct_PackingMaterials', $conarray);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
function update_finalcoproduct($coparray,$coplineId)
|
||||
{
|
||||
$this->db->where('CoId', $coplineId);
|
||||
$this->db->update('T_FinalProduct_CoProduct_Materials', $coparray);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1291,6 +1291,8 @@ $("#EditItem").on("shown.bs.modal", function(e)
|
||||
userid = $(e.relatedTarget).data('userid');
|
||||
var tr= document.getElementById(userid);
|
||||
|
||||
|
||||
|
||||
$('#Editrawmaterialcode').val($('#rawmaterialcode'+userid).val());
|
||||
$('#EditrawSupplier').val($('#rawSupplierID'+userid).val());
|
||||
$('#Editrawqty').val($('#rawQty'+userid).val());
|
||||
@ -1372,19 +1374,24 @@ $("#EditRootCausemodal").on("shown.bs.modal", function(e)
|
||||
|
||||
$('.rootEditItem').click(function()
|
||||
{
|
||||
|
||||
//alert()
|
||||
var editconsumaterialcode= $('#Editconsumaterialcode').val();
|
||||
var editconsuSupplierID = $('#EditconsuSupplier').val();
|
||||
var editconsuQty = $('#Editconsuqty').val();
|
||||
var editrawprice = $('#Editconsuprice').val();
|
||||
|
||||
var tr= document.getElementById(rootuserid);
|
||||
var cellval = tr.cells;
|
||||
cellval[1].innerHTML = editconsumaterialcode;
|
||||
cellval[2].innerHTML = editconsuSupplierID;
|
||||
cellval[3].innerHTML = editconsuQty;
|
||||
cellval[4].innerHTML = editrawprice;
|
||||
// var tr= document.getElementById(rootuserid);
|
||||
// var cellval = tr.cells;
|
||||
// cellval[1].innerHTML = editconsumaterialcode;
|
||||
// cellval[2].innerHTML = editconsuSupplierID;
|
||||
// cellval[3].innerHTML = editconsuQty;
|
||||
// cellval[4].innerHTML = editrawprice;
|
||||
|
||||
// document.getElementById('rootcause'+rootuserid).innerHTML = editroot;
|
||||
document.getElementById('consumaterial'+rootuserid).innerHTML = editconsumaterialcode;
|
||||
document.getElementById('consusuppliername'+rootuserid).innerHTML = editconsuSupplierID;
|
||||
document.getElementById('consuQuantiy'+rootuserid).innerHTML = editconsuQty;
|
||||
document.getElementById('consumaterialPrice'+rootuserid).innerHTML = editrawprice;
|
||||
|
||||
$('#consumematerialcode'+rootuserid).val(editconsumaterialcode);
|
||||
$('#consumeSupplierID'+rootuserid).val(editconsuSupplierID);
|
||||
@ -1451,13 +1458,21 @@ $('.CounterEditItem').click(function()
|
||||
var editpacksuppliername = EditpackSupplier.options[EditpackSupplier.selectedIndex].text;
|
||||
|
||||
var tr= document.getElementById(cuserid);
|
||||
var cellval = tr.cells;
|
||||
//var cellval = tr.cells;
|
||||
//alert(cuserid)
|
||||
|
||||
cellval[1].innerHTML = editpackmaterialcode;
|
||||
cellval[2].innerHTML = editpacksuppliername;
|
||||
cellval[3].innerHTML = editpackQty;
|
||||
cellval[4].innerHTML = editpackprice;
|
||||
// cellval[1].innerHTML = editpackmaterialcode;
|
||||
// cellval[2].innerHTML = editpacksuppliername;
|
||||
// cellval[3].innerHTML = editpackQty;
|
||||
// cellval[4].innerHTML = editpackprice;
|
||||
|
||||
|
||||
document.getElementById('packmaterial'+cuserid).innerHTML = editpackmaterialcode;
|
||||
document.getElementById('packsuppliername'+cuserid).innerHTML = editpackSupplierID;
|
||||
document.getElementById('packQuantiy'+cuserid).innerHTML = editpackQty;
|
||||
document.getElementById('packmaterialPrice'+cuserid).innerHTML = editpackprice;
|
||||
|
||||
|
||||
|
||||
$('#packmaterialcode'+cuserid).val(editpackmaterialcode);
|
||||
$('#packSupplierID'+cuserid).val(editpackSupplierID);
|
||||
@ -1529,13 +1544,18 @@ $('.CoEditItem').click(function()
|
||||
var editcopproduct = Editcoproduct_id.options[Editcoproduct_id.selectedIndex].text;
|
||||
|
||||
var tr= document.getElementById(cuserid);
|
||||
var cellval = tr.cells;
|
||||
//var cellval = tr.cells;
|
||||
//alert(cuserid)
|
||||
|
||||
cellval[1].innerHTML = editcopproduct;
|
||||
cellval[2].innerHTML = editcopdate;
|
||||
cellval[3].innerHTML = editcopqty;
|
||||
cellval[4].innerHTML = editcopprice;
|
||||
// cellval[1].innerHTML = editcopproduct;
|
||||
// cellval[2].innerHTML = editcopdate;
|
||||
// cellval[3].innerHTML = editcopqty;
|
||||
// cellval[4].innerHTML = editcopprice;
|
||||
|
||||
document.getElementById('Copmaterial'+cuserid).innerHTML = editcoproductid;
|
||||
document.getElementById('Copsuppliername'+cuserid).innerHTML = newdate;
|
||||
document.getElementById('CopQuantiy'+cuserid).innerHTML = editcopqty;
|
||||
document.getElementById('CopmaterialPrice'+cuserid).innerHTML = editcopprice;
|
||||
|
||||
$('#Copmaterialcode'+cuserid).val(editcoproductid);
|
||||
$('#CopDate'+cuserid).val(newdate);
|
||||
@ -2221,7 +2241,7 @@ function Save()
|
||||
|
||||
alert(data);
|
||||
$('#content').loader('hide');
|
||||
//window.location = "ncrlist";
|
||||
window.location = "FinalProductlisting";
|
||||
|
||||
}
|
||||
else
|
||||
|
||||
88
application/views/FinalProductlisting.php
Normal file
88
application/views/FinalProductlisting.php
Normal file
@ -0,0 +1,88 @@
|
||||
|
||||
<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 - Final Product Listing</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>Id</th>
|
||||
<th>Product Name</th>
|
||||
<th>Quantity</th>
|
||||
<th>Price</th>
|
||||
<th>Date</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><?php
|
||||
if(!empty($final_product))
|
||||
{
|
||||
$index = 0;
|
||||
foreach($final_product as $record)
|
||||
{
|
||||
$index = $index + 1;
|
||||
?>
|
||||
<tr id="<?php echo $index ; ?>">
|
||||
<td><?php echo $index ; ?></td>
|
||||
<td><?php echo "FP".$record->FPId ?></td>
|
||||
<td><?php echo $record->product_description."-".$record->product_name; ?></td> <td><?php echo $record->Quantity; ?></td>
|
||||
<td><?php echo $record->Price ?></td>
|
||||
<td><?php echo $Cdt=new DateTime($record->ProductDate);
|
||||
$CreatedDate= $Cdt->format('d-m-Y');
|
||||
echo $CreatedDate; ?></td>
|
||||
|
||||
<td> <a data-toggle="tooltip" href="<?php echo base_url().'EditFinalProduct?FPId='.$record->FPId; ?>" ><i class="fa fa-pencil" data-toggle="tooltip" title="<?php echo $record->FPId; ?> - 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>
|
||||
2341
application/views/editFinalProduct.php
Normal file
2341
application/views/editFinalProduct.php
Normal file
File diff suppressed because it is too large
Load Diff
@ -406,6 +406,12 @@ display: none;
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="<?php echo base_url(); ?>FinalProduct">
|
||||
<i class="fa fa-dashboard"></i> <span>Final Product Listing</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="<?php echo base_url(); ?>MaterailAdjustment">
|
||||
@ -435,6 +441,12 @@ else{
|
||||
<i class="fa fa-dashboard"></i> <span>Final Product</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="<?php echo base_url(); ?>FinalProductlisting">
|
||||
<i class="fa fa-dashboard"></i> <span>Final Product Listing</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="<?php echo base_url(); ?>MaterailAdjustment">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user