8713-testToMaster #3523

Merged
alexm merged 383 commits from 8713-testToMaster into master 2025-03-04 06:52:15 +00:00
1 changed files with 3 additions and 3 deletions
Showing only changes of commit dc989cb075 - Show all commits

View File

@ -48,12 +48,10 @@ module.exports = Self => {
}, myOptions); }, myOptions);
let asien = bookEntry?.ASIEN; let asien = bookEntry?.ASIEN;
const invoiceIn = await Self.findById(invoiceInId, myOptions);
if (asien) { if (asien) {
accountingEntries = await models.Xdiario.count({ASIEN: asien}, myOptions); accountingEntries = await models.Xdiario.count({ASIEN: asien}, myOptions);
await models.Xdiario.destroyAll({ASIEN: asien}, myOptions); await models.Xdiario.destroyAll({ASIEN: asien}, myOptions);
const invoiceIn = await Self.findById(invoiceInId, myOptions);
await invoiceIn.updateAttribute('isBooked', false, myOptions);
} else { } else {
const linkedBookEntry = await models.Xdiario.findOne({ const linkedBookEntry = await models.Xdiario.findOne({
fields: ['ASIEN'], fields: ['ASIEN'],
@ -66,6 +64,8 @@ module.exports = Self => {
asien = linkedBookEntry?.ASIEN; asien = linkedBookEntry?.ASIEN;
isLinked = true; isLinked = true;
} }
await invoiceIn.updateAttribute('isBooked', false, myOptions);
if (tx) await tx.commit(); if (tx) await tx.commit();
return { return {