Merge branch 'dev' of https://git.verdnatura.es/salix into dev
This commit is contained in:
commit
700fea1d54
|
@ -1,4 +1,4 @@
|
|||
<mg-ajax path="/ticket/api/Sales/saleComponentFilter" options="vnIndex" actions="$ctrl.sales = index.model.instances"></mg-ajax>
|
||||
<mg-ajax path="/ticket/api/Sales/saleComponentFilter" options="vnIndexNonAuto" actions="$ctrl.sales = index.model.instances"></mg-ajax>
|
||||
<vn-vertical>
|
||||
<vn-card pad-large>
|
||||
<vn-vertical>
|
||||
|
|
|
@ -1,7 +1,14 @@
|
|||
import ngModule from '../module';
|
||||
import './style.scss';
|
||||
import FilterTicketList from '../filter-ticket-list';
|
||||
|
||||
class Controller extends FilterTicketList {
|
||||
constructor($scope, $timeout, $stateParams) {
|
||||
super($scope, $timeout, $stateParams);
|
||||
this.$scope = $scope;
|
||||
this.onOrder('itemFk', 'ASC');
|
||||
}
|
||||
|
||||
class Controller {
|
||||
total() {
|
||||
let sum;
|
||||
if (this.sales) {
|
||||
|
@ -36,6 +43,8 @@ class Controller {
|
|||
}
|
||||
}
|
||||
|
||||
Controller.$inject = ['$scope', '$timeout', '$state'];
|
||||
|
||||
ngModule.component('vnTicketComponents', {
|
||||
template: require('./component.html'),
|
||||
controller: Controller,
|
||||
|
|
|
@ -7,7 +7,7 @@ module.exports = Self => {
|
|||
* @param {Integer} stateId The user id
|
||||
* @return {Boolean} %true if user has the role, %false otherwise
|
||||
*/
|
||||
Self.isAlertLevel0 = async function(stateId) {
|
||||
Self.isAlertLevelZero = async function(stateId) {
|
||||
let result = await Self.rawSql(
|
||||
`SELECT alertLevel
|
||||
FROM vn.state
|
||||
|
|
|
@ -10,10 +10,10 @@ module.exports = function(Self) {
|
|||
|
||||
let isEmployee = await models.Account.hasRole(userId, 'employee');
|
||||
let isProduction = await models.Account.hasRole(userId, 'production');
|
||||
let isAlertLevel0 = await models.State.isAlertLevel0(ctx.instance.stateFk);
|
||||
let isAlertLevelZero = await models.State.isAlertLevelZero(ctx.instance.stateFk);
|
||||
let ticketAlertLevel = await models.TicketState.findOne({where: {id: ctx.instance.ticketFk}, fields: ["alertLevel"]});
|
||||
|
||||
if ((!isProduction && !isAlertLevel0) || !isEmployee || (isEmployee && ticketAlertLevel != 0 && !isProduction))
|
||||
if ((!isProduction && !isAlertLevelZero) || !isEmployee || (isEmployee && ticketAlertLevel != 0 && !isProduction))
|
||||
throw new Error("You don't have enough privileges to do that");
|
||||
|
||||
let user = await models.Worker.findOne({where: {userFk: userId}});
|
||||
|
|
Loading…
Reference in New Issue