7161DeleteitemTrash #2273
|
@ -147,7 +147,7 @@ proc:BEGIN
|
|||
(@t := IF(i.stems, i.stems, 1)) * e.pri / IFNULL(i.stemMultiplier, 1) buyingValue,
|
||||
IFNULL(vItem, vDefaultEntry) itemFk,
|
||||
e.qty stickers,
|
||||
@pac := IFNULL(i.stemMultiplier, 1) * e.pac / @t packing,
|
||||
@pac := GREATEST(1, i.stemMultiplier * e.pac / @t) packing,
|
||||
IFNULL(b.`grouping`, e.pac),
|
||||
@pac * e.qty,
|
||||
vForceToPacking,
|
||||
|
|
|
@ -3,6 +3,6 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` EVENT `hedera`.`order_doRecalc`
|
|||
ON SCHEDULE EVERY 10 SECOND
|
||||
STARTS '2019-08-29 14:18:04.000'
|
||||
ON COMPLETION PRESERVE
|
||||
ENABLE
|
||||
DISABLE
|
||||
DO CALL order_doRecalc$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -10,6 +10,7 @@ proc: BEGIN
|
|||
LEAVE proc;
|
||||
END IF;
|
||||
|
||||
INSERT INTO orderRecalc SET orderFk = vSelf;
|
||||
-- #4409 Disable order recalc
|
||||
-- INSERT INTO orderRecalc SET orderFk = vSelf;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -6,16 +6,24 @@ BEGIN
|
|||
*/
|
||||
DECLARE vSlowQueryLog INT DEFAULT @@slow_query_log;
|
||||
DECLARE vSqlLogBin INT DEFAULT @@SESSION.sql_log_bin;
|
||||
DECLARE vLogExists BOOL;
|
||||
|
||||
SET sql_log_bin = OFF;
|
||||
SET GLOBAL slow_query_log = OFF;
|
||||
|
||||
RENAME TABLE `mysql`.`slow_log` TO `mysql`.`slow_log_temp`;
|
||||
SELECT COUNT(*) > 0 INTO vLogExists
|
||||
FROM information_schema.TABLES
|
||||
WHERE TABLE_SCHEMA = 'mysql' AND TABLE_NAME = 'slow_log';
|
||||
|
||||
DELETE FROM `mysql`.`slow_log_temp`
|
||||
IF vLogExists THEN
|
||||
DROP TEMPORARY TABLE IF EXISTS mysql.slow_log_temp;
|
||||
RENAME TABLE mysql.slow_log TO mysql.slow_log_temp;
|
||||
END IF;
|
||||
|
||||
DELETE FROM mysql.slow_log_temp
|
||||
WHERE start_time < TIMESTAMPADD(WEEK, -1, util.VN_NOW());
|
||||
|
||||
RENAME TABLE `mysql`.`slow_log_temp` TO `mysql`.`slow_log`;
|
||||
RENAME TABLE mysql.slow_log_temp TO mysql.slow_log;
|
||||
|
||||
SET GLOBAL slow_query_log = vSlowQueryLog;
|
||||
SET sql_log_bin = vSqlLogBin;
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
UPDATE salix.ACL SET principalId = "hr" WHERE property IN ('find','findById','findOne') AND model = "Worker";
|
||||
|
||||
INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId)
|
||||
VALUES ('Worker', '__get__summary', 'READ', 'ALLOW', 'ROLE', 'employee');
|
|
@ -2,7 +2,6 @@ import selectors from '../../helpers/selectors.js';
|
|||
import getBrowser from '../../helpers/puppeteer';
|
||||
|
||||
describe('Worker summary path', () => {
|
||||
const workerId = 3;
|
||||
let browser;
|
||||
let page;
|
||||
beforeAll(async() => {
|
||||
|
@ -10,7 +9,7 @@ describe('Worker summary path', () => {
|
|||
page = browser.page;
|
||||
await page.loginAndModule('employee', 'worker');
|
||||
const httpDataResponse = page.waitForResponse(response => {
|
||||
return response.status() === 200 && response.url().includes(`Workers/${workerId}`);
|
||||
return response.status() === 200 && response.url().includes(`Workers/summary`);
|
||||
});
|
||||
await page.accessToSearchResult('agencyNick');
|
||||
await httpDataResponse;
|
||||
|
|
|
@ -19,7 +19,7 @@ module.exports = Self => {
|
|||
if (ticket.ticketFk != claim.ticketFk)
|
||||
throw new UserError(`Cannot create a new claimBeginning from a different ticket`);
|
||||
}
|
||||
// await claimIsEditable(ctx);
|
||||
await claimIsEditable(ctx);
|
||||
});
|
||||
|
||||
Self.observe('before delete', async ctx => {
|
||||
|
@ -36,7 +36,7 @@ module.exports = Self => {
|
|||
if (ctx.options && ctx.options.transaction)
|
||||
myOptions.transaction = ctx.options.transaction;
|
||||
|
||||
const claimBeginning = await Self.findById(ctx.where.id);
|
||||
const claimBeginning = ctx.instance ?? await Self.findById(ctx.where.id);
|
||||
|
||||
const filter = {
|
||||
where: {id: claimBeginning.claimFk},
|
||||
|
|
|
@ -92,5 +92,87 @@
|
|||
"model": "WorkerTeamCollegues",
|
||||
"foreignKey": "workerFk"
|
||||
}
|
||||
},
|
||||
"scopes":{
|
||||
"summary": {
|
||||
"include": [
|
||||
{
|
||||
"relation": "user",
|
||||
"scope": {
|
||||
"fields": ["email", "name", "nickname", "roleFk"],
|
||||
"include": [
|
||||
{
|
||||
"relation": "role",
|
||||
"scope": {
|
||||
"fields": ["name"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"relation": "emailUser",
|
||||
"scope": {
|
||||
"fields": ["email"]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}, {
|
||||
"relation": "department",
|
||||
"scope": {
|
||||
"include": {
|
||||
"relation": "department"
|
||||
}
|
||||
}
|
||||
}, {
|
||||
"relation": "boss"
|
||||
}, {
|
||||
"relation": "client",
|
||||
"scope": {
|
||||
"fields": [
|
||||
"id",
|
||||
"name",
|
||||
"fi",
|
||||
"socialName",
|
||||
"contact",
|
||||
"street",
|
||||
"city",
|
||||
"postcode",
|
||||
"email",
|
||||
"mobile",
|
||||
"isActive",
|
||||
"credit",
|
||||
"creditInsurance",
|
||||
"iban",
|
||||
"dueDay",
|
||||
"isEqualizated",
|
||||
"isFreezed",
|
||||
"hasToInvoiceByAddress",
|
||||
"hasToInvoice",
|
||||
"isToBeMailed",
|
||||
"hasSepaVnl",
|
||||
"hasLcr",
|
||||
"hasCoreVnl",
|
||||
"hasCoreVnh",
|
||||
"hasIncoterms",
|
||||
"isTaxDataChecked",
|
||||
"eypbc",
|
||||
"quality",
|
||||
"isVies",
|
||||
"isRelevant",
|
||||
"accountingAccount",
|
||||
"created",
|
||||
"sageTaxTypeFk",
|
||||
"sageTransactionTypeFk",
|
||||
"businessTypeFk",
|
||||
"salesPersonFk",
|
||||
"hasElectronicInvoice",
|
||||
"rating",
|
||||
"recommendedCredit"
|
||||
]
|
||||
}
|
||||
}, {
|
||||
"relation": "sip"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,37 +4,13 @@ import ModuleCard from 'salix/components/module-card';
|
|||
class Controller extends ModuleCard {
|
||||
reload() {
|
||||
const filter = {
|
||||
include: [
|
||||
{
|
||||
relation: 'user',
|
||||
scope: {
|
||||
fields: ['name', 'emailVerified'],
|
||||
include: {
|
||||
relation: 'emailUser',
|
||||
scope: {
|
||||
fields: ['email']
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
relation: 'sip',
|
||||
scope: {
|
||||
fields: ['extension', 'secret']
|
||||
}
|
||||
}, {
|
||||
relation: 'department',
|
||||
scope: {
|
||||
include: {
|
||||
relation: 'department'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
where: {
|
||||
id: this.$params.id}
|
||||
};
|
||||
|
||||
return Promise.all([
|
||||
this.$http.get(`Workers/${this.$params.id}`, {filter})
|
||||
.then(res => this.worker = res.data),
|
||||
this.$http.get(`Workers/summary`, {filter})
|
||||
.then(res => this.worker = res.data[0]),
|
||||
this.$http.get(`Workers/${this.$params.id}/activeContract`)
|
||||
.then(res => this.hasWorkCenter = res.data?.workCenterFk)
|
||||
]);
|
||||
|
|
|
@ -37,41 +37,11 @@ class Controller extends Descriptor {
|
|||
|
||||
loadData() {
|
||||
const filter = {
|
||||
include: [
|
||||
{
|
||||
relation: 'user',
|
||||
scope: {
|
||||
fields: ['name', 'emailVerified'],
|
||||
include: {
|
||||
relation: 'emailUser',
|
||||
scope: {
|
||||
fields: ['email']
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
relation: 'client',
|
||||
scope: {
|
||||
fields: ['fi']
|
||||
}
|
||||
}, {
|
||||
relation: 'sip',
|
||||
scope: {
|
||||
fields: ['extension']
|
||||
}
|
||||
}, {
|
||||
relation: 'department',
|
||||
scope: {
|
||||
include: {
|
||||
relation: 'department'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
where: {id: this.id},
|
||||
};
|
||||
|
||||
return this.getData(`Workers/${this.id}`, {filter})
|
||||
.then(res => this.entity = res.data);
|
||||
return this.getData(`Workers/summary`, {filter})
|
||||
.then(res => this.entity = res.data[0]);
|
||||
}
|
||||
|
||||
getPassRequirements() {
|
||||
|
|
|
@ -14,14 +14,14 @@ describe('vnWorkerDescriptor', () => {
|
|||
describe('loadData()', () => {
|
||||
it(`should perform a get query to store the worker data into the controller`, () => {
|
||||
const id = 1;
|
||||
const response = 'foo';
|
||||
const response = ['foo'];
|
||||
|
||||
$httpBackend.whenGET('UserConfigs/getUserConfig').respond({});
|
||||
$httpBackend.expectRoute('GET', `Workers/${id}`).respond(response);
|
||||
$httpBackend.expectRoute('GET', `Workers/summary`).respond(response);
|
||||
controller.id = id;
|
||||
$httpBackend.flush();
|
||||
|
||||
expect(controller.worker).toEqual(response);
|
||||
expect([controller.worker]).toEqual(response);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -10,53 +10,14 @@ class Controller extends Summary {
|
|||
this.$.worker = null;
|
||||
if (!value) return;
|
||||
|
||||
const query = `Workers/${value.id}`;
|
||||
const filter = {
|
||||
include: [
|
||||
{
|
||||
relation: 'user',
|
||||
scope: {
|
||||
fields: ['name', 'roleFk'],
|
||||
include: [{
|
||||
relation: 'role',
|
||||
scope: {
|
||||
fields: ['name']
|
||||
where: {
|
||||
id: value.id
|
||||
}
|
||||
},
|
||||
{
|
||||
relation: 'emailUser',
|
||||
scope: {
|
||||
fields: ['email']
|
||||
}
|
||||
}]
|
||||
}
|
||||
},
|
||||
{
|
||||
relation: 'client',
|
||||
scope: {fields: ['fi', 'phone']}
|
||||
},
|
||||
{
|
||||
relation: 'boss',
|
||||
scope: {fields: ['id', 'name']}
|
||||
},
|
||||
{
|
||||
relation: 'sip',
|
||||
scope: {fields: ['extension']}
|
||||
},
|
||||
{
|
||||
relation: 'department',
|
||||
scope: {
|
||||
include: {
|
||||
relation: 'department',
|
||||
scope: {fields: ['id', 'code', 'name']}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
this.$http.get(query, {params: {filter}}).then(res => {
|
||||
this.$.worker = res.data;
|
||||
this.$http.get(`Workers/summary`, {filter}).then(res => {
|
||||
this.$.worker = res.data[0];
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue