Merge branch 'test' into warnFix_travel_summary_entry
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
commit
7e542f93a1
|
@ -9,11 +9,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
- (Entradas -> Correo) Al cambiar el tipo de cambio enviará un correo a las personas designadas
|
- (Entradas -> Correo) Al cambiar el tipo de cambio enviará un correo a las personas designadas
|
||||||
|
- (General -> Históricos) Botón para ver el estado del registro en cada punto
|
||||||
|
- (General -> Históricos) Al filtar por registro se muestra todo el histórial desde que fue creado
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
- (General -> Históricos) Los registros se muestran agrupados por usuario y entidad
|
||||||
|
- (Facturas -> Facturación global) Optimizada, generación de PDFs y notificaciones en paralelo
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
-
|
- (General -> Históricos) Duplicidades eliminadas
|
||||||
|
- (Facturas -> Facturación global) Solucionados fallos que paran el proceso
|
||||||
|
|
||||||
## [2324.01] - 2023-06-15
|
## [2324.01] - 2023-06-15
|
||||||
|
|
||||||
|
|
|
@ -22,11 +22,13 @@ module.exports = Self => {
|
||||||
const tokenId = ctx.req.accessToken.id;
|
const tokenId = ctx.req.accessToken.id;
|
||||||
|
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const differenceMilliseconds = now - created;
|
const differenceMilliseconds = now - new Date(created);
|
||||||
const differenceSeconds = Math.floor(differenceMilliseconds / 1000);
|
const differenceSeconds = Math.floor(differenceMilliseconds / 1000);
|
||||||
|
|
||||||
const accessTokenConfig = await models.AccessTokenConfig.findOne({fields: ['renewPeriod']});
|
const accessTokenConfig = await models.AccessTokenConfig.findOne({fields: ['renewPeriod']});
|
||||||
|
|
||||||
|
console.log(userId, created, now, differenceMilliseconds, differenceSeconds, accessTokenConfig.renewPeriod, differenceSeconds <= accessTokenConfig.renewPeriod);
|
||||||
|
|
||||||
if (differenceSeconds <= accessTokenConfig.renewPeriod)
|
if (differenceSeconds <= accessTokenConfig.renewPeriod)
|
||||||
throw new UserError(`The renew period has not been exceeded`);
|
throw new UserError(`The renew period has not been exceeded`);
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
CREATE TABLE `vn`.`travelConfig` (
|
||||||
|
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`warehouseInFk` smallint(6) unsigned NOT NULL DEFAULT 8 COMMENT 'Warehouse de origen',
|
||||||
|
`warehouseOutFk` smallint(6) unsigned NOT NULL DEFAULT 60 COMMENT 'Warehouse destino',
|
||||||
|
`agencyFk` int(11) NOT NULL DEFAULT 1378 COMMENT 'Agencia por defecto',
|
||||||
|
`companyFk` int(10) unsigned NOT NULL DEFAULT 442 COMMENT 'Compañía por defecto',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `travelConfig_FK` (`warehouseInFk`),
|
||||||
|
KEY `travelConfig_FK_1` (`warehouseOutFk`),
|
||||||
|
KEY `travelConfig_FK_2` (`agencyFk`),
|
||||||
|
KEY `travelConfig_FK_3` (`companyFk`),
|
||||||
|
CONSTRAINT `travelConfig_FK` FOREIGN KEY (`warehouseInFk`) REFERENCES `warehouse` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||||
|
CONSTRAINT `travelConfig_FK_1` FOREIGN KEY (`warehouseOutFk`) REFERENCES `warehouse` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||||
|
CONSTRAINT `travelConfig_FK_2` FOREIGN KEY (`agencyFk`) REFERENCES `agencyMode` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||||
|
CONSTRAINT `travelConfig_FK_3` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
||||||
|
|
||||||
|
INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
|
||||||
|
VALUES
|
||||||
|
('Entry', 'addFromPackaging', 'WRITE', 'ALLOW', 'ROLE', 'production'),
|
||||||
|
('Entry', 'addFromBuy', 'WRITE', 'ALLOW', 'ROLE', 'production'),
|
||||||
|
('Supplier', 'getItemsPackaging', 'READ', 'ALLOW', 'ROLE', 'production');
|
|
@ -9,7 +9,7 @@ describe('Travel descriptor path', () => {
|
||||||
browser = await getBrowser();
|
browser = await getBrowser();
|
||||||
page = browser.page;
|
page = browser.page;
|
||||||
await page.loginAndModule('buyer', 'travel');
|
await page.loginAndModule('buyer', 'travel');
|
||||||
await page.write(selectors.travelIndex.generalSearchFilter, '1');
|
await page.write(selectors.travelIndex.generalSearchFilter, '3');
|
||||||
await page.keyboard.press('Enter');
|
await page.keyboard.press('Enter');
|
||||||
await page.waitForState('travel.card.summary');
|
await page.waitForState('travel.card.summary');
|
||||||
});
|
});
|
||||||
|
@ -23,7 +23,7 @@ describe('Travel descriptor path', () => {
|
||||||
await page.waitForState('travel.index');
|
await page.waitForState('travel.index');
|
||||||
const result = await page.countElement(selectors.travelIndex.anySearchResult);
|
const result = await page.countElement(selectors.travelIndex.anySearchResult);
|
||||||
|
|
||||||
expect(result).toBeGreaterThanOrEqual(7);
|
expect(result).toBeGreaterThanOrEqual(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should navigate to the first search result', async() => {
|
it('should navigate to the first search result', async() => {
|
||||||
|
|
|
@ -49,6 +49,7 @@ export class Layout extends Component {
|
||||||
const differenceMilliseconds = now - new Date(this.vnToken.created);
|
const differenceMilliseconds = now - new Date(this.vnToken.created);
|
||||||
const differenceSeconds = Math.floor(differenceMilliseconds / 1000);
|
const differenceSeconds = Math.floor(differenceMilliseconds / 1000);
|
||||||
|
|
||||||
|
console.log(this.vnToken.created, now, differenceMilliseconds, differenceSeconds, this.renewPeriod, differenceSeconds > this.renewPeriod);
|
||||||
if (differenceSeconds > this.renewPeriod) {
|
if (differenceSeconds > this.renewPeriod) {
|
||||||
this.$http.post('VnUsers/renewToken')
|
this.$http.post('VnUsers/renewToken')
|
||||||
.then(json => {
|
.then(json => {
|
||||||
|
|
|
@ -81,17 +81,15 @@ module.exports = Self => {
|
||||||
throw new UserError('You must delete all the buy requests first');
|
throw new UserError('You must delete all the buy requests first');
|
||||||
|
|
||||||
// removes item shelvings
|
// removes item shelvings
|
||||||
if (hasItemShelvingSales && isSalesAssistant) {
|
const promises = [];
|
||||||
const promises = [];
|
for (let sale of sales) {
|
||||||
for (let sale of sales) {
|
if (sale.itemShelvingSale()) {
|
||||||
if (sale.itemShelvingSale()) {
|
const itemShelvingSale = sale.itemShelvingSale();
|
||||||
const itemShelvingSale = sale.itemShelvingSale();
|
const destroyedShelving = models.ItemShelvingSale.destroyById(itemShelvingSale.id, myOptions);
|
||||||
const destroyedShelving = models.ItemShelvingSale.destroyById(itemShelvingSale.id, myOptions);
|
promises.push(destroyedShelving);
|
||||||
promises.push(destroyedShelving);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
await Promise.all(promises);
|
|
||||||
}
|
}
|
||||||
|
await Promise.all(promises);
|
||||||
|
|
||||||
// Remove ticket greuges
|
// Remove ticket greuges
|
||||||
const ticketGreuges = await models.Greuge.find({where: {ticketFk: id}}, myOptions);
|
const ticketGreuges = await models.Greuge.find({where: {ticketFk: id}}, myOptions);
|
||||||
|
|
|
@ -37,6 +37,16 @@ class Controller extends SearchPanel {
|
||||||
}
|
}
|
||||||
|
|
||||||
applyFilters(param) {
|
applyFilters(param) {
|
||||||
|
if (typeof this.filter.scopeDays === 'number') {
|
||||||
|
const shippedFrom = Date.vnNew();
|
||||||
|
shippedFrom.setHours(0, 0, 0, 0);
|
||||||
|
|
||||||
|
const shippedTo = new Date(shippedFrom.getTime());
|
||||||
|
shippedTo.setDate(shippedTo.getDate() + this.filter.scopeDays);
|
||||||
|
shippedTo.setHours(23, 59, 59, 999);
|
||||||
|
Object.assign(this.filter, {shippedFrom, shippedTo});
|
||||||
|
}
|
||||||
|
|
||||||
this.model.applyFilter({}, this.filter)
|
this.model.applyFilter({}, this.filter)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
if (param && this.model._orgData.length === 1)
|
if (param && this.model._orgData.length === 1)
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
module.exports = function(Self) {
|
module.exports = function(Self) {
|
||||||
Self.observe('after save', async function(ctx) {
|
Self.observe('after save', async function(ctx) {
|
||||||
const instance = ctx.instance;
|
const instance = ctx.data || ctx.instance;
|
||||||
const models = Self.app.models;
|
const models = Self.app.models;
|
||||||
const options = ctx.options;
|
const options = ctx.options;
|
||||||
|
|
||||||
if (!instance.sectorFk || !instance.labelerFk) return;
|
if (!instance?.sectorFk || !instance?.labelerFk) return;
|
||||||
|
|
||||||
const sector = await models.Sector.findById(instance.sectorFk, {
|
const sector = await models.Sector.findById(instance.sectorFk, {
|
||||||
fields: ['mainPrinterFk']
|
fields: ['mainPrinterFk']
|
||||||
|
|
|
@ -16,18 +16,12 @@
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"trainFk": {
|
"trainFk": {
|
||||||
"type": "number",
|
"type": "number"
|
||||||
"required": true
|
|
||||||
},
|
},
|
||||||
"itemPackingTypeFk": {
|
"itemPackingTypeFk": {
|
||||||
"type": "string",
|
"type": "string"
|
||||||
"required": true
|
|
||||||
},
|
},
|
||||||
"warehouseFk": {
|
"warehouseFk": {
|
||||||
"type": "number",
|
|
||||||
"required": true
|
|
||||||
},
|
|
||||||
"sectorFk": {
|
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"labelerFk": {
|
"labelerFk": {
|
||||||
|
|
Loading…
Reference in New Issue