refs #6276 feat:newWarehouse
This commit is contained in:
parent
99689917f5
commit
b84351e060
|
@ -89,16 +89,9 @@ module.exports = Self => {
|
||||||
const {itemOriginalFk} = await models.Buy.findById(buyFk, {fields: ['itemOriginalFk']}, myOptions);
|
const {itemOriginalFk} = await models.Buy.findById(buyFk, {fields: ['itemOriginalFk']}, myOptions);
|
||||||
if (itemOriginalFk) await models.SaleBuy.create({saleFk, buyFk}, myOptions);
|
if (itemOriginalFk) await models.SaleBuy.create({saleFk, buyFk}, myOptions);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw new UserError('The sale cannot be tracked');
|
if (tx) await tx.commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tx) await tx.commit();
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.message == 'The sale cannot be tracked') {
|
|
||||||
if (tx) tx.commit();
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tx) await tx.rollback();
|
if (tx) await tx.rollback();
|
||||||
throw new UserError('The line could not be marked');
|
throw new UserError('The line could not be marked');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue