feat: changing items quantity on hand with sales invoices and bills.

This commit is contained in:
a.bouhuolia
2020-12-23 13:11:02 +02:00
parent 395ee71c53
commit 26452d9c05
6 changed files with 202 additions and 47 deletions

View File

@@ -251,6 +251,7 @@ export default class ItemsService implements IItemsService {
const storedItem = await Item.query().insertAndFetch({
...itemDTO,
active: defaultTo(itemDTO.active, 1),
quantityOnHand: itemDTO.type === 'inventory' ? 0 : null,
});
this.logger.info('[items] item inserted successfully.', {
tenantId,