mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 12:20:31 +00:00
feat: allow quantity of entries accept decimal value (#753)
This commit is contained in:
@@ -233,7 +233,7 @@ export default class PaymentReceivesController extends BaseController {
|
||||
check('entries.*.index').exists().isNumeric().toInt(),
|
||||
check('entries.*.item_id').exists().isNumeric().toInt(),
|
||||
check('entries.*.rate').exists().isNumeric().toFloat(),
|
||||
check('entries.*.quantity').exists().isNumeric().toInt(),
|
||||
check('entries.*.quantity').exists().isNumeric().toFloat(),
|
||||
check('entries.*.discount')
|
||||
.optional({ nullable: true })
|
||||
.isNumeric()
|
||||
@@ -755,9 +755,8 @@ export default class PaymentReceivesController extends BaseController {
|
||||
const { tenantId } = req;
|
||||
|
||||
try {
|
||||
const data = await this.getCreditNoteStateService.getCreditNoteState(
|
||||
tenantId
|
||||
);
|
||||
const data =
|
||||
await this.getCreditNoteStateService.getCreditNoteState(tenantId);
|
||||
return res.status(200).send({ data });
|
||||
} catch (error) {
|
||||
next(error);
|
||||
|
||||
@@ -172,7 +172,7 @@ export default class SalesEstimatesController extends BaseController {
|
||||
check('entries').exists().isArray({ min: 1 }),
|
||||
check('entries.*.index').exists().isNumeric().toInt(),
|
||||
check('entries.*.item_id').exists().isNumeric().toInt(),
|
||||
check('entries.*.quantity').exists().isNumeric().toInt(),
|
||||
check('entries.*.quantity').exists().isNumeric().toFloat(),
|
||||
check('entries.*.rate').exists().isNumeric().toFloat(),
|
||||
check('entries.*.description').optional({ nullable: true }).trim(),
|
||||
check('entries.*.discount')
|
||||
@@ -562,9 +562,8 @@ export default class SalesEstimatesController extends BaseController {
|
||||
const { tenantId } = req;
|
||||
|
||||
try {
|
||||
const data = await this.saleEstimatesApplication.getSaleEstimateState(
|
||||
tenantId
|
||||
);
|
||||
const data =
|
||||
await this.saleEstimatesApplication.getSaleEstimateState(tenantId);
|
||||
return res.status(200).send({ data });
|
||||
} catch (error) {
|
||||
next(error);
|
||||
|
||||
@@ -148,7 +148,7 @@ export default class SalesReceiptsController extends BaseController {
|
||||
check('entries.*.id').optional({ nullable: true }).isNumeric().toInt(),
|
||||
check('entries.*.index').exists().isNumeric().toInt(),
|
||||
check('entries.*.item_id').exists().isNumeric().toInt(),
|
||||
check('entries.*.quantity').exists().isNumeric().toInt(),
|
||||
check('entries.*.quantity').exists().isNumeric().toFloat(),
|
||||
check('entries.*.rate').exists().isNumeric().toFloat(),
|
||||
check('entries.*.discount')
|
||||
.optional({ nullable: true })
|
||||
@@ -392,9 +392,8 @@ export default class SalesReceiptsController extends BaseController {
|
||||
|
||||
// Retrieves receipt in pdf format.
|
||||
try {
|
||||
const data = await this.saleReceiptsApplication.getSaleReceiptState(
|
||||
tenantId
|
||||
);
|
||||
const data =
|
||||
await this.saleReceiptsApplication.getSaleReceiptState(tenantId);
|
||||
return res.status(200).send({ data });
|
||||
} catch (error) {
|
||||
next(error);
|
||||
|
||||
Reference in New Issue
Block a user