This commit is contained in:
gandhimathi 2018-10-24 17:54:28 +05:30
commit 3f29694919
6 changed files with 347 additions and 4 deletions

View File

@ -306,6 +306,12 @@ $route['addNonOperational'] = 'DayBook_Controller/addNonOperational';
$route['updateNonOperationalDetails'] = 'DayBook_Controller/updateNonOperationalDetails';
$route['getExpenseType'] = 'DayBook_Controller/getExpenseType';
$route['getDayBookfilterDetails'] = 'DayBook_Controller/getDayBookfilterDetails';
/** This is for CRONE JOB*/
$route['sendStudentNotification'] = 'Fees_Status_Controller/sendStudentNotification';

View File

@ -199,6 +199,40 @@ class DayBook_Controller extends REST_Controller {
}
}
public function getDayBookfilterDetails_post()
{
$reqData = $this->post('data');
$reqDataBy = $this->post('localReqDetails');
$filter['exptype'] = $this->post('exptype');
$filter['modeofpayment'] = $this->post('modeofpayment');
$filter['fdate'] = $this->post('fdate');
$filter['tdate'] = $this->post('tdate');
$getDayBookApprovalDetails = $this->daybook_model->get_Daybook_filterApproval_Details_List($reqData, $reqDataBy,$filter);// Check if the employee exist
if ($getDayBookApprovalDetails)
{
$getDayBookApprovalDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getDayBookApprovalDetails, 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 deleteDayBookDetails_post() {
$reqData = $this->post('data');
$reason = $this->post('reason');
@ -318,6 +352,10 @@ public function updateNonOperationalDetails_post() {
// add details daybook
public function adddaybook_post() {
@ -347,6 +385,8 @@ public function updateNonOperationalDetails_post() {
$req['VoucherNumber'] = $reqData['voucherNumber'];
$date = date('Y-m-d H:i:s');
$req['CreatedOn'] = $date;
$req['ModeOfPayment'] = 'CASH';
if($reqData['Isdaybook']==true)
{
@ -361,7 +401,7 @@ public function updateNonOperationalDetails_post() {
$non['Name'] = $reqData['name'];
$non['Type'] = $reqData['type'];
$non['Type'] = $reqData['type'];
//$non['Type'] = $typealone->ID;
$non['Amount'] = $reqData['amount'];
// $d = new DateTime($reqData['date']);
@ -375,6 +415,7 @@ public function updateNonOperationalDetails_post() {
$non['VoucherNumber'] = $reqData['voucherNumber'];
$date = date('Y-m-d H:i:s');
$non['CreatedOn'] = $date;
$non['ModeOfPayment'] = 'CASH';
$non['Isdaybook'] = 0;
@ -739,5 +780,31 @@ public function updateNonOperationalDetails_post() {
}
public function getExpenseType_post()
{
$branch=$this->post('branch');
$getexpensetype = $this->daybook_model->getExpenseType($branch);
if ($getexpensetype)
{
$getexpensetype['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getexpensetype, 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
}
}
}

View File

@ -225,6 +225,68 @@ class DayBook_model extends CI_Model
return $results;
}
public function get_Daybook_filterApproval_Details_List($reqData, $reqDataBy,$filter) {
$ModeOfPayment= $filter['modeofpayment'];
$exptype = $filter['exptype'];
if($reqData['date'] != '' && $reqData['dateTo'] != '') {
$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'];
// $ModeOfPayment= $filter['modeofpayment'];
// $exptype = $filter['exptype'];
$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
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
WHERE STR_TO_DATE(t1.Date, '%d-%m-%Y') BETWEEN '$fromDate'
AND '$toDate' AND t1.BranchCode = '$reqpayType' AND t1.Status NOT IN ('Approved', 'Cancel')
and t1.Type='$exptype'
AND (t1.ModeOfPayment='$ModeOfPayment' or t1.ModeOfPayment is NULL)
ORDER BY ORDER_ID DESC";
}
else { $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
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
WHERE t1.BranchCode = '$reqpayType' AND t1.Status NOT IN ('Approved', 'Cancel')
and t1.Type='$exptype'
AND (t1.ModeOfPayment='$ModeOfPayment' or t1.ModeOfPayment is NULL)
ORDER BY ORDER_ID DESC";
}
$dayBookDetails = $this->db->query($querys);
$dayBookDetailsList = $dayBookDetails->result();
$results['dayBookListStatus'] = true;
$results['dayBookListDetails'] = $dayBookDetailsList;
// print_r($this->db->last_query());
// die();
return $results;
}
// delete the daybook details
public function delete_dayBookDetails($id,$reason) {
// echo $id;exit();
@ -1261,4 +1323,37 @@ $subQuery='select Name,ListName,q.Date as dat,month(str_to_date(Date,?)) as mont
}
return $results;
}
public function getExpenseType($branch)
{
$expcode='I001';
$this->db->select('ID,TypeName');
$this->db->from('T_Income_Outcome_Master');
$this->db->where('TypeID',$expcode);
$this->db->where('BranchCode',$branch);
$this->db->where('IsActive','1');
$searchDetails = $this->db->get();
if($searchDetails->result())
{
$expDetails['status'] = true;
$expDetails['details'] = $searchDetails->result();
}
else
{
$expDetails['status'] = false;
$expDetails['details'] = "No records found!";
}
return $expDetails;
}
}

View File

@ -603,7 +603,7 @@ $upperresult=strtoupper($getlastansbookstatus);
$this->db->select('t3.BatchName, t3.BatchCode,t3.BatchDate');
$this->db->from('' . BATCH . ' as t3');
$this->db->where('t3.UniversityID', $clip->UniversityID);
$this->db->where('t3.IsActive', 1);
// $this->db->where('t3.IsActive', 1);
$this->db->where('t3.BranchCode', $branch);
$batDetails = $this->db->get();
$batchDetails = $batDetails->result();

View File

@ -17,6 +17,32 @@ app.controller('daybooksuperadminapprovalCtrl', ["$scope", "$rootScope", "toaste
}
$scope.viewStudentDetailsPage = false;
$scope.ExpenseType='';
$scope.paymentOptions = [
{
"paymentOn":"CASH"
},
{
"paymentOn":"CHEQUE"
},
{
"paymentOn":"REFERRAL"
},
{
"paymentOn":"ONLINE TRANSACTION"
},
{
"paymentOn":"WAIVER"
},
{
"paymentOn":"Credit/Debit Card"
}
];
// load when html page load
$scope.init = function () {
if (localDetail != null) {
@ -164,8 +190,97 @@ app.controller('daybooksuperadminapprovalCtrl', ["$scope", "$rootScope", "toaste
} else {
}
});
var getExpenseType = {
method: 'POST',
url: apiPoint.url + 'getExpenseType/',
headers: {
'Content-Type': 'application/json'
},
data: {
branch: localDetails.localBranchID,
}
};
$http(getExpenseType).then(function (response) {
if(response.data.status='200')
{
$scope.ExpenseType= response.data.details;
}
else
{
}
//console.log(localDetails);
// console.log($scope.searchData.dateTo);
//console.log($scope.searchData.date);
});
}
$scope.searchData = {
"modeofpayment": "",
"exptype": ""
}
$scope.getfilterDetails=function(p)
{
// alert()
//console.log(p.expensetype)
// console.log(p.paymentOn.paymentOn)
if((p.expensetype != undefined)&&(p.paymentOn.paymentOn != undefined))
{
var getDayBookfilterDetails = {
method: 'POST',
url: apiPoint.url + 'getDayBookfilterDetails/',
headers: {
'Content-Type': 'application/json'
},
data: {
data: $scope.searchData,
localReqDetails: localDetails,
exptype:p.expensetype,
modeofpayment:p.paymentOn.paymentOn,
fdate:$scope.searchData.date,
tdate:$scope.searchData.dateTo
}
};
$http(getDayBookfilterDetails).then(function (response) {
if (response.data.dayBookListStatus) {
$scope.loadingsearch = false;
$scope.searchResultDetails = response.data.dayBookListDetails;
$scope.searchResultDetailsCopy = response.data.dayBookListDetails;
} else {
$scope.loadingsearch = false;
}
});
}
else
{
$scope.getDayBookList();
}
}
$scope.loadingsearch = false;
$scope.noRecordFound = true;
$scope.noRecordFoundSearch = false;
@ -355,6 +470,10 @@ app.controller('daybooksuperadminapprovalCtrl', ["$scope", "$rootScope", "toaste
// });
}
$scope.statusList = [{
"status_id": 'TS001',
"name": "Pending",

View File

@ -44,13 +44,16 @@
</div>
</div>
<div class="col-md-3">
<div class="col-md-3">
<label for="form-field-select-2">
Search
</label>
<input class="form-control" type="text" ng-model="search" id="search" autofocus tabindex="1" placeholder="Search" /><br><br>
</div>
</div>
<!-- <div class="col-md-3 form-group" ng-class="{'has-error':Form.gender.$dirty && Form.addName.$invalid , 'has-success':Form.addName.$valid}">
<label for="form-field-select-2">
Income/Expense
@ -65,6 +68,59 @@
</div> -->
</div>
<div class="row">
<div class="col-md-3">
<label>
Mode Of Payment <span class="symbol required"></span>
</label>
<select class="form-control" name="paymentOn" tabindex="20" id="paymentOn"
ng-model="updateModel.paymentOn"
ng-options="payment.paymentOn for payment in paymentOptions"
required>
<option value=""> Select Payment</option>
<option ng-repeat="pay in paymentOptions" value="{{pay.paymentOn}}">{{pay.paymentOn}}</option>
</select>
</div>
<div class="col-md-3">
<label>
Expense Type <span class="symbol required"></span>
</label>
<select class="form-control" name="paymentOn" tabindex="20" id="expensetype"
ng-model="updateModel.expensetype"
required>
<option value=""> Select</option>
<option ng-repeat="exp in ExpenseType" value="{{exp.ID}}">{{exp.TypeName}}</option>
</select>
</div>
<div class="col-md-3">
<br/>
<button type="submit" class="btn btn-success btn-o" ng-click="getfilterDetails(updateModel);" tabindex="8">
Submit
</button>
</div>
</div>
<div>
<br/>
</div>
<div>
<div ng-show="loadingsearch" class="center">
<span style="color: #007AFF;