mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
fix(Items): Not display inactive items in sales and purchases.
fix(item): Prevent edit inventory account of item once item has transactions.
This commit is contained in:
@@ -512,9 +512,19 @@ export default class ItemsController extends BaseController {
|
||||
errors: [{
|
||||
type: 'TYPE_CANNOT_CHANGE_WITH_ITEM_HAS_TRANSACTIONS',
|
||||
message: 'Cannot change item type to inventory with item has associated transactions.',
|
||||
code: 350,
|
||||
}],
|
||||
});
|
||||
}
|
||||
if (error.errorType === 'INVENTORY_ACCOUNT_CANNOT_MODIFIED') {
|
||||
return res.status(400).send({
|
||||
errors: [{
|
||||
type: 'INVENTORY_ACCOUNT_CANNOT_MODIFIED',
|
||||
message: 'Cannot change item inventory account while the item has transactions.',
|
||||
code: 360,
|
||||
}]
|
||||
})
|
||||
}
|
||||
}
|
||||
next(error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user