mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 22:30:31 +00:00
fix: discount and adjustment fields
This commit is contained in:
@@ -153,7 +153,7 @@ export default class BillsController extends BaseController {
|
|||||||
check('discount_type')
|
check('discount_type')
|
||||||
.default(DiscountType.Amount)
|
.default(DiscountType.Amount)
|
||||||
.isIn([DiscountType.Amount, DiscountType.Percentage]),
|
.isIn([DiscountType.Amount, DiscountType.Percentage]),
|
||||||
check('discount').optional().isDecimal().toFloat(),
|
check('discount').optional({ nullable: true }).isDecimal().toFloat(),
|
||||||
|
|
||||||
// # Adjustment
|
// # Adjustment
|
||||||
check('adjustment').optional({ nullable: true }).isNumeric().toFloat(),
|
check('adjustment').optional({ nullable: true }).isNumeric().toFloat(),
|
||||||
@@ -204,7 +204,7 @@ export default class BillsController extends BaseController {
|
|||||||
check('discount_type')
|
check('discount_type')
|
||||||
.default(DiscountType.Amount)
|
.default(DiscountType.Amount)
|
||||||
.isIn([DiscountType.Amount, DiscountType.Percentage]),
|
.isIn([DiscountType.Amount, DiscountType.Percentage]),
|
||||||
check('discount').optional().isDecimal().toFloat(),
|
check('discount').optional({ nullable: true }).isDecimal().toFloat(),
|
||||||
|
|
||||||
// # Adjustment
|
// # Adjustment
|
||||||
check('adjustment').optional({ nullable: true }).isNumeric().toFloat(),
|
check('adjustment').optional({ nullable: true }).isNumeric().toFloat(),
|
||||||
|
|||||||
@@ -204,13 +204,13 @@ export default class SalesEstimatesController extends BaseController {
|
|||||||
check('pdf_template_id').optional({ nullable: true }).isNumeric().toInt(),
|
check('pdf_template_id').optional({ nullable: true }).isNumeric().toInt(),
|
||||||
|
|
||||||
// # Discount
|
// # Discount
|
||||||
check('discount').optional().isNumeric().toFloat(),
|
check('discount').optional({ nullable: true }).isNumeric().toFloat(),
|
||||||
check('discount_type')
|
check('discount_type')
|
||||||
.default(DiscountType.Amount)
|
.default(DiscountType.Amount)
|
||||||
.isIn([DiscountType.Amount, DiscountType.Percentage]),
|
.isIn([DiscountType.Amount, DiscountType.Percentage]),
|
||||||
|
|
||||||
// # Adjustment
|
// # Adjustment
|
||||||
check('adjustment').optional().isNumeric().toFloat(),
|
check('adjustment').optional({ nullable: true }).isNumeric().toFloat(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export default function EstimateDetailTableFooter() {
|
|||||||
value={estimate.formatted_subtotal}
|
value={estimate.formatted_subtotal}
|
||||||
borderStyle={TotalLineBorderStyle.SingleDark}
|
borderStyle={TotalLineBorderStyle.SingleDark}
|
||||||
/>
|
/>
|
||||||
{estimate?.discount_amount > 0 && (
|
{estimate?.discount_amount_formatted && (
|
||||||
<TotalLine
|
<TotalLine
|
||||||
title={
|
title={
|
||||||
estimate.discount_percentage_formatted
|
estimate.discount_percentage_formatted
|
||||||
@@ -36,6 +36,13 @@ export default function EstimateDetailTableFooter() {
|
|||||||
textStyle={TotalLineTextStyle.Regular}
|
textStyle={TotalLineTextStyle.Regular}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
{estimate?.adjustment_formatted && (
|
||||||
|
<TotalLine
|
||||||
|
title="Adjustment"
|
||||||
|
value={estimate.adjustment_formatted}
|
||||||
|
textStyle={TotalLineTextStyle.Regular}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
<TotalLine
|
<TotalLine
|
||||||
title={<T id={'estimate.details.total'} />}
|
title={<T id={'estimate.details.total'} />}
|
||||||
value={estimate.total_formatted}
|
value={estimate.total_formatted}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export function InvoiceDetailTableFooter() {
|
|||||||
textStyle={TotalLineTextStyle.Regular}
|
textStyle={TotalLineTextStyle.Regular}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{invoice?.adjustment > 0 && (
|
{invoice?.adjustment_formatted && (
|
||||||
<TotalLine
|
<TotalLine
|
||||||
title="Adjustment"
|
title="Adjustment"
|
||||||
value={invoice.adjustment_formatted}
|
value={invoice.adjustment_formatted}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export default function VendorCreditDetailDrawerFooter() {
|
|||||||
value={vendorCredit.formatted_subtotal}
|
value={vendorCredit.formatted_subtotal}
|
||||||
borderStyle={TotalLineBorderStyle.SingleDark}
|
borderStyle={TotalLineBorderStyle.SingleDark}
|
||||||
/>
|
/>
|
||||||
{vendorCredit.discount_amount_formatted && (
|
{vendorCredit?.discount_amount_formatted && (
|
||||||
<TotalLine
|
<TotalLine
|
||||||
title={
|
title={
|
||||||
vendorCredit.discount_percentage_formatted
|
vendorCredit.discount_percentage_formatted
|
||||||
@@ -36,6 +36,13 @@ export default function VendorCreditDetailDrawerFooter() {
|
|||||||
textStyle={TotalLineTextStyle.Regular}
|
textStyle={TotalLineTextStyle.Regular}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
{vendorCredit?.adjustment_formatted && (
|
||||||
|
<TotalLine
|
||||||
|
title={'Adjustment'}
|
||||||
|
value={vendorCredit.adjustment_formatted}
|
||||||
|
textStyle={TotalLineTextStyle.Regular}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
<TotalLine
|
<TotalLine
|
||||||
title={<T id={'vendor_credit.drawer.label_total'} />}
|
title={<T id={'vendor_credit.drawer.label_total'} />}
|
||||||
value={vendorCredit.formatted_amount}
|
value={vendorCredit.formatted_amount}
|
||||||
|
|||||||
Reference in New Issue
Block a user