Merge remote-tracking branch 'origin/master'

This commit is contained in:
gandhimathi 2018-04-20 11:18:20 +05:30
commit 4592927922
10 changed files with 51 additions and 18 deletions

View File

@ -55,6 +55,7 @@ class Status_Controller extends REST_Controller {
$details['ListGroup'] = "1";
$details['CreatedBy'] = $this->post('createdBy');
$details['IsActive'] = $this->post('status');
$details['BranchCode'] = $this->post('branch');
$details['CreatedOn'] = $now->format('Y-m-d H:i:s');
$statusDetails = $this->status_model->addstatus($details);// Check if the users data store contains users (in case the database result returns NULL)
if ($statusDetails)
@ -81,7 +82,8 @@ class Status_Controller extends REST_Controller {
public function getStatusDetails_post()
{
$requestedBy = $this->post('requestedBy');
$getStatus = $this->status_model->getStatus($requestedBy);
$requestedBranch = $this->post('requestBranch');
$getStatus = $this->status_model->getStatus($requestedBy, $requestedBranch);
if ($getStatus)
{
@ -113,8 +115,9 @@ class Status_Controller extends REST_Controller {
$details['ListName'] = $this->post('ListName');
$details['IsActive'] = $this->post('status');
$details['UpdatedBy'] = $this->post('updatedBy');
$branch = $this->post('requestBranch');
$details['UpdatedOn'] = $now->format("Y-m-d H:i:s");
$statusDetails = $this->status_model->update($details,$ListCode);// Check if the users data store contains users (in case the database result returns NULL)
$statusDetails = $this->status_model->update($details,$ListCode, $branch);// Check if the users data store contains users (in case the database result returns NULL)
if ($statusDetails)

View File

@ -120,14 +120,16 @@ class DayBook_model extends CI_Model
$toDate = $dTo->format('Y-m-d');
$reqpayType = $reqDataBy['localBranchID'];
$querys = "SELECT t1.ID as ORDER_ID, t1.*, t2.ListName, t3.TypeName , t5.Firstname as Approved_by_name 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
LEFT JOIN ".LOGIN." as t4 ON t4.ID = t1.Approval_By LEFT JOIN ".STAFF." as t5 ON t5.StaffID = t4.StaffID
$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
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
LEFT JOIN ".UNIVERSITY." as t7 ON t7.UniversityID = t6.UniversityID
WHERE STR_TO_DATE(t1.Date, '%d-%m-%Y') BETWEEN '$fromDate'
AND '$toDate' AND t1.BranchCode = '$reqpayType' AND t1.Status NOT IN ('Approved', 'Cancel') 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 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
LEFT JOIN ".LOGIN." as t4 ON t4.ID = t1.Approval_By LEFT JOIN ".STAFF." as t5 ON t5.StaffID = t4.StaffID
$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
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
LEFT JOIN ".UNIVERSITY." as t7 ON t7.UniversityID = t6.UniversityID
WHERE t1.BranchCode = '$reqpayType' AND t1.Status NOT IN ('Approved', 'Cancel') ORDER BY ORDER_ID DESC";
}

View File

@ -17,9 +17,11 @@ class Status_model extends CI_Model {
public function addstatus($arrayDetails=null)
{
$this->db->select('ListCode');
// print_r($arrayDetails);exit();
$this->db->select('ListCode');
$this->db->where('ListGroup', '1');
$this->db->where('ListName', $arrayDetails['ListName']);
$this->db->where('BranchCode', $arrayDetails['BranchCode']);
if($this->db->get(PICK_LIST_DETAILS)->first_row()){
$result['Status'] = false;
$result['message'] = "Status name is already exist!";
@ -52,10 +54,11 @@ class Status_model extends CI_Model {
* created by Surendiran
* */
public function getStatus()
{
public function getStatus($reqBy, $reqBranch)
{
$this->db->select('ListCode,ListName,IsActive');
$this->db->where('ListGroup','1');
$this->db->where('BranchCode', $reqBranch);
$this->db->order_by('ListCode','DESC');
$statusDetails = $this->db->get(PICK_LIST_DETAILS);
if($statusDetails->result()){
@ -76,10 +79,11 @@ class Status_model extends CI_Model {
* created by Surendiran
* */
public function update($arrayDetails=null,$ListCode=null)
public function update($arrayDetails=null,$ListCode=null, $branch)
{
$this->db->select('ListName');
$this->db->where('ListName', $arrayDetails['ListName']);
$this->db->where('BranchCode', $branch);
$this->db->where_not_in('ListCode', $ListCode);
if($this->db->get(PICK_LIST_DETAILS)->first_row()){
$result['Status'] = false;

View File

@ -334,9 +334,11 @@ $scope.dayBookApprovalAccess = '';
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 = $filter('date')(new Date($scope.myModelAdd.date), formate);
$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.data.push(myModelAdd);

View File

@ -399,9 +399,11 @@ $scope.dayBookApprovalAccess = '';
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 = $filter('date')(new Date($scope.myModelAdd.date), formate);
$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.data.push(myModelAdd);

View File

@ -75,7 +75,8 @@ app.controller("statusCtrl", ["$scope", "toaster", "$filter", "API_POINTS", "$lo
data: {
statusName: myModel.StatusName,
status: myModel.switchsetting,
createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID
createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
branch : localDetail.localBranchID
}
};
@ -87,7 +88,7 @@ app.controller("statusCtrl", ["$scope", "toaster", "$filter", "API_POINTS", "$lo
$state.go($state.current, {}, { reload: true });
} else {
$scope.ldloading1[loading.replace('-', '_')] = false;
swal("", "Something went wrong, please try again.", "error");
swal("", response.data.message, "error");
}
});
@ -123,6 +124,7 @@ app.controller("statusCtrl", ["$scope", "toaster", "$filter", "API_POINTS", "$lo
'Content-Type': 'application/json'
},
data: {
requestBranch: localDetail.localBranchID,
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID
}
};
@ -201,18 +203,20 @@ app.controller("statusCtrl", ["$scope", "toaster", "$filter", "API_POINTS", "$lo
ListCode: myModel.ListCode,
ListName: myModel.ListName,
status: myModel.IsActive,
requestBranch: localDetail.localBranchID,
updatedBy: JSON.parse(localStorage.getItem('localObj')).localUserID
}
};
$http(update).then(function (response) {
if (response.data.status == 200 && response.data.Status) {
if (response.data.Status) {
$scope.ldloading[loading.replace('-', '_')] = false;
swal("", "Updated Successfully", "success");
$scope.editId = -1;
$scope.init();
} else {
$scope.ldloading[loading.replace('-', '_')] = false;
swal("", "Something went wrong, please try again", "error");
$scope.init();
swal("", response.data.message, "error");
}
});
}

View File

@ -216,6 +216,12 @@
<th ng-click="sort('PaidTo')">Paid To / Received From
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='PaidTo'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th>
<th>Sem/Course/University
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='EmailID'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th>
<th>Description/Comments
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='PaidTo'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th>
@ -244,6 +250,7 @@
<td>{{p.ListName}}</td>
<td>{{p.VoucherNumber}}</td>
<td>{{p.PaidTo}}</td>
<td> {{p.FeePaymentDetails}}<br>{{p.CourseName}} <br> {{p.UniversityName}}</td>
<td>
<div id="containersPara">
<div id="wrapper">

View File

@ -291,7 +291,7 @@
Date <span
class="symbol required"></span>
</label>
<input type="text" tabindex="1" class="form-control " ng-click="startOpen = !startOpen" datepicker-popup="dd-MM-yyyy" ng-model="myModelAdd.date"
<input type="text" id="date" tabindex="1" class="form-control " ng-click="startOpen = !startOpen" datepicker-popup="dd-MM-yyyy" ng-model="myModelAdd.date"
is-open="startOpen" ng-init="startOpen = false" name="addDate" datepicker-options="dateOptions"
placeholder="Select Date" close-text="Close" required="required" ng-change="getMaxEndDate(myModel.startDate)"
show-button-bar="true" max-date="todayDate" />

View File

@ -216,6 +216,12 @@
<th ng-click="sort('PaidTo')">Paid To / Received From
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='PaidTo'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th>
<th>Sem/Course/University
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='EmailID'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th>
<th>Description/Comments
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='PaidTo'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th>
@ -244,6 +250,9 @@
<td>{{p.ListName}}</td>
<td>{{p.VoucherNumber}}</td>
<td>{{p.PaidTo}}</td>
<td> {{p.FeePaymentDetails}}<br>{{p.CourseName}} <br> {{p.UniversityName}}</td>
<td>
<div id="containersPara">
<div id="wrapper">

View File

@ -315,7 +315,7 @@
Date <span
class="symbol required"></span>
</label>
<input type="text" tabindex="1" class="form-control " ng-click="startOpen = !startOpen" datepicker-popup="dd-MM-yyyy" ng-model="myModelAdd.date"
<input type="text" id="date" tabindex="1" class="form-control " ng-click="startOpen = !startOpen" datepicker-popup="dd-MM-yyyy" ng-model="myModelAdd.date"
is-open="startOpen" ng-init="startOpen = false" name="addDate" datepicker-options="dateOptions"
placeholder="Select Date" close-text="Close" required="required" ng-change="getMaxEndDate(myModel.startDate)"
show-button-bar="true" max-date="todayDate" />