From 217034aae97697e1c21b0dcdbac7c3fa0f401450 Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Wed, 12 Sep 2018 16:10:36 +0530 Subject: [PATCH] final product --- application/controllers/batchcard.php | 10 +++++----- application/models/batchcard_model.php | 8 ++++++-- application/views/FinalProductHistory.php | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/application/controllers/batchcard.php b/application/controllers/batchcard.php index e97d1521..d97812ec 100755 --- a/application/controllers/batchcard.php +++ b/application/controllers/batchcard.php @@ -1699,7 +1699,7 @@ class batchcard extends BaseController $copfinal_history = array('RefID'=>$final_product_id,'ProductCode'=>$copmaterial,'Quantity'=>$copqty,'Price'=>$copvalue,'Transactiondate'=>$createddt,'TransactionType'=>'Inward'); - $final_cophistory_save= $this->batchcard_model->SaveFinalHistory($copfinal_history); + //$final_cophistory_save= $this->batchcard_model->SaveFinalHistory($copfinal_history); } echo "Details Saved Successfully"; @@ -2036,16 +2036,16 @@ class batchcard extends BaseController if(count($checkpackid)>0) { - $this->batchcard_model->update_finalcoproduct($coparray,$coplineId); - $finalHistoryupdate = $this->batchcard_model->UpdateFinalHistory($copfinal_history,$FPID,$copmaterial); + // $this->batchcard_model->update_finalcoproduct($coparray,$coplineId); + // $finalHistoryupdate = $this->batchcard_model->UpdateFinalHistory($copfinal_history,$FPID,$copmaterial); } else { - $this->batchcard_model->save_finalcoproduct($coparray); - $final_cophistory_save= $this->batchcard_model->SaveFinalHistory($copfinal_history); + // $this->batchcard_model->save_finalcoproduct($coparray); + // $final_cophistory_save= $this->batchcard_model->SaveFinalHistory($copfinal_history); } } } diff --git a/application/models/batchcard_model.php b/application/models/batchcard_model.php index 8a1d499b..d68d8be8 100755 --- a/application/models/batchcard_model.php +++ b/application/models/batchcard_model.php @@ -864,6 +864,7 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty'; $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->order_by('T_FinalProduct_Master.FPId','desc'); $res = $this->db->get(); return $res->result(); @@ -1174,13 +1175,16 @@ function GetFinishedProductList($starting_date,$end_date,$product_id) // where ProductCode=? // and Transactiondate >= ? and Transactiondate <= ?'; - $subQuery='select RefID,ProductCode,Quantity,Price,Transactiondate,TransactionType,product_name + $subQuery='select RefID,ProductCode,product_description,Quantity,Price,Transactiondate,TransactionType,product_name from T_FinalProduct_History join ip_products on ip_products.product_id= T_FinalProduct_History.ProductCode where ProductCode=? and Transactiondate >= ? and Transactiondate <= ?'; + +// $subQuery='select FPId as RefID,product_id as ProductCode,Quantity,product_description,Price,ProductDate as Transactiondate,ProductType as TransactionType,product_name from T_FinalProduct_Master join ip_products on ip_products.product_id= T_FinalProduct_Master.MaterialCode where MaterialCode=? and ProductDate >= ? and ProductDate <= ?'; + $query = $this->db->query($subQuery,array($product_id,$starting_date,$end_date)); - //print_r($this->db->last_query()); +// print_r($this->db->last_query()); return $query->result_array(); } diff --git a/application/views/FinalProductHistory.php b/application/views/FinalProductHistory.php index c2f0819e..b683f512 100644 --- a/application/views/FinalProductHistory.php +++ b/application/views/FinalProductHistory.php @@ -237,7 +237,7 @@ $(function() { tble +=''+ ''+idno+''+ ''+item.ProductCode+''+ - ''+item.product_name+''+ + ''+item.product_name+'-'+item.product_description+''+ ''+item.Price+''+ ''+item.Quantity+''+ ''+item.TransactionType+''+