8713-testToMaster #3523
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue