feat: add discount fields in sale and purchase forms

This commit is contained in:
Ahmed Bouhuolia
2024-11-30 18:02:50 +02:00
parent 73ab92e693
commit ffb06f5194
11 changed files with 352 additions and 36 deletions

View File

@@ -8,8 +8,12 @@ import {
TotalLine,
TotalLineBorderStyle,
TotalLineTextStyle,
FInputGroup,
FFormGroup,
FSelect,
} from '@/components';
import { useReceiptTotals } from './utils';
import { Button } from '@blueprintjs/core';
export function ReceiptFormFooterRight() {
const {
@@ -26,6 +30,31 @@ export function ReceiptFormFooterRight() {
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={'receipt_form.label.total'} />}
value={formattedTotal}