mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
feat: item-level discount
This commit is contained in:
@@ -127,6 +127,11 @@ export default class BillsController 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.*.landed_cost')
|
||||
.optional({ nullable: true })
|
||||
|
||||
@@ -176,6 +176,10 @@ export default class VendorCreditController 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.*.warehouse_id')
|
||||
.optional({ nullable: true })
|
||||
@@ -225,6 +229,10 @@ export default class VendorCreditController 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.*.warehouse_id')
|
||||
.optional({ nullable: true })
|
||||
|
||||
@@ -239,6 +239,10 @@ export default class PaymentReceivesController 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.*.warehouse_id')
|
||||
.optional({ nullable: true })
|
||||
|
||||
@@ -187,6 +187,11 @@ export default class SalesEstimatesController extends BaseController {
|
||||
.optional({ nullable: true })
|
||||
.isNumeric()
|
||||
.toFloat(),
|
||||
check('entries.*.discount_type')
|
||||
.default(DiscountType.Percentage)
|
||||
.isString()
|
||||
.isIn([DiscountType.Percentage, DiscountType.Amount]),
|
||||
|
||||
check('entries.*.warehouse_id')
|
||||
.optional({ nullable: true })
|
||||
.isNumeric()
|
||||
|
||||
@@ -164,6 +164,11 @@ export default class SalesReceiptsController extends BaseController {
|
||||
.optional({ nullable: true })
|
||||
.isNumeric()
|
||||
.toInt(),
|
||||
check('entries.*.discount_type')
|
||||
.default(DiscountType.Percentage)
|
||||
.isString()
|
||||
.isIn([DiscountType.Percentage, DiscountType.Amount]),
|
||||
|
||||
check('entries.*.description').optional({ nullable: true }).trim(),
|
||||
check('entries.*.warehouse_id')
|
||||
.optional({ nullable: true })
|
||||
|
||||
Reference in New Issue
Block a user