refactoring: invoice form.

refactoring: receipt form.
refactoring: bill form.
refactoring: estimate form.
This commit is contained in:
a.bouhuolia
2021-02-15 16:23:58 +02:00
parent 151bd9bc54
commit e8458e2b36
37 changed files with 410 additions and 903 deletions

View File

@@ -16,22 +16,15 @@ import {
tansformDateValue,
handleDateChange,
inputIntent,
saveInvoke,
} from 'utils';
/**
* Fill form header.
*/
function BillFormHeader({
onBillNumberChanged,
}) {
function BillFormHeader() {
// Bill form context.
const { vendors } = useBillFormContext();
const handleBillNumberBlur = (event) => {
saveInvoke(onBillNumberChanged, event.currentTarget.value);
};
return (
<div className={classNames(CLASSES.PAGE_FORM_HEADER_FIELDS)}>
{/* ------- Vendor name ------ */}
@@ -121,11 +114,7 @@ function BillFormHeader({
intent={inputIntent({ error, touched })}
helperText={<ErrorMessage name="bill_number" />}
>
<InputGroup
minimal={true}
{...field}
onBlur={handleBillNumberBlur}
/>
<InputGroup minimal={true} {...field} />
</FormGroup>
)}
</FastField>
@@ -148,6 +137,4 @@ function BillFormHeader({
);
}
export default compose(
withDialogActions,
)(BillFormHeader);
export default compose(withDialogActions)(BillFormHeader);