inward changes

This commit is contained in:
gandhimathi 2017-12-12 18:41:13 +05:30
parent 1c0c3a5ddc
commit 687ee443ac
6 changed files with 128 additions and 152 deletions

View File

@ -779,11 +779,11 @@ class report extends BaseController
{ {
$this->global['pageTitle'] = 'Siddharth : Reports'; $this->global['pageTitle'] = 'Siddharth : Reports';
$mat=$this->input->get('mid'); //$mat=$this->input->get('mid');
$cat=$this->input->get('cat'); $cat=$this->input->get('cat');
//print_r($sup); //print_r($sup);
$data['cum_year']=$this->dahsboard_Model->rawi_report_cum_year($mat,$cat); $data['cum_year']=$this->dahsboard_Model->rawi_report_cum_year($cat);
$this->loadviews("Report_cumulative_year_raw",$this->global,$data, NULL); $this->loadviews("Report_cumulative_year_raw",$this->global,$data, NULL);
} }
@ -791,12 +791,12 @@ class report extends BaseController
{ {
$this->global['pageTitle'] = 'Siddharth : Reports'; $this->global['pageTitle'] = 'Siddharth : Reports';
$mat=$this->input->get('mid'); //$mat=$this->input->get('mid');
$cat=$this->input->get('cat'); $cat=$this->input->get('cat');
//print_r($prod); //print_r($prod);
$data['cum_month']=$this->dahsboard_Model->rawi_report_cum_month($mat,$cat); $data['cum_month']=$this->dahsboard_Model->rawi_report_cum_month($cat);
$this->loadviews("Report_cumulative_month_raw",$this->global,$data, NULL); $this->loadviews("Report_cumulative_month_raw",$this->global,$data, NULL);
} }
@ -804,11 +804,11 @@ class report extends BaseController
{ {
$this->global['pageTitle'] = 'Siddharth : Reports'; $this->global['pageTitle'] = 'Siddharth : Reports';
$mat=$this->input->get('mid'); //$mat=$this->input->get('mid');
$cat=$this->input->get('cat'); $cat=$this->input->get('cat');
//print_r($prod); //print_r($prod);
$data['cum_day']=$this->dahsboard_Model->rawi_report_cum_day($mat,$cat); $data['cum_day']=$this->dahsboard_Model->rawi_report_cum_day($cat);
$this->loadviews("Report_cumulative_day_raw",$this->global,$data, NULL); $this->loadviews("Report_cumulative_day_raw",$this->global,$data, NULL);
} }
@ -822,7 +822,7 @@ class report extends BaseController
$fa=substr($ab,0,-5); $fa=substr($ab,0,-5);
$aa=substr($ab,5,5); $aa=substr($ab,5,5);
//print_r($prod); //print_r($prod);
$data['material']=$this->dahsboard_Model->material_name(); $data['material']=$this->dahsboard_Model->category();
$data['cust']=$this->dahsboard_Model->customer_name(); $data['cust']=$this->dahsboard_Model->customer_name();
$data['finyear']=$this->dahsboard_Model->report_finyear(); $data['finyear']=$this->dahsboard_Model->report_finyear();
$data['spurchse']=$this->dahsboard_Model->rawi_report_consolidate($cname,$fa,$aa); $data['spurchse']=$this->dahsboard_Model->rawi_report_consolidate($cname,$fa,$aa);
@ -844,7 +844,7 @@ class report extends BaseController
//$this->input->post('btn_submit'); //$this->input->post('btn_submit');
$cat = $this->input->get('cat'); $cat = $this->input->get('cat');
$sup = $this->input->get('sup'); $sup = $this->input->get('sup');
$mat = $this->input->get('mid'); //$mat = $this->input->get('mid');
$m = $this->input->get('m'); $m = $this->input->get('m');
$ab=$this->input->get('ab'); $ab=$this->input->get('ab');
$fa=substr($ab,0,-5); $fa=substr($ab,0,-5);
@ -853,7 +853,7 @@ class report extends BaseController
$data['material']=$this->dahsboard_Model->material_name(); $data['material']=$this->dahsboard_Model->material_name();
$data['cust']=$this->dahsboard_Model->customer_name(); $data['cust']=$this->dahsboard_Model->customer_name();
$data['finyear']=$this->dahsboard_Model->report_finyear(); $data['finyear']=$this->dahsboard_Model->report_finyear();
$data['spurchse']=$this->dahsboard_Model->rawi_consolidate_month($m,$cat,$sup,$mat,$fa,$aa); $data['spurchse']=$this->dahsboard_Model->rawi_consolidate_month($m,$cat,$sup,$fa,$aa);
// print_r( $data['spurchse']); // print_r( $data['spurchse']);
if($this->DEPCode == MANAGEMENT) if($this->DEPCode == MANAGEMENT)
{ {
@ -872,7 +872,7 @@ class report extends BaseController
//$this->input->post('btn_submit'); //$this->input->post('btn_submit');
$cat = $this->input->get('cat'); $cat = $this->input->get('cat');
$sup = $this->input->get('sup'); $sup = $this->input->get('sup');
$mat = $this->input->get('mid'); //$mat = $this->input->get('mid');
$ab=$this->input->get('ab'); $ab=$this->input->get('ab');
$fa=substr($ab,0,-5); $fa=substr($ab,0,-5);
$aa=substr($ab,5,5); $aa=substr($ab,5,5);
@ -880,7 +880,7 @@ class report extends BaseController
$data['material']=$this->dahsboard_Model->material_name(); $data['material']=$this->dahsboard_Model->material_name();
$data['cust']=$this->dahsboard_Model->customer_name(); $data['cust']=$this->dahsboard_Model->customer_name();
$data['finyear']=$this->dahsboard_Model->report_finyear(); $data['finyear']=$this->dahsboard_Model->report_finyear();
$data['spurchse']=$this->dahsboard_Model->rawi_consolidate_year($cat,$sup,$mat,$fa,$aa); $data['spurchse']=$this->dahsboard_Model->rawi_consolidate_year($cat,$sup,$fa,$aa);
// print_r( $data['spurchse']); // print_r( $data['spurchse']);
if($this->DEPCode == MANAGEMENT) if($this->DEPCode == MANAGEMENT)
{ {

View File

@ -494,7 +494,7 @@ group by PONO,POType,Dept_Name";
function report_total($fa,$aa){ function report_total($fa,$aa){
$sql="select Dept_Details.DepartmentName As Dept_Name, $sql="select ifnull(Dept_Details.DepartmentName,'-') As Dept_Name,
SUM(CASE WHEN Mast.Status = 'ST015' THEN 1 ELSE 0 END) AS PO_Created, SUM(CASE WHEN Mast.Status = 'ST015' THEN 1 ELSE 0 END) AS PO_Created,
SUM(CASE WHEN Mast.Status = 'ST025' THEN 1 ELSE 0 END) AS Approved, SUM(CASE WHEN Mast.Status = 'ST025' THEN 1 ELSE 0 END) AS Approved,
SUM(CASE WHEN Mast.Status = 'ST051' THEN 1 ELSE 0 END) AS Approver_Onhold, SUM(CASE WHEN Mast.Status = 'ST051' THEN 1 ELSE 0 END) AS Approver_Onhold,
@ -506,9 +506,8 @@ group by PONO,POType,Dept_Name";
SUM(CASE WHEN Mast.Status = 'ST045' THEN 1 ELSE 0 END) AS MRIR_Rejected, SUM(CASE WHEN Mast.Status = 'ST045' THEN 1 ELSE 0 END) AS MRIR_Rejected,
SUM(CASE WHEN Mast.Status = 'ST056' THEN 1 ELSE 0 END) AS Special_po SUM(CASE WHEN Mast.Status = 'ST056' THEN 1 ELSE 0 END) AS Special_po
from T_PO_Detail Mast from T_PO_Detail Mast
JOIN T_Requestion_Master as Req on Req.ReqNo=Mast.ReqNo left JOIN T_Requestion_Master as Req on Req.ReqNo=Mast.ReqNo
JOIN T_Employee_Details as Emp_Det on Emp_Det.EmpID=Req.RequestedBy left JOIN T_DepartmentDetails Dept_Details on Dept_Details.DEPCode=Req.RequestedDept
JOIN T_DepartmentDetails Dept_Details on Dept_Details.DEPCode=Emp_Det.Departmentcode
where Mast.PODate >= '".$fa."-04-01' and Mast.PODate <= '".$aa."-03-31' where Mast.PODate >= '".$fa."-04-01' and Mast.PODate <= '".$aa."-03-31'
group by Dept_Name"; group by Dept_Name";
$query = $this->db->query($sql); $query = $this->db->query($sql);
@ -811,6 +810,11 @@ group by month(created_date)";
$sql="SELECT distinct MaterialName FROM T_MaterialMaster;"; $sql="SELECT distinct MaterialName FROM T_MaterialMaster;";
$query = $this->db->query($sql); $query = $this->db->query($sql);
return $query->result(); return $query->result();
}
function category(){
$sql="SELECT distinct Category FROM T_MaterialMaster;";
$query = $this->db->query($sql);
return $query->result();
} }
function report_month_wise($mont){ function report_month_wise($mont){
$month= date("m",strtotime($mont)); $month= date("m",strtotime($mont));
@ -1503,45 +1507,45 @@ group by supplier_name,material_name";
} }
function rawi_report_cumulative(){ function rawi_report_cumulative(){
$sql="SELECT year.mid as mid,year.category as category,year.material_name as material_name,year.quantity as quantity,year.total as total,month.mquantity as mquantity,month.mtotal as mtotal,today.tquantity as tquantity,today.ttotal as ttotal $sql="SELECT year.category as category,year.quantity as quantity,year.total as total,month.mquantity as mquantity,month.mtotal as mtotal,today.tquantity as tquantity,today.ttotal as ttotal
FROM (SELECT mm.Category as category,mm.MaterialCode as mid,ifnull(mm.MaterialName,'-') as material_name,ifnull(sum(pl.Quantity),0) as quantity,round(ifnull(sum(pl.Quantity * pl.Rate),0),2) as total FROM (SELECT mm.Category as category,ifnull(sum(pl.Quantity),0) as quantity,round(ifnull(sum(pl.Quantity * pl.Rate),0),2) as total
FROM T_PurchaseOrder_Master pm FROM T_PurchaseOrder_Master pm
left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) and where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) and
case case
when (month(pm.PODate) >=4) then when (month(pm.CreatedDate) >=4) then
(YEAR(pm.PODate) = YEAR(CURRENT_DATE) and MONTH(pm.PODate) >= 4 ) or ( YEAR(pm.PODate) = YEAR(CURRENT_DATE)+1 and MONTH(pm.PODate) <= 3 ) (YEAR(pm.CreatedDate) = YEAR(CURRENT_DATE) and MONTH(pm.CreatedDate) >= 4 ) or ( YEAR(pm.CreatedDate) = YEAR(CURRENT_DATE)+1 and MONTH(pm.CreatedDate) <= 3 )
else else
(YEAR(pm.PODate) = YEAR(CURRENT_DATE)-1 and MONTH(pm.PODate) >= 4 ) or ( YEAR(pm.PODate) = YEAR(CURRENT_DATE) and MONTH(pm.PODate) <= 3 ) (YEAR(pm.CreatedDate) = YEAR(CURRENT_DATE)-1 and MONTH(pm.CreatedDate) >= 4 ) or ( YEAR(pm.CreatedDate) = YEAR(CURRENT_DATE) and MONTH(pm.CreatedDate) <= 3 )
end end
group by category,material_name group by category
) as year left join ) as year left join
(SELECT mm.Category as category,mm.MaterialCode as mid,ifnull(mm.MaterialName,'-') as material_name,ifnull(sum(pl.Quantity),0) as mquantity,round(ifnull(sum(pl.Quantity * pl.Rate),0),2) as mtotal (SELECT mm.Category as category,ifnull(sum(pl.Quantity),0) as mquantity,round(ifnull(sum(pl.Quantity * pl.Rate),0),2) as mtotal
FROM T_PurchaseOrder_Master pm FROM T_PurchaseOrder_Master pm
left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) and where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) and
month(pm.PODate) = month(current_date()) month(pm.CreatedDate) = month(current_date())
group by category,material_name group by category
) as month on month.material_name=year.material_name and month.category=year.category ) as month on month.category=year.category
left join left join
(SELECT mm.Category as category,mm.MaterialCode as mid,ifnull(mm.MaterialName,'-') as material_name,IF(pl.Quantity IS NULL or pl.Quantity = '', 0, sum(pl.Quantity)) as tquantity,ifnull(sum(pl.Quantity * pl.Rate),0) as ttotal (SELECT mm.Category as category,IF(pl.Quantity IS NULL or pl.Quantity = '', 0, sum(pl.Quantity)) as tquantity,ifnull(sum(pl.Quantity * pl.Rate),0) as ttotal
FROM T_PurchaseOrder_Master pm FROM T_PurchaseOrder_Master pm
left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) and where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) and
date(pm.PODate) = current_date() date(pm.CreatedDate) = current_date()
group by category,material_name group by category
) as today on today.material_name=month.material_name and today.category=month.category ) as today on today.category=month.category
group by category,material_name "; group by category ";
$query = $this->db->query($sql); $query = $this->db->query($sql);
return $query->result(); return $query->result();
} }
function rawi_report_cum_year($mat=null,$cat=null){ function rawi_report_cum_year($cat=null){
$sql="SELECT mm.Category as category,sd.SupplierID as sid,mm.MaterialCode as mid,sd.SupplierName as supplier_name,ifnull(mm.MaterialName,'-') as material_name,IF(pl.Quantity IS NULL or pl.Quantity = '', 0, sum(pl.Quantity)) as tquantity,ifnull(sum(pl.Quantity * pl.Rate),0) as ttotal $sql="SELECT mm.Category as category,sd.SupplierID as sid,mm.MaterialCode as mid,sd.SupplierName as supplier_name,ifnull(mm.MaterialName,'-') as material_name,IF(pl.Quantity IS NULL or pl.Quantity = '', 0, sum(pl.Quantity)) as tquantity,ifnull(sum(pl.Quantity * pl.Rate),0) as ttotal
FROM T_PurchaseOrder_Master pm FROM T_PurchaseOrder_Master pm
@ -1550,18 +1554,18 @@ left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) and where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) and
case case
when (month(pm.PODate) >=4) then when (month(pm.CreatedDate) >=4) then
(YEAR(pm.PODate) = YEAR(CURRENT_DATE) and MONTH(pm.PODate) >= 4 ) or ( YEAR(pm.PODate) = YEAR(CURRENT_DATE)+1 and MONTH(pm.PODate) <= 3 ) (YEAR(pm.CreatedDate) = YEAR(CURRENT_DATE) and MONTH(pm.CreatedDate) >= 4 ) or ( YEAR(pm.CreatedDate) = YEAR(CURRENT_DATE)+1 and MONTH(pm.CreatedDate) <= 3 )
else else
(YEAR(pm.PODate) = YEAR(CURRENT_DATE)-1 and MONTH(pm.PODate) >= 4 ) or ( YEAR(pm.PODate) = YEAR(CURRENT_DATE) and MONTH(pm.PODate) <= 3 ) (YEAR(pm.CreatedDate) = YEAR(CURRENT_DATE)-1 and MONTH(pm.CreatedDate) >= 4 ) or ( YEAR(pm.CreatedDate) = YEAR(CURRENT_DATE) and MONTH(pm.CreatedDate) <= 3 )
end end
and mm.MaterialCode = '".$mat."' and mm.Category = '".$cat."' and mm.Category = '".$cat."'
group by supplier_name,material_name"; group by supplier_name,material_name";
$query = $this->db->query($sql); $query = $this->db->query($sql);
//echo $sql; //echo $sql;
return $query->result(); return $query->result();
} }
function rawi_report_cum_month($mat=null,$cat=null){ function rawi_report_cum_month($cat=null){
$sql="SELECT mm.Category as category,sd.SupplierID as sid,mm.MaterialCode as mid,sd.SupplierName as supplier_name,ifnull(mm.MaterialName,'-') as material_name,IF(pl.Quantity IS NULL or pl.Quantity = '', 0, sum(pl.Quantity)) as tquantity,ifnull(sum(pl.Quantity * pl.Rate),0) as ttotal $sql="SELECT mm.Category as category,sd.SupplierID as sid,mm.MaterialCode as mid,sd.SupplierName as supplier_name,ifnull(mm.MaterialName,'-') as material_name,IF(pl.Quantity IS NULL or pl.Quantity = '', 0, sum(pl.Quantity)) as tquantity,ifnull(sum(pl.Quantity * pl.Rate),0) as ttotal
FROM T_PurchaseOrder_Master pm FROM T_PurchaseOrder_Master pm
@ -1569,12 +1573,12 @@ left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) and where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) and
month(pm.PODate) = month(current_date()) and mm.MaterialCode = '".$mat."' and mm.Category = '".$cat."' month(pm.CreatedDate) = month(current_date()) and mm.Category = '".$cat."'
group by supplier_name,material_name"; group by supplier_name,material_name";
$query = $this->db->query($sql); $query = $this->db->query($sql);
return $query->result(); return $query->result();
} }
function rawi_report_cum_day($mat=null,$cat=null){ function rawi_report_cum_day($cat=null){
$sql="SELECT mm.Category as category,sd.SupplierID as sid,mm.MaterialCode as mid,sd.SupplierName as supplier_name,ifnull(mm.MaterialName,'-') as material_name,IF(pl.Quantity IS NULL or pl.Quantity = '', 0, sum(pl.Quantity)) as tquantity,ifnull(sum(pl.Quantity * pl.Rate),0) as ttotal $sql="SELECT mm.Category as category,sd.SupplierID as sid,mm.MaterialCode as mid,sd.SupplierName as supplier_name,ifnull(mm.MaterialName,'-') as material_name,IF(pl.Quantity IS NULL or pl.Quantity = '', 0, sum(pl.Quantity)) as tquantity,ifnull(sum(pl.Quantity * pl.Rate),0) as ttotal
FROM T_PurchaseOrder_Master pm FROM T_PurchaseOrder_Master pm
@ -1582,40 +1586,41 @@ left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) and where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) and
date(pm.PODate) = current_date() and mm.MaterialCode = '".$mat."'and mm.Category = '".$cat."' date(pm.CreatedDate) = current_date() and mm.Category = '".$cat."'
group by supplier_name,material_name"; group by supplier_name,material_name";
$query = $this->db->query($sql); $query = $this->db->query($sql);
echo $sql;
return $query->result(); return $query->result();
} }
function rawi_report_consolidate($cname,$fa,$aa){ function rawi_report_consolidate($cname,$fa,$aa){
$sql="select mm.Category as category,mm.MaterialCode as mid,mm.MaterialName as material_name, $sql="select mm.Category as category,
SUM(IF(month(pm.PODate) = 4, pl.Quantity, 0)) AS April, SUM(IF(month(pm.CreatedDate) = 4, pl.Quantity, 0)) AS April,
SUM(IF(month(pm.PODate) = 5, pl.Quantity, 0)) AS May, SUM(IF(month(pm.CreatedDate) = 5, pl.Quantity, 0)) AS May,
SUM(IF(month(pm.PODate) = 6, pl.Quantity, 0)) AS June, SUM(IF(month(pm.CreatedDate) = 6, pl.Quantity, 0)) AS June,
SUM(IF(month(pm.PODate) = 7, pl.Quantity, 0)) AS July, SUM(IF(month(pm.CreatedDate) = 7, pl.Quantity, 0)) AS July,
SUM(IF(month(pm.PODate) = 8, pl.Quantity, 0)) AS August, SUM(IF(month(pm.CreatedDate) = 8, pl.Quantity, 0)) AS August,
SUM(IF(month(pm.PODate) = 9, pl.Quantity, 0)) AS September, SUM(IF(month(pm.CreatedDate) = 9, pl.Quantity, 0)) AS September,
SUM(IF(month(pm.PODate) = 10, pl.Quantity, 0)) AS October, SUM(IF(month(pm.CreatedDate) = 10, pl.Quantity, 0)) AS October,
SUM(IF(month(pm.PODate) = 11, pl.Quantity, 0)) AS November, SUM(IF(month(pm.CreatedDate) = 11, pl.Quantity, 0)) AS November,
SUM(IF(month(pm.PODate) = 12, pl.Quantity, 0)) AS December, SUM(IF(month(pm.CreatedDate) = 12, pl.Quantity, 0)) AS December,
SUM(IF(month(pm.PODate) = 1, pl.Quantity, 0)) AS January, SUM(IF(month(pm.CreatedDate) = 1, pl.Quantity, 0)) AS January,
SUM(IF(month(pm.PODate) = 2, pl.Quantity, 0)) AS February, SUM(IF(month(pm.CreatedDate) = 2, pl.Quantity, 0)) AS February,
SUM(IF(month(pm.PODate) = 3, pl.Quantity, 0)) AS March, SUM(IF(month(pm.CreatedDate) = 3, pl.Quantity, 0)) AS March,
sum(pl.Quantity) as qtotal, sum(pl.Quantity) as qtotal,
SUM(IF(month(pm.PODate) = 4, pl.Quantity * pl.Rate, 0)) AS vApril, SUM(IF(month(pm.CreatedDate) = 4, pl.Quantity * pl.Rate, 0)) AS vApril,
SUM(IF(month(pm.PODate) = 5, pl.Quantity * pl.Rate, 0)) AS vMay, SUM(IF(month(pm.CreatedDate) = 5, pl.Quantity * pl.Rate, 0)) AS vMay,
SUM(IF(month(pm.PODate) = 6, pl.Quantity * pl.Rate, 0)) AS vJune, SUM(IF(month(pm.CreatedDate) = 6, pl.Quantity * pl.Rate, 0)) AS vJune,
SUM(IF(month(pm.PODate) = 7, pl.Quantity * pl.Rate, 0)) AS vJuly, SUM(IF(month(pm.CreatedDate) = 7, pl.Quantity * pl.Rate, 0)) AS vJuly,
SUM(IF(month(pm.PODate) = 8, pl.Quantity * pl.Rate, 0)) AS vAugust, SUM(IF(month(pm.CreatedDate) = 8, pl.Quantity * pl.Rate, 0)) AS vAugust,
SUM(IF(month(pm.PODate) = 9, pl.Quantity * pl.Rate, 0)) AS vSeptember, SUM(IF(month(pm.CreatedDate) = 9, pl.Quantity * pl.Rate, 0)) AS vSeptember,
SUM(IF(month(pm.PODate) = 10, pl.Quantity * pl.Rate, 0)) AS vOctober, SUM(IF(month(pm.CreatedDate) = 10, pl.Quantity * pl.Rate, 0)) AS vOctober,
SUM(IF(month(pm.PODate) = 11, pl.Quantity * pl.Rate, 0)) AS vNovember, SUM(IF(month(pm.CreatedDate) = 11, pl.Quantity * pl.Rate, 0)) AS vNovember,
SUM(IF(month(pm.PODate) = 12, pl.Quantity * pl.Rate, 0)) AS vDecember, SUM(IF(month(pm.CreatedDate) = 12, pl.Quantity * pl.Rate, 0)) AS vDecember,
SUM(IF(month(pm.PODate) = 1, pl.Quantity * pl.Rate, 0)) AS vJanuary, SUM(IF(month(pm.CreatedDate) = 1, pl.Quantity * pl.Rate, 0)) AS vJanuary,
SUM(IF(month(pm.PODate) = 2, pl.Quantity * pl.Rate, 0)) AS vFebruary, SUM(IF(month(pm.CreatedDate) = 2, pl.Quantity * pl.Rate, 0)) AS vFebruary,
SUM(IF(month(pm.PODate) = 3, pl.Quantity * pl.Rate, 0)) AS vMarch, SUM(IF(month(pm.CreatedDate) = 3, pl.Quantity * pl.Rate, 0)) AS vMarch,
sum(pl.Quantity * pl.Rate) as vtotal sum(pl.Quantity * pl.Rate) as vtotal
FROM T_PurchaseOrder_Master pm FROM T_PurchaseOrder_Master pm
join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
@ -1625,7 +1630,7 @@ where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO f
if ($cname!= ''){ if ($cname!= ''){
$sql.="and mm.MaterialName = '".$cname."'"; $sql.="and mm.Category = '".$cname."'";
} }
@ -1633,17 +1638,17 @@ if ($cname!= ''){
if ($fa and $aa != ''){ if ($fa and $aa != ''){
$sql.=" and (pm.PODate >= '".$fa."-04-01' and pm.PODate <= '".$aa."-03-31')"; $sql.=" and (pm.CreatedDate >= '".$fa."-04-01' and pm.CreatedDate <= '".$aa."-03-31')";
} }
$sql.= "group by category,material_name"; $sql.= "group by category";
//echo $sql; //echo $sql;
$query = $this->db->query($sql); $query = $this->db->query($sql);
return $query->result(); return $query->result();
} }
function rawi_consolidate_month($m=null,$cat=null,$sup=null,$mat=null,$fa=null,$aa=null){ function rawi_consolidate_month($m=null,$cat=null,$sup=null,$fa=null,$aa=null){
$sql="select mm.Category as category,sd.SupplierID as sid,sd.SupplierName as supplier_name,mm.MaterialCode as mid,mm.MaterialName as material_name, $sql="select mm.Category as category,sd.SupplierID as sid,sd.SupplierName as supplier_name,mm.MaterialCode as mid,mm.MaterialName as material_name,
sum(pl.Quantity) as quantity, sum(pl.Quantity) as quantity,
@ -1653,10 +1658,10 @@ join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) and where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) and
monthname(pm.PODate) = '".$m."' and mm.Category = '".$cat."' and mm.MaterialCode = '".$mat."' "; monthname(pm.CreatedDate) = '".$m."' and mm.Category = '".$cat."' ";
if ($fa and $aa != ''){ if ($fa and $aa != ''){
$sql.=" and (pm.PODate >= '".$fa."-04-01' and pm.PODate <= '".$aa."-03-31')"; $sql.=" and (pm.CreatedDate >= '".$fa."-04-01' and pm.CreatedDate <= '".$aa."-03-31')";
} }
$sql.= "group by category,supplier_name,material_name"; $sql.= "group by category,supplier_name,material_name";
@ -1664,7 +1669,7 @@ if ($fa and $aa != ''){
//echo $sql; //echo $sql;
return $query->result(); return $query->result();
} }
function rawi_consolidate_year($cat=null,$sup=null,$mat=null,$fa=null,$aa=null){ function rawi_consolidate_year($cat=null,$sup=null,$fa=null,$aa=null){
$sql="select mm.Category as category,sd.SupplierID as sid,sd.SupplierName as supplier_name,mm.MaterialCode as mid,mm.MaterialName as material_name, $sql="select mm.Category as category,sd.SupplierID as sid,sd.SupplierName as supplier_name,mm.MaterialCode as mid,mm.MaterialName as material_name,
sum(pl.Quantity) as quantity, sum(pl.Quantity) as quantity,
@ -1674,10 +1679,10 @@ join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) and where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) and
mm.Category = '".$cat."' and mm.MaterialCode = '".$mat."' "; mm.Category = '".$cat."' ";
if ($fa and $aa != ''){ if ($fa and $aa != ''){
$sql.=" and (pm.PODate >= '".$fa."-04-01' and pm.PODate <= '".$aa."-03-31')"; $sql.=" and (pm.CreatedDate >= '".$fa."-04-01' and pm.CreatedDate <= '".$aa."-03-31')";
} }
$sql.= "group by category,supplier_name,material_name"; $sql.= "group by category,supplier_name,material_name";

