fix: Invalid bill payment amount on editing bill payment

This commit is contained in:
Ahmed Bouhuolia
2024-02-05 22:38:56 +02:00
parent 7b5287ee80
commit 12740223a8
10 changed files with 60 additions and 4 deletions

View File

@@ -560,6 +560,16 @@ export default class BillsController extends BaseController {
errors: [{ type: 'ITEM_ENTRY_TAX_RATE_ID_NOT_FOUND', code: 1900 }],
});
}
if (error.errorType === 'BILL_AMOUNT_SMALLER_THAN_PAID_AMOUNT') {
return res.boom.badRequest(null, {
errors: [
{
type: 'BILL_AMOUNT_SMALLER_THAN_PAID_AMOUNT',
code: 2000,
},
],
});
}
}
next(error);
}