fix: refs #8388 update booking status in toUnbook method
gitea/salix/pipeline/pr-dev This commit looks good
Details
gitea/salix/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
c79867188a
commit
f9d1a8c0c2
|
@ -48,12 +48,10 @@ module.exports = Self => {
|
|||
}, myOptions);
|
||||
|
||||
let asien = bookEntry?.ASIEN;
|
||||
const invoiceIn = await Self.findById(invoiceInId, myOptions);
|
||||
if (asien) {
|
||||
accountingEntries = await models.Xdiario.count({ASIEN: asien}, myOptions);
|
||||
|
||||
await models.Xdiario.destroyAll({ASIEN: asien}, myOptions);
|
||||
const invoiceIn = await Self.findById(invoiceInId, myOptions);
|
||||
await invoiceIn.updateAttribute('isBooked', false, myOptions);
|
||||
} else {
|
||||
const linkedBookEntry = await models.Xdiario.findOne({
|
||||
fields: ['ASIEN'],
|
||||
|
@ -66,6 +64,8 @@ module.exports = Self => {
|
|||
asien = linkedBookEntry?.ASIEN;
|
||||
isLinked = true;
|
||||
}
|
||||
await invoiceIn.updateAttribute('isBooked', false, myOptions);
|
||||
|
||||
if (tx) await tx.commit();
|
||||
|
||||
return {
|
||||
|
|
Loading…
Reference in New Issue