daybook approval change
This commit is contained in:
parent
5ae7aa2d63
commit
f26ac543b1
@ -306,6 +306,12 @@ $route['addNonOperational'] = 'DayBook_Controller/addNonOperational';
|
|||||||
$route['updateNonOperationalDetails'] = 'DayBook_Controller/updateNonOperationalDetails';
|
$route['updateNonOperationalDetails'] = 'DayBook_Controller/updateNonOperationalDetails';
|
||||||
|
|
||||||
|
|
||||||
|
$route['getExpenseType'] = 'DayBook_Controller/getExpenseType';
|
||||||
|
|
||||||
|
|
||||||
|
$route['getDayBookfilterDetails'] = 'DayBook_Controller/getDayBookfilterDetails';
|
||||||
|
|
||||||
|
|
||||||
/** This is for CRONE JOB*/
|
/** This is for CRONE JOB*/
|
||||||
$route['sendStudentNotification'] = 'Fees_Status_Controller/sendStudentNotification';
|
$route['sendStudentNotification'] = 'Fees_Status_Controller/sendStudentNotification';
|
||||||
|
|
||||||
|
|||||||
@ -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() {
|
public function deleteDayBookDetails_post() {
|
||||||
$reqData = $this->post('data');
|
$reqData = $this->post('data');
|
||||||
$reason = $this->post('reason');
|
$reason = $this->post('reason');
|
||||||
@ -318,6 +352,10 @@ public function updateNonOperationalDetails_post() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// add details daybook
|
// add details daybook
|
||||||
public function adddaybook_post() {
|
public function adddaybook_post() {
|
||||||
|
|
||||||
@ -348,6 +386,8 @@ public function updateNonOperationalDetails_post() {
|
|||||||
$date = date('Y-m-d H:i:s');
|
$date = date('Y-m-d H:i:s');
|
||||||
$req['CreatedOn'] = $date;
|
$req['CreatedOn'] = $date;
|
||||||
|
|
||||||
|
$req['ModeOfPayment'] = 'CASH';
|
||||||
|
|
||||||
if($reqData['Isdaybook']==true)
|
if($reqData['Isdaybook']==true)
|
||||||
{
|
{
|
||||||
$req['Isdaybook']=1;
|
$req['Isdaybook']=1;
|
||||||
@ -375,6 +415,7 @@ public function updateNonOperationalDetails_post() {
|
|||||||
$non['VoucherNumber'] = $reqData['voucherNumber'];
|
$non['VoucherNumber'] = $reqData['voucherNumber'];
|
||||||
$date = date('Y-m-d H:i:s');
|
$date = date('Y-m-d H:i:s');
|
||||||
$non['CreatedOn'] = $date;
|
$non['CreatedOn'] = $date;
|
||||||
|
$non['ModeOfPayment'] = 'CASH';
|
||||||
|
|
||||||
$non['Isdaybook'] = 0;
|
$non['Isdaybook'] = 0;
|
||||||
|
|
||||||
@ -740,4 +781,30 @@ 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
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -225,6 +225,68 @@ class DayBook_model extends CI_Model
|
|||||||
return $results;
|
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
|
// delete the daybook details
|
||||||
public function delete_dayBookDetails($id,$reason) {
|
public function delete_dayBookDetails($id,$reason) {
|
||||||
// echo $id;exit();
|
// echo $id;exit();
|
||||||
@ -1261,4 +1323,37 @@ $subQuery='select Name,ListName,q.Date as dat,month(str_to_date(Date,?)) as mont
|
|||||||
}
|
}
|
||||||
return $results;
|
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;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -17,6 +17,32 @@ app.controller('daybooksuperadminapprovalCtrl', ["$scope", "$rootScope", "toaste
|
|||||||
}
|
}
|
||||||
|
|
||||||
$scope.viewStudentDetailsPage = false;
|
$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
|
// load when html page load
|
||||||
$scope.init = function () {
|
$scope.init = function () {
|
||||||
if (localDetail != null) {
|
if (localDetail != null) {
|
||||||
@ -164,7 +190,96 @@ app.controller('daybooksuperadminapprovalCtrl', ["$scope", "$rootScope", "toaste
|
|||||||
} else {
|
} 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.loadingsearch = false;
|
||||||
$scope.noRecordFound = true;
|
$scope.noRecordFound = true;
|
||||||
@ -355,6 +470,10 @@ app.controller('daybooksuperadminapprovalCtrl', ["$scope", "$rootScope", "toaste
|
|||||||
// });
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$scope.statusList = [{
|
$scope.statusList = [{
|
||||||
"status_id": 'TS001',
|
"status_id": 'TS001',
|
||||||
"name": "Pending",
|
"name": "Pending",
|
||||||
|
|||||||
@ -44,6 +44,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<label for="form-field-select-2">
|
<label for="form-field-select-2">
|
||||||
Search
|
Search
|
||||||
@ -51,6 +52,8 @@
|
|||||||
<input class="form-control" type="text" ng-model="search" id="search" autofocus tabindex="1" placeholder="Search" /><br><br>
|
<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}">
|
<!-- <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">
|
<label for="form-field-select-2">
|
||||||
Income/Expense
|
Income/Expense
|
||||||
@ -65,6 +68,59 @@
|
|||||||
|
|
||||||
</div> -->
|
</div> -->
|
||||||
</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>
|
||||||
<div ng-show="loadingsearch" class="center">
|
<div ng-show="loadingsearch" class="center">
|
||||||
<span style="color: #007AFF;
|
<span style="color: #007AFF;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user