diff --git a/application/config/routes.php b/application/config/routes.php
index 692011d4..8ef78e2d 100644
--- a/application/config/routes.php
+++ b/application/config/routes.php
@@ -370,3 +370,6 @@ $route['EditFinalProduct'] = "batchcard/EditFinalProduct";
$route['shortagematerialListing'] = 'rawmaterialdetails/shortagematerialListing';
+$route['MaterailStockReport'] = 'batchcard/MaterailStockReport';
+
+$route['IndividualStockDetails'] = 'batchcard/IndividualStockDetails';
\ No newline at end of file
diff --git a/application/controllers/batchcard.php b/application/controllers/batchcard.php
index 5a80f283..a3e9e48f 100755
--- a/application/controllers/batchcard.php
+++ b/application/controllers/batchcard.php
@@ -20,6 +20,7 @@ class batchcard extends BaseController
$this->load->model('batchcard_model');
$this->load->model('inwardgateregister_model');
$this->load->model('rawmaterialdetails_model');
+ $this->load->model('dahsboard_model');
$this->isLoggedIn();
$this->load->helper(array('form','url'));
date_default_timezone_set('Asia/Kolkata');
@@ -1287,6 +1288,8 @@ class batchcard extends BaseController
$data['packsupplier'] = $this->batchcard_model->Pacsupplier();
$data['stock_value'] = $this->batchcard_model->getStockValue();
$data['Records'] = $this->rawmaterialdetails_model->reOrderListing();
+ $data['productprices'] = $this->batchcard_model->getSalesProductvalue();
+ $data['reclaation'] = $this->batchcard_model->GetReclamationMaterial();
//echo count($data['rawsupplier']);die();
@@ -1299,6 +1302,7 @@ class batchcard extends BaseController
{
$FPId = $_GET['FPId'];
+ $data['check'] = $_GET['check'];
$data['masterproduct'] = $this->batchcard_model->getmasterProductDetails($FPId);
$data['rawmaterial'] = $this->batchcard_model->getrawmaterialDetails($FPId);
$data['consumaterial'] = $this->batchcard_model->getconsumaterialDetails($FPId);
@@ -1311,6 +1315,9 @@ class batchcard extends BaseController
$data['supplier'] = $this->batchcard_model->getSupplierlist();
$data['stock_value'] = $this->batchcard_model->getStockValue();
+ $data['reclaation'] = $this->batchcard_model->GetReclamationMaterial();
+
+
$data['Records'] = $this->rawmaterialdetails_model->reOrderListing();
$data['rawsupplier'] = $this->batchcard_model->Rawsupplier();
@@ -1549,6 +1556,8 @@ class batchcard extends BaseController
$final_master_save =$this->batchcard_model->insert_final_product($final_master);
+
+
//$final_product_id= $final_master_save[0]['PId'];
@@ -1571,6 +1580,19 @@ class batchcard extends BaseController
$final_history_save= $this->batchcard_model->SaveFinalHistory($final_history);
+
+
+
+ $finalproducthistory= array('MaterialCode'=>$final_product,'Transaction_type'=>'Add','Ref_Type'=>'Final Product','Ref_No'=>$final_product_id,'Quantity'=>$final_qty,'ItemValue'=>$product_value,'CreatedBy'=>$createdby,'CreatedOn'=>$createddt);
+
+
+ $this->batchcard_model->save_rawmaterialto_materialHistory($finalproducthistory);
+
+
+
+
+
+
$rawilne = $this->input->post('RawRow');
$consuline = $this->input->post('ConsuRow');
$packline = $this->input->post('PkgRow');
@@ -1710,6 +1732,13 @@ class batchcard extends BaseController
$copfinal_history = array('RefID'=>$final_product_id,'ProductCode'=>$copmaterial,'Quantity'=>$copqty,'Price'=>$copvalue,'Transactiondate'=>$createddt,'TransactionType'=>'Inward');
+
+
+ $copproducthistory= array('MaterialCode'=>$copmaterial,'Transaction_type'=>'Reduce','Ref_Type'=>'Final Product','Ref_No'=>$final_product_id,'Quantity'=>$copqty,'ItemValue'=>$copvalue,'CreatedBy'=>$createdby,'CreatedOn'=>$createddt);
+
+
+ $this->batchcard_model->save_rawmaterialto_materialHistory($copproducthistory);
+
//$final_cophistory_save= $this->batchcard_model->SaveFinalHistory($copfinal_history);
}
@@ -1754,6 +1783,16 @@ class batchcard extends BaseController
$finalHistoryupdate = $this->batchcard_model->UpdateFinalHistory($final_history,$FPID,$final_product);
+ $FPhistory= array('MaterialCode'=>$final_product,'Transaction_type'=>'Add','Ref_Type'=>'Final Product','Ref_No'=>$FPID,'Quantity'=>$final_qty,'ItemValue'=>$product_value,'CreatedBy'=>$createdby,'CreatedOn'=>$createddt);
+
+
+ $this->batchcard_model->update_rawmaterialto_materialHistory($FPhistory,$final_product,$FPID);
+
+
+
+
+
+
$rawilne = $this->input->post('RawRow');
$consuline = $this->input->post('ConsuRow');
@@ -2042,6 +2081,14 @@ class batchcard extends BaseController
$copfinal_history = array('RefID'=>$FPID,'ProductCode'=>$copmaterial,'Quantity'=>$copqty,'Price'=>$copvalue,'Transactiondate'=>$createddt,'TransactionType'=>'Inward');
+
+ $Cophistory= array('MaterialCode'=>$copmaterial,'Transaction_type'=>'Reduce','Ref_Type'=>'Final Product','Ref_No'=>$FPID,'Quantity'=>$copqty,'ItemValue'=>$copvalue,'CreatedBy'=>$createdby,'CreatedOn'=>$createddt);
+
+
+
+
+ // $this->batchcard_model->update_rawmaterialto_materialHistory($FPhistory,$final_product,$FPID);
+
// print_r($coparray);
@@ -2051,12 +2098,17 @@ class batchcard extends BaseController
$finalHistoryupdate = $this->batchcard_model->UpdateFinalHistory($copfinal_history,$FPID,$copmaterial);
+ $this->batchcard_model->update_rawmaterialto_materialHistory($Cophistory,$copmaterial,$FPID);
+
+
}
else
{
$this->batchcard_model->save_finalcoproduct($coparray);
$final_cophistory_save= $this->batchcard_model->SaveFinalHistory($copfinal_history);
+
+ $this->batchcard_model->save_rawmaterialto_materialHistory($Cophistory);
}
}
}
@@ -2165,5 +2217,82 @@ class batchcard extends BaseController
}
+
+
+ function MaterailStockReport()
+ {
+ //$data['materailAdjustmentlist'] = $this->batchcard_model->getAllMaterialAdjustments();
+ $data['finyear']=$this->batchcard_model->finyear();
+
+ if ($this->input->post('btn_submit')) {
+
+
+ $search['year'] =$this->input->post('Finyear');
+ $search['from_date'] = $this->input->post('fdate');
+ $search['to_date'] = $this->input->post('tdate');
+ $search['month'] = $this->input->post('month');
+
+ $data['getdata'] = $this->batchcard_model->GetStockAbstract($search);
+
+ $data['field_det'] = $search;
+
+ //print_r($data['getdata']);die();
+
+ }
+
+
+ $this->global['pageTitle'] = 'Siddharth : Stock Report';
+ $this->loadViews("materialStockReport", $this->global,$data,NULL);
+ }
+
+
+ function IndividualStockDetails()
+ {
+ //$PONO = $_GET['PONO'];
+
+ $get['year'] = $_GET['year'];
+
+ $get['materialcode'] = $_GET['MaterialCode'];
+
+ $get['month'] = $_GET['month'];
+
+ $get['fdate'] = $_GET['fromdate'];
+
+ $get['tdate'] = $_GET['todate'];
+
+ $get['open'] = $_GET['openingstock'];
+
+ $get['addition'] = $_GET['Add'];
+
+ $get['reduce'] = $_GET['Reduce'];
+
+ $data['finyear']=$this->batchcard_model->finyear();
+
+
+ if($get['tdate'] == '')
+ {
+ $get['tdate']='0';
+ }
+
+ else if($get['fdate'] =='')
+ {
+ $get['fdate']='0';
+ }
+
+ //die();
+
+
+ $data['getdata'] = $this->batchcard_model->GetStockAbstractdetails($get);
+
+ $data['field_det'] = $get;
+
+ $this->global['pageTitle'] = 'Siddharth : Stock Report';
+
+ $this->loadViews("individualStockdetails", $this->global,$data,NULL);
+
+
+
+ }
+
}
?>
\ No newline at end of file
diff --git a/application/controllers/rawmaterialdetails.php b/application/controllers/rawmaterialdetails.php
index 8a6ad69e..a833091a 100755
--- a/application/controllers/rawmaterialdetails.php
+++ b/application/controllers/rawmaterialdetails.php
@@ -274,6 +274,25 @@ else
{
$IsActive = '0';
}
+
+
+
+ $salesproduct = $this->input->post('isSales');
+
+
+
+
+ if( $chked != '')
+ {
+ $IsActive = '1';
+ }
+ else
+ {
+ $IsActive = '0';
+ }
+
+
+
$RawMaterial = array('MaterialName'=>$MaterialName, 'MaterialType'=>$MaterialType, 'UOM'=>$UOM,'Category'=>$MaterialCategory, 'CreatedBy'=>$CreatedBy,'IsActive' => $IsActive,'assetcode'=>$AssetCode,'CostCenterCode'=>$CostCenterCode,'ConversionFactorUnit'=>$ConversionFactor,'ConversionFactorUOM'=>$ConversionFactorUOM,'Remarks'=>$Remarks,'HSNCODE'=>$HSNcode ,'stock'=>$stock,'stockdate'=>$stockdate,'reorder'=>$reorder,'Current_stock'=>$currentstock);
//print_r($RawMaterial);die();
diff --git a/application/models/batchcard_model.php b/application/models/batchcard_model.php
index 5f404ac1..7b013318 100755
--- a/application/models/batchcard_model.php
+++ b/application/models/batchcard_model.php
@@ -689,6 +689,20 @@ class batchcard_model extends CI_Model
}
+ function GetReclamationMaterial()
+ {
+
+ $this->db->select('product_id,product_name,product_description');
+ $this->db->from('ip_products');
+ $this->db->join('ip_families','ip_families.family_id=ip_products.family_id');
+ // $this->db->where('T_MaterialMaster.Category',Packingmaterial);
+ $this->db->where('ip_families.family_name like','%Reclam%');
+ $supp = $this->db->get();
+ return $supp->result();
+
+ }
+
+
function getMaterial()
{
$this->db->select('MaterialCode,MaterialName,');
@@ -1302,6 +1316,293 @@ where MaterialCode = ? and SupplierID=?';
}
+
+
+ function getSalesProductvalue()
+ {
+ $this->db->select('product_id,product_price');
+ $this->db->from('ip_products');
+ $price = $this->db->get();
+ return $price->result();
+ }
+
+
+
+ function finyear(){
+
+ $sql="SELECT
+ CASE WHEN MONTH(MaterialRcvdDate)>=4
+ THEN concat(YEAR(MaterialRcvdDate), '-',YEAR(MaterialRcvdDate)+1)
+ ELSE concat(YEAR(MaterialRcvdDate)-1,'-', YEAR(MaterialRcvdDate))
+ END AS financial_year
+ FROM T_IGR_Master
+ GROUP BY financial_year";
+ $query = $this->db->query($sql);
+
+ // print_r($this->db->last_query());die();
+ return $query->result();
+
+ }
+
+
+
+ function GetStockAbstract($search)
+ {
+ // echo 'in';
+
+ $fdate = $search['from_date'];
+ $fromdate = date("Y-m-d", strtotime($fdate) );
+
+ $tdate = $search['to_date'];
+ $todate = date("Y-m-d", strtotime($tdate) );
+
+ //echo $todate;die();
+
+ $finyear = $search['year'];
+
+$pieces = explode("-", $finyear);///fin year
+//print_r($search); die();
+$startyr = $pieces['0'];
+$endyr = $pieces['1'];
+
+//echo $endyr;die();
+
+
+$subquery="SELECT
+ DISTINCT(p.MaterialCode) AS ProductID,Ref_No,Date(CreatedOn),mm.MaterialName,stock,MaterialType,Category,stockdate,OpeningStock,mm.Category,ip.product_name,ip.product_id,
+ SUM(IF(p.Transaction_type='Add',Quantity,0)) AS Addition,
+ SUM(IF(p.Transaction_type='Reduce',Quantity,0)) AS Reduce,
+ SUM((IF(p.Transaction_type='Add',Quantity,0))-(IF(p.Transaction_type='Reduce',Quantity,0))) AS AvailableStock
+FROM
+ T_Material_stock_history AS p
+left join T_MaterialMaster mm on mm.MaterialCode = p.MaterialCode
+
+left join ip_products ip on ip.product_id=p.MaterialCode
+ ";
+
+
+if($search['month']=='' && $startyr =='' && $endyr =='')
+{
+
+ if($search['from_date'] != '')
+ {
+
+ $subquery.=" left join (select StockId,pp.MaterialCode mc,
+SUM((IF(pp.Transaction_type='Add',Quantity,0))-(IF(pp.Transaction_type='Reduce',Quantity,0)))
+AS OpeningStock
+FROM T_Material_stock_history AS pp
+where pp.CreatedOn < '".$fromdate."'
+GROUP BY pp.MaterialCode
+) as opens on opens.mc = p.MaterialCode";
+ }
+
+
+}
+
+
+else if($search['month']!='' && $startyr !='' && $endyr !='' )
+{
+
+ if($search['month']!='')
+ {
+ $subquery.=" left join (select StockId,pq.MaterialCode mc,
+SUM((IF(pq.Transaction_type='Add',Quantity,0))-(IF(pq.Transaction_type='Reduce',Quantity,0)))
+AS OpeningStock
+FROM T_Material_stock_history AS pq
+where month(pq.CreatedOn) < '".$search['month']."'
+GROUP BY pq.MaterialCode
+) as opens on opens.mc = p.MaterialCode";
+
+ }
+
+}
+
+
+else if($search['month']=='' && $startyr !='' && $endyr !='' )
+{
+
+ // if($search['month']!='')
+ // {
+ $subquery.=" left join (select StockId,pq.MaterialCode mc,
+SUM((IF(pq.Transaction_type='Add',Quantity,0))-(IF(pq.Transaction_type='Reduce',Quantity,0)))
+AS OpeningStock
+FROM T_Material_stock_history AS pq
+where date(pq.CreatedOn) < '".$startyr."-03-31'
+GROUP BY pq.MaterialCode
+) as opens on opens.mc = p.MaterialCode";
+
+ // }
+
+}
+
+
+
+
+//$subquery.=" where mm.IsActive='1'";
+
+if($search['month']=='' && $startyr =='' && $endyr =='')
+{
+
+ if($search['from_date'] != '')
+ {
+
+ $subquery.=" where date(p.CreatedOn)>= '".$fromdate."'";
+ }
+
+ if($search['to_date'] != '')
+ {
+ //$subquery. = " and date(p.CreatedOn)<='".$todate."'";
+
+ $subquery.=" and date(p.CreatedOn)<= '".$todate."'";
+ }
+
+}
+
+else
+{
+
+ // if($search['month']!='' && $startyr !='' && $endyr !='')
+ // {
+ // $subquery.=" where month(p.CreatedOn)= '".$search['month']."'";
+ // }
+
+
+ if($search['month']!='' && $startyr !='' && $endyr !='')
+ {
+ $subquery.=" where month(p.CreatedOn)= '".$search['month']."' and date(p.CreatedOn)>= '".$startyr."-04-01' and date(p.CreatedOn)<= '".$endyr."-03-31'";
+ }
+
+ if($startyr !='' && $endyr !='' && $search['month']=='')
+ {
+ $subquery.=" where date(p.CreatedOn)>= '".$startyr."-04-01' and date(p.CreatedOn)<= '".$endyr."-03-31'";
+ }
+
+}
+
+
+
+
+$subquery.=" GROUP BY p.MaterialCode";
+//$subquery. = "GROUP BY p.MaterialCode";
+
+$query = $this->db->query($subquery,array());
+
+//print_r($query->result());die();
+
+//print_r($this->db->last_query());die();
+
+ return $query->result();
+
+
+ }
+
+
+
+
+ function GetStockAbstractdetails($search)
+ {
+ // echo 'in';
+
+ $fdate = $search['fdate'];
+
+ if($fdate != '0')
+ {
+ $fromdate = date("Y-m-d", strtotime($fdate) );
+ }
+
+ else
+ {
+ $fromdate ='';
+
+ }
+
+ $tdate = $search['tdate'];
+
+ if($tdate != '0')
+ {
+ $todate = date("Y-m-d", strtotime($tdate) );
+ }
+
+ else
+ {
+ $todate = '';
+ }
+ //echo $todate;die();
+
+ $finyear = $search['year'];
+
+$pieces = explode("-", $finyear);///fin year
+//print_r($search); die();
+$startyr = $pieces['0'];
+$endyr = $pieces['1'];
+
+//echo $endyr;die();
+
+
+$subquery="SELECT
+ DISTINCT(p.MaterialCode) AS ProductID,Ref_No,Date(CreatedOn) as Cdate,mm.MaterialName,stock,MaterialType,Category,stockdate,p.Transaction_type,Ref_Type, Ref_No,ip.product_name,
+ SUM(IF(p.Transaction_type='Add',Quantity,0)) AS Addition,
+ SUM(IF(p.Transaction_type='Reduce',Quantity,0)) AS Reduce,
+ SUM((IF(p.Transaction_type='Add',Quantity,0))-(IF(p.Transaction_type='Reduce',Quantity,0))) AS AvailableStock
+FROM
+ T_Material_stock_history AS p
+left join T_MaterialMaster mm on mm.MaterialCode = p.MaterialCode
+left join ip_products ip on ip.product_id=p.MaterialCode
+where p.MaterialCode='".$search['materialcode']."'
+ ";
+
+
+
+
+if($search['month']=='' && $startyr =='' && $endyr =='')
+{
+
+ if($fromdate != '')
+ {
+
+ //echo "sv";die();
+
+ $subquery.=" and date(p.CreatedOn)>= '".$fromdate."'";
+ }
+
+ if($todate != '')
+ {
+ //$subquery. = " and date(p.CreatedOn)<='".$todate."'";
+
+ $subquery.=" and date(p.CreatedOn)<= '".$todate."'";
+ }
+
+}
+
+else
+{
+
+ if($search['month']!='')
+ {
+ $subquery.=" and month(p.CreatedOn)>= '".$search['month']."'";
+ }
+
+ if($startyr !='' && $endyr !='')
+ {
+ $subquery.=" and date(p.CreatedOn)>= '".$startyr."-04-01' and date(p.CreatedOn)<= '".$endyr."-03-31'";
+ }
+
+}
+
+
+
+
+$subquery.=" GROUP BY p.CreatedOn";
+//$subquery. = "GROUP BY p.MaterialCode";
+
+$query = $this->db->query($subquery,array());
+//print_r($this->db->last_query());die();
+
+ return $query->result();
+
+
+ }
+
}
?>
\ No newline at end of file
diff --git a/application/models/rawmaterialdetails_model.php b/application/models/rawmaterialdetails_model.php
index ccdd204a..f260a537 100755
--- a/application/models/rawmaterialdetails_model.php
+++ b/application/models/rawmaterialdetails_model.php
@@ -155,7 +155,9 @@ class rawmaterialdetails_model extends CI_Model
$subquery="SELECT SUM(IF(Transaction_type='Add',Quantity,0)) - SUM(IF(Transaction_type='Reduce',Quantity,0))as remainingqty
FROM T_Material_stock_history
WHERE MaterialCode=? AND CreatedOn >=? AND CreatedOn <=? ";
- $query = $this->db->query($subquery,array($MaterialCode,$startdate,$newdate));
+ $query = $this->db->query($subquery,array($MaterialCode,$startdate,$newdate));
+
+ // print_r($this->db->last_query());die();
return $query->result_array();
diff --git a/application/views/FinalProduct.php b/application/views/FinalProduct.php
index ca806f43..ee948044 100644
--- a/application/views/FinalProduct.php
+++ b/application/views/FinalProduct.php
@@ -1000,11 +1000,11 @@ $(function() {
-
+
-
Add Co-Products
+
Add Products
@@ -1026,9 +1026,9 @@ $(function() {
$options = array("0"=>'Select Material Code');
- if(!empty($inv_final_product))
+ if(!empty($reclaation))
{
- foreach ($inv_final_product as $mat):
+ foreach ($reclaation as $mat):
$options[$mat->product_id] =$mat->product_id.' '.' - '.' '.$mat->product_name.' '.' ('.' '.$mat->product_description.')';
@@ -1121,9 +1121,9 @@ $(function() {
$options = array("0"=>'Select Material Code');
- if(!empty($inv_final_product))
+ if(!empty($reclaation))
{
- foreach ($inv_final_product as $mat):
+ foreach ($reclaation as $mat):
$options[$mat->product_id] =$mat->product_id.' '.' - '.' '.$mat->product_name;
@@ -1356,7 +1356,7 @@ var lowstock =;
var rawsupplier =;
-console.log(rawsupplier);
+//console.log(rawsupplier);
@@ -3834,6 +3834,31 @@ function EditResultantQty(materialtype)
+var pricelist = ;
+
+$('#DEPTFN').change(function()
+{
+ console.log(pricelist);
+
+var product = $('#DEPTFN').val();
+ $.each(pricelist,function(i,obj)
+ {
+ product_id = parseFloat(obj.product_id);
+
+ productprice = obj.product_price
+
+ if(product==product_id)
+ {
+ $('#values').val(productprice);
+
+ }
+
+ });
+
+});
+
+
+
function Save()
{
diff --git a/application/views/FinalProductlisting.php b/application/views/FinalProductlisting.php
index d80b3116..e87930fa 100644
--- a/application/views/FinalProductlisting.php
+++ b/application/views/FinalProductlisting.php
@@ -56,7 +56,7 @@
$CreatedDate= $Cdt->format('d-m-Y');
echo $CreatedDate; ?>
-
|
+
" > |
+
+
+
+
+
diff --git a/application/views/editFinalProduct.php b/application/views/editFinalProduct.php
index 5fcc72f8..7f381f76 100644
--- a/application/views/editFinalProduct.php
+++ b/application/views/editFinalProduct.php
@@ -28,6 +28,9 @@ if(!empty($masterproduct))
}
+//print_r($check);die();
+
+
//echo $finProduct;
?>
@@ -1102,9 +1105,9 @@ $(function() {
$options = array("0"=>'Select Material Code');
- if(!empty($inv_final_product))
+ if(!empty($reclaation))
{
- foreach ($inv_final_product as $mat):
+ foreach ($reclaation as $mat):
$options[$mat->product_id] =$mat->product_id.' '.' - '.' '.$mat->product_name.' '.' ('.' '.$mat->product_description.')';
@@ -1370,11 +1373,13 @@ $(function() {
-
+
+
+
diff --git a/application/views/editOldRawmaterial.php b/application/views/editOldRawmaterial.php
index e648dd4b..5e038cd0 100755
--- a/application/views/editOldRawmaterial.php
+++ b/application/views/editOldRawmaterial.php
@@ -112,9 +112,6 @@ if(!empty($currentstock))
{
$total= $x + $y;
}
-
-
-
}
diff --git a/application/views/includes/header.php b/application/views/includes/header.php
index 8e5fc70e..09e63d4c 100644
--- a/application/views/includes/header.php
+++ b/application/views/includes/header.php
@@ -549,6 +549,16 @@ display: none;
Material Adjustment List
+
+
+
+
+ Material Stock Abstract
+
+
+
+
+
Material History
+
+
+
+
+ Material Stock Abstract
+
+
+
+
diff --git a/application/views/individualStockdetails.php b/application/views/individualStockdetails.php
new file mode 100644
index 00000000..0a922a6e
--- /dev/null
+++ b/application/views/individualStockdetails.php
@@ -0,0 +1,537 @@
+MaterialName;
+ $code = $ge->ProductID;
+ $product = $ge->product_name;
+
+
+}
+
+//echo $seyear;die();
+$monthname='';
+
+
+
+if($semonth == '1')
+{
+ $monthname='January';
+}
+if($semonth == '2')
+{
+ $monthname='February';
+}
+if($semonth == '3')
+{
+ $monthname='March';
+}
+if($semonth == '4')
+{
+ $monthname='April';
+}
+if($semonth == '5')
+{
+ $monthname='May';
+}
+if($semonth == '6')
+{
+ $monthname='June';
+}
+if($semonth == '7')
+{
+ $monthname='July';
+}
+if($semonth == '8')
+{
+ $monthname='August';
+}
+if($semonth == '9')
+{
+ $monthname='September';
+}
+if($semonth == '10')
+{
+ $monthname='October';
+}
+if($semonth == '11')
+{
+ $monthname='November';
+}
+if($semonth == '12')
+{
+ $monthname='December';
+}
+
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 'form-label-left materialstockreport','name' => 'materialstockreport','id' => 'materialstockreport');
+
+ echo form_open($this->config->base_url().'batchcard/MaterailStockReport',$attributes);
+
+
+
+ ?>
+
+
+
+
+
+
+ 'Select Financial Year');
+
+ if(!empty($finyear))
+ {
+ foreach ($finyear as $item):
+ $options[$item->financial_year] =$item->financial_year;
+
+
+ //$RL[$SID->ReqNo] = $SID->ReqNo.' '.' - '.' '.$SID->DepartmentName;
+ endforeach;
+ }
+
+ echo form_dropdown('Finyear', $options,set_value('financial_year',$seyear),'id="Finyear"' ,'class="form-control select2"' , 'required="true"' );
+
+
+ // $data = array('name' => 'Finyear','value' => set_value('Finyear',$seyear),'id'=>'Finyear', 'class' => 'form-control');
+ // echo form_input($data);
+
+
+
+
+
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 'fdate','value' => set_value('fdate',$sefdate),'id'=>'fdate', 'class' => 'form-control' , 'onkeypress'=>'return false;');
+ echo form_input($data);
+ ?>
+
+
+
+
+
+
+
+
+
+
+ 'tdate','value' => set_value('tdate',$setdate),'id'=>'tdate', 'class' => 'form-control' ,'onkeypress'=>'return false;');
+ echo form_input($data);
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Abstract:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | SlNo |
+ Date |
+ Material Name |
+
+ Receipt/Issue |
+ Quantity |
+ Total |
+ Reference |
+
+
+
+
+
+
+ stock;
+ // $Openingstock = $beforestock-($ge->AvailableStock+$ge->Addition+$ge->Reduce);
+ ?>
+
+ |
+ Cdate;?> |
+ MaterialName.$ge->product_name;?> |
+ Transaction_type?> |
+ Addition;
+
+ if($ge->Reduce != 0){ echo $ge->Reduce;}?> |
+
+ AvailableStock;?> |
+
+ Ref_Type == 'Final Product'){?>
+
+
+ ">Ref_No?> |
+
+
+
+
+ Ref_Type != 'Final Product'){?>
+
+ Ref_No?> |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/application/views/materialStockReport.php b/application/views/materialStockReport.php
new file mode 100644
index 00000000..38d26bc7
--- /dev/null
+++ b/application/views/materialStockReport.php
@@ -0,0 +1,509 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 'form-label-left materialstockreport','name' => 'materialstockreport','id' => 'materialstockreport');
+
+ echo form_open($this->config->base_url().'batchcard/MaterailStockReport',$attributes);
+
+
+
+ ?>
+
+
+
+
+
+
+ 'Select Financial Year');
+
+ if(!empty($finyear))
+ {
+ foreach ($finyear as $item):
+ $options[$item->financial_year] =$item->financial_year;
+
+
+ //$RL[$SID->ReqNo] = $SID->ReqNo.' '.' - '.' '.$SID->DepartmentName;
+ endforeach;
+ }
+
+ echo form_dropdown('Finyear', $options,set_value('financial_year',$seyear),'id="Finyear"' ,'class="form-control select2"' , 'required="true"' );
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 'fdate','value' => set_value('fdate',$sefdate),'id'=>'fdate', 'class' => 'form-control' , 'onkeypress'=>'return false;');
+ echo form_input($data);
+ ?>
+
+
+
+
+
+
+
+
+
+
+ 'tdate','value' => set_value('tdate',$setdate),'id'=>'tdate', 'class' => 'form-control' ,'onkeypress'=>'return false;');
+ echo form_input($data);
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | Material Code |
+ Material Name |
+ Opening Stock |
+ Receipt |
+ Total |
+ Issue Stock |
+ Closing Stock |
+ |
+
+
+
+
+
+
+ stock;
+ //$Openingstock = $ge->AvailableStock-($ge->Addition+$ge->Reduce);
+
+ // $total = ($ge->OpeningStock + $ge->Addition);
+
+ // $FinalStock= $total - ($ge->Reduce);
+
+ $che = $ge->OpeningStock;
+
+ $MaterilCat='';
+
+ if($ge->Category !='')
+ {
+
+ $MaterilCat = $ge->Category;
+ }
+
+ else
+ {
+ $MaterilCat='Final Product';
+ }
+
+
+ $data1 = $ge->stockdate;
+
+ $stockyear = date('Y', strtotime($data1));
+
+ $stockmonth = date('m',strtotime($data1));
+
+ $data2 = $stockyear+1;
+
+ $curyear = date('Y');
+
+ $OpeningTotalStock = 0;
+
+
+//$dat = 'out';
+ if($curyear==$stockyear)
+ {
+ if($stockmonth>='4')
+ {
+ $OpeningTotalStock = $ge->OpeningStock+$ge->stock;
+
+ //$dat ='if1 if';
+
+ }
+
+ else
+ {
+ $OpeningTotalStock = $ge->OpeningStock;
+ //$dat ='if1 else';
+
+
+ }
+ }
+
+ else if($data2 == $curyear)
+ {
+ if($stockmonth>'3')
+ {
+ $OpeningTotalStock = $ge->OpeningStock+$ge->stock;
+
+ //$dat ='else if if';
+
+ }
+
+ else
+ {
+ $OpeningTotalStock = $ge->OpeningStock;
+ }
+ }
+
+ else
+ {
+
+//echo $ge->OpeningStock;
+ //$ch=$ge->OpeningStock;
+ if($ge->OpeningStock =='')
+ {
+ // $OpeningTotalStock = $ge->OpeningStock;
+
+ //$dat ='else if1';
+
+ $OpeningTotalStock = 0;
+ }
+
+ else
+ {
+ // $OpeningTotalStock = 0;
+
+ $OpeningTotalStock = $ge->OpeningStock;
+
+ // $dat ='else else';
+ }
+ }
+
+
+
+ $total = ($OpeningTotalStock + $ge->Addition);
+
+ $FinalStock= $total - ($ge->Reduce);
+
+
+
+
+ ?>
+
+
+
+
+
+ | ProductID;?> |
+ MaterialName.$ge->product_name;?> |
+
+
+ |
+ Addition?> |
+ |
+ Reduce?> |
+ |
+ |
+
+
+
+
+ No Data Found
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+