mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
fix: handle delete vendor/vendors that has/have associated bills.
This commit is contained in:
@@ -483,10 +483,14 @@ export default class ItemsService implements IItemsService {
|
||||
tenantId,
|
||||
itemsIds,
|
||||
});
|
||||
/// Validates the given items exist on the storage.
|
||||
await this.validateItemsIdsExists(tenantId, itemsIds);
|
||||
|
||||
// Validate the items have no associated invoices or bills.
|
||||
await this.validateHasNoInvoicesOrBills(tenantId, itemsIds);
|
||||
|
||||
await Item.query().whereIn('id', itemsIds).delete();
|
||||
|
||||
this.logger.info('[items] deleted successfully in bulk.', {
|
||||
tenantId,
|
||||
itemsIds,
|
||||
|
||||
Reference in New Issue
Block a user