report changes
This commit is contained in:
parent
5aecbcf63e
commit
be50146e6a
@ -234,6 +234,7 @@ $route['Report_consolidate_inward'] = "report/iconsolidate";
|
||||
$route['Report_cumulative_inward'] = "report/icumulative";
|
||||
$route['Report_cumulative_raw'] = "report/rawi_cumulative";
|
||||
$route['Report_consolidate_category'] = "report/rawi_consolidate";
|
||||
$route['Report_pending_purchase'] = "report/pending_purchase";
|
||||
|
||||
|
||||
// Company Information
|
||||
|
||||
@ -1152,6 +1152,58 @@ class report extends BaseController
|
||||
}
|
||||
|
||||
}
|
||||
public function pending_purchase()
|
||||
{
|
||||
|
||||
$this->global['pageTitle'] = 'Resico : Reports';
|
||||
|
||||
if ($this->input->post('btn_submit')) {
|
||||
|
||||
$cname = $this->input->post('client_name');
|
||||
|
||||
$prod = $this->input->post('item_name');
|
||||
|
||||
$ab=$this->input->post('financialyear');
|
||||
|
||||
$cat = $this->input->get('cat');
|
||||
|
||||
$fa=substr($ab,0,-5);
|
||||
|
||||
$aa=substr($ab,5,5);
|
||||
|
||||
$m=$this->input->post('month');
|
||||
|
||||
$frm = $this->input->post('from_date');
|
||||
|
||||
$t = $this->input->post('to_date');
|
||||
|
||||
$data['material']=$this->dahsboard_Model->material_name();
|
||||
|
||||
$data['cust']=$this->dahsboard_Model->customer_name();
|
||||
|
||||
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
||||
|
||||
$data['ppurchse']=$this->dahsboard_Model->pending_purchase($cname,$prod,$fa,$aa,$m,$frm,$t);
|
||||
|
||||
}
|
||||
|
||||
$data['material']=$this->dahsboard_Model->material_name();
|
||||
|
||||
$data['cust']=$this->dahsboard_Model->customer_name();
|
||||
|
||||
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
||||
|
||||
if($this->DEPCode == MANAGEMENT)
|
||||
{
|
||||
$this->loadviews("Report_pending_purchase",$this->global,$data, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->loadViews("access", $this->global, $data, NULL);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function cashbook()
|
||||
{
|
||||
@ -1201,7 +1253,7 @@ class report extends BaseController
|
||||
|
||||
|
||||
$data['monthlyreport']=$this->dahsboard_Model->monthexpensereport();
|
||||
// $data['monthlyincreport']=$this->dahsboard_Model->monthincomereport();
|
||||
|
||||
$data['Indiancurrency']=$this->dahsboard_Model->INRSymbol();
|
||||
|
||||
if($this->DEPCode == MANAGEMENT)
|
||||
@ -1222,7 +1274,7 @@ class report extends BaseController
|
||||
$this->global['pageTitle'] = 'Cashbook - yearly expenses Reports - ';
|
||||
|
||||
|
||||
//$data['yearlyincreport']=$this->dahsboard_Model->yearincomereport();
|
||||
|
||||
$data['yearlyreport']=$this->dahsboard_Model->yearexpensereport();
|
||||
$data['Indiancurrency']=$this->dahsboard_Model->INRSymbol();
|
||||
|
||||
@ -1244,7 +1296,7 @@ class report extends BaseController
|
||||
$this->global['pageTitle'] = 'Cashbook - department - ';
|
||||
$data['departmentwise']=$this->dahsboard_Model->departmentwise($sid,$d);
|
||||
$data['Indiancurrency']=$this->dahsboard_Model->INRSymbol();
|
||||
//print_r($data['departmentwise']);
|
||||
|
||||
if($this->DEPCode == MANAGEMENT)
|
||||
{
|
||||
$this->loadviews("cashbookmonthlydep",$this->global,$data, NULL);
|
||||
|
||||
@ -76,13 +76,12 @@ class supplier extends BaseController
|
||||
$this->global['pageTitle'] = 'Resico : Add New Supplier';
|
||||
if($this->role == ROLE_ADMIN || $this->DEPCode == SALES || $this->DEPCode == FINANCE ||$this->DEPCode == HR)
|
||||
{
|
||||
|
||||
if($this->DEPCode != FINANCE && $this->DEPCode != HR)
|
||||
{
|
||||
//Load the view addsupplier.php
|
||||
$this->loadViews("addsupplier", $this->global,$data, NULL);
|
||||
|
||||
}
|
||||
{
|
||||
//Load the view addsupplier.php
|
||||
$this->loadViews("addsupplier", $this->global,$data, NULL);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
@ -2,16 +2,7 @@
|
||||
|
||||
class dahsboard_Model extends CI_Model
|
||||
{
|
||||
/*Admin Dashboard - To get User count */
|
||||
function getUserCount()
|
||||
{
|
||||
|
||||
$sql="select count(userId) as users FROM tbl_users where isDeleted ='0'";
|
||||
$query =$this->db->query($sql);
|
||||
return $query->result();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* HR DASHBOART Model START*/
|
||||
function totemp()
|
||||
@ -22,7 +13,8 @@ class dahsboard_Model extends CI_Model
|
||||
return $query->result();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function totloan()
|
||||
{
|
||||
|
||||
@ -250,8 +242,8 @@ $sql= "select * FROM T_Emp_Pay_Data where EmpID = ?;";
|
||||
}
|
||||
function reqdetail(){
|
||||
|
||||
|
||||
$sql="SELECT count(Status) as TODAY_REQUESTS FROM T_Requestion_Master where date(ReqDate) = date(now());";
|
||||
$now= date('Y-m-d');
|
||||
$sql="SELECT count(Status) as TODAY_REQUESTS FROM T_Requestion_Master where date(ReqDate) = '".$now."' ";
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
@ -509,6 +501,15 @@ function revenuebudgt ()
|
||||
}
|
||||
function typebal ()
|
||||
{
|
||||
if (date('m') >= 4)
|
||||
{
|
||||
$yearl = date('Y').'-'.(date('Y')+1);
|
||||
} else {
|
||||
$yearl = (date('Y')-1).'-'.date('Y');
|
||||
}
|
||||
$ab=$yearl;
|
||||
$fa=substr($ab,0,-5);
|
||||
$aa=substr($ab,5,5);
|
||||
$sql="SELECT Cost_Center_Budget.BudgetYear as BudgetYear,
|
||||
sum(if(Cost_Center_Budget.BudgetType='IMPORT',
|
||||
(PO_Line_Item.Quantity * PO_Line_Item.Rate) * po.ExchangeRate,0)) as im,
|
||||
@ -525,7 +526,7 @@ left JOIN T_PurchaseOrder_Master po on po.PONO=PO_Line_Item.PONO and po.Status !
|
||||
left JOIN T_Revenue_Tax T_Rev_Tax on PO_Line_Item.LineItemNo=T_Rev_Tax.LineItemNo
|
||||
JOIN T_CostCenter_Master Cost_Mast on Cost_Center_Budget.CostCenterCode=Cost_Mast.CostCenterCode
|
||||
left JOIN T_Service_Tax st on st.LineItemNo = PO_Line_Item.LineItemNo
|
||||
WHERE Cost_Center_Budget.BudgetType = po.POType and date(po.PODate) >= '2017-04-01' and date(po.PODate) <= '2018-03-31'
|
||||
WHERE Cost_Center_Budget.BudgetType = po.POType and date(po.PODate) >= '".$fa."-04-01' and date(po.PODate) <= '".$aa."-03-31'
|
||||
group by
|
||||
Cost_Center_Budget.BudgetYear
|
||||
";
|
||||
@ -692,24 +693,36 @@ group by Dept_Name";
|
||||
$sql="SELECT Cost_Center_Budget.CostCenterCode as Cost_Center_Code, CostCenterName as Cost_Center_Name,group_concat(distinct Dept_Details.DepartmentName) as Dept_Name,Cost_Center_Budget.BudgetType as BudgetType,Cost_Center_Budget.BudgetYear as BudgetYear,
|
||||
case Cost_Center_Budget.BudgetType
|
||||
when 'IMPORT'
|
||||
then ifnull((sum(distinct(PO_Line_Item.Quantity * PO_Line_Item.Rate) * po.ExchangeRate)),0)
|
||||
then
|
||||
sum(distinct if(Cost_Center_Budget.BudgetType='IMPORT',
|
||||
(PO_Line_Item.Quantity * PO_Line_Item.Rate) * po.ExchangeRate,0))
|
||||
when 'CAPITAL'
|
||||
then ifnull(sum(distinct if(CapitalRange=0,(( PO_Line_Item.Quantity * PO_Line_Item.Rate) * po.ExchangeRate),( PO_Line_Item.Quantity * PO_Line_Item.Rate) - st.Afterdiscountval)),0)
|
||||
when 'SERVICE'
|
||||
then ifnull((sum(distinct PO_Line_Item.Quantity * PO_Line_Item.Rate)),0)
|
||||
when 'REVENUE'
|
||||
then ifnull((sum(distinct PO_Line_Item.Quantity * PO_Line_Item.Rate) - sum(distinct T_Rev_Tax.AfterDiscount)),0)
|
||||
then
|
||||
sum(distinct if(Cost_Center_Budget.BudgetType='CAPITAL',
|
||||
if(CapitalRange=0,(( PO_Line_Item.Quantity * PO_Line_Item.Rate) * po.ExchangeRate),( PO_Line_Item.Quantity * PO_Line_Item.Rate) - st.Afterdiscountval),0))
|
||||
when 'SERVICE'
|
||||
then
|
||||
sum(distinct if(Cost_Center_Budget.BudgetType='SERVICE',
|
||||
PO_Line_Item.Quantity * PO_Line_Item.Rate,0))
|
||||
when 'REVENUE'
|
||||
then
|
||||
sum(distinct if(Cost_Center_Budget.BudgetType='REVENUE',
|
||||
(PO_Line_Item.Quantity * PO_Line_Item.Rate)-T_Rev_Tax.AfterDiscount,0))
|
||||
end
|
||||
as Util_Amount,
|
||||
case Cost_Center_Budget.BudgetType
|
||||
when 'IMPORT'
|
||||
then (Cost_Center_Budget.BudgetAmount - ifnull((sum(distinct(PO_Line_Item.Quantity * PO_Line_Item.Rate) * po.ExchangeRate)),0))
|
||||
then (Cost_Center_Budget.BudgetAmount - ifnull((sum(distinct if(Cost_Center_Budget.BudgetType='IMPORT',
|
||||
(PO_Line_Item.Quantity * PO_Line_Item.Rate) * po.ExchangeRate,0))),0))
|
||||
when 'CAPITAL'
|
||||
then (Cost_Center_Budget.BudgetAmount - ifnull(sum(distinct if(CapitalRange=0,(( PO_Line_Item.Quantity * PO_Line_Item.Rate) * po.ExchangeRate),( PO_Line_Item.Quantity * PO_Line_Item.Rate) - st.Afterdiscountval)),0))
|
||||
then (Cost_Center_Budget.BudgetAmount - ifnull(sum(distinct if(Cost_Center_Budget.BudgetType='CAPITAL',
|
||||
if(CapitalRange=0,(( PO_Line_Item.Quantity * PO_Line_Item.Rate) * po.ExchangeRate),( PO_Line_Item.Quantity * PO_Line_Item.Rate) - st.Afterdiscountval),0)),0))
|
||||
when 'SERVICE'
|
||||
then (Cost_Center_Budget.BudgetAmount - ifnull((sum(distinct PO_Line_Item.Quantity * PO_Line_Item.Rate)),0))
|
||||
then (Cost_Center_Budget.BudgetAmount - ifnull((sum(distinct if(Cost_Center_Budget.BudgetType='SERVICE',
|
||||
PO_Line_Item.Quantity * PO_Line_Item.Rate,0))),0))
|
||||
when 'REVENUE'
|
||||
then (Cost_Center_Budget.BudgetAmount - ifnull((sum(distinct PO_Line_Item.Quantity * PO_Line_Item.Rate) - sum(distinct T_Rev_Tax.AfterDiscount)),0))
|
||||
then (Cost_Center_Budget.BudgetAmount - ifnull((sum(distinct if(Cost_Center_Budget.BudgetType='REVENUE',
|
||||
(PO_Line_Item.Quantity * PO_Line_Item.Rate)-T_Rev_Tax.AfterDiscount,0))),0))
|
||||
end
|
||||
as Avlbl_Amt
|
||||
from T_CostCenter_Budget Cost_Center_Budget
|
||||
@ -1294,8 +1307,8 @@ group by supplier_name,material_name";
|
||||
function ireport_purchase($cname,$prod,$fa,$aa,$m,$frm,$t,$cat){
|
||||
|
||||
|
||||
$sql="SELECT pm.PONO as pono,pm.POType as potype,date_format(pm.PODate,'%d-%m-%Y') as created_date,
|
||||
TIME_FORMAT(pm.PODate,'%l:%i %p') as created_time,
|
||||
$sql="SELECT pm.PONO as pono,pm.POType as potype,date_format(im.CreatedDate,'%d-%m-%Y') as created_date,
|
||||
TIME_FORMAT(im.CreatedDate,'%l:%i %p') as created_time,
|
||||
mm.MaterialName as material_name,mm.Category as category,sd.SupplierName as supplier_name,
|
||||
ifnull(sum(pl.Quantity),0) as quantity,mm.UOM as UOM,ifnull(sum(pl.Rate),0) as rate,
|
||||
round(ifnull(sum(pl.Quantity * pl.Rate),0),2) as value,
|
||||
@ -1317,13 +1330,14 @@ ifnull(sum(pl.Quantity * pl.Rate),0)))
|
||||
+ ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterPackagingValue),0),0)
|
||||
- ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterDiscount),sum(distinct st.Afterdiscountval)),0)),2) as total,pb.FilePath as file
|
||||
FROM T_PurchaseOrder_Master pm
|
||||
join T_IGR_Master im on im.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_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
|
||||
left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo
|
||||
left join T_Revenue_Tax rt on rt.LineItemNo = pl.LineItemNo
|
||||
left join T_PurchaseOrder_BillUpload pb on pb.PONO=pm.PONO
|
||||
where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) ";
|
||||
where pm.Status != 'ST030' ";
|
||||
|
||||
if ($cname!= ''){
|
||||
|
||||
@ -1335,12 +1349,12 @@ if ($cname!= ''){
|
||||
|
||||
if ($fa and $aa != ''){
|
||||
|
||||
$sql.=" and (pm.PODate >= '".$fa."-04-01' and pm.PODate <= '".$aa."-03-31')";
|
||||
$sql.=" and (im.CreatedDate >= '".$fa."-04-01' and im.CreatedDate <= '".$aa."-03-31')";
|
||||
|
||||
}
|
||||
if ($m!= ''){
|
||||
|
||||
$sql.="and monthname(pm.PODate) = '".$m."'";
|
||||
$sql.="and monthname(im.CreatedDate) = '".$m."'";
|
||||
|
||||
}
|
||||
|
||||
@ -1348,8 +1362,8 @@ if ($cname!= ''){
|
||||
$fromd= date("Y-m-d",strtotime($frm));
|
||||
$tod=date("Y-m-d",strtotime($t));
|
||||
|
||||
$sql.="and date(pm.PODate) >= '".$fromd."'
|
||||
and date(pm.PODate) <= '".$tod."'";
|
||||
$sql.="and date(im.CreatedDate) >= '".$fromd."'
|
||||
and date(im.CreatedDate) <= '".$tod."'";
|
||||
|
||||
}
|
||||
if ($prod!= ''){
|
||||
@ -1373,8 +1387,8 @@ $sql.="group by pono,material_name,category,supplier_name";
|
||||
function ireport_purchase_link($cname,$prod,$fa,$aa,$m,$frm,$t,$sid,$mid,$d,$cat){
|
||||
|
||||
|
||||
$sql="SELECT pm.PONO as pono,pm.POType as potype,date_format(pm.PODate,'%d-%m-%Y') as created_date,
|
||||
TIME_FORMAT(pm.PODate,'%l:%i %p') as created_time,
|
||||
$sql="SELECT pm.PONO as pono,pm.POType as potype,date_format(im.CreatedDate,'%d-%m-%Y') as created_date,
|
||||
TIME_FORMAT(im.CreatedDate,'%l:%i %p') as created_time,
|
||||
mm.MaterialName as material_name,mm.Category as category,sd.SupplierName as supplier_name,
|
||||
ifnull(sum(pl.Quantity),0) as quantity,mm.UOM as UOM,ifnull(sum(pl.Rate),0) as rate,
|
||||
round(ifnull(sum(pl.Quantity * pl.Rate),0),2) as value,
|
||||
@ -1396,14 +1410,14 @@ ifnull(sum(pl.Quantity * pl.Rate),0)))
|
||||
+ ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterPackagingValue),0),0)
|
||||
- ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterDiscount),sum(distinct st.Afterdiscountval)),0)),2) as total,pb.FilePath as file
|
||||
FROM T_PurchaseOrder_Master pm
|
||||
join T_IGR_Master im on im.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_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
|
||||
left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo
|
||||
left join T_Revenue_Tax rt on rt.LineItemNo = pl.LineItemNo
|
||||
left join T_PurchaseOrder_BillUpload pb on pb.PONO=pm.PONO
|
||||
where
|
||||
pm.Status != 'ST030' ";
|
||||
where pm.Status != 'ST030' ";
|
||||
|
||||
if ($cname!= ''){
|
||||
|
||||
@ -1415,12 +1429,12 @@ if ($cname!= ''){
|
||||
|
||||
if ($fa and $aa != ''){
|
||||
|
||||
$sql.=" and (pm.PODate >= '".$fa."-04-01' and pm.PODate <= '".$aa."-03-31')";
|
||||
$sql.=" and (im.CreatedDate >= '".$fa."-04-01' and im.CreatedDate <= '".$aa."-03-31')";
|
||||
|
||||
}
|
||||
if ($m!= ''){
|
||||
|
||||
$sql.="and monthname(pm.PODate) = '".$m."'";
|
||||
$sql.="and monthname(im.CreatedDate) = '".$m."'";
|
||||
|
||||
}
|
||||
|
||||
@ -1428,8 +1442,8 @@ if ($cname!= ''){
|
||||
$fromd= date("Y-m-d",strtotime($frm));
|
||||
$tod=date("Y-m-d",strtotime($t));
|
||||
|
||||
$sql.="and date(pm.PODate) >= '".$fromd."'
|
||||
and date(pm.PODate) <= '".$tod."'";
|
||||
$sql.="and date(im.CreatedDate) >= '".$fromd."'
|
||||
and date(im.CreatedDate) <= '".$tod."'";
|
||||
|
||||
}
|
||||
if ($prod!= ''){
|
||||
@ -1449,7 +1463,7 @@ if ($cname!= ''){
|
||||
}
|
||||
if ($d!= ''){
|
||||
|
||||
$sql.=" and date(pm.PODate) = '".$d."' ";
|
||||
$sql.=" and date(im.CreatedDate) = '".$d."' ";
|
||||
|
||||
}
|
||||
if ($cat!= ''){
|
||||
@ -1459,7 +1473,7 @@ if ($cname!= ''){
|
||||
}
|
||||
|
||||
|
||||
$sql.="and pm.PONO in (select PONO from T_IGR_Master) ";
|
||||
|
||||
$sql.="group by pono,material_name,category,supplier_name";
|
||||
// echo $m;
|
||||
// echo $sid;
|
||||
@ -1471,13 +1485,14 @@ $sql.="group by pono,material_name,category,supplier_name";
|
||||
function ireport_year_wise(){
|
||||
|
||||
|
||||
$sql="SELECT sd.SupplierID as sid,mm.MaterialCode as mid,pm.PODate as created_date,ifnull(sum(pl.Quantity),0) as quantity,round(ifnull(sum(pl.Quantity * pl.Rate),0),2) as total
|
||||
$sql="SELECT sd.SupplierID as sid,mm.MaterialCode as mid,im.CreatedDate as created_date,ifnull(sum(pl.Quantity),0) as quantity,round(ifnull(sum(pl.Quantity * pl.Rate),0),2) as total
|
||||
FROM T_PurchaseOrder_Master pm
|
||||
join T_IGR_Master im on im.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_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
|
||||
left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo
|
||||
where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master)
|
||||
where pm.Status != 'ST030'
|
||||
group by month(created_date)";
|
||||
$query = $this->db->query($sql);
|
||||
return $query->result();
|
||||
@ -1492,11 +1507,12 @@ group by month(created_date)";
|
||||
|
||||
$sql="SELECT sd.SupplierID as sid,mm.MaterialCode as mid,sd.SupplierName as supplier_name,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 T_PurchaseOrder_Master pm
|
||||
join T_IGR_Master im on im.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_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
|
||||
left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo
|
||||
where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and sd.SupplierName is not null and pm.PONO in (select PONO from T_IGR_Master) and month(pm.PODate)= ? and year(pm.PODate) = ?
|
||||
where pm.Status != 'ST030' and sd.SupplierName is not null and month(im.CreatedDate)= ? and year(im.CreatedDate) = ?
|
||||
group by supplier_name,material_name";
|
||||
$query = $this->db->query($sql,array($month,$year));
|
||||
return $query->result();
|
||||
@ -1505,11 +1521,12 @@ group by supplier_name,material_name";
|
||||
|
||||
$sql="SELECT sd.SupplierID as sid,mm.MaterialCode as mid,sd.SupplierName as supplier_name,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 T_PurchaseOrder_Master pm
|
||||
join T_IGR_Master im on im.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_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
|
||||
left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo
|
||||
where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and sd.SupplierName is not null and date(pm.PODate) >= '$a-04-01' and date(pm.PODate) <= '$b-03-31'
|
||||
where pm.Status != 'ST030' and sd.SupplierName is not null and date(im.CreatedDate) >= '$a-04-01' and date(im.CreatedDate) <= '$b-03-31'
|
||||
group by supplier_name,material_name";
|
||||
$query = $this->db->query($sql,array());
|
||||
return $query->result();
|
||||
@ -1554,12 +1571,13 @@ then ifnull(sum(distinct pl.Quantity * pl.Rate),0)
|
||||
end
|
||||
as total
|
||||
FROM T_PurchaseOrder_Master pm
|
||||
join T_IGR_Master im on im.PONO = pm.PONO
|
||||
left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
|
||||
left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
|
||||
left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo
|
||||
left join T_Revenue_Tax rt on rt.LineItemNo = pl.LineItemNo
|
||||
where
|
||||
pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) ";
|
||||
pm.Status != 'ST030' ";
|
||||
|
||||
if ($cname!= ''){
|
||||
|
||||
@ -1571,12 +1589,12 @@ if ($cname!= ''){
|
||||
|
||||
if ($fa and $aa != ''){
|
||||
|
||||
$sql.=" and (pm.PODate >= '".$fa."-04-01' and pm.PODate <= '".$aa."-03-31')";
|
||||
$sql.=" and (im.CreatedDate >= '".$fa."-04-01' and im.CreatedDate <= '".$aa."-03-31')";
|
||||
|
||||
}
|
||||
if ($m!= ''){
|
||||
|
||||
$sql.="and monthname(pm.PODate) = '".$m."'";
|
||||
$sql.="and monthname(im.CreatedDate) = '".$m."'";
|
||||
|
||||
}
|
||||
|
||||
@ -1584,8 +1602,8 @@ if ($cname!= ''){
|
||||
$fromd= date("Y-m-d",strtotime($frm));
|
||||
$tod=date("Y-m-d",strtotime($t));
|
||||
|
||||
$sql.="and date(pm.PODate) >= '".$fromd."'
|
||||
and date(pm.PODate) <= '".$tod."'";
|
||||
$sql.="and date(im.CreatedDate) >= '".$fromd."'
|
||||
and date(im.CreatedDate) <= '".$tod."'";
|
||||
|
||||
}
|
||||
$sql.= "group by supplier_name";
|
||||
@ -1598,39 +1616,40 @@ if ($cname!= ''){
|
||||
|
||||
|
||||
$sql="select sd.SupplierID as sid,mm.MaterialCode as mid,sd.SupplierName as supplier_name,mm.MaterialName as material_name,
|
||||
SUM(IF(month(pm.PODate) = 4, pl.Quantity, 0)) AS April,
|
||||
SUM(IF(month(pm.PODate) = 5, pl.Quantity, 0)) AS May,
|
||||
SUM(IF(month(pm.PODate) = 6, pl.Quantity, 0)) AS June,
|
||||
SUM(IF(month(pm.PODate) = 7, pl.Quantity, 0)) AS July,
|
||||
SUM(IF(month(pm.PODate) = 8, pl.Quantity, 0)) AS August,
|
||||
SUM(IF(month(pm.PODate) = 9, pl.Quantity, 0)) AS September,
|
||||
SUM(IF(month(pm.PODate) = 10, pl.Quantity, 0)) AS October,
|
||||
SUM(IF(month(pm.PODate) = 11, pl.Quantity, 0)) AS November,
|
||||
SUM(IF(month(pm.PODate) = 12, pl.Quantity, 0)) AS December,
|
||||
SUM(IF(month(pm.PODate) = 1, pl.Quantity, 0)) AS January,
|
||||
SUM(IF(month(pm.PODate) = 2, pl.Quantity, 0)) AS February,
|
||||
SUM(IF(month(pm.PODate) = 3, pl.Quantity, 0)) AS March,
|
||||
SUM(IF(month(im.CreatedDate) = 4, pl.Quantity, 0)) AS April,
|
||||
SUM(IF(month(im.CreatedDate) = 5, pl.Quantity, 0)) AS May,
|
||||
SUM(IF(month(im.CreatedDate) = 6, pl.Quantity, 0)) AS June,
|
||||
SUM(IF(month(im.CreatedDate) = 7, pl.Quantity, 0)) AS July,
|
||||
SUM(IF(month(im.CreatedDate) = 8, pl.Quantity, 0)) AS August,
|
||||
SUM(IF(month(im.CreatedDate) = 9, pl.Quantity, 0)) AS September,
|
||||
SUM(IF(month(im.CreatedDate) = 10, pl.Quantity, 0)) AS October,
|
||||
SUM(IF(month(im.CreatedDate) = 11, pl.Quantity, 0)) AS November,
|
||||
SUM(IF(month(im.CreatedDate) = 12, pl.Quantity, 0)) AS December,
|
||||
SUM(IF(month(im.CreatedDate) = 1, pl.Quantity, 0)) AS January,
|
||||
SUM(IF(month(im.CreatedDate) = 2, pl.Quantity, 0)) AS February,
|
||||
SUM(IF(month(im.CreatedDate) = 3, pl.Quantity, 0)) AS March,
|
||||
sum(pl.Quantity) as qtotal,
|
||||
SUM(IF(month(pm.PODate) = 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.PODate) = 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.PODate) = 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.PODate) = 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.PODate) = 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.PODate) = 2, pl.Quantity * pl.Rate, 0)) AS vFebruary,
|
||||
SUM(IF(month(pm.PODate) = 3, pl.Quantity * pl.Rate, 0)) AS vMarch,
|
||||
SUM(IF(month(im.CreatedDate) = 4, pl.Quantity * pl.Rate, 0)) AS vApril,
|
||||
SUM(IF(month(im.CreatedDate) = 5, pl.Quantity * pl.Rate, 0)) AS vMay,
|
||||
SUM(IF(month(im.CreatedDate) = 6, pl.Quantity * pl.Rate, 0)) AS vJune,
|
||||
SUM(IF(month(im.CreatedDate) = 7, pl.Quantity * pl.Rate, 0)) AS vJuly,
|
||||
SUM(IF(month(im.CreatedDate) = 8, pl.Quantity * pl.Rate, 0)) AS vAugust,
|
||||
SUM(IF(month(im.CreatedDate) = 9, pl.Quantity * pl.Rate, 0)) AS vSeptember,
|
||||
SUM(IF(month(im.CreatedDate) = 10, pl.Quantity * pl.Rate, 0)) AS vOctober,
|
||||
SUM(IF(month(im.CreatedDate) = 11, pl.Quantity * pl.Rate, 0)) AS vNovember,
|
||||
SUM(IF(month(im.CreatedDate) = 12, pl.Quantity * pl.Rate, 0)) AS vDecember,
|
||||
SUM(IF(month(im.CreatedDate) = 1, pl.Quantity * pl.Rate, 0)) AS vJanuary,
|
||||
SUM(IF(month(im.CreatedDate) = 2, pl.Quantity * pl.Rate, 0)) AS vFebruary,
|
||||
SUM(IF(month(im.CreatedDate) = 3, pl.Quantity * pl.Rate, 0)) AS vMarch,
|
||||
sum(pl.Quantity * pl.Rate) as vtotal
|
||||
FROM T_PurchaseOrder_Master pm
|
||||
join T_IGR_Master im on im.PONO = pm.PONO
|
||||
join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
|
||||
join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
|
||||
join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
|
||||
left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo
|
||||
left join T_Revenue_Tax rt on rt.LineItemNo = pl.LineItemNo
|
||||
where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) ";
|
||||
where pm.Status != 'ST030' ";
|
||||
|
||||
if ($cname!= ''){
|
||||
|
||||
@ -1642,7 +1661,7 @@ if ($cname!= ''){
|
||||
|
||||
if ($fa and $aa != ''){
|
||||
|
||||
$sql.=" and (pm.PODate >= '".$fa."-04-01' and pm.PODate <= '".$aa."-03-31')";
|
||||
$sql.=" and (im.CreatedDate >= '".$fa."-04-01' and im.CreatedDate <= '".$aa."-03-31')";
|
||||
|
||||
}
|
||||
|
||||
@ -1658,16 +1677,17 @@ if ($cname!= ''){
|
||||
sum(pl.Quantity) as quantity,
|
||||
sum(pl.Quantity * pl.Rate) as total
|
||||
FROM T_PurchaseOrder_Master pm
|
||||
join T_IGR_Master im on im.PONO = pm.PONO
|
||||
join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
|
||||
join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
|
||||
join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
|
||||
left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo
|
||||
left join T_Revenue_Tax rt on rt.LineItemNo = pl.LineItemNo
|
||||
where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and
|
||||
monthname(pm.PODate) = '".$m."' and sd.SupplierName = '".$cname."' and mm.MaterialName = '".$prod."' ";
|
||||
where pm.Status != 'ST030' and
|
||||
monthname(im.CreatedDate) = '".$m."' and sd.SupplierName = '".$cname."' and mm.MaterialName = '".$prod."' ";
|
||||
if ($fa and $aa != ''){
|
||||
|
||||
$sql.=" and (pm.PODate >= '".$fa."-04-01' and pm.PODate <= '".$aa."-03-31')";
|
||||
$sql.=" and (im.CreatedDate >= '".$fa."-04-01' and im.CreatedDate <= '".$aa."-03-31')";
|
||||
|
||||
}
|
||||
$sql.= "group by supplier_name,material_name";
|
||||
@ -1681,15 +1701,16 @@ if ($fa and $aa != ''){
|
||||
sum(pl.Quantity) as quantity,
|
||||
sum(pl.Quantity * pl.Rate) as total
|
||||
FROM T_PurchaseOrder_Master pm
|
||||
join T_IGR_Master im on im.PONO = pm.PONO
|
||||
join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
|
||||
join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
|
||||
join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
|
||||
left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo
|
||||
left join T_Revenue_Tax rt on rt.LineItemNo = pl.LineItemNo
|
||||
where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and sd.SupplierName = '".$cname."' and mm.MaterialName = '".$prod."' ";
|
||||
where pm.Status != 'ST030' and sd.SupplierName = '".$cname."' and mm.MaterialName = '".$prod."' ";
|
||||
if ($fa and $aa != ''){
|
||||
|
||||
$sql.=" and (pm.PODate >= '".$fa."-04-01' and pm.PODate <= '".$aa."-03-31')";
|
||||
$sql.=" and (im.CreatedDate >= '".$fa."-04-01' and im.CreatedDate <= '".$aa."-03-31')";
|
||||
|
||||
}
|
||||
$sql.= "group by supplier_name,material_name";
|
||||
@ -1702,35 +1723,38 @@ if ($fa and $aa != ''){
|
||||
$sql="SELECT year.sid as sid,year.mid as mid,year.supplier_name as supplier_name,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
|
||||
FROM (SELECT sd.SupplierID as sid,mm.MaterialCode as mid,sd.SupplierName as supplier_name,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 T_PurchaseOrder_Master pm
|
||||
join T_IGR_Master im on im.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_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
|
||||
where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and
|
||||
where pm.Status != 'ST030' and
|
||||
case
|
||||
when (month(pm.PODate) >=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 )
|
||||
when (month(im.CreatedDate) >=4) then
|
||||
(YEAR(im.CreatedDate) = YEAR(CURRENT_DATE) and MONTH(im.CreatedDate) >= 4 ) or ( YEAR(im.CreatedDate) = YEAR(CURRENT_DATE)+1 and MONTH(im.CreatedDate) <= 3 )
|
||||
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(im.CreatedDate) = YEAR(CURRENT_DATE)-1 and MONTH(im.CreatedDate) >= 4 ) or ( YEAR(im.CreatedDate) = YEAR(CURRENT_DATE) and MONTH(im.CreatedDate) <= 3 )
|
||||
end
|
||||
group by supplier_name,material_name
|
||||
) as year left join
|
||||
(SELECT sd.SupplierID as sid,mm.MaterialCode as mid,sd.SupplierName as supplier_name,ifnull(mm.MaterialName,'-') as material_name,ifnull(sum(pl.Quantity),0) as mquantity,round(ifnull(sum(pl.Quantity * pl.Rate),0),2) as mtotal
|
||||
FROM T_PurchaseOrder_Master pm
|
||||
join T_IGR_Master im on im.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_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
|
||||
where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and
|
||||
month(pm.PODate) = month(current_date())
|
||||
where pm.Status != 'ST030' and
|
||||
month(im.CreatedDate) = month(current_date())
|
||||
group by supplier_name,material_name
|
||||
) as month on month.supplier_name=year.supplier_name and month.material_name=year.material_name
|
||||
left join
|
||||
(SELECT 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
|
||||
join T_IGR_Master im on im.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_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
|
||||
where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and
|
||||
date(pm.PODate) = current_date()
|
||||
where pm.Status != 'ST030' and
|
||||
date(im.CreatedDate) = current_date()
|
||||
group by supplier_name,material_name
|
||||
) as today on today.supplier_name=month.supplier_name and today.material_name=month.material_name
|
||||
group by supplier_name,material_name
|
||||
@ -1742,10 +1766,11 @@ group by supplier_name,material_name
|
||||
|
||||
$sql="SELECT 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
|
||||
join T_IGR_Master im on im.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_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
|
||||
where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and month(pm.PODate) = month(current_date()) and sd.SupplierID = '".$sup."' and mm.MaterialCode = '".$mat."'
|
||||
where pm.Status != 'ST030' and month(im.CreatedDate) = month(current_date()) and sd.SupplierID = '".$sup."' and mm.MaterialCode = '".$mat."'
|
||||
group by supplier_name,material_name";
|
||||
$query = $this->db->query($sql);
|
||||
return $query->result();
|
||||
@ -1754,15 +1779,16 @@ group by supplier_name,material_name";
|
||||
|
||||
$sql="SELECT 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
|
||||
join T_IGR_Master im on im.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_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
|
||||
where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and
|
||||
where pm.Status != 'ST030' and
|
||||
case
|
||||
when (month(pm.PODate) >=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 )
|
||||
when (month(im.CreatedDate) >=4) then
|
||||
(YEAR(im.CreatedDate) = YEAR(CURRENT_DATE) and MONTH(im.CreatedDate) >= 4 ) or ( YEAR(im.CreatedDate) = YEAR(CURRENT_DATE)+1 and MONTH(im.CreatedDate) <= 3 )
|
||||
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(im.CreatedDate) = YEAR(CURRENT_DATE)-1 and MONTH(im.CreatedDate) >= 4 ) or ( YEAR(im.CreatedDate) = YEAR(CURRENT_DATE) and MONTH(im.CreatedDate) <= 3 )
|
||||
end
|
||||
and sd.SupplierID = '".$sup."' and mm.MaterialCode = '".$mat."'
|
||||
group by supplier_name,material_name";
|
||||
@ -1773,11 +1799,12 @@ group by supplier_name,material_name";
|
||||
|
||||
$sql="SELECT 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
|
||||
join T_IGR_Master im on im.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_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
|
||||
where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and
|
||||
date(pm.PODate) = current_date() and sd.SupplierID = '".$sup."' and mm.MaterialCode = '".$mat."'
|
||||
where pm.Status != 'ST030' and
|
||||
date(im.CreatedDate) = current_date() and sd.SupplierID = '".$sup."' and mm.MaterialCode = '".$mat."'
|
||||
group by supplier_name,material_name";
|
||||
$query = $this->db->query($sql);
|
||||
return $query->result();
|
||||
@ -1787,35 +1814,38 @@ group by supplier_name,material_name";
|
||||
$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,ifnull(sum(pl.Quantity),0) as quantity,round(ifnull(sum(pl.Quantity * pl.Rate),0),2) as total
|
||||
FROM T_PurchaseOrder_Master pm
|
||||
join T_IGR_Master im on im.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_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
|
||||
where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and
|
||||
where pm.Status != 'ST030' and
|
||||
case
|
||||
when (month(pm.PODate) >=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 )
|
||||
when (month(im.CreatedDate) >=4) then
|
||||
(YEAR(im.CreatedDate) = YEAR(CURRENT_DATE) and MONTH(im.CreatedDate) >= 4 ) or ( YEAR(im.CreatedDate) = YEAR(CURRENT_DATE)+1 and MONTH(im.CreatedDate) <= 3 )
|
||||
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(im.CreatedDate) = YEAR(CURRENT_DATE)-1 and MONTH(im.CreatedDate) >= 4 ) or ( YEAR(im.CreatedDate) = YEAR(CURRENT_DATE) and MONTH(im.CreatedDate) <= 3 )
|
||||
end
|
||||
group by category
|
||||
) as year left join
|
||||
(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
|
||||
join T_IGR_Master im on im.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_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
|
||||
where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and
|
||||
month(pm.PODate) = month(current_date())
|
||||
where pm.Status != 'ST030' and
|
||||
month(im.CreatedDate) = month(current_date())
|
||||
group by category
|
||||
) as month on month.category=year.category
|
||||
left join
|
||||
(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
|
||||
join T_IGR_Master im on im.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_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
|
||||
where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and
|
||||
date(pm.PODate) = current_date()
|
||||
where pm.Status != 'ST030' and
|
||||
date(im.CreatedDate) = current_date()
|
||||
group by category
|
||||
) as today on today.category=month.category
|
||||
group by category ";
|
||||
@ -1826,15 +1856,16 @@ group by category ";
|
||||
|
||||
$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
|
||||
join T_IGR_Master im on im.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_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
|
||||
where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and
|
||||
where pm.Status != 'ST030' and
|
||||
case
|
||||
when (month(pm.PODate) >=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 )
|
||||
when (month(im.CreatedDate) >=4) then
|
||||
(YEARim.CreatedDate) = YEAR(CURRENT_DATE) and MONTH(im.CreatedDate) >= 4 ) or ( YEAR(im.CreatedDate) = YEAR(CURRENT_DATE)+1 and MONTH(im.CreatedDate) <= 3 )
|
||||
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(im.CreatedDate) = YEAR(CURRENT_DATE)-1 and MONTH(im.CreatedDate) >= 4 ) or ( YEAR(im.CreatedDate) = YEAR(CURRENT_DATE) and MONTH(im.CreatedDate) <= 3 )
|
||||
end
|
||||
and mm.Category = '".$cat."'
|
||||
group by supplier_name,material_name";
|
||||
@ -1846,11 +1877,12 @@ group by supplier_name,material_name";
|
||||
|
||||
$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
|
||||
join T_IGR_Master im on im.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_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
|
||||
where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and
|
||||
month(pm.PODate) = month(current_date()) and mm.Category = '".$cat."'
|
||||
where pm.Status != 'ST030' and
|
||||
month(im.CreatedDate) = month(current_date()) and mm.Category = '".$cat."'
|
||||
group by supplier_name,material_name";
|
||||
$query = $this->db->query($sql);
|
||||
return $query->result();
|
||||
@ -1859,11 +1891,12 @@ group by supplier_name,material_name";
|
||||
|
||||
$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
|
||||
join T_IGR_Master im on im.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_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
|
||||
where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and
|
||||
date(pm.PODate) = current_date() and mm.Category = '".$cat."'
|
||||
where pm.Status != 'ST030' and
|
||||
date(im.CreatedDate) = current_date() and mm.Category = '".$cat."'
|
||||
group by supplier_name,material_name";
|
||||
$query = $this->db->query($sql);
|
||||
echo $sql;
|
||||
@ -1873,37 +1906,38 @@ group by supplier_name,material_name";
|
||||
|
||||
|
||||
$sql="select sd.SupplierID as sid,mm.MaterialCode as mid,mm.Category as category,sd.SupplierName as supplier_name,mm.MaterialName as material_name,
|
||||
SUM(IF(month(pm.PODate) = 4, pl.Quantity, 0)) AS April,
|
||||
SUM(IF(month(pm.PODate) = 5, pl.Quantity, 0)) AS May,
|
||||
SUM(IF(month(pm.PODate) = 6, pl.Quantity, 0)) AS June,
|
||||
SUM(IF(month(pm.PODate) = 7, pl.Quantity, 0)) AS July,
|
||||
SUM(IF(month(pm.PODate) = 8, pl.Quantity, 0)) AS August,
|
||||
SUM(IF(month(pm.PODate) = 9, pl.Quantity, 0)) AS September,
|
||||
SUM(IF(month(pm.PODate) = 10, pl.Quantity, 0)) AS October,
|
||||
SUM(IF(month(pm.PODate) = 11, pl.Quantity, 0)) AS November,
|
||||
SUM(IF(month(pm.PODate) = 12, pl.Quantity, 0)) AS December,
|
||||
SUM(IF(month(pm.PODate) = 1, pl.Quantity, 0)) AS January,
|
||||
SUM(IF(month(pm.PODate) = 2, pl.Quantity, 0)) AS February,
|
||||
SUM(IF(month(pm.PODate) = 3, pl.Quantity, 0)) AS March,
|
||||
SUM(IF(month(im.CreatedDate) = 4, pl.Quantity, 0)) AS April,
|
||||
SUM(IF(month(im.CreatedDate) = 5, pl.Quantity, 0)) AS May,
|
||||
SUM(IF(month(im.CreatedDate) = 6, pl.Quantity, 0)) AS June,
|
||||
SUM(IF(month(im.CreatedDate) = 7, pl.Quantity, 0)) AS July,
|
||||
SUM(IF(month(im.CreatedDate) = 8, pl.Quantity, 0)) AS August,
|
||||
SUM(IF(month(im.CreatedDate) = 9, pl.Quantity, 0)) AS September,
|
||||
SUM(IF(month(im.CreatedDate) = 10, pl.Quantity, 0)) AS October,
|
||||
SUM(IF(month(im.CreatedDate) = 11, pl.Quantity, 0)) AS November,
|
||||
SUM(IF(month(im.CreatedDate) = 12, pl.Quantity, 0)) AS December,
|
||||
SUM(IF(month(im.CreatedDate) = 1, pl.Quantity, 0)) AS January,
|
||||
SUM(IF(month(im.CreatedDate) = 2, pl.Quantity, 0)) AS February,
|
||||
SUM(IF(month(im.CreatedDate) = 3, pl.Quantity, 0)) AS March,
|
||||
sum(pl.Quantity) as qtotal,
|
||||
SUM(IF(month(pm.PODate) = 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.PODate) = 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.PODate) = 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.PODate) = 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.PODate) = 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.PODate) = 2, pl.Quantity * pl.Rate, 0)) AS vFebruary,
|
||||
SUM(IF(month(pm.PODate) = 3, pl.Quantity * pl.Rate, 0)) AS vMarch,
|
||||
SUM(IF(month(im.CreatedDate) = 4, pl.Quantity * pl.Rate, 0)) AS vApril,
|
||||
SUM(IF(month(im.CreatedDate) = 5, pl.Quantity * pl.Rate, 0)) AS vMay,
|
||||
SUM(IF(month(im.CreatedDate) = 6, pl.Quantity * pl.Rate, 0)) AS vJune,
|
||||
SUM(IF(month(im.CreatedDate) = 7, pl.Quantity * pl.Rate, 0)) AS vJuly,
|
||||
SUM(IF(month(im.CreatedDate) = 8, pl.Quantity * pl.Rate, 0)) AS vAugust,
|
||||
SUM(IF(month(im.CreatedDate) = 9, pl.Quantity * pl.Rate, 0)) AS vSeptember,
|
||||
SUM(IF(month(im.CreatedDate) = 10, pl.Quantity * pl.Rate, 0)) AS vOctober,
|
||||
SUM(IF(month(im.CreatedDate) = 11, pl.Quantity * pl.Rate, 0)) AS vNovember,
|
||||
SUM(IF(month(im.CreatedDate) = 12, pl.Quantity * pl.Rate, 0)) AS vDecember,
|
||||
SUM(IF(month(im.CreatedDate) = 1, pl.Quantity * pl.Rate, 0)) AS vJanuary,
|
||||
SUM(IF(month(im.CreatedDate) = 2, pl.Quantity * pl.Rate, 0)) AS vFebruary,
|
||||
SUM(IF(month(im.CreatedDate) = 3, pl.Quantity * pl.Rate, 0)) AS vMarch,
|
||||
sum(pl.Quantity * pl.Rate) as vtotal
|
||||
FROM T_PurchaseOrder_Master pm
|
||||
join T_IGR_Master im on im.PONO = pm.PONO
|
||||
join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
|
||||
join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
|
||||
join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
|
||||
where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) ";
|
||||
where pm.Status != 'ST030' ";
|
||||
|
||||
if ($cname!= ''){
|
||||
|
||||
@ -1915,7 +1949,7 @@ if ($cname!= ''){
|
||||
|
||||
if ($fa and $aa != ''){
|
||||
|
||||
$sql.=" and (pm.PODate >= '".$fa."-04-01' and pm.PODate <= '".$aa."-03-31')";
|
||||
$sql.=" and (im.CreatedDate >= '".$fa."-04-01' and im.CreatedDate <= '".$aa."-03-31')";
|
||||
|
||||
}
|
||||
|
||||
@ -1931,14 +1965,15 @@ if ($cname!= ''){
|
||||
sum(pl.Quantity) as quantity,
|
||||
sum(pl.Quantity * pl.Rate) as total
|
||||
FROM T_PurchaseOrder_Master pm
|
||||
join T_IGR_Master im on im.PONO = pm.PONO
|
||||
join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
|
||||
join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
|
||||
join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
|
||||
where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and
|
||||
monthname(pm.PODate) = '".$m."' and mm.Category = '".$cat."' ";
|
||||
where pm.Status != 'ST030' and
|
||||
monthname(im.CreatedDate) = '".$m."' and mm.Category = '".$cat."' ";
|
||||
if ($fa and $aa != ''){
|
||||
|
||||
$sql.=" and (pm.PODate >= '".$fa."-04-01' and pm.PODate <= '".$aa."-03-31')";
|
||||
$sql.=" and (im.CreatedDate >= '".$fa."-04-01' and im.CreatedDate <= '".$aa."-03-31')";
|
||||
|
||||
}
|
||||
$sql.= "group by category,supplier_name,material_name";
|
||||
@ -1952,20 +1987,72 @@ if ($fa and $aa != ''){
|
||||
sum(pl.Quantity) as quantity,
|
||||
sum(pl.Quantity * pl.Rate) as total
|
||||
FROM T_PurchaseOrder_Master pm
|
||||
join T_IGR_Master im on im.PONO = pm.PONO
|
||||
join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
|
||||
join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
|
||||
join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
|
||||
where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and
|
||||
where pm.Status != 'ST030' and
|
||||
mm.Category = '".$cat."' ";
|
||||
if ($fa and $aa != ''){
|
||||
|
||||
$sql.=" and (pm.PODate >= '".$fa."-04-01' and pm.PODate <= '".$aa."-03-31')";
|
||||
$sql.=" and (im.CreatedDate >= '".$fa."-04-01' and im.CreatedDate <= '".$aa."-03-31')";
|
||||
|
||||
}
|
||||
$sql.= "group by category,supplier_name,material_name";
|
||||
$query = $this->db->query($sql);
|
||||
//echo $sql;
|
||||
return $query->result();
|
||||
}
|
||||
function pending_purchase($cname,$prod,$fa,$aa,$m,$frm,$t){
|
||||
|
||||
$sql="select po.PONO as po,date_format(po.PODate,'%d-%m-%Y') as pdate,sup.SupplierName as supplier,mm.MaterialName as material,mm.Category as category,pl.Quantity as quantity,pl.ReceivedQuantity as received, (pl.Quantity - pl.ReceivedQuantity) as pending
|
||||
from T_PurchaseOrder_LineItem pl
|
||||
join T_PurchaseOrder_Master po on po.PONO = pl.PONO
|
||||
join T_SupplierDetailsN sup on sup.SupplierID=po.SupplierID
|
||||
join T_MaterialMaster mm on mm.MaterialCode=pl.MaterialCode
|
||||
where po.Status != 'ST030' and po.Status = 'ST026'
|
||||
";
|
||||
if ($cname!= ''){
|
||||
|
||||
$sql.="and sup.SupplierName = '".$cname."'";
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($fa and $aa != ''){
|
||||
|
||||
$sql.=" and (po.PODate >= '".$fa."-04-01' and po.PODate <= '".$aa."-03-31')";
|
||||
|
||||
}
|
||||
if ($m!= ''){
|
||||
|
||||
$sql.="and monthname(po.PODate) = '".$m."'";
|
||||
|
||||
}
|
||||
|
||||
if ($frm and $t != ''){
|
||||
$fromd= date("Y-m-d",strtotime($frm));
|
||||
$tod=date("Y-m-d",strtotime($t));
|
||||
|
||||
$sql.="and date(po.PODate) >= '".$fromd."'
|
||||
and date(po.PODate) <= '".$tod."'";
|
||||
|
||||
}
|
||||
if ($prod!= ''){
|
||||
|
||||
$sql.=" and mm.MaterialName = '".$prod."' ";
|
||||
|
||||
}
|
||||
// if ($cat!= ''){
|
||||
|
||||
// $sql.=" and mm.Category = '".$cat."' ";
|
||||
|
||||
// }
|
||||
$sql.="order by po.PONO";
|
||||
$query = $this->db->query($sql);
|
||||
//echo $sql;
|
||||
return $query->result();
|
||||
}
|
||||
function cashbook()
|
||||
{
|
||||
@ -2075,7 +2162,7 @@ if ($fa and $aa != ''){
|
||||
when tinc.type = 'RECEIPT'
|
||||
then tinc.towhom
|
||||
end, '-') as receiptname,
|
||||
date_format(tinc.date,'%d-%m-%Y')as date,tinc.type,tinc.total,tinc.towhom,.tinc.description, ac.name FROM
|
||||
date_format(tinc.date,'%d-%m-%Y')as date,tinc.type,tinc.total,tinc.document,tinc.towhom,.tinc.description, ac.name FROM
|
||||
t_income_expense tinc join t_accountcode ac on ac.code=tinc.account_code
|
||||
WHERE account_code = '$sid' and monthname(date)='$d' and tinc.type='$c'";
|
||||
$query = $this->db->query($sql);
|
||||
@ -2173,7 +2260,7 @@ function INRSymbol()
|
||||
when tinc.type = 'RECEIPT'
|
||||
then tinc.towhom
|
||||
end, '-') as receiptname,
|
||||
tinc.total,tinc.towhom,tinc.description,tinc.type,tinc.account_code,ac.name FROM t_income_expense tinc join t_accountcode ac on ac.code=tinc.account_code WHERE DATE(date) = CURRENT_DATE";
|
||||
tinc.total,tinc.towhom,tinc.description,tinc.document,tinc.type,tinc.account_code,ac.name FROM t_income_expense tinc join t_accountcode ac on ac.code=tinc.account_code WHERE DATE(date) = CURRENT_DATE";
|
||||
$query = $this->db->query($sql);
|
||||
return $query->result();
|
||||
}
|
||||
@ -2214,7 +2301,7 @@ function INRSymbol()
|
||||
when tinc.type = 'RECEIPT'
|
||||
then tinc.towhom
|
||||
end, '-') as receiptname,
|
||||
tinc.total,tinc.towhom,tinc.description,tinc.type,tinc.account_code,ac.name FROM t_income_expense tinc join t_accountcode ac on ac.code=tinc.account_code where tinc.date !=0 ";
|
||||
tinc.total,tinc.towhom,tinc.description,tinc.type,tinc.document,tinc.account_code,ac.name FROM t_income_expense tinc join t_accountcode ac on ac.code=tinc.account_code where tinc.date !=0 ";
|
||||
if ($fdate and $tdate != ''){
|
||||
$fdate= date("Y-m-d",strtotime($fdate));
|
||||
$tdate=date("Y-m-d",strtotime($tdate));
|
||||
@ -2238,7 +2325,7 @@ function INRSymbol()
|
||||
}
|
||||
function menudepartmentwise($sid='')
|
||||
{
|
||||
$sql="SELECT date_format(tinc.date,'%d-%m-%Y')as date,tinc.type,tinc.total,tinc.towhom,.tinc.description, ac.name FROM t_income_expense tinc join t_accountcode ac on ac.code=tinc.account_code
|
||||
$sql="SELECT date_format(tinc.date,'%d-%m-%Y')as date,tinc.type,tinc.total,tinc.document,tinc.towhom,tinc.description, ac.name FROM t_income_expense tinc join t_accountcode ac on ac.code=tinc.account_code
|
||||
WHERE account_code = '$sid'";
|
||||
$query = $this->db->query($sql);
|
||||
//print_r($this->db->last_query());
|
||||
|
||||
@ -176,7 +176,7 @@ ifnull(Po.Quantity,0) as POQTY,sta.StatusName
|
||||
{
|
||||
$this->db->select('MaterialCode, MaterialName,UOM');
|
||||
$this->db->from('T_MaterialMaster');
|
||||
$this->db->where('MaterialType',$ReqType );
|
||||
//$this->db->where('MaterialType',$ReqType );
|
||||
|
||||
$query = $this->db->get();
|
||||
if($NotArray == '')
|
||||
|
||||
@ -305,7 +305,7 @@ if(!empty($rel_po))
|
||||
<table class="table table-bordered table-hover" id="req" >
|
||||
<thead>
|
||||
<tr>
|
||||
<th>PO NO</th>
|
||||
<th>PO No</th>
|
||||
<th>PO Type</th>
|
||||
<th>PO Date</th>
|
||||
<th>Released Date</th>
|
||||
@ -492,14 +492,13 @@ $.fn.dataTable.ext.search.push(
|
||||
);
|
||||
|
||||
$(document).ready(function() {
|
||||
//var table = $('#qdetails').DataTable();
|
||||
|
||||
// Event listener to the two range filtering inputs to redraw on input
|
||||
$('#min, #max').keyup( function() {
|
||||
table.draw();
|
||||
} );
|
||||
} );
|
||||
//for clear button
|
||||
|
||||
function Reset()
|
||||
{
|
||||
$('#min').val('');
|
||||
@ -508,11 +507,5 @@ function Reset()
|
||||
$('#max-date').val('');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@ -36,6 +36,9 @@
|
||||
|
||||
|
||||
</style>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content"><br/>
|
||||
<div class="row" style="min-height: 600px;">
|
||||
<!-- Left col -->
|
||||
<div class="col-md-12">
|
||||
@ -664,7 +667,9 @@
|
||||
<!-- /.box -->
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.min.js"></script>
|
||||
|
||||
@ -268,7 +268,7 @@ if(!empty($open_po))
|
||||
<table class="table table-bordered table-hover" id="req" >
|
||||
<thead>
|
||||
<tr>
|
||||
<th>PO NO</th>
|
||||
<th>PO No</th>
|
||||
<th>PO Type</th>
|
||||
<th>Created Date</th>
|
||||
<th>Approved Date</th>
|
||||
|
||||
471
application/views/Report_pending_purchase.php
Normal file
471
application/views/Report_pending_purchase.php
Normal file
@ -0,0 +1,471 @@
|
||||
|
||||
|
||||
<?php
|
||||
if(!empty($mms))
|
||||
{
|
||||
|
||||
}
|
||||
?>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
|
||||
$("#client_name").select2();
|
||||
$("#item_name").select2();
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
|
||||
<style>
|
||||
.dataTables_filter input {padding: 4px;}
|
||||
.dataTables_filter {
|
||||
width: 50%;
|
||||
float: right;
|
||||
text-align: right;
|
||||
}
|
||||
.dataTables_paginate {
|
||||
width: 50%;
|
||||
float: right;
|
||||
text-align: right;
|
||||
}
|
||||
div.dt-buttons {
|
||||
position: relative;
|
||||
float: right;
|
||||
|
||||
}
|
||||
.btn-success {
|
||||
background-color:#5d0411;
|
||||
border-color:#5d0411;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
<div class="content-wrapper">
|
||||
<section class="content"><br/>
|
||||
<div class="row" style="min-height: 600px;">
|
||||
<!-- Left col -->
|
||||
<div class="col-md-12">
|
||||
<!-- TABLE: LATEST ORDERS -->
|
||||
<div class="box box-info">
|
||||
<div class="box-header with-border">
|
||||
<center><h3 class="box-title"><p style="color:#5d0411"><b>Report - Pending Purchase Order</b>
|
||||
<br><br>
|
||||
<?php
|
||||
if($this->input->post('client_name')){
|
||||
$cl=$this->input->post('client_name');
|
||||
echo $cl;
|
||||
echo ' '.' ';
|
||||
}
|
||||
if($this->input->post('item_name')){
|
||||
$it=$this->input->post('item_name');
|
||||
echo $it;
|
||||
echo ' '.' ';
|
||||
}
|
||||
|
||||
if($this->input->post('financialyear')){
|
||||
$ab=$this->input->post('financialyear');
|
||||
echo '('.$ab.')';
|
||||
echo ' ';
|
||||
|
||||
}
|
||||
if($this->input->post('month')){
|
||||
$m=$this->input->post('month');
|
||||
echo '('.$m.')';
|
||||
echo ' ';
|
||||
}
|
||||
if($this->input->post('from_date') && $this->input->post('to_date')){
|
||||
$frm = $this->input->post('from_date');
|
||||
$t = $this->input->post('to_date');
|
||||
echo $frm.'-to-'.$t;
|
||||
}
|
||||
|
||||
?>
|
||||
</p></h3></center>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="panel-body">
|
||||
|
||||
<form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>">
|
||||
|
||||
<div class="form-group has-feedback">
|
||||
<div class="col-md-4">
|
||||
<label for="client_name">
|
||||
<?php echo 'Supplier'; ?>
|
||||
</label>
|
||||
<div class="input-group">
|
||||
<select class="form-control" id="client_name" name="client_name">
|
||||
<option value="">Select Supplier</option>
|
||||
<?php
|
||||
foreach($cust as $item):
|
||||
|
||||
{?>
|
||||
|
||||
<option value="<?php echo $item->SupplierName;?>"><?php echo $item->SupplierName ; ?></option>
|
||||
|
||||
|
||||
<?php } endforeach; ?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="client_name">
|
||||
<?php echo'Material'; ?>
|
||||
</label>
|
||||
<div class="input-group">
|
||||
<select class="form-control" id="item_name" name="item_name">
|
||||
<option value="">Select Material</option>
|
||||
<?php
|
||||
|
||||
|
||||
foreach($material as $it):
|
||||
|
||||
{?>
|
||||
|
||||
<option value="<?php echo $it->MaterialName;?>"><?php echo $it->MaterialName ; ?></option>
|
||||
|
||||
|
||||
<?php } endforeach; ?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<label for="to_date">
|
||||
<?php echo 'Year'; ?>
|
||||
</label>
|
||||
<div class="input-group">
|
||||
<select class="form-control" id="financialyear" name="financialyear">
|
||||
<option value="">Select Year</option>
|
||||
<?php
|
||||
|
||||
|
||||
foreach($finyear as $item):
|
||||
|
||||
{?>
|
||||
|
||||
<option value="<?php echo $item->financial_year;?>"><?php echo $item->financial_year ; ?></option>
|
||||
|
||||
|
||||
<?php } endforeach; ?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label for="to_date">
|
||||
<?php echo 'Month'; ?>
|
||||
</label>
|
||||
<div class="input-group">
|
||||
<select class="form-control" id="month" name="month">
|
||||
<option value="">Select Month</option>
|
||||
<option value="January">January</option>
|
||||
<option value="February">February</option>
|
||||
<option value="March">March</option>
|
||||
<option value="April">April</option>
|
||||
<option value="May">May</option>
|
||||
<option value="June">June</option>
|
||||
<option value="July">July</option>
|
||||
<option value="August">August</option>
|
||||
<option value="September">September</option>
|
||||
<option value="October">October</option>
|
||||
<option value="November">November</option>
|
||||
<option value="December">December</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="from_date">
|
||||
<?php echo 'From Date'; ?>
|
||||
</label>
|
||||
<div class="input-group">
|
||||
<input name="from_date" id="max-date" class="form-control datepicker">
|
||||
<span class="input-group-addon">
|
||||
<i class="fa fa-calendar fa-fw"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-4">
|
||||
<label for="to_date">
|
||||
<?php echo 'To Date'; ?>
|
||||
</label>
|
||||
<div class="input-group">
|
||||
<input name="to_date" id="min-date" class="form-control datepicker">
|
||||
<span class="input-group-addon">
|
||||
<i class="fa fa-calendar fa-fw"></i>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-2 col-md-offset-2"><br>
|
||||
<input type="submit" class="btn btn-success" name="btn_submit"
|
||||
value="View Report">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div>
|
||||
<table class="table table-bordered table-hover" id="cc" style="font-size:13px!important;">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th style="text-align:center">PO No</th>
|
||||
<th style="text-align:center">PO Date</th>
|
||||
<th style="text-align:center">Supplier Name</th>
|
||||
<th style="text-align:center">Material Name</th>
|
||||
<th style="text-align:center">Category</th>
|
||||
<th style="text-align:center">Ordered Quantity</th>
|
||||
<th style="text-align:center">Received Quantity</th>
|
||||
<th style="text-align:center">Pending Quantity</th>
|
||||
</tr>
|
||||
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if(!empty($ppurchse)){
|
||||
|
||||
$mvt=0.00;
|
||||
$yqt=0.00;
|
||||
$yvt=0.00;
|
||||
|
||||
|
||||
|
||||
|
||||
foreach($ppurchse as $rel)
|
||||
{
|
||||
$cat = $rel->category;
|
||||
?>
|
||||
<tr>
|
||||
<!-- <td><span>
|
||||
<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>-->
|
||||
<td><span>
|
||||
<?php echo $rel->po;?>
|
||||
</span></td>
|
||||
<td><span>
|
||||
<?php echo $rel->pdate;?>
|
||||
</span></td>
|
||||
<td><span>
|
||||
|
||||
<?php echo $rel->supplier;?>
|
||||
</span></td>
|
||||
<td><span>
|
||||
<?php echo $rel->material;?>
|
||||
</span></td>
|
||||
<td><span>
|
||||
<?php echo $rel->category;?>
|
||||
</span></td>
|
||||
<td style="text-align:right"><span><?php
|
||||
$mvt= $mvt + round($rel->quantity);
|
||||
?>
|
||||
<?php echo round($rel->quantity);?>
|
||||
</span></td>
|
||||
<td style="text-align:right"><span><?php
|
||||
$yqt= $yqt + round($rel->received);
|
||||
?>
|
||||
<?php echo round($rel->received);?>
|
||||
</span></td>
|
||||
<td style="text-align:right"><span><?php
|
||||
$yvt= $yvt + round($rel->pending);
|
||||
?>
|
||||
<?php echo round($rel->pending);?>
|
||||
</span></td>
|
||||
|
||||
|
||||
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
</tbody>
|
||||
<tfoot width="100%">
|
||||
<tr>
|
||||
<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
|
||||
{
|
||||
echo '';
|
||||
|
||||
}
|
||||
?>
|
||||
</strong>
|
||||
</td>
|
||||
<td style="text-align:right">
|
||||
<strong>
|
||||
<?php
|
||||
{
|
||||
echo '';
|
||||
|
||||
}
|
||||
?>
|
||||
</strong>
|
||||
</td>
|
||||
<td style="text-align:right">
|
||||
<strong>
|
||||
<?php
|
||||
{
|
||||
echo '';
|
||||
|
||||
}
|
||||
?>
|
||||
</strong>
|
||||
</td>
|
||||
<td style="text-align:right">
|
||||
<strong>
|
||||
<?php
|
||||
{
|
||||
echo $mvt;
|
||||
|
||||
}
|
||||
?>
|
||||
</strong>
|
||||
</td>
|
||||
<td style="text-align:right">
|
||||
<strong>
|
||||
<?php
|
||||
{
|
||||
echo $yqt;
|
||||
|
||||
}
|
||||
?>
|
||||
</strong>
|
||||
</td>
|
||||
<td style="text-align:right">
|
||||
<strong>
|
||||
<?php
|
||||
{
|
||||
echo $yvt;
|
||||
|
||||
}
|
||||
?>
|
||||
</strong>
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
|
||||
</tfoot>
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/pdfmake.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/vfs_fonts.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.html5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.colVis.min.js"></script>
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
// Bootstrap datepicker
|
||||
// Set up your table
|
||||
$(document).ready(function() {
|
||||
table = $('#cc').DataTable( {
|
||||
"dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
|
||||
"<'row'<'col-md-6'><'col-md-6'>>" +
|
||||
"<'row'<'col-md-12't>><'row'<'col-md-4'i><'col-md-8'p>>",
|
||||
buttons: [
|
||||
|
||||
{
|
||||
extend: 'excelHtml5',
|
||||
footer: 'true',
|
||||
messageTop: $('h3').text(),
|
||||
title: 'REPORT-Pending Purchase Order',
|
||||
exportOptions: {
|
||||
columns: ':visible'
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
'colvis'
|
||||
]
|
||||
} );
|
||||
} );
|
||||
$('#mySelect').on('change',function(){
|
||||
|
||||
table
|
||||
.column(4)
|
||||
.search(this.value)
|
||||
.draw();
|
||||
});
|
||||
|
||||
$( function() {
|
||||
//var dateFormat = "mm/dd/yy",
|
||||
from = $( "#min-date" )
|
||||
.datepicker({
|
||||
dateFormat: "dd-mm-yy",
|
||||
defaultDate: "+0d",
|
||||
changeMonth: true,
|
||||
//numberOfMonths: 1
|
||||
|
||||
})
|
||||
.on( "change", function() {
|
||||
to.datepicker("option", "minDate", getDate( this ) );
|
||||
}),
|
||||
to = $( "#max-date" ).datepicker({
|
||||
dateFormat: "dd-mm-yy",
|
||||
defaultDate: "+0d",
|
||||
changeMonth: true,
|
||||
//numberOfMonths: 1
|
||||
|
||||
})
|
||||
.on( "change", function() {
|
||||
from.datepicker( "option", "maxDate", getDate( this ) );
|
||||
});
|
||||
|
||||
function getDate( element ) {
|
||||
var date;
|
||||
|
||||
try {
|
||||
date = $.datepicker.parseDate( dateFormat, element.value );
|
||||
|
||||
} catch( error ) {
|
||||
date = null;
|
||||
}
|
||||
|
||||
return date;
|
||||
}
|
||||
} );
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@ -240,7 +240,7 @@ if(!empty($mms))
|
||||
<table class="table table-bordered table-hover" id="cc" style="font-size:10px !important;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align:center">PO NO</th>
|
||||
<th style="text-align:center">PO No</th>
|
||||
<th style="text-align:center">Date</th>
|
||||
<th style="text-align:center">Time</th>
|
||||
<th style="text-align:center">Material Name</th>
|
||||
|
||||
@ -1375,7 +1375,7 @@ function calculateTime() {
|
||||
min1 = Math.round(min1);
|
||||
|
||||
if (minites< 0) {
|
||||
swal('Please enter a invalid time');
|
||||
swal('Please enter a valid time');
|
||||
$("#Pretime").val(0);
|
||||
} else{
|
||||
$("#Pretime").val(hrs+':'+min1);
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
<style type="text/css">
|
||||
/* unvisited link */
|
||||
a:link {
|
||||
/* h4 {
|
||||
color: #ffaa80;
|
||||
}
|
||||
} */
|
||||
/* mouse over link */
|
||||
a:hover {
|
||||
color: #cc6666;
|
||||
a:hover a:onclick {
|
||||
/* color: #cc6666; */
|
||||
color :#99514D;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -34,16 +35,17 @@
|
||||
<a href="<?php echo base_url(); ?>Report_supplier" target="_blank" >Purchase Supplier - Wise<p class="uk-text uk-margin-remove"></p></a>
|
||||
<a href="<?php echo base_url(); ?>Report_consolidate" target="_blank" >Consolidate Report<p class="uk-text-meta uk-margin-remove"></p></a>
|
||||
<a href="<?php echo base_url(); ?>Report_cumulative" target="_blank" >Cumulative Report<p class="uk-text uk-margin-remove"></p></a>
|
||||
<a href="<?php echo base_url(); ?>Report_pending_purchase" target="_blank" >Purchase Order Pending<p class="uk-text uk-margin-remove"></p></a>
|
||||
|
||||
</div>
|
||||
<div class="col-xs-3">
|
||||
<h4><span class="fa fa-superpowers"> Material Master </span></h4>
|
||||
<h4><span class="fa fa-codepen"> Material Master </span></h4>
|
||||
<a href="<?php echo base_url(); ?>Report_Material_Supplier" target="_blank" ><p class="uk-text uk-margin-remove">Material Master - supplier wise</p></a>
|
||||
<a href="<?php echo base_url(); ?>Report_Material_Item" target="_blank" ><p class="uk-text uk-margin-remove">Material Master - Item wise</p></a>
|
||||
<a href="<?php echo base_url(); ?>Report_Material_ReceiptValue" target="_blank" ><p class="uk-text uk-margin-remove">Material Master - Receipt Value</p></a>
|
||||
</div>
|
||||
<div class="col-xs-3">
|
||||
<h4><span class="fa fa-cart-arrow-down"> Inward</span></h4>
|
||||
<h4><span class="fa fa-truck"> Inward</span></h4>
|
||||
<a href="<?php echo base_url(); ?>Report_purchase_inward" target="_blank" >Purchase<p class="uk-text uk-margin-remove"></p></a>
|
||||
<a href="<?php echo base_url(); ?>Report_year_wise_inward" target="_blank" >Year Wise<p class="uk-text-meta uk-margin-remove"></p></a>
|
||||
<a href="<?php echo base_url(); ?>Report_supplier_inward" target="_blank" >Purchase Supplier - Wise<p class="uk-text uk-margin-remove"></p></a>
|
||||
|
||||
@ -109,7 +109,7 @@ if(!empty($Emp))
|
||||
$Costs[$SID->CostCenterCode] = $SID->CostCenterCode .'-'. $SID->CostCenterName ;
|
||||
|
||||
endforeach;
|
||||
|
||||
|
||||
}
|
||||
echo form_dropdown('CostCenter', $Costs,set_value('CostCenter'),'id="CostCenter"' ,'class = "form-control"');
|
||||
|
||||
@ -362,8 +362,8 @@ if(!empty($Emp))
|
||||
<input type="hidden" name="txtDeletedRow" id="txtDeletedRow" />
|
||||
<a class="btn btn-primary Save" ID="Save" onclick="Save()" > <span class="bold">Save</span></a>
|
||||
|
||||
<input type="submit" value="submit" class="btn btn-primary" >
|
||||
<input type="reset" class="btn btn-primary">
|
||||
<input type="submit" value="submit" class="btn btn-primary" >
|
||||
<input type="reset" value="Reset" id="reset" class="btn btn-primary" onclick="history.go();">
|
||||
|
||||
</div>
|
||||
<br>
|
||||
@ -373,7 +373,8 @@ if(!empty($Emp))
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<script>
|
||||
|
||||
var isExceed = 0;
|
||||
function isNumberKey(evt)
|
||||
{
|
||||
|
||||
@ -34,6 +34,7 @@
|
||||
<th>UA Number</th>
|
||||
<th>Payment Terms</th>
|
||||
</tr>
|
||||
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
@ -73,37 +74,17 @@
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/common.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
// $(function () {
|
||||
$(function () {
|
||||
|
||||
// $('#datatable').DataTable({
|
||||
// "paging": true,
|
||||
// "lengthChange": true,
|
||||
// "searching": true,
|
||||
// "ordering": true,
|
||||
// "info": true,
|
||||
// "autoWidth": true
|
||||
$('#datatable').DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": true,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": true
|
||||
|
||||
// });
|
||||
// });
|
||||
$(document).ready(function() {
|
||||
table = $('#tab').DataTable( {
|
||||
"dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
|
||||
"<'row'<'col-md-6'><'col-md-6'>>" +
|
||||
"<'table-responsive'<'col-md-12't>><'row'<'col-md-4'i><'col-md-8'p>>",
|
||||
buttons: [
|
||||
{
|
||||
extend: 'excelHtml5',
|
||||
footer: 'true',
|
||||
messageTop: $('h3').text(),
|
||||
title: 'supplier listing',
|
||||
exportOptions: {
|
||||
columns: ':visible'
|
||||
}
|
||||
},
|
||||
'colvis'
|
||||
]
|
||||
} );
|
||||
} );
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user