minor bug
gitea/salix/pipeline/head This commit is unstable Details

This commit is contained in:
Javi Gallego 2022-08-09 15:04:58 +02:00
parent da7d9b48ea
commit 399612c9db
4 changed files with 8 additions and 5 deletions

View File

@ -232,5 +232,6 @@
"Fichadas impares": "Fichadas impares", "Fichadas impares": "Fichadas impares",
"Descanso diario 12h.": "Descanso diario 12h.", "Descanso diario 12h.": "Descanso diario 12h.",
"Descanso semanal 36h. / 72h.": "Descanso semanal 36h. / 72h.", "Descanso semanal 36h. / 72h.": "Descanso semanal 36h. / 72h.",
"Dirección incorrecta": "Dirección incorrecta" "Dirección incorrecta": "Dirección incorrecta",
"Prices recalculated": "Precios recalculados"
} }

View File

@ -27,6 +27,7 @@ module.exports = Self => {
const myOptions = {}; const myOptions = {};
const userId = ctx.req.accessToken.userId; const userId = ctx.req.accessToken.userId;
const models = Self.app.models; const models = Self.app.models;
const $t = ctx.req.__;
if (typeof options == 'object') if (typeof options == 'object')
Object.assign(myOptions, options); Object.assign(myOptions, options);
@ -41,14 +42,13 @@ module.exports = Self => {
id id
], myOptions); ], myOptions);
*/ */
const oldProperties = await loggable.translateValues(Self, {price: 'Prices recalculated'});
const entryLog = await models.EntryLog.create({ const entryLog = await models.EntryLog.create({
originFk: id, originFk: id,
userFk: userId, userFk: userId,
action: 'update', action: 'update',
changedModel: 'Entry', changedModel: 'Entry',
changedModelId: id, changedModelId: id,
oldInstance: oldProperties description: $t('Prices recalculated')
}, myOptions); }, myOptions);
if (tx) await tx.commit(); if (tx) await tx.commit();

View File

@ -10,7 +10,9 @@
</vn-item> </vn-item>
<vn-item <vn-item
ng-click="$ctrl.recalcPrices()" ng-click="$ctrl.recalcPrices()"
translate> translate
vn-acl="buyer"
vn-acl-action="remove">
Recalc prices Recalc prices
</vn-item> </vn-item>
</slot-menu> </slot-menu>

View File

@ -93,7 +93,7 @@ class Controller extends Descriptor {
recalcPrices() { recalcPrices() {
this.$http.post(`Entries/${this.id}/recalcPrices`).then(() => { this.$http.post(`Entries/${this.id}/recalcPrices`).then(() => {
this.vnApp.showSuccess(this.$t('Prices recalculated!')); this.vnApp.showSuccess(this.$t('Prices recalculated'));
}); });
} }
} }