feat: wip line-level discount

This commit is contained in:
Ahmed Bouhuolia
2024-12-11 12:37:15 +02:00
parent 6323e2ffec
commit 5a8d9cc7e8
8 changed files with 67 additions and 14 deletions

View File

@@ -243,6 +243,10 @@ export default class SaleInvoicesController extends BaseController {
.optional({ nullable: true })
.isNumeric()
.toFloat(),
check('entries.*.discount_type')
.default(DiscountType.Percentage)
.isString()
.isIn([DiscountType.Percentage, DiscountType.Amount]),
check('entries.*.description').optional({ nullable: true }).trim(),
check('entries.*.tax_code')
.optional({ nullable: true })