mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
Fix : Connect default payment account with Expenses
This commit is contained in:
@@ -56,13 +56,13 @@ function ExpenseForm({
|
||||
|
||||
// #withSettings
|
||||
baseCurrency,
|
||||
preferredPaymentAccount,
|
||||
|
||||
// #own Props
|
||||
expenseId,
|
||||
onFormSubmit,
|
||||
onCancelForm,
|
||||
}) {
|
||||
|
||||
const [payload, setPayload] = useState({});
|
||||
|
||||
const history = useHistory();
|
||||
@@ -148,7 +148,7 @@ function ExpenseForm({
|
||||
|
||||
const defaultInitialValues = useMemo(
|
||||
() => ({
|
||||
payment_account_id: '',
|
||||
payment_account_id: parseInt(preferredPaymentAccount),
|
||||
beneficiary: '',
|
||||
payment_date: moment(new Date()).format('YYYY-MM-DD'),
|
||||
description: '',
|
||||
@@ -410,7 +410,8 @@ export default compose(
|
||||
withDashboardActions,
|
||||
withMediaActions,
|
||||
withExpenseDetail(),
|
||||
withSettings(({ organizationSettings }) => ({
|
||||
withSettings(({ organizationSettings, expenseSettings }) => ({
|
||||
baseCurrency: organizationSettings?.baseCurrency,
|
||||
preferredPaymentAccount: expenseSettings?.preferredPaymentAccount,
|
||||
})),
|
||||
)(ExpenseForm);
|
||||
|
||||
@@ -11,6 +11,7 @@ export default (mapState) => {
|
||||
receiptSettings: state.settings.data.salesReceipts,
|
||||
invoiceSettings: state.settings.data.salesInvoices,
|
||||
itemsSettings: state.settings.data.items,
|
||||
expenseSettings: state.settings.data.expenses,
|
||||
};
|
||||
return mapState ? mapState(mapped, state, props) : mapped;
|
||||
};
|
||||
|
||||
@@ -92,6 +92,10 @@ export default {
|
||||
key: "number_prefix",
|
||||
type: "string",
|
||||
},
|
||||
{
|
||||
key: "preferred_deposit_account",
|
||||
type: "number",
|
||||
},
|
||||
],
|
||||
sales_invoices: [
|
||||
{
|
||||
@@ -127,4 +131,10 @@ export default {
|
||||
type: "number",
|
||||
},
|
||||
],
|
||||
expenses: [
|
||||
{
|
||||
key: "preferred_payment_account",
|
||||
type: "number",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user