refs #6276 feat:newWarehouse

This commit is contained in:
Sergio De la torre 2024-03-20 13:50:29 +01:00
parent 99689917f5
commit b84351e060
1 changed files with 1 additions and 8 deletions

View File

@ -89,16 +89,9 @@ module.exports = Self => {
const {itemOriginalFk} = await models.Buy.findById(buyFk, {fields: ['itemOriginalFk']}, myOptions);
if (itemOriginalFk) await models.SaleBuy.create({saleFk, buyFk}, myOptions);
} catch (e) {
throw new UserError('The sale cannot be tracked');
}
if (tx) await tx.commit();
} catch (e) {
if (e.message == 'The sale cannot be tracked') {
if (tx) tx.commit();
throw e;
}
} catch (e) {
if (tx) await tx.rollback();
throw new UserError('The line could not be marked');
}