pending purchase report changes

This commit is contained in:
gandhimathi 2017-12-27 16:37:54 +05:30
parent e17cd072fc
commit e4fa30bf52
3 changed files with 26 additions and 14 deletions

View File

@ -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!= ''){

View File

@ -29,13 +29,13 @@
</div>
<div class="col-xs-3">
<h4><span class="fa fa-superpowers">&nbsp; Material Master </span></h4>
<h4><span class="fa fa-codepen">&nbsp; 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">&nbsp; Inward</span></h4>
<h4><span class="fa fa-truck">&nbsp; 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>

View File

@ -363,7 +363,7 @@ if(!empty($Emp))
<a class="btn btn-primary Save" ID="Save" onclick="Save()" >&nbsp;&nbsp;<span class="bold">Save</span></a>
<input type="submit" value="submit" class="btn btn-primary" >
<input type="reset" class="btn btn-primary">
<input type="reset" value="Reset" class="btn btn-primary" onclick="window.location.reload();">
</div>
<br>