#6276 createNewWarehouse methods migrated from silex to salix #1850

Merged
jorgep merged 158 commits from 6276-createNewWarehouse into dev 2024-03-06 11:32:11 +00:00
3 changed files with 20 additions and 15 deletions
Showing only changes of commit d5f09c2f75 - Show all commits

View File

@ -4,4 +4,5 @@ INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalTyp
('ExpeditionPallet', 'getPallet', 'READ', 'ALLOW', 'ROLE', 'employee'),
('MachineWorker','updateInTime','WRITE','ALLOW','ROLE','employee'),
('MachineWorker','add','READ','ALLOW','ROLE','employee'),
('MobileAppVersionControl','getVersion','READ','ALLOW','ROLE','employee');
('MobileAppVersionControl','getVersion','READ','ALLOW','ROLE','employee'),
('SaleTracking','deleteTracking','WRITE','ALLOW','ROLE','employee');

View File

@ -10,12 +10,12 @@ module.exports = Self => {
description: 'The sale id'
},
{
arg: 'stateCode',
type: 'string'
}
arg: 'stateCodes',
type: ['string']
},
],
returns: {
jorgep marked this conversation as resolved
Review

Si no lo requiere sergio especificamente, normalmente con terminar el procedimiento sobra, no hace falta devolver true

Si no lo requiere sergio especificamente, normalmente con terminar el procedimiento sobra, no hace falta devolver true
Review

Lo quito

Lo quito
type: ['object'],
type: 'boolean',
root: true
},
http: {
@ -24,7 +24,7 @@ module.exports = Self => {
}
});
Self.delete = async(saleFk, stateCode, options) => {
Self.delete = async(saleFk, stateCodes, options) => {
const models = Self.app.models;
const myOptions = {};
let tx;
@ -38,20 +38,24 @@ module.exports = Self => {
}
try {
if (stateCode === 'PREPARED') {
const itemShelvingSales = await models.ItemShelvingSale.find({where: {saleFk: saleFk}}, myOptions);
for (let itemShelvingSale of itemShelvingSales)
await itemShelvingSale.destroy(myOptions);
}
const itemShelvingSales = await models.ItemShelvingSale.find({where: {saleFk: saleFk}}, myOptions);
const state = await models.State.findOne({
where: {code: stateCode}
for (let itemShelvingSale of itemShelvingSales)
await itemShelvingSale.destroy(myOptions);
const states = await models.State.find({
fields: ['id'],
where: {
code: {inq: stateCodes}
}
}, myOptions);
const stateIds = states.map(state => state.id);
const filter = {
where: {
saleFk: saleFk,
stateFk: state.id
stateFk: {inq: stateIds}
}
};
const saleTrackings = await models.SaleTracking.find(filter, myOptions);

View File

@ -100,7 +100,7 @@ class Controller extends Section {
saleTrackingDel(sale, stateCode) {
const params = {
saleFk: sale.saleFk,
stateCode: stateCode
stateCodes: [stateCode]
};
this.$http.post(`SaleTrackings/delete`, params).then(() => {
this.vnApp.showSuccess(this.$t('Data saved!'));