diff --git a/Apollo/api/application/config/routes.php b/Apollo/api/application/config/routes.php index 44c4e2a1..0465bb22 100755 --- a/Apollo/api/application/config/routes.php +++ b/Apollo/api/application/config/routes.php @@ -375,3 +375,8 @@ $route['getStudentUnivFormIdFeeDatailsList'] = 'Receive_Enrolment_Fees_Univ_Cont $route['getFormIdDetailsStatusUpdateList'] = 'Receive_Enrolment_Fees_Univ_Controller/getFormIdDetailsStatusUpdateList'; $route['insertStatusUpdateDetails'] = 'Receive_Enrolment_Fees_Univ_Controller/insertStatusUpdateDetails'; $route['paymentVerficationDetails'] = 'Receive_Enrolment_Fees_Univ_Controller/paymentVerficationDetails'; +$route['getUniversityCodeForFormDetailsGet'] = 'Receive_Enrolment_Fees_Univ_Controller/getUniversityCodeForFormDetailsGet'; +$route['getUnmatchedFormIdFeesDetails'] = 'Receive_Enrolment_Fees_Univ_Controller/getUnmatchedFormIdFeesDetails'; +$route['addToAccountStateList'] = 'Receive_Enrolment_Fees_Univ_Controller/addToAccountStateList'; +$route['addUniversityPaymentDetails'] = 'Receive_Enrolment_Fees_Univ_Controller/addUniversityPaymentDetails'; + diff --git a/Apollo/api/application/controllers/Batch_Controller.php b/Apollo/api/application/controllers/Batch_Controller.php index 9a77c55b..9124550c 100755 --- a/Apollo/api/application/controllers/Batch_Controller.php +++ b/Apollo/api/application/controllers/Batch_Controller.php @@ -44,7 +44,7 @@ class Batch_Controller extends REST_Controller { $details['IsActive'] = $this->post('status'); $details['BranchCode'] = $this->post('branchCode'); $details['CreatedOn'] = $now->format('Y-m-d H:i:s'); - print_r( $details +'samplearray'); + //print_r( $details +'samplearray'); $batchDetails = $this->batch_model->addBatch($details);// Check if the users data store contains users (in case the database result returns NULL) if ($batchDetails) diff --git a/Apollo/api/application/controllers/Receive_Enrolment_Fees_Univ_Controller.php b/Apollo/api/application/controllers/Receive_Enrolment_Fees_Univ_Controller.php index 637edb56..01120c37 100644 --- a/Apollo/api/application/controllers/Receive_Enrolment_Fees_Univ_Controller.php +++ b/Apollo/api/application/controllers/Receive_Enrolment_Fees_Univ_Controller.php @@ -37,6 +37,7 @@ class Receive_Enrolment_Fees_Univ_Controller extends REST_Controller { $this->methods['getExistStudentEnrolmentDetails_post']['limit'] = 1000; $this->methods['addManualEnrolmentDetails_post']['limit'] = 1000; + $this->methods['addUniversityPaymentDetails_post']['limit'] = 1000; // load the model $this->load->model('Receive_Enrolment_Fees_Univ_model', 'receive_model'); @@ -85,7 +86,8 @@ class Receive_Enrolment_Fees_Univ_Controller extends REST_Controller { public function insertFormIdUnivFeeDetails_post(){ $formIdDetails = $this->post('details'); $localDetails = $this->post('localDetails'); - $updatedDetails = $this->receive_model->formIdFeeDetails($formIdDetails,$localDetails);// Check if the users data store contains users (in case the database result returns NULL) + $univDetails = $this->post('univ'); + $updatedDetails = $this->receive_model->formIdFeeDetails($formIdDetails,$localDetails, $univDetails);// Check if the users data store contains users (in case the database result returns NULL) if ($updatedDetails) { $updatedDetails['status'] = REST_Controller::HTTP_OK; @@ -271,6 +273,8 @@ class Receive_Enrolment_Fees_Univ_Controller extends REST_Controller { } } + // get formid draft mode list details + // kdk public function getForFormIdDraftDetails_post(){ $reqBranch = $this->post('localDetails'); $getForFormIdDraftDetails = $this->receive_model->getForFormIdDraftDetails(); // Check if the employee exist @@ -286,10 +290,14 @@ class Receive_Enrolment_Fees_Univ_Controller extends REST_Controller { } } + // add formid manual details form the university and draftmode + // kdk public function addForFormIdDraftDetails_post(){ $reqBranch = $this->post('localDetails'); $details = $this->post('details'); - $addForFormIdDraftDetails = $this->receive_model->addForFormIdDraftDetails($details, $reqBranch); // Check if the employee exist + $univDetails = $this->post('univ'); + + $addForFormIdDraftDetails = $this->receive_model->addForFormIdDraftDetails($details, $reqBranch, $univDetails); // Check if the employee exist if ($addForFormIdDraftDetails) { $addForFormIdDraftDetails['status'] = REST_Controller::HTTP_OK; // Set the response and exit @@ -302,6 +310,8 @@ class Receive_Enrolment_Fees_Univ_Controller extends REST_Controller { } } + // manual formid entry draft details move to the list details + // kdk public function draftMovetoList_post(){ $reqBranch = $this->post('localDetails'); $details = $this->post('details'); @@ -318,6 +328,8 @@ class Receive_Enrolment_Fees_Univ_Controller extends REST_Controller { } } + // edit draft mode formid manul entry details + // kdk public function editDraftFormIdFeesDetails_post(){ $reqBranch = $this->post('localDetails'); $details = $this->post('details'); @@ -337,7 +349,8 @@ class Receive_Enrolment_Fees_Univ_Controller extends REST_Controller { } } - // get formid fee details list with status + // get formid , fee details form the file upload for the university , course, student + // kdk public function getStudentUnivFormIdFeeDatailsList_post(){ $reqBranchData = $this->post('data'); $searchDetails = $this->post('search'); @@ -355,6 +368,8 @@ class Receive_Enrolment_Fees_Univ_Controller extends REST_Controller { } } + // get formid status list for that particular record + // kdk public function getFormIdDetailsStatusUpdateList_post(){ $reqBranchData = $this->post('localDetails'); $statusDetailsId = $this->post('detailsID'); @@ -372,6 +387,8 @@ class Receive_Enrolment_Fees_Univ_Controller extends REST_Controller { } } + // add formid list file status list for that record + // kdk public function insertStatusUpdateDetails_post(){ $reqBranchData = $this->post('localDetails'); $statusDetails = $this->post('details'); @@ -391,5 +408,115 @@ class Receive_Enrolment_Fees_Univ_Controller extends REST_Controller { } } + public function getUniversityCodeForFormDetailsGet_post(){ + $reqData = $this->post('data'); + $loginUserId = $reqData['localUserID']; + $loginUserBranchId = $reqData['localBranchID']; + $loginUserType = $reqData['localType']; + $getUniversityListDetails = $this->receive_model->get_university_list($loginUserBranchId); // Check if the employee exist + if ($getUniversityListDetails) { + $getUniversityListDetails['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($getUniversityListDetails, 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 + + } + } + + // get unmatched records of the formid file details , compare with file 1 + // kdk + public function getUnmatchedFormIdFeesDetails_post(){ + $localDetails = $this->post('localDetails'); + $getDetailsFor = $this->post('getDetailsFor'); + + $getUnmatchedFormIdFeesDetails = $this->receive_model->getUnmatchedFormIdFeesDetails($localDetails, $getDetailsFor); // Check if the employee exist + if ($getUnmatchedFormIdFeesDetails) { + $getUnmatchedFormIdFeesDetails['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($getUnmatchedFormIdFeesDetails, 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 fromid university amount details to account state + // kdk + public function addToAccountStateList_post(){ + $localDetails = $this->post('localDetails'); + $getDetailsFor = $this->post('details'); + + $addFormIdListToAccountState = $this->receive_model->addFormIdListToAccountState($localDetails, $getDetailsFor); // Check if the employee exist + if ($addFormIdListToAccountState) { + $addFormIdListToAccountState['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($addFormIdListToAccountState, 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 + + } + } + /* + * get payment verfication details + * created by kms + * */ + public function paymentVerficationDetails_post(){ + $fromDetails['UniversityCode']=$this->post('universityID'); + $fromDetails['UniversityName']=$this->post('universityName'); + $getVerificationDetails=$this->receive_model->getPaymentVerificationDetails($fromDetails); + if($getVerificationDetails['status']==true){ + $this->response($getVerificationDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + + } + else if($getVerificationDetails['status']==false){ + $this->response($getVerificationDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + + } + else{ + $this->response(['details' => 'No list were found', 'status' => false], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code + + } + } + /* + * add university payment details + * created by kms + * */ + public function addUniversityPaymentDetails_post(){ + $now = new DateTime(); + $now->setTimezone(new DateTimezone('Asia/Kolkata')); + $details=$this->post('details'); + $localData=$this->post('localDetails'); + $fromDetails['BillNo']=$details['billNo']; + $fromDetails['ReceiptNo']=$details['receiptNo']; + $fromDetails['Amount']=$details['billAmount']; + $fromDetails['ApprovedDate']=$details['date']; + $fromDetails['UniversityCode']=$details['universityCode']; + $fromDetails['UniversityName']=$details['universityName']; + $fromDetails['Remarks']=$details['comments']; + $fromDetails['BranchCode']=$localData['localBranchID']; + $fromDetails['CreatedBy']=$localData['localUserID']; + $fromDetails['CreatedOn']=$now->format('Y-m-d H:i:s'); + $addPaymentDetails=$this->receive_model->addPaymentDetails($fromDetails); + if($addPaymentDetails['status']==true){ + $this->response($addPaymentDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + + } + else if($addPaymentDetails['status']==false){ + $this->response($addPaymentDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + + } + else{ + $this->response(['message' => 'Try again', 'status' => false], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code + + } + } + } \ No newline at end of file diff --git a/Apollo/api/application/models/Receive_Enrolment_Fees_Univ_model.php b/Apollo/api/application/models/Receive_Enrolment_Fees_Univ_model.php index a869d2b7..e4c23cf8 100644 --- a/Apollo/api/application/models/Receive_Enrolment_Fees_Univ_model.php +++ b/Apollo/api/application/models/Receive_Enrolment_Fees_Univ_model.php @@ -367,10 +367,12 @@ class Receive_Enrolment_Fees_Univ_model extends CI_Model { return $finalArray; } - - public function formIdFeeDetails($formFeeDetails=null,$local=null){ + // add student formid feedetails from the university by file upload , with check the unique entry + // kdk + public function formIdFeeDetails($formFeeDetails=null,$local=null, $univ =null){ $localBranchID = $local['localBranchID']; $localUserID = $local['localUserID']; + $univId = $univ['univCode']; $time = date('Y-m-d H:i:s'); $CreatedOn = $time; @@ -443,9 +445,9 @@ class Receive_Enrolment_Fees_Univ_model extends CI_Model { if(count($queryDetails->result()) == 0){ $query = "INSERT INTO T_FormId_FeeDetails_Received_From_University - (FormID, FormType, CentreCode,Session,Year,Semester,Student_Name,Father_Name,CourseCode, ActualCourseFee, CourseFee, ExamFee, EnrollmentFee, ProspectusFee, ReRegFee, CreditTransferFee, LateralEntryFee, DualSpclFee, OtherFee, NRIFEE, ProvisionalFee, MigrationFee, UrgentResultDMCFee, AdditionalFee, Amount, CreatedBy, CreatedOn, BranchCode, DraftStatus, EditStatus) + (FormID, FormType, CentreCode,Session,Year,Semester,Student_Name,Father_Name,CourseCode, ActualCourseFee, CourseFee, ExamFee, EnrollmentFee, ProspectusFee, ReRegFee, CreditTransferFee, LateralEntryFee, DualSpclFee, OtherFee, NRIFEE, ProvisionalFee, MigrationFee, UrgentResultDMCFee, AdditionalFee, Amount,UniversityID, CreatedBy, CreatedOn, BranchCode, DraftStatus, EditStatus, AddToAccountStatus) VALUES - ( '$formIds', '$formType', '$CentreCode','$Session','$Year','$Semester','$Student_Name','$Father_Name', '$CourseCode', '$ActualCourseFee', '$CourseFee', '$ExamFee', '$EnrollmentFee', '$ProspectusFee', '$ReRegFee', '$CreditTransferFee', '$LateralEntryFee', '$DualSpclFee', '$OtherFee', '$NRIFEE', '$ProvisionalFee', '$MigrationFee', '$UrgentResultDMCFee', '$AdditionalFee', '$Amount', '$localUserID', '$CreatedOn', '$localBranchID' , 0, 0)"; + ( '$formIds', '$formType', '$CentreCode','$Session','$Year','$Semester','$Student_Name','$Father_Name', '$CourseCode', '$ActualCourseFee', '$CourseFee', '$ExamFee', '$EnrollmentFee', '$ProspectusFee', '$ReRegFee', '$CreditTransferFee', '$LateralEntryFee', '$DualSpclFee', '$OtherFee', '$NRIFEE', '$ProvisionalFee', '$MigrationFee', '$UrgentResultDMCFee', '$AdditionalFee', '$Amount', '$univId', '$localUserID', '$CreatedOn', '$localBranchID' , 0, 0, 0)"; $queryDetails = $this->db->query($query); } else { echo 'else con'; @@ -889,6 +891,8 @@ class Receive_Enrolment_Fees_Univ_model extends CI_Model { return $resultArray; } + // get formid draft mode list details + // kdk public function getForFormIdDraftDetails(){ $selectQuery = "SELECT * FROM T_FormId_FeeDetails_Received_From_University WHERE DraftStatus = 1"; $details = $this->db->query($selectQuery); @@ -905,10 +909,13 @@ class Receive_Enrolment_Fees_Univ_model extends CI_Model { return $result; } - public function addForFormIdDraftDetails($details, $local){ + // add formid manual details form the university and draftmode + // kdk + public function addForFormIdDraftDetails($details, $local, $univ =null){ $localBranchID = $local['localBranchID']; $localUserID = $local['localUserID']; + $univId = $univ['univCode']; $time = date('Y-m-d H:i:s'); $CreatedOn = $time; @@ -967,9 +974,9 @@ class Receive_Enrolment_Fees_Univ_model extends CI_Model { if(count($queryDetails->result()) == 0){ $query = "INSERT INTO T_FormId_FeeDetails_Received_From_University - (FormID, FormType, CentreCode,Session,Year,Semester,Student_Name,Father_Name,CourseCode, ActualCourseFee, CourseFee, ExamFee, EnrollmentFee, ProspectusFee, ReRegFee, CreditTransferFee, LateralEntryFee, DualSpclFee, OtherFee, NRIFEE, ProvisionalFee, MigrationFee, UrgentResultDMCFee, AdditionalFee, Amount, CreatedBy, CreatedOn, BranchCode, DraftStatus, EditStatus) + (FormID, FormType, CentreCode,Session,Year,Semester,Student_Name,Father_Name,CourseCode, ActualCourseFee, CourseFee, ExamFee, EnrollmentFee, ProspectusFee, ReRegFee, CreditTransferFee, LateralEntryFee, DualSpclFee, OtherFee, NRIFEE, ProvisionalFee, MigrationFee, UrgentResultDMCFee, AdditionalFee, Amount, UniversityID, CreatedBy, CreatedOn, BranchCode, DraftStatus, EditStatus, AddToAccountStatus) VALUES - ( '$formIds', '$formType', '$CentreCode','$Session','$Year','$Semester','$Student_Name','$Father_Name', '$CourseCode', '$ActualCourseFee', '$CourseFee', '$ExamFee', '$EnrollmentFee', '$ProspectusFee', '$ReRegFee', '$CreditTransferFee', '$LateralEntryFee', '$DualSpclFee', '$OtherFee', '$NRIFEE', '$ProvisionalFee', '$MigrationFee', '$UrgentResultDMCFee', '$AdditionalFee', '$Amount', '$localUserID', '$CreatedOn', '$localBranchID' , 1, 1)"; + ( '$formIds', '$formType', '$CentreCode','$Session','$Year','$Semester','$Student_Name','$Father_Name', '$CourseCode', '$ActualCourseFee', '$CourseFee', '$ExamFee', '$EnrollmentFee', '$ProspectusFee', '$ReRegFee', '$CreditTransferFee', '$LateralEntryFee', '$DualSpclFee', '$OtherFee', '$NRIFEE', '$ProvisionalFee', '$MigrationFee', '$UrgentResultDMCFee', '$AdditionalFee', '$Amount', '$univId' , '$localUserID', '$CreatedOn', '$localBranchID' , 1, 1, 0)"; $queryDetails = $this->db->query($query); if($queryDetails){ @@ -986,6 +993,8 @@ class Receive_Enrolment_Fees_Univ_model extends CI_Model { return $result; } + // manual formid entry draft details move to the list details + // kdk public function draftMovetoList($detail, $local){ // print_r($details);exit(); @@ -1014,6 +1023,8 @@ class Receive_Enrolment_Fees_Univ_model extends CI_Model { return $result; } + // edit draft mode formid manul entry details + // kdk public function editDraftFormIdFeesDetails($reqBranch, $details, $detailsID){ $ids = $detailsID; $formIds = $details['FormID']; @@ -1083,6 +1094,8 @@ $result['updatedraftStatus'] = false; return $result; } + // get formid , fee details form the file upload for the university , course, student + // kdk public function getStudentUnivFormIdFeeDatailsList($reqBranchData, $searchDetails){ $this->db->select('FUD.*, concat(ST.FirstName," ", ST.Lastname) as app_StudentName, IF(concat(ST.FirstName," " , ST.Lastname) = FUD.Student_Name, "YES", "NO") as StudentNameStatus , @@ -1152,8 +1165,14 @@ $result['updatedraftStatus'] = false; } + // get formid status list for that particular record + // kdk public function getFormIdDetailsStatusUpdateList($reqBranchData, $searchDetails){ - $selectQuery = "SELECT * FROM T_FormId_FeeDetails_Received_From_University_StatusUpdate WHERE FormIdDetailsID = '$searchDetails'"; + $selectQuery = "SELECT * , concat(t3.Firstname, '', t3.Lastname) as CreatedByName + FROM T_FormId_FeeDetails_Received_From_University_StatusUpdate as t1 + LEFT JOIN T_Login as t2 ON t1.CreatedBy = t2.ID + LEFT JOIN T_StaffDetails as t3 ON t2.StaffID = t3.StaffID + WHERE FormIdDetailsID = '$searchDetails' ORDER BY t1.CreatedOn DESC "; $details = $this->db->query($selectQuery); $detailsList = $details->result(); if($detailsList) { @@ -1168,6 +1187,8 @@ $result['updatedraftStatus'] = false; return $result; } + // add formid list file status list for that record + // kdk public function insertStatusUpdateDetails($reqBranchData, $statusDetails, $id, $formId ){ $newLeadDetails['FormIdDetailsID'] = $id; @@ -1188,4 +1209,262 @@ $result['updatedraftStatus'] = false; return $result; } + // get university list for search + // kdk + public function get_university_list($branch) { + $this->db->select('UniversityID, UniversityName'); + $this->db->order_by('CreatedOn', 'DESC'); + $this->db->from(UNIVERSITY); + $this->db->where('IsActive', 1); + $this->db->where('BranchCode', $branch); + $univDetails = $this->db->get(); + $universityDetails = $univDetails->result(); + if (count($universityDetails) > 0) { + $results['univList'] = true; + $results['university_details'] = $universityDetails; + } else { + $results['univList'] = false; + $results['message'] = 'No record found'; + } + return $results; + } + + // get unmatched records of the formid file details , compare with file 1 + // kdk + public function getUnmatchedFormIdFeesDetails($localDetails, $getDetailsFor) { + + $searchUniv = $getDetailsFor['univCode']; + // echo $searchUniv;exit(); + $query = "select * + from T_FormId_FeeDetails_Received_From_University as t1 + where t1.FormID NOT IN (select FormID from T_Enrolment_Received_From_University) + and t1.UniversityID ='$searchUniv'"; + $details = $this->db->query($query); + $detailsList = $details->result(); + if($detailsList){ + $resultArr['unMatchedRecordDetails'] = $detailsList; + $resultArr['unMatchedRecordStatus'] = true; + $resultArr['unMatchedRecordFor'] = 'FormIDFile'; + $resultArr['message'] = "Successfully data generated"; + } else { + $resultArr['unMatchedRecordDetails'] = []; + $resultArr['unMatchedRecordStatus'] = false; + $resultArr['unMatchedRecordFor'] = 'FormIDFile'; + $resultArr['message'] = "No record found"; + } + return $resultArr; + } + + // Add formid , university amount payment details to the account state + // kdk + public function addFormIdListToAccountState($localDetails, $getDetailsFor){ + $localCreatedBy = $localDetails['localUserID']; + $time = date('Y-m-d H:i:s'); + $localCreatedOn = $time; + foreach($getDetailsFor as $row) { + $ids = $row['ID']; + $query = "SELECT t1.ID, t1.FormID, t1.Amount, t2.ApprovedDate , t2.CreatedOn ,t2.UniversityCode, t2.UniversityName + from T_FormId_FeeDetails_Received_From_University as t1 + LEFT JOIN T_Enrolment_Received_From_University as t2 ON t1.FormID = t2.FormID + WHERE t1.ID = '$ids'"; + $details = $this->db->query($query); + $detailsList = $details->result(); + if($detailsList){ + $arr['FormMapID'] = $detailsList[0]->ID; + $arr['FormID'] = $detailsList[0]->FormID; + $arr['CreditAmount'] = $detailsList[0]->Amount; + $ApprovedDate = date('y-m-d',strtotime($detailsList[0]->ApprovedDate)); + $CreatedOn = date('y-m-d',strtotime($detailsList[0]->CreatedOn)); + $arr['ApprovedDate'] = $ApprovedDate ? $ApprovedDate : $CreatedOn; + $arr['TypeID'] = 1; + $arr['TypeName'] = 'Credit'; + $arr['UniversityCode'] = $detailsList[0]->UniversityCode; + $arr['UniversityName'] = $detailsList[0]->UniversityName; + $arr['CreatedOn'] = $localCreatedOn; + $arr['CreatedBy'] = $localCreatedBy; + $this->db->insert('T_University_Credit_Debit', $arr); + if ($this->db->affected_rows() >= 1) { + $updateQuery = 'UPDATE `T_FormId_FeeDetails_Received_From_University` SET `AddToAccountStatus` = 1 WHERE `ID` = '.$ids; + $queryDetails = $this->db->query($updateQuery); + if ($this->db->affected_rows() == '1') { + $result['accountStateMoveStatus'] = true; + $result['accountStateMoveMessagae'] = "Updated Successfully."; + } else { + $result['accountStateMoveStatus'] = false; + $result['accountStateMoveMessagae'] = "Something went wrong."; + } + } else { + $result['accountStateMoveStatus'] = false; + $result['accountStateMoveMessagae'] = "Something went wrong."; + } + } else { + $result['accountStateMoveStatus'] = false; + $result['accountStateMoveMessagae'] = "Something went wrong."; + } + } + return $result; + } + + + // public function getUnmatchedFormDetails($reqType){ + // // $this->db->select('t1.*'); + // // $this->db->from('T_Enrolment_Received_From_University as t1'); + // // $this->db->join('T_Student_CourseDetails as t2', 't2.EnrollmentID = t1.EnrolmentNo'); + // if($reqType == 'EnrolmentIDFile'){ + // $query = "select * + // from T_Enrolment_Received_From_University as t1 + // where t1.EnrolmentNo NOT IN (select EnrollmentID from T_Student_CourseDetails)"; + // $details = $this->db->query($query); + // $detailsList = $details->result(); + // if($detailsList){ + // $resultArr['unMatchedRecordDetails'] = $detailsList; + // $resultArr['unMatchedRecordStatus'] = true; + // $resultArr['unMatchedRecordFor'] = 'EnrolmentIDFile'; + // $resultArr['message'] = "Successfully data generated"; + // } else { + // $resultArr['unMatchedRecordDetails'] = []; + // $resultArr['unMatchedRecordStatus'] = false; + // $resultArr['unMatchedRecordFor'] = 'EnrolmentIDFile'; + // $resultArr['message'] = "No record found"; + // } + // }else if($reqType == 'FormIDFile'){ + // $query = "select * + // from T_FormId_FeeDetails_Received_From_University as t1 + // where t1.FormID NOT IN (select FormID from T_Enrolment_Received_From_University)"; + // $details = $this->db->query($query); + // $detailsList = $details->result(); + // if($detailsList){ + // $resultArr['unMatchedRecordDetails'] = $detailsList; + // $resultArr['unMatchedRecordStatus'] = true; + // $resultArr['unMatchedRecordFor'] = 'FormIDFile'; + // $resultArr['message'] = "Successfully data generated"; + // } else { + // $resultArr['unMatchedRecordDetails'] = []; + // $resultArr['unMatchedRecordStatus'] = false; + // $resultArr['unMatchedRecordFor'] = 'FormIDFile'; + // $resultArr['message'] = "No record found"; + // } + // } + // return $resultArr; + // } + /* + * get payment verification details + * created by kms + * */ + public function getPaymentVerificationDetails($search){ + $this->db->select('UNCD.ID,UNCD.FormMapID,UNCD.PaymentMapID,UNCD.FormID,UNCD.CreditAmount,UNCD.DebitAmount,UNCD.ApprovedDate,UNCD.UniversityCode,UNCD.UniversityName,UNCD.TypeID,ENU.EnrolmentNo,UNP.BillNo,UNP.PID as PaymentID'); + $this->db->from(UNIVERSITYCREDITDEBIY.' as UNCD'); + $this->db->join(FORMFEESRECEIVEDFROMUNIV.' as UNFR', 'UNFR.ID = UNCD.FormMapID','left'); + $this->db->join(UNIVERSITYPAYMENT.' as UNP', 'UNP.PID = UNCD.PaymentMapID','left'); + $this->db->join(ENROLMENTRECEIVEDFROMUNIV.' as ENU', 'ENU.FormID = UNFR.FormID','left'); + $this->db->order_by('UNCD.ApprovedDate','DESC'); + $this->db->where('UNCD.UniversityCode',$search['UniversityCode']); + $this->db->order_by('UNCD.UniversityName',$search['UniversityName']); + $details = $this->db->get(); + $resultArray=array(); + if($details->result()){ + $resultArray['status']=true; + $resultArray['details']=$details->result(); + + } + + else{ + $resultArray['status']=false; + $resultArray['details']="No list were found"; + } + return $resultArray; + + } + + /* + * add payment details + * created by kms + * */ + public function addPaymentDetails($fromDetails=null){ + $resultArray=array(); + $this->db->select('UNP.BillNo'); + $this->db->from(UNIVERSITYPAYMENT.' as UNP'); + $this->db->where('UNP.BillNo', $fromDetails['BillNo']); + $billExist = $this->db->get(); + if($billExist->num_rows()<=0){ + + if($fromDetails['ReceiptNo']!='' AND $fromDetails['ReceiptNo']!=null){ + $this->db->select('UNP1.ReceiptNo'); + $this->db->from(UNIVERSITYPAYMENT.' as UNP1'); + $this->db->where('UNP1.ReceiptNo', $fromDetails['ReceiptNo']); + $receiptExist = $this->db->get(); + if($receiptExist->num_rows()<=0){ + $this->db->insert(UNIVERSITYPAYMENT, $fromDetails); + if ($this->db->affected_rows() > 0) { + $updateDebitTable['PaymentMapID']=$this->db->insert_id(); + $updateDebitTable['DebitAmount']=$fromDetails['Amount']; + $updateDebitTable['ApprovedDate']=$fromDetails['ApprovedDate']; + $updateDebitTable['TypeID']=0; + $updateDebitTable['TypeName']="Debit"; + $updateDebitTable['UniversityCode']=$fromDetails['UniversityCode']; + $updateDebitTable['UniversityName']=$fromDetails['UniversityName']; + $updateDebitTable['BranchCode']=$fromDetails['BranchCode']; + $updateDebitTable['CreatedBy']=$fromDetails['CreatedBy']; + $updateDebitTable['CreatedOn']=$fromDetails['CreatedOn']; + $this->db->insert(UNIVERSITYCREDITDEBIY, $updateDebitTable); + if ($this->db->affected_rows() > 0) { + $resultArray['status']=true; + $resultArray['message']="Payment added successfully"; + } + else{ + $this->db->delete(UNIVERSITYPAYMENT); + $this->db->where('PID',$updateDebitTable['PaymentMapID']); + $resultArray['status']=false; + $resultArray['message']="Payment failed.try again"; + } + + } else { + $resultArray['status']=false; + $resultArray['message']="Payment failed.Try again"; + } + } + else{ + $resultArray['status']=false; + $resultArray['message']="Receipt no is already exist.."; + } + } + else{ + $this->db->insert(UNIVERSITYPAYMENT, $fromDetails); + if ($this->db->affected_rows() > 0) { + $updateDebitTable['PaymentMapID']=$this->db->insert_id(); + $updateDebitTable['DebitAmount']=$fromDetails['Amount']; + $updateDebitTable['ApprovedDate']=$fromDetails['ApprovedDate']; + $updateDebitTable['TypeID']=0; + $updateDebitTable['TypeName']="Debit"; + $updateDebitTable['UniversityCode']=$fromDetails['UniversityCode']; + $updateDebitTable['UniversityName']=$fromDetails['UniversityName']; + $updateDebitTable['BranchCode']=$fromDetails['BranchCode']; + $updateDebitTable['CreatedBy']=$fromDetails['CreatedBy']; + $updateDebitTable['CreatedOn']=$fromDetails['CreatedOn']; + $this->db->insert(UNIVERSITYCREDITDEBIY, $updateDebitTable); + if ($this->db->affected_rows() > 0) { + $resultArray['status']=true; + $resultArray['message']="Payment added successfully"; + } + else{ + $this->db->delete(UNIVERSITYPAYMENT); + $this->db->where('PID',$updateDebitTable['PaymentMapID']); + $resultArray['status']=false; + $resultArray['message']="Payment failed.try again"; + } + + } else { + $resultArray['status']=false; + $resultArray['message']="Payment failed.Try again"; + } + + } + } + else { + $resultArray['status']=false; + $resultArray['message']="Bill no is already exist.."; + } + return $resultArray; + + } } \ No newline at end of file diff --git a/Apollo/assets/js/controllers/studentUnivFormIdFeeDetailsCtrl.js b/Apollo/assets/js/controllers/studentUnivFormIdFeeDetailsCtrl.js index 7f424922..24c39d90 100644 --- a/Apollo/assets/js/controllers/studentUnivFormIdFeeDetailsCtrl.js +++ b/Apollo/assets/js/controllers/studentUnivFormIdFeeDetailsCtrl.js @@ -1,7 +1,6 @@ 'use strict'; /** - * controllers for ng-table - * Simple table with sorting and filtering on AngularJS + * Student University Formid, Fee details compare * kdk */ @@ -37,6 +36,7 @@ app.controller('studentUnivFormIdFeeDetailsCtrl', ["$scope", "toaster", "$filter if (localDetails.localType === 'R004') { // $scope.getUniversityList(); $scope.getUniversitySearchList(); + $scope.getUniveesityListFromApp(); } else { ipCookie.remove('cookiechk'); $window.localStorage.clear(); @@ -47,11 +47,11 @@ app.controller('studentUnivFormIdFeeDetailsCtrl', ["$scope", "toaster", "$filter } - /*$scope.universityData = ''; - $scope.getUniversityList = function () { + $scope.universityData = ''; + $scope.getUniveesityListFromApp = function () { var empListreq = { method: 'POST', - url: apiPoint.url + 'getStudentUniversity/', + url: apiPoint.url + 'getUniversityCodeForFormDetailsGet/', headers: { 'Content-Type': 'application/json' }, @@ -65,7 +65,7 @@ app.controller('studentUnivFormIdFeeDetailsCtrl', ["$scope", "toaster", "$filter } else { } }); - }*/ + } // get University List $scope.universitySearchData = ''; $scope.getUniversitySearchList = function () { @@ -88,7 +88,7 @@ app.controller('studentUnivFormIdFeeDetailsCtrl', ["$scope", "toaster", "$filter }); }; - $scope.semDetails=["1","2","3","4","5","6","7","8"]; + $scope.semDetails = ["1", "2", "3", "4", "5", "6", "7", "8"]; $scope.searchData = { "University": "", @@ -163,15 +163,15 @@ app.controller('studentUnivFormIdFeeDetailsCtrl', ["$scope", "toaster", "$filter } } - $scope.myObj = { + $scope.myObj = { // "color" : "green", - "font-size" : "inherit" + "font-size": "inherit" } - $scope.myObjErr = { + $scope.myObjErr = { "text-decoration": "underline", "text-decoration-color": "red", - "font-size" : "inherit" + "font-size": "inherit" } $scope.editId = -1; @@ -229,9 +229,12 @@ app.controller('studentUnivFormIdFeeDetailsCtrl', ["$scope", "toaster", "$filter } + $scope.formUploadUnivSelectID = { + 'univCode': '' + }; + $scope.receiveFormIdFeeDetails = function (details) { console.log(details); - var updateUniversityEnrolment = { method: 'POST', url: apiPoint.url + 'insertFormIdUnivFeeDetails/', @@ -240,7 +243,8 @@ app.controller('studentUnivFormIdFeeDetailsCtrl', ["$scope", "toaster", "$filter }, data: { localDetails: localDetail, - details: details + details: details, + univ: $scope.formUploadUnivSelectID } }; @@ -291,22 +295,26 @@ app.controller('studentUnivFormIdFeeDetailsCtrl', ["$scope", "toaster", "$filter }); } + + $scope.formIdMissMatchUnivSelectID = { + 'univCode': '' + }; + $scope.unMatchedLoadingStatus = false; // Get unmached details $scope.getUnmatchedRecord = function (ss) { $scope.unMatchedRecordDetails = ''; $scope.unMatchedNoRecordFound = false; $scope.unMatchedLoadingStatus = true; - var getDetailsFor = ss == 1 ? 'EnrolmentIDFile' : 'FormIDFile'; var getFeeCompareDetailsList = { method: 'POST', - url: apiPoint.url + 'getUnmatchedRecordDetails/', + url: apiPoint.url + 'getUnmatchedFormIdFeesDetails/', headers: { 'Content-Type': 'application/json' }, data: { localDetails: localDetail, - getDetailsFor: getDetailsFor + getDetailsFor: $scope.formIdMissMatchUnivSelectID } }; $http(getFeeCompareDetailsList).then(function (response) { @@ -325,8 +333,8 @@ app.controller('studentUnivFormIdFeeDetailsCtrl', ["$scope", "toaster", "$filter // get subtab details for the formid fee details get form the university - $scope.subTabActive= function(tab){ - if( tab == 'subTabactive2'){ + $scope.subTabActive = function (tab) { + if (tab == 'subTabactive2') { getDraftFormIdDetails(); } } @@ -336,14 +344,14 @@ app.controller('studentUnivFormIdFeeDetailsCtrl', ["$scope", "toaster", "$filter 'FormID': '', 'FormType': 'NEW', 'CentreCode': '', - 'Session':'', - 'Year':'', - 'Semester':'', - 'Student_Name':'', - 'Father_Name':'', - 'CourseCode':'', - 'ActualCourseFee':'0', - 'CourseFee':'0', + 'Session': '', + 'Year': '', + 'Semester': '', + 'Student_Name': '', + 'Father_Name': '', + 'CourseCode': '', + 'ActualCourseFee': '0', + 'CourseFee': '0', 'ExamFee': '0', 'EnrollmentFee': '0', 'ProspectusFee': '0', @@ -352,7 +360,7 @@ app.controller('studentUnivFormIdFeeDetailsCtrl', ["$scope", "toaster", "$filter 'LateralEntryFee': '0', 'DualSpclFee': '0', 'OtherFee': '0', - 'NRIFEE':'0', + 'NRIFEE': '0', 'ProvisionalFee': '0', 'MigrationFee': '0', 'UrgentResultDMCFee': '0', @@ -360,12 +368,12 @@ app.controller('studentUnivFormIdFeeDetailsCtrl', ["$scope", "toaster", "$filter 'Amount': '0' } - + $scope.draftListDetails = ''; $scope.draftListDetailsNoRecordFound = false; $scope.draftListDetailsLoading = false; // get draft form id details - function getDraftFormIdDetails(){ + function getDraftFormIdDetails() { $scope.draftListDetailsLoading = true; $scope.draftListDetailsNoRecordFound = false; $scope.draftListDetails = ''; @@ -393,8 +401,8 @@ app.controller('studentUnivFormIdFeeDetailsCtrl', ["$scope", "toaster", "$filter // manual entry details add - $scope.addManualData = function() { - alert(JSON.stringify($scope.draftManualEntryDetails)); + $scope.addManualData = function () { + // alert(JSON.stringify($scope.draftManualEntryDetails)); var addDraftDetailsList = { method: 'POST', @@ -404,7 +412,8 @@ app.controller('studentUnivFormIdFeeDetailsCtrl', ["$scope", "toaster", "$filter }, data: { localDetails: localDetail, - details : $scope.draftManualEntryDetails + details: $scope.draftManualEntryDetails, + univ: $scope.formUploadUnivSelectID } }; $http(addDraftDetailsList).then(function (response) { @@ -420,93 +429,96 @@ app.controller('studentUnivFormIdFeeDetailsCtrl', ["$scope", "toaster", "$filter }); } - function getEmptycall(){ -$scope.draftManualEntryDetails = { - 'FormID': '', - 'FormType': 'NEW', - 'CentreCode': '', - 'Session':'', - 'Year':'', - 'Semester':'', - 'Student_Name':'', - 'Father_Name':'', - 'CourseCode':'', - 'ActualCourseFee':'0', - 'CourseFee':'0', - 'ExamFee': '0', - 'EnrollmentFee': '0', - 'ProspectusFee': '0', - 'ReRegFee': '0', - 'CreditTransferFee': '0', - 'LateralEntryFee': '0', - 'DualSpclFee': '0', - 'OtherFee': '0', - 'NRIFEE':'0', - 'ProvisionalFee': '0', - 'MigrationFee': '0', - 'UrgentResultDMCFee': '0', - 'AdditionalFee': '0', - 'Amount': '0' + function getEmptycall() { + $scope.draftManualEntryDetails = { + 'FormID': '', + 'FormType': 'NEW', + 'CentreCode': '', + 'Session': '', + 'Year': '', + 'Semester': '', + 'Student_Name': '', + 'Father_Name': '', + 'CourseCode': '', + 'ActualCourseFee': '0', + 'CourseFee': '0', + 'ExamFee': '0', + 'EnrollmentFee': '0', + 'ProspectusFee': '0', + 'ReRegFee': '0', + 'CreditTransferFee': '0', + 'LateralEntryFee': '0', + 'DualSpclFee': '0', + 'OtherFee': '0', + 'NRIFEE': '0', + 'ProvisionalFee': '0', + 'MigrationFee': '0', + 'UrgentResultDMCFee': '0', + 'AdditionalFee': '0', + 'Amount': '0' + } + return 0; } - return 0; -} - $scope.addToList = function(id){ - swal({ - title: "Are you sure?", - text: "You Want to Add this Record to List!", - type: "warning", - showCancelButton: true, - confirmButtonColor: '#DD6B55', - confirmButtonText: 'Yes', - cancelButtonText: "No", - closeOnConfirm: false, - closeOnCancel: false - }, - function(isConfirm){ - if (isConfirm){ - var selectedItems = []; - function getUpdateDetails(id) { - this.ID = id; - this.DraftStatus = 0; - } - let itemGetID = new getUpdateDetails(id); - selectedItems.push(itemGetID); - var draftMoveToList = { - method: 'POST', - url: apiPoint.url + 'draftMovetoList/', - headers: { - 'Content-Type': 'application/json' - }, - data: { - localDetails: localDetail, - details : selectedItems + // add draft details to list + $scope.addToList = function (id) { + swal({ + title: "Are you sure?", + text: "You Want to Add this Record to List!", + type: "warning", + showCancelButton: true, + confirmButtonColor: '#DD6B55', + confirmButtonText: 'Yes', + cancelButtonText: "No", + closeOnConfirm: false, + closeOnCancel: false + }, + function (isConfirm) { + if (isConfirm) { + var selectedItems = []; + function getUpdateDetails(id) { + this.ID = id; + this.DraftStatus = 0; } - }; - $http(draftMoveToList).then(function (response) { - if (response.data.draftStatus == true) { - // alert(); - swal("", response.data.draftDetailsMessagae, "success"); - getDraftFormIdDetails(); - } else { - swal("", response.data.draftDetailsMessagae, "warning"); - - }}); + let itemGetID = new getUpdateDetails(id); + selectedItems.push(itemGetID); + var draftMoveToList = { + method: 'POST', + url: apiPoint.url + 'draftMovetoList/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + localDetails: localDetail, + details: selectedItems + } + }; + $http(draftMoveToList).then(function (response) { + if (response.data.draftStatus == true) { + // alert(); + swal("", response.data.draftDetailsMessagae, "success"); + getDraftFormIdDetails(); + } else { + swal("", response.data.draftDetailsMessagae, "warning"); + + } + }); } else { - swal("Cancelled", "Your record not added to list :)", "error"); + swal("Cancelled", "Your record not added to list :)", "error"); } }); } $scope.editId = -1; $scope.leader = {}; - $scope.editList = function(details, d){ + $scope.editList = function (details, d) { $scope.leader = {}; angular.copy(d, $scope.leader); $scope.editId = details; } - $scope.updateFeeIDDetails = function(id, p){ + // update feeid details in draft mode + $scope.updateFeeIDDetails = function (id, p) { var editDraftMoveToList = { method: 'POST', url: apiPoint.url + 'editDraftFormIdFeesDetails/', @@ -515,7 +527,7 @@ $scope.draftManualEntryDetails = { }, data: { localDetails: localDetail, - details : p, + details: p, detailsID: id } }; @@ -525,21 +537,29 @@ $scope.draftManualEntryDetails = { swal("", response.data.updatedraftDetailsMessagae, "success"); getDraftFormIdDetails(); $scope.editId = -1; - $scope.leader = {}; + $scope.leader = {}; } else { swal("", response.data.updatedraftDetailsMessagae, "warning"); - - }}); + + } + }); } $scope.statusUpdateEditId = -1; - $scope.statusUpdate = function(id){ + $scope.statusUpdate = function (id) { $scope.statusUpdateEditId = id; + $scope.statusUpdateFormIdDetails = { + "Status": "", + "Comments": "" + } } - $scope.StatusListDetails = ''; + + $scope.StatusListDetails = ''; $scope.getFormIdDetailsStatusListLoading = false; - $scope.getFormIdDetailsStatusList = function(id){ + // formid records status details + $scope.getFormIdDetailsStatusList = function (id) { + $scope.getFormIdDetailsStatusListLoading = true; var getFormIdDetailsStatusList = { method: 'POST', @@ -549,18 +569,19 @@ $scope.draftManualEntryDetails = { }, data: { localDetails: localDetail, - detailsID : id + detailsID: id } }; $http(getFormIdDetailsStatusList).then(function (response) { if (response.data.formIdstatusListStatus == true) { - $scope.getFormIdDetailsStatusListLoading = false; + $scope.getFormIdDetailsStatusListLoading = false; $scope.StatusListDetails = response.data.formIdstatusListDetails; } else { - $scope.getFormIdDetailsStatusListLoading = false; + $scope.getFormIdDetailsStatusListLoading = false; $scope.StatusListDetails = response.data.formIdstatusListDetails; $scope.StatusListDetailsApiMessage = response.data.formIdstatusListMessagae; - }}); + } + }); } $scope.statusUpdateFormIdDetails = { @@ -568,7 +589,16 @@ $scope.draftManualEntryDetails = { "Comments": "" } - $scope.addStatusUpdateDetails = function(id, formId){ + $scope.resetStatusUpdateForm = function () { + $scope.statusUpdateFormIdDetails = { + "Status": "", + "Comments": "" + } + } + + // add status for the formid record details + // kdk + $scope.addStatusUpdateDetails = function (id, formId) { var addStatusUpdateDetailsStatusList = { method: 'POST', url: apiPoint.url + 'insertStatusUpdateDetails/', @@ -577,25 +607,75 @@ $scope.draftManualEntryDetails = { }, data: { localDetails: localDetail, - details : $scope.statusUpdateFormIdDetails, + details: $scope.statusUpdateFormIdDetails, id: id, - formId : formId + formId: formId } }; $http(addStatusUpdateDetailsStatusList).then(function (response) { if (response.data.insertStatusUpdateDetailsStatus == true) { - $scope.statusUpdateFormIdDetails = { - "Status": "", - "Comments": "" - } - $scope.statusUpdateEditId = -1; - swal("", response.data.insertStatusUpdateDetailsMessagae, "success"); - } else { - swal("", response.data.insertStatusUpdateDetailsMessagae, "success"); + $scope.statusUpdateFormIdDetails = { + "Status": "", + "Comments": "" + } + $scope.statusUpdateEditId = -1; + swal("", response.data.insertStatusUpdateDetailsMessagae, "success"); + } else { + swal("", response.data.insertStatusUpdateDetailsMessagae, "success"); // $scope.getFormIdDetailsStatusListLoading = false; // $scope.StatusListDetails = response.data.formIdstatusListDetails; // $scope.StatusListDetailsApiMessage = response.data.formIdstatusListMessagae; - }}); + } + }); + } + + // add formid list details to account state + // kdk + $scope.addToAccountState = function (id) { + + swal({ + title: "Are you sure?", + text: "You Want to Add this Record to Account State List!", + type: "warning", + showCancelButton: true, + confirmButtonColor: '#DD6B55', + confirmButtonText: 'Yes', + cancelButtonText: "No", + closeOnConfirm: false, + closeOnCancel: false + }, + function (isConfirm) { + if (isConfirm) { + var selectedItems = []; + function getUpdateDetails(id) { + this.ID = id; + } + let itemGetID = new getUpdateDetails(id); + selectedItems.push(itemGetID); + var addToAccountStateList = { + method: 'POST', + url: apiPoint.url + 'addToAccountStateList/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + localDetails: localDetail, + details: selectedItems + } + }; + $http(addToAccountStateList).then(function (response) { + if (response.data.accountStateMoveStatus == true) { + swal("", response.data.accountStateMoveMessagae, "success"); + $scope.onSubmit(); + } else { + swal("", response.data.accountStateMoveMessagae, "warning"); + + } + }); + } else { + swal("Cancelled", "Your record not added to list :)", "error"); + } + }); } }]); diff --git a/Apollo/assets/js/controllers/univFormPaymentCtrl.js b/Apollo/assets/js/controllers/univFormPaymentCtrl.js index e69de29b..c78855d3 100644 --- a/Apollo/assets/js/controllers/univFormPaymentCtrl.js +++ b/Apollo/assets/js/controllers/univFormPaymentCtrl.js @@ -0,0 +1,236 @@ +'use strict'; +/** + * controllers for ng-table + * Simple table with sorting and filtering on AngularJS + */ +app.controller('univFormPaymentCtrl', ["$scope","$rootScope","$filter", "ngTableParams", "API_POINTS", "$localStorage", "$http", "$state", "$modal", "$log", "SweetAlert", "$timeout", function ($scope,$rootScope, $filter, ngTableParams, apiPoint, $localStorage, $http, $state, $modal, SweetAlert, $log, $timeout) { + // ng-model object for payment search + $scope.paymentVerficationModel= { + 'universitySearch':"", + }; + // load when html page load + var localDetail = JSON.parse(localStorage.getItem('localObj')); + + $scope.init = function () { + + if (localDetail != null) { + if (localDetail.localType === 'R004') { + $scope.getPaymentUnivSearchData(); + } else { + localStorage.removeItem('localObj'); + $state.go('login.signin'); + } + } else { + $state.go('login.signin'); + } + } + /* + * get university details for search + * cretaed by kms + * */ + $scope.universityPaymentSearchData=[]; + $scope.getPaymentUnivSearchData = function () { + var paymentSearch = { + method: 'POST', + url: apiPoint.url + 'getUnivCourseFromFileDetails/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + data: localDetail + } + }; + $http(paymentSearch).then(function (response) { + if (response.data.status) { + $scope.universityPaymentSearchData = response.data.details; + } else { + $scope.universityPaymentSearchData=""; + } + }); + } + /* + * add payment details + * created by kms + * */ + $rootScope.addPaymentModel = { + 'billNo':"", + 'date':"", + 'billAmount':"", + 'receiptNo':"", + 'comments':"", + 'university':[] + }; + $scope.addUniversityPaymentModal = function (values) { + $rootScope.addError=""; + $rootScope.addPaymentModel.university=angular.fromJson(values.universitySearch); + $rootScope.paymentModal = $modal.open({ + templateUrl: 'assets/views/student/addUniversityPaymentModal.html', + // controller: 'univFormPaymentCtrl', + // size: size, + resolve: { + items: function () { + return $scope.univPayDetails; + } + } + }); + + $rootScope.paymentModal.result.then(function (selectedItem) { + }, function () { + $rootScope.paymentModal.close(); + $rootScope.addPaymentModel = { + 'billNo':"", + 'date':"", + 'billAmount':"", + 'receiptNo':"", + 'comments':"", + 'university':[] + }; + }); + }; + /* + * add university payment details + * created by kms + * */ + $rootScope.addError=""; + $rootScope.addUnivPayment = function (form,addDetails) { + $rootScope.addError=""; + 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 getdate=new Date(addDetails.date).toDateString(); + $scope.univPayData = { + "universityCode":addDetails.university.univCode, + "universityName":addDetails.university.univName, + "billNo":addDetails.billNo, + "billAmount":addDetails.billAmount, + "date":$filter('date')(new Date(getdate), 'yyyy-MM-dd'), + "receiptNo":addDetails.receiptNo, + "comments":addDetails.comments, + } + + var submitPayment = { + method: 'POST', + url: apiPoint.url + 'addUniversityPaymentDetails/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + localDetails: localDetail, + details: $scope.univPayData, + } + }; + $http(submitPayment).then(function (response) { + if (response.data.status==true) { + swal(" ", response.data.message, "success"); + $rootScope.paymentModal.close(); + $rootScope.addPaymentModel = { + 'billNo':"", + 'date':"", + 'billAmount':"", + 'receiptNo':"", + 'comments':"", + 'university':[] + }; + $rootScope.getPaymentVerificationDetails($scope.paymentVerficationModel); + + + } else { + $rootScope.addError=response.data.message; + $timeout(function () { + $rootScope.addError=""; + }, 4000); + + + } + }); + } + + } + /* + * cancel add modal + * */ + $rootScope.cancelAddPaymentModal=function () { + $rootScope.paymentModal.close(); + $rootScope.addPaymentModel = { + 'billNo':"", + 'date':"", + 'billAmount':"", + 'receiptNo':"", + 'comments':"", + 'university':[] + }; + $rootScope.addError=""; + }; + + + /* + * get payment details + * cretaed by kms + * */ + $scope.paymentVerificationData=""; + $scope.emptyList=true; + $scope.searchLoader = false; + $rootScope.getPaymentVerificationDetails = function (searchData) { + $scope.paymentVerificationData=""; + $scope.emptyList=true; + $scope.searchLoader = true; + var paymentVerification = { + method: 'POST', + url: apiPoint.url + 'paymentVerficationDetails/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + localData: localDetail, + universityID: angular.fromJson(searchData.universitySearch).univCode, + universityName: angular.fromJson(searchData.universitySearch).univName, + } + }; + $http(paymentVerification).then(function (response) { + if (response.data.status) { + $scope.searchLoader = false; + $scope.emptyList=false; + $scope.paymentVerificationData=response.data.details; + var tagMap = $scope.paymentVerificationData.reduce(function(map, tag,key) { + if(map.RunningBalance==undefined){ + map['RunningBalance'] = parseInt(tag.CreditAmount)-parseInt(tag.DebitAmount); + tag['RunningBalance']=parseInt(tag.CreditAmount)-parseInt(tag.DebitAmount);; + } + else{ + if(parseInt(tag.DebitAmount)<=0){ + map['RunningBalance'] = parseInt(map.RunningBalance)+parseInt(tag.CreditAmount); + tag['RunningBalance']=parseInt(map.RunningBalance); + } + else{ + map['RunningBalance'] = parseInt(map.RunningBalance)-parseInt(tag.DebitAmount); + tag['RunningBalance']=parseInt(map.RunningBalance); + } + + } + return map; + }, {}); + + } else { + $scope.searchLoader = false; + $scope.emptyList=true; + $scope.paymentVerificationData=response.data.details; + } + }); + }; + +}]); \ No newline at end of file diff --git a/Apollo/assets/views/student/UnivFormPaymentDetails.html b/Apollo/assets/views/student/UnivFormPaymentDetails.html index 566549bd..eb2748c9 100644 --- a/Apollo/assets/views/student/UnivFormPaymentDetails.html +++ b/Apollo/assets/views/student/UnivFormPaymentDetails.html @@ -1,10 +1,96 @@ - - -
- -| Form ID | +Enrolment No | +Bill No | +Payable | +Paid | +Balance | + +||
|---|---|---|---|---|---|---|---|
| {{p.FormID}} | +{{p.EnrolmentNo}} | +{{p.BillNo}} | ++ | {{p.CreditAmount}} | ++ | {{p.DebitAmount}} | +{{p.RunningBalance}} | + + +
| Action + | Action | FormID | @@ -147,22 +147,23 @@NRIFEE | -ProvisionalFee + | ProvisionalFee | -MigrationFee + | MigrationFee | -UrgentResultDMCFee + | UrgentResultDMCFee | -AdditionalFee - | -Amount + | AdditionalFee + | +Amount | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| - + + | {{p.FormID}} @@ -183,10 +184,10 @@ {{p.Semester}} | - {{p.Student_Name}} + {{p.Student_Name}} | - {{p.Father_Name}} + {{p.Father_Name}} | {{p.CourseCode}} @@ -212,78 +213,118 @@ | -->|||||||||||||||||||||||||||
|
-
-
-
-
-
-
-
- Loading...
-
+
+
+ |
-
+
+
+
+
+
+ Loading...+
+
-
-
-
-
+
+
+
+
+
+
+
-
+
{{StatusListDetailsApiMessage}}+
-
-
-
- {{StatusListDetailsApiMessage}}
- | ||||||||||||||||||||||||||||||