mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 06:40:31 +00:00
Fix: make journal.
This commit is contained in:
@@ -6,22 +6,15 @@ import 'style/pages/ManualJournal/MakeJournal.scss';
|
|||||||
import MakeJournalEntriesForm from './MakeJournalEntriesForm';
|
import MakeJournalEntriesForm from './MakeJournalEntriesForm';
|
||||||
import { MakeJournalProvider } from './MakeJournalProvider';
|
import { MakeJournalProvider } from './MakeJournalProvider';
|
||||||
|
|
||||||
import withCurrentOrganization from 'containers/Organization/withCurrentOrganization';
|
|
||||||
import { compose } from 'utils';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Make journal entries page.
|
* Make journal entries page.
|
||||||
*/
|
*/
|
||||||
function MakeJournalEntriesPage({
|
export default function MakeJournalEntriesPage() {
|
||||||
// #withCurrentOrganization
|
|
||||||
organization: { base_currency },
|
|
||||||
}) {
|
|
||||||
const { id: journalId } = useParams();
|
const { id: journalId } = useParams();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MakeJournalProvider journalId={journalId} baseCurrency={base_currency}>
|
<MakeJournalProvider journalId={journalId}>
|
||||||
<MakeJournalEntriesForm />
|
<MakeJournalEntriesForm />
|
||||||
</MakeJournalProvider>
|
</MakeJournalProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
export default compose(withCurrentOrganization())(MakeJournalEntriesPage);
|
|
||||||
|
|||||||
@@ -15,14 +15,13 @@ export function MakeJournalFormFooterRight() {
|
|||||||
return (
|
return (
|
||||||
<MakeJouranlTotalLines>
|
<MakeJouranlTotalLines>
|
||||||
<TotalLine
|
<TotalLine
|
||||||
title={<T id={'manual_journal.details.subtotal'} />}
|
title={<T id={'make_journal.label.subtotal'} />}
|
||||||
value={formattedSubtotal}
|
value={formattedSubtotal}
|
||||||
borderStyle={TotalLineBorderStyle.None}
|
borderStyle={TotalLineBorderStyle.None}
|
||||||
/>
|
/>
|
||||||
<TotalLine
|
<TotalLine
|
||||||
title={<T id={'manual_journal.details.total'} />}
|
title={<T id={'make_journal.label.total'} />}
|
||||||
value={formattedTotal}
|
value={formattedTotal}
|
||||||
// borderStyle={TotalLineBorderStyle.SingleDark}
|
|
||||||
textStyle={TotalLineTextStyle.Bold}
|
textStyle={TotalLineTextStyle.Bold}
|
||||||
/>
|
/>
|
||||||
</MakeJouranlTotalLines>
|
</MakeJouranlTotalLines>
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ function MakeJournalFormSelectBranch() {
|
|||||||
function MakeJournalBranchSelectButton({ label }) {
|
function MakeJournalBranchSelectButton({ label }) {
|
||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
text={intl.get('invoice.branch_button.label', { label })}
|
text={intl.get('make_journal.branch_button.label', { label })}
|
||||||
minimal={true}
|
minimal={true}
|
||||||
small={true}
|
small={true}
|
||||||
icon={<Icon icon={'branch-16'} iconSize={16} />}
|
icon={<Icon icon={'branch-16'} iconSize={16} />}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ const MakeJournalFormContext = createContext();
|
|||||||
/**
|
/**
|
||||||
* Make journal form provider.
|
* Make journal form provider.
|
||||||
*/
|
*/
|
||||||
function MakeJournalProvider({ journalId, query, baseCurrency, ...props }) {
|
function MakeJournalProvider({ journalId, query, ...props }) {
|
||||||
// Features guard.
|
// Features guard.
|
||||||
const { featureCan } = useFeatureCan();
|
const { featureCan } = useFeatureCan();
|
||||||
const isBranchFeatureCan = featureCan(Features.Branches);
|
const isBranchFeatureCan = featureCan(Features.Branches);
|
||||||
@@ -58,21 +58,16 @@ function MakeJournalProvider({ journalId, query, baseCurrency, ...props }) {
|
|||||||
|
|
||||||
// Submit form payload.
|
// Submit form payload.
|
||||||
const [submitPayload, setSubmitPayload] = useState({});
|
const [submitPayload, setSubmitPayload] = useState({});
|
||||||
const [selectJournalCurrency, setSelactJournalCurrency] = useState(null);
|
|
||||||
|
|
||||||
// Determines whether the warehouse and branches are loading.
|
// Determines whether the warehouse and branches are loading.
|
||||||
const isFeatureLoading = isBranchesLoading;
|
const isFeatureLoading = isBranchesLoading;
|
||||||
|
|
||||||
const isForeignJournal =
|
|
||||||
!isEqual(selectJournalCurrency?.currency_code, baseCurrency) &&
|
|
||||||
!isUndefined(selectJournalCurrency?.currency_code);
|
|
||||||
|
|
||||||
const provider = {
|
const provider = {
|
||||||
accounts,
|
accounts,
|
||||||
contacts,
|
contacts,
|
||||||
currencies,
|
currencies,
|
||||||
manualJournal,
|
manualJournal,
|
||||||
baseCurrency,
|
|
||||||
branches,
|
branches,
|
||||||
|
|
||||||
createJournalMutate,
|
createJournalMutate,
|
||||||
@@ -84,14 +79,11 @@ function MakeJournalProvider({ journalId, query, baseCurrency, ...props }) {
|
|||||||
isJournalLoading,
|
isJournalLoading,
|
||||||
isFeatureLoading,
|
isFeatureLoading,
|
||||||
isSettingsLoading,
|
isSettingsLoading,
|
||||||
isForeignJournal,
|
|
||||||
isBranchesSuccess,
|
isBranchesSuccess,
|
||||||
isNewMode: !journalId,
|
isNewMode: !journalId,
|
||||||
|
|
||||||
submitPayload,
|
submitPayload,
|
||||||
setSubmitPayload,
|
setSubmitPayload,
|
||||||
selectJournalCurrency,
|
|
||||||
setSelactJournalCurrency,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user