Merge remote-tracking branch 'origin/master'

This commit is contained in:
gandhimathi 2018-03-15 11:25:58 +05:30
commit e4f6e8ccb6
12 changed files with 1516 additions and 1216 deletions

View File

@ -64,11 +64,11 @@ class DayBook_model extends CI_Model
$toDate = $dTo->format('Y-m-d'); $toDate = $dTo->format('Y-m-d');
$reqpayType = $reqDataBy['localBranchID']; $reqpayType = $reqDataBy['localBranchID'];
$querys = "SELECT 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 $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 LEFT JOIN ".LOGIN." as t4 ON t4.ID = t1.Approval_By LEFT JOIN ".STAFF." as t5 ON t5.StaffID = t4.StaffID
WHERE STR_TO_DATE(t1.Date, '%d-%m-%Y') BETWEEN '$fromDate' WHERE STR_TO_DATE(t1.Date, '%d-%m-%Y') BETWEEN '$fromDate'
AND '$toDate' AND t1.BranchCode = '$reqpayType' ORDER BY ID DESC"; AND '$toDate' AND t1.BranchCode = '$reqpayType' ORDER BY ORDER_ID DESC";
// echo $querys;exit();
// $this->db->where(' STR_TO_DATE(t1.Date, %d-%m-%Y) >=', $fromDate); // $this->db->where(' STR_TO_DATE(t1.Date, %d-%m-%Y) >=', $fromDate);
// $this->db->where(' STR_TO_DATE(t1.Date, %d-%m-%Y) >=', $toDate); // $this->db->where(' STR_TO_DATE(t1.Date, %d-%m-%Y) >=', $toDate);
// $this->db->where('t1.Date', $reqData['date']); // $this->db->where('t1.Date', $reqData['date']);
@ -84,9 +84,10 @@ class DayBook_model extends CI_Model
// $this->db->order_by('CreatedOn', 'DESC'); // $this->db->order_by('CreatedOn', 'DESC');
// $this->db->where('t1.BranchCode', $reqDataBy['localBranchID']); // $this->db->where('t1.BranchCode', $reqDataBy['localBranchID']);
$reqpayType = $reqDataBy['localBranchID']; $reqpayType = $reqDataBy['localBranchID'];
$querys = "SELECT 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 $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 LEFT JOIN ".LOGIN." as t4 ON t4.ID = t1.Approval_By LEFT JOIN ".STAFF." as t5 ON t5.StaffID = t4.StaffID
WHERE t1.BranchCode = '$reqpayType' ORDER BY ID DESC"; WHERE t1.BranchCode = '$reqpayType' ORDER BY ORDER_ID DESC";
} }
// $this->db->join('' . COURSE . ' as t2', 't2.UniversityID = t1.UniversityID', 'LEFT'); // $this->db->join('' . COURSE . ' as t2', 't2.UniversityID = t1.UniversityID', 'LEFT');
@ -126,10 +127,10 @@ class DayBook_model extends CI_Model
$latestUpdateDetails2 = $latestUpdate2->result(); $latestUpdateDetails2 = $latestUpdate2->result();
foreach( $latestUpdateDetails2 as $clip){ foreach( $latestUpdateDetails2 as $clip){
if($clip->Name == 'I002') { if($clip->Name == 'I002' && ($clip->Status == "Pending" || $clip->Status == "Approved" || $clip->Status == "approved" || $clip->Status == "pending")) {
//Income //Income
$currBalance = $currBalance + $clip->Amount; $currBalance = $currBalance + $clip->Amount;
}else if ($clip->Name == 'I001') { }else if ($clip->Name == 'I001' && ($clip->Status == "Pending" || $clip->Status == "Approved" || $clip->Status == "approved" || $clip->Status == "pending")) {
//Expense //Expense
$currBalance = $currBalance - $clip->Amount; $currBalance = $currBalance - $clip->Amount;
} else { } else {
@ -152,52 +153,56 @@ class DayBook_model extends CI_Model
// delete the daybook fees entry details // delete the daybook fees entry details
public function delete_dayBookFeePayableDetails($id) { public function delete_dayBookFeePayableDetails($id) {
// echo $id;exit(); $this->db->select('FeesPaymentID, BranchCode');
$this->db->select('FeesPaymentID');
$this->db->from(DAYBOOKMASTER); $this->db->from(DAYBOOKMASTER);
$this->db->where('ID', $id); $this->db->where('ID', $id);
$typeDetails = $this->db->get(); $typeDetails = $this->db->get();
$typeStateDetails = $typeDetails->result(); $typeStateDetails = $typeDetails->result();
// print_r($typeStateDetails);exit();
$getID = $typeStateDetails[0]->FeesPaymentID; $getID = $typeStateDetails[0]->FeesPaymentID;
// if($getID != '' || $getID != null ) { $branch = $typeStateDetails[0]->BranchCode;
// $sql1 = " DELETE FROM T_Students_Fees_PaidDetails WHERE ID ='$getID'"; // echo $id;exit();
// // update branch to staff_branch table
// if ($this->db->query($sql1) == '1') {
// $sql2 = " DELETE FROM ".DAYBOOKMASTER." WHERE ID ='$id'";
// if ($this->db->query($sql2) == '1') {
// $result['deletedStatus'] = true;
// $result['message'] = "Entry is Deleted";
// }else{
// $result['deletedStatus'] = false;
// $result['message'] = "Something went wrong.please try again";
// }
// } else {
// $result['deletedStatus'] = false;
// $result['message'] = "Something went wrong.please try again";
// }
// return $result;
// } else {
// $sql1 = " DELETE FROM ".DAYBOOKMASTER." WHERE ID ='$id'";
// // update branch to staff_branch table
// if ($this->db->query($sql1) == '1') {
// $result['deletedStatus'] = true;
// $result['message'] = "Entry is Deleted";
// } else {
// $result['deletedStatus'] = false;
// $result['message'] = "Something went wrong.please try again";
// }
// return $result;
// }
try { try {
$sql1 = " DELETE FROM ".STUDENTS_FEES_PAID." WHERE ID ='$getID'"; $sql1 = " DELETE FROM ".STUDENTS_FEES_PAID." WHERE ID ='$getID'";
$this->db->query($sql1); $this->db->query($sql1);
} catch(Exception $e) { } catch(Exception $e) {
echo 'error'; echo 'error';
} finally { } finally {
$sql1 = " DELETE FROM ".DAYBOOKMASTER." WHERE ID ='$id'"; $sql = "SELECT * FROM ".DAYBOOKMASTER." WHERE (BranchCode = '$branch' AND ID < '$id')
ORDER BY ID DESC
LIMIT 1 ";
$currBalance = 0;
$currID = $id;
$latestUpdate = $this->db->query($sql);
$latestUpdateDetails = $latestUpdate->result();
If(is_array($latestUpdateDetails) && count($latestUpdateDetails)>0)
{
$currBalance = $latestUpdateDetails[0]->Balance;
$currID = $latestUpdateDetails[0]->ID;
}else{
}
$sql1 = " DELETE FROM ".DAYBOOKMASTER." WHERE FeesPaymentID ='$getID'";
// update branch to staff_branch table // update branch to staff_branch table
if ($this->db->query($sql1) == '1') { if ($this->db->query($sql1) == '1') {
$sql2 = "SELECT * FROM ".DAYBOOKMASTER." WHERE (BranchCode = '$branch' AND ID > '$currID')
ORDER BY ID ASC";
$latestUpdate2 = $this->db->query($sql2);
$latestUpdateDetails2 = $latestUpdate2->result();
foreach( $latestUpdateDetails2 as $clip){
if($clip->Name == 'I002' && ($clip->Status == "Pending" || $clip->Status == "Approved" || $clip->Status == "approved" || $clip->Status == "pending")) {
//Income
$currBalance = $currBalance + $clip->Amount;
}else if ($clip->Name == 'I001' && ($clip->Status == "Pending" || $clip->Status == "Approved" || $clip->Status == "approved" || $clip->Status == "pending")) {
//Expense
$currBalance = $currBalance - $clip->Amount;
} else {
}
$updateSql = "UPDATE ".DAYBOOKMASTER." SET Balance ='$currBalance' WHERE ID = '$clip->ID'";
$this->db->query($updateSql);
}
$result['deletedStatus'] = true; $result['deletedStatus'] = true;
$result['message'] = "Entry is Deleted"; $result['message'] = "Entry is Deleted";
} else { } else {
@ -215,9 +220,14 @@ class DayBook_model extends CI_Model
$sql = "SELECT * FROM ".DAYBOOKMASTER." WHERE (BranchCode = '$branch' AND ID < '$upFor') $sql = "SELECT * FROM ".DAYBOOKMASTER." WHERE (BranchCode = '$branch' AND ID < '$upFor')
ORDER BY ID DESC ORDER BY ID DESC
LIMIT 1 "; LIMIT 1 ";
$prevBalance = 0;
$latestUpdate = $this->db->query($sql); $latestUpdate = $this->db->query($sql);
$latestUpdateDetails = $latestUpdate->result(); $latestUpdateDetails = $latestUpdate->result();
If(is_array($latestUpdateDetails) && count($latestUpdateDetails)>0)
{
$prevBalance = $latestUpdateDetails[0]->Balance; $prevBalance = $latestUpdateDetails[0]->Balance;
}else{
}
if($Arr['Name'] == 'I002') { if($Arr['Name'] == 'I002') {
//Income //Income
@ -245,10 +255,10 @@ class DayBook_model extends CI_Model
$latestUpdateDetails2 = $latestUpdate2->result(); $latestUpdateDetails2 = $latestUpdate2->result();
foreach( $latestUpdateDetails2 as $clip){ foreach( $latestUpdateDetails2 as $clip){
if($clip->Name == 'I002') { if($clip->Name == 'I002' && ($clip->Status == "Pending" || $clip->Status == "Approved" || $clip->Status == "approved" || $clip->Status == "pending")) {
//Income //Income
$currBalance = $currBalance + $clip->Amount; $currBalance = $currBalance + $clip->Amount;
}else if ($clip->Name == 'I001') { }else if ($clip->Name == 'I001' && ($clip->Status == "Pending" || $clip->Status == "Approved" || $clip->Status == "approved" || $clip->Status == "pending")) {
//Expense //Expense
$currBalance = $currBalance - $clip->Amount; $currBalance = $currBalance - $clip->Amount;
} else { } else {
@ -272,9 +282,16 @@ class DayBook_model extends CI_Model
$sql = "SELECT * FROM ".DAYBOOKMASTER." WHERE BranchCode = '$branch' $sql = "SELECT * FROM ".DAYBOOKMASTER." WHERE BranchCode = '$branch'
ORDER BY CreatedOn DESC ORDER BY CreatedOn DESC
LIMIT 1"; LIMIT 1";
$prevBalance = 0;
$latestUpdate = $this->db->query($sql); $latestUpdate = $this->db->query($sql);
$latestUpdateDetails = $latestUpdate->result(); $latestUpdateDetails = $latestUpdate->result();
If(is_array($latestUpdateDetails) && count($latestUpdateDetails)>0)
{
$prevBalance = $latestUpdateDetails[0]->Balance; $prevBalance = $latestUpdateDetails[0]->Balance;
}else{
}
if($Arr['Name'] == 'I002') { if($Arr['Name'] == 'I002') {
//Income //Income
$Arr['Balance'] = $prevBalance + $Arr['Amount']; $Arr['Balance'] = $prevBalance + $Arr['Amount'];
@ -326,7 +343,7 @@ class DayBook_model extends CI_Model
$currBalance = 0; $currBalance = 0;
$latestUpdate = $this->db->query($sql); $latestUpdate = $this->db->query($sql);
$latestUpdateDetails = $latestUpdate->result(); $latestUpdateDetails = $latestUpdate->result();
if($updateDataDetails[0]->Name == 'I002') { if($updateDataDetails[0]->Name == 'I002' ) {
//Income //Income
$currBalance = $latestUpdateDetails[0]->Balance + $Amount; $currBalance = $latestUpdateDetails[0]->Balance + $Amount;
}else if ($updateDataDetails[0]->Name == 'I001') { }else if ($updateDataDetails[0]->Name == 'I001') {
@ -349,10 +366,10 @@ class DayBook_model extends CI_Model
$latestUpdate2 = $this->db->query($sql2); $latestUpdate2 = $this->db->query($sql2);
$latestUpdateDetails2 = $latestUpdate2->result(); $latestUpdateDetails2 = $latestUpdate2->result();
foreach( $latestUpdateDetails2 as $clip){ foreach( $latestUpdateDetails2 as $clip){
if($clip->Name == 'I002') { if($clip->Name == 'I002' && ($clip->Status == "Pending" || $clip->Status == "Approved" || $clip->Status == "approved" || $clip->Status == "pending")) {
//Income //Income
$currBalance = $currBalance + $clip->Amount; $currBalance = $currBalance + $clip->Amount;
}else if ($clip->Name == 'I001') { }else if ($clip->Name == 'I001' && ($clip->Status == "Pending" || $clip->Status == "Approved" || $clip->Status == "approved" || $clip->Status == "pending")) {
//Expense //Expense
$currBalance = $currBalance - $clip->Amount; $currBalance = $currBalance - $clip->Amount;
} else { } else {
@ -366,57 +383,108 @@ class DayBook_model extends CI_Model
$result['addStatus'] = false; $result['addStatus'] = false;
$result['message'] = "Something went wrong.please try again"; $result['message'] = "Something went wrong.please try again";
} }
} else if( $status == "Rejected" || $status == "rejected" ) { } else if( $status == "Rejected" || $status == "rejected" ) {
$mysql = "SELECT * FROM ".DAYBOOKMASTER." WHERE ID = '$updateFor'"; $mysql = "SELECT * FROM ".DAYBOOKMASTER." WHERE ID = '$updateFor'";
$updateDetails = $this->db->query($mysql); $updateDetails = $this->db->query($mysql);
$updateDataDetails = $updateDetails->result(); $updateDataDetails = $updateDetails->result();
$branch = $updateDataDetails[0]->BranchCode; $branch = $updateDataDetails[0]->BranchCode;
$Amount = 0; $Amount = 0;
$Amount = $updateDataDetails[0]->Amount; $Amount = $updateDataDetails[0]->Amount;
if($updateDataDetails[0]->PaymentStatus === '1' ){
$sql = "SELECT * FROM ".DAYBOOKMASTER." WHERE (BranchCode = '$branch' AND ID < '$updateFor')
ORDER BY ID DESC
LIMIT 1 ";
$currBalance = 0; $sql = "SELECT * FROM ".DAYBOOKMASTER." WHERE (BranchCode = '$branch' AND ID < '$updateFor')
$latestUpdate = $this->db->query($sql); ORDER BY ID DESC
$latestUpdateDetails = $latestUpdate->result(); LIMIT 1 ";
$currBalance = $latestUpdateDetails[0]->Balance;
$sql = "UPDATE ".DAYBOOKMASTER." $currBalance = 0;
SET Status = '$status', Approval_By = '$Approval_By' , $latestUpdate = $this->db->query($sql);
Approval_Comments = '$Approval_Comments', UpdatedBy = '$UpdatedBy' , UpdatedOn = '$UpdatedOn' , Balance = '$currBalance' $latestUpdateDetails = $latestUpdate->result();
WHERE id = '$updateFor' "; $currBalance = $latestUpdateDetails[0]->Balance;
$mBranchDetails = $this->db->query($sql);
// echo $mBranchDetails; $sql = "UPDATE ".DAYBOOKMASTER."
// echo $this->db->affected_rows(); exit(); SET Status = '$status', Approval_By = '$Approval_By' ,
if ($this->db->affected_rows() >= 1) { Approval_Comments = '$Approval_Comments', UpdatedBy = '$UpdatedBy' , UpdatedOn = '$UpdatedOn' , Balance = '$currBalance'
$sql2 = "SELECT * FROM ".DAYBOOKMASTER." WHERE (BranchCode = '$branch' AND ID > '$updateFor') WHERE id = '$updateFor' ";
ORDER BY ID ASC"; $mBranchDetails = $this->db->query($sql);
$latestUpdate2 = $this->db->query($sql2); // echo $mBranchDetails;
$latestUpdateDetails2 = $latestUpdate2->result(); // echo $this->db->affected_rows(); exit();
foreach( $latestUpdateDetails2 as $clip){ if ($this->db->affected_rows() >= 1) {
if($clip->Name == 'I002') { $sql2 = "SELECT * FROM ".DAYBOOKMASTER." WHERE (BranchCode = '$branch' AND ID > '$updateFor')
//Income ORDER BY ID ASC";
$currBalance = $currBalance + $clip->Amount; $latestUpdate2 = $this->db->query($sql2);
}else if ($clip->Name == 'I001') { $latestUpdateDetails2 = $latestUpdate2->result();
//Expense foreach( $latestUpdateDetails2 as $clip){
$currBalance = $currBalance - $clip->Amount; if($clip->Name == 'I002' && ($clip->Status == "Pending" || $clip->Status == "Approved" || $clip->Status == "approved" || $clip->Status == "pending")) {
} else { //Income
$currBalance = $currBalance + $clip->Amount;
}else if ($clip->Name == 'I001' && ($clip->Status == "Pending" || $clip->Status == "Approved" || $clip->Status == "approved" || $clip->Status == "pending")) {
//Expense
$currBalance = $currBalance - $clip->Amount;
} else {
}
$updateSql = "UPDATE ".DAYBOOKMASTER." SET Balance ='$currBalance' WHERE ID = '$clip->ID'";
$this->db->query($updateSql);
} }
$updateSql = "UPDATE ".DAYBOOKMASTER." SET Balance ='$currBalance' WHERE ID = '$clip->ID'"; $result['addStatus'] = true;
$this->db->query($updateSql); $result['message'] = "Successfully Details Updated";
} } else {
$result['addStatus'] = true; $result['addStatus'] = false;
$result['message'] = "Successfully Details Updated"; $result['message'] = "Something went wrong.please try again";
} else { }
$result['addStatus'] = false; } else if($updateDataDetails[0]->PaymentStatus === '0') {
$result['message'] = "Something went wrong.please try again"; $currentVoucheNumber = $updateDataDetails[0]->VoucherNumber;
} $mySql = "SELECT * FROM ".DAYBOOKMASTER." WHERE (BranchCode = '$branch' AND VoucherNumber = '$currentVoucheNumber')
ORDER BY ID ASC
LIMIT 1 ";
$mySqlUpdate = $this->db->query($mySql);
$mySqlUpdateDetails = $mySqlUpdate->result();
$mySqlUpdateDetailsID = $mySqlUpdateDetails[0]->ID;
} $sql = "SELECT * FROM ".DAYBOOKMASTER." WHERE (BranchCode = '$branch' AND ID < '$mySqlUpdateDetailsID')
ORDER BY ID DESC
LIMIT 1 ";
$currBalance = 0;
$latestUpdate = $this->db->query($sql);
$latestUpdateDetails = $latestUpdate->result();
If(is_array($latestUpdateDetails) && count($latestUpdateDetails)>0)
{
$currBalance = $latestUpdateDetails[0]->Balance;
}else{
}
$sql = "UPDATE ".DAYBOOKMASTER."
SET Status = '$status', Approval_By = '$Approval_By' ,
Approval_Comments = '$Approval_Comments', UpdatedBy = '$UpdatedBy' , UpdatedOn = '$UpdatedOn' , Balance = '$currBalance'
WHERE VoucherNumber = '$currentVoucheNumber' ";
$mBranchDetails = $this->db->query($sql);
// echo $mBranchDetails;
// echo $this->db->affected_rows(); exit();
if ($this->db->affected_rows() >= 1) {
$sql2 = "SELECT * FROM ".DAYBOOKMASTER." WHERE (BranchCode = '$branch' AND ID > '$updateFor')
ORDER BY ID ASC";
$latestUpdate2 = $this->db->query($sql2);
$latestUpdateDetails2 = $latestUpdate2->result();
foreach( $latestUpdateDetails2 as $clip){
if($clip->Name == 'I002' && ($clip->Status == "Pending" || $clip->Status == "Approved" || $clip->Status == "approved" || $clip->Status == "pending")) {
//Income
$currBalance = $currBalance + $clip->Amount;
}else if ($clip->Name == 'I001' && ($clip->Status == "Pending" || $clip->Status == "Approved" || $clip->Status == "approved" || $clip->Status == "pending")) {
//Expense
$currBalance = $currBalance - $clip->Amount;
} else {
}
$updateSql = "UPDATE ".DAYBOOKMASTER." SET Balance ='$currBalance' WHERE ID = '$clip->ID'";
$this->db->query($updateSql);
}
$result['addStatus'] = true;
$result['message'] = "Successfully Details Updated";
} else {
$result['addStatus'] = false;
$result['message'] = "Something went wrong.please try again";
}
}
}
return $result; return $result;
} }

View File

@ -153,6 +153,7 @@ app.constant('JS_REQUIRES', {
'daybookadminCtrl': 'assets/js/controllers/daybookadminCtrl.js', 'daybookadminCtrl': 'assets/js/controllers/daybookadminCtrl.js',
'daybooksuperadminCtrl': 'assets/js/controllers/daybooksuperadminCtrl.js', 'daybooksuperadminCtrl': 'assets/js/controllers/daybooksuperadminCtrl.js',
'daybookapprovalCtrl': 'assets/js/controllers/daybookapprovalCtrl.js', 'daybookapprovalCtrl': 'assets/js/controllers/daybookapprovalCtrl.js',
'daybookadminapprovalCtrl': 'assets/js/controllers/daybookadminapprovalCtrl.js',
'studentStatusUpdateCtrl':'assets/js/controllers/studentStatusUpdateCtrl.js', 'studentStatusUpdateCtrl':'assets/js/controllers/studentStatusUpdateCtrl.js',
'studentViewCtrl':'assets/js/controllers/studentViewCtrl.js', 'studentViewCtrl':'assets/js/controllers/studentViewCtrl.js',

View File

@ -416,13 +416,30 @@ app.config(['$stateProvider', '$urlRouterProvider', '$controllerProvider', '$com
} }
}).state('app.daybookadmin', { }).state('app.daybookadmin', {
url: '/daybookadmin', url: '/daybookadmin',
templateUrl: "assets/views/daybook/daybookadmin.html", template: '<div ui-view class="fade-in-up"> <div style="margin: auto; width: 50%;padding: 10px;"> STUDENT STATUS UPDATE </div> </div>',
title: 'Income/Expense', title: 'Income/Expense',
resolve: loadSequence('spin', 'ladda', 'angular-ladda', 'daybookadminCtrl','ngTable'),
ncyBreadcrumb: { ncyBreadcrumb: {
label: 'Income/Expense' label: 'Income/Expense'
} }
}).state('app.daybooksuperadmin', { }).state('app.daybookadmin.details', {
url: '/daybookadmindetails',
templateUrl: "assets/views/daybook/daybookadmin.html",
title: 'Income/Expense',
resolve: loadSequence('spin', 'ladda', 'angular-ladda', 'daybookadminCtrl','ngTable'),
ncyBreadcrumb: {
label: 'Income/Expense'
}
})
.state('app.daybookadmin.approval', {
url: '/daybookadminApproval',
templateUrl: "assets/views/daybook/dayBookadminApproval.html",
title: 'Approve expense',
resolve: loadSequence('spin', 'ladda', 'angular-ladda', 'daybookadminapprovalCtrl','ngTable'),
ncyBreadcrumb: {
label: 'Approve expense'
}
})
.state('app.daybooksuperadmin', {
url: '/daybooksuperadmin', url: '/daybooksuperadmin',
templateUrl: "assets/views/daybook/daybooksuperadmin.html", templateUrl: "assets/views/daybook/daybooksuperadmin.html",
title: 'Income/Expense', title: 'Income/Expense',

View File

@ -3,54 +3,40 @@
* daybook details capturing * daybook details capturing
* *
*/ */
app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter", "ngTableParams", "API_POINTS", "$localStorage", "$http", "$state", 'ipCookie', '$window', function ($scope, $rootScope, toaster, $filter, ngTableParams, apiPoint, $localStorage, $http, $state, ipCookie, $window) { app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter", "ngTableParams", "API_POINTS", "$localStorage", "$http", "$state", 'ipCookie', '$window','SweetAlert', function ($scope, $rootScope, toaster, $filter, ngTableParams, apiPoint, $localStorage, $http, $state, ipCookie, $window, SweetAlert) {
// get local client details // get local client details
var localDetail = JSON.parse(localStorage.getItem('localObj')); var localDetail = JSON.parse(localStorage.getItem('localObj'));
var localDetails = ipCookie('cookiechk'); var localDetails = ipCookie('cookiechk');
$scope.localTypeViewAdmin = false;
$scope.localTypeViewSuperAdmin = false;
$scope.searchData = { $scope.searchData = {
"date": "", "date": "",
"dateTo": "" "dateTo": ""
} }
// load functionality when page get loaded // get the data while page loading functions goes here
$scope.init = function () { $scope.init = function () {
const LOCALTYPE = localDetail.localType; const LOCALTYPE = localDetail.localType;
if (LOCALTYPE === 'R003') { if(LOCALTYPE === 'R003') {
// getFinanceModuleAccess();
// if(getFinanceModuleAccess()){
$scope.dayBookApprovalAccess = localDetail.is_DayBookApproval_Access;
$scope.showTheRefValue = 'I001';
$scope.localTypeViewAdmin = true;
$scope.currentDate = new Date(); $scope.currentDate = new Date();
var d = new Date();
$scope.oneMonthBefore = d.setMonth(d.getMonth()-1);
// alert($scope.oneMonthBefore);
var formate = "dd-MM-yyyy"; var formate = "dd-MM-yyyy";
$scope.searchData.date = $filter('date')(new Date($scope.currentDate), formate); $scope.searchData.date = $filter('date')(new Date($scope.oneMonthBefore), formate);
$scope.searchData.dateTo = $filter('date')(new Date($scope.currentDate), formate); $scope.searchData.dateTo = $filter('date')(new Date($scope.currentDate), formate);
$scope.getIncomeExpenseType_Status();
$scope.getDayBookList(); $scope.getDayBookList();
// } $scope.getIncomeExpenseType_Status();
} else {
ipCookie.remove('cookiechk'); }else {alert();
$window.localStorage.clear(); ipCookie.remove('cookiechk');
$state.go('login.signin'); $window.localStorage.clear();
// $scope.localTypeViewSuperAdmin = true; $state.go('login.signin');
// $scope.showTheRefValue = 'I001';
// $scope.localTypeViewAdmin = true;
// $scope.currentDate = new Date();
// var formate = "dd-MM-yyyy";
// $scope.searchData.date = $filter('date')(new Date($scope.currentDate), formate);
// $scope.searchData.dateTo = $filter('date')(new Date($scope.currentDate), formate);
// $scope.getIncomeExpenseType_Status();
// $scope.getDayBookList();
} }
} }
$scope.dayBookApprovalAccess = ''; $scope.dayBookApprovalAccess = '';
// Finance module access control
// Finance module access control
function getFinanceModuleAccess() { function getFinanceModuleAccess() {
var getFinacnceModuleAcccessCtrl = { var getFinacnceModuleAcccessCtrl = {
method: 'POST', method: 'POST',
@ -65,14 +51,12 @@ app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter"
$http(getFinacnceModuleAcccessCtrl).then(function (response) { $http(getFinacnceModuleAcccessCtrl).then(function (response) {
if (response.data.dayBkAccessChkStatus) { if (response.data.dayBkAccessChkStatus) {
$scope.dayBookApprovalAccess = response.data.dayBkAccessChk_Value; $scope.dayBookApprovalAccess = response.data.dayBkAccessChk_Value;
$scope.showTheRefValue = 'I001';
$scope.localTypeViewAdmin = true;
$scope.currentDate = new Date(); $scope.currentDate = new Date();
var formate = "dd-MM-yyyy"; var formate = "dd-MM-yyyy";
$scope.searchData.date = $filter('date')(new Date($scope.currentDate), formate); $scope.searchData.date = $filter('date')(new Date($scope.currentDate), formate);
$scope.searchData.dateTo = $filter('date')(new Date($scope.currentDate), formate); $scope.searchData.dateTo = $filter('date')(new Date($scope.currentDate), formate);
$scope.getIncomeExpenseType_Status();
$scope.getDayBookList(); $scope.getDayBookList();
$scope.getIncomeExpenseType_Status();
return true; return true;
} else { } else {
return true; return true;
@ -81,7 +65,9 @@ app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter"
} }
// $scope.getApproveLoad = function() {
// alert();
// }
// change from date, update and call search functionality // change from date, update and call search functionality
$scope.changeDate = function () { $scope.changeDate = function () {
@ -107,14 +93,46 @@ app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter"
} }
} }
// sorting function for table params // sorting function for table params
$scope.sort = function (keyname) { $scope.sort = function (keyname) {
// alert();
$scope.sortKey = keyname; //set the sortKey to the param passed $scope.sortKey = keyname; //set the sortKey to the param passed
$scope.reverse = !$scope.reverse; //if true make it false and vice versa $scope.reverse = !$scope.reverse; //if true make it false and vice versa
} }
// income expense type status list $scope.noRecordFound = true;
$scope.dataLength = 0;
// get day book type name list
$scope.getDayBookList = function () {
var getDatBookListDetails = {
method: 'POST',
url: apiPoint.url + 'getDayBookDetails/',
headers: {
'Content-Type': 'application/json'
},
data: {
data: $scope.searchData,
localReqDetails: localDetails,
}
};
$http(getDatBookListDetails).then(function (response) {
if (response.data.dayBookListStatus) {
$scope.data = response.data.dayBookListDetails;
$scope.dataLength = $scope.data.length;
if ($scope.data.length !== 0) {
$scope.noRecordFound = false;
} else {
$scope.noRecordFound = true;
}
// alert(JSON.stringify($scope.data));
// $scope.incomeExpenseType = response.data.typeNameList;
} else {
}
});
}
// income expense type status list
$scope.getIncomeExpenseType_Status = function () { $scope.getIncomeExpenseType_Status = function () {
var getIncomeExpenseType = { var getIncomeExpenseType = {
method: 'POST', method: 'POST',
@ -135,269 +153,16 @@ app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter"
}); });
} }
$scope.loadingsearch = false; // parse the income and expense type from the list
$scope.noRecordFound = true;
$scope.noRecordFoundSearch = false;
$scope.dataLengthIncome = 0;
$scope.dataLengthExpense = 0;
// day book entry list
$scope.getDayBookList = function () {
$scope.loadingsearch = true;
$scope.noRecordFoundSearch = false;
var getDatBookListDetails = {
method: 'POST',
url: apiPoint.url + 'getDayBookDetails/',
headers: {
'Content-Type': 'application/json'
},
data: {
data: $scope.searchData,
localReqDetails: localDetails,
}
};
$http(getDatBookListDetails).then(function (response) {
if (response.data.dayBookListStatus) {
$scope.loadingsearch = false;
// $scope.data = response.data.dayBookListDetails;
let datas = response.data.dayBookListDetails;
if (datas.length <= 0) {
$scope.noRecordFoundSearch = true;
} else {
$scope.noRecordFoundSearch = false;
}
let searchResultDetailsBef = datas.filter(val => {
return val.Name == 'I001' ? 1 : 0;
});
$scope.IncomeData = datas.filter(val => {
return val.Name == 'I002' ? 1 : 0;
});
$scope.dataLengthIncome = $scope.IncomeData.length;
const filterAddSelect = searchResultDetailsBef.filter(val => {
val['Selected'] = false;
return val;
});
$scope.searchResultDetails = filterAddSelect;
$scope.dataLengthExpense = $scope.searchResultDetails.length;
// alert(JSON.stringify($scope.searchResultDetails));
$scope.searchResultLength = Object.keys($scope.searchResultDetails).length;
// if ($scope.data.length !== 0) {
// $scope.OpenWindowStatus = false;
// $scope.noRecordFound = false;
// } else {
// $scope.OpenWindowStatus = false;
// $scope.noRecordFound = true;
// }
// alert(JSON.stringify($scope.data));
// $scope.incomeExpenseType = response.data.typeNameList;
} else {
$scope.loadingsearch = false;
}
});
}
// select all or individual functionality
var getAllSelected = function () {
var selectedItems = $scope.searchResultDetails.filter(function (item) {
return item.Selected;
});
return selectedItems.length === $scope.searchResultDetails.length;
}
var setAllSelected = function (value) {
angular.forEach($scope.searchResultDetails, function (item) {
item.Selected = value;
});
}
$scope.allSelected = function (value) {
if (value !== undefined) {
return setAllSelected(value);
} else {
return getAllSelected();
}
}
$scope.myStatusModel = {
'staus': '',
'description': '',
}
// End: select all or individual functionality
$scope.OpenWindowStatus = false;
// open popup window when checkbox get selected / close popup window uncheck the selected items
$scope.openUpdateWind = function () {
var ItemsSelected = $scope.searchResultDetails.filter(function (item) {
if (item.Selected === true) { return true; }
});
// $scope.getStatusList();
// alert(ItemsSelected.length);
if (ItemsSelected.length) {
$scope.myStatusModel = {
'staus': '',
'description': '',
}
$scope.OpenWindowStatus = true;
} else {
$scope.OpenWindowStatus = false;
}
}
// update the status details
$scope.statusUpdate = {
submit: function (form, myStatusModel) {
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 selectedItems = [];
var ItemsSelected = $scope.searchResultDetails.filter(function (item) {
if (item.Selected === true && item.Status === 'Pending') {
let itemGetID = new getUpdateDetails(item.ID);
selectedItems.push(itemGetID);
return true;
}
});
function getUpdateDetails(id) {
this.dabookListId = id;
this.ListCodeStatus = $scope.myStatusModel.staus;
this.comments = $scope.myStatusModel.description;
}
if(selectedItems.length > 0) {
var updateStudyMaterial = {
method: 'POST',
url: apiPoint.url + 'updateDayBookStatusAdmin/',
headers: {
'Content-Type': 'application/json'
},
data: {
data: selectedItems,
requestDetails: localDetails
}
};
$http(updateStudyMaterial).then(function (response) {
if (response.data.addStatus) {
swal(" ", "Updated successfully.", "success");
// for success state
$scope.getDayBookList();
$scope.allSelected('undefined');
$scope.OpenWindowStatus = false;
} else {
swal(" ", response.data.message, "error");
}
});
} else {
swal(" ", "Item not Selected", "warning");
}
}
},
reset: function (form) {
form.$setPristine(true);
$scope.myStatusModel = {
'staus': '',
'description': '',
}
}
}
$scope.statusList = [{
"status_id": 'TS001',
"name": "Pending",
}, {
"status_id": 'TS002',
"name": "Approved",
}, {
"status_id": 'TS003',
"name": "Rejected",
}];
$scope.data = [{
"id": 1,
"date": "20-12-2017",
"incomeExpense": "Income",
"type": "typeIncome1",
"amount": "1000",
"status": "Pending",
"description": "income type income type income type"
}, {
"id": 2,
"date": "20-12-2017",
"incomeExpense": "Expense",
"type": "typeIncome2",
"amount": "2000",
"status": "Pending",
"description": "income type income type income type"
}, {
"id": 3,
"date": "20-12-2017",
"incomeExpense": "Expense",
"type": "typeIncome3",
"amount": "3000",
"status": "Pending",
"description": "income type income type income type"
}];
$scope.incomeExpenseType = [{
"type_id": 1,
"type": "Income",
"name": "fees"
}, {
"type_id": 2,
"type": "Expense",
"name": "food"
}, {
"type_id": 3,
"type": "Expense",
"name": "phone"
}, {
"type_id": 4,
"type": "Expense",
"name": "tea-coffee"
}, {
"type_id": 5,
"type": "Expense",
"name": "Paper"
}];
$scope.getIncomeExpense = function () {
$scope.incomeExpenseName = [{
"type_id": 1,
"type": "TYPE001",
"name": "Income"
}, {
"type_id": 2,
"type": "TYPE002",
"name": "Expense"
}];
}
$scope.getIncomeTypes = $scope.incomeExpenseType.filter(function (val) {
return val.type === 'Income' ? 1 : 0;
});
$scope.getExpenseTypes = $scope.incomeExpenseType.filter(function (val) {
return val.type === 'Expense' ? 1 : 0;
});
$scope.getType = function (type) { $scope.getType = function (type) {
// alert(type); $scope.getIncomeTypes = $scope.incomeExpenseType.filter(function (val) {
return val.TypeID === 'I002' ? 1 : 0;
});
$scope.getExpenseTypes = $scope.incomeExpenseType.filter(function (val) {
return val.TypeID === 'I001' ? 1 : 0;
});
$scope.myModelAdd.type = ''; $scope.myModelAdd.type = '';
$scope.getTypes = type === 'Income' ? $scope.getIncomeTypes : $scope.getExpenseTypes; $scope.getTypes = type === 'I002' ? $scope.getIncomeTypes : $scope.getExpenseTypes;
}; };
$scope.editId = -1; $scope.editId = -1;
@ -415,7 +180,12 @@ app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter"
"type": "", "type": "",
"amount": "", "amount": "",
"status": "", "status": "",
"description": "" "description": "",
"paidTo": "",
"description_paid": "",
"voucherNumber": "",
"branch":"",
"name":""
} }
} }
@ -426,22 +196,73 @@ app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter"
"type": "", "type": "",
"amount": "", "amount": "",
"status": "", "status": "",
"description": "" "description": "",
"paidTo": "",
"description_paid": "",
"voucherNumber": "",
"branch": "",
"name":""
} }
$scope.copyModel = function (p) { $scope.copyModel = function (p) {
console.log(p);
$scope.myModel = { $scope.myModel = {
"id": p.id, "id": p.ID,
"date": p.date, "date": p.Date,
"incomeExpense": p.incomeExpense, "incomeExpense": p.Name,
"type": p.type, "type": p.Type,
"amount": p.amount, "amount": p.Amount,
"status": p.status, "status": p.Status,
"description": p.description "description": p.Description,
"paidTo": p.PaidTo,
"description_paid": p.PaidDescription,
"voucherNumber": p.VoucherNumber,
"branch":p.BranchCode,
"name": p.Name
} }
// alert(JSON.stringify($scope.myModel));
} }
// delete the entry row from the daybook list
//delete the income entry From the fees payable
$scope.deleteFeePayableEntry = function (id) {
// alert(id);
SweetAlert.swal({
title: "Warning!",
text: "Do you want to Delete this Entry ?",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#007aff",
confirmButtonText: "Yes!"
}, function (res) {
if (res === true) {
// alert(id);
// alert(stuId);
var deleteFeePayableDetails = {
method: 'POST',
url: apiPoint.url + 'deleteDayBookFeePayableDetails/',
headers: {
'Content-Type': 'application/json'
},
data: {
data: id,
requestDetails: localDetails
}
};
$http(deleteFeePayableDetails).then(function (response) {
if (response.data.deletedStatus) {
swal(" ", "Deleted Successfully.", "success");
$scope.getDayBookList();
} else {
swal(" ", response.data.message, "error");
}
});
}
});
}
// delete the income/expense list row
$scope.deleEditEntry = function (id) { $scope.deleEditEntry = function (id) {
swal({ swal({
title: "Are you sure?", title: "Are you sure?",
@ -453,22 +274,29 @@ app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter"
closeOnConfirm: false closeOnConfirm: false
}, },
function () { function () {
$scope.indexDelete2(); $scope.indexDelete2(id);
// if( $scope.indexDelete2() === true) {
// $scope.data;
// swal("Deleted!", "Your imaginary file has been deleted.", "success");
// }
}); });
$scope.indexDelete2 = function () { $scope.indexDelete2 = function (id) {
let ans = $scope.data.some(function (val, i) { var deleteDetails = {
if (val.id === id) { method: 'POST',
$scope.data.splice(i, 1); url: apiPoint.url + 'deleteDayBookDetails/',
swal(" ", "Your record has been deleted.", "success"); headers: {
return true; 'Content-Type': 'application/json'
},
data: {
data: id,
requestDetails: localDetails
} }
}); return ans; };
$http(deleteDetails).then(function (response) {
if (response.data.deletedStatus) {
swal(" ", "Deleted Successfully.", "success");
$scope.getDayBookList();
} else {
swal(" ", response.data.message, "error");
}
});
} }
} }
$scope.myModelAdd = { $scope.myModelAdd = {
@ -478,10 +306,13 @@ app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter"
"type": "", "type": "",
"amount": "", "amount": "",
"status": "", "status": "",
"description": "" "description": "",
"paidTo": "",
"description_paid": "",
"voucherNumber": ""
} }
// add a new entry to the day book list // add a new daybook entry
$scope.daybookAdd = { $scope.daybookAdd = {
submit: function (form, myModelAdd) { submit: function (form, myModelAdd) {
var firstError = null; var firstError = null;
@ -500,15 +331,51 @@ app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter"
angular.element('.ng-invalid[name=' + firstError + ']').focus(); 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"); // swal("The form cannot be submitted because it contains validation errors!", "Errors are marked with a red, dashed border!", "error");
} else { } else {
var formate = "dd-MM-yyyy"; var formate = "dd-MM-yyyy";
$scope.myModelAdd.date = $filter('date')(new Date($scope.myModelAdd.date), formate); $scope.myModelAdd.date = $filter('date')(new Date($scope.myModelAdd.date), formate);
$scope.myModelAdd.status = 'Pending'; $scope.myModelAdd.status = $scope.myModelAdd.name == 'I001' ? 'Pending' : 'Approved';
$scope.data.push(myModelAdd); // $scope.data.push(myModelAdd);
var addDayBookDetails = {
method: 'POST',
url: apiPoint.url + 'addDayBook/',
headers: {
'Content-Type': 'application/json'
},
data: {
data: myModelAdd,
localReqDetails: localDetails
}
};
$http(addDayBookDetails).then(function (response) {
if (response.data.addDayBookStatus) {
swal(" ", "Income/Expense added successfully.", "success");
$state.go($state.current, {}, { reload: true });
} else {
swal(" ", response.data.message, "error");
}
});
} }
},
reset: function (form) {
form.$setPristine(true);
$scope.myModelAdd = {
"id": "",
"date": "",
"name": "",
"type": "",
"amount": "",
"status": "",
"description": "",
"paidTo": "",
"description_paid": "",
"voucherNumber": ""
}
} }
} }
// update daybook entry data from the list // update a daybook entry details
$scope.daybookeditUpdate = { $scope.daybookeditUpdate = {
submit: function (form, myModel) { submit: function (form, myModel) {
var firstError = null; var firstError = null;
@ -527,60 +394,30 @@ app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter"
angular.element('.ng-invalid[name=' + firstError + ']').focus(); 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"); // swal("The form cannot be submitted because it contains validation errors!", "Errors are marked with a red, dashed border!", "error");
} else { } else {
// var studentForUpdate = []; // alert(JSON.stringify($scope.myModel));exit();
// let formate = "dd-MM-yyyy"; var updateDayBookDetails = {
// $scope.myStatusModel.dateOn = $filter('date')(new Date($scope.myStatusModel.dateOn), formate); method: 'POST',
// var ItemsSelected = $scope.searchResultDetails.filter(function (item) { url: apiPoint.url + 'updateDayBookDetails/',
// if (item.Selected === true) { headers: {
// let getStudentID = new getStudentForUpdateDetails(item.StudentID); 'Content-Type': 'application/json'
// studentForUpdate.push(getStudentID); },
// return true; data: {
// } data: $scope.myModel,
// }); requestDetails: localDetails
// function getStudentForUpdateDetails(id) { }
// this.StudentID = id; };
// this.CourseID = $scope.myStatusModel.semYear; $http(updateDayBookDetails).then(function (response) {
// this.BranchCode = localDetails.localBranchID; if (response.data.updateDetailsStatus) {
// this.ListCode = $scope.myStatusModel.staus; swal(" ","Updated successfully.", "success");
// this.SDate = $scope.myStatusModel.dateOn; // for success state
// this.Coursedetail = id; $scope.editId = -1;
// this.Comments = $scope.myStatusModel.comment; $scope.getDayBookList();
// } } else {
// // alert(JSON.stringify($scope.myStatusModel)); swal(" ", response.data.message, "error");
// // alert(JSON.stringify(studentForUpdate)); }
});
// var updateStudyMaterial = {
// method: 'POST',
// url: apiPoint.url + 'updateStudentMaterialStatus/',
// headers: {
// 'Content-Type': 'application/json'
// },
// data: {
// data: studentForUpdate,
// requestDetails : localDetails
// }
// };
// $http(updateStudyMaterial).then(function (response) {
// if (response.data.addStatus) {
// swal("Success!", response.data.message, "success");
// // for success state
// $scope.allSelected('undefined');
// $scope.OpenWindowStatus = false;
// } else {
// swal("Failed!", response.data.message, "error");
// }
// });
} }
}, }
// reset: function (form) {
// form.$setPristine(true);
// $scope.myStatusModel = {
// 'semYear': '',
// 'staus': '',
// 'dateOn': '',
// 'comment': ''
// }
// }
} }
}]); }]);

View File

@ -0,0 +1,311 @@
'use strict';
/**
* daybook details capturing
*
*/
app.controller('daybookadminapprovalCtrl', ["$scope", "$rootScope", "toaster", "$filter", "ngTableParams", "API_POINTS", "$localStorage", "$http", "$state", 'ipCookie', '$window', function ($scope, $rootScope, toaster, $filter, ngTableParams, apiPoint, $localStorage, $http, $state, ipCookie, $window) {
// get local client details
var localDetail = JSON.parse(localStorage.getItem('localObj'));
var localDetails = ipCookie('cookiechk');
$scope.localTypeViewAdmin = false;
$scope.localTypeViewSuperAdmin = false;
$scope.searchData = {
"date": "",
"dateTo": ""
}
// load functionality when page get loaded
$scope.init = function () {
const LOCALTYPE = localDetail.localType;
if (LOCALTYPE === 'R003') {
// getFinanceModuleAccess();
// // if(getFinanceModuleAccess()){
$scope.dayBookApprovalAccess = localDetail.is_DayBookApproval_Access;
$scope.showTheRefValue = undefined;
$scope.localTypeViewAdmin = true;
$scope.currentDate = new Date();
var d = new Date();
$scope.oneMonthBefore = d.setMonth(d.getMonth()-1);
var formate = "dd-MM-yyyy";
$scope.searchData.date = $filter('date')(new Date($scope.oneMonthBefore), formate);
$scope.searchData.dateTo = $filter('date')(new Date($scope.currentDate), formate);
$scope.getIncomeExpenseType_Status();
$scope.getDayBookList();
// }
} else {
ipCookie.remove('cookiechk');
$window.localStorage.clear();
$state.go('login.signin');
}
}
$scope.dayBookApprovalAccess = '';
// Finance module access control
function getFinanceModuleAccess() {
var getFinacnceModuleAcccessCtrl = {
method: 'POST',
url: apiPoint.url + 'empDayBookModuleAccessChk/',
headers: {
'Content-Type': 'application/json'
},
data: {
localReqDetails: localDetails
}
};
$http(getFinacnceModuleAcccessCtrl).then(function (response) {
if (response.data.dayBkAccessChkStatus) {
$scope.dayBookApprovalAccess = response.data.dayBkAccessChk_Value;
$scope.showTheRefValue = undefined;
$scope.localTypeViewAdmin = true;
$scope.currentDate = new Date();
var formate = "dd-MM-yyyy";
$scope.searchData.date = $filter('date')(new Date($scope.currentDate), formate);
$scope.searchData.dateTo = $filter('date')(new Date($scope.currentDate), formate);
$scope.getIncomeExpenseType_Status();
$scope.getDayBookList();
return true;
} else {
return true;
}
});
}
// change from date, update and call search functionality
$scope.changeDate = function () {
if($scope.searchData.date !== undefined) {
var formate = "dd-MM-yyyy";
$scope.searchData.date = $filter('date')(new Date($scope.searchData.date), formate);
$scope.getDayBookList();
} else {
$scope.searchData.date = '';
$scope.getDayBookList();
}
}
// change to date, update and call search functionality
$scope.changeToDate = function () {
if($scope.searchData.dateTo !== undefined) {
var formate = "dd-MM-yyyy";
$scope.searchData.dateTo = $filter('date')(new Date($scope.searchData.dateTo), formate);
$scope.getDayBookList();
} else {
$scope.searchData.dateTo = '';
$scope.getDayBookList();
}
}
// sorting function for table params
$scope.sort = function (keyname) {
// alert();
$scope.sortKey = keyname; //set the sortKey to the param passed
$scope.reverse = !$scope.reverse; //if true make it false and vice versa
}
// income expense type status list
$scope.getIncomeExpenseType_Status = function () {
var getIncomeExpenseType = {
method: 'POST',
url: apiPoint.url + 'getIncomeExpenseTypeState/',
headers: {
'Content-Type': 'application/json'
},
data: {
localReqDetails: localDetails
}
};
$http(getIncomeExpenseType).then(function (response) {
if (response.data.typeNameStatus) {
$scope.incomeExpenseName = response.data.typeList;
$scope.incomeExpenseType = response.data.typeNameList;
} else {
}
});
}
$scope.loadingsearch = false;
$scope.noRecordFound = true;
$scope.noRecordFoundSearch = false;
$scope.dataLengthIncome = 0;
$scope.dataLengthExpense = 0;
// day book entry list
$scope.getDayBookList = function () {
$scope.loadingsearch = true;
$scope.noRecordFoundSearch = false;
var getDatBookListDetails = {
method: 'POST',
url: apiPoint.url + 'getDayBookDetails/',
headers: {
'Content-Type': 'application/json'
},
data: {
data: $scope.searchData,
localReqDetails: localDetails,
}
};
$http(getDatBookListDetails).then(function (response) {
if (response.data.dayBookListStatus) {
$scope.loadingsearch = false;
// $scope.data = response.data.dayBookListDetails;
$scope.datas = response.data.dayBookListDetails;
const filterAddSelect = $scope.datas.filter(val => {
val['Selected'] = false;
return val;
});
$scope.searchResultDetails = filterAddSelect;
$scope.searchResultDetailsCopy = filterAddSelect;
} else {
$scope.loadingsearch = false;
}
});
}
// Select one row in a table once
$scope.setOneSelect = function (value) {
angular.forEach($scope.searchResultDetails, function (item) {
item.Selected = false;
});
value.Selected = true;
$scope.OpenWindowStatus = true;
$scope.openUpdateWind();
}
$scope.unSelect = function () {
// alert(value.Selected);
angular.forEach($scope.searchResultDetails, function (item) {
item.Selected = false;
});
$scope.openUpdateWind();
}
$scope.myStatusModel = {
'staus': '',
'description': '',
}
// End: select all or individual functionality
$scope.OpenWindowStatus = false;
// open popup window when checkbox get selected / close popup window uncheck the selected items
$scope.openUpdateWind = function () {
var ItemsSelected = $scope.searchResultDetails.filter(function (item) {
if (item.Selected === true) { return true; }
});
if (ItemsSelected.length) {
$scope.myStatusModel = {
'staus': '',
'description': '',
}
$scope.OpenWindowStatus = true;
} else {
$scope.OpenWindowStatus = false;
}
}
// update the status details
$scope.statusUpdate = {
submit: function (form, myStatusModel) {
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();
} else {
var selectedItems = [];
var ItemsSelected = $scope.searchResultDetails.filter(function (item) {
if (item.Selected === true && item.Status === 'Pending' ) {
let itemGetID = new getUpdateDetails(item.ID);
selectedItems.push(itemGetID);
return true;
}
});
function getUpdateDetails(id) {
this.dabookListId = id;
this.ListCodeStatus = $scope.myStatusModel.staus;
this.comments = $scope.myStatusModel.description;
}
if(selectedItems.length > 0) {
var updateStudyMaterial = {
method: 'POST',
url: apiPoint.url + 'updateDayBookStatusAdmin/',
headers: {
'Content-Type': 'application/json'
},
data: {
data: selectedItems,
requestDetails: localDetails
}
};
$http(updateStudyMaterial).then(function (response) {
if (response.data.addStatus) {
swal(" ", "Updated successfully,", "success");
// for success state
$scope.getDayBookList();
$scope.unSelect();
$scope.myStatusModel = {
'staus': '',
'description': '',
}
$scope.allSelected('undefined');
$scope.OpenWindowStatus = false;
} else {
swal(" ", response.data.message, "error");
}
});
} else {
swal(" ", "Item not Selected", "warning");
}
}
},
reset: function (form) {
form.$setPristine(true);
$scope.myStatusModel = {
'staus': '',
'description': '',
}
}
}
$scope.showTheResType = function (type) {
// alert(type);
if (type == undefined) {
$scope.searchResultDetails = $scope.searchResultDetailsCopy;
} else {
$scope.searchResultDetails = $scope.searchResultDetailsCopy.filter(val => {
return val.Name == type ? 1 : 0;
})
}
// const filterAddSelect = $scope.searchResultDetails.filter(val => {
// });
}
$scope.statusList = [{
"status_id": 'TS001',
"name": "Pending",
}, {
"status_id": 'TS002',
"name": "Approved",
}, {
"status_id": 'TS003',
"name": "Rejected",
}];
}]);

View File

@ -23,11 +23,13 @@ app.controller('daybookapprovalCtrl', ["$scope", "$rootScope", "toaster", "$filt
// getFinanceModuleAccess(); // getFinanceModuleAccess();
// // if(getFinanceModuleAccess()){ // // if(getFinanceModuleAccess()){
$scope.dayBookApprovalAccess = localDetail.is_DayBookApproval_Access; $scope.dayBookApprovalAccess = localDetail.is_DayBookApproval_Access;
$scope.showTheRefValue = 'I001'; $scope.showTheRefValue = undefined;
$scope.localTypeViewAdmin = true; $scope.localTypeViewAdmin = true;
$scope.currentDate = new Date(); $scope.currentDate = new Date();
var d = new Date();
$scope.oneMonthBefore = d.setMonth(d.getMonth()-1);
var formate = "dd-MM-yyyy"; var formate = "dd-MM-yyyy";
$scope.searchData.date = $filter('date')(new Date($scope.currentDate), formate); $scope.searchData.date = $filter('date')(new Date($scope.oneMonthBefore), formate);
$scope.searchData.dateTo = $filter('date')(new Date($scope.currentDate), formate); $scope.searchData.dateTo = $filter('date')(new Date($scope.currentDate), formate);
$scope.getIncomeExpenseType_Status(); $scope.getIncomeExpenseType_Status();
$scope.getDayBookList(); $scope.getDayBookList();
@ -36,15 +38,6 @@ app.controller('daybookapprovalCtrl', ["$scope", "$rootScope", "toaster", "$filt
ipCookie.remove('cookiechk'); ipCookie.remove('cookiechk');
$window.localStorage.clear(); $window.localStorage.clear();
$state.go('login.signin'); $state.go('login.signin');
// $scope.localTypeViewSuperAdmin = true;
// $scope.showTheRefValue = 'I001';
// $scope.localTypeViewAdmin = true;
// $scope.currentDate = new Date();
// var formate = "dd-MM-yyyy";
// $scope.searchData.date = $filter('date')(new Date($scope.currentDate), formate);
// $scope.searchData.dateTo = $filter('date')(new Date($scope.currentDate), formate);
// $scope.getIncomeExpenseType_Status();
// $scope.getDayBookList();
} }
} }
@ -65,7 +58,7 @@ app.controller('daybookapprovalCtrl', ["$scope", "$rootScope", "toaster", "$filt
$http(getFinacnceModuleAcccessCtrl).then(function (response) { $http(getFinacnceModuleAcccessCtrl).then(function (response) {
if (response.data.dayBkAccessChkStatus) { if (response.data.dayBkAccessChkStatus) {
$scope.dayBookApprovalAccess = response.data.dayBkAccessChk_Value; $scope.dayBookApprovalAccess = response.data.dayBkAccessChk_Value;
$scope.showTheRefValue = 'I001'; $scope.showTheRefValue = undefined;
$scope.localTypeViewAdmin = true; $scope.localTypeViewAdmin = true;
$scope.currentDate = new Date(); $scope.currentDate = new Date();
var formate = "dd-MM-yyyy"; var formate = "dd-MM-yyyy";
@ -81,8 +74,6 @@ app.controller('daybookapprovalCtrl', ["$scope", "$rootScope", "toaster", "$filt
} }
// change from date, update and call search functionality // change from date, update and call search functionality
$scope.changeDate = function () { $scope.changeDate = function () {
if($scope.searchData.date !== undefined) { if($scope.searchData.date !== undefined) {
@ -107,14 +98,14 @@ app.controller('daybookapprovalCtrl', ["$scope", "$rootScope", "toaster", "$filt
} }
} }
// sorting function for table params // sorting function for table params
$scope.sort = function (keyname) { $scope.sort = function (keyname) {
// alert(); // alert();
$scope.sortKey = keyname; //set the sortKey to the param passed $scope.sortKey = keyname; //set the sortKey to the param passed
$scope.reverse = !$scope.reverse; //if true make it false and vice versa $scope.reverse = !$scope.reverse; //if true make it false and vice versa
} }
// income expense type status list // income expense type status list
$scope.getIncomeExpenseType_Status = function () { $scope.getIncomeExpenseType_Status = function () {
var getIncomeExpenseType = { var getIncomeExpenseType = {
method: 'POST', method: 'POST',
@ -135,12 +126,12 @@ app.controller('daybookapprovalCtrl', ["$scope", "$rootScope", "toaster", "$filt
}); });
} }
$scope.loadingsearch = false; $scope.loadingsearch = false;
$scope.noRecordFound = true; $scope.noRecordFound = true;
$scope.noRecordFoundSearch = false; $scope.noRecordFoundSearch = false;
$scope.dataLengthIncome = 0; $scope.dataLengthIncome = 0;
$scope.dataLengthExpense = 0; $scope.dataLengthExpense = 0;
// day book entry list // day book entry list
$scope.getDayBookList = function () { $scope.getDayBookList = function () {
$scope.loadingsearch = true; $scope.loadingsearch = true;
$scope.noRecordFoundSearch = false; $scope.noRecordFoundSearch = false;
@ -157,66 +148,39 @@ app.controller('daybookapprovalCtrl', ["$scope", "$rootScope", "toaster", "$filt
}; };
$http(getDatBookListDetails).then(function (response) { $http(getDatBookListDetails).then(function (response) {
if (response.data.dayBookListStatus) { if (response.data.dayBookListStatus) {
$scope.loadingsearch = false; $scope.loadingsearch = false;
// $scope.data = response.data.dayBookListDetails; // $scope.data = response.data.dayBookListDetails;
let datas = response.data.dayBookListDetails; $scope.datas = response.data.dayBookListDetails;
if (datas.length <= 0) {
$scope.noRecordFoundSearch = true; const filterAddSelect = $scope.datas.filter(val => {
} else {
$scope.noRecordFoundSearch = false;
}
let searchResultDetailsBef = datas.filter(val => {
return val.Name == 'I001' ? 1 : 0;
});
$scope.IncomeData = datas.filter(val => {
return val.Name == 'I002' ? 1 : 0;
});
$scope.dataLengthIncome = $scope.IncomeData.length;
const filterAddSelect = searchResultDetailsBef.filter(val => {
val['Selected'] = false; val['Selected'] = false;
return val; return val;
}); });
$scope.searchResultDetails = filterAddSelect; $scope.searchResultDetails = filterAddSelect;
$scope.dataLengthExpense = $scope.searchResultDetails.length; $scope.searchResultDetailsCopy = filterAddSelect;
// alert(JSON.stringify($scope.searchResultDetails));
$scope.searchResultLength = Object.keys($scope.searchResultDetails).length;
// if ($scope.data.length !== 0) {
// $scope.OpenWindowStatus = false;
// $scope.noRecordFound = false;
// } else {
// $scope.OpenWindowStatus = false;
// $scope.noRecordFound = true;
// }
// alert(JSON.stringify($scope.data));
// $scope.incomeExpenseType = response.data.typeNameList;
} else { } else {
$scope.loadingsearch = false; $scope.loadingsearch = false;
} }
}); });
} }
// select all or individual functionality // Select one row in a table once
var getAllSelected = function () { $scope.setOneSelect = function (value) {
var selectedItems = $scope.searchResultDetails.filter(function (item) {
return item.Selected;
});
return selectedItems.length === $scope.searchResultDetails.length;
}
var setAllSelected = function (value) {
angular.forEach($scope.searchResultDetails, function (item) { angular.forEach($scope.searchResultDetails, function (item) {
item.Selected = value; item.Selected = false;
}); });
value.Selected = true;
$scope.OpenWindowStatus = true;
$scope.openUpdateWind();
} }
$scope.allSelected = function (value) { $scope.unSelect = function () {
if (value !== undefined) { // alert(value.Selected);
return setAllSelected(value); angular.forEach($scope.searchResultDetails, function (item) {
} else { item.Selected = false;
return getAllSelected(); });
$scope.openUpdateWind();
} }
}
$scope.myStatusModel = { $scope.myStatusModel = {
'staus': '', 'staus': '',
@ -231,9 +195,7 @@ app.controller('daybookapprovalCtrl', ["$scope", "$rootScope", "toaster", "$filt
var ItemsSelected = $scope.searchResultDetails.filter(function (item) { var ItemsSelected = $scope.searchResultDetails.filter(function (item) {
if (item.Selected === true) { return true; } if (item.Selected === true) { return true; }
}); });
// $scope.getStatusList(); if (ItemsSelected.length) {
// alert(ItemsSelected.length);
if (ItemsSelected.length) {
$scope.myStatusModel = { $scope.myStatusModel = {
'staus': '', 'staus': '',
'description': '', 'description': '',
@ -261,8 +223,7 @@ app.controller('daybookapprovalCtrl', ["$scope", "$rootScope", "toaster", "$filt
} }
} }
angular.element('.ng-invalid[name=' + firstError + ']').focus(); 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 {
} else {
var selectedItems = []; var selectedItems = [];
var ItemsSelected = $scope.searchResultDetails.filter(function (item) { var ItemsSelected = $scope.searchResultDetails.filter(function (item) {
if (item.Selected === true && item.Status === 'Pending' ) { if (item.Selected === true && item.Status === 'Pending' ) {
@ -293,6 +254,11 @@ app.controller('daybookapprovalCtrl', ["$scope", "$rootScope", "toaster", "$filt
swal(" ", "Updated successfully,", "success"); swal(" ", "Updated successfully,", "success");
// for success state // for success state
$scope.getDayBookList(); $scope.getDayBookList();
$scope.unSelect();
$scope.myStatusModel = {
'staus': '',
'description': '',
}
$scope.allSelected('undefined'); $scope.allSelected('undefined');
$scope.OpenWindowStatus = false; $scope.OpenWindowStatus = false;
} else { } else {
@ -314,7 +280,20 @@ app.controller('daybookapprovalCtrl', ["$scope", "$rootScope", "toaster", "$filt
} }
} }
$scope.showTheResType = function (type) {
// alert(type);
if (type == undefined) {
$scope.searchResultDetails = $scope.searchResultDetailsCopy;
} else {
$scope.searchResultDetails = $scope.searchResultDetailsCopy.filter(val => {
return val.Name == type ? 1 : 0;
})
}
// const filterAddSelect = $scope.searchResultDetails.filter(val => {
// });
}
$scope.statusList = [{ $scope.statusList = [{
"status_id": 'TS001', "status_id": 'TS001',
@ -327,263 +306,6 @@ app.controller('daybookapprovalCtrl', ["$scope", "$rootScope", "toaster", "$filt
"name": "Rejected", "name": "Rejected",
}]; }];
$scope.data = [{
"id": 1,
"date": "20-12-2017",
"incomeExpense": "Income",
"type": "typeIncome1",
"amount": "1000",
"status": "Pending",
"description": "income type income type income type"
}, {
"id": 2,
"date": "20-12-2017",
"incomeExpense": "Expense",
"type": "typeIncome2",
"amount": "2000",
"status": "Pending",
"description": "income type income type income type"
}, {
"id": 3,
"date": "20-12-2017",
"incomeExpense": "Expense",
"type": "typeIncome3",
"amount": "3000",
"status": "Pending",
"description": "income type income type income type"
}];
$scope.incomeExpenseType = [{
"type_id": 1,
"type": "Income",
"name": "fees"
}, {
"type_id": 2,
"type": "Expense",
"name": "food"
}, {
"type_id": 3,
"type": "Expense",
"name": "phone"
}, {
"type_id": 4,
"type": "Expense",
"name": "tea-coffee"
}, {
"type_id": 5,
"type": "Expense",
"name": "Paper"
}];
$scope.getIncomeExpense = function () {
$scope.incomeExpenseName = [{
"type_id": 1,
"type": "TYPE001",
"name": "Income"
}, {
"type_id": 2,
"type": "TYPE002",
"name": "Expense"
}];
}
$scope.getIncomeTypes = $scope.incomeExpenseType.filter(function (val) {
return val.type === 'Income' ? 1 : 0;
});
$scope.getExpenseTypes = $scope.incomeExpenseType.filter(function (val) {
return val.type === 'Expense' ? 1 : 0;
});
$scope.getType = function (type) {
// alert(type);
$scope.myModelAdd.type = '';
$scope.getTypes = type === 'Income' ? $scope.getIncomeTypes : $scope.getExpenseTypes;
};
$scope.editId = -1;
$scope.setEditId = function (P) {
// alert(id);
$scope.editId = P;
}
$scope.editClose = function () {
$scope.editId = -1;
$scope.myModel = {
"id": "",
"date": "",
"incomeExpense": "",
"type": "",
"amount": "",
"status": "",
"description": ""
}
}
$scope.myModel = {
"id": "",
"date": "",
"incomeExpense": "",
"type": "",
"amount": "",
"status": "",
"description": ""
}
$scope.copyModel = function (p) {
$scope.myModel = {
"id": p.id,
"date": p.date,
"incomeExpense": p.incomeExpense,
"type": p.type,
"amount": p.amount,
"status": p.status,
"description": p.description
}
}
// delete the entry row from the daybook list
$scope.deleEditEntry = function (id) {
swal({
title: "Are you sure?",
text: "Your will not be able to recover this record!",
type: "warning",
showCancelButton: true,
confirmButtonClass: "btn-danger",
confirmButtonText: "Yes, delete it!",
closeOnConfirm: false
},
function () {
$scope.indexDelete2();
// if( $scope.indexDelete2() === true) {
// $scope.data;
// swal("Deleted!", "Your imaginary file has been deleted.", "success");
// }
});
$scope.indexDelete2 = function () {
let ans = $scope.data.some(function (val, i) {
if (val.id === id) {
$scope.data.splice(i, 1);
swal("Deleted!", "Your record has been deleted.", "success");
return true;
}
}); return ans;
}
}
$scope.myModelAdd = {
"id": "",
"date": "",
"name": "",
"type": "",
"amount": "",
"status": "",
"description": ""
}
// add a new entry to the day book list
$scope.daybookAdd = {
submit: function (form, myModelAdd) {
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 formate = "dd-MM-yyyy";
$scope.myModelAdd.date = $filter('date')(new Date($scope.myModelAdd.date), formate);
$scope.myModelAdd.status = 'Pending';
$scope.data.push(myModelAdd);
}
}
}
// update daybook entry data from the list
$scope.daybookeditUpdate = {
submit: function (form, myModel) {
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 studentForUpdate = [];
// let formate = "dd-MM-yyyy";
// $scope.myStatusModel.dateOn = $filter('date')(new Date($scope.myStatusModel.dateOn), formate);
// var ItemsSelected = $scope.searchResultDetails.filter(function (item) {
// if (item.Selected === true) {
// let getStudentID = new getStudentForUpdateDetails(item.StudentID);
// studentForUpdate.push(getStudentID);
// return true;
// }
// });
// function getStudentForUpdateDetails(id) {
// this.StudentID = id;
// this.CourseID = $scope.myStatusModel.semYear;
// this.BranchCode = localDetails.localBranchID;
// this.ListCode = $scope.myStatusModel.staus;
// this.SDate = $scope.myStatusModel.dateOn;
// this.Coursedetail = id;
// this.Comments = $scope.myStatusModel.comment;
// }
// // alert(JSON.stringify($scope.myStatusModel));
// // alert(JSON.stringify(studentForUpdate));
// var updateStudyMaterial = {
// method: 'POST',
// url: apiPoint.url + 'updateStudentMaterialStatus/',
// headers: {
// 'Content-Type': 'application/json'
// },
// data: {
// data: studentForUpdate,
// requestDetails : localDetails
// }
// };
// $http(updateStudyMaterial).then(function (response) {
// if (response.data.addStatus) {
// swal("Success!", response.data.message, "success");
// // for success state
// $scope.allSelected('undefined');
// $scope.OpenWindowStatus = false;
// } else {
// swal("Failed!", response.data.message, "error");
// }
// });
}
},
// reset: function (form) {
// form.$setPristine(true);
// $scope.myStatusModel = {
// 'semYear': '',
// 'staus': '',
// 'dateOn': '',
// 'comment': ''
// }
// }
}
}]); }]);

View File

@ -21,6 +21,7 @@ app.controller('sessionCtrl', ["$scope", "$localStorage", "$state", 'ipCookie',
$scope.getLoginDash = 'superAdmin'; $scope.getLoginDash = 'superAdmin';
} else if (localDetail.localType == 'R003') { } else if (localDetail.localType == 'R003') {
$scope.getLoginDash = 'Admin'; $scope.getLoginDash = 'Admin';
$scope.is_active_DayBookAprlAccess = localDetail.is_DayBookApproval_Access;
} else if (localDetail.localType == 'R002') { } else if (localDetail.localType == 'R002') {
$scope.getLoginDash = 'staff'; $scope.getLoginDash = 'staff';
$scope.is_active_DayBookAprlAccess = localDetail.is_DayBookApproval_Access; $scope.is_active_DayBookAprlAccess = localDetail.is_DayBookApproval_Access;

View File

@ -44,18 +44,9 @@
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="row"> <div class="row">
<!--<div class="col-md-3">
<script>
$(function () {
$("#search").focus();
});
</script>
<input class="form-control" type="text" ng-model="search" id="search" autofocus tabindex="1" placeholder="Search" /><br><br>
</div>-->
<div class="col-md-4"> <div class="col-md-4">
<!--<pre>{{searchData.date}}</pre>--> <div data-ng-controller="DatepickerDemoCtrl">
<div data-ng-controller="DatepickerDemoCtrl">
<label> <label>
From Date From Date
</label> </label>
@ -67,8 +58,7 @@
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<!--<pre>{{searchData.date}}</pre>--> <div data-ng-controller="DatepickerDemoCtrl">
<div data-ng-controller="DatepickerDemoCtrl">
<label> <label>
To Date To Date
</label> </label>
@ -83,30 +73,15 @@
<label for="form-field-select-2"> <label for="form-field-select-2">
Income/Expense Income/Expense
</label> </label>
<!--<pre>{{incomeExpenseName }}</pre>--> <select class="form-control" tabindex="2" class="cs-select cs-skin-elastic" name="addName" ng-model="showTheRefValue" ng-change="showTheResType(showTheRefValue)"
<select class="form-control" tabindex="2" class="cs-select cs-skin-elastic" name="addName" ng-model="showTheRefValue" ng-change="showTheResType(myModelAdd.name)"
required> required>
<option value="" disabled selected>Select</option> <option value="" selected>Select</option>
<option ng-repeat="typeName in incomeExpenseName" ng-selected="showTheRefValue == typeName.ListCode" value="{{typeName.ListCode}}">{{typeName.ListName}}</option> <option ng-repeat="typeName in incomeExpenseName" ng-selected="showTheRefValue == typeName.ListCode" value="{{typeName.ListCode}}">{{typeName.ListName}}</option>
</select> </select>
<span class="error text-small block" ng-if="Form.addName.$dirty && Form.addName.$error.required">Type is Required</span> <span class="error text-small block" ng-if="Form.addName.$dirty && Form.addName.$error.required">Type is Required</span>
</div> </div>
</div> </div>
<!--<div class="row">
<div class="col-md-4 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
</label>
<select class="form-control" tabindex="2" class="cs-select cs-skin-elastic" name="addName" ng-model="showTheRefValue" ng-change="showTheResType(myModelAdd.name)"
required>
<option value="" disabled selected>Select</option>
<option ng-repeat="typeName in incomeExpenseName" ng-selected="showTheRefValue == typeName.ListCode" value="{{typeName.ListCode}}">{{typeName.ListName}}</option>
</select>
<span class="error text-small block" ng-if="Form.addName.$dirty && Form.addName.$error.required">Type is Required</span>
</div>
</div>-->
<div> <div>
<div ng-show="loadingsearch" class="center"> <div ng-show="loadingsearch" class="center">
<span style="color: #007AFF; <span style="color: #007AFF;
@ -117,7 +92,7 @@
<p style="color: red;" align="center"><strong><h3 class="text-center">No <p style="color: red;" align="center"><strong><h3 class="text-center">No
records found... </h3></strong></p> records found... </h3></strong></p>
</div> </div>
<div ng-if="showTheRefValue == 'I002'"> <!--<div ng-if="showTheRefValue == 'I002'">
<style> <style>
.listCoutShow { .listCoutShow {
margin: 12px; margin: 12px;
@ -147,7 +122,6 @@
<table style="width: 100%;" class="table table-hover" ng-if="dataLengthIncome > 0"> <table style="width: 100%;" class="table table-hover" ng-if="dataLengthIncome > 0">
<thead> <thead>
<tr> <tr>
<th ng-click="sort('Date')">Date <th ng-click="sort('Date')">Date
<span class="glyphicon sort-icon" ng-show="sortKey=='Date'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span> <span class="glyphicon sort-icon" ng-show="sortKey=='Date'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th> </th>
@ -155,24 +129,18 @@
<span class="glyphicon sort-icon" ng-show="sortKey=='ListName'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span> <span class="glyphicon sort-icon" ng-show="sortKey=='ListName'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th> </th>
<th>Voucher Number <th>Voucher Number
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='EmailID'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>--> </th>
</th>
<th ng-click="sort('PaidTo')">Paid To / Received From <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> <span class="glyphicon sort-icon" ng-show="sortKey=='PaidTo'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th> </th>
<th>Description/Comments <th>Description/Comments
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='PaidTo'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>--> </th>
</th>
<th ng-click="sort('TypeName')">Type <th ng-click="sort('TypeName')">Type
<span class="glyphicon sort-icon" ng-show="sortKey=='TypeName'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span> <span class="glyphicon sort-icon" ng-show="sortKey=='TypeName'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th> </th>
<th>Amount <th>Amount
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='EmailID'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th> </th>
<!--<th ng-click="sort('amount')">Status
<span class="glyphicon sort-icon" ng-show="sortKey=='EmailID'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>-->
</tr> </tr>
</thead> </thead>
<tbody dir-paginate="p in IncomeData|orderBy:sortKey:reverse|filter:search:strict|itemsPerPage:10"> <tbody dir-paginate="p in IncomeData|orderBy:sortKey:reverse|filter:search:strict|itemsPerPage:10">
@ -192,25 +160,14 @@
</td> </td>
<td>{{p.TypeName}}</td> <td>{{p.TypeName}}</td>
<td>{{p.Amount}}</td> <td>{{p.Amount}}</td>
<!-- <td>
<div id="containersPara">
<div id="wrapper">
{{p.Description}}
</div>
</div>
</td> -->
<!--<td tooltip="{{p.Approval_Comments}}"><span ng-if="p.Status == 'Pending'" style="text-transform: uppercase; text-shadow: 1px 1px #286d5f; color: #55d4bb ">{{p.Status}}</span>
<span ng-if="p.Status == 'Approved'" style="text-transform: uppercase; text-shadow: 1px 1px #166307; color: #2be209 ">{{p.Status}}</span>
<span ng-if="p.Status == 'Rejected'" style="text-transform: uppercase; text-shadow: 1px 1px rgb(167, 88, 15); color: rgba(236, 24, 24, 0.98823529);">{{p.Status}}</span>
</td>-->
</tr> </tr>
</tbody> </tbody>
</table> </table>
<dir-pagination-controls max-size="10" direction-links="true" boundary-links="true"> <dir-pagination-controls max-size="10" direction-links="true" boundary-links="true">
</dir-pagination-controls> </dir-pagination-controls>
</div> </div>
</div> </div>-->
<div ng-if="showTheRefValue == 'I001'"> <div>
<style> <style>
.listCoutShow { .listCoutShow {
margin: 12px; margin: 12px;
@ -237,30 +194,30 @@
</div> </div>
</div> </div>
<div class="table-responsive"> <div class="table-responsive">
<table style="width: 100%;" class="table table-hover" ng-if="dataLengthExpense > 0"> <table style="width: 100%;" class="table table-hover">
<thead> <thead>
<tr> <tr>
<th ng-if="dayBookApprovalAccess == '1'"> <th ng-if="dayBookApprovalAccess == '1'">
<input type="checkbox" ng-hide="allSelectedHide" ng-model="allSelected" ng-change="openUpdateWind()" ng-model-options="{getterSetter: true}" <!--<input type="checkbox" ng-hide="allSelectedHide" ng-model="allSelected" ng-change="openUpdateWind()" ng-model-options="{getterSetter: true}"
/> />-->
</th> </th>
<th ng-click="sort('Date')">Date <th ng-click="sort('Date')">Date
<span class="glyphicon sort-icon" ng-show="sortKey=='Date'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span> <!--<span class="glyphicon sort-icon" ng-show="sortKey=='Date'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th> </th>
<th ng-click="sort('ListName')">Income/Expense <th ng-click="sort('ListName')">Income/Expense
<span class="glyphicon sort-icon" ng-show="sortKey=='ListName'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span> <!--<span class="glyphicon sort-icon" ng-show="sortKey=='ListName'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th> </th>
<th>Voucher Number <th>Voucher Number
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='EmailID'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>--> <!--<span class="glyphicon sort-icon" ng-show="sortKey=='EmailID'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th> </th>
<th ng-click="sort('PaidTo')">Paid To / Received From <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> <!--<span class="glyphicon sort-icon" ng-show="sortKey=='PaidTo'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th> </th>
<th>Description/Comments <th>Description/Comments
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='PaidTo'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>--> <!--<span class="glyphicon sort-icon" ng-show="sortKey=='PaidTo'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th> </th>
<th ng-click="sort('TypeName')">Type <th ng-click="sort('TypeName')">Type
<span class="glyphicon sort-icon" ng-show="sortKey=='TypeName'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span> <!--<span class="glyphicon sort-icon" ng-show="sortKey=='TypeName'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th> </th>
<th>Amount <th>Amount
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='EmailID'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>--> <!--<span class="glyphicon sort-icon" ng-show="sortKey=='EmailID'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
@ -271,12 +228,12 @@
</th> </th>
</tr> </tr>
</thead> </thead>
<tbody dir-paginate="p in searchResultDetails|orderBy:sortKey:reverse|filter:search:strict|itemsPerPage:10"> <tbody dir-paginate="p in searchResultDetails|itemsPerPage:10">
<tr> <tr>
<td> <td>
<label ng-if="dayBookApprovalAccess == '1' && p.Status == 'Pending'"> <label ng-if="dayBookApprovalAccess == '1' && p.Status == 'Pending'">
<input type="checkbox" ng-model="p.Selected" ng-change="openUpdateWind()" /> <input type="checkbox" ng-model="p.Selected" ng-change="setOneSelect(p)" />
<!--{{p.StudentID}}--> <!--{{p.StudentID}}-->
</label> </label>
</td> </td>
@ -319,6 +276,7 @@
<form name="Form" id="form" novalidate ng-submit="statusUpdate.submit(Form, myStatusModel)" method="post"> <form name="Form" id="form" novalidate ng-submit="statusUpdate.submit(Form, myStatusModel)" method="post">
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
</div> </div>
@ -328,6 +286,9 @@
Update Status Update Status
</legend> </legend>
<div class="row"> <div class="row">
<a id="cancel_button" ng-click="unSelect()" tooltip="Close">
<span class="glyphicon glyphicon-remove-circle"></span>
</a>
<div class="col-md-2"> <div class="col-md-2">
</div> </div>
<div class="col-md-8 form-group" ng-class="{'has-error':Form.status.$dirty && Form.status.$invalid, 'has-success':Form.status.$valid}"> <div class="col-md-8 form-group" ng-class="{'has-error':Form.status.$dirty && Form.status.$invalid, 'has-success':Form.status.$valid}">

View File

@ -0,0 +1,360 @@
<!-- start: PAGE TITLE -->
<section id="page-title">
<div class="row">
<div class="col-sm-8">
<h1 class="mainTitle" translate="Approve expense">{{ mainTitle }}</h1>
</div>
<div ncy-breadcrumb></div>
</div>
</section>
<!-- end: PAGE TITLE -->
<!-- start: DAY BOOK -->
<div class="container-fluid container-fullw bg-white">
<div ng-controller="daybookadminapprovalCtrl">
<div ng-init="init()">
<style>
/*#wrapper {
width: 200px;
height: 110px;
}*/
#containersPara {
/*background-color: #fff;*/
width: 160px;
height: 85px;
/*overflow-x: scroll;*/
color: rgba(7, 21, 176, 0.7);
overflow: auto;
display: flex;
justify-content: center;
flex-direction: column;
}
/*.square {
background-color: #00b;
float: left;
height: 90px;
width: 90px;
margin: 5px;
}*/
</style>
<div ng-if="localTypeViewAdmin">
<tabset class="tabbable">
<tab heading="View" id="viewDayBook">
<div class="container-fluid container-fullw">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="col-md-4">
<div data-ng-controller="DatepickerDemoCtrl">
<label>
From Date
</label>
<input type="text" tabindex="1" class="form-control " ng-click="startOpen = !startOpen" datepicker-popup="dd-MM-yyyy" ng-model="searchData.date"
is-open="startOpen" ng-init="startOpen = false" name="addDate" datepicker-options="dateOptions"
placeholder="Select Date" close-text="Close" required="required" ng-change="changeDate()"
show-button-bar="true" />
</div>
</div>
<div class="col-md-4">
<div data-ng-controller="DatepickerDemoCtrl">
<label>
To Date
</label>
<input type="text" tabindex="1" class="form-control " ng-click="startOpen = !startOpen" datepicker-popup="dd-MM-yyyy" ng-model="searchData.dateTo"
is-open="startOpen" ng-init="startOpen = false" name="addDate" datepicker-options="dateOptions"
placeholder="Select Date" close-text="Close" required="required" ng-change="changeToDate()"
show-button-bar="true" />
</div>
</div>
<div class="col-md-4 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
</label>
<select class="form-control" tabindex="2" class="cs-select cs-skin-elastic" name="addName" ng-model="showTheRefValue" ng-change="showTheResType(showTheRefValue)"
required>
<option value="" selected>Select</option>
<option ng-repeat="typeName in incomeExpenseName" ng-selected="showTheRefValue == typeName.ListCode" value="{{typeName.ListCode}}">{{typeName.ListName}}</option>
</select>
<span class="error text-small block" ng-if="Form.addName.$dirty && Form.addName.$error.required">Type is Required</span>
</div>
</div>
<div>
<div ng-show="loadingsearch" class="center">
<span style="color: #007AFF;
font-size: 16px;">Loading...</span>
</div>
</div>
<div class="center" ng-show="noRecordFoundSearch">
<p style="color: red;" align="center"><strong><h3 class="text-center">No
records found... </h3></strong></p>
</div>
<!--<div ng-if="showTheRefValue == 'I002'">
<style>
.listCoutShow {
margin: 12px;
padding: 4px;
padding-left: 10px;
padding-right: 10px;
border: 1px solid #59b176;
border-radius: 7px;
color: #FFF;
background-color: #5fba7d;
text-align: center;
}
</style>
<div class="row" ng-if="dataLengthIncome > 0">
<div class="pull-right">
<div style="margin: 8px;">
<div style="width: 45px; display: initial;">
<span style="font-size: 14px;
color: black;">Total Count:</span>
<span class="listCoutShow">{{ dataLengthIncome }}</span>
</div>
</div>
</div>
</div>
<div class="table-responsive">
<table style="width: 100%;" class="table table-hover" ng-if="dataLengthIncome > 0">
<thead>
<tr>
<th ng-click="sort('Date')">Date
<span class="glyphicon sort-icon" ng-show="sortKey=='Date'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>
<th ng-click="sort('ListName')">Income/Expense
<span class="glyphicon sort-icon" ng-show="sortKey=='ListName'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>
<th>Voucher Number
</th>
<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>Description/Comments
</th>
<th ng-click="sort('TypeName')">Type
<span class="glyphicon sort-icon" ng-show="sortKey=='TypeName'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>
<th>Amount
</th>
</tr>
</thead>
<tbody dir-paginate="p in IncomeData|orderBy:sortKey:reverse|filter:search:strict|itemsPerPage:10">
<tr>
<td>{{p.Date}}</td>
<td>{{p.ListName}}</td>
<td>{{p.VoucherNumber}}</td>
<td>{{p.PaidTo}}</td>
<td>
<div id="containersPara">
<div id="wrapper">
{{p.PaidDescription}} / {{p.Description}}
</div>
</div>
</td>
<td>{{p.TypeName}}</td>
<td>{{p.Amount}}</td>
</tr>
</tbody>
</table>
<dir-pagination-controls max-size="10" direction-links="true" boundary-links="true">
</dir-pagination-controls>
</div>
</div>-->
<div>
<style>
.listCoutShow {
margin: 12px;
padding: 4px;
padding-left: 10px;
padding-right: 10px;
border: 1px solid #59b176;
border-radius: 7px;
color: #FFF;
background-color: #5fba7d;
text-align: center;
}
</style>
<div class="row">
<div class="pull-right" ng-if="dataLengthExpense > 0">
<div style="margin: 8px;">
<div style="width: 45px; display: initial;">
<span style="font-size: 14px;
color: black;">Total Count:</span>
<span class="listCoutShow">{{ dataLengthExpense }}</span>
</div>
</div>
</div>
</div>
<div class="table-responsive">
<table style="width: 100%;" class="table table-hover">
<thead>
<tr>
<th ng-if="dayBookApprovalAccess == '1'">
<!--<input type="checkbox" ng-hide="allSelectedHide" ng-model="allSelected" ng-change="openUpdateWind()" ng-model-options="{getterSetter: true}"
/>-->
</th>
<th ng-click="sort('Date')">Date
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='Date'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th>
<th ng-click="sort('ListName')">Income/Expense
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='ListName'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th>
<th>Voucher Number
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='EmailID'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th>
<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>Description/Comments
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='PaidTo'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th>
<th ng-click="sort('TypeName')">Type
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='TypeName'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th>
<th>Amount
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='EmailID'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th>
<th ng-click="sort('Status')">Status
<span class="glyphicon sort-icon" ng-show="sortKey=='Status'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>
</tr>
</thead>
<tbody dir-paginate="p in searchResultDetails|itemsPerPage:10">
<tr>
<td>
<label ng-if="dayBookApprovalAccess == '1' && p.Status == 'Pending'">
<input type="checkbox" ng-model="p.Selected" ng-change="setOneSelect(p)" />
<!--{{p.StudentID}}-->
</label>
</td>
<td>{{p.Date}}</td>
<td>{{p.ListName}}</td>
<td>{{p.VoucherNumber}}</td>
<td>{{p.PaidTo}}</td>
<td>
<div id="containersPara">
<div id="wrapper">
{{p.PaidDescription}} / {{p.Description}}
</div>
</div>
</td>
<td>{{p.TypeName}}</td>
<td>{{p.Amount}}</td>
<!-- <td>
<div id="containersPara">
<div id="wrapper">
{{p.Description}}
</div>
</div>
</td> -->
<td tooltip="{{p.Approval_Comments}} BY {{p.Approved_by_name}}"><span ng-if="p.Status == 'Pending'" style="text-transform: uppercase; text-shadow: 1px 1px #286d5f; color: #55d4bb ">{{p.Status}}</span>
<span ng-if="p.Status == 'Approved'" style="text-transform: uppercase; text-shadow: 1px 1px #166307; color: #2be209 ">{{p.Status}}</span>
<span ng-if="p.Status == 'Rejected'" style="text-transform: uppercase; text-shadow: 1px 1px rgb(167, 88, 15); color: rgba(236, 24, 24, 0.98823529);">{{p.Status}}</span>
</td>
</tr>
</tbody>
</table>
<dir-pagination-controls max-size="10" direction-links="true" boundary-links="true">
</dir-pagination-controls>
</div>
</div>
</div>
</div>
</div>
<div ng-if="OpenWindowStatus">
<form name="Form" id="form" novalidate ng-submit="statusUpdate.submit(Form, myStatusModel)" method="post">
<div class="container">
<div class="row">
<div class="col-md-4">
</div>
<div class="col-md-4">
<fieldset style="background-color: #eaeaea;">
<legend>
Update Status
</legend>
<div class="row">
<a id="cancel_button" ng-click="unSelect()" tooltip="Close">
<span class="glyphicon glyphicon-remove-circle"></span>
</a>
<div class="col-md-2">
</div>
<div class="col-md-8 form-group" ng-class="{'has-error':Form.status.$dirty && Form.status.$invalid, 'has-success':Form.status.$valid}">
<label for="form-field-select-2">
Status <span class="symbol required"></span>
</label>
<select class="form-control" tabindex="4" class="cs-select cs-skin-elastic" name="status" ng-model="myStatusModel.staus"
required>
<option value="" disabled selected>Select Status</option>
<option ng-repeat="itemStatus in statusList" value="{{itemStatus.name}}">{{itemStatus.name}}</option>
</select>
<span class="error text-small block" ng-if="Form.status.$dirty && Form.status.$error.required">Status is Required</span>
</div>
</div>
<div>
<div class="row">
<div class="col-md-12 form-group" ng-class="{'has-error':Form.description.$dirty && Form.description.$invalid}">
<label>
Comments
</label>
<textarea type="text" placeholder="Enter Comments" tabindex="3" class="form-control" name="description" ng-model="myStatusModel.description"
maxlength="100" />
<span class="text-small block">Max 100 Characters.</span>
<span class="error text-small block" ng-if="Form.description.$dirty && Form.description.$error.pattern">Invalid Comments</span>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="center">
<button type="submit" tabindex="8" ladda="ldloading1.zoom_in" class="btn btn-sm btn-success" data-style="zoom-in">
Update
</button>
<!--<button type="reset" tabindex="9" class="btn btn-warning btn-wide" tabindex="9" ng-click="employeeForm.resetCourse(Form)">
Reset
</button>-->
</div>
</div>
</div>
</fieldset>
</div>
<div class="col-md-4">
</div>
</div>
</div>
</form>
</div>
</tab>
</tabset>
</div>
</div>
</div>
</div>
<!-- end: DAY BOOK -->
<section id="page-title">
<div class="row">
<!--<div class="col-sm-8">
<h1 class="mainTitle" translate="sidebar.nav.profile.MAIN">{{ mainTitle }}</h1>
</div>
<div ncy-breadcrumb></div>-->
</div>
</section>

View File

@ -102,10 +102,10 @@
<thead> <thead>
<tr> <tr>
<th ng-click="sort('Date')">Date <th ng-click="sort('Date')">Date
<span class="glyphicon sort-icon" ng-show="sortKey=='Date'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span> <!--<span class="glyphicon sort-icon" ng-show="sortKey=='Date'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th> </th>
<th ng-click="sort('ListName')">Income/Expense <th ng-click="sort('ListName')">Income/Expense
<span class="glyphicon sort-icon" ng-show="sortKey=='ListName'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span> <!--<span class="glyphicon sort-icon" ng-show="sortKey=='ListName'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th> </th>
<th>Voucher Number / Bill Number <th>Voucher Number / Bill Number
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='EmailID'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>--> <!--<span class="glyphicon sort-icon" ng-show="sortKey=='EmailID'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
@ -114,7 +114,7 @@
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='EmailID'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>--> <!--<span class="glyphicon sort-icon" ng-show="sortKey=='EmailID'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th> </th>
<th ng-click="sort('TypeName')">Type <th ng-click="sort('TypeName')">Type
<span class="glyphicon sort-icon" ng-show="sortKey=='TypeName'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span> <!--<span class="glyphicon sort-icon" ng-show="sortKey=='TypeName'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th> </th>
<th>Amount <th>Amount
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='Amount'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>--> <!--<span class="glyphicon sort-icon" ng-show="sortKey=='Amount'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
@ -124,13 +124,13 @@
</th> </th>
<th class="center" ng-click="sort('Status')">Status <th class="center" ng-click="sort('Status')">Status
<span class="glyphicon sort-icon" ng-show="sortKey=='Status'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span> <!--<span class="glyphicon sort-icon" ng-show="sortKey=='Status'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th> </th>
<th class="center">Activity <th class="center">Activity
</th> </th>
</tr> </tr>
</thead> </thead>
<tbody dir-paginate="p in data|orderBy:sortKey:reverse|filter:search:strict|itemsPerPage:10"> <tbody dir-paginate="p in data|itemsPerPage:10">
<tr> <tr>
<td>{{p.Date}}</td> <td>{{p.Date}}</td>
<td>{{p.ListName}}</td> <td>{{p.ListName}}</td>
@ -156,8 +156,10 @@
</span> </span>
</td> </td>
<td class="center" ng-if="p.Status == 'Pending'"> <td class="center" ng-if="p.Status == 'Pending'">
<span ng-if=" p.PaymentStatus == 1 ">
<span> <i tooltip="EDIT" class="glyphicon glyphicon-pencil" ng-click="setEditId(p.ID)"></i> </span> <span> <i tooltip="EDIT" class="glyphicon glyphicon-pencil" ng-click="setEditId(p.ID)"></i> </span>
<span> <i tooltip="DELETE" class="glyphicon glyphicon-remove" ng-click="deleEditEntry(p.ID)"></i> </span> <span> <i tooltip="DELETE" class="glyphicon glyphicon-remove" ng-click="deleEditEntry(p.ID)"></i> </span>
</span>
</td> </td>
</tr> </tr>
<tr ng-show="editId === p.ID" ng-if="editId === p.ID"> <tr ng-show="editId === p.ID" ng-if="editId === p.ID">

View File

@ -11,383 +11,378 @@
<!-- start: DAY BOOK --> <!-- start: DAY BOOK -->
<div class="container-fluid container-fullw bg-white"> <div class="container-fluid container-fullw bg-white">
<div ng-controller="daybookadminCtrl"> <div ng-controller="daybookadminCtrl">
<div ng-init="init()"> <tabset class="tabbable" ng-init="init()">
<style> <tab heading="View" id="viewDayBook">
/*#wrapper { <div class="container-fluid container-fullw">
width: 200px; <div class="row">
height: 110px; <!--<div class="col-md-12" align="center">
}*/ <spinner name="html5spinner">
<div class="overlay"></div>
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
<div class="please-wait">Please Wait...</div>
</spinner>
</div>
#containersPara { <div class="col-md-12" ng-if="studentData == false" style="min-height: 281px;">
/*background-color: #fff;*/ <p style="color: red;" align="center"><strong><h3 class="text-center">No
width: 160px; records found... </h3></strong></p>
height: 85px; </div>-->
/*overflow-x: scroll;*/
color: rgba(7, 21, 176, 0.7); <div class="col-md-12">
overflow: auto;
display: flex;
justify-content: center;
flex-direction: column;
}
/*.square {
background-color: #00b;
float: left;
height: 90px;
width: 90px;
margin: 5px;
}*/
</style>
<div ng-if="localTypeViewAdmin">
<tabset class="tabbable">
<tab heading="View" id="viewDayBook">
<div class="container-fluid container-fullw">
<div class="row"> <div class="row">
<div class="col-md-12"> <!--<div class="col-md-3">
<div class="row"> <script>
<!--<div class="col-md-3"> $(function () {
<script> $("#search").focus();
$(function () { });
$("#search").focus(); </script>
}); <input class="form-control" type="text" ng-model="search" id="search" autofocus tabindex="1" placeholder="Search" /><br><br>
</script> </div>-->
<input class="form-control" type="text" ng-model="search" id="search" autofocus tabindex="1" placeholder="Search" /><br><br> <div class="col-md-4">
</div>--> <!--<pre>{{searchData.date}}</pre>-->
<div data-ng-controller="DatepickerDemoCtrl">
<div class="col-md-4"> <label>
<!--<pre>{{searchData.date}}</pre>-->
<div data-ng-controller="DatepickerDemoCtrl">
<label>
From Date From Date
</label> </label>
<input type="text" tabindex="1" class="form-control " ng-click="startOpen = !startOpen" datepicker-popup="dd-MM-yyyy" ng-model="searchData.date" <input type="text" tabindex="1" class="form-control " ng-click="startOpen = !startOpen" datepicker-popup="dd-MM-yyyy" ng-model="searchData.date"
is-open="startOpen" ng-init="startOpen = false" name="addDate" datepicker-options="dateOptions" is-open="startOpen" ng-init="startOpen = false" name="addDate" datepicker-options="dateOptions"
placeholder="Select Date" close-text="Close" required="required" ng-change="changeDate()" placeholder="Select Date" close-text="Close" required="required" ng-change="changeDate()"
show-button-bar="true" /> show-button-bar="true" />
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<!--<pre>{{searchData.date}}</pre>--> <!--<pre>{{searchData.date}}</pre>-->
<div data-ng-controller="DatepickerDemoCtrl"> <div data-ng-controller="DatepickerDemoCtrl">
<label> <label>
To Date To Date
</label> </label>
<input type="text" tabindex="1" class="form-control " ng-click="startOpen = !startOpen" datepicker-popup="dd-MM-yyyy" ng-model="searchData.dateTo" <input type="text" tabindex="1" class="form-control " ng-click="startOpen = !startOpen" datepicker-popup="dd-MM-yyyy" ng-model="searchData.dateTo"
is-open="startOpen" ng-init="startOpen = false" name="addDate" datepicker-options="dateOptions" is-open="startOpen" ng-init="startOpen = false" name="addDate" datepicker-options="dateOptions"
placeholder="Select Date" close-text="Close" required="required" ng-change="changeToDate()" placeholder="Select Date" close-text="Close" required="required" ng-change="changeToDate()"
show-button-bar="true" /> show-button-bar="true" />
</div>
</div>
<div class="col-md-4 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
</label>
<!--<pre>{{incomeExpenseName }}</pre>-->
<select class="form-control" tabindex="2" class="cs-select cs-skin-elastic" name="addName" ng-model="showTheRefValue" ng-change="showTheResType(myModelAdd.name)"
required>
<option value="" disabled selected>Select</option>
<option ng-repeat="typeName in incomeExpenseName" ng-selected="showTheRefValue == typeName.ListCode" value="{{typeName.ListCode}}">{{typeName.ListName}}</option>
</select>
<span class="error text-small block" ng-if="Form.addName.$dirty && Form.addName.$error.required">Type is Required</span>
</div>
</div> </div>
<!--<div class="row">
<div class="col-md-4 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
</label>
<select class="form-control" tabindex="2" class="cs-select cs-skin-elastic" name="addName" ng-model="showTheRefValue" ng-change="showTheResType(myModelAdd.name)"
required>
<option value="" disabled selected>Select</option>
<option ng-repeat="typeName in incomeExpenseName" ng-selected="showTheRefValue == typeName.ListCode" value="{{typeName.ListCode}}">{{typeName.ListName}}</option>
</select>
<span class="error text-small block" ng-if="Form.addName.$dirty && Form.addName.$error.required">Type is Required</span>
</div>
</div>-->
<div>
<div ng-show="loadingsearch" class="center">
<span style="color: #007AFF;
font-size: 16px;">Loading...</span>
</div>
</div>
<div class="center" ng-show="noRecordFoundSearch">
<p style="color: red;" align="center"><strong><h3 class="text-center">No
records found... </h3></strong></p>
</div>
<div ng-if="showTheRefValue == 'I002'">
<style>
.listCoutShow {
margin: 12px;
padding: 4px;
padding-left: 10px;
padding-right: 10px;
border: 1px solid #59b176;
border-radius: 7px;
color: #FFF;
background-color: #5fba7d;
text-align: center;
}
</style>
<div class="row" ng-if="dataLengthIncome > 0">
<div class="pull-right">
<div style="margin: 8px;">
<div style="width: 45px; display: initial;">
<span style="font-size: 14px;
color: black;">Total Count:</span>
<span class="listCoutShow">{{ dataLengthIncome }}</span>
</div>
</div>
</div>
</div>
<div class="table-responsive">
<table style="width: 100%;" class="table table-hover" ng-if="dataLengthIncome > 0">
<thead>
<tr>
<th ng-click="sort('Date')">Date
<span class="glyphicon sort-icon" ng-show="sortKey=='Date'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>
<th ng-click="sort('ListName')">Income/Expense
<span class="glyphicon sort-icon" ng-show="sortKey=='ListName'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>
<th>Voucher Number
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='EmailID'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th>
<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>Description/Comments
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='PaidTo'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th>
<th ng-click="sort('TypeName')">Type
<span class="glyphicon sort-icon" ng-show="sortKey=='TypeName'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>
<th>Amount
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='EmailID'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th>
<!--<th ng-click="sort('amount')">Status
<span class="glyphicon sort-icon" ng-show="sortKey=='EmailID'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>-->
</tr>
</thead>
<tbody dir-paginate="p in IncomeData|orderBy:sortKey:reverse|filter:search:strict|itemsPerPage:10">
<tr>
<td>{{p.Date}}</td>
<td>{{p.ListName}}</td>
<td>{{p.VoucherNumber}}</td>
<td>{{p.PaidTo}}</td>
<td>
<div id="containersPara">
<div id="wrapper">
{{p.PaidDescription}} / {{p.Description}}
</div>
</div>
</td>
<td>{{p.TypeName}}</td>
<td>{{p.Amount}}</td>
<!-- <td>
<div id="containersPara">
<div id="wrapper">
{{p.Description}}
</div>
</div>
</td> -->
<!--<td tooltip="{{p.Approval_Comments}}"><span ng-if="p.Status == 'Pending'" style="text-transform: uppercase; text-shadow: 1px 1px #286d5f; color: #55d4bb ">{{p.Status}}</span>
<span ng-if="p.Status == 'Approved'" style="text-transform: uppercase; text-shadow: 1px 1px #166307; color: #2be209 ">{{p.Status}}</span>
<span ng-if="p.Status == 'Rejected'" style="text-transform: uppercase; text-shadow: 1px 1px rgb(167, 88, 15); color: rgba(236, 24, 24, 0.98823529);">{{p.Status}}</span>
</td>-->
</tr>
</tbody>
</table>
<dir-pagination-controls max-size="10" direction-links="true" boundary-links="true">
</dir-pagination-controls>
</div>
</div>
<div ng-if="showTheRefValue == 'I001'">
<style>
.listCoutShow {
margin: 12px;
padding: 4px;
padding-left: 10px;
padding-right: 10px;
border: 1px solid #59b176;
border-radius: 7px;
color: #FFF;
background-color: #5fba7d;
text-align: center;
}
</style>
<div class="row">
<div class="pull-right" ng-if="dataLengthExpense > 0">
<div style="margin: 8px;">
<div style="width: 45px; display: initial;">
<span style="font-size: 14px;
color: black;">Total Count:</span>
<span class="listCoutShow">{{ dataLengthExpense }}</span>
</div>
</div>
</div>
</div>
<div class="table-responsive">
<table style="width: 100%;" class="table table-hover" ng-if="dataLengthExpense > 0">
<thead>
<tr>
<!--<th></th>-->
<th ng-if="dayBookApprovalAccess == '1'">
<input type="checkbox" ng-hide="allSelectedHide" ng-model="allSelected" ng-change="openUpdateWind()" ng-model-options="{getterSetter: true}"
/>
</th>
<th ng-click="sort('Date')">Date
<span class="glyphicon sort-icon" ng-show="sortKey=='Date'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>
<th ng-click="sort('ListName')">Income/Expense
<span class="glyphicon sort-icon" ng-show="sortKey=='ListName'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>
<th>Voucher Number
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='EmailID'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th>
<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>Description/Comments
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='PaidTo'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th>
<th ng-click="sort('TypeName')">Type
<span class="glyphicon sort-icon" ng-show="sortKey=='TypeName'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>
<th>Amount
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='EmailID'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th>
<th ng-click="sort('Status')">Status
<span class="glyphicon sort-icon" ng-show="sortKey=='Status'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>
</tr>
</thead>
<tbody dir-paginate="p in searchResultDetails|orderBy:sortKey:reverse|filter:search:strict|itemsPerPage:10">
<tr>
<td ng-if="dayBookApprovalAccess == '1' && p.Status == 'Pending'">
<label >
<input type="checkbox" ng-model="p.Selected" ng-change="openUpdateWind()" />
<!--{{p.StudentID}}-->
</label>
</td>
<td>{{p.Date}}</td>
<td>{{p.ListName}}</td>
<td>{{p.VoucherNumber}}</td>
<td>{{p.PaidTo}}</td>
<td>
<div id="containersPara">
<div id="wrapper">
{{p.PaidDescription}} / {{p.Description}}
</div>
</div>
</td>
<td>{{p.TypeName}}</td>
<td>{{p.Amount}}</td>
<!-- <td>
<div id="containersPara">
<div id="wrapper">
{{p.Description}}
</div>
</div>
</td> -->
<td tooltip="{{p.Approval_Comments}} BY {{p.Approved_by_name}}"><span ng-if="p.Status == 'Pending'" style="text-transform: uppercase; text-shadow: 1px 1px #286d5f; color: #55d4bb ">{{p.Status}}</span>
<span ng-if="p.Status == 'Approved'" style="text-transform: uppercase; text-shadow: 1px 1px #166307; color: #2be209 ">{{p.Status}}</span>
<span ng-if="p.Status == 'Rejected'" style="text-transform: uppercase; text-shadow: 1px 1px rgb(167, 88, 15); color: rgba(236, 24, 24, 0.98823529);">{{p.Status}}</span>
</td>
</tr>
</tbody>
</table>
<dir-pagination-controls max-size="10" direction-links="true" boundary-links="true">
</dir-pagination-controls>
</div>
</div>
</div> </div>
</div> </div>
</div> <!--<div class="col-md-12" ng-if="noRecordFound == true" style="min-height: 281px;">
<div ng-if="OpenWindowStatus"> <p style="color: red;" align="center"><strong><h3 class="text-center">No
<form name="Form" id="form" novalidate ng-submit="statusUpdate.submit(Form, myStatusModel)" method="post"> records found... </h3></strong></p>
<div class="container"> </div>-->
<div class="row"> <style>
<div class="col-md-4"> .listCoutShow {
</div> margin: 12px;
padding: 4px;
padding-left: 10px;
padding-right: 10px;
border: 1px solid #59b176;
border-radius: 7px;
color: #FFF;
background-color: #5fba7d;
text-align: center;
}
</style>
<div class="col-md-4"> <div class="row">
<fieldset style="background-color: #eaeaea;"> <div class="pull-right">
<legend> <div style="margin: 8px;">
Update Status <div style="width: 45px; display: initial;">
</legend> <span style="font-size: 14px;
<div class="row"> color: black;">Total Count:</span> <span class="listCoutShow">{{ dataLength }}</span>
<div class="col-md-2"> </div>
</div> </div>
<div class="col-md-8 form-group" ng-class="{'has-error':Form.status.$dirty && Form.status.$invalid, 'has-success':Form.status.$valid}"> </div>
<label for="form-field-select-2"> </div>
Status <span class="symbol required"></span> <div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th ng-click="sort('Date')">Date
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='Date'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th>
<th ng-click="sort('ListName')">Income/Expense
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='ListName'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th>
<th>Voucher Number / Bill Number
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='EmailID'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th>
<th>Paid To / Received From
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='EmailID'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th>
<th ng-click="sort('TypeName')">Type
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='TypeName'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th>
<th>Amount
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='Amount'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th>
<th>Balance
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='Amount'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th>
<th class="center" ng-click="sort('Status')">Status
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='Status'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
</th>
<th class="center">Activity
</th>
</tr>
</thead>
<tbody dir-paginate="p in data|itemsPerPage:10">
<tr>
<td>{{p.Date}}</td>
<td>{{p.ListName}}</td>
<td>{{p.VoucherNumber}}</td>
<td>{{p.PaidTo}}</td>
<td>
<span ng-if=" p.PaymentStatus == 1 ">{{p.TypeName}}</span>
<span tooltip="Fees Updation" ng-if=" p.PaymentStatus == 0 " style="color:chocolate">{{p.TypeName}}</span></td>
<td>{{p.Amount}}</td>
<td>{{p.Balance}}</td>
<!--<td class="center" tooltip="{{p.Approval_Comments}}" ng-if="p.ListName == 'Income'">
- </td>-->
<td class="center" tooltip="{{p.Approval_Comments}}"><span ng-if="p.Status == 'Pending'" style="text-transform: uppercase; text-shadow: 1px 1px #286d5f; color: #55d4bb ">{{p.Status}}</span>
<span ng-if="p.Status == 'Approved'" style="text-transform: uppercase; text-shadow: 1px 1px #166307; color: #2be209 ">{{p.Status}}</span>
<span ng-if="p.Status == 'Rejected'" style="text-transform: uppercase; text-shadow: 1px 1px rgb(167, 88, 15); color: rgba(236, 24, 24, 0.98823529);">{{p.Status}}</span>
</td>
<td class="center" ng-if="p.Status != 'Pending' && p.ListName != 'Income' ">-</td>
<td class="center" ng-if="p.ListName == 'Income' ">
<span ng-if=" p.PaymentStatus == 1 "> <i tooltip="EDIT" class="glyphicon glyphicon-pencil" ng-click="setEditId(p.ID)"></i> </span>
<span ng-if=" p.PaymentStatus == 0 ">
<i tooltip="DELETE" class="glyphicon glyphicon-remove" ng-click="deleteFeePayableEntry(p.ID)"></i>
</span>
</td>
<td class="center" ng-if="p.Status == 'Pending'">
<span ng-if=" p.PaymentStatus == 1 ">
<span> <i tooltip="EDIT" class="glyphicon glyphicon-pencil" ng-click="setEditId(p.ID)"></i> </span>
<span> <i tooltip="DELETE" class="glyphicon glyphicon-remove" ng-click="deleEditEntry(p.ID)"></i> </span>
</span>
</td>
</tr>
<tr ng-show="editId === p.ID" ng-if="editId === p.ID">
<!--<pre>{{ p }}</pre>-->
<td colspan="9">
<form name="Form" id="form" novalidate ng-submit="daybookeditUpdate.submit(Form, myModel)" method="post">
<div ng-init="copyModel(p)" class="container" style="background-color: rgb(248, 248, 248);
border-radius: 6px;padding: 22px;">
<div class="row">
<div class="col-md-4 form-group">
<label>
Voucher Number
</label>
<input type="text" name="editvoucherNumber" tabindex="1" placeholder="Enter Voucher Number" class="form-control" ng-model="myModel.voucherNumber"
/>
<span class="error text-small block" ng-if="Form.editvoucherNumber.$dirty && Form.editvoucherNumber.$invalid" ng-hide="Form.editvoucherNumber.$error.maxlength || Form.editvoucherNumber.$error.minlength || Form.editvoucherNumber.$error.pattern">Voucher Number is required.</span>
</div>
<div class="col-md-4 form-group" ng-class="{'has-error':Form.editpaidTo.$dirty && Form.editpaidTo.$invalid, 'has-success':Form.editpaidTo.$valid}">
<label>
Paid To / Received From
</label>
<input type="text" name="editpaidTo" tabindex="1" placeholder="Enter Paid To / Received From" class="form-control" ng-model="myModel.paidTo"
/>
<span class="error text-small block" ng-if="Form.editpaidTo.$dirty && Form.editpaidTo.$invalid" ng-hide="Form.editpaidTo.$error.maxlength || Form.editpaidTo.$error.minlength || Form.editpaidTo.$error.pattern">Paid To / Received From is required.</span>
</div>
<div class="col-md-4">
<label>
Description
</label>
<textarea type="text" placeholder="Enter Description" tabindex="3" class="form-control" name="editdescription_paid" ng-model="myModel.description_paid"
maxlength="100" />
<span class="text-small block" style="color: rgba(128, 128, 128, 0.64)">Max 100 Characters.</span>
<span class="error text-small block" ng-if="Form.editdescription_paid.$dirty && Form.editdescription_paid.$error.pattern">Invalid Description</span>
</div>
</div>
<div class="row">
<div class="col-md-4" ng-class="{'has-error':Form.editType.$dirty && Form.editType.$invalid, 'has-success':Form.editType.$valid}">
<label for="form-field-select-2">
Type <span class="symbol required"></span>
</label> </label>
<select class="form-control" tabindex="4" class="cs-select cs-skin-elastic" name="status" ng-model="myStatusModel.staus" <select class="form-control" ng-init="getType(p.Name)" tabindex="1" class="cs-select cs-skin-elastic" name="editType" ng-model="myModel.type"
required> required>
<option value="" disabled selected>Select Status</option> <option value="" disabled selected>Select Type</option>
<option ng-repeat="itemStatus in statusList" value="{{itemStatus.name}}">{{itemStatus.name}}</option> <option ng-repeat="typeItem in getTypes" ng-selected="typeItem.ID == p.Type" value="{{typeItem.ID}}">{{typeItem.TypeName}}</option>
</select> </select>
<span class="error text-small block" ng-if="Form.status.$dirty && Form.status.$error.required">Status is Required</span> <span class="error text-small block" ng-if="Form.editType.$dirty && Form.editType.$error.required">Type is Required</span>
</div> </div>
<div class="col-md-4" ng-class="{'has-error':Form.editAmount.$dirty && Form.editAmount.$invalid, 'has-success':Form.editAmount.$valid}">
<label>
Amount <span class="symbol required"></span>
</div> </label>
<div> <input type="text" name="editAmount" tabindex="2" placeholder="Enter Amount" class="form-control" ng-model="myModel.amount"
<div class="row"> required/>
<div class="col-md-12 form-group" ng-class="{'has-error':Form.description.$dirty && Form.description.$invalid}"> <span class="error text-small block" ng-if="Form.editAmount.$dirty && Form.editAmount.$error.required">Amount is Required </span>
<label>
</div>
<div class="col-md-4">
<label>
Comments Comments
</label> </label>
<textarea type="text" placeholder="Enter Comments" tabindex="3" class="form-control" name="description" ng-model="myStatusModel.description" <textarea type="text" placeholder="Enter Comments" tabindex="3" class="form-control" name="editComments" ng-model="myModel.description"
maxlength="100" /> maxlength="100" />
<span class="text-small block">Max 100 Characters.</span> <span class="text-small block" style="color: rgba(128, 128, 128, 0.64)">Max 100 Charactes.</span>
<span class="error text-small block" ng-if="Form.description.$dirty && Form.description.$error.pattern">Invalid Comments</span> <span class="error text-small block" ng-if="Form.description.$dirty && Form.description.$error.pattern">Invalid Comments</span>
</div>
</div> </div>
</div> <div class="row">
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="center">
<div class="center"> <button type="submit" ng-disabled="disableButton" tabindex="4" ladda="ldloading1.zoom_in" class="btn btn-sm btn-success"
<button type="submit" tabindex="8" ladda="ldloading1.zoom_in" class="btn btn-sm btn-success" data-style="zoom-in"> data-style="zoom-in">
Update Submit
</button> </button>
<!--<button type="reset" tabindex="9" class="btn btn-warning btn-wide" tabindex="9" ng-click="employeeForm.resetCourse(Form)"> <button type="cancel" ng-click="editClose()" tabindex="5" class="btn btn-warning btn-sm" ng-click="employeeForm.resetCourse(Form)">
Reset Cancel
</button>--> </button>
</div>
</div> </div>
</div> </div>
</div> </form>
</fieldset> </td>
</div>
<div class="col-md-4"> </tr>
</tbody>
</div> </table>
</div> <dir-pagination-controls max-size="10" direction-links="true" boundary-links="true">
</div> </dir-pagination-controls>
</form> </div>
</div> </div>
</tab> </div>
</tabset> </div>
</div> </tab>
</div> <tab heading="Add" id="addDayBook">
<!--<pre>{{myModelAdd}}</pre>-->
<div>
<form name="Form" id="form" novalidate ng-submit="daybookAdd.submit(Form, myModelAdd)" method="post">
<div>
<div class="row">
<div data-ng-controller="DatepickerDemoCtrl">
<div class="col-md-6 form-group" ng-class="{'has-error':Form.addDate.$dirty && Form.addDate.$invalid, 'has-success':Form.addDate.$valid}">
<label>
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"
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" />
<span class="error text-small block" ng-if="Form.addDate.$dirty && Form.addDate.$invalid" ng-hide="Form.addDate.$error.maxlength">Date is required.</span>
<span class="error text-small block" ng-if="Form.addDate.$error.maxlength">Enter a Valid Date </span>
</div>
</div>
<div class="col-md-6 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 <span class="symbol required"></span>
</label>
<!--<pre>{{incomeExpenseName }}</pre>-->
<select class="form-control" tabindex="2" class="cs-select cs-skin-elastic" name="addName" ng-model="myModelAdd.name" ng-change="getType(myModelAdd.name)"
required>
<option value="" disabled selected>Select</option>
<option ng-repeat="typeName in incomeExpenseName" value="{{typeName.ListCode}}">{{typeName.ListName}}</option>
</select>
<span class="error text-small block" ng-if="Form.addName.$dirty && Form.addName.$error.required">Type is Required</span>
</div>
</div>
<div class="row">
<div class="col-md-4 form-group">
<label>
Voucher Number
</label>
<input type="text" name="voucherNumber" tabindex="1" placeholder="Enter Voucher Number" class="form-control" ng-model="myModelAdd.voucherNumber"
/>
<span class="error text-small block" ng-if="Form.paidTo.$dirty && Form.paidTo.$invalid" ng-hide="Form.voucherNumber.$error.maxlength || Form.voucherNumber.$error.minlength || Form.voucherNumber.$error.pattern">Voucher Number is required.</span>
</div>
<div class="col-md-4 form-group">
<label>
Paid To / Received From
</label>
<input type="text" name="paidTo" tabindex="1" placeholder="Enter Paid To / Received From" class="form-control" ng-model="myModelAdd.paidTo"
/>
<span class="error text-small block" ng-if="Form.paidTo.$dirty && Form.paidTo.$invalid" ng-hide="Form.paidTo.$error.maxlength || Form.paidTo.$error.minlength || Form.paidTo.$error.pattern">Paid To / Reveived From is required.</span>
</div>
<div class="col-md-4">
<label>
Description
</label>
<textarea type="text" placeholder="Enter Description" tabindex="3" class="form-control" name="description_paid" ng-model="myModelAdd.description_paid"
maxlength="100" />
<span class="text-small block" style="color: rgba(128, 128, 128, 0.64)">Max 100 Characters.</span>
<span class="error text-small block" ng-if="Form.description_paid.$dirty && Form.description_paid.$error.pattern">Invalid Description</span>
</div>
</div>
<div class="row">
<div class="col-md-4" ng-class="{'has-error':Form.addType.$dirty && Form.addType.$invalid, 'has-success':Form.addType.$valid}">
<label for="form-field-select-2">
Type <span class="symbol required"></span>
</label>
<select class="form-control" tabindex="1" class="cs-select cs-skin-elastic" name="addType" ng-model="myModelAdd.type" required>
<option value="" disabled selected>Select Type</option>
<option ng-repeat="typeItem in getTypes" value="{{typeItem.ID}}">{{typeItem.TypeName}}</option>
</select>
<span class="error text-small block" ng-if="Form.addType.$dirty && Form.addType.$error.required">Type is Required</span>
</div>
<div class="col-md-4" ng-class="{'has-error':Form.addAmount.$dirty && Form.addAmount.$invalid, 'has-success':Form.addAmount.$valid}">
<label>
Amount <span class="symbol required"></span>
</label>
<input type="text" ng-pattern="/^[0-9]*$/" name="addAmount" tabindex="2" placeholder="Enter Amount" class="form-control"
ng-model="myModelAdd.amount" required/>
<span class="error text-small block" ng-if="Form.addAmount.$dirty && Form.addAmount.$error.required">Amount is Required </span>
<!--<span class="error text-small block" ng-if="Form.addAmount.$dirty">Amount is Required </span>-->
</div>
<div class="col-md-4">
<label>
Comments
</label>
<textarea type="text" placeholder="Enter Comments" tabindex="3" class="form-control" name="addComments" ng-model="myModelAdd.description"
maxlength="100" />
<span class="text-small block" style="color: rgba(128, 128, 128, 0.64)">Max 100 Characters.</span>
<span class="error text-small block" ng-if="Form.addComments.$dirty && Form.addComments.$error.pattern">Invalid Comments</span>
</div>
</div>
<div class="row">
</div>
<div class="row">
<div class="pull-right">
<button type="submit" ng-disabled="disableButton" tabindex="4" ladda="ldloading1.zoom_in" class="btn btn-sm btn-success"
data-style="zoom-in">
Submit
</button>
<button type="cancel" ng-click="daybookAdd.reset(Form)" tabindex="5" class="btn btn-warning btn-sm" ng-click="employeeForm.resetCourse(Form)">
Reset
</button>
</div>
</div>
</div>
</form>
</div>
</tab>
<!--<tab heading="Approve Income/Expense" id="addDayBook" ng-if="dayBookApprovalAccess == '1'">
<div ng-init="getApproveLoad()">
</div>
</tab>-->
</tabset>
</div> </div>
</div> </div>
<!-- end: DAY BOOK --> <!-- end: DAY BOOK -->

View File

@ -540,7 +540,7 @@
</a> </a>
</li>--> </li>-->
<li ng-class="{'active open':$state.includes('app.daybookadmin')}"> <!--<li ng-class="{'active open':$state.includes('app.daybookadmin')}">
<a ui-sref="app.daybookadmin" ng-click="checkAdmin()"> <a ui-sref="app.daybookadmin" ng-click="checkAdmin()">
<div class="item-content"> <div class="item-content">
<div class="item-media"> <div class="item-media">
@ -551,6 +551,31 @@
</div> </div>
</div> </div>
</a> </a>
</li>-->
<li ng-class="{'active open':$state.includes('app.daybookadmin')}">
<a href="javascript:void(0)">
<div class="item-content">
<div class="item-media">
<i class="ti-money"></i>
</div>
<div class="item-inner">
<span class="title" translate="sidebar.nav.daybook.MAIN"> DAY BOOK</span><i class="icon-arrow"></i>
</div>
</div>
</a>
<ul class="sub-menu">
<li ui-sref-active="active">
<a ui-sref="app.daybookadmin.details" ng-click="checkAdmin()">
<span class="title" translate="sidebar.nav.daybook.MAIN"> DAY BOOK</span>
</a>
</li>
<li ui-sref-active="active" ng-if="is_active_DayBookAprlAccess == '1'">
<a ui-sref="app.daybookadmin.approval" ng-click="checkAdmin()">
<span class="title" translate="sidebar.nav.daybook.APPROVAL"> DAY BOOK</span>
</a>
</li>
</ul>
</li> </li>
<li ng-class="{'active open':$state.includes('app.myprofile')}"> <li ng-class="{'active open':$state.includes('app.myprofile')}">
<a ui-sref="app.myprofile" ng-click="checkAdmin()"> <a ui-sref="app.myprofile" ng-click="checkAdmin()">