Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 6067-vnUser_privileges_and_verifyEmail
This commit is contained in:
commit
a0d705683b
|
@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
|
|||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [2342.01] - 2023-10-19
|
||||
|
||||
### Added
|
||||
### Changed
|
||||
### Fixed
|
||||
|
||||
## [2340.01] - 2023-10-05
|
||||
|
||||
|
@ -17,6 +22,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
### Added
|
||||
- (Ticket -> Servicios) Se pueden abonar servicios
|
||||
- (Facturas -> Datos básicos) Muestra valores por defecto
|
||||
- (Facturas -> Borrado) Notificación al borrar un asiento ya enlazado en Sage
|
||||
### Changed
|
||||
- (Trabajadores -> Calendario) Icono de check arreglado cuando pulsas un tipo de dia
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
ALTER TABLE `vn`.`deviceLog` ADD serialNumber varchar(45) DEFAULT NULL NULL;
|
||||
-- ALTER TABLE `vn`.`deviceLog` ADD serialNumber varchar(45) DEFAULT NULL NULL;
|
||||
|
||||
INSERT INTO `salix`.`ACL` ( model, property, accessType, permission, principalType, principalId)
|
||||
VALUES( 'DeviceLog', 'create', 'WRITE', 'ALLOW', 'ROLE', 'employee');
|
||||
-- INSERT INTO `salix`.`ACL` ( model, property, accessType, permission, principalType, principalId)
|
||||
-- VALUES( 'DeviceLog', 'create', 'WRITE', 'ALLOW', 'ROLE', 'employee');
|
||||
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
-- No encuentro este back
|
||||
DELETE FROM `salix`.`ACL` WHERE property = 'activeWorkersWithRole';
|
||||
DELETE FROM `salix`.`ACL` WHERE model = 'Client' AND property = '*';
|
||||
|
||||
INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId)
|
||||
VALUES ('Client','findOne','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId)
|
||||
VALUES ('Client','findById','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId)
|
||||
VALUES ('Client','find','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId)
|
||||
VALUES ('Client','exists','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId)
|
||||
VALUES ('Client','__get__addresses','READ','ALLOW','ROLE','employee');
|
||||
|
||||
DELETE FROM `salix`.`ACL` WHERE model = 'Client' AND property = '*' AND accessType IN (
|
||||
'campaignMetricsEmail',
|
||||
'campaignMetricsPdf',
|
||||
'clientDebtStatementEmail',
|
||||
'clientDebtStatementHtml',
|
||||
'clientDebtStatementPdf',
|
||||
'clientWelcomeEmail',
|
||||
'clientWelcomeHtml',
|
||||
'consumptionSendQueued',
|
||||
'creditRequestEmail',
|
||||
'creditRequestHtml',
|
||||
'creditRequestPdf',
|
||||
'getClientOrSupplierReference',
|
||||
'incotermsAuthorizationEmail',
|
||||
'incotermsAuthorizationHtml',
|
||||
'incotermsAuthorizationPdf',
|
||||
'letterDebtorNdEmail',
|
||||
'letterDebtorNdHtml',
|
||||
'letterDebtorPdf',
|
||||
'letterDebtorStEmail',
|
||||
'letterDebtorStHtml',
|
||||
'printerSetupEmail',
|
||||
'printerSetupHtml',
|
||||
'sepaCoreEmail',
|
||||
'setPassword',
|
||||
'updateUser',
|
||||
'uploadFile');
|
|
@ -0,0 +1,11 @@
|
|||
INSERT INTO `salix`.`ACL` ( model, property, accessType, permission, principalType, principalId)
|
||||
VALUES
|
||||
('ExpeditionMistakeType', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
|
||||
('WorkerMistakeType', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
|
||||
('ExpeditionMistake','*','WRITE','ALLOW','ROLE','employee'),
|
||||
('WorkerMistake', '*', 'WRITE', 'ALLOW', 'ROLE', 'coolerBoss'),
|
||||
('MistakesTypes', '*', 'WRITE', 'ALLOW', 'ROLE', 'coolerBoss'),
|
||||
('MistakeType','*','READ','ALLOW','ROLE','employee'),
|
||||
('MachineWorker', '*', 'READ', 'ALLOW', 'ROLE', 'coolerAssist'),
|
||||
('Printer','*','READ','ALLOW','ROLE','employee'),
|
||||
('SaleMistake', '*', 'WRITE', 'ALLOW', 'ROLE', 'production');
|
|
@ -0,0 +1,10 @@
|
|||
DELETE FROM `salix`.`ACL` WHERE model = 'Account' AND property = '*' AND principalId = 'employee';
|
||||
|
||||
INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId)
|
||||
VALUES ('Account','findOne','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId)
|
||||
VALUES ('Account','findById','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId)
|
||||
VALUES ('Account','find','READ','ALLOW','ROLE','employee');
|
||||
INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId)
|
||||
VALUES ('Account','exists','READ','ALLOW','ROLE','employee');
|
|
@ -4,13 +4,18 @@ INSERT INTO `account`.`role` (name, description)
|
|||
|
||||
INSERT INTO `account`.`roleInherit` (role, inheritsFrom)
|
||||
SELECT (SELECT id FROM account.role r1 WHERE r1.name = 'deliveryAssistant'), ri.inheritsFrom
|
||||
FROM account.roleInherit ri
|
||||
JOIN account.role r2 ON r2.id = ri.`role`
|
||||
WHERE r2.name = 'deliveryBoss';
|
||||
FROM account.roleInherit ri
|
||||
JOIN account.role r2 ON r2.id = ri.`role`
|
||||
WHERE r2.name = 'deliveryBoss';
|
||||
|
||||
DELETE `account`.`roleInherit` FROM `account`.`roleInherit`
|
||||
JOIN `account`.`role` r ON `account`.`roleInherit`.role = r.id
|
||||
WHERE r.name = 'deliveryBoss';
|
||||
|
||||
INSERT INTO `account`.`roleInherit` (role, inheritsFrom)
|
||||
SELECT (SELECT id FROM account.role WHERE name = 'deliveryBoss') role,
|
||||
(SELECT id FROM account.role WHERE name = 'deliveryAssistant') roleInherit;
|
||||
|
||||
|
||||
CALL `account`.`role_syncPrivileges`();
|
||||
UPDATE `salix`.`ACL`
|
||||
SET principalId='deliveryAssistant'
|
||||
WHERE principalId='deliveryBoss';
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
-- Locally it fails because it is executed before the fixtures and the roleConfig table is empty
|
||||
CALL `account`.`role_syncPrivileges`();
|
File diff suppressed because one or more lines are too long
|
@ -2974,3 +2974,7 @@ INSERT INTO vn.XDiario (id, ASIEN, FECHA, SUBCTA, CONTRA, CONCEPTO, EURODEBE, EU
|
|||
(4, 2.0, util.VN_CURDATE(), '4300001104', NULL, 'n/fra T4444444', 8.88, NULL, NULL, NULL, '0', NULL, 0.00, NULL, NULL, NULL, NULL, NULL, '2', NULL, 1, 2, 'I.F.', 'Nombre Importador', 1, 0, 0, util.VN_CURDATE(), 0, 442, 0, 0, 0.00, NULL, NULL, util.VN_CURDATE(), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
|
||||
(5, 2.0, util.VN_CURDATE(), '2000000000', '4300001104', 'n/fra T4444444 Tony Stark', NULL, 8.07, NULL, NULL, '0', NULL, 0.00, NULL, NULL, NULL, NULL, NULL, '2', NULL, 1, 2, 'I.F.', 'Nombre Importador', 1, 0, 0, util.VN_CURDATE(), 0, 442, 0, 0, 0.00, NULL, NULL, util.VN_CURDATE(), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
|
||||
(6, 2.0, util.VN_CURDATE(), '4770000010', '4300001104', 'Inmovilizado pendiente : n/fra T4444444 Tony Stark', NULL, 0.81, 8.07, 'T', '4444444', 10.00, NULL, NULL, NULL, NULL, NULL, '', '2', '', 1, 1, '06089160W', 'IRON MAN', 1, 1, 0, util.VN_CURDATE(), 0, 442, 0, 0, 0.00, NULL, NULL, util.VN_CURDATE(), NULL, 1, 1, 1, 1, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0);
|
||||
|
||||
INSERT INTO `vn`.`mistakeType` (`id`, `description`)
|
||||
VALUES
|
||||
(1, 'Incorrect quantity');
|
||||
|
|
|
@ -26556,6 +26556,7 @@ CREATE TABLE `deviceLog` (
|
|||
`created` timestamp NOT NULL DEFAULT current_timestamp(),
|
||||
`nameApp` varchar(45) DEFAULT NULL,
|
||||
`versionApp` varchar(45) DEFAULT NULL,
|
||||
`serialNumber` varchar(45) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `deviceLog_FK` (`userFk`),
|
||||
CONSTRAINT `deviceLog_FK` FOREIGN KEY (`userFk`) REFERENCES `worker` (`id`) ON UPDATE CASCADE
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import selectors from '../../helpers/selectors.js';
|
||||
import getBrowser from '../../helpers/puppeteer';
|
||||
import getBrowser from '../../helpers/puppeteer.js';
|
||||
|
||||
// #1528 e2e claim/detail
|
||||
xdescribe('Claim detail', () => {
|
|
@ -1,97 +0,0 @@
|
|||
import selectors from '../../helpers/selectors.js';
|
||||
import getBrowser from '../../helpers/puppeteer';
|
||||
|
||||
describe('Claim development', () => {
|
||||
let browser;
|
||||
let page;
|
||||
|
||||
beforeAll(async() => {
|
||||
browser = await getBrowser();
|
||||
page = browser.page;
|
||||
await page.loginAndModule('claimManager', 'claim');
|
||||
await page.accessToSearchResult('1');
|
||||
await page.accessToSection('claim.card.development');
|
||||
});
|
||||
|
||||
afterAll(async() => {
|
||||
await browser.close();
|
||||
});
|
||||
|
||||
it('should delete a development and create a new one', async() => {
|
||||
await page.waitToClick(selectors.claimDevelopment.firstDeleteDevelopmentButton);
|
||||
await page.waitToClick(selectors.claimDevelopment.addDevelopmentButton);
|
||||
await page.autocompleteSearch(selectors.claimDevelopment.secondClaimReason, 'Baja calidad');
|
||||
await page.autocompleteSearch(selectors.claimDevelopment.secondClaimResult, 'Deshidratacion');
|
||||
await page.autocompleteSearch(selectors.claimDevelopment.secondClaimResponsible, 'Calidad general');
|
||||
await page.autocompleteSearch(selectors.claimDevelopment.secondClaimWorker, 'deliveryNick');
|
||||
await page.autocompleteSearch(selectors.claimDevelopment.secondClaimRedelivery, 'Reparto');
|
||||
await page.waitToClick(selectors.claimDevelopment.saveDevelopmentButton);
|
||||
const message = await page.waitForSnackbar();
|
||||
|
||||
expect(message.text).toContain('Data saved!');
|
||||
});
|
||||
|
||||
it(`should redirect to the next section of claims as the role is claimManager`, async() => {
|
||||
await page.waitForState('claim.card.action');
|
||||
});
|
||||
|
||||
it('should edit a development', async() => {
|
||||
await page.reloadSection('claim.card.development');
|
||||
await page.autocompleteSearch(selectors.claimDevelopment.firstClaimReason, 'Calor');
|
||||
await page.autocompleteSearch(selectors.claimDevelopment.firstClaimResult, 'Cocido');
|
||||
await page.autocompleteSearch(selectors.claimDevelopment.firstClaimResponsible, 'Calidad general');
|
||||
await page.autocompleteSearch(selectors.claimDevelopment.firstClaimWorker, 'adminAssistantNick');
|
||||
await page.autocompleteSearch(selectors.claimDevelopment.firstClaimRedelivery, 'Cliente');
|
||||
await page.waitToClick(selectors.claimDevelopment.saveDevelopmentButton);
|
||||
const message = await page.waitForSnackbar();
|
||||
|
||||
expect(message.text).toContain('Data saved!');
|
||||
});
|
||||
|
||||
it('should confirm the first development is the expected one', async() => {
|
||||
await page.reloadSection('claim.card.development');
|
||||
const reason = await page
|
||||
.waitToGetProperty(selectors.claimDevelopment.firstClaimReason, 'value');
|
||||
|
||||
const result = await page
|
||||
.waitToGetProperty(selectors.claimDevelopment.firstClaimResult, 'value');
|
||||
|
||||
const responsible = await page
|
||||
.waitToGetProperty(selectors.claimDevelopment.firstClaimResponsible, 'value');
|
||||
|
||||
const worker = await page
|
||||
.waitToGetProperty(selectors.claimDevelopment.firstClaimWorker, 'value');
|
||||
|
||||
const redelivery = await page
|
||||
.waitToGetProperty(selectors.claimDevelopment.firstClaimRedelivery, 'value');
|
||||
|
||||
expect(reason).toEqual('Calor');
|
||||
expect(result).toEqual('Baboso/Cocido');
|
||||
expect(responsible).toEqual('Calidad general');
|
||||
expect(worker).toEqual('adminAssistantNick');
|
||||
expect(redelivery).toEqual('Cliente');
|
||||
});
|
||||
|
||||
it('should confirm the second development is the expected one', async() => {
|
||||
const reason = await page
|
||||
.waitToGetProperty(selectors.claimDevelopment.secondClaimReason, 'value');
|
||||
|
||||
const result = await page
|
||||
.waitToGetProperty(selectors.claimDevelopment.secondClaimResult, 'value');
|
||||
|
||||
const responsible = await page
|
||||
.waitToGetProperty(selectors.claimDevelopment.secondClaimResponsible, 'value');
|
||||
|
||||
const worker = await page
|
||||
.waitToGetProperty(selectors.claimDevelopment.secondClaimWorker, 'value');
|
||||
|
||||
const redelivery = await page
|
||||
.waitToGetProperty(selectors.claimDevelopment.secondClaimRedelivery, 'value');
|
||||
|
||||
expect(reason).toEqual('Baja calidad');
|
||||
expect(result).toEqual('Deshidratacion');
|
||||
expect(responsible).toEqual('Calidad general');
|
||||
expect(worker).toEqual('deliveryNick');
|
||||
expect(redelivery).toEqual('Reparto');
|
||||
});
|
||||
});
|
|
@ -1,5 +1,5 @@
|
|||
import selectors from '../../helpers/selectors.js';
|
||||
import getBrowser from '../../helpers/puppeteer';
|
||||
import getBrowser from '../../helpers/puppeteer.js';
|
||||
|
||||
describe('Claim action path', () => {
|
||||
let browser;
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
import selectors from '../../helpers/selectors.js';
|
||||
import getBrowser from '../../helpers/puppeteer';
|
||||
import getBrowser from '../../helpers/puppeteer.js';
|
||||
|
||||
describe('Claim summary path', () => {
|
||||
let browser;
|
|
@ -1,5 +1,5 @@
|
|||
import selectors from '../../helpers/selectors.js';
|
||||
import getBrowser from '../../helpers/puppeteer';
|
||||
import getBrowser from '../../helpers/puppeteer.js';
|
||||
|
||||
describe('Claim descriptor path', () => {
|
||||
let browser;
|
|
@ -1,116 +1,2 @@
|
|||
<vn-crud-model
|
||||
vn-id="model"
|
||||
url="ClaimDevelopments"
|
||||
fields="['id', 'claimFk', 'claimReasonFk', 'claimResultFk', 'claimResponsibleFk', 'workerFk', 'claimRedeliveryFk']"
|
||||
link="{claimFk: $ctrl.$params.id}"
|
||||
filter="$ctrl.filter"
|
||||
data="claimDevelopments"
|
||||
auto-load="true">
|
||||
</vn-crud-model>
|
||||
<vn-crud-model
|
||||
url="ClaimReasons"
|
||||
data="claimReasons"
|
||||
order="description"
|
||||
auto-load="true">
|
||||
</vn-crud-model>
|
||||
<vn-crud-model
|
||||
url="ClaimResults"
|
||||
data="claimResults"
|
||||
order="description"
|
||||
auto-load="true">
|
||||
</vn-crud-model>
|
||||
<vn-crud-model
|
||||
url="ClaimResponsibles"
|
||||
data="claimResponsibles"
|
||||
order="description"
|
||||
auto-load="true">
|
||||
</vn-crud-model>
|
||||
<vn-crud-model
|
||||
url="ClaimRedeliveries"
|
||||
data="claimRedeliveries"
|
||||
order="description"
|
||||
auto-load="true">
|
||||
</vn-crud-model>
|
||||
<vn-watcher
|
||||
vn-id="watcher"
|
||||
data="claimDevelopments"
|
||||
form="form">
|
||||
</vn-watcher>
|
||||
<vn-vertical class="vn-w-lg">
|
||||
<vn-card class="vn-pa-lg">
|
||||
<vn-vertical>
|
||||
<form name="form">
|
||||
<vn-horizontal ng-repeat="claimDevelopment in claimDevelopments">
|
||||
<vn-autocomplete
|
||||
vn-focus
|
||||
label="Reason"
|
||||
ng-model="claimDevelopment.claimReasonFk"
|
||||
data="claimReasons"
|
||||
fields="['id', 'description']"
|
||||
show-field="description"
|
||||
rule>
|
||||
</vn-autocomplete>
|
||||
<vn-autocomplete
|
||||
label="Result"
|
||||
ng-model="claimDevelopment.claimResultFk"
|
||||
data="claimResults"
|
||||
fields="['id', 'description']"
|
||||
show-field="description"
|
||||
rule>
|
||||
</vn-autocomplete>
|
||||
<vn-autocomplete
|
||||
label="Responsible"
|
||||
ng-model="claimDevelopment.claimResponsibleFk"
|
||||
data="claimResponsibles"
|
||||
fields="['id', 'description']"
|
||||
show-field="description"
|
||||
rule>
|
||||
</vn-autocomplete>
|
||||
<vn-worker-autocomplete
|
||||
ng-model="claimDevelopment.workerFk"
|
||||
show-field="nickname"
|
||||
rule>
|
||||
</vn-worker-autocomplete>
|
||||
<vn-autocomplete
|
||||
label="Redelivery"
|
||||
ng-model="claimDevelopment.claimRedeliveryFk"
|
||||
data="claimRedeliveries"
|
||||
fields="['id', 'description']"
|
||||
show-field="description"
|
||||
rule>
|
||||
</vn-autocomplete>
|
||||
<vn-icon-button
|
||||
vn-none
|
||||
class="vn-my-md"
|
||||
vn-tooltip="Remove sale"
|
||||
icon="delete"
|
||||
ng-click="model.remove($index)"
|
||||
tabindex="-1">
|
||||
</vn-icon-button>
|
||||
</vn-horizontal>
|
||||
</form>
|
||||
<vn-one class="vn-pt-md">
|
||||
<vn-icon-button
|
||||
vn-bind="+"
|
||||
vn-tooltip="Add sale"
|
||||
icon="add_circle"
|
||||
ng-click="model.insert()">
|
||||
</vn-icon-button>
|
||||
</vn-one>
|
||||
</vn-vertical>
|
||||
</vn-card>
|
||||
<vn-button-bar>
|
||||
<vn-submit
|
||||
disabled="!watcher.dataChanged()"
|
||||
ng-click="$ctrl.onSubmit()"
|
||||
label="Save">
|
||||
</vn-submit>
|
||||
<!-- # #2680 Undo changes button bugs -->
|
||||
<!-- <vn-button
|
||||
class="cancel"
|
||||
label="Undo changes"
|
||||
disabled="!watcher.dataChanged()"
|
||||
ng-click="watcher.loadOriginalData()">
|
||||
</vn-button> -->
|
||||
</vn-button-bar>
|
||||
</vn-vertical>
|
||||
<vn-card>
|
||||
</vn-card>
|
||||
|
|
|
@ -1,17 +1,14 @@
|
|||
import ngModule from '../module';
|
||||
import Section from 'salix/components/section';
|
||||
import './style.scss';
|
||||
|
||||
class Controller extends Section {
|
||||
onSubmit() {
|
||||
this.$.watcher.check();
|
||||
this.$.model.save().then(() => {
|
||||
this.$.watcher.notifySaved();
|
||||
this.$.watcher.updateOriginalData();
|
||||
constructor($element, $) {
|
||||
super($element, $);
|
||||
}
|
||||
|
||||
if (this.aclService.hasAny(['claimManager']))
|
||||
this.$state.go('claim.card.action');
|
||||
});
|
||||
async $onInit() {
|
||||
this.$state.go('claim.card.summary', {id: this.$params.id});
|
||||
window.location.href = await this.vnApp.getUrl(`claim/${this.$params.id}/development`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
import './index.js';
|
||||
import watcher from 'core/mocks/watcher';
|
||||
import crudModel from 'core/mocks/crud-model';
|
||||
|
||||
describe('Claim', () => {
|
||||
describe('Component vnClaimDevelopment', () => {
|
||||
let controller;
|
||||
let $scope;
|
||||
|
||||
beforeEach(ngModule('claim'));
|
||||
|
||||
beforeEach(inject(($componentController, $rootScope) => {
|
||||
$scope = $rootScope.$new();
|
||||
$scope.watcher = watcher;
|
||||
$scope.model = crudModel;
|
||||
const $element = angular.element('<vn-claim-development></vn-claim-development>');
|
||||
controller = $componentController('vnClaimDevelopment', {$element, $scope});
|
||||
}));
|
||||
|
||||
describe('onSubmit()', () => {
|
||||
it(`should redirect to 'claim.card.action' state`, () => {
|
||||
jest.spyOn(controller.aclService, 'hasAny').mockReturnValue(true);
|
||||
jest.spyOn(controller.$state, 'go');
|
||||
|
||||
controller.onSubmit();
|
||||
|
||||
expect(controller.$state.go).toHaveBeenCalledWith('claim.card.action');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
|
@ -1,8 +0,0 @@
|
|||
Destination: Destino
|
||||
Development: Trazabilidad
|
||||
Reason: Motivo
|
||||
Result: Consecuencia
|
||||
Responsible: Responsable
|
||||
Worker: Trabajador
|
||||
Redelivery: Devolución
|
||||
Add line: Añadir Linea
|
|
@ -18,6 +18,13 @@
|
|||
"isLabeler": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
"sector": {
|
||||
"type": "belongsTo",
|
||||
"model": "Sector",
|
||||
"foreignKey": "sectorFk"
|
||||
}
|
||||
},
|
||||
"acls": [{
|
||||
"accessType": "READ",
|
||||
|
|
|
@ -32,6 +32,6 @@ module.exports = Self => {
|
|||
|
||||
Self.setVisibleDiscard = async(ctx, itemFk, warehouseFk, quantity, addressFk) => {
|
||||
const query = `CALL vn.item_setVisibleDiscard(?, ?, ?, ?)`;
|
||||
await Self.rawSql(query, [itemFk, warehouseFk, quantity, addressFk]);
|
||||
await Self.rawSql(query, [itemFk, warehouseFk, quantity, addressFk], {userId: ctx.req.accessToken.userId});
|
||||
};
|
||||
};
|
||||
|
|
|
@ -26,11 +26,17 @@
|
|||
"shelving": {
|
||||
"type": "string"
|
||||
},
|
||||
"subName": {
|
||||
"type": "string"
|
||||
},
|
||||
"packing": {
|
||||
"type": "number"
|
||||
},
|
||||
"stock": {
|
||||
"type": "number"
|
||||
},
|
||||
"size": {
|
||||
"type": "number"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -20,10 +20,16 @@
|
|||
},
|
||||
"created": {
|
||||
"type": "date"
|
||||
},
|
||||
"grouping": {
|
||||
"type": "number"
|
||||
},
|
||||
"isChecked": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"packing": {
|
||||
"type": "number"
|
||||
},
|
||||
"visible": {
|
||||
"type": "number"
|
||||
},
|
||||
|
|
|
@ -10,5 +10,8 @@
|
|||
},
|
||||
"Sector": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"Train": {
|
||||
"dataSource": "vn"
|
||||
}
|
||||
}
|
|
@ -9,12 +9,11 @@
|
|||
"properties": {
|
||||
"id": {
|
||||
"type": "number",
|
||||
"id": true,
|
||||
"description": "Identifier"
|
||||
"description": "Identifier",
|
||||
"id": true
|
||||
},
|
||||
"code": {
|
||||
"type": "string",
|
||||
"required": true
|
||||
"type": "string"
|
||||
},
|
||||
"parkingFk": {
|
||||
"type": "number"
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"name": "Train",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "train"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "number",
|
||||
"id": true
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"required": true
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -118,7 +118,7 @@ module.exports = Self => {
|
|||
|
||||
// Send notification to salesPerson
|
||||
const salesPersonUser = ticket.client().salesPersonUser();
|
||||
if (salesPersonUser) {
|
||||
if (salesPersonUser && sales.length) {
|
||||
const origin = ctx.req.headers.origin;
|
||||
const message = $t(`I have deleted the ticket id`, {
|
||||
id: id,
|
||||
|
|
|
@ -49,7 +49,7 @@ describe('ticket merge()', () => {
|
|||
|
||||
expect(deletedTicket.isDeleted).toEqual(true);
|
||||
expect(salesTicketFuture.length).toEqual(2);
|
||||
expect(chatNotificationBeforeMerge.length).toEqual(chatNotificationAfterMerge.length - 2);
|
||||
expect(chatNotificationBeforeMerge.length).toEqual(chatNotificationAfterMerge.length - 1);
|
||||
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
|
|
|
@ -17,6 +17,12 @@
|
|||
"Expedition": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"ExpeditionPallet": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"ExpeditionScan": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"ExpeditionState": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
|
@ -32,6 +38,9 @@
|
|||
"ExpeditionMistake": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"ExpeditionMistakeType": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"PrintServerQueue": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
|
@ -47,6 +56,9 @@
|
|||
"SaleGroup": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"SaleMistake": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"SaleGroupDetail": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
},
|
||||
"type": {
|
||||
"type": "belongsTo",
|
||||
"model": "MistakeType",
|
||||
"model": "ExpeditionMistakeType",
|
||||
"foreignKey": "typeFk"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"name": "ExpeditionMistakeType",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "expeditionMistakeType"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"code": {
|
||||
"id":true,
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"name": "ExpeditionPallet",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "expeditionPallet"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "number",
|
||||
"id": true,
|
||||
"description": "Identifier"
|
||||
}
|
||||
},
|
||||
"acls": [{
|
||||
"accessType": "WRITE",
|
||||
"principalType": "ROLE",
|
||||
"principalId": "production",
|
||||
"permission": "ALLOW"
|
||||
}]
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
"name": "ExpeditionScan",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "expeditionScan"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "number",
|
||||
"description": "Identifier"
|
||||
},
|
||||
"expeditionFk": {
|
||||
"type": "number",
|
||||
"description": "Identifier",
|
||||
"id": true
|
||||
},
|
||||
"palletFk": {
|
||||
"type": "number",
|
||||
"description": "Identifier",
|
||||
"id": true
|
||||
},
|
||||
"scanned": {
|
||||
"type": "date",
|
||||
"default": "$now"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
"expedition": {
|
||||
"type": "belongsTo",
|
||||
"model": "Expedition",
|
||||
"foreignKey": "expeditionFk"
|
||||
},
|
||||
"pallet": {
|
||||
"type": "belongsTo",
|
||||
"model": "expeditionPallet",
|
||||
"foreignKey": "palletFk"
|
||||
}
|
||||
},
|
||||
"acls": [{
|
||||
"accessType": "WRITE",
|
||||
"principalType": "ROLE",
|
||||
"principalId": "production",
|
||||
"permission": "ALLOW"
|
||||
}]
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
"name": "SaleMistake",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "saleMistake"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"id": {
|
||||
"id": true,
|
||||
"type": "number",
|
||||
"description": "Identifier"
|
||||
},
|
||||
"created": {
|
||||
"type": "date"
|
||||
},
|
||||
"saleFk": {
|
||||
"type": "number",
|
||||
"required": true
|
||||
},
|
||||
"userFk": {
|
||||
"type": "number",
|
||||
"required": true
|
||||
},
|
||||
"typeFk": {
|
||||
"type": "number",
|
||||
"required": true
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
"sale": {
|
||||
"type": "belongsTo",
|
||||
"model": "Sale",
|
||||
"foreignKey": "saleFk"
|
||||
},
|
||||
"worker": {
|
||||
"type": "belongsTo",
|
||||
"model": "Worker",
|
||||
"foreignKey": "userFk"
|
||||
},
|
||||
"mistakeType": {
|
||||
"type": "belongsTo",
|
||||
"model": "MistakeType",
|
||||
"foreignKey": "typeFk"
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -43,6 +43,9 @@
|
|||
},
|
||||
"EducationLevel": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"MistakeType": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"ProfileType":{
|
||||
"dataSource": "vn"
|
||||
|
@ -83,6 +86,12 @@
|
|||
"WorkerMana": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"WorkerMistake": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"WorkerMistakeType": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"WorkerMedia": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
|
|
|
@ -28,6 +28,9 @@
|
|||
},
|
||||
"deviceProductionFk": {
|
||||
"type": "number"
|
||||
},
|
||||
"serialNumber": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"name": "MistakeType",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "mistakeType"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"id": {
|
||||
"id":true,
|
||||
"type": "number"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"name": "WorkerMistake",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "workerMistake"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"id": {
|
||||
"id":true,
|
||||
"type": "number"
|
||||
},
|
||||
"userFk": {
|
||||
"type": "number"
|
||||
},
|
||||
"workerMistakeTypeFk": {
|
||||
"type": "string"
|
||||
},
|
||||
"created": {
|
||||
"type": "date"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"name": "WorkerMistakeType",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "workerMistakeType"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"code": {
|
||||
"id":true,
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
"type": {
|
||||
"type": "belongsTo",
|
||||
"model": "WorkerMistakeType",
|
||||
"foreignKey": "code"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "salix-back",
|
||||
"version": "23.32.02",
|
||||
"version": "23.42.01",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "salix-back",
|
||||
"version": "23.26.01",
|
||||
"version": "23.42.01",
|
||||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
"axios": "^1.2.2",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "salix-back",
|
||||
"version": "23.40.01",
|
||||
"version": "23.42.01",
|
||||
"author": "Verdnatura Levante SL",
|
||||
"description": "Salix backend",
|
||||
"license": "GPL-3.0",
|
||||
|
|
Loading…
Reference in New Issue