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