#1719 claim.detail cambiar descuento falla
This commit is contained in:
parent
d56c7ff540
commit
99ef8a6010
|
@ -20,11 +20,12 @@ module.exports = Self => {
|
|||
});
|
||||
|
||||
Self.isEditable = async(ctx, id) => {
|
||||
const accessToken = ctx.req.accessToken;
|
||||
const userId = accessToken.userId;
|
||||
const userId = ctx.req.accessToken.userId;
|
||||
|
||||
let state = await Self.app.models.TicketState.findOne({
|
||||
where: {ticketFk: id}
|
||||
});
|
||||
|
||||
let isProductionBoss = await Self.app.models.Account.hasRole(userId, 'productionBoss');
|
||||
let alertLevel = state ? state.alertLevel : null;
|
||||
let ticket = await Self.app.models.Ticket.findById(id, {
|
||||
|
@ -41,7 +42,7 @@ module.exports = Self => {
|
|||
|
||||
const isDeleted = ticket && ticket.isDeleted;
|
||||
const isOnDelivery = (alertLevel && alertLevel > 0);
|
||||
const isNotNormalClient = ticket && ticket.client().type().code == 'normal';
|
||||
const isNotNormalClient = ticket && ticket.client().type().code != 'normal';
|
||||
const isInvoiced = ticket && ticket.refFk;
|
||||
|
||||
if (!ticket || (isOnDelivery && isNotNormalClient && !isProductionBoss) || isInvoiced || isDeleted)
|
||||
|
|
Loading…
Reference in New Issue