View File

@ -76,9 +76,10 @@ if(!empty($mms))
?> ?>
<tr> <tr>
<td style="text-align:left;"> <td style="text-align:left;">
<a href="<?= base_url() ?>report/ilink_purchase?sid=<?php echo $rel->sid;?>&ab=<?php echo $ab;?>&mid=<?php echo $rel->mid;?>&cat=<?php echo $rel->category;?>&m=<?php echo $m;?>"><?php echo $rel->category;?> </a> <?php echo $rel->category;?>
</td> </td>
<td><span><?php echo $rel->supplier_name;?> <td><span>
<a href="<?= base_url() ?>report/ilink_purchase?sid=<?php echo $rel->sid;?>&ab=<?php echo $ab;?>&mid=<?php echo $rel->mid;?>&cat=<?php echo $rel->category;?>&m=<?php echo $m;?>"><?php echo $rel->supplier_name;?> </a>
</span></td> </span></td>
<td><span><?php echo $rel->material_name;?></span></td> <td><span><?php echo $rel->material_name;?></span></td>
<td style="text-align:right"><span><?php <td style="text-align:right"><span><?php

View File

@ -51,17 +51,17 @@
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="col-md-4"> <div class="col-md-4">
<label for="client_name"> <label for="client_name">
<?php echo 'Material'; ?> <?php echo 'Category'; ?>
</label> </label>
<div class="input-group"> <div class="input-group">
<select class="form-control" id="client_name" name="client_name"> <select class="form-control" id="client_name" name="client_name">
<option value="">Select Material</option> <option value="">Select Category</option>
<?php <?php
foreach($material as $item): foreach($material as $item):
{?> {?>
<option value="<?php echo $item->MaterialName;?>"><?php echo $item->MaterialName ; ?></option> <option value="<?php echo $item->Category;?>"><?php echo $item->Category ; ?></option>
<?php } endforeach; ?> <?php } endforeach; ?>
@ -120,7 +120,6 @@
<thead> <thead>
<tr> <tr>
<th style="text-align:center;">Category</th> <th style="text-align:center;">Category</th>
<th style="text-align:center;">Material Name</th>
<th style="text-align:center;">Apr</th> <th style="text-align:center;">Apr</th>
<th style="text-align:center;">May</th> <th style="text-align:center;">May</th>
<th style="text-align:center;">Jun</th> <th style="text-align:center;">Jun</th>
@ -157,88 +156,85 @@
foreach ($spurchse as $result) { ?> foreach ($spurchse as $result) { ?>
<tr> <tr>
<td style="text-align:left;"> <td style="text-align:left;">
<a href="<?= base_url() ?>report/ilink_purchase?ab=<?php echo $ab;?>&mid=<?php echo $result->mid;?>&cat=<?php echo $result->category;?>"><?php echo $result->category;?> </a> <a href="<?= base_url() ?>report/ilink_purchase?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>"><?php echo $result->category;?> </a>
</td> </td>
<td style="text-align:left;"><?php <td style="text-align:right;">
if(!empty($result->material_name)) { echo $result->material_name ; } else {echo "-";}
?></td>
<td style="text-align:right;">
<?php <?php
$apr= $apr + round($result->April); $apr= $apr + round($result->April);
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&mid=<?php echo $result->mid;?>&cat=<?php echo $result->category;?>&m=<?php echo 'April';?>"><?php echo round($result->April);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'April';?>"><?php echo round($result->April);?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$may= $may + round($result->May); $may= $may + round($result->May);
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&mid=<?php echo $result->mid;?>&cat=<?php echo $result->category;?>&m=<?php echo 'May';?>"><?php echo round($result->May);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'May';?>"><?php echo round($result->May);?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$jun= $jun + round($result->June); $jun= $jun + round($result->June);
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&mid=<?php echo $result->mid;?>&cat=<?php echo $result->category;?>&m=<?php echo 'June';?>"><?php echo round($result->June);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'June';?>"><?php echo round($result->June);?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$jul= $jul + round($result->July); $jul= $jul + round($result->July);
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&mid=<?php echo $result->mid;?>&cat=<?php echo $result->category;?>&m=<?php echo 'July';?>"><?php echo round($result->July);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'July';?>"><?php echo round($result->July);?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$aug= $aug + round($result->August); $aug= $aug + round($result->August);
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&mid=<?php echo $result->mid;?>&cat=<?php echo $result->category;?>&m=<?php echo 'August';?>"><?php echo round($result->August);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'August';?>"><?php echo round($result->August);?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$sep= $sep + $result->September; $sep= $sep + $result->September;
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&mid=<?php echo $result->mid;?>&cat=<?php echo $result->category;?>&m=<?php echo 'September';?>"><?php echo round($result->September);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'September';?>"><?php echo round($result->September);?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$oct= $oct + round($result->October); $oct= $oct + round($result->October);
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&mid=<?php echo $result->mid;?>&cat=<?php echo $result->category;?>&m=<?php echo 'October';?>"><?php echo round($result->October);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'October';?>"><?php echo round($result->October);?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$nov= $nov + round($result->November); $nov= $nov + round($result->November);
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&mid=<?php echo $result->mid;?>&cat=<?php echo $result->category;?>&m=<?php echo 'November';?>"><?php echo round($result->November);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'November';?>"><?php echo round($result->November);?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$dec= $dec + round($result->December); $dec= $dec + round($result->December);
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&mid=<?php echo $result->mid;?>&cat=<?php echo $result->category;?>&m=<?php echo 'December';?>"><?php echo round($result->December);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'December';?>"><?php echo round($result->December);?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$jan= $jan + round($result->January); $jan= $jan + round($result->January);
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&mid=<?php echo $result->mid;?>&cat=<?php echo $result->category;?>&m=<?php echo 'January';?>"><?php echo round($result->January);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'January';?>"><?php echo round($result->January);?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$feb= $feb + round($result->February); $feb= $feb + round($result->February);
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&mid=<?php echo $result->mid;?>&cat=<?php echo $result->category;?>&m=<?php echo 'February';?>"><?php echo round($result->February);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'February';?>"><?php echo round($result->February);?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$mar= $mar + round($result->March); $mar= $mar + round($result->March);
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&mid=<?php echo $result->mid;?>&cat=<?php echo $result->category;?>&m=<?php echo 'March';?>"><?php echo round($result->March);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'March';?>"><?php echo round($result->March);?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$tot= $tot + round($result->qtotal); $tot= $tot + round($result->qtotal);
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_year?ab=<?php echo $ab;?>&mid=<?php echo $result->mid;?>&cat=<?php echo $result->category;?>"><?php echo round($result->qtotal);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_year?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>"><?php echo round($result->qtotal);?> </a>
</td> </td>
</tr> </tr>
@ -252,13 +248,7 @@
<tfoot width="100%"> <tfoot width="100%">
<tr> <tr>
<td style="text-align:center;"><strong>Total</strong></td> <td style="text-align:center;"><strong>Total</strong></td>
<td style="text-align:right;"><strong><?php
{
echo '';
}
?>
</strong></td>
<td style="text-align:right;"><strong><?php <td style="text-align:right;"><strong><?php
{ {
echo $apr; echo $apr;
@ -392,7 +382,6 @@
<thead> <thead>
<tr> <tr>
<th style="text-align:center;">Category</th> <th style="text-align:center;">Category</th>
<th style="text-align:center;">Material Name</th>
<th style="text-align:center;">Apr &nbsp;(<i class="fa fa-rupee " ></i>)</th> <th style="text-align:center;">Apr &nbsp;(<i class="fa fa-rupee " ></i>)</th>
<th style="text-align:center;">May &nbsp;(<i class="fa fa-rupee " ></i>)</th> <th style="text-align:center;">May &nbsp;(<i class="fa fa-rupee " ></i>)</th>
<th style="text-align:center;">Jun &nbsp;(<i class="fa fa-rupee "></i>)</th> <th style="text-align:center;">Jun &nbsp;(<i class="fa fa-rupee "></i>)</th>
@ -428,88 +417,85 @@
foreach ($spurchse as $result) { ?> foreach ($spurchse as $result) { ?>
<tr> <tr>
<td style="text-align:left;"> <td style="text-align:left;">
<a href="<?= base_url() ?>report/link_purchase?ab=<?php echo $ab;?>&mid=<?php echo $result->mid;?>"><?php echo $result->category;?> </a> <a href="<?= base_url() ?>report/ilink_purchase?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>"><?php echo $result->category;?> </a>
</td> </td>
<td style="text-align:left;"><?php
if(!empty($result->material_name)) { echo $result->material_name ; } else {echo "-";}
?></td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$apr= $apr + round($result->vApril); $apr= $apr + round($result->vApril);
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&mid=<?php echo $result->mid;?>&cat=<?php echo $result->category;?>&m=<?php echo 'April';?>"><?php echo round($result->vApril);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'April';?>"><?php echo round($result->vApril);?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$may= $may + round($result->vMay); $may= $may + round($result->vMay);
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&mid=<?php echo $result->mid;?>&cat=<?php echo $result->category;?>&m=<?php echo 'May';?>"><?php echo round($result->vMay);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'May';?>"><?php echo round($result->vMay);?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$jun= $jun + round($result->vJune); $jun= $jun + round($result->vJune);
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&mid=<?php echo $result->mid;?>&cat=<?php echo $result->category;?>&m=<?php echo 'June';?>"><?php echo round($result->vJune);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'June';?>"><?php echo round($result->vJune);?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$jul= $jul + round($result->vJuly); $jul= $jul + round($result->vJuly);
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&mid=<?php echo $result->mid;?>&cat=<?php echo $result->category;?>&m=<?php echo 'July';?>"><?php echo round($result->vJuly);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'July';?>"><?php echo round($result->vJuly);?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$aug= $aug + round($result->vAugust); $aug= $aug + round($result->vAugust);
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&mid=<?php echo $result->mid;?>&cat=<?php echo $result->category;?>&m=<?php echo 'August';?>"><?php echo round($result->vAugust);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'August';?>"><?php echo round($result->vAugust);?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$sep= $sep + $result->vSeptember; $sep= $sep + $result->vSeptember;
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&mid=<?php echo $result->mid;?>&cat=<?php echo $result->category;?>&m=<?php echo 'September';?>"><?php echo round($result->vSeptember);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'September';?>"><?php echo round($result->vSeptember);?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$oct= $oct + round($result->vOctober); $oct= $oct + round($result->vOctober);
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&mid=<?php echo $result->mid;?>&cat=<?php echo $result->category;?>&m=<?php echo 'October';?>"><?php echo round($result->vOctober);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'October';?>"><?php echo round($result->vOctober);?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$nov= $nov + round($result->vNovember); $nov= $nov + round($result->vNovember);
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&mid=<?php echo $result->mid;?>&cat=<?php echo $result->category;?>&m=<?php echo 'November';?>"><?php echo round($result->vNovember);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'November';?>"><?php echo round($result->vNovember);?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$dec= $dec + round($result->vDecember); $dec= $dec + round($result->vDecember);
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&mid=<?php echo $result->mid;?>&cat=<?php echo $result->category;?>&m=<?php echo 'December';?>"><?php echo round($result->vDecember);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'December';?>"><?php echo round($result->vDecember);?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$jan= $jan + round($result->vJanuary); $jan= $jan + round($result->vJanuary);
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&mid=<?php echo $result->mid;?>&cat=<?php echo $result->category;?>&m=<?php echo 'January';?>"><?php echo round($result->vJanuary);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'January';?>"><?php echo round($result->vJanuary);?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$feb= $feb + round($result->vFebruary); $feb= $feb + round($result->vFebruary);
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&mid=<?php echo $result->mid;?>&cat=<?php echo $result->category;?>&m=<?php echo 'February';?>"><?php echo round($result->vFebruary);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'February';?>"><?php echo round($result->vFebruary);?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$mar= $mar + round($result->vMarch); $mar= $mar + round($result->vMarch);
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&mid=<?php echo $result->mid;?>&cat=<?php echo $result->category;?>&m=<?php echo 'March';?>"><?php echo round($result->vMarch);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'March';?>"><?php echo round($result->vMarch);?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$tot= $tot + round($result->vtotal); $tot= $tot + round($result->vtotal);
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_year?ab=<?php echo $ab;?>&mid=<?php echo $result->mid;?>&cat=<?php echo $result->category;?>"><?php echo round($result->vtotal);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_year?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>"><?php echo round($result->vtotal);?> </a>
</td> </td>
</tr> </tr>
@ -523,14 +509,7 @@
<tfoot width="100%"> <tfoot width="100%">
<tr> <tr>
<td style="text-align:center;"><strong>Total</strong></td> <td style="text-align:center;"><strong>Total</strong></td>
<td><strong><?php <td style="text-align:right;"><strong><?php
{
echo '';
}
?>
</strong></td>
<td style="text-align:right;"><strong><?php
{ {
echo number_format($apr,2,'.',''); echo number_format($apr,2,'.','');

View File

@ -76,9 +76,11 @@ if(!empty($mms))
?> ?>
<tr> <tr>
<td style="text-align:left;"> <td style="text-align:left;">
<a href="<?= base_url() ?>report/ilink_purchase?sid=<?php echo $rel->sid;?>&ab=<?php echo $ab;?>&mid=<?php echo $rel->mid;?>&cat=<?php echo $rel->category;?>"><?php echo $rel->category;?> </a> <?php echo $rel->category;?>
</td> </td>
<td><span><?php echo $rel->supplier_name;?> <td><span>
<a href="<?= base_url() ?>report/ilink_purchase?sid=<?php echo $rel->sid;?>&ab=<?php echo $ab;?>&mid=<?php echo $rel->mid;?>&cat=<?php echo $rel->category;?>"><?php echo $rel->supplier_name;?> </a>
</span></td> </span></td>
<td><span><?php echo $rel->material_name;?></span></td> <td><span><?php echo $rel->material_name;?></span></td>
<td style="text-align:right"><span><?php <td style="text-align:right"><span><?php

View File

@ -55,8 +55,7 @@ if(!empty($mms))
$ab=$yearl; $ab=$yearl;
?> ?>
<th style="text-align:center" rowspan="2">Category</th> <th style="text-align:center" rowspan="2">Category</th>
<th style="text-align:center" rowspan="2">Material Name</th> <th style="text-align:center" colspan="2"><?php echo date('d-m-Y'); ?></th>
<th style="text-align:center" colspan="2"><?php echo date('d-m-Y'); ?></th>
<th style="text-align:center" colspan="2"><?php echo date('M-Y'); ?></th> <th style="text-align:center" colspan="2"><?php echo date('M-Y'); ?></th>
<th style="text-align:center" colspan="2"><?php echo $ab; ?></th> <th style="text-align:center" colspan="2"><?php echo $ab; ?></th>
</tr> </tr>
@ -96,39 +95,38 @@ if(!empty($mms))
<a href="<?= base_url() ?>report/link_purchase?sid=<?php //echo $rel->sid;?>&ab=<?php //echo $ab;?>&mid=<?php //echo $rel->mid;?>"><?php //echo $rel->supplier_name;?></a> <a href="<?= base_url() ?>report/link_purchase?sid=<?php //echo $rel->sid;?>&ab=<?php //echo $ab;?>&mid=<?php //echo $rel->mid;?>"><?php //echo $rel->supplier_name;?></a>
</span></td>--> </span></td>-->
<td><span> <td><span>
<a href="<?= base_url() ?>report/ilink_purchase?ab=<?php echo $ab;?>&mid=<?php echo $rel->mid;?>&cat=<?php echo $rel->category;?>"><?php echo $rel->category;?></a> <a href="<?= base_url() ?>report/ilink_purchase?ab=<?php echo $ab;?>&cat=<?php echo $rel->category;?>"><?php echo $rel->category;?></a>
</span></td> </span></td>
<td><span><?php echo $rel->material_name;?></span></td>
<td style="text-align:right"><span> <td style="text-align:right"><span>
<?php <?php
$tqt= $tqt + round($rel->tquantity); $tqt= $tqt + round($rel->tquantity);
?> ?>
<a href="<?= base_url() ?>report/rawi_cum_day?cat=<?php echo $rel->category;?>&ab=<?php echo $ab;?>&mid=<?php echo $rel->mid;?>"><?php echo round($rel->tquantity);?></a> <a href="<?= base_url() ?>report/rawi_cum_day?cat=<?php echo $rel->category;?>&ab=<?php echo $ab;?>"><?php echo round($rel->tquantity);?></a>
</span></td> </span></td>
<td style="text-align:right"><span><?php <td style="text-align:right"><span><?php
$tvt= $tvt + number_format($rel->ttotal,2,'.',''); $tvt= $tvt + number_format($rel->ttotal,2,'.','');
?> ?>
<a href="<?= base_url() ?>report/rawi_cum_day?cat=<?php echo $rel->category;?>&ab=<?php echo $ab;?>&mid=<?php echo $rel->mid;?>"><?php echo number_format($rel->ttotal,2,'.','');?></a> <a href="<?= base_url() ?>report/rawi_cum_day?cat=<?php echo $rel->category;?>&ab=<?php echo $ab;?>"><?php echo number_format($rel->ttotal,2,'.','');?></a>
</span></td> </span></td>
<td style="text-align:right"><span><?php <td style="text-align:right"><span><?php
$mqt= $mqt + round($rel->mquantity); $mqt= $mqt + round($rel->mquantity);
?> ?>
<a href="<?= base_url() ?>report/rawi_cum_month?cat=<?php echo $rel->category;?>&ab=<?php echo $ab;?>&mid=<?php echo $rel->mid;?>"><?php echo round($rel->mquantity);?></a> <a href="<?= base_url() ?>report/rawi_cum_month?cat=<?php echo $rel->category;?>&ab=<?php echo $ab;?>"><?php echo round($rel->mquantity);?></a>
</span></td> </span></td>
<td style="text-align:right"><span><?php <td style="text-align:right"><span><?php
$mvt= $mvt + number_format($rel->mtotal,2,'.',''); $mvt= $mvt + number_format($rel->mtotal,2,'.','');
?> ?>
<a href="<?= base_url() ?>report/rawi_cum_month?cat=<?php echo $rel->category;?>&ab=<?php echo $ab;?>&mid=<?php echo $rel->mid;?>"><?php echo number_format($rel->mtotal,2,'.','');?></a> <a href="<?= base_url() ?>report/rawi_cum_month?cat=<?php echo $rel->category;?>&ab=<?php echo $ab;?>"><?php echo number_format($rel->mtotal,2,'.','');?></a>
</span></td> </span></td>
<td style="text-align:right"><span><?php <td style="text-align:right"><span><?php
$yqt= $yqt + round($rel->quantity); $yqt= $yqt + round($rel->quantity);
?> ?>
<a href="<?= base_url() ?>report/rawi_cum_year?cat=<?php echo $rel->category;?>&ab=<?php echo $ab;?>&mid=<?php echo $rel->mid;?>"><?php echo round($rel->quantity);?></a> <a href="<?= base_url() ?>report/rawi_cum_year?cat=<?php echo $rel->category;?>&ab=<?php echo $ab;?>"><?php echo round($rel->quantity);?></a>
</span></td> </span></td>
<td style="text-align:right"><span><?php <td style="text-align:right"><span><?php
$yvt= $yvt + number_format($rel->total,2,'.',''); $yvt= $yvt + number_format($rel->total,2,'.','');
?> ?>
<a href="<?= base_url() ?>report/rawi_cum_year?cat=<?php echo $rel->category;?>&ab=<?php echo $ab;?>&mid=<?php echo $rel->mid;?>"><?php echo number_format($rel->total,2,'.','');?></a> <a href="<?= base_url() ?>report/rawi_cum_year?cat=<?php echo $rel->category;?>&ab=<?php echo $ab;?>"><?php echo number_format($rel->total,2,'.','');?></a>
</span></td> </span></td>
@ -143,16 +141,7 @@ if(!empty($mms))
<tr> <tr>
<td style="text-align:center;"><strong>Total</strong></td> <td style="text-align:center;"><strong>Total</strong></td>
<td style="text-align:right">
<strong>
<?php
{
echo '';
}
?>
</strong>
</td>
<td style="text-align:right"> <td style="text-align:right">
<strong> <strong>