Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 3690-worker_calendar_fixe2e

This commit is contained in:
Alex Moreno 2022-03-15 14:49:22 +01:00
commit c7d8ebebff
6 changed files with 13 additions and 10 deletions

View File

@ -0,0 +1,3 @@
UPDATE `account`.`user`
SET `role` = 57
WHERE id IN (2294, 4365, 7294);

View File

@ -116,8 +116,8 @@ module.exports = Self => {
if (!isEditable) if (!isEditable)
throw new UserError(`The sales of this ticket can't be modified`); throw new UserError(`The sales of this ticket can't be modified`);
const isProductionBoss = await models.Account.hasRole(userId, 'productionBoss', myOptions); const isDeliveryBoss = await models.Account.hasRole(userId, 'deliveryBoss', myOptions);
if (!isProductionBoss) { if (!isDeliveryBoss) {
const zoneShipped = await models.Agency.getShipped( const zoneShipped = await models.Agency.getShipped(
args.landed, args.landed,
args.addressFk, args.addressFk,

View File

@ -31,10 +31,10 @@ module.exports = Self => {
}, myOptions); }, myOptions);
const isSalesAssistant = await Self.app.models.Account.hasRole(userId, 'salesAssistant', myOptions); const isSalesAssistant = await Self.app.models.Account.hasRole(userId, 'salesAssistant', myOptions);
const isProductionBoss = await Self.app.models.Account.hasRole(userId, 'productionBoss', myOptions); const isDeliveryBoss = await Self.app.models.Account.hasRole(userId, 'deliveryBoss', myOptions);
const isBuyer = await Self.app.models.Account.hasRole(userId, 'buyer', myOptions); const isBuyer = await Self.app.models.Account.hasRole(userId, 'buyer', myOptions);
const isValidRole = isSalesAssistant || isProductionBoss || isBuyer; const isValidRole = isSalesAssistant || isDeliveryBoss || isBuyer;
let alertLevel = state ? state.alertLevel : null; let alertLevel = state ? state.alertLevel : null;
let ticket = await Self.app.models.Ticket.findById(id, { let ticket = await Self.app.models.Ticket.findById(id, {

View File

@ -78,8 +78,8 @@ module.exports = Self => {
if (!isEditable) if (!isEditable)
throw new UserError(`The sales of this ticket can't be modified`); throw new UserError(`The sales of this ticket can't be modified`);
const isProductionBoss = await models.Account.hasRole(userId, 'productionBoss', myOptions); const isDeliveryBoss = await models.Account.hasRole(userId, 'deliveryBoss', myOptions);
if (!isProductionBoss) { if (!isDeliveryBoss) {
const zoneShipped = await models.Agency.getShipped( const zoneShipped = await models.Agency.getShipped(
args.landed, args.landed,
args.addressId, args.addressId,

View File

@ -69,14 +69,14 @@ class Controller extends Section {
if (!$events.length) return; if (!$events.length) return;
const day = $days[0]; const day = $days[0];
const zonesIds = []; const zoneIds = [];
for (let event of $events) for (let event of $events)
zonesIds.push(event.zoneFk); zoneIds.push(event.zoneFk);
this.$.zoneEvents.show($event.target); this.$.zoneEvents.show($event.target);
const params = { const params = {
zonesId: zonesIds, zoneIds: zoneIds,
date: day date: day
}; };

View File

@ -110,7 +110,7 @@ describe('Zone Component vnZoneDeliveryDays', () => {
{zoneFk: 8} {zoneFk: 8}
]; ];
const params = { const params = {
zonesId: [1, 2, 8], zoneIds: [1, 2, 8],
date: [day][0] date: [day][0]
}; };
const response = [{id: 1, hour: ''}]; const response = [{id: 1, hour: ''}];