diff --git a/Apollo/api/application/config/routes.php b/Apollo/api/application/config/routes.php index a579f8bc..d06c7284 100755 --- a/Apollo/api/application/config/routes.php +++ b/Apollo/api/application/config/routes.php @@ -266,6 +266,7 @@ $route['updateDayBookStatusAdmin'] = 'DayBook_Controller/updateDayBookStatusAdmi $route['getDayBookDetailsSuperAdmin'] = 'DayBook_Controller/getDayBookDetailsSuperAdmin'; $route['empDayBookModuleAccessChk'] = 'DayBook_Controller/empDayBookModuleAccessChk'; $route['deleteDayBookFeePayableDetails'] = 'DayBook_Controller/deleteDayBookFeePayableDetails'; +$route['billModal'] = 'DayBook_Controller/billModal'; /* * day book master * */ $route['getDayBookMasterDetails'] = 'DayBookMaster_Controller/getDayBookMasterDetails'; diff --git a/Apollo/api/application/controllers/DayBook_Controller.php b/Apollo/api/application/controllers/DayBook_Controller.php index 82f80f73..97a9532e 100755 --- a/Apollo/api/application/controllers/DayBook_Controller.php +++ b/Apollo/api/application/controllers/DayBook_Controller.php @@ -529,6 +529,28 @@ class DayBook_Controller extends REST_Controller { + } + public function billModal_post() + { + $bilNo = $this->post('billNo'); + $getStatus = $this->daybook_model->getBillDetails($bilNo); + //print_r($getStatus); + if ($getStatus) + { + $getStatus['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($getStatus, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + } + else + { + // Set the response and exit + $this->response([ + 'message' => 'No records found!', + 'status' => REST_Controller::HTTP_NOT_FOUND + ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code + } + + } } diff --git a/Apollo/api/application/models/DayBook_model.php b/Apollo/api/application/models/DayBook_model.php index 75bd3a9f..64569e53 100644 --- a/Apollo/api/application/models/DayBook_model.php +++ b/Apollo/api/application/models/DayBook_model.php @@ -889,4 +889,21 @@ $query = $this->db->query($subQuery,array('%d-%m-%Y',$fromd,'%d-%m-%Y',$tod,'Can return $studentDetails; } + Public function getBillDetails($bilNo=null) + { + $sql = "select BillNO,BillDate,BillAmount,ifnull(ReceiptNo,'-') as ReceiptNo,ModeOfPayment,CommentsForStudent,InternalComments + from T_Students_Fees_PaidDetails where BillNO = '".$bilNo."' + "; + $a=$this->db->query($sql); + $bill = $a->result(); + + if (count($bill) > 0) { + $results['List'] = true; + $results['bill_Details'] = $bill; + } else { + $results['List'] = false; + $results['message'] = 'No records found'; + } + return $results; + } } \ No newline at end of file diff --git a/Apollo/assets/js/controllers/daybooksuperadminCtrl.js b/Apollo/assets/js/controllers/daybooksuperadminCtrl.js index d74a5669..cb5a473d 100644 --- a/Apollo/assets/js/controllers/daybooksuperadminCtrl.js +++ b/Apollo/assets/js/controllers/daybooksuperadminCtrl.js @@ -936,7 +936,56 @@ $scope.loadStaring = true; 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 + $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': '', diff --git a/Apollo/assets/views/Daybook_billDetails_modal.html b/Apollo/assets/views/Daybook_billDetails_modal.html new file mode 100644 index 00000000..a98075e5 --- /dev/null +++ b/Apollo/assets/views/Daybook_billDetails_modal.html @@ -0,0 +1,53 @@ + + +
+ +
+
+ + + Bill Details + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Bill NoBill DateBill AmountReceipt NoComments For StudentInternal Comments
{{p.BillNO}}{{p.BillDate}}{{p.BillAmount}}{{p.ReceiptNo}}{{p.CommentsForStudent}}{{p.InternalComments}}
+ + +
+
+ + +
\ No newline at end of file diff --git a/Apollo/assets/views/daybook/daybooksuperadmin.html b/Apollo/assets/views/daybook/daybooksuperadmin.html index 52ab3716..ded62259 100755 --- a/Apollo/assets/views/daybook/daybooksuperadmin.html +++ b/Apollo/assets/views/daybook/daybooksuperadmin.html @@ -182,7 +182,9 @@ {{p.ORDER_ID}} {{p.Date}} {{p.ListName}} - {{p.VoucherNumber}} + + {{p.VoucherNumber}} + {{p.PaidTo}} {{ p.Lastname}} {{p.UniversityName}},{{p.CourseName}},{{p.FeePaymentDetails}}