fix(webapp): no default branch for customer/vendor opening balance branch

This commit is contained in:
Ahmed Bouhuolia
2023-06-28 18:07:47 +02:00
parent 7fbe51ddf2
commit 8d990ae85d
18 changed files with 100 additions and 293 deletions

View File

@@ -1,12 +1,9 @@
// @ts-nocheck
import React from 'react';
import intl from 'react-intl-universal';
import styled from 'styled-components';
import {
Alignment,
NavbarGroup,
NavbarDivider,
Button,
Classes,
} from '@blueprintjs/core';
import {
@@ -18,12 +15,13 @@ import { Features } from '@/constants';
import { useFeatureCan } from '@/hooks/state';
import { useReceiptFormContext } from './ReceiptFormProvider';
import {
Icon,
BranchSelect,
FeatureCan,
WarehouseSelect,
FormTopbar,
DetailsBarSkeletonBase,
FormBranchSelectButton,
FormWarehouseSelectButton,
} from '@/components';
/**
@@ -76,8 +74,9 @@ function ReceiptFormSelectBranch() {
<BranchSelect
name={'branch_id'}
branches={branches}
input={ReceiptBranchSelectButton}
input={FormBranchSelectButton}
popoverProps={{ minimal: true }}
fill={false}
/>
);
}
@@ -96,30 +95,9 @@ function ReceiptFormSelectWarehouse() {
<WarehouseSelect
name={'warehouse_id'}
warehouses={warehouses}
input={ReceiptWarehouseSelectButton}
input={FormWarehouseSelectButton}
popoverProps={{ minimal: true }}
/>
);
}
function ReceiptBranchSelectButton({ label }) {
return (
<Button
text={intl.get('receipt.branch_button.label', { label })}
minimal={true}
small={true}
icon={<Icon icon={'branch-16'} iconSize={16} />}
/>
);
}
function ReceiptWarehouseSelectButton({ label }) {
return (
<Button
text={intl.get('receipt.warehouse_button.label', { label })}
minimal={true}
small={true}
icon={<Icon icon={'warehouse-16'} iconSize={16} />}
fill={false}
/>
);
}