Phase1 Issues xl - report 5A : sanjeev

This commit is contained in:
Sanjeev 2020-11-02 17:05:38 +05:30
parent cfd7b0e3ad
commit 32db33d774

View File

@ -1192,14 +1192,21 @@ class DayBook_model extends CI_Model
$expid = 'I001';
$subQuery='select Name,sum(Amount) as Total,T_DayBookMaster.ID,T_Income_Outcome_Master.ID as SubID,T_Income_Outcome_Master.TypeID as OrgType,T_Income_Outcome_Master.TypeName,T_DayBookMaster.Date,Reason,T_DayBookMaster.Description,ListName from T_DayBookMaster
left join T_Income_Outcome_Master on T_Income_Outcome_Master.ID = T_DayBookMaster.Type
join T_PickListDetails on T_PickListDetails.ListCode = T_Income_Outcome_Master.TypeID
where str_to_date(date,?)>=? and str_to_date(date,?)<=? and Status!=? and T_DayBookMaster.BranchCode=? and (T_DayBookMaster.ModeOfPayment != ? and T_DayBookMaster.ModeOfPayment != ?and T_DayBookMaster.Status !=?) group by Type,Name';
// $subQuery='select Name,sum(Amount) as Total,T_DayBookMaster.ID,T_Income_Outcome_Master.ID as SubID,T_Income_Outcome_Master.TypeID as OrgType,T_Income_Outcome_Master.TypeName,T_DayBookMaster.Date,Reason,T_DayBookMaster.Description,ListName from T_DayBookMaster
// left join T_Income_Outcome_Master on T_Income_Outcome_Master.ID = T_DayBookMaster.Type
// join T_PickListDetails on T_PickListDetails.ListCode = T_Income_Outcome_Master.TypeID
// where str_to_date(date,?)>=? and str_to_date(date,?)<=? and Status!=? and T_DayBookMaster.BranchCode=? and (T_DayBookMaster.ModeOfPayment != ? and T_DayBookMaster.ModeOfPayment != ?and T_DayBookMaster.Status !=?) group by Type,Name';
$query = $this->db->query($subQuery,array('%d-%m-%Y',$fromd,'%d-%m-%Y',$tod,'Cancel',$branch,'WAIVER','REFERRAL','Pending'));
// $query = $this->db->query($subQuery,array('%d-%m-%Y',$fromd,'%d-%m-%Y',$tod,'Cancel',$branch,'WAIVER','REFERRAL','Pending'));
//and T_DayBookMaster.Isdaybook=?
$subQuery="select Name,sum(Amount) as Total,T_DayBookMaster.ID,T_Income_Outcome_Master.ID as SubID,T_Income_Outcome_Master.TypeID as OrgType,T_Income_Outcome_Master.TypeName,T_DayBookMaster.Date,Reason,T_DayBookMaster.Description,ListName from T_DayBookMaster
left join T_Income_Outcome_Master on T_Income_Outcome_Master.ID = T_DayBookMaster.Type
join T_PickListDetails on T_PickListDetails.ListCode = T_Income_Outcome_Master.TypeID
where str_to_date(date,?)>=? and str_to_date(date,?)<=? and Status!=? and T_DayBookMaster.BranchCode=? and (case when ListName = 'Income' then T_DayBookMaster.ModeOfPayment != 'WAIVER' and T_DayBookMaster.ModeOfPayment != 'REFERRAL'and T_DayBookMaster.Status !='Pending' and T_Income_Outcome_Master.TypeName NOT LIKE '%BY CASH%'
when ListName = 'Expense' then T_DayBookMaster.Status !='Pending' and T_Income_Outcome_Master.TypeName != 'FEES' and T_Income_Outcome_Master.TypeName NOT LIKE '%CASH TO%' end) group by Type,Name";
$query = $this->db->query($subQuery,array('%d-%m-%Y',$fromd,'%d-%m-%Y',$tod,'Cancel',$branch));
$expense = $query->result();