dashboard issues and attachments on inward
This commit is contained in:
parent
bcb8947693
commit
78c5c561e4
@ -72,13 +72,10 @@ class user extends BaseController
|
||||
|
||||
//dashboard pie chart
|
||||
$data['importbudgt'] = $this->dahsboard_Model->importbudgt();
|
||||
$data['importbal'] = $this->dahsboard_Model->importbal();
|
||||
$data['servicebudgt'] = $this->dahsboard_Model->servicebudgt();
|
||||
$data['servicebal'] = $this->dahsboard_Model->servicebal();
|
||||
$data['servicebudgt'] = $this->dahsboard_Model->servicebudgt();
|
||||
$data['revenuebudgt'] = $this->dahsboard_Model->revenuebudgt();
|
||||
$data['revenuebal'] = $this->dahsboard_Model->revenuebal();
|
||||
$data['capitalbud'] = $this->dahsboard_Model->capitalbud();
|
||||
$data['capitalbal'] = $this->dahsboard_Model->capitalbal();
|
||||
$data['typebal'] = $this->dahsboard_Model->typebal();
|
||||
|
||||
|
||||
/* HR DASHBOARD Controller Start*/
|
||||
|
||||
@ -306,7 +306,7 @@ function getTotalServicePoCount(){
|
||||
$sql="SELECT count(cmast.PONO) as totalService FROM T_PurchaseOrder_Master cmast
|
||||
left join T_PurchaseOrder_LineItem line on line.PONO=cmast.PONO
|
||||
left join T_Requestion_Master req on req.ReqNo=line.ReqNo
|
||||
where ReqType='SERVICE' and month(PODate) = $i
|
||||
where POType='SERVICE' and month(PODate) = $i
|
||||
and date(cmast.PODate) >= '".$fa."-04-01' and date(cmast.PODate) <= '".$aa."-03-31'";
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
@ -336,7 +336,7 @@ function getTotalimportPoCount(){
|
||||
$sql="SELECT count(cmast.PONO) as totalImport FROM T_PurchaseOrder_Master cmast
|
||||
left join T_PurchaseOrder_LineItem line on line.PONO=cmast.PONO
|
||||
left join T_Requestion_Master req on req.ReqNo=line.ReqNo
|
||||
where ReqType='IMPORT' and month(PODate) = $i
|
||||
where POType='IMPORT' and month(PODate) = $i
|
||||
and date(cmast.PODate) >= '".$fa."-04-01' and date(cmast.PODate) <= '".$aa."-03-31'";
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
@ -364,7 +364,7 @@ function getTotalcapitalPoCount(){
|
||||
$sql="SELECT count(cmast.PONO) as totalcapital FROM T_PurchaseOrder_Master cmast
|
||||
left join T_PurchaseOrder_LineItem line on line.PONO=cmast.PONO
|
||||
left join T_Requestion_Master req on req.ReqNo=line.ReqNo
|
||||
where ReqType='CAPITAL' and month(PODate) = $i
|
||||
where POType='CAPITAL' and month(PODate) = $i
|
||||
and date(cmast.PODate) >= '".$fa."-04-01' and date(cmast.PODate) <= '".$aa."-03-31'";
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
@ -392,7 +392,7 @@ $i++;
|
||||
$sql="SELECT count(cmast.PONO) as totalrevenue FROM T_PurchaseOrder_Master cmast
|
||||
left join T_PurchaseOrder_LineItem line on line.PONO=cmast.PONO
|
||||
left join T_Requestion_Master req on req.ReqNo=line.ReqNo
|
||||
where ReqType='REVENUE' and month(PODate) = $i
|
||||
where POType='REVENUE' and month(PODate) = $i
|
||||
and date(cmast.PODate) >= '".$fa."-04-01' and date(cmast.PODate) <= '".$aa."-03-31'";
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
@ -486,81 +486,49 @@ function importbudgt ()
|
||||
$query = $this->db->query($sql);
|
||||
return $query->result();
|
||||
}
|
||||
function importbal ()
|
||||
{
|
||||
$sql="SELECT ROUND(sum(BudgetAmount)-(SELECT
|
||||
ifnull((sum(distinct(PO_Line_Item.Quantity * PO_Line_Item.Rate) * po.ExchangeRate)),0)
|
||||
as Util_Amount
|
||||
from T_CostCenter_Budget Cost_Center_Budget
|
||||
join T_PurchaseOrder_LineItem PO_Line_Item on Cost_Center_Budget.CostCenterCode=PO_Line_Item.CostCenterCode
|
||||
JOIN T_PurchaseOrder_Master po on po.PONO=PO_Line_Item.PONO and po.POType=Cost_Center_Budget.BudgetType
|
||||
WHERE Cost_Center_Budget.BudgetType='IMPORT' and YEAR(STR_TO_DATE(`BudgetYear`,'%Y')) = YEAR(NOW())),2) as balimportbudget FROM T_CostCenter_Budget where BudgetType ='IMPORT' and YEAR(STR_TO_DATE(`BudgetYear`,'%Y')) = YEAR(NOW()) ";
|
||||
$query = $this->db->query($sql);
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function capitalbud ()
|
||||
{
|
||||
$sql="SELECT sum(BudgetAmount) as totalcapitalbudget FROM T_CostCenter_Budget where BudgetType ='CAPITAL' and YEAR(STR_TO_DATE(`BudgetYear`,'%Y')) = YEAR(NOW()) ";
|
||||
$query = $this->db->query($sql);
|
||||
return $query->result();
|
||||
}
|
||||
function capitalbal ()
|
||||
{
|
||||
$sql="SELECT ROUND(sum(BudgetAmount)-(SELECT
|
||||
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)
|
||||
as Util_Amount
|
||||
from T_CostCenter_Budget Cost_Center_Budget
|
||||
join T_PurchaseOrder_LineItem PO_Line_Item on Cost_Center_Budget.CostCenterCode=PO_Line_Item.CostCenterCode
|
||||
JOIN T_PurchaseOrder_Master po on po.PONO=PO_Line_Item.PONO and po.POType=Cost_Center_Budget.BudgetType and po.Status !='ST030'
|
||||
left JOIN T_Service_Tax st on st.LineItemNo = PO_Line_Item.LineItemNo
|
||||
WHERE Cost_Center_Budget.BudgetType='CAPITAL' and YEAR(STR_TO_DATE(`BudgetYear`,'%Y')) = YEAR(NOW())),2) as balcapitalbudget FROM T_CostCenter_Budget where BudgetType ='CAPITAL' and YEAR(STR_TO_DATE(`BudgetYear`,'%Y')) = YEAR(NOW())
|
||||
";
|
||||
$query = $this->db->query($sql);
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function servicebudgt ()
|
||||
{
|
||||
$sql="SELECT ROUND(sum(BudgetAmount),2) as totalservicebudget FROM T_CostCenter_Budget where BudgetType ='SERVICE' and YEAR(STR_TO_DATE(`BudgetYear`,'%Y')) = YEAR(NOW())";
|
||||
$query = $this->db->query($sql);
|
||||
return $query->result();
|
||||
}
|
||||
function servicebal ()
|
||||
{
|
||||
$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 'SERVICE'
|
||||
then ifnull((sum(distinct PO_Line_Item.Quantity * PO_Line_Item.Rate)),0)
|
||||
end as service
|
||||
from T_CostCenter_Budget Cost_Center_Budget
|
||||
left join T_PurchaseOrder_LineItem PO_Line_Item on Cost_Center_Budget.CostCenterCode=PO_Line_Item.CostCenterCode
|
||||
left JOIN T_PurchaseOrder_Master po on po.PONO=PO_Line_Item.PONO and po.Status !='ST030'
|
||||
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
|
||||
JOIN T_CostCenter_Departments CostCentDept on CostCentDept.CostCenterCode=Cost_Mast.CostCenterCode
|
||||
JOIN T_DepartmentDetails Dept_Details on Dept_Details.DEPCode= CostCentDept.DEPCode
|
||||
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'
|
||||
group by
|
||||
Cost_Center_Budget.BudgetType
|
||||
";
|
||||
$query = $this->db->query($sql);
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function revenuebudgt ()
|
||||
{
|
||||
$sql="SELECT ROUND(sum(BudgetAmount),2) as totalrevenuebudget FROM T_CostCenter_Budget where BudgetType ='REVENUE' and YEAR(STR_TO_DATE(`BudgetYear`,'%Y')) = YEAR(NOW())";
|
||||
$query = $this->db->query($sql);
|
||||
return $query->result();
|
||||
}
|
||||
function revenuebal ()
|
||||
function typebal ()
|
||||
{
|
||||
$sql="SELECT ROUND(sum(BudgetAmount)-(SELECT
|
||||
ifnull((sum(distinct PO_Line_Item.Quantity * PO_Line_Item.Rate) - sum(distinct T_Rev_Tax.AfterDiscount)),0)
|
||||
as Util_Amount
|
||||
$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,
|
||||
sum(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)) as ca,
|
||||
sum(if(Cost_Center_Budget.BudgetType='SERVICE',
|
||||
PO_Line_Item.Quantity * PO_Line_Item.Rate,0)) as sr,
|
||||
sum(if(Cost_Center_Budget.BudgetType='REVENUE',
|
||||
(PO_Line_Item.Quantity * PO_Line_Item.Rate)-T_Rev_Tax.AfterDiscount,0)) as rv
|
||||
|
||||
from T_CostCenter_Budget Cost_Center_Budget
|
||||
join T_PurchaseOrder_LineItem PO_Line_Item on Cost_Center_Budget.CostCenterCode=PO_Line_Item.CostCenterCode
|
||||
JOIN T_Revenue_Tax T_Rev_Tax on PO_Line_Item.LineItemNo=T_Rev_Tax.LineItemNo
|
||||
WHERE Cost_Center_Budget.BudgetType='REVENUE' and YEAR(STR_TO_DATE(`BudgetYear`,'%Y')) = YEAR(NOW())),2) as balrevenuebudget FROM T_CostCenter_Budget where BudgetType ='REVENUE' and YEAR(STR_TO_DATE(`BudgetYear`,'%Y')) = YEAR(NOW())";
|
||||
left join T_PurchaseOrder_LineItem PO_Line_Item on Cost_Center_Budget.CostCenterCode=PO_Line_Item.CostCenterCode
|
||||
left JOIN T_PurchaseOrder_Master po on po.PONO=PO_Line_Item.PONO and po.Status !='ST030'
|
||||
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'
|
||||
group by
|
||||
Cost_Center_Budget.BudgetYear
|
||||
";
|
||||
$query = $this->db->query($sql);
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
@ -201,7 +201,7 @@
|
||||
<a href="<?= base_url() ?>report/i_consolidate_month?ab=<?php echo $ab;?>&cname=<?php echo $result->supplier_name;?>&prod=<?php echo $result->material_name;?>&m=<?php echo 'August';?>"><?php echo round($result->August);?> </a>
|
||||
</td>
|
||||
<td style="text-align:right;"><?php
|
||||
$sep= $sep + $result->September;
|
||||
$sep= $sep + round($result->September);
|
||||
?>
|
||||
<a href="<?= base_url() ?>report/i_consolidate_month?ab=<?php echo $ab;?>&cname=<?php echo $result->supplier_name;?>&prod=<?php echo $result->material_name;?>&m=<?php echo 'September';?>"><?php echo round($result->September);?> </a>
|
||||
</td>
|
||||
|
||||
@ -789,7 +789,7 @@ collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Monthly Released Purchase Order</h3>
|
||||
<h3 class="box-title">Monthly Purchase Order</h3>
|
||||
|
||||
<!--<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
|
||||
@ -932,24 +932,24 @@ collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
<div class="box-footer">
|
||||
<div class="box-footer">
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-6 col-md-3 text-center">
|
||||
<div class="description-block border-right">
|
||||
<?php foreach($servicebudgt as $service)
|
||||
if(!empty($servicebal))
|
||||
if(!empty($typebal))
|
||||
{
|
||||
foreach($servicebal as $serviceb)
|
||||
$sb=$service->totalservicebudget-$serviceb->service;
|
||||
foreach($typebal as $serviceb)
|
||||
$sb=$service->totalservicebudget-$serviceb->sr;
|
||||
{
|
||||
?>
|
||||
<div class="knob-label"><strong style="color:#00c0ef">SERVICE BUDGET</strong></div>
|
||||
<input type="text" class="knob" data-thickness="0.4" data-readonly="true" value=<?php
|
||||
echo $sb;?> data-min="20" data-max=<?php echo $service->totalservicebudget;?> data-width="" data-height="" data-fgColor="#00c0ef "> <br>
|
||||
echo number_format($sb,2,'.','');?> data-min="20" data-max=<?php echo $service->totalservicebudget;?> data-width="" data-height="" data-fgColor="#00c0ef "> <br>
|
||||
<div class="knob-label"><strong>TOTAL : <i class="fa fa-rupee " ></i> <?php echo $service->totalservicebudget;?></strong></div>
|
||||
<div class="knob-label"><strong>BALANCE : <i class="fa fa-rupee " ></i> <?php
|
||||
echo $sb;?></strong></div>
|
||||
echo number_format($sb,2,'.','');?></strong></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
@ -962,17 +962,17 @@ collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:
|
||||
<?php // if(!empty($totalrevenuepo))
|
||||
// {
|
||||
foreach($revenuebudgt as $revenue)
|
||||
if(!empty($revenuebal))
|
||||
if(!empty($typebal))
|
||||
{
|
||||
foreach($revenuebal as $revenueb)
|
||||
|
||||
foreach($typebal as $revenueb)
|
||||
$rb=$revenue->totalrevenuebudget-$revenueb->rv;
|
||||
{
|
||||
|
||||
?>
|
||||
<div class="knob-label"><strong style="color:#dd4b39">REVENUE BUDGET</strong></div>
|
||||
<input type="text" class="knob" data-thickness="0.4" data-readonly="true" value="<?php echo $revenueb->balrevenuebudget;?> " data-min="0" data-max=<?php echo $revenue->totalrevenuebudget;?> data-width="" data-height="" data-fgColor="#dd4b39 "> <br>
|
||||
<input type="text" class="knob" data-thickness="0.4" data-readonly="true" value="<?php echo number_format($rb,2,'.','');?> " data-min="0" data-max=<?php echo $revenue->totalrevenuebudget;?> data-width="" data-height="" data-fgColor="#dd4b39 "> <br>
|
||||
<div class="knob-label"><strong>TOTAL : <i class="fa fa-rupee " ></i> <?php echo $revenue->totalrevenuebudget;?> </strong> </div>
|
||||
<div class="knob-label"><strong>BALANCE : <i class="fa fa-rupee " ></i> <?php echo $revenueb->balrevenuebudget;?></strong> </div>
|
||||
<div class="knob-label"><strong>BALANCE : <i class="fa fa-rupee " ></i> <?php echo number_format($rb,2,'.','');?></strong> </div>
|
||||
|
||||
<?php
|
||||
}
|
||||
@ -984,15 +984,16 @@ collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:
|
||||
<div class="col-xs-6 col-md-3 text-center">
|
||||
<div class="description-block border-right">
|
||||
<?php foreach($importbudgt as $import)
|
||||
if(!empty($importbal)){
|
||||
foreach($importbal as $importb)
|
||||
if(!empty($typebal)){
|
||||
foreach($typebal as $importb)
|
||||
$im=$import->totalimportbudget-$importb->im;
|
||||
{
|
||||
|
||||
?>
|
||||
<div class="knob-label"><strong style="color:#00a65a">IMPORT BUDGET</strong></div>
|
||||
<input type="text" class="knob" data-thickness="0.4" data-readonly="true" value=<?php echo $importb->balimportbudget;?> data-min="0" data-max=<?php echo $import->totalimportbudget;?> data-width="" data-height="" data-fgColor="#00a65a "> <br>
|
||||
<input type="text" class="knob" data-thickness="0.4" data-readonly="true" value=<?php echo number_format($im,2,'.','');?> data-min="0" data-max=<?php echo $import->totalimportbudget;?> data-width="" data-height="" data-fgColor="#00a65a "> <br>
|
||||
<div class="knob-label"><strong>TOTAL : <i class="fa fa-rupee " ></i> <?php echo $import->totalimportbudget;?> </strong></div>
|
||||
<div class="knob-label"><strong>BALANCE : <i class="fa fa-rupee " ></i> <?php echo $importb->balimportbudget;?> </strong></div>
|
||||
<div class="knob-label"><strong>BALANCE : <i class="fa fa-rupee " ></i> <?php echo number_format($im,2,'.','');?> </strong></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
@ -1002,16 +1003,16 @@ collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:
|
||||
<div class="col-xs-6 col-md-3 text-center">
|
||||
<div class="description-block border-right">
|
||||
<?php foreach($capitalbud as $capital)
|
||||
if(!empty($capitalbal)){
|
||||
foreach($capitalbal as $capitalb)
|
||||
|
||||
if(!empty($typebal)){
|
||||
foreach($typebal as $capitalb)
|
||||
$ca=$capital->totalcapitalbudget-$capitalb->ca;
|
||||
{
|
||||
|
||||
?>
|
||||
<div class="knob-label"><strong style="color:#f39c12">CAPITAL BUDGET</strong></div>
|
||||
<input type="text" class="knob" data-thickness="0.4" data-readonly="true" value=<?php echo $capitalb->balcapitalbudget;?> data-min="0" data-max=<?php echo $capital->totalcapitalbudget;?> data-fgColor="#f39c12 "><br>
|
||||
<input type="text" class="knob" data-thickness="0.4" data-readonly="true" value=<?php echo number_format($ca,2,'.','');?> data-min="0" data-max=<?php echo $capital->totalcapitalbudget;?> data-fgColor="#f39c12 "><br>
|
||||
<div class="knob-label"><strong>TOTAL : <i class="fa fa-rupee " ></i> <?php echo $capital->totalcapitalbudget;?></strong></div>
|
||||
<div class="knob-label"><strong>BALANCE : <i class="fa fa-rupee " ></i> <?php echo $capitalb->balcapitalbudget;?></strong> </div>
|
||||
<div class="knob-label"><strong>BALANCE : <i class="fa fa-rupee " ></i> <?php echo number_format($ca,2,'.','');?></strong> </div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user