diff --git a/Apollo/api/application/models/Fees_status_model.php b/Apollo/api/application/models/Fees_status_model.php index f161e616..8fb223fe 100755 --- a/Apollo/api/application/models/Fees_status_model.php +++ b/Apollo/api/application/models/Fees_status_model.php @@ -422,9 +422,26 @@ class Fees_status_model extends CI_Model else{ $storePaidDetails['BalanceAmount']=$storePaidDetails['PayableAmount'] - $paidBillAmount[0]->PaidBillAmount; } + // sepearte for student waiver and referral bill list + $this->db->select('ifnull(SUM((BillAmount)),0) as StudentWaiverRefAmount'); + $this->db->where('FeesId',$feeRow->FeesID); + $this->db->where('IsActive','1'); + $this->db->where_in('ModeOfPayment',$serachArray); + $studentWaiverRefAmount = $this->db->get(STUDENTS_FEES_PAID)->result(); + + $storePaidDetails['StudentWaiverRefAmount']=$studentWaiverRefAmount[0]->StudentWaiverRefAmount; + + $this->db->select('ifnull(SUM((BillAmount)),0) as StudentPaidAmount'); + $this->db->where('FeesId',$feeRow->FeesID); + $this->db->where('IsActive','1'); + $this->db->where('ModeOfPayment !=',WAIVER); + $this->db->where('ModeOfPayment !=',REFERRAL); + $studentPaidAmount = $this->db->get(STUDENTS_FEES_PAID)->result(); + + $storePaidDetails['StudentPaidAmount']=$studentPaidAmount[0]->StudentPaidAmount; // for get paid bill details - $this->db->select('ifnull(SUM((BillAmount)),0) as BillAmount,BillNO,BillDate,ModeOfPayment,ReceiptNo,BR.BranchName,BR.Address,BR.LogoPath,STF.Firstname as ReceivedBy'); + $this->db->select('ifnull(SUM((BillAmount)),0) as BillAmount,BillNO,BillDate,ModeOfPayment,ReceiptNo,BR.BranchName,BR.Address,BR.LogoPath,BR.FeesReceiptTitle,STF.Firstname as ReceivedBy,SFP.CommentsForStudent,SFP.InternalComments'); $this->db->from(STUDENTS_FEES_PAID.' as SFP'); $this->db->join(BRANCH.' as BR','BR.BranchCode = SFP.UpdatedBy','left'); $this->db->join(LOGIN.' as LO','LO.ID = SFP.CreatedBy');