Claim fixes
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
44e7abd6d3
commit
445a0b0e1f
|
@ -29,21 +29,21 @@ module.exports = Self => {
|
|||
myOptions.transaction = ctx.options.transaction;
|
||||
|
||||
const claimBeginning = await Self.findById(ctx.where.id);
|
||||
|
||||
|
||||
const filter = {
|
||||
where: {id: claimBeginning.claimFk},
|
||||
include: [
|
||||
{
|
||||
relation: 'claimState',
|
||||
scope: {
|
||||
fields: ['id', 'code', 'description']
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
where: {id: claimBeginning.claimFk},
|
||||
include: [
|
||||
{
|
||||
relation: 'claimState',
|
||||
scope: {
|
||||
fields: ['id', 'code', 'description']
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
const [claim] = await models.Claim.find(filter, myOptions);
|
||||
const isEditable = await models.ClaimState.isEditable(httpCtx, claim.ClaimState());
|
||||
const isEditable = await models.ClaimState.isEditable(httpCtx, claim.claimState().id);
|
||||
|
||||
if (!isEditable)
|
||||
throw new UserError(`The current claim can't be modified`);
|
||||
|
|
|
@ -100,8 +100,8 @@ class Controller extends Section {
|
|||
}
|
||||
|
||||
setClaimedQuantity(id, claimedQuantity) {
|
||||
let params = {id: id, quantity: claimedQuantity};
|
||||
let query = `ClaimBeginnings/`;
|
||||
let params = {quantity: claimedQuantity};
|
||||
let query = `ClaimBeginnings/${id}`;
|
||||
this.$http.patch(query, params).then(() => {
|
||||
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||
this.calculateTotals();
|
||||
|
|
Loading…
Reference in New Issue