diff --git a/application/models/dahsboard_model.php b/application/models/dahsboard_model.php index 98aa26aa..c8deeb3c 100755 --- a/application/models/dahsboard_model.php +++ b/application/models/dahsboard_model.php @@ -693,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 @@ -1998,7 +2010,7 @@ 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' +where po.Status != 'ST030' and po.Status = 'ST026' "; if ($cname!= ''){ diff --git a/application/views/reportslink.php b/application/views/reportslink.php index f798feac..96d0d26a 100755 --- a/application/views/reportslink.php +++ b/application/views/reportslink.php @@ -29,13 +29,13 @@
-

  Material Master

+

  Material Master

Material Master - supplier wise

Material Master - Item wise

Material Master - Receipt Value

-

  Inward

+

  Inward

Purchase

Year Wise

Purchase Supplier - Wise

diff --git a/application/views/requisitionform.php b/application/views/requisitionform.php index 30ea45f2..d2949fc1 100755 --- a/application/views/requisitionform.php +++ b/application/views/requisitionform.php @@ -363,7 +363,7 @@ if(!empty($Emp))   Save - +