Employee functions dummy created.
Hopefully client side authorization fixed. Post voucher fixed.
This commit is contained in:
parent
b1dd396556
commit
44bab156f3
29
brewman/brewman/static/partial/employee-functions.html
Normal file
29
brewman/brewman/static/partial/employee-functions.html
Normal file
@ -0,0 +1,29 @@
|
||||
<form method="post" autocomplete="off" class="form-horizontal">
|
||||
<legend>Credit Salary</legend>
|
||||
<div class="control-group">
|
||||
<label for="txtSalaryMonth" class="control-label">Month</label>
|
||||
|
||||
<div class="controls">
|
||||
<datepicker id="txtSalaryMonth" model="info" prop="SalaryMonth" ng-model="salaryMonth"></datepicker>
|
||||
<button class="btn" ng-click="creditSalary()">Credit</button>
|
||||
</div>
|
||||
</div>
|
||||
<legend>Credit Esi / Pf</legend>
|
||||
<div class="control-group">
|
||||
<label for="txtEsiPfMonth" class="control-label">Month</label>
|
||||
|
||||
<div class="controls">
|
||||
<datepicker id="txtEsiPfMonth" model="info" prop="EsiPfMonth" ng-model="esiPfMonth"></datepicker>
|
||||
<button class="btn" ng-click="creditEsiPf()">Credit</button>
|
||||
</div>
|
||||
</div>
|
||||
<legend>Upload Fingerprints</legend>
|
||||
<div class="control-group">
|
||||
<label for="uploadFingerprints" class="control-label"></label>
|
||||
|
||||
<div class="controls">
|
||||
<input type="file" id="uploadFingerprints" />
|
||||
<button class="btn" ng-click="uploadFingerprints()">Upload</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
@ -120,7 +120,7 @@
|
||||
<button class="btn btn-primary" ng-click="save()"
|
||||
ng-disabled="!perms['Issue']">{{voucher.Code | save_button}}
|
||||
</button>
|
||||
= <button class="btn btn-danger" ng-click="resetVoucher(voucher.VoucherID)" ng-hide="voucher.Code == '(Auto)'">
|
||||
<button class="btn btn-danger" ng-click="resetVoucher(voucher.VoucherID)" ng-hide="voucher.Code == '(Auto)'">
|
||||
New Entry
|
||||
</button>
|
||||
<button class="btn btn-danger" ng-click="delete()" ng-hide="voucher.Code == '(Auto)'"
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 771 KiB |
Binary file not shown.
Before Width: | Height: | Size: 153 KiB |
Binary file not shown.
Before Width: | Height: | Size: 36 KiB |
Binary file not shown.
Before Width: | Height: | Size: 46 KiB |
Binary file not shown.
Before Width: | Height: | Size: 67 KiB |
Binary file not shown.
Before Width: | Height: | Size: 33 KiB |
12
brewman/brewman/static/scripts/employee-functions.js
Normal file
12
brewman/brewman/static/scripts/employee-functions.js
Normal file
@ -0,0 +1,12 @@
|
||||
function EmployeeFunctionsCtrl($scope) {
|
||||
$scope.creditSalary = function () {
|
||||
$scope.toasts.push({Type:'Error', Message:'Not Implemented Yet'});
|
||||
};
|
||||
$scope.creditEsiPf = function () {
|
||||
$scope.toasts.push({Type:'Error', Message:'Not Implemented Yet'});
|
||||
};
|
||||
$scope.uploadFingerprints = function () {
|
||||
$scope.toasts.push({Type:'Error', Message:'Not Implemented Yet'});
|
||||
};
|
||||
|
||||
}
|
@ -43,6 +43,7 @@ var overlord = angular.module('overlord', ['overlord.directive', 'overlord.filte
|
||||
when('/Unposted', {templateUrl:'/partial/unposted.html', controller:UnpostedCtrl}).
|
||||
when('/ProfitLoss', {templateUrl:'/partial/profit-loss.html', controller:ProfitLossCtrl}).
|
||||
when('/PurchaseEntries', {templateUrl:'/partial/purchase-entries.html', controller:PurchaseEntriesCtrl}).
|
||||
when('/EmployeeFunctions', {templateUrl:'/partial/employee-functions.html', controller:EmployeeFunctionsCtrl}).
|
||||
|
||||
when('/TrialBalance', {templateUrl:'/partial/trial-balance.html', controller:TrialBalanceCtrl}).
|
||||
when('/TrialBalance/:date', {templateUrl:'/partial/trial-balance.html', controller:TrialBalanceCtrl}).
|
||||
@ -124,7 +125,7 @@ var overlord = angular.module('overlord', ['overlord.directive', 'overlord.filte
|
||||
function BaseCtrl($rootScope, $scope, Auth, $location) {
|
||||
$rootScope.spinner = {http:0, route:false};
|
||||
$rootScope.$on('event:loginRequired', function () {
|
||||
if (!$rootScope.auth.isAuthenticated) {
|
||||
if ($rootScope.auth.isAuthenticated) {
|
||||
$location.path('/');
|
||||
} else {
|
||||
$location.path('/login');
|
||||
|
@ -39,6 +39,7 @@
|
||||
<script src="/script/issue.js"> </script>
|
||||
|
||||
<script src="/script/employee-attendance.js"> </script>
|
||||
<script src="/script/employee-functions.js"> </script>
|
||||
<script src="/script/attendance.js"> </script>
|
||||
<script src="/script/ledger.js"> </script>
|
||||
<script src="/script/product-ledger.js"> </script>
|
||||
|
@ -1,7 +1,10 @@
|
||||
from decimal import Decimal
|
||||
import json
|
||||
import os
|
||||
import uuid
|
||||
from pyramid.httpexceptions import HTTPForbidden, HTTPFound
|
||||
from pyramid.httpexceptions import HTTPForbidden, HTTPFound, exception_response
|
||||
from pyramid.response import FileResponse, Response
|
||||
from pyramid.security import forget
|
||||
from pyramid.view import view_config
|
||||
|
||||
@view_config(route_name='home', renderer='brewman:templates/angular_base.mako')
|
||||
@ -10,9 +13,27 @@ from pyramid.view import view_config
|
||||
def home(request):
|
||||
return {}
|
||||
|
||||
@view_config(context=HTTPForbidden, renderer='brewman:templates/angular_base.mako')
|
||||
@view_config(context=HTTPForbidden, renderer='brewman:templates/angular_base.mako', xhr=False)
|
||||
def forbidden(request):
|
||||
return HTTPFound(location=request.route_url('login'))
|
||||
if 'X-Requested-With' in request.headers and request.headers['X-Requested-With'] == 'XMLHttpRequest':
|
||||
response = Response("Forbidden")
|
||||
response.status_int = 401
|
||||
return response
|
||||
else:
|
||||
return HTTPFound(location=request.route_url('login'))
|
||||
|
||||
@view_config(route_name='logout')
|
||||
def logout(request):
|
||||
request.session.invalidate()
|
||||
headers = forget(request)
|
||||
return HTTPFound(location=request.route_url('home'), headers=headers)
|
||||
|
||||
|
||||
@view_config(route_name='favicon')
|
||||
def favicon(request):
|
||||
here = os.path.dirname(__file__)
|
||||
icon = os.path.join(here, 'favicon.ico')
|
||||
return FileResponse(icon, request=request)
|
||||
|
||||
class DecimalAsFloatHack(float):
|
||||
def __init__(self, d):
|
||||
|
@ -1,20 +0,0 @@
|
||||
import os
|
||||
|
||||
from pyramid.httpexceptions import HTTPFound
|
||||
from pyramid.response import FileResponse
|
||||
from pyramid.security import forget
|
||||
from pyramid.view import view_config
|
||||
|
||||
|
||||
@view_config(route_name='logout')
|
||||
def logout(request):
|
||||
request.session.invalidate()
|
||||
headers = forget(request)
|
||||
return HTTPFound(location=request.route_url('home'), headers=headers)
|
||||
|
||||
|
||||
@view_config(route_name='favicon')
|
||||
def favicon(request):
|
||||
here = os.path.dirname(__file__)
|
||||
icon = os.path.join(here, 'favicon.ico')
|
||||
return FileResponse(icon, request=request)
|
@ -20,7 +20,7 @@ __author__ = 'tanshu'
|
||||
def voucher_post(request):
|
||||
user = User.get_by_id(uuid.UUID(authenticated_userid(request)))
|
||||
try:
|
||||
voucher = Voucher.by_id(uuid.UUID(id))
|
||||
voucher = Voucher.by_id(uuid.UUID(request.matchdict['id']))
|
||||
voucher.posted = True
|
||||
voucher.poster_id = user.id
|
||||
transaction.commit()
|
||||
|
Loading…
Reference in New Issue
Block a user