update daybook details: kdk
This commit is contained in:
parent
48794a0434
commit
867177d498
@ -125,6 +125,8 @@ defined('STUDY_MATERIAL_STATUS') OR define('STUDY_MATERIAL_STATUS','T_StudyMater
|
||||
defined('CERTIFICATION') OR define('CERTIFICATION','T_CertificationMaster');
|
||||
defined('DEFAULTACTIVITY') OR define('DEFAULTACTIVITY','T_StatusMaster');
|
||||
defined('CERTIFICATION_MASTER') OR define('CERTIFICATION_MASTER','T_CertificationMaster');
|
||||
defined('DAYBOOKMASTER') OR define('DAYBOOKMASTER','T_DayBookMaster');
|
||||
defined('INCOMEOUTCOMEMASTER') OR define('INCOMEOUTCOMEMASTER','T_Income_Outcome_Master');
|
||||
|
||||
|
||||
|
||||
|
||||
@ -172,6 +172,17 @@ $route['getStudentBasicInfo'] = 'StudentView_Controller/getStudentInfo';
|
||||
$route['getCertificateDetails'] = 'Certificate_Controller/getCertificateDetails';
|
||||
$route['addCertificateDetails'] = 'Certificate_Controller/addCertificateDetails';
|
||||
$route['updateCertificateDetails'] = 'Certificate_Controller/updateCertificateDetails';
|
||||
/*
|
||||
* Day Book
|
||||
* */
|
||||
$route['deleteDayBookDetails'] = 'DayBook_Controller/deleteDayBookDetails';
|
||||
$route['updateDayBookDetails'] = 'DayBook_Controller/updateDayBookDetails';
|
||||
$route['getDayBookDetails'] = 'DayBook_Controller/getDayBookDetails';
|
||||
$route['getIncomeExpenseTypeState'] = 'DayBook_Controller/getIncomeExpenseTypeState';
|
||||
$route['addDayBook'] = 'DayBook_Controller/adddaybook';
|
||||
$route['updateDayBookStatusAdmin'] = 'DayBook_Controller/updateDayBookStatusAdmin';
|
||||
$route['getDayBookDetailsSuperAdmin'] = 'DayBook_Controller/getDayBookDetailsSuperAdmin';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
217
Apollo/api/application/controllers/DayBook_Controller.php
Normal file
217
Apollo/api/application/controllers/DayBook_Controller.php
Normal file
@ -0,0 +1,217 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
// This can be removed if you use __autoload() in config.php OR use Modular Extensions
|
||||
/** @noinspection PhpIncludeInspection */
|
||||
require_once APPPATH . '/libraries/REST_Controller.php';
|
||||
|
||||
/**
|
||||
* This is an example of a few basic user interaction methods you could use
|
||||
* all done with a hardcoded array
|
||||
*
|
||||
* @package CodeIgniter
|
||||
* @subpackage Rest Server
|
||||
* @category Controller
|
||||
* @author
|
||||
* @license MIT
|
||||
* @link
|
||||
*/
|
||||
class DayBook_Controller extends REST_Controller {
|
||||
|
||||
/*
|
||||
* daybook updation details
|
||||
* params:
|
||||
* created by kdk
|
||||
* */
|
||||
function __construct()
|
||||
{
|
||||
// Construct the parent class
|
||||
parent::__construct();
|
||||
// load the university model
|
||||
$this->load->model('DayBook_model', 'daybook_model');
|
||||
}
|
||||
|
||||
//get income expese type, name details
|
||||
public function getIncomeExpenseTypeState_post() {
|
||||
$reqData = $this->post('data');
|
||||
$getIncomeExpenseTypeState = $this->daybook_model->get_Income_Expense_typeState();// Check if the employee exist
|
||||
if ($getIncomeExpenseTypeState)
|
||||
{
|
||||
$getIncomeExpenseTypeState['status'] = REST_Controller::HTTP_OK;
|
||||
// Set the response and exit
|
||||
$this->response($getIncomeExpenseTypeState, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
|
||||
}
|
||||
else
|
||||
{
|
||||
// Set the response and exit
|
||||
$this->response([
|
||||
'message' => 'No list were found',
|
||||
'status' => REST_Controller::HTTP_NOT_FOUND
|
||||
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
|
||||
}
|
||||
}
|
||||
|
||||
// {"data":{"date":"22-12-2017"},"localReqDetails":{"localUserID":"137","localBranchID":"001","localType":"R002","localOn":"2017-12-22T12:45:19.688Z","status":"active"}}
|
||||
|
||||
// get all daybook details
|
||||
public function getDayBookDetails_post() {
|
||||
$reqData = $this->post('data');
|
||||
$reqDataBy = $this->post('localReqDetails');
|
||||
$getDayBookDetails = $this->daybook_model->get_Daybook_Details_List($reqData, $reqDataBy);// Check if the employee exist
|
||||
if ($getDayBookDetails)
|
||||
{
|
||||
$getDayBookDetails['status'] = REST_Controller::HTTP_OK;
|
||||
// Set the response and exit
|
||||
$this->response($getDayBookDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
|
||||
}
|
||||
else
|
||||
{
|
||||
// Set the response and exit
|
||||
$this->response([
|
||||
'message' => 'No list were found',
|
||||
'status' => REST_Controller::HTTP_NOT_FOUND
|
||||
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function deleteDayBookDetails_post() {
|
||||
$reqData = $this->post('data');
|
||||
$reqbyData = $this->post('localReqDetails');
|
||||
$deletedayBookDetails = $this->daybook_model->delete_dayBookDetails($reqData);// Check if the employee exist
|
||||
if ($deletedayBookDetails)
|
||||
{
|
||||
$deletedayBookDetails['status'] = REST_Controller::HTTP_OK;
|
||||
// Set the response and exit
|
||||
$this->response($deletedayBookDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
|
||||
}
|
||||
else
|
||||
{
|
||||
// Set the response and exit
|
||||
$this->response([
|
||||
'message' => 'No list were found',
|
||||
'status' => REST_Controller::HTTP_NOT_FOUND
|
||||
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
|
||||
}
|
||||
}
|
||||
|
||||
public function updateDayBookDetails_post() {
|
||||
$reqData = $this->post('data');
|
||||
$reqbyData = $this->post('localReqDetails');
|
||||
|
||||
$updateFor = $reqData['id'];
|
||||
$req['Type'] = $reqData['type'];
|
||||
$req['Amount'] = $reqData['amount'];
|
||||
$req['Description'] = $reqData['description'];
|
||||
$req['UpdatedBy'] = $reqbyData['localUserID'];
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$req['UpdatedOn'] = $date;
|
||||
$updatedayBookDetails = $this->daybook_model->update_dayBookDetails($req , $updateFor);// Check if the employee exist
|
||||
if ($updatedayBookDetails)
|
||||
{
|
||||
$updatedayBookDetails['status'] = REST_Controller::HTTP_OK;
|
||||
// Set the response and exit
|
||||
$this->response($updatedayBookDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
|
||||
}
|
||||
else
|
||||
{
|
||||
// Set the response and exit
|
||||
$this->response([
|
||||
'message' => 'No list were found',
|
||||
'status' => REST_Controller::HTTP_NOT_FOUND
|
||||
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
|
||||
}
|
||||
}
|
||||
|
||||
// add details daybook
|
||||
public function adddaybook_post() {
|
||||
$reqData = $this->post('data');
|
||||
$reqbyData = $this->post('localReqDetails');
|
||||
|
||||
$req['Name'] = $reqData['name'];
|
||||
$req['Type'] = $reqData['type'];
|
||||
$req['Amount'] = $reqData['amount'];
|
||||
$req['Date'] = $reqData['date'];
|
||||
$req['Status'] = $reqData['status'];
|
||||
$req['Description'] = $reqData['description'];
|
||||
$req['BranchCode'] = $reqbyData['localBranchID'];
|
||||
$req['CreatedBy'] = $reqbyData['localUserID'];
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$req['CreatedOn'] = $date;
|
||||
$addDayBookDetails = $this->daybook_model->add_dayBook($req);// Check if the employee exist
|
||||
if ($addDayBookDetails)
|
||||
{
|
||||
$addDayBookDetails['status'] = REST_Controller::HTTP_OK;
|
||||
// Set the response and exit
|
||||
$this->response($addDayBookDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
|
||||
}
|
||||
else
|
||||
{
|
||||
// Set the response and exit
|
||||
$this->response([
|
||||
'message' => 'No list were found',
|
||||
'status' => REST_Controller::HTTP_NOT_FOUND
|
||||
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
|
||||
}
|
||||
}
|
||||
|
||||
public function updateDayBookStatusAdmin_post() {
|
||||
|
||||
$reqData = $this->post('data');
|
||||
$reqDetails = $this->post('requestDetails');
|
||||
|
||||
$time = date('Y-m-d H:i:s');
|
||||
$dateTime = $time;
|
||||
|
||||
$count = count($reqData);
|
||||
|
||||
for($i=0; $i < $count; $i++) {
|
||||
$data[] = array(
|
||||
'ID' => $reqData[$i]['dabookListId'],
|
||||
'Approval_By' => $reqDetails['localUserID'],
|
||||
'Status' => $reqData[$i]['ListCodeStatus'],
|
||||
'Approval_Comments' => $reqData[$i]['comments'],
|
||||
'UpdatedBy' => $reqDetails['localUserID'],
|
||||
'UpdatedOn' => $dateTime,
|
||||
);
|
||||
}
|
||||
|
||||
$updateStatusAdminDetails = $this->daybook_model->update_status_admin($data);// Check if the employee exist
|
||||
if ($updateStatusAdminDetails)
|
||||
{
|
||||
$updateStatusAdminDetails['status'] = REST_Controller::HTTP_OK;
|
||||
// Set the response and exit
|
||||
$this->response($updateStatusAdminDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
|
||||
}
|
||||
else
|
||||
{
|
||||
// Set the response and exit
|
||||
$this->response([
|
||||
'message' => 'No list were found',
|
||||
'status' => REST_Controller::HTTP_NOT_FOUND
|
||||
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
|
||||
}
|
||||
|
||||
}
|
||||
public function getDayBookDetailsSuperAdmin_post() {
|
||||
$reqData = $this->post('data');
|
||||
$reqDataBy = $this->post('localReqDetails');
|
||||
$getDayBookDetails = $this->daybook_model->get_Daybook_Details_List_superAdmin($reqData, $reqDataBy);// Check if the employee exist
|
||||
if ($getDayBookDetails)
|
||||
{
|
||||
$getDayBookDetails['status'] = REST_Controller::HTTP_OK;
|
||||
// Set the response and exit
|
||||
$this->response($getDayBookDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
|
||||
}
|
||||
else
|
||||
{
|
||||
// Set the response and exit
|
||||
$this->response([
|
||||
'message' => 'No list were found',
|
||||
'status' => REST_Controller::HTTP_NOT_FOUND
|
||||
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
145
Apollo/api/application/models/DayBook_model.php
Normal file
145
Apollo/api/application/models/DayBook_model.php
Normal file
@ -0,0 +1,145 @@
|
||||
<?php
|
||||
/**
|
||||
* Date: 11/9/17
|
||||
* Time: 5:28 PM
|
||||
*/
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class DayBook_model extends CI_Model
|
||||
{
|
||||
|
||||
/*
|
||||
* day book update details
|
||||
* params:
|
||||
* created by kdk
|
||||
* */
|
||||
|
||||
// get income expense type lists
|
||||
public function get_Income_Expense_typeState(){
|
||||
$this->db->select('t1.ListCode, t1.ListName');
|
||||
$this->db->from(''.PICK_LIST_DETAILS. ' as t1');
|
||||
$this->db->where('t1.ListGroup', 10);
|
||||
// $this->db->join('' . COURSE . ' as t2', 't2.UniversityID = t1.UniversityID', 'LEFT');
|
||||
$typeDetails = $this->db->get();
|
||||
$typeStateDetails = $typeDetails->result();
|
||||
// TypeName details
|
||||
$this->db->select('t2.TypeName, t2.TypeID, t2.ID');
|
||||
$this->db->from(''.INCOMEOUTCOMEMASTER. ' as t2');
|
||||
$this->db->where('t2.IsActive', 1);
|
||||
|
||||
$typeNaDetails = $this->db->get();
|
||||
$typeNameDetails = $typeNaDetails->result();
|
||||
|
||||
$results['typeNameStatus'] = true;
|
||||
$results['typeList'] = $typeStateDetails;
|
||||
$results['typeNameList'] = $typeNameDetails;
|
||||
return $results;
|
||||
}
|
||||
|
||||
public function get_Daybook_Details_List($reqData, $reqDataBy) {
|
||||
$this->db->select('t1.*, t2.ListName, t3.TypeName');
|
||||
$this->db->from(''.DAYBOOKMASTER. ' as t1');
|
||||
$this->db->join('' . PICK_LIST_DETAILS . ' as t2', 't2.ListCode = t1.Name', 'LEFT');
|
||||
$this->db->join('' . INCOMEOUTCOMEMASTER . ' as t3', 't3.ID = t1.Type', 'LEFT');
|
||||
$this->db->where('t1.Date', $reqData['date']);
|
||||
$this->db->order_by('CreatedOn', 'DESC');
|
||||
$this->db->where('t1.BranchCode', $reqDataBy['localBranchID']);
|
||||
// $this->db->join('' . COURSE . ' as t2', 't2.UniversityID = t1.UniversityID', 'LEFT');
|
||||
$dayBookDetails = $this->db->get();
|
||||
$dayBookDetailsList = $dayBookDetails->result();
|
||||
|
||||
$results['dayBookListStatus'] = true;
|
||||
$results['dayBookListDetails'] = $dayBookDetailsList;
|
||||
return $results;
|
||||
|
||||
}
|
||||
|
||||
public function delete_dayBookDetails($id) {
|
||||
|
||||
$sql1 = " DELETE FROM ".DAYBOOKMASTER." WHERE ID ='$id'";
|
||||
// update branch to staff_branch table
|
||||
if ($this->db->query($sql1) == '1') {
|
||||
$result['deletedStatus'] = true;
|
||||
$result['message'] = "DayBook Details Deleted";
|
||||
} else {
|
||||
$result['deletedStatus'] = false;
|
||||
$result['message'] = "Something went wrong.please try again";
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function update_dayBookDetails($Arr, $upFor) {
|
||||
$this->db->where('ID', $upFor);
|
||||
$this->db->update(DAYBOOKMASTER, $Arr);
|
||||
if ($this->db->affected_rows() == '1') {
|
||||
$result['updateDetailsStatus'] = true;
|
||||
$result['message'] = "Successfully details Updated";
|
||||
} else {
|
||||
$result['updateDetailsStatus'] = false;
|
||||
$result['message'] = "Something went wrong.please try again";
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
// add dayBook
|
||||
public function add_dayBook($Arr)
|
||||
{
|
||||
$this->db->insert(DAYBOOKMASTER, $Arr);
|
||||
if ($this->db->affected_rows() == '1') {
|
||||
$result['addDayBookStatus'] = true;
|
||||
$result['message'] = "Successfully DayBook details added";
|
||||
|
||||
} else {
|
||||
$result['addDayBookStatus'] = false;
|
||||
$result['message'] = "Something went wrong.please try again";
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function update_status_admin($arr) {
|
||||
|
||||
$Approval_By = $arr[0]['Approval_By'];
|
||||
$Approval_Comments = $arr[0]['Approval_Comments'];
|
||||
$UpdatedBy = $arr[0]['UpdatedBy'];
|
||||
$UpdatedOn = $arr[0]['UpdatedOn'];
|
||||
$status = $arr[0]['Status'];
|
||||
$number = array();
|
||||
foreach($arr as $ar){
|
||||
array_push($number, $ar['ID']);
|
||||
}
|
||||
$updateFor = implode(',', $number);
|
||||
|
||||
$sql = "UPDATE ".DAYBOOKMASTER."
|
||||
SET Status = '$status', Approval_By = '$Approval_By' ,
|
||||
Approval_Comments = '$Approval_Comments', UpdatedBy = '$UpdatedBy' , UpdatedOn = '$UpdatedOn'
|
||||
WHERE id IN ($updateFor)";
|
||||
$mBranchDetails = $this->db->query($sql);
|
||||
// echo $mBranchDetails;
|
||||
// echo $this->db->affected_rows(); exit();
|
||||
if ($this->db->affected_rows() >= 1) {
|
||||
$result['addStatus'] = true;
|
||||
$result['message'] = "Successfully Study Material Status Updated";
|
||||
} else {
|
||||
$result['addStatus'] = false;
|
||||
$result['message'] = "Something went wrong.please try again";
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function get_Daybook_Details_List_superAdmin($reqData, $reqDataBy){
|
||||
$this->db->select('t1.*, t2.ListName, t3.TypeName, t4.BranchName');
|
||||
$this->db->from(''.DAYBOOKMASTER. ' as t1');
|
||||
$this->db->join('' . PICK_LIST_DETAILS . ' as t2', 't2.ListCode = t1.Name', 'LEFT');
|
||||
$this->db->join('' . INCOMEOUTCOMEMASTER . ' as t3', 't3.ID = t1.Type', 'LEFT');
|
||||
$this->db->join('' . BRANCH . ' as t4', 't4.BranchCode = t1.BranchCode', 'LEFT');
|
||||
$this->db->where('t1.Date', $reqData['date']);
|
||||
$this->db->order_by('CreatedOn', 'DESC');
|
||||
// $this->db->join('' . COURSE . ' as t2', 't2.UniversityID = t1.UniversityID', 'LEFT');
|
||||
$dayBookDetails = $this->db->get();
|
||||
$dayBookDetailsList = $dayBookDetails->result();
|
||||
|
||||
$results['dayBookListStatus'] = true;
|
||||
$results['dayBookListDetails'] = $dayBookDetailsList;
|
||||
return $results;
|
||||
}
|
||||
}
|
||||
@ -146,7 +146,12 @@ app.constant('JS_REQUIRES', {
|
||||
* Certificate Type
|
||||
* */
|
||||
'certificateCtrl': 'assets/js/controllers/certificateCtrl.js',
|
||||
|
||||
/*
|
||||
* daybook details
|
||||
* */
|
||||
'daybookCtrl': 'assets/js/controllers/daybookCtrl.js',
|
||||
'daybookadminCtrl': 'assets/js/controllers/daybookadminCtrl.js',
|
||||
'daybooksuperadminCtrl': 'assets/js/controllers/daybooksuperadminCtrl.js',
|
||||
|
||||
'studentStatusUpdateCtrl':'assets/js/controllers/studentStatusUpdateCtrl.js',
|
||||
'studentViewCtrl':'assets/js/controllers/studentViewCtrl.js',
|
||||
|
||||
@ -309,11 +309,28 @@ app.config(['$stateProvider', '$urlRouterProvider', '$controllerProvider', '$com
|
||||
}
|
||||
}).state('app.daybook', {
|
||||
url: '/daybook',
|
||||
template: '<div ui-view class="fade-in-up"></div>',
|
||||
templateUrl: "assets/views/daybook/daybook.html",
|
||||
title: 'daybook',
|
||||
resolve: loadSequence('spin', 'ladda', 'angular-ladda', 'daybookCtrl','ngTable'),
|
||||
ncyBreadcrumb: {
|
||||
label: 'daybook'
|
||||
}
|
||||
}).state('app.daybookadmin', {
|
||||
url: '/daybookadmin',
|
||||
templateUrl: "assets/views/daybook/daybookadmin.html",
|
||||
title: 'daybook',
|
||||
resolve: loadSequence('spin', 'ladda', 'angular-ladda', 'daybookadminCtrl','ngTable'),
|
||||
ncyBreadcrumb: {
|
||||
label: 'daybook'
|
||||
}
|
||||
}).state('app.daybooksuperadmin', {
|
||||
url: '/daybooksuperadmin',
|
||||
templateUrl: "assets/views/daybook/daybooksuperadmin.html",
|
||||
title: 'daybook',
|
||||
resolve: loadSequence('spin', 'ladda', 'angular-ladda', 'daybooksuperadminCtrl','ngTable'),
|
||||
ncyBreadcrumb: {
|
||||
label: 'daybook'
|
||||
}
|
||||
}).state('app.daybook.income', {
|
||||
url: '/income',
|
||||
templateUrl: "assets/views/utility_search_result.html",
|
||||
|
||||
272
Apollo/assets/js/controllers/daybookCtrl.js
Normal file
272
Apollo/assets/js/controllers/daybookCtrl.js
Normal file
@ -0,0 +1,272 @@
|
||||
'use strict';
|
||||
/**
|
||||
* daybook details capturing
|
||||
*
|
||||
*/
|
||||
app.controller('daybookCtrl', ["$scope", "$rootScope", "toaster", "$filter", "ngTableParams", "API_POINTS", "$localStorage", "$http", "$state", 'ipCookie', function ($scope, $rootScope, toaster, $filter, ngTableParams, apiPoint, $localStorage, $http, $state, ipCookie) {
|
||||
|
||||
// get local client details
|
||||
var localDetail = JSON.parse(localStorage.getItem('localObj'));
|
||||
var localDetails = ipCookie('cookiechk');
|
||||
|
||||
$scope.searchData = {
|
||||
"date": ""
|
||||
}
|
||||
|
||||
$scope.init = function () {
|
||||
$scope.currentDate = new Date();
|
||||
var formate = "dd-MM-yyyy";
|
||||
$scope.searchData.date = $filter('date')(new Date($scope.currentDate), formate);
|
||||
$scope.getDayBookList();
|
||||
$scope.getIncomeExpenseType_Status();
|
||||
}
|
||||
|
||||
$scope.changeDate = function () {
|
||||
var formate = "dd-MM-yyyy";
|
||||
$scope.searchData.date = $filter('date')(new Date($scope.searchData.date), formate);
|
||||
$scope.getDayBookList();
|
||||
}
|
||||
|
||||
$scope.noRecordFound = true;
|
||||
|
||||
$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;
|
||||
if ($scope.data.length !== 0) {
|
||||
$scope.noRecordFound = false;
|
||||
} else {
|
||||
$scope.noRecordFound = true;
|
||||
}
|
||||
// alert(JSON.stringify($scope.data));
|
||||
// $scope.incomeExpenseType = response.data.typeNameList;
|
||||
} else {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$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.getType = function (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.getTypes = type === 'I002' ? $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) {
|
||||
console.log(p);
|
||||
$scope.myModel = {
|
||||
"id": p.ID,
|
||||
"date": p.Date,
|
||||
"incomeExpense": p.Name,
|
||||
"type": p.Type,
|
||||
"amount": p.Amount,
|
||||
"status": p.Status,
|
||||
"description": p.Description
|
||||
}
|
||||
}
|
||||
|
||||
$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(id);
|
||||
});
|
||||
$scope.indexDelete2 = function (id) {
|
||||
var deleteDetails = {
|
||||
method: 'POST',
|
||||
url: apiPoint.url + 'deleteDayBookDetails/',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
data: {
|
||||
data: id,
|
||||
requestDetails: localDetails
|
||||
}
|
||||
};
|
||||
$http(deleteDetails).then(function (response) {
|
||||
if (response.data.deletedStatus) {
|
||||
swal("Success!", response.data.message, "success");
|
||||
$scope.getDayBookList();
|
||||
} else {
|
||||
swal("Failed!", response.data.message, "error");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$scope.myModelAdd = {
|
||||
"id": "",
|
||||
"date": "",
|
||||
"name": "",
|
||||
"type": "",
|
||||
"amount": "",
|
||||
"status": "",
|
||||
"description": ""
|
||||
}
|
||||
|
||||
$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);
|
||||
|
||||
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("Success!", response.data.message, "success");
|
||||
$state.go($state.current, {}, { reload: true });
|
||||
} else {
|
||||
swal("Failed!", response.data.message, "error");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$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 updateDayBookDetails = {
|
||||
method: 'POST',
|
||||
url: apiPoint.url + 'updateDayBookDetails/',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
data: {
|
||||
data: myModel,
|
||||
requestDetails: localDetails
|
||||
}
|
||||
};
|
||||
$http(updateDayBookDetails).then(function (response) {
|
||||
if (response.data.updateDetailsStatus) {
|
||||
swal("Success!", response.data.message, "success");
|
||||
// for success state
|
||||
$scope.editId = -1;
|
||||
$scope.getDayBookList();
|
||||
} else {
|
||||
swal("Failed!", response.data.message, "error");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}]);
|
||||
|
||||
|
||||
530
Apollo/assets/js/controllers/daybookadminCtrl.js
Normal file
530
Apollo/assets/js/controllers/daybookadminCtrl.js
Normal file
@ -0,0 +1,530 @@
|
||||
'use strict';
|
||||
/**
|
||||
* daybook details capturing
|
||||
*
|
||||
*/
|
||||
app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter", "ngTableParams", "API_POINTS", "$localStorage", "$http", "$state", 'ipCookie', function ($scope, $rootScope, toaster, $filter, ngTableParams, apiPoint, $localStorage, $http, $state, ipCookie) {
|
||||
|
||||
// get local client details
|
||||
var localDetail = JSON.parse(localStorage.getItem('localObj'));
|
||||
var localDetails = ipCookie('cookiechk');
|
||||
$scope.localTypeViewAdmin = false;
|
||||
$scope.localTypeViewSuperAdmin = false;
|
||||
|
||||
// $scope.init = function () {
|
||||
// const LOCALTYPE = localDetail.localType;
|
||||
// if (LOCALTYPE === 'R003') {
|
||||
// $scope.localTypeViewAdmin = true;
|
||||
// $scope.getDayBookList();
|
||||
// } else {
|
||||
// $scope.localTypeViewSuperAdmin = true;
|
||||
// }
|
||||
// }
|
||||
|
||||
$scope.searchData = {
|
||||
"date": ""
|
||||
}
|
||||
|
||||
$scope.init = function () {
|
||||
|
||||
const LOCALTYPE = localDetail.localType;
|
||||
if (LOCALTYPE === 'R003') {
|
||||
$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.getIncomeExpenseType_Status();
|
||||
$scope.getDayBookList();
|
||||
} else if(LOCALTYPE === 'R004') {
|
||||
$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.getIncomeExpenseType_Status();
|
||||
$scope.getDayBookList();
|
||||
}
|
||||
}
|
||||
|
||||
$scope.changeDate = function () {
|
||||
var formate = "dd-MM-yyyy";
|
||||
$scope.searchData.date = $filter('date')(new Date($scope.searchData.date), formate);
|
||||
$scope.getDayBookList();
|
||||
}
|
||||
|
||||
|
||||
$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.noRecordFound = true;
|
||||
|
||||
$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;
|
||||
let datas = response.data.dayBookListDetails;
|
||||
let searchResultDetailsBef = datas.filter(val => {
|
||||
return val.Name == 'I001' ? 1 : 0;
|
||||
});
|
||||
$scope.IncomeData = datas.filter(val => {
|
||||
return val.Name == 'I002' ? 1 : 0;
|
||||
});
|
||||
const filterAddSelect = searchResultDetailsBef.filter(val => {
|
||||
val['Selected'] = false;
|
||||
return val;
|
||||
});
|
||||
$scope.searchResultDetails = 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 {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// $scope.getDayBookList = function() {
|
||||
// let searchResultDetailsBef = $scope.data;
|
||||
// const filterAddSelect = searchResultDetailsBef.filter(val => {
|
||||
// val['Selected'] = false;
|
||||
// return val;
|
||||
// });
|
||||
// $scope.searchResultDetails = filterAddSelect;
|
||||
// $scope.searchResultLength = Object.keys($scope.searchResultDetails).length;
|
||||
// }
|
||||
|
||||
|
||||
// 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;
|
||||
$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;
|
||||
}
|
||||
}
|
||||
|
||||
$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) {
|
||||
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;
|
||||
}
|
||||
// alert(JSON.stringify($scope.myStatusModel));
|
||||
// alert(JSON.stringify(selectedItems));
|
||||
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("Success!", response.data.message, "success");
|
||||
// for success state
|
||||
$scope.getDayBookList();
|
||||
$scope.allSelected('undefined');
|
||||
$scope.OpenWindowStatus = false;
|
||||
} else {
|
||||
swal("Failed!", response.data.message, "error");
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
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) {
|
||||
// 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
|
||||
}
|
||||
}
|
||||
|
||||
$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": ""
|
||||
}
|
||||
|
||||
$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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$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': ''
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
}]);
|
||||
|
||||
|
||||
524
Apollo/assets/js/controllers/daybooksuperadminCtrl.js
Normal file
524
Apollo/assets/js/controllers/daybooksuperadminCtrl.js
Normal file
@ -0,0 +1,524 @@
|
||||
'use strict';
|
||||
/**
|
||||
* daybook details capturing
|
||||
*
|
||||
*/
|
||||
app.controller('daybooksuperadminCtrl', ["$scope", "$rootScope", "toaster", "$filter", "ngTableParams", "API_POINTS", "$localStorage", "$http", "$state", 'ipCookie', function ($scope, $rootScope, toaster, $filter, ngTableParams, apiPoint, $localStorage, $http, $state, ipCookie) {
|
||||
|
||||
// get local client details
|
||||
var localDetail = JSON.parse(localStorage.getItem('localObj'));
|
||||
var localDetails = ipCookie('cookiechk');
|
||||
$scope.localTypeViewAdmin = false;
|
||||
$scope.localTypeViewSuperAdmin = false;
|
||||
|
||||
// $scope.init = function () {
|
||||
// const LOCALTYPE = localDetail.localType;
|
||||
// if (LOCALTYPE === 'R003') {
|
||||
// $scope.localTypeViewAdmin = true;
|
||||
// $scope.getDayBookList();
|
||||
// } else {
|
||||
// $scope.localTypeViewSuperAdmin = true;
|
||||
// }
|
||||
// }
|
||||
|
||||
$scope.searchData = {
|
||||
"date": ""
|
||||
}
|
||||
|
||||
$scope.init = function () {
|
||||
|
||||
const LOCALTYPE = localDetail.localType;
|
||||
if(LOCALTYPE === 'R004') {
|
||||
$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.getIncomeExpenseType_Status();
|
||||
$scope.getDayBookList();
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$scope.changeDate = function () {
|
||||
var formate = "dd-MM-yyyy";
|
||||
$scope.searchData.date = $filter('date')(new Date($scope.searchData.date), formate);
|
||||
$scope.getDayBookList();
|
||||
}
|
||||
|
||||
|
||||
$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.noRecordFound = true;
|
||||
|
||||
$scope.getDayBookList = function () {
|
||||
|
||||
var getDatBookListDetails = {
|
||||
method: 'POST',
|
||||
url: apiPoint.url + 'getDayBookDetailsSuperAdmin/',
|
||||
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;
|
||||
let datas = response.data.dayBookListDetails;
|
||||
let searchResultDetailsBef = datas.filter(val => {
|
||||
return val.Name == 'I001' ? 1 : 0;
|
||||
});
|
||||
$scope.IncomeData = datas.filter(val => {
|
||||
return val.Name == 'I002' ? 1 : 0;
|
||||
});
|
||||
const filterAddSelect = searchResultDetailsBef.filter(val => {
|
||||
val['Selected'] = false;
|
||||
return val;
|
||||
});
|
||||
$scope.searchResultDetails = 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 {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// $scope.getDayBookList = function() {
|
||||
// let searchResultDetailsBef = $scope.data;
|
||||
// const filterAddSelect = searchResultDetailsBef.filter(val => {
|
||||
// val['Selected'] = false;
|
||||
// return val;
|
||||
// });
|
||||
// $scope.searchResultDetails = filterAddSelect;
|
||||
// $scope.searchResultLength = Object.keys($scope.searchResultDetails).length;
|
||||
// }
|
||||
|
||||
|
||||
// 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;
|
||||
$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;
|
||||
}
|
||||
}
|
||||
|
||||
$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) {
|
||||
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;
|
||||
}
|
||||
// alert(JSON.stringify($scope.myStatusModel));
|
||||
// alert(JSON.stringify(selectedItems));
|
||||
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("Success!", response.data.message, "success");
|
||||
// for success state
|
||||
$scope.getDayBookList();
|
||||
$scope.allSelected('undefined');
|
||||
$scope.OpenWindowStatus = false;
|
||||
} else {
|
||||
swal("Failed!", response.data.message, "error");
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
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) {
|
||||
// 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
|
||||
}
|
||||
}
|
||||
|
||||
$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": ""
|
||||
}
|
||||
|
||||
$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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$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': ''
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
}]);
|
||||
|
||||
|
||||
276
Apollo/assets/views/daybook/daybook.html
Normal file
276
Apollo/assets/views/daybook/daybook.html
Normal file
@ -0,0 +1,276 @@
|
||||
<!-- start: PAGE TITLE -->
|
||||
<section id="page-title">
|
||||
<div class="row">
|
||||
<div class="col-sm-8">
|
||||
<h1 class="mainTitle" translate="sidebar.nav.daybook.MAIN">{{ 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="daybookCtrl">
|
||||
<tabset class="tabbable" ng-init="init()">
|
||||
<tab heading="View" id="viewDayBook">
|
||||
<div class="container-fluid container-fullw">
|
||||
<div class="row">
|
||||
<!--<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>
|
||||
|
||||
<div class="col-md-12" ng-if="studentData == false" style="min-height: 281px;">
|
||||
<p style="color: red;" align="center"><strong><h3 class="text-center">No
|
||||
records found... </h3></strong></p>
|
||||
</div>-->
|
||||
|
||||
<div class="col-md-12">
|
||||
<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">
|
||||
<!--<pre>{{searchData.date}}</pre>-->
|
||||
<div data-ng-controller="DatepickerDemoCtrl">
|
||||
<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="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>
|
||||
<!--<div class="col-md-12" ng-if="noRecordFound == true" style="min-height: 281px;">
|
||||
<p style="color: red;" align="center"><strong><h3 class="text-center">No
|
||||
records found... </h3></strong></p>
|
||||
</div>-->
|
||||
<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=='Firstname'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
|
||||
</th>
|
||||
<th ng-click="sort('incomeExpense')">Income/Expense
|
||||
<span class="glyphicon sort-icon" ng-show="sortKey=='Lastname'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
|
||||
</th>
|
||||
<th ng-click="sort('type')">Type
|
||||
<span class="glyphicon sort-icon" ng-show="sortKey=='MobileNumber'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
|
||||
</th>
|
||||
<th ng-click="sort('amount')">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')">Description
|
||||
<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>
|
||||
<th class="center">Activity
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody dir-paginate="p in data|orderBy:sortKey:reverse|filter:search:strict|itemsPerPage:10">
|
||||
<tr>
|
||||
<td>{{p.Date}}</td>
|
||||
<td>{{p.ListName}}</td>
|
||||
<td>{{p.TypeName}}</td>
|
||||
<td>{{p.Amount}}</td>
|
||||
<td style="width: 275px;">{{p.Description}}</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>
|
||||
<td class="center" ng-if="p.Status != 'Pending'">-</td>
|
||||
<td class="center" ng-if="p.Status == 'Pending'">
|
||||
<span> <i tooltip="EDIT : {{p.ID}}" class="glyphicon glyphicon-pencil" ng-click="setEditId(p.ID)"></i> </span>
|
||||
<span> <i tooltip="DELETE : {{p.ID}}" class="glyphicon glyphicon-remove" ng-click="deleEditEntry(p.ID)"></i> </span>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr ng-show="editId === p.ID" ng-if="editId === p.ID">
|
||||
<!--<pre>{{ p }}</pre>-->
|
||||
<td colspan="7">
|
||||
<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" 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>
|
||||
|
||||
<select class="form-control" ng-init="getType(p.Name)" tabindex="1" class="cs-select cs-skin-elastic" name="editType" ng-model="myModel.type"
|
||||
required>
|
||||
<option value="" disabled selected>Select Type</option>
|
||||
<option ng-repeat="typeItem in getTypes" ng-selected="typeItem.ID == p.Type" value="{{typeItem.ID}}">{{typeItem.TypeName}}</option>
|
||||
</select>
|
||||
<span class="error text-small block" ng-if="Form.editType.$dirty && Form.editType.$error.required">Type is Required</span>
|
||||
|
||||
</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>
|
||||
|
||||
</label>
|
||||
<input type="text" name="editAmount" tabindex="2" placeholder="Enter Amount" class="form-control" ng-model="myModel.amount"
|
||||
required/>
|
||||
<span class="error text-small block" ng-if="Form.editAmount.$dirty && Form.editAmount.$error.required">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="editComments" ng-model="myModel.description"
|
||||
maxlength="100" />
|
||||
<span class="text-small block">Comments Should Less than 100 Charactes.</span>
|
||||
<span class="error text-small block" ng-if="Form.description.$dirty && Form.description.$error.pattern">Invalid Comments</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="center">
|
||||
<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="editClose()" tabindex="5" class="btn btn-warning btn-sm" ng-click="employeeForm.resetCourse(Form)">
|
||||
Cancel
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<dir-pagination-controls max-size="10" direction-links="true" boundary-links="true">
|
||||
</dir-pagination-controls>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</tab>
|
||||
<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-4 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-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 <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 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>
|
||||
<div class="row">
|
||||
|
||||
<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>
|
||||
|
||||
</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">Comments Should Less than 50 letters.</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="editClose()" tabindex="5" class="btn btn-warning btn-sm" ng-click="employeeForm.resetCourse(Form)">
|
||||
Cancel
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</tab>
|
||||
</tabset>
|
||||
</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>
|
||||
240
Apollo/assets/views/daybook/daybookadmin.html
Normal file
240
Apollo/assets/views/daybook/daybookadmin.html
Normal file
@ -0,0 +1,240 @@
|
||||
<!-- start: PAGE TITLE -->
|
||||
<section id="page-title">
|
||||
<div class="row">
|
||||
<div class="col-sm-8">
|
||||
<h1 class="mainTitle" translate="sidebar.nav.daybook.MAIN">{{ 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="daybookadminCtrl">
|
||||
<div ng-init="init()">
|
||||
|
||||
<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-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">
|
||||
<!--<pre>{{searchData.date}}</pre>-->
|
||||
<div data-ng-controller="DatepickerDemoCtrl">
|
||||
<label>
|
||||
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>
|
||||
<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>
|
||||
<!--<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 class="table-responsive" ng-if="showTheRefValue == 'I002'">
|
||||
<table class="table table-hover" ng-if="searchResultLength > 0">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th ng-click="sort('date')">Date
|
||||
<span class="glyphicon sort-icon" ng-show="sortKey=='Firstname'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
|
||||
</th>
|
||||
<th ng-click="sort('incomeExpense')">Income/Expense
|
||||
<span class="glyphicon sort-icon" ng-show="sortKey=='Lastname'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
|
||||
</th>
|
||||
<th ng-click="sort('type')">Type
|
||||
<span class="glyphicon sort-icon" ng-show="sortKey=='MobileNumber'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
|
||||
</th>
|
||||
<th ng-click="sort('amount')">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')">Description
|
||||
<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.TypeName}}</td>
|
||||
<td>{{p.Amount}}</td>
|
||||
<td style="width: 275px;">{{p.Description}}</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 class="table-responsive" ng-if="showTheRefValue == 'I001'">
|
||||
<table class="table table-hover" ng-if="searchResultLength > 0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<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=='Firstname'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
|
||||
</th>
|
||||
<th ng-click="sort('incomeExpense')">Income/Expense
|
||||
<span class="glyphicon sort-icon" ng-show="sortKey=='Lastname'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
|
||||
</th>
|
||||
<th ng-click="sort('type')">Type
|
||||
<span class="glyphicon sort-icon" ng-show="sortKey=='MobileNumber'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
|
||||
</th>
|
||||
<th ng-click="sort('amount')">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')">Description
|
||||
<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 searchResultDetails|orderBy:sortKey:reverse|filter:search:strict|itemsPerPage:10">
|
||||
<tr>
|
||||
<td>
|
||||
<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.TypeName}}</td>
|
||||
<td>{{p.Amount}}</td>
|
||||
<td style="width: 275px;">{{p.Description}}</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>
|
||||
</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">
|
||||
<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">Comments Should Less than 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>
|
||||
237
Apollo/assets/views/daybook/daybooksuperadmin.html
Normal file
237
Apollo/assets/views/daybook/daybooksuperadmin.html
Normal file
@ -0,0 +1,237 @@
|
||||
<!-- start: PAGE TITLE -->
|
||||
<section id="page-title">
|
||||
<div class="row">
|
||||
<div class="col-sm-8">
|
||||
<h1 class="mainTitle" translate="sidebar.nav.daybook.MAIN">{{ 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="daybooksuperadminCtrl">
|
||||
<div ng-init="init()">
|
||||
|
||||
<div ng-if="localTypeViewSuperAdmin">
|
||||
<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-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">
|
||||
<!--<pre>{{searchData.date}}</pre>-->
|
||||
<div data-ng-controller="DatepickerDemoCtrl">
|
||||
<label>
|
||||
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>
|
||||
<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>
|
||||
<!--<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 class="table-responsive" ng-if="showTheRefValue == 'I002'">
|
||||
<table class="table table-hover" ng-if="searchResultLength > 0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th ng-click="sort('date')">Branch
|
||||
<span class="glyphicon sort-icon" ng-show="sortKey=='Firstname'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
|
||||
</th>
|
||||
|
||||
<th ng-click="sort('date')">Date
|
||||
<span class="glyphicon sort-icon" ng-show="sortKey=='Firstname'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
|
||||
</th>
|
||||
<th ng-click="sort('incomeExpense')">Income/Expense
|
||||
<span class="glyphicon sort-icon" ng-show="sortKey=='Lastname'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
|
||||
</th>
|
||||
<th ng-click="sort('type')">Type
|
||||
<span class="glyphicon sort-icon" ng-show="sortKey=='MobileNumber'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
|
||||
</th>
|
||||
<th ng-click="sort('amount')">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')">Description
|
||||
<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.BranchName}}</td>
|
||||
<td>{{p.Date}}</td>
|
||||
<td>{{p.ListName}}</td>
|
||||
<td>{{p.TypeName}}</td>
|
||||
<td>{{p.Amount}}</td>
|
||||
<td style="width: 275px;">{{p.Description}}</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 class="table-responsive" ng-if="showTheRefValue == 'I001'">
|
||||
<table class="table table-hover" ng-if="searchResultLength > 0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th ng-click="sort('date')">Branch
|
||||
<span class="glyphicon sort-icon" ng-show="sortKey=='Firstname'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
|
||||
</th>
|
||||
<th ng-click="sort('date')">Date
|
||||
<span class="glyphicon sort-icon" ng-show="sortKey=='Firstname'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
|
||||
</th>
|
||||
<th ng-click="sort('incomeExpense')">Income/Expense
|
||||
<span class="glyphicon sort-icon" ng-show="sortKey=='Lastname'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
|
||||
</th>
|
||||
<th ng-click="sort('type')">Type
|
||||
<span class="glyphicon sort-icon" ng-show="sortKey=='MobileNumber'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
|
||||
</th>
|
||||
<th ng-click="sort('amount')">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')">Description
|
||||
<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 searchResultDetails|orderBy:sortKey:reverse|filter:search:strict|itemsPerPage:10">
|
||||
<tr>
|
||||
<td>{{p.BranchName}}</td>
|
||||
<td>{{p.Date}}</td>
|
||||
<td>{{p.ListName}}</td>
|
||||
<td>{{p.TypeName}}</td>
|
||||
<td>{{p.Amount}}</td>
|
||||
<td style="width: 275px;">{{p.Description}}</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>
|
||||
</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">
|
||||
<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">Comments Should Less than 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>
|
||||
@ -111,6 +111,18 @@
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li ng-class="{'active open':$state.includes('app.daybooksuperadmin')}">
|
||||
<a ui-sref="app.daybooksuperadmin">
|
||||
<div class="item-content">
|
||||
<div class="item-media">
|
||||
<i class="ti-id-badge"></i>
|
||||
</div>
|
||||
<div class="item-inner">
|
||||
<span class="title" translate="sidebar.nav.daybook.MAIN">DAY BOOK</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li ng-class="{'active open':$state.includes('app.myprofile')}">
|
||||
<a ui-sref="app.myprofile">
|
||||
<div class="item-content">
|
||||
@ -265,6 +277,18 @@
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li ng-class="{'active open':$state.includes('app.daybookadmin')}">
|
||||
<a ui-sref="app.daybookadmin">
|
||||
<div class="item-content">
|
||||
<div class="item-media">
|
||||
<i class="ti-id-badge"></i>
|
||||
</div>
|
||||
<div class="item-inner">
|
||||
<span class="title" translate="sidebar.nav.daybook.MAIN">DAY BOOK</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li ng-class="{'active open':$state.includes('app.myprofile')}">
|
||||
<a ui-sref="app.myprofile">
|
||||
<div class="item-content">
|
||||
@ -328,6 +352,18 @@
|
||||
</div>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li ng-class="{'active open':$state.includes('app.daybook')}">
|
||||
<a ui-sref="app.daybook">
|
||||
<div class="item-content">
|
||||
<div class="item-media">
|
||||
<i class="ti-id-badge"></i>
|
||||
</div>
|
||||
<div class="item-inner">
|
||||
<span class="title" translate="sidebar.nav.daybook.MAIN">DAY BOOK</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li ng-class="{'active open':$state.includes('app.myprofile')}">
|
||||
<a ui-sref="app.myprofile">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user