mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 05:40:31 +00:00
feat: add discount fields in sale and purchase forms
This commit is contained in:
@@ -7,8 +7,12 @@ import {
|
||||
TotalLine,
|
||||
TotalLineBorderStyle,
|
||||
TotalLineTextStyle,
|
||||
FInputGroup,
|
||||
FFormGroup,
|
||||
FSelect,
|
||||
} from '@/components';
|
||||
import { useEstimateTotals } from './utils';
|
||||
import { Button } from '@blueprintjs/core';
|
||||
|
||||
export function EstimateFormFooterRight() {
|
||||
const { formattedSubtotal, formattedTotal } = useEstimateTotals();
|
||||
@@ -20,6 +24,32 @@ export function EstimateFormFooterRight() {
|
||||
value={formattedSubtotal}
|
||||
borderStyle={TotalLineBorderStyle.None}
|
||||
/>
|
||||
|
||||
<FFormGroup name={'discount'} label={'Discount'} inline>
|
||||
<FInputGroup
|
||||
name={'discount'}
|
||||
rightElement={
|
||||
<FSelect
|
||||
name={'discount_type'}
|
||||
items={[
|
||||
{ text: 'USD', value: 'amount' },
|
||||
{ text: '%', value: 'percentage' },
|
||||
]}
|
||||
input={({ text }) => (
|
||||
<Button small minimal>
|
||||
{text}
|
||||
</Button>
|
||||
)}
|
||||
filterable={false}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
</FFormGroup>
|
||||
|
||||
<FFormGroup name={'adjustment'} label={'Adjustment'} inline>
|
||||
<FInputGroup name={'adjustment'} />
|
||||
</FFormGroup>
|
||||
|
||||
<TotalLine
|
||||
title={<T id={'estimate_form.label.total'} />}
|
||||
value={formattedTotal}
|
||||
|
||||
@@ -63,6 +63,8 @@ export const defaultEstimate = {
|
||||
entries: [...repeatValue(defaultEstimateEntry, MIN_LINES_NUMBER)],
|
||||
attachments: [],
|
||||
pdf_template_id: '',
|
||||
discount: '',
|
||||
discount_type: 'amount'
|
||||
};
|
||||
|
||||
const ERRORS = {
|
||||
|
||||
Reference in New Issue
Block a user