mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
Merge remote-tracking branch 'origin/Tasks'
This commit is contained in:
@@ -78,15 +78,9 @@ function ItemCategoryDialog({
|
||||
.required()
|
||||
.label(formatMessage({ id: 'category_name_' })),
|
||||
parent_category_id: Yup.string().nullable(),
|
||||
cost_account_id: Yup.number()
|
||||
.required()
|
||||
.label(formatMessage({ id: 'cost_account_' })),
|
||||
sell_account_id: Yup.number()
|
||||
.required()
|
||||
.label(formatMessage({ id: 'sell_account_' })),
|
||||
inventory_account_id: Yup.number()
|
||||
.required()
|
||||
.label(formatMessage({ id: 'inventory_account_' })),
|
||||
cost_account_id: Yup.number().nullable(),
|
||||
sell_account_id: Yup.number().nullable(),
|
||||
inventory_account_id: Yup.number(),
|
||||
description: Yup.string().trim().nullable(),
|
||||
});
|
||||
|
||||
@@ -122,7 +116,7 @@ function ItemCategoryDialog({
|
||||
onSubmit: (values, { setSubmitting }) => {
|
||||
const afterSubmit = () => {
|
||||
closeDialog(dialogName);
|
||||
queryCache.invalidateQueries('items-categories-table');
|
||||
queryCache.invalidateQueries('items-categories-list');
|
||||
queryCache.invalidateQueries('accounts-list');
|
||||
};
|
||||
if (payload.action === 'edit') {
|
||||
|
||||
71
client/src/containers/Dialogs/JournalNumberDailog.js
Normal file
71
client/src/containers/Dialogs/JournalNumberDailog.js
Normal file
@@ -0,0 +1,71 @@
|
||||
import React, { useEffect, useCallback, useMemo } from 'react';
|
||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
||||
import { useQuery, queryCache } from 'react-query';
|
||||
import { Dialog } from 'components';
|
||||
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||
import withDialogRedux from 'components/DialogReduxConnect';
|
||||
import withSettingsActions from 'containers/Settings/withSettingsActions';
|
||||
import withSettings from 'containers/Settings/withSettings';
|
||||
import ReferenceNumberForm from 'containers/JournalNumber/ReferenceNumberForm';
|
||||
import classNames from 'classnames';
|
||||
|
||||
import { connect } from 'react-redux';
|
||||
import { compose, optionsMapToArray } from 'utils';
|
||||
|
||||
function JournalNumberDailog({
|
||||
dialogName,
|
||||
payload,
|
||||
isOpen,
|
||||
|
||||
// #withSettingsActions
|
||||
requestSubmitOptions,
|
||||
|
||||
// #withDialogActions
|
||||
closeDialog,
|
||||
}) {
|
||||
// Handles dialog close.
|
||||
const handleClose = useCallback(() => {
|
||||
closeDialog(dialogName);
|
||||
}, [closeDialog, dialogName]);
|
||||
|
||||
const handleSubmitForm = useCallback(() => {});
|
||||
|
||||
// Handle dialog on closed.
|
||||
// const onDialogClosed = useCallback(() => {
|
||||
// resetForm();
|
||||
// }, [resetForm]);
|
||||
|
||||
return (
|
||||
<Dialog
|
||||
name={dialogName}
|
||||
// isLoading={}
|
||||
title={<T id={'journal_number_settings'} />}
|
||||
autoFocus={true}
|
||||
canEscapeKeyClose={true}
|
||||
isOpen={isOpen}
|
||||
onClose={handleClose}
|
||||
>
|
||||
<ReferenceNumberForm
|
||||
onSubmit={handleSubmitForm}
|
||||
initialNumber={'1000'}
|
||||
initialPrefix={'A'}
|
||||
onClose={handleClose}
|
||||
groupName={'manual_journals'}
|
||||
/>
|
||||
</Dialog>
|
||||
);
|
||||
}
|
||||
|
||||
const mapStateToProps = (state, props) => ({
|
||||
dialogName: 'journalNumber-form',
|
||||
journalNumberId: props?.payload?.id || null,
|
||||
});
|
||||
|
||||
const withJournalNumberDailog = connect(mapStateToProps);
|
||||
|
||||
export default compose(
|
||||
withDialogRedux(null, 'journalNumber-form'),
|
||||
withJournalNumberDailog,
|
||||
withDialogActions,
|
||||
withSettingsActions,
|
||||
)(JournalNumberDailog);
|
||||
Reference in New Issue
Block a user