diff --git a/Apollo/api/application/config/constants.php b/Apollo/api/application/config/constants.php index 9117a288..152ae0db 100755 --- a/Apollo/api/application/config/constants.php +++ b/Apollo/api/application/config/constants.php @@ -183,3 +183,9 @@ defined('ENCR_PASSWORD') OR define('ENCR_PASSWORD','e99a18c428cb38d5f26085367892 +//for non operational items + +defined('NONOPERATIONAL') OR define('NONOPERATIONAL','T_NonOperationalMaster'); + + + diff --git a/Apollo/api/application/config/routes.php b/Apollo/api/application/config/routes.php index 31af1786..3e2858d9 100755 --- a/Apollo/api/application/config/routes.php +++ b/Apollo/api/application/config/routes.php @@ -187,6 +187,7 @@ $route['IncomeExpenseDetails'] = 'DayBook_Controller/getIncomeExpenseDetails'; $route['ViewFullIncomeDetails'] = 'DayBook_Controller/ViewFullIncomeDetails'; $route['GetSubTypes'] = 'DayBook_Controller/GetSubTypes'; +$route['GetPLforExcel'] = 'DayBook_Controller/GetPLforExcel'; $route['getAllDayBookDetails'] = 'DayBook_Controller/getAllDayBookDetails'; @@ -275,6 +276,13 @@ $route['getDayBookMasterDetails'] = 'DayBookMaster_Controller/getDayBookMasterDe $route['addDaybookMasterDetails'] = 'DayBookMaster_Controller/addDaybookMasterDetails'; $route['updateDayBookMasterDetails'] = 'DayBookMaster_Controller/updateDayBookMasterDetails'; +/** non operational **/ + +$route['getNonDayBookDetails'] = 'DayBook_Controller/getNonDayBookDetails'; +$route['addNonOperational'] = 'DayBook_Controller/addNonOperational'; +$route['updateNonOperationalDetails'] = 'DayBook_Controller/updateNonOperationalDetails'; + + /** This is for CRONE JOB*/ $route['sendStudentNotification'] = 'Fees_Status_Controller/sendStudentNotification'; diff --git a/Apollo/api/application/controllers/DayBook_Controller.php b/Apollo/api/application/controllers/DayBook_Controller.php index 97a9532e..ea06df43 100755 --- a/Apollo/api/application/controllers/DayBook_Controller.php +++ b/Apollo/api/application/controllers/DayBook_Controller.php @@ -152,6 +152,33 @@ class DayBook_Controller extends REST_Controller { } + + + + public function getNonDayBookDetails_post() { + + + + $reqData = $this->post('data'); + $reqDataBy = $this->post('localReqDetails'); + $getDayBookDetails = $this->daybook_model->get_Daybook_NonDetails_List($reqData, $reqDataBy);// Check if the employee exist + if ($getDayBookDetails) + { + $getDayBookDetails['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($getDayBookDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + } + else + { + // Set the response and exit + $this->response([ + 'message' => 'No list were found', + 'status' => REST_Controller::HTTP_NOT_FOUND + ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code + } + + } + public function getDayBookApprovalDetails_post() { $reqData = $this->post('data'); $reqDataBy = $this->post('localReqDetails'); @@ -251,12 +278,103 @@ class DayBook_Controller extends REST_Controller { } } + + + +public function updateNonOperationalDetails_post() { + $reqData = $this->post('data'); + $reqbyData = $this->post('localReqDetails'); + + $updateFor = $reqData['id']; + $req['Type'] = $reqData['type']; + $req['Amount'] = $reqData['amount']; + $req['Description'] = $reqData['description']; + $req['UpdatedBy'] = $reqbyData['localUserID']; + $req['PaidTo'] = $reqData['paidTo']; + $req['PaidDescription'] = $reqData['description_paid']; + $req['VoucherNumber'] = $reqData['voucherNumber']; + $req['BranchCode'] = $reqData['branch']; + $req['Name'] = $reqData['name']; + $date = date('Y-m-d H:i:s'); + $req['UpdatedOn'] = $date; + $updatedayBookDetails = $this->daybook_model->update_NonOperationalDetails($req , $updateFor);// Check if the employee exist + if ($updatedayBookDetails) + { + $updatedayBookDetails['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($updatedayBookDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + } + else + { + // Set the response and exit + $this->response([ + 'message' => 'No list were found', + 'status' => REST_Controller::HTTP_NOT_FOUND + ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code + } + } + + + + + // add details daybook public function adddaybook_post() { $reqData = $this->post('data'); $reqbyData = $this->post('localReqDetails'); + + $req['Name'] = $reqData['name']; + $req['Type'] = $reqData['type']; + $req['Amount'] = $reqData['amount']; + // $d = new DateTime($reqData['date']); + $req['Date'] = $reqData['date']; + $req['Status'] = $reqData['status']; + $req['Description'] = $reqData['description']; + $req['BranchCode'] = $reqbyData['localBranchID']; + $req['CreatedBy'] = $reqbyData['localUserID']; + $req['PaidTo'] = $reqData['paidTo']; + $req['PaidDescription'] = $reqData['description_paid']; + $req['VoucherNumber'] = $reqData['voucherNumber']; + $date = date('Y-m-d H:i:s'); + $req['CreatedOn'] = $date; + + if($reqData['Isdaybook']==true) + { + $req['Isdaybook']=1; + } + else + { + $req['Isdaybook']=0; + } + // print_r($req);exit(); + $addDayBookDetails = $this->daybook_model->add_dayBook($req);// Check if the employee exist + if ($addDayBookDetails) + { + $addDayBookDetails['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($addDayBookDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + } + else + { + // Set the response and exit + $this->response([ + 'message' => 'No list were found', + 'status' => REST_Controller::HTTP_NOT_FOUND + ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code + } + } + + + + + // add details non operational + public function addNonOperational_post() { + + $reqData = $this->post('data'); + $reqbyData = $this->post('localReqDetails'); + $req['Name'] = $reqData['name']; $req['Type'] = $reqData['type']; $req['Amount'] = $reqData['amount']; @@ -272,7 +390,7 @@ class DayBook_Controller extends REST_Controller { $date = date('Y-m-d H:i:s'); $req['CreatedOn'] = $date; // print_r($req);exit(); - $addDayBookDetails = $this->daybook_model->add_dayBook($req);// Check if the employee exist + $addDayBookDetails = $this->daybook_model->add_NonOperational($req);// Check if the employee exist if ($addDayBookDetails) { $addDayBookDetails['status'] = REST_Controller::HTTP_OK; @@ -289,6 +407,9 @@ class DayBook_Controller extends REST_Controller { } } + + + public function updateDayBookStatusAdmin_post() { $reqData = $this->post('data'); @@ -381,8 +502,9 @@ class DayBook_Controller extends REST_Controller { $from = $this->post('from'); $to = $this->post('to'); $incid = 'I002'; + $branch = $this->post('branch'); - $getincomedetails = $this->daybook_model->getIncome_Details($from,$to,$incid); + $getincomedetails = $this->daybook_model->getIncome_Details($from,$to,$incid,$branch); // print_r($getincomedetails); // die(); @@ -405,6 +527,9 @@ class DayBook_Controller extends REST_Controller { $br = $this->post('branch'); // echo $from.'from'; // echo $to.'to'; + + + //echo $br;die(); $getStatus = $this->daybook_model->Income_expense($from,$to,$br); //print_r($getStatus); if ($getStatus) @@ -453,6 +578,34 @@ class DayBook_Controller extends REST_Controller { + public function GetPLforExcel_post() + { + + $from= $this->post('from'); + $to = $this->post('to'); + $branch = $this->post('branch'); + $getexceldet = $this->daybook_model->GetPLexcelDetails($from,$to,$branch); + + + if($getexceldet) + { + + $getexceldet['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($getexceldet, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + } + else + { + $this->response([ + 'message' => 'No records found!', + 'status' => REST_Controller::HTTP_NOT_FOUND + ], REST_Controller::HTTP_NOT_FOUND); + } + } + + + + public function getAllDayBookDetails_post() { diff --git a/Apollo/api/application/models/DayBook_model.php b/Apollo/api/application/models/DayBook_model.php index 64569e53..aa2d9fb6 100644 --- a/Apollo/api/application/models/DayBook_model.php +++ b/Apollo/api/application/models/DayBook_model.php @@ -115,6 +115,79 @@ class DayBook_model extends CI_Model return $results; } + + + + + public function get_Daybook_NonDetails_List($reqData, $reqDataBy) { + + + if($reqData['date'] != '' && $reqData['dateTo'] != '') { + // $this->db->select('t1.*, t2.ListName, t3.TypeName'); + // $this->db->from(''.DAYBOOKMASTER. ' as t1'); + // $this->db->join('' . PICK_LIST_DETAILS . ' as t2', 't2.ListCode = t1.Name', 'LEFT'); + // $this->db->join('' . INCOMEOUTCOMEMASTER . ' as t3', 't3.ID = t1.Type', 'LEFT'); + + $d = new DateTime($reqData['date']); + $dTo = new DateTime($reqData['dateTo']); + $fromDate = $d->format('Y-m-d'); + $toDate = $dTo->format('Y-m-d'); + $reqpayType = $reqDataBy['localBranchID']; + + $querys = "SELECT t1.ID as ORDER_ID, t1.*, t2.ListName, t3.TypeName + FROM ".NONOPERATIONAL." as t1 + LEFT JOIN ".PICK_LIST_DETAILS." as t2 ON t2.ListCode = t1.Name + LEFT JOIN ".INCOMEOUTCOMEMASTER." as t3 ON t3.ID = t1.Type AND t3.BranchCode = t1.BranchCode + + WHERE date_format(t1.CreatedOn,'%Y-%m-%d') BETWEEN '$fromDate' + + AND '$toDate' AND t3.TypeID != 'I001' and t3.TypeID !='I002' AND t1.BranchCode = '$reqpayType' ORDER BY ORDER_ID DESC"; +// echo $querys;exit(); + // $this->db->where(' STR_TO_DATE(t1.Date, %d-%m-%Y) >=', $fromDate); + // $this->db->where(' STR_TO_DATE(t1.Date, %d-%m-%Y) >=', $toDate); + // $this->db->where('t1.Date', $reqData['date']); + // $this->db->order_by('CreatedOn', 'DESC'); + // $this->db->where('t1.BranchCode', $reqDataBy['localBranchID']); + + } else { + // $this->db->select('t1.*, t2.ListName, t3.TypeName'); + // $this->db->from(''.DAYBOOKMASTER. ' as t1'); + // $this->db->join('' . PICK_LIST_DETAILS . ' as t2', 't2.ListCode = t1.Name', 'LEFT'); + // $this->db->join('' . INCOMEOUTCOMEMASTER . ' as t3', 't3.ID = t1.Type', 'LEFT'); + // // $this->db->where('t1.Date', $reqData['date']); + // $this->db->order_by('CreatedOn', 'DESC'); + // $this->db->where('t1.BranchCode', $reqDataBy['localBranchID']); + $reqpayType = $reqDataBy['localBranchID']; + $querys = "SELECT t1.ID as ORDER_ID, t1.*, t2.ListName, t3.TypeName, t5.Firstname as Approved_by_name , + t7.UniversityName as UniversityName, t6.CourseName as CourseName,t7.UniversityID,t8.Lastname,t8.MobileNumber + FROM ".DAYBOOKMASTER." as t1 + LEFT JOIN ".PICK_LIST_DETAILS." as t2 ON t2.ListCode = t1.Name + LEFT JOIN ".INCOMEOUTCOMEMASTER." as t3 ON t3.ID = t1.Type AND t3.BranchCode = t1.BranchCode + LEFT JOIN ".LOGIN." as t4 ON t4.ID = t1.Approval_By + LEFT JOIN ".STAFF." as t5 ON t5.StaffID = t4.StaffID + LEFT JOIN ".COURSE." as t6 ON t6.CourseID = t1.CourseID AND t6.BranchCode = t1.BranchCode + LEFT JOIN ".UNIVERSITY." as t7 ON t7.UniversityID = t6.UniversityID AND t7.BranchCode = t1.BranchCode + left join ".STUDENTS." as t8 on t8.StudentID = t1.StudentID + WHERE t1.BranchCode = '$reqpayType' AND t3.TypeID != 'I001' and t3.TypeID !='I002' ORDER BY ORDER_ID DESC"; + + } + + + + + // $this->db->join('' . COURSE . ' as t2', 't2.UniversityID = t1.UniversityID', 'LEFT'); + $dayBookDetails = $this->db->query($querys); + $dayBookDetailsList = $dayBookDetails->result(); + $results['dayBookListStatus'] = true; + $results['dayBookListDetails'] = $dayBookDetailsList; + + // print_r($this->db->last_query()); + // die(); + + return $results; + } + + public function get_Daybook_Approval_Details_List($reqData, $reqDataBy) { if($reqData['date'] != '' && $reqData['dateTo'] != '') { $d = new DateTime($reqData['date']); @@ -369,10 +442,89 @@ class DayBook_model extends CI_Model return $result; } + + + + + // update existing daybook details + public function update_NonOperationalDetails($Arr, $upFor) { + + $branch = $Arr['BranchCode']; + $sql = "SELECT * FROM ".NONOPERATIONAL." WHERE (BranchCode = '$branch' AND ID < '$upFor') + ORDER BY ID DESC + LIMIT 1 "; + $prevBalance = 0; + $latestUpdate = $this->db->query($sql); + $latestUpdateDetails = $latestUpdate->result(); + If(is_array($latestUpdateDetails) && count($latestUpdateDetails)>0) + { + $prevBalance = $latestUpdateDetails[0]->Balance; + }else{ + } + + if($Arr['Name'] == 'I002') { + //Income + $Arr['Balance'] = $prevBalance + $Arr['Amount']; + }else if ($Arr['Name'] == 'I001') { + //Expense + $Arr['Balance'] = $prevBalance - $Arr['Amount']; + } else { + $Arr['Balance'] = 0; + } + + $this->db->where('ID', $upFor); + $this->db->update(NONOPERATIONAL, $Arr); + if ($this->db->affected_rows() == '1') { + + $currBalance = 0; + $sql1 = "SELECT * FROM ".NONOPERATIONAL." WHERE BranchCode = '$branch' AND ID = '$upFor'"; + $latestUpdate1 = $this->db->query($sql1); + $latestUpdateDetails1 = $latestUpdate1->result(); + $currBalance = $latestUpdateDetails1[0]->Balance; + + $sql2 = "SELECT * FROM ".NONOPERATIONAL." WHERE (BranchCode = '$branch' AND ID > '$upFor') + ORDER BY ID ASC"; + $latestUpdate2 = $this->db->query($sql2); + $latestUpdateDetails2 = $latestUpdate2->result(); + + foreach( $latestUpdateDetails2 as $clip){ + if($clip->Name == 'I002' && ($clip->Status == "Pending" || $clip->Status == "Approved" || $clip->Status == "approved" || $clip->Status == "pending")) { + //Income + $currBalance = $currBalance + $clip->Amount; + }else if ($clip->Name == 'I001' && ($clip->Status == "Pending" || $clip->Status == "Approved" || $clip->Status == "approved" || $clip->Status == "pending")) { + //Expense + $currBalance = $currBalance - $clip->Amount; + } else { + } + $updateSql = "UPDATE ".NONOPERATIONAL." SET Balance ='$currBalance' WHERE ID = '$clip->ID'"; + $this->db->query($updateSql); + } + $result['updateDetailsStatus'] = true; + $result['message'] = "Successfully Details Updated"; + } else { + $result['updateDetailsStatus'] = false; + $result['message'] = "Something went wrong.please try again"; + } + return $result; + } + + + + + + + + + + + + // add dayBook public function add_dayBook($Arr) { $voucherNo = $Arr['VoucherNumber']; + + // $Arr['Isdaybook'] = '1'; $sqlCheck = "SELECT * FROM ".DAYBOOKMASTER." WHERE VoucherNumber = '$voucherNo'"; // print_r($this->db->query($sqlCheck));exit(); $checkAdd = $this->db->query($sqlCheck); @@ -418,6 +570,65 @@ class DayBook_model extends CI_Model return $result; } + + + + // add non operational + public function add_NonOperational($Arr) + { + $voucherNo = $Arr['VoucherNumber']; + $sqlCheck = "SELECT * FROM ".NONOPERATIONAL." WHERE VoucherNumber = '$voucherNo'"; + // print_r($this->db->query($sqlCheck));exit(); + $checkAdd = $this->db->query($sqlCheck); + $checkAddDetails = $checkAdd->result(); + if(count( $checkAddDetails ) > 0){ + $result['addDayBookStatus'] = false; + $result['message'] = "This Voucher Number Already Exist."; + }else{ + $branch = $Arr['BranchCode']; + $sql = "SELECT * FROM ".NONOPERATIONAL." WHERE BranchCode = '$branch' + ORDER BY ID DESC + LIMIT 1"; + $prevBalance = 0; + $latestUpdate = $this->db->query($sql); + $latestUpdateDetails = $latestUpdate->result(); + + If(is_array($latestUpdateDetails) && count($latestUpdateDetails)>0) + { + $prevBalance = $latestUpdateDetails[0]->Balance; + }else{ + } + + if($Arr['Name'] == 'I002') { + //Income + $Arr['Balance'] = $prevBalance + $Arr['Amount']; + }else if ($Arr['Name'] == 'I001') { + //Expense + $Arr['Balance'] = $prevBalance - $Arr['Amount']; + } else { + $Arr['Balance'] = 0; + } + + $this->db->insert(NONOPERATIONAL, $Arr); + if ($this->db->affected_rows() == '1') { + $result['addDayBookStatus'] = true; + $result['message'] = "Successfully DayBook Details Added"; + } else { + $result['addDayBookStatus'] = false; + $result['message'] = "Something went wrong.please try again"; + } +} + + return $result; + } + + + + + + + + // approve/reject status updation for the daybook expense details public function update_status_admin($arr) { @@ -675,9 +886,9 @@ class DayBook_model extends CI_Model FROM T_DayBookMaster AS p join T_PickListDetails on T_PickListDetails.ListCode = p.name - where str_to_date(Date,?)>=? and str_to_date(Date,?)<=? and p.IsActive=? and (p.Name=? or p.Name=?) and Status !=? + where str_to_date(Date,?)>=? and str_to_date(Date,?)<=? and p.IsActive=? and (p.Name=? or p.Name=?) and Status !=? and p.BranchCode=? and p.Isdaybook=? GROUP BY p.`Name`'; - $query = $this->db->query($subQuery,array($incomecode,$expensecode,$incomecode,$expensecode,'%d-%m-%Y',$fromd,'%d-%m-%Y',$tod,'1','I001','I002','Cancel')); + $query = $this->db->query($subQuery,array($incomecode,$expensecode,$incomecode,$expensecode,'%d-%m-%Y',$fromd,'%d-%m-%Y',$tod,'1','I001','I002','Cancel',$br,'1')); $expense = $query->result(); if(count($query)>0) @@ -685,47 +896,82 @@ class DayBook_model extends CI_Model $results['expense_data'] = $expense; } - //print_r( $this->db->last_query()); - +// print_r($this->db->last_query());die(); + + $subQueryNON= 'SELECT + DISTINCT(q.Name) AS TID,ListName,T_Income_Outcome_Master.TypeID as Orgtype, + SUM(IF(q.Name=?,Amount,0)) AS Income, + SUM(IF(q.Name=?,Amount,0)) AS Expense, + + SUM( CASE Name + WHEN ? THEN Amount + WHEN ? THEN Amount + END) AS Total + FROM T_NonOperationalMaster AS q + Join T_Income_Outcome_Master on T_Income_Outcome_Master.ID=q.Type + join T_PickListDetails on T_PickListDetails.ListCode = q.name + where str_to_date(Date,?)>=? and str_to_date(Date,?)<=? and q.IsActive=? and (q.Name=? or q.Name=?) + and Status !=? and q.BranchCode=? GROUP BY q.Name'; + + + $querynon = $this->db->query($subQueryNON,array($incomecode,$expensecode,$incomecode,$expensecode,'%d-%m-%Y',$fromd,'%d-%m-%Y',$tod,'1','I001','I002','Cancel',$br)); + $expensenon = $querynon->result(); + + if(count($querynon)>0) + { + $results['expense_data_nonop'] = $expensenon; + } + + //print_r($expensenon);die(); return $results; } - public function getIncome_Details($from,$to,$incid) + public function getIncome_Details($from,$to,$incid,$branch) { $fromd= date("Y-m-d",strtotime($from)); $tod=date("Y-m-d",strtotime($to)); $expid = 'I001'; - // $subQuery = 'select Name,T_DayBookMaster.ID,T_Income_Outcome_Master.TypeID as OrgType,T_Income_Outcome_Master.TypeName,SUM(Amount) as Tot_Amount,T_Income_Outcome_Master.ID as SID,T_Income_Outcome_Master.TypeName as Type,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 Name in (?,?) and str_to_date(date,?)>=? and str_to_date(date,?)<=? group by ListName'; - - // $query = $this->db->query($subQuery,array($incid,$expid,'%d-%m-%Y',$fromd,'%d-%m-%Y',$tod)); - - - $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!=? group by Type,Name'; +where str_to_date(date,?)>=? and str_to_date(date,?)<=? and Status!=? and T_DayBookMaster.BranchCode=? and T_DayBookMaster.Isdaybook=? group by Type,Name'; -$query = $this->db->query($subQuery,array('%d-%m-%Y',$fromd,'%d-%m-%Y',$tod,'Cancel')); - - - //print_r( $this->db->last_query()); - // die(); +$query = $this->db->query($subQuery,array('%d-%m-%Y',$fromd,'%d-%m-%Y',$tod,'Cancel',$branch,'1')); + $expense = $query->result(); - // print_r($expense); + if(count($query)>0) { $results['fullexpense_detail'] = $expense; - } + } + + + +$subQueryNON = 'select Name,sum(Amount) as Total,T_NonOperationalMaster.ID,T_Income_Outcome_Master.ID as SubID,T_Income_Outcome_Master.TypeID as OrgType,T_Income_Outcome_Master.TypeName,T_NonOperationalMaster.Date,Reason,T_NonOperationalMaster.Description,ListName +from T_NonOperationalMaster +left join T_Income_Outcome_Master on T_Income_Outcome_Master.ID = T_NonOperationalMaster.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_NonOperationalMaster.BranchCode=? group by Type,Name'; + + +$queryNon = $this->db->query($subQueryNON,array('%d-%m-%Y',$fromd,'%d-%m-%Y',$tod,'Cancel',$branch)); + + + $expenseNon = $queryNon->result(); + + + if(count($queryNon)>0) + { + $results['fullNonOpexpense_detail'] = $expenseNon; + } + return $results; @@ -735,6 +981,52 @@ $query = $this->db->query($subQuery,array('%d-%m-%Y',$fromd,'%d-%m-%Y',$tod,'Can } + +public function GetPLexcelDetails($from,$to,$branch) +{ + $fromd= date("Y-m-d",strtotime($from)); + $tod=date("Y-m-d",strtotime($to)); + + $subQuery='select + Name,sum(Amount) as Total ,Date,T_Income_Outcome_Master.ID,T_Income_Outcome_Master.TypeID as OrgType,T_Income_Outcome_Master.TypeName + from T_DayBookMaster + + Join T_Income_Outcome_Master on T_Income_Outcome_Master.ID= T_DayBookMaster.Type + where str_to_date(Date,?)>=? and str_to_date(Date,?)<=? and T_DayBookMaster.Isdaybook=? and T_DayBookMaster.BranchCode=? group by Name,Month(str_to_date(Date,?)) + union + select Name,sum(Amount) as Total,Date,T_Income_Outcome_Master.ID,T_Income_Outcome_Master.TypeID as OrgType,T_Income_Outcome_Master.TypeName from T_NonOperationalMaster + Join T_Income_Outcome_Master on T_Income_Outcome_Master.ID= T_NonOperationalMaster.Type + where str_to_date(Date,?)>=? + and str_to_date(Date,?)<=? + and T_NonOperationalMaster.BranchCode=? + group by Name,Month(str_to_date(Date,?)) + + '; + + + $query = $this->db->query($subQuery,array('%d-%m-%Y',$fromd,'%d-%m-%Y',$tod,'1',$branch,'%d-%m-%Y','%d-%m-%Y',$fromd,'%d-%m-%Y',$tod,$branch,'%d-%m-%Y')); + + + $expenseNon = $query->result(); + + + if(count($query)>0) + { + $results['exceldetails'] = $expenseNon; + } + + + return $results; + + + +} + + + + + + public function Income_expenseSubtype() { $this->db->select('ListCode,ListName,IsActive'); diff --git a/Apollo/assets/i18n/en.json b/Apollo/assets/i18n/en.json index cc2a51d1..40d48509 100755 --- a/Apollo/assets/i18n/en.json +++ b/Apollo/assets/i18n/en.json @@ -157,7 +157,8 @@ "DAYBOOKDETAILS": "Daybook Details", "DAYBOOKAPPROVAL": "Approve Expenses", "INCOMEEXPENSEREPORT" : "Proft/Loss Statement", - "DATACORRECTION" : "Bills Correction" + "DATACORRECTION" : "Bills Correction", + "NonOperational" : "Non Operational Entry" }, "mydetails": { "MAIN": "My Details" diff --git a/Apollo/assets/js/config.constant.js b/Apollo/assets/js/config.constant.js index ee716a2d..986eddc0 100755 --- a/Apollo/assets/js/config.constant.js +++ b/Apollo/assets/js/config.constant.js @@ -133,6 +133,10 @@ app.constant('JS_REQUIRES', { 'income_reportCtrl': 'assets/js/controllers/income_reportCtrl.js', /* + * */ + 'nonoperationalCtrl': 'assets/js/controllers/nonoperationalCtrl.js', + /* + * */ 'datacorrectionCtrl': 'assets/js/controllers/datacorrectionCtrl.js', diff --git a/Apollo/assets/js/config.router.js b/Apollo/assets/js/config.router.js index 233770c9..dd01217c 100755 --- a/Apollo/assets/js/config.router.js +++ b/Apollo/assets/js/config.router.js @@ -178,6 +178,14 @@ app.config(['$stateProvider', '$urlRouterProvider', '$controllerProvider', '$com ncyBreadcrumb: { label: 'income_expense' }, + }).state('app.daybooksuperadmin.nonoperational', { + url: '/nonoperational', + templateUrl: "assets/views/daybook/nonoperational.html", + resolve: loadSequence('nonoperationalCtrl','ngTable', 'ladda', 'angular-ladda'), + title: 'IncomeExpense', + ncyBreadcrumb: { + label: 'nonoperational' + }, }).state('app.entry.datacorrection', { url: '/datacorrection', templateUrl: "assets/views/data_correction.html", diff --git a/Apollo/assets/js/controllers/daybookCtrl.js b/Apollo/assets/js/controllers/daybookCtrl.js index 0cc8946c..ff0baff7 100644 --- a/Apollo/assets/js/controllers/daybookCtrl.js +++ b/Apollo/assets/js/controllers/daybookCtrl.js @@ -645,7 +645,8 @@ $scope.dayBookApprovalAccess = ''; "description": "", "paidTo": "", "description_paid": "", - "voucherNumber": "" + "voucherNumber": "", + "Isdaybook":"" } // add a new daybook entry diff --git a/Apollo/assets/js/controllers/daybookadminCtrl.js b/Apollo/assets/js/controllers/daybookadminCtrl.js index a4c9f791..82e9ddac 100644 --- a/Apollo/assets/js/controllers/daybookadminCtrl.js +++ b/Apollo/assets/js/controllers/daybookadminCtrl.js @@ -633,7 +633,8 @@ $scope.dayBookApprovalAccess = ''; "description": "", "paidTo": "", "description_paid": "", - "voucherNumber": "" + "voucherNumber": "", + "Isdaybook":"" } // add a new daybook entry diff --git a/Apollo/assets/js/controllers/daybooksuperadminCtrl.js b/Apollo/assets/js/controllers/daybooksuperadminCtrl.js index 41993fc6..bd23cfe0 100644 --- a/Apollo/assets/js/controllers/daybooksuperadminCtrl.js +++ b/Apollo/assets/js/controllers/daybooksuperadminCtrl.js @@ -772,12 +772,17 @@ $scope.loadStaring = true; "description": "", "paidTo": "", "description_paid": "", - "voucherNumber": "" + "voucherNumber": "", + "Isdaybook":"" } // add a new daybook entry $scope.daybookAdd = { submit: function (form, myModelAdd) { + +// console.log(myModelAdd); +// return false; + var firstError = null; if (form.$invalid) { var field = null, firstError = null; diff --git a/Apollo/assets/js/controllers/income_reportCtrl.js b/Apollo/assets/js/controllers/income_reportCtrl.js index c81bf6b5..0842e00a 100644 --- a/Apollo/assets/js/controllers/income_reportCtrl.js +++ b/Apollo/assets/js/controllers/income_reportCtrl.js @@ -91,8 +91,11 @@ app.controller('income_reportCtrl', ["$scope","$rootScope","toaster", "$filter", //alert($scope.batch.name); $scope.expense_data = ''; + $scope.nonexp_data =''; $scope.message = ''; $scope.incomedetail = ''; + $scope.nonopdetails =''; + $scope.Subtypes = ''; $scope.Total_expense = ''; $scope.Total_income = ''; @@ -104,6 +107,10 @@ app.controller('income_reportCtrl', ["$scope","$rootScope","toaster", "$filter", $scope.nonopinctotal=''; $scope.opexptotal=''; $scope.nonopexptotal=''; + $scope.Net_Total = ''; + $scope.PLexceldetails=''; + + var response_data = { @@ -126,9 +133,10 @@ app.controller('income_reportCtrl', ["$scope","$rootScope","toaster", "$filter", $http(response_data).then(function (response) { //console.log(response.data); if (response.data.status == '200') - { - + { + // console.log(response.data); $scope.expense_data = response.data.expense_data; + $scope.nonexp_data = response.data.expense_data_nonop; if($scope.expense_data.length>0) { @@ -141,49 +149,42 @@ app.controller('income_reportCtrl', ["$scope","$rootScope","toaster", "$filter", $scope.load = "No Records Found"; } - //console.log($scope.expense_data); - if(($scope.expense_data.length)==2) - { - - if($scope.expense_data[0].Total == 'undefined' || $scope.expense_data[0].Total == null) - { - $scope.Total_expense=0; - } - else - { - $scope.Total_expense = $scope.expense_data[0].Total; - } - - if($scope.expense_data[1].Total == 'undefined' || $scope.expense_data[1].Total == null) - { - $scope.Total_income=0; - } - else - { - $scope.Total_income = $scope.expense_data[1].Total; - } - - } + if($scope.expense_data != undefined || $scope.expense_data != '') + { - else - { - if($scope.expense_data[0].TID == 'I002') - { - $scope.Total_income = $scope.expense_data[0].Total; - $scope.Total_expense = 0; + angular.forEach(($scope.expense_data),function(expense_data,key) + { - } + if((expense_data.TID == 'I001')) + { + $scope.Total_expense = parseFloat(expense_data.Expense); - else - { - $scope.Total_expense = $scope.expense_data[0].Total; - $scope.Total_income = 0; - } - - } - $scope.Net_Total = $scope.Total_income -$scope.Total_expense; + //console.log($scope.Total_income) + + } + + + if((expense_data.TID == 'I002')) + { + $scope.Total_income = parseFloat(expense_data.Income); + //console.log($scope.Total_expense) + + } + + }); + + + } + + + + + + + + // $scope.Net_Total = $scope.Total_income -$scope.Total_expense; } @@ -215,49 +216,76 @@ app.controller('income_reportCtrl', ["$scope","$rootScope","toaster", "$filter", //console.log(response.data); if (response.data.status == '200') { + + //console.log(response.data); $scope.incomedetail = response.data; $scope.fullincomedetail = response.data.fullexpense_detail; - console.log($scope.fullincomedetail); + $scope.nonopdetails = response.data.fullNonOpexpense_detail; + // console.log($scope.fullincomedetail); $scope.opinctotal =0; $scope.nonopinctotal =0; $scope.opexptotal = 0; $scope.nonopexptotal =0; angular.forEach(($scope.fullincomedetail),function(fullincomedetail,key) { - //console.log('in') - if((fullincomedetail.Name == 'I002')&&(fullincomedetail.OrgType=='I002')) + if((fullincomedetail.Name == 'I002')) { $scope.opinctotal = parseFloat(fullincomedetail.Total)+parseFloat($scope.opinctotal); - - - } - - if((fullincomedetail.Name == 'I002')&&((fullincomedetail.OrgType=='I003')||(fullincomedetail.OrgType=='I004') - ||(fullincomedetail.OrgType=='I005')||(fullincomedetail.OrgType=='I006'))) - { - $scope.nonopinctotal = parseFloat(fullincomedetail.Total)+parseFloat($scope.nonopinctotal); - - + } - if((fullincomedetail.Name == 'I001')&&(fullincomedetail.OrgType=='I001')) + if((fullincomedetail.Name == 'I001')) { $scope.opexptotal = parseFloat(fullincomedetail.Total)+parseFloat($scope.opexptotal); - - } - - if((fullincomedetail.Name == 'I001')&&((fullincomedetail.OrgType=='I003')||(fullincomedetail.OrgType=='I004') - ||(fullincomedetail.OrgType=='I005')||(fullincomedetail.OrgType=='I006'))) - { - $scope.nonopexptotal = parseFloat(fullincomedetail.Total)+parseFloat($scope.nonopexptotal); - } }); + // console.log($scope.opinctotal) + + // console.log($scope.opexptotal) + + angular.forEach(($scope.nonopdetails),function(nonopdetails,key) + { + + if((nonopdetails.Name == 'I002')) + { + $scope.nonopinctotal = parseFloat(nonopdetails.Total)+parseFloat($scope.nonopinctotal); + + + } + + + if((nonopdetails.Name == 'I001')) + { + $scope.nonopexptotal = parseFloat(nonopdetails.Total)+parseFloat($scope.nonopexptotal); + + } + + }); + + // console.log($scope.nonopinctotal) + //console.log($scope.nonopexptotal) + + + $scope.Net_Total = (parseFloat($scope.opinctotal)+parseFloat($scope.nonopinctotal))- + + (parseFloat($scope.opexptotal)+parseFloat($scope.nonopexptotal) ); + +//console.log($scope.Net_Total) + +// console.log($scope.Total_income) + +// console.log($scope.nonopinctotal) + +// console.log($scope.Total_expense) + +// console.log($scope.nonopexptotal) + + @@ -306,7 +334,48 @@ app.controller('income_reportCtrl', ["$scope","$rootScope","toaster", "$filter", }); - } + + + var getexceldetails = { + method: 'POST', + url: apiPoint.url + 'GetPLforExcel/', + headers: { + 'Content-Type': 'application/json' + + }, + data: { + branch: JSON.parse(localStorage.getItem('localObj')).localBranchID, + from : $scope.filters.from_date, + to : $scope.filters.to_date + } + + + }; + + + $http(getexceldetails).then(function (response) { + // console.log(response.data); + if (response.data.status == '200') + { + $scope.PLexceldetails = response.data.exceldetails; + + //console.log($scope.PLexceldetails); + + } + else + { + $scope.message = response.data.message; + } + + }); + + + + + + + + } @@ -325,37 +394,36 @@ app.controller('income_reportCtrl', ["$scope","$rootScope","toaster", "$filter", }, }; + + + + $scope.Newexcel={ + // "OperationalIncome":"", + // "NonOperationalIncome":"", + // "OperationalExpense":"", + // "NonOperationalExpense":"", + + }; + // $scope.Newexcel=[]; $scope.exportData = function () { //alert() - angular.forEach(($scope.fullincomedetail),function(fullincomedetail,key) - { - //console.log($scope.fullincomedetail[key].TypeName); - if($scope.fullincomedetail[key].Name == 'I001') - { - $scope.fullincomedetail[key]['Type'] = 'Expense'; - } + $scope.Newexcel.OperationalIncome=$scope.opinctotal; + $scope.Newexcel.NonOperationalIncome=$scope.nonopinctotal; + $scope.Newexcel.OperationalExpense=$scope.opexptotal; + $scope.Newexcel.NonOperationalExpense=$scope.nonopexptotal; + - else if($scope.fullincomedetail[key].Name == 'I002') - { - $scope.fullincomedetail[key]['Type'] = 'Income'; - } - - - //console.log($scope.fullincomedetail); - - // alasql('SELECT Type,ListName,TypeName,Date,Amount INTO XLS("Income_Expense_report.xls",?) FROM ?',[mystyle,$scope.fullincomedetail]); - - - }); + console.log($scope.Newexcel); + //return false; //console.log($scope.fullincomedetail); - alasql('SELECT Type,ListName,TypeName,Date,Amount INTO XLS("Income Expense report.xls",?) FROM ?',[mystyle,$scope.fullincomedetail]); + alasql('SELECT * INTO XLS("Income Expense report.xls",?) FROM ?',[mystyle,$scope.Newexcel]); }; @@ -394,35 +462,21 @@ $scope.tdate =''; $scope.changeSem = function() { - $scope.open($scope.fullincomedetail,$scope.expense_data,$scope.Subtypes); + $scope.open($scope.fullincomedetail,$scope.nonopdetails,$scope.expense_data,$scope.nonexp_data,$scope.Subtypes); } var fm_date= ''; var Total_inc = 0; var Total_exp = 0; - $scope.open = function(incomeexpensedetails,incomeexpenselist,Subtypes) + $scope.open = function(incomeexpensedetails,nonopdetails,incomeexpenselist,nonexp_data,Subtypes) { - //Total_inc === incomeexpenselist[1].Total - if(incomeexpenselist[0] == 'undefined' || incomeexpenselist[0] == null) - { - Total_exp=0; - } - else - { - Total_exp = incomeexpenselist[0].Total; - } + + + // console.log(nonopdetails); - if(incomeexpenselist[1] == 'undefined' || incomeexpenselist[1] == null) - { - Total_inc=0; - } - else - { - Total_inc = incomeexpenselist[1].Total; - } - //console.log(incomeexpenselist[1]); + // console.log(nonexp_data); // var formate = "dd-MM-yyyy"; @@ -438,20 +492,23 @@ var Total_exp = 0; // console.log(incomeexpensedetails); // console.log(Subtypes); - // $scope.opinctotal =0; - // $scope.nonopinctotal =0; - // $scope.opexptotal = 0; - // $scope.nonopexptotal =0; + // $scope.opinctotal =0; + // $scope.nonopinctotal =0; + // $scope.opexptotal = 0; + // $scope.nonopexptotal =0; $rootScope.income_expendelist = incomeexpenselist; $rootScope.income_expensedetails = incomeexpensedetails; + + $rootScope.nonopeincexpdetails = nonopdetails; + $rootScope.listdetails = Subtypes; $rootScope.fdate = $scope.fdate; $rootScope.tdate = $scope.tdate $rootScope.net_totalamount = $scope.Net_Total; - $rootScope.opeinctot = $scope.opinctotal; + $rootScope.opeinctot = $scope.Total_income; $rootScope.nonopeinctot = $scope.nonopinctotal; - $rootScope.opeexptot = $scope.opexptotal; + $rootScope.opeexptot = $scope.Total_expense; $rootScope.nonopexptot = $scope.nonopexptotal; //$rootScope.sum = incomeexpenselist[1].Total - incomeexpenselist[0].Total; diff --git a/Apollo/assets/js/controllers/nonoperationalCtrl.js b/Apollo/assets/js/controllers/nonoperationalCtrl.js new file mode 100644 index 00000000..1fef8bae --- /dev/null +++ b/Apollo/assets/js/controllers/nonoperationalCtrl.js @@ -0,0 +1,1235 @@ +'use strict'; +/** + * daybook details capturing + * + */ +app.controller('nonoperationalCtrl', ["$scope", "$rootScope","$modal", "toaster", "$filter", "ngTableParams", "API_POINTS", "$localStorage", "$http", "$state", 'ipCookie', '$window', 'SweetAlert', '$timeout', function ($scope, $rootScope, $modal,toaster, $filter, ngTableParams, apiPoint, $localStorage, $http, $state, ipCookie, $window, SweetAlert, $timeout) { + + // get local client details + var localDetail = JSON.parse(localStorage.getItem('localObj')); + var localDetails = ipCookie('cookiechk'); + $scope.disableAddButton = false; + $scope.disableEditButton = false; + + + + + //In controller + $scope.exportAction = function () { + // alert(); + switch ('excel') { + case 'pdf': $scope.$broadcast('export-pdf', {}); + break; + case 'excel': $scope.$broadcast('export-excel', {}); + break; + case 'doc': $scope.$broadcast('export-doc', {}); + break; + default: console.log('no event caught'); + } + } + + + $scope.searchData = { + "date": "", + "dateTo": "" + } + + $scope.viewStudentDetailsPage = false; + // load when html page load + $scope.init = function () { + + + + console.log('in'); + if (localDetail != null) { + +//console.log(localDetails.localType);return false; + + if ((localDetails.localType === 'R004') || (localDetails.localType == 'R003')) { + + console.log('ioo') + // $scope.getBranchList(); + getDetails(); + } else { + ipCookie.remove('cookiechk'); + $window.localStorage.clear(); + $state.go('login.signin'); + } + } else { + } + } + + + // $scope.getBranchList = function () { + // $scope.loader = true; + // var empListreq = { + // method: 'POST', + // url: apiPoint.url + 'getBranchListDetails/', + // headers: { + // 'Content-Type': 'application/json' + // }, + // data: { + // data: localDetails + // } + // }; + // $http(empListreq).then(function (response) { + // if (response.data.branDetailstatus) { + // $scope.loader = false; + // $scope.branchList_data = response.data.branch_details; + // } else { + // } + // }); + // } + + // $scope.changeBranch = function () { + // $scope.viewStudentDetailsPage = false; + // localDetails.localBranchID = $scope.localBranchDetails; + // localDetail.localBranchID = $scope.localBranchDetails; + // getDetails() + // } + + function getDetails() { + $scope.todayDate = new Date(); + const LOCALTYPE = localDetail.localType; + if (LOCALTYPE === 'R004' || LOCALTYPE === 'R003') { + $scope.currentDate = new Date(); + var d = new Date(); + $scope.oneMonthBefore = d.setMonth(d.getMonth() - 1); + // alert($scope.oneMonthBefore); + var formate = "dd-MM-yyyy"; + $scope.searchData.date = $filter('date')(new Date($scope.oneMonthBefore), formate); + $scope.searchData.dateTo = $filter('date')(new Date($scope.currentDate), formate); + $scope.getDayBookList(); + $scope.getIncomeExpenseType_Status(); + $scope.viewStudentDetailsPage = true; + + } else { + ipCookie.remove('cookiechk'); + $window.localStorage.clear(); + $state.go('login.signin'); + } + } + + // get the data while page loading functions goes here + // $scope.init = function () { + // const LOCALTYPE = localDetail.localType; + // if(LOCALTYPE === 'R003') { + // $scope.currentDate = new Date(); + // var d = new Date(); + // $scope.oneMonthBefore = d.setMonth(d.getMonth()-1); + // // alert($scope.oneMonthBefore); + // var formate = "dd-MM-yyyy"; + // $scope.searchData.date = $filter('date')(new Date($scope.oneMonthBefore), formate); + // $scope.searchData.dateTo = $filter('date')(new Date($scope.currentDate), formate); + // $scope.getDayBookList(); + // $scope.getIncomeExpenseType_Status(); + + // }else {alert(); + // ipCookie.remove('cookiechk'); + // $window.localStorage.clear(); + // $state.go('login.signin'); + // } + // } + + $scope.dayBookApprovalAccess = ''; + // Finance module access control + function getFinanceModuleAccess() { + var getFinacnceModuleAcccessCtrl = { + method: 'POST', + url: apiPoint.url + 'empDayBookModuleAccessChk/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + localReqDetails: localDetails + } + }; + $http(getFinacnceModuleAcccessCtrl).then(function (response) { + if (response.data.dayBkAccessChkStatus) { + $scope.dayBookApprovalAccess = response.data.dayBkAccessChk_Value; + $scope.currentDate = new Date(); + var formate = "dd-MM-yyyy"; + $scope.searchData.date = $filter('date')(new Date($scope.currentDate), formate); + $scope.searchData.dateTo = $filter('date')(new Date($scope.currentDate), formate); + $scope.getDayBookList(); + $scope.getIncomeExpenseType_Status(); + return true; + } else { + return true; + } + }); + + } + + // $scope.getApproveLoad = function() { + // alert(); + // } + + // change from date, update and call search functionality + $scope.changeDate = function () { + if ($scope.searchData.date !== undefined) { + var formate = "dd-MM-yyyy"; + $scope.searchData.date = $filter('date')(new Date($scope.searchData.date), formate); + $scope.getDayBookList(); + } else { + $scope.searchData.date = ''; + $scope.getDayBookList(); + } + } + + // change to date, update and call search functionality + $scope.changeToDate = function () { + if ($scope.searchData.dateTo !== undefined) { + var formate = "dd-MM-yyyy"; + $scope.searchData.dateTo = $filter('date')(new Date($scope.searchData.dateTo), formate); + $scope.getDayBookList(); + } else { + $scope.searchData.dateTo = ''; + $scope.getDayBookList(); + } + } + + // sorting function for table params + $scope.sort = function (keyname) { + $scope.sortKey = keyname; //set the sortKey to the param passed + $scope.reverse = !$scope.reverse; //if true make it false and vice versa + } + + + + + + + $scope.noRecordFound = true; + $scope.dataLength = 0; + + // get day book type name list + $scope.getDayBookList = function () { + var getDatBookListDetails = { + method: 'POST', + url: apiPoint.url + 'getNonDayBookDetails/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + data: $scope.searchData, + localReqDetails: localDetails, + } + }; + $http(getDatBookListDetails).then(function (response) { + if (response.data.dayBookListStatus) { + + $scope.data = response.data.dayBookListDetails; + $scope.datas = response.data.dayBookListDetails; + // alert(JSON.stringify($scope.data)); + console.log($scope.data); + + $scope.dataLength = $scope.data.length; + if ($scope.data.length !== 0) { + $scope.noRecordFound = false; + } else { + $scope.noRecordFound = true; + } + // alert(JSON.stringify($scope.data)); + // $scope.incomeExpenseType = response.data.typeNameList; + } else { + + } + }); + } + + + + //print PDF -------- START ============================================================================== + + var rows1 = ''; + + $scope.paymentOptions = [ + { + "paymentOn": "CASH" + }, + { + "paymentOn": "CHEQUE" + }, + { + "paymentOn": "REFERRAL" + }, + { + "paymentOn": "ONLINE TRANSACTION" + }, + { + "paymentOn": "WAIVER" + }, + { + "paymentOn": "Credit/Debit Card" + } + + ]; + + function getSortCutModeofPayment(type) { + var sortCutName = ''; + switch (type) { + case 'CASH': + sortCutName = 'CH'; + break; + case 'CHEQUE': + sortCutName = 'CHQ'; + break; + case 'REFERRAL': + sortCutName = 'REF'; + break; + case 'ONLINE TRANSACTION': + sortCutName = 'ONL'; + break; + case 'WAIVER': + sortCutName = 'WAI'; + break; + case 'Credit/Debit Card': + sortCutName = 'CARD'; + break; + default: + sortCutName = type; + } + return sortCutName; + } + + + $scope.generatePFD = function (datas) { +$scope.loadStaring = true; + // daybookDetails.generatePFD(datas,$scope.searchData.date, $scope.searchData.dateTo); + + var o = {}; + var intDataSNo = 1; + var intDate = 0; + // var arrForeach = datas.reverse(); + // for() + // var ememem = datas[7-1]; + // alert(ememem.VoucherNumber); + // for(var i = datas.length ; i > 0; --i){ + for(var i = 0 ; i <= datas.length-1; ++i){ + var element = datas[i]; + //var element = datas[i-1]; + var value = {}; + var Lastname=''; + if(element.Lastname != null) + { + var Lastname = element.Lastname; + } + value['SNo'] = element.ORDER_ID; + value['Date'] = element.VoucherNumber + '\n/' + element.Date || '-'; + var ListName = element.ListName; + value['PaidReceivedToFrom'] = element.PaidTo +' ' +Lastname || '-'; + var Sem = element.FeePaymentDetails || '-'; + var Course = element.CourseName || '-'; + var University = element.UniversityName || '-'; + value['UnivCourseSem'] = University.concat('/ ' + Course, '/ ' + Sem); + value['Type'] = element.TypeName || '-'; + value['ReceiptNo'] = element.ReceiptNo || '-'; + value['Comments'] = element.ReceiptNoComments || '-'; + value['ModeofPayment'] = getSortCutModeofPayment(element.ModeOfPayment) || '-'; + value['Status'] = element.Status || '-'; + value['Amount'] = (ListName == 'Expense' ? '-' : '+') + ' ' + element.Amount || '-'; + value['Balance'] = element.Balance || '-'; + + o[intDate] = value; + intDate++; + intDataSNo++; + } + // alert(JSON.stringify(o)); + // arrForeach.forEach(function (element) { + // var value = {}; + // value['SNo'] = intDataSNo; + // value['Date'] = element.VoucherNumber + '\n/' + element.Date || '-'; + // var ListName = element.ListName; + // value['PaidReceivedToFrom'] = element.PaidTo || '-'; + // var Sem = element.FeePaymentDetails || '-'; + // var Course = element.CourseName || '-'; + // var University = element.UniversityName || '-'; + // value['UnivCourseSem'] = University.concat('/ ' + Course, '/ ' + Sem); + // value['Type'] = element.TypeName || '-'; + // value['ReceiptNo'] = element.ReceiptNo || '-'; + // value['Comments'] = element.ReceiptNoComments || '-'; + // value['ModeofPayment'] = getSortCutModeofPayment(element.ModeOfPayment) || '-'; + // value['Amount'] = (ListName == 'Expense' ? '-' : '+') + ' ' + element.Amount || '-'; + // value['Balance'] = element.Balance || '-'; + // o[intDate] = value; + // intDate++; + // intDataSNo++; + // }); + rows1 = o; + var headers = { + fila_1: { + col_1: { text: 'SNo', style: 'tableHeader', alignment: 'center', bold: true }, + col_2: { text: 'Voucher Number Bill Number / DATE', style: 'tableHeader', alignment: 'center', bold: true }, + col_3: { text: 'Paid To Received From', style: 'tableHeader', alignment: 'center', bold: true }, + col_4: { text: 'University / Course/ Sem', style: 'tableHeader', alignment: 'center', bold: true }, + col_5: { text: 'Type', style: 'tableHeader', alignment: 'center', bold: true }, + col_6: { text: 'Receipt No', style: 'tableHeader', alignment: 'center', bold: true }, + // col_7: { text: 'Comments', style: 'tableHeader', alignment: 'center', bold: true }, + col_7: { text: 'Mode of Payment', style: 'tableHeader', alignment: 'center', bold: true }, + col_8: { text: 'Status', style: 'tableHeader', alignment: 'center', bold: true }, + col_9: { text: 'Amount', style: 'tableHeader', alignment: 'center', bold: true }, + col_10: { text: 'Balance', style: 'tableHeader', alignment: 'center', bold: true }, + col_11: { text: 'Comments', style: 'tableHeader', alignment: 'center', bold: true }, + } + } + var body = []; + for (var key in headers) { + if (headers.hasOwnProperty(key)) { + var header = headers[key]; + var row = new Array(); + row.push(header.col_1); + row.push(header.col_2); + row.push(header.col_3); + row.push(header.col_4); + row.push(header.col_5); + row.push(header.col_6); + row.push(header.col_7); + row.push(header.col_8); + row.push(header.col_9); + row.push(header.col_10); + row.push(header.col_11); + body.push(row); + } + } + for (var key in rows1) { + if (rows1.hasOwnProperty(key)) { + var data = rows1[key]; + var row = new Array(); + row.push(data.SNo.toString()); + row.push(data.Date.toString()); + row.push(data.PaidReceivedToFrom.toString()); + row.push(data.UnivCourseSem.toString()); + row.push(data.Type.toString()); + row.push(data.ReceiptNo.toString()); + // row.push(data.Comments.toString()); + row.push(data.ModeofPayment.toString()); + row.push(data.Status.toString()); + row.push(data.Amount.toString()); + row.push(data.Balance.toString()); + row.push(data.Comments.toString()); + body.push(row); + } + } + + + var docDefinition = { + pageMargins: [10, 85, 20, 50], + pageOrientation: 'landscape', + header: function () { + return { + margin: 0, + columns: [ + { + text: ['DAYBOOK DETAILS' + '( ' + $scope.searchData.date + ' - ' + $scope.searchData.dateTo + ' )'], + alignment: 'left', bold: true, margin: [20, 30, 0, 0], fontSize: 18 + } + ] + } + }, + footer: function (currentPage, pageCount) { + if (currentPage === pageCount) { + return { + columns: [ + { + text: ['Note :' + '\n\t\t\t\t\t\t CH-CASH, CHQ-CHEQUE, REF-REFERRAL, ONL-ONLINE TRANSACTION, WAI-WAIVER, CARD-Credit/Debit Card'], + alignment: 'left', margin: [10, 0, 0, 0], fontSize: 8 + }, + { text: ['\n Page ' + currentPage.toString() + ' of ' + pageCount], alignment: 'right', margin: [0, 10, 10, 0], fontSize: 10 } + ] + }; + } else { + return { + text: 'Page ' + currentPage.toString() + ' of ' + pageCount, alignment: 'right', margin: [0, 10, 10, 0], fontSize: 10 + }; + } + }, + content: [ + { + // layout: 'lightHorizontalLines', // optional + table: { + // headers are automatically repeated if the table spans over multiple pages + // you can declare how many rows should be treated as headers + // headerRows: 1, + // widths: [ '40', '40', '40', '40', '40'], + headerRows: 1, + keepWithHeaderRows: 0, + body: body + }, + layout: { + hLineWidth: function (i, node) { + return 0.5; + }, + vLineWidth: function (i, node) { + // return (i === 0 || i === node.table.widths.length) ? 0 : 40; + return 0.5; + }, + hLineColor: function (i, node) { + return '#2D4D81'; + }, + vLineColor: function (i, node) { + return '#2D4D81'; + }, + } + } + ], + styles: { + header: { + fontSize: 12, + bold: true + }, + subheader: { + fontSize: 12, + bold: true + }, + quote: { + italics: true + }, + small: { + fontSize: 6 + }, + sta: { + fontSize: 8, + bold: false, + alignment: 'justify' + } + } + }; + + // alert(JSON.stringify(rows1)); + // var returndata = pdfMake.createPdf(docDefinition).download('DAYBOOK DETAILS' + '( ' + $scope.searchData.date + ' - ' + $scope.searchData.dateTo + ' ).pdf', function(){ + // return true; + // }); + // pdfMake.createPdf(docDefinition).getDataUrl(function(url) { alert('your pdf is done'); }); + pdfMake.createPdf(docDefinition).download('DAYBOOK DETAILS' + '( ' + $scope.searchData.date + ' - ' + $scope.searchData.dateTo + ' ).pdf', function(res) { + if(res === 'success'){ + $scope.$apply(function(){ + $scope.loadStaring = false; + }); + }else{ + $scope.$apply(function(){ + $scope.loadStaring = false; + }); + } + }); + + // if(returndata === 1){ + // $scope.loadStaring = false; + // } + + // if(returndata){ + // $scope.loadStaring = false; + // } + // pdfMake.createPdf(docDefinition).print(); + + // $scope.loadStaring = false; + // pdfMake.createPdf(docDefinition).open(); + } + + + + // print PDF-------- END ============================================================================== + + // income expense type status list + $scope.getIncomeExpenseType_Status = function () { + var getIncomeExpenseType = { + method: 'POST', + url: apiPoint.url + 'getIncomeExpenseTypeState/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + localReqDetails: localDetails + } + }; + $http(getIncomeExpenseType).then(function (response) { + if (response.data.typeNameStatus) { + $scope.incomeExpenseName = response.data.typeList; + $scope.incomeExpenseType = response.data.typeNameList; + + + // console.log(response.data.typeList); + // console.log(response.data.typeNameList); + + } + }); + } + + // parse the income and expense type from the list + $scope.getType = function (type) { + $scope.getIncomeTypes = $scope.incomeExpenseName.filter(function (val) { + return val.TypeID === 'I002' ? 1 : 0; + }); + $scope.getExpenseTypes = $scope.incomeExpenseName.filter(function (val) { + return val.TypeID === 'I001' ? 1 : 0; + }); + + $scope.getExpenseTypes = $scope.incomeExpenseName.filter(function (val) { + return val.TypeID === 'I003' ? 1 : 0; + }); + + $scope.getExpenseTypes = $scope.incomeExpenseName.filter(function (val) { + return val.TypeID === 'I004' ? 1 : 0; + }); + + $scope.getExpenseTypes = $scope.incomeExpenseName.filter(function (val) { + return val.TypeID === 'I005' ? 1 : 0; + }); + + $scope.getExpenseTypes = $scope.incomeExpenseName.filter(function (val) { + return val.TypeID === 'I006' ? 1 : 0; + }); + + + + + $scope.myModelAdd.type = ''; + $scope.getTypes = type === 'I002' ? $scope.getIncomeTypes : $scope.getExpenseTypes; + + }; + + $scope.editId = -1; + $scope.setEditId = function (P) { + //alert(id); + $scope.editId = P; + } + + $scope.editClose = function () { + $scope.editId = -1; + $scope.myModel = { + "id": "", + "date": "", + "incomeExpense": "", + "type": "", + "amount": "", + "status": "", + "description": "", + "paidTo": "", + "description_paid": "", + "voucherNumber": "", + "branch": "", + "name": "" + } + } + + $scope.myModel = { + "id": "", + "date": "", + "incomeExpense": "", + "type": "", + "amount": "", + "status": "", + "description": "", + "paidTo": "", + "description_paid": "", + "voucherNumber": "", + "branch": "", + "name": "" + } + + $scope.copyModel = function (p) { + var inc = $scope.incomeExpenseType.filter((inc) => inc.ID == p.Type); + $scope.incexp = inc[0]; + $scope.myModel = { + "id": p.ID, + "date": p.Date, + "incomeExpense": p.Name, + "type": $scope.incexp.ID, + "amount": p.Amount, + "status": p.Status, + "description": p.Description, + "paidTo": p.PaidTo, + "description_paid": p.PaidDescription, + "voucherNumber": p.VoucherNumber, + "branch": p.BranchCode, + "name": p.Name + + } + // alert(JSON.stringify($scope.myModel)); + } + + + $scope.deleted1 = function (id) { + var id = id; + var reason = prompt("Reason For Deletion!", ""); + + if(reason!=null) + { + $scope.deleteFeePayableEntry(reason, id); + } + //console.log($scope.deleteFeePayableEntry) + + + } + //delete the income entry From the fees payable + $scope.deleteFeePayableEntry = function (reason, id) { + // alert(id); + if(reason != ''){ + SweetAlert.swal({ + title: "Warning!", + text: "Do you want to Delete this Entry ?", + type: "warning", + showCancelButton: true, + confirmButtonColor: "#007aff", + confirmButtonText: "Yes!" + }, function (res) { + + //console.log(res); + + if (res === true) { + // alert(reason); + //alert(stuId); +// + if(reason == '') + { + + + + //reason = prompt("Reason For Deletion!", ""); + + //$scope.deleteFeePayableEntry(reason, $scope.ID); + + // swal("Please Enter Reason!", "", "error"); + + return false; + } + else{ + + + + var deleteFeePayableDetails = { + method: 'POST', + url: apiPoint.url + 'deleteDayBookFeePayableDetails/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + reason: reason, + data: id, + requestDetails: localDetails + } + }; + $http(deleteFeePayableDetails).then(function (response) { + if (response.data.deletedStatus) { + swal(" ", "Deleted Successfully.", "success"); + $scope.getDayBookList(); + } else { + swal(" ", response.data.message, "error"); + } + }); + + } + } + }); + }else{ + swal(" ","Reason is Mandatorary","error"); + } + } + + + + $scope.deleted = function (id) { + + var id = id; + var a = prompt("Enter Reason!", ""); + $scope.deleEditEntry(a, id); + + + + } + // delete the income/expense list row + $scope.deleEditEntry = function (a, id) { + swal({ + + title: "Are you sure?", + text: "Your will not be able to recover this record!", + type: "warning", + showCancelButton: true, + confirmButtonClass: "btn-danger", + confirmButtonText: "Yes, delete it!", + closeOnConfirm: false + }, + function () { + $scope.indexDelete2(a, id); + }); + $scope.indexDelete2 = function (a, id) { + var deleteDetails = { + method: 'POST', + url: apiPoint.url + 'deleteDayBookDetails/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + reason: a, data: id, + requestDetails: localDetails + } + }; + $http(deleteDetails).then(function (response) { + if (response.data.deletedStatus) { + swal(" ", "Deleted Successfully.", "success"); + $scope.getDayBookList(); + } else { + swal(" ", response.data.message, "error"); + } + }); + } + } + + $scope.myModelAdd = { + "id": "", + "date": "", + "name": "", + "type": "", + "amount": "", + "status": "", + "description": "", + "paidTo": "", + "description_paid": "", + "voucherNumber": "" + } + + // add a new daybook entry + $scope.daybookAdd = { + submit: function (form, myModelAdd) { + + //alert();return false; + var firstError = null; + if (form.$invalid) { + var field = null, firstError = null; + for (field in form) { + if (field[0] != '$') { + if (firstError === null && !form[field].$valid) { + firstError = form[field].$name; + } + if (form[field].$pristine) { + form[field].$dirty = true; + } + } + } + angular.element('.ng-invalid[name=' + firstError + ']').focus(); + // swal("The form cannot be submitted because it contains validation errors!", "Errors are marked with a red, dashed border!", "error"); + } else { + var sdate = $('#date').val(); + $scope.disableAddButton = true; + var formate = "dd-MM-yyyy"; + $scope.myModelAdd.date = sdate; + //$scope.myModelAdd.date = $filter('date')(new Date($scope.myModelAdd.date), formate); + // $scope.myModelAdd.status = $scope.myModelAdd.name == 'I001' ? 'Pending' : 'Approved'; + $scope.myModelAdd.status = 'Approved'; + // $scope.data.push(myModelAdd); + + var addDayBookDetails = { + method: 'POST', + url: apiPoint.url + 'addNonOperational/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + data: myModelAdd, + localReqDetails: localDetails + } + }; + $http(addDayBookDetails).then(function (response) { + if (response.data.addDayBookStatus) { + swal(" ", "Income/Expense added successfully.", "success"); + $state.go($state.current, {}, { reload: true }); + $scope.viewStudentDetailsPage = false; + // $scope.myActivateDiv(); + $scope.disableAddButton = false; + } else { + swal(" ", response.data.message, "error"); + $scope.disableAddButton = false; + } + }); + } + }, + reset: function (form) { + form.$setPristine(true); + $scope.myModelAdd = { + "id": "", + "date": "", + "name": "", + "type": "", + "amount": "", + "status": "", + "description": "", + "paidTo": "", + "description_paid": "", + "voucherNumber": "" + } + } + } + + + // $scope.myActivateDiv = function () { + // $scope.viewStudentDetailsPage = false; + // $scope.myModelAdd = { + // "id": "", + // "date": "", + // "name": "", + // "type": "", + // "amount": "", + // "status": "", + // "description": "", + // "paidTo": "", + // "description_paid": "", + // "voucherNumber": "" + // } + + // $timeout(function () { + // getDetails(); + // }, 1000); + // } + + + // update a daybook entry details + $scope.daybookeditUpdate = { + submit: function (form, myModel) { + + // alert('update'); + + // return false; + var firstError = null; + if (form.$invalid) { + + var field = null, firstError = null; + for (field in form) { + if (field[0] != '$') { + if (firstError === null && !form[field].$valid) { + firstError = form[field].$name; + } + if (form[field].$pristine) { + form[field].$dirty = true; + } + } + } + angular.element('.ng-invalid[name=' + firstError + ']').focus(); + swal("The form cannot be submitted because it contains validation errors!", "Errors are marked with a red, dashed border!", "error"); + } else { + // alert(JSON.stringify($scope.myModel));exit(); + $scope.disableEditButton = true; + var updateDayBookDetails = { + method: 'POST', + url: apiPoint.url + 'updateNonOperationalDetails/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + data: $scope.myModel, + requestDetails: localDetails + } + }; + $http(updateDayBookDetails).then(function (response) { + if (response.data.updateDetailsStatus) { + swal(" ", "Updated successfully.", "success"); + // for success state + $scope.editId = -1; + $scope.getDayBookList(); + $scope.disableEditButton = false; + } else { + swal(" ", response.data.message, "error"); + $scope.disableEditButton = false; + } + }); + } + } + } + + + function styleXl() { + var mystyle = { + sheetid: 'DAYBOOK DETAILS', + headers: true, + caption: { + title: 'DAYBOOK DETAILS' + '(' + $scope.searchData.date + ' - ' + $scope.searchData.dateTo + ')', + width: '300px', + style: 'font-size:50px;color:blue;' + }, + // style:'background:#00FF00', + column: { + style: 'font-size:11px; color:blue;' + } + }; + return mystyle; + } + $scope.exportData = function () { + alasql('SELECT Date as Date, ListName as IncomeExpense, VoucherNumber as VoucherNumberBillNumber, concat( PaidTo,Lastname )as PaidToReceivedFrom,FeePaymentDetails as Sem, CourseName as Course,UniversityName as University,TypeName as Type, ReceiptNo as Receipt_No, ModeOfPayment as Mode_of_Payment,Amount as Amount,Balance as Balance, ReceiptNoComments as Comments, Reason, Activity INTO XLS("daybook_details.xls",?) FROM ?', [styleXl(), $scope.data]); + }; + + //Modal for bill details + $rootScope.bill_Details = ''; + $scope.billDetails = function(p){ + + //$rootScope.student = $scope.selectedStudentsID; + + //$rootScope.controller = 'ng-controller="daybooksuperadminCtrl"'; + console.log(p); + $scope.bNo=p; + + //request to get bill details + var toMerge = { + method: 'POST', + url: apiPoint.url + 'billModal/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + billNo:$scope.bNo, + + } + }; + $http(toMerge).then(function (response) { + if (response.data.List == true) { + $rootScope.bill_Details = response.data.bill_Details; + } else { + $scope.message = response.data.message; + } + + }); + //open bill details in modal + $rootScope.modalInstance = $modal.open({ + templateUrl: 'assets/views/Daybook_billDetails_modal.html', + // controller: 'daybooksuperadminCtrl', + // size: size, + + + }); + + $rootScope.modalInstance.result.then(function (selectedItem) { + $scope.selected = selectedItem; + }, function () { + //$log.info('Modal dismissed at: ' + new Date()); + }); + + + + + +} + //End of modal for bill details + $scope.searchData = { + 'University': '', + 'Course': '', + 'Batch': '', + 'Mobile': '', + 'Name': '' + } + + $scope.studentDetails='';$scope.studentDetails + +$scope.searchResultDetails =''; + $scope.open = function (studentDetails) { + + //alert(JSON.stringify(studentDetails)); + + var studentallDetails = { + method: 'POST', + url: apiPoint.url + 'getStudentAllInfo/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + mobileNumber :studentDetails.MobileNumber, + requestedFrom: 3, + branchCode:JSON.parse(localStorage.getItem('localObj')).localBranchID + } + }; + $http(studentallDetails).then(function (response) { + + console.log(response.data.details); + + if (response.data.status == 200) { + + $scope.studentDetails=response.data.details; + + + } else { + swal("Failed!", "No details Availble", "warning"); + + + } + + + }); + + + + + // get student view details + var getcourse = { + method: 'POST', + url: apiPoint.url + 'getStudentBasicInfo/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + requestedBy :studentDetails.MobileNumber, + requestedFrom: 3, + branchCode:JSON.parse(localStorage.getItem('localObj')).localBranchID + } + }; + $http(getcourse).then(function (response) { + + if (response.data.status == 200 && response.data.studentStatus== true) { + $scope.courseEditLoading = false; + // $scope.studentDetails = response.data.studentDetails; + $scope.studentDetails = response.data; + // $scope.courseDetails = response.data.courseDetails; + + console.log($scope.studentDetails.studentDetails); + var modalInstance = $modal.open({ + templateUrl: 'assets/views/student/studentDetailsModal.html', + controller: 'ModalInstanceCtrl', + // size: size, + resolve: { + items: function () { + return $scope.studentDetails; + } + } + }); + + modalInstance.result.then(function (selectedItem) { + $scope.selected = selectedItem; + }, function () { + $log.info('Modal dismissed at: ' + new Date()); + }); + + } else { + swal("Failed!", "This student is not registerd", "warning"); + $scope.courseEditLoading = false; + $scope.studentDetails = ""; + $scope.courseDetails = ""; + + } + }); + + + }; + + +}]); + + +app.controller('ModalInstanceCtrl', ["$scope", "$modalInstance", "items","WordsService", function ($scope, $modalInstance, items,WordsService) { + + $scope.items = items; + $scope.selected = { + item: $scope.items[0] + }; + + $scope.ok = function () { + $modalInstance.close($scope.selected.item); + }; + + $scope.cancel = function () { + $modalInstance.dismiss('cancel'); + }; + + +}]); + + + + +/*modal controller + * */ +app.controller('studentModalDemoCtrl', ["$scope", "$rootScope", "$modal", "$log", "API_POINTS", "$http", function ($scope, $rootScope, $modal, $log,apiPoint,$http) { + //Tooltip for print button + + $scope.studentDetails='';$scope.studentDetails + +$scope.searchResultDetails =''; + $scope.open = function (studentDetails) { + + // alert(JSON.stringify(studentDetails)); + + var studentallDetails = { + method: 'POST', + url: apiPoint.url + 'getStudentAllInfo/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + mobileNumber :studentDetails.MobileNumber, + requestedFrom: 3, + branchCode:JSON.parse(localStorage.getItem('localObj')).localBranchID + } + }; + $http(studentallDetails).then(function (response) { + + console.log(response.data.details); + + if (response.data.status == 200) { + + $scope.studentDetails=response.data.details; + + + } else { + swal("Failed!", "No details Availble", "warning"); + + + } + + + }); + + + + + // get student view details + var getcourse = { + method: 'POST', + url: apiPoint.url + 'getStudentBasicInfo/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + requestedBy :studentDetails.MobileNumber, + requestedFrom: 3, + branchCode:JSON.parse(localStorage.getItem('localObj')).localBranchID + } + }; + $http(getcourse).then(function (response) { + + if (response.data.status == 200 && response.data.studentStatus== true) { + $scope.courseEditLoading = false; + // $scope.studentDetails = response.data.studentDetails; + $scope.studentDetails = response.data; + // $scope.courseDetails = response.data.courseDetails; + + console.log($scope.studentDetails.studentDetails); + var modalInstance = $modal.open({ + templateUrl: 'assets/views/student/studentDetailsModal.html', + controller: 'ModalInstanceCtrl', + // size: size, + resolve: { + items: function () { + return $scope.studentDetails; + } + } + }); + + modalInstance.result.then(function (selectedItem) { + $scope.selected = selectedItem; + }, function () { + $log.info('Modal dismissed at: ' + new Date()); + }); + + } else { + swal("Failed!", "This student is not registerd", "warning"); + $scope.courseEditLoading = false; + $scope.studentDetails = ""; + $scope.courseDetails = ""; + + } + }); + + + }; + + +}]); + + + + diff --git a/Apollo/assets/views/daybook/daybook.html b/Apollo/assets/views/daybook/daybook.html index e1e09fa6..18241179 100755 --- a/Apollo/assets/views/daybook/daybook.html +++ b/Apollo/assets/views/daybook/daybook.html @@ -281,7 +281,7 @@ - + @@ -473,6 +473,29 @@ Invalid Comments + + + + +
+ + +
+ + +
+ + +
+ + + + +
diff --git a/Apollo/assets/views/daybook/daybookadmin.html b/Apollo/assets/views/daybook/daybookadmin.html index 4e6d70ff..2fef0493 100755 --- a/Apollo/assets/views/daybook/daybookadmin.html +++ b/Apollo/assets/views/daybook/daybookadmin.html @@ -288,7 +288,7 @@ - + @@ -488,6 +488,31 @@ Invalid Comments + + + + +
+ + +
+ + +
+ + +
+ + + + + + +
diff --git a/Apollo/assets/views/daybook/daybooksuperadmin.html b/Apollo/assets/views/daybook/daybooksuperadmin.html index ded62259..8d24872a 100755 --- a/Apollo/assets/views/daybook/daybooksuperadmin.html +++ b/Apollo/assets/views/daybook/daybooksuperadmin.html @@ -278,7 +278,7 @@ - + @@ -469,6 +469,29 @@ Invalid Comments + + + +
+ + +
+ + +
+ + +
+ + + + + +
diff --git a/Apollo/assets/views/daybook/nonoperational.html b/Apollo/assets/views/daybook/nonoperational.html new file mode 100644 index 00000000..1ff2353f --- /dev/null +++ b/Apollo/assets/views/daybook/nonoperational.html @@ -0,0 +1,463 @@ + +
+
+
+

{{ mainTitle }}

+
+ +
+
+ + + +
+
+
+ + +
+
+
+
+
+
+ + + +
+
+
+ +
+ + + +
+
+
+ +

+ +
+
+ + +
+ +
Generating...
+ +
+ + +
+
+ + + + +
+
+
+
+ Total Count: {{ dataLength }} +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
S.NoDateIncome/
Expense
Voucher No / Bill NoPaid To / Received FromTypeAmountBalance CommentsStatusAction
{{p.ORDER_ID}}{{p.Date}}{{p.ListName}} + {{p.VoucherNumber}} + {{p.PaidTo}} {{ p.Lastname}}{{p.TypeName}} + {{p.TypeName}}{{p.Amount}}{{p.Balance}}
{{p.Description}}
{{p.Status}} + {{p.Status}} + {{p.Status}} + {{p.Status}} + - + + + + + + + + + +
+
+
+
+
+ + + + Enter a Valid Voucher Number. + Voucher Number is required. +
+
+ + + Paid To / Received From is required. +
+
+ + +