mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
fix: assign contacts customer/vendor in make jorunal.
This commit is contained in:
@@ -51,6 +51,7 @@ export default function ContactsSuggestField({
|
||||
<MenuItem
|
||||
key={contact.id}
|
||||
text={contact.display_name}
|
||||
label={contact.formatted_contact_service}
|
||||
onClick={handleClick}
|
||||
/>
|
||||
),
|
||||
|
||||
@@ -12,10 +12,7 @@ export default function ContactsListCellRenderer({
|
||||
}) {
|
||||
const handleContactSelected = useCallback(
|
||||
(contact) => {
|
||||
updateData(index, id, {
|
||||
contact_id: contact.id,
|
||||
contact_type: contact.contact_type,
|
||||
});
|
||||
updateData(index, 'contact_id', contact.id);
|
||||
},
|
||||
[updateData, index, id],
|
||||
);
|
||||
|
||||
@@ -25,7 +25,7 @@ export default function MakeJournalEntriesTable({
|
||||
minLinesNumber = 4,
|
||||
currencyCode,
|
||||
}) {
|
||||
const { accounts, customers } = useMakeJournalFormContext();
|
||||
const { accounts, contacts } = useMakeJournalFormContext();
|
||||
|
||||
// Memorized data table columns.
|
||||
const columns = useJournalTableEntriesColumns();
|
||||
@@ -68,10 +68,7 @@ export default function MakeJournalEntriesTable({
|
||||
errors: error,
|
||||
updateData: handleUpdateData,
|
||||
removeRow: handleRemoveRow,
|
||||
contacts: customers.map((customer) => ({
|
||||
...customer,
|
||||
contact_type: 'customer',
|
||||
})),
|
||||
contacts,
|
||||
autoFocus: ['account_id', 0],
|
||||
currencyCode,
|
||||
}}
|
||||
|
||||
@@ -2,7 +2,7 @@ import React, { createContext, useState } from 'react';
|
||||
import DashboardInsider from 'components/Dashboard/DashboardInsider';
|
||||
import {
|
||||
useAccounts,
|
||||
useCustomers,
|
||||
useAutoCompleteContacts,
|
||||
useCurrencies,
|
||||
useJournal,
|
||||
useCreateJournal,
|
||||
@@ -21,9 +21,9 @@ function MakeJournalProvider({ journalId, ...props }) {
|
||||
|
||||
// Load the customers list.
|
||||
const {
|
||||
data: { customers },
|
||||
isLoading: isCustomersLoading,
|
||||
} = useCustomers();
|
||||
data: contacts,
|
||||
isLoading: isContactsLoading,
|
||||
} = useAutoCompleteContacts();
|
||||
|
||||
// Load the currencies list.
|
||||
const { data: currencies, isLoading: isCurrenciesLoading } = useCurrencies();
|
||||
@@ -47,7 +47,7 @@ function MakeJournalProvider({ journalId, ...props }) {
|
||||
|
||||
const provider = {
|
||||
accounts,
|
||||
customers,
|
||||
contacts,
|
||||
currencies,
|
||||
manualJournal,
|
||||
|
||||
@@ -55,7 +55,7 @@ function MakeJournalProvider({ journalId, ...props }) {
|
||||
editJournalMutate,
|
||||
|
||||
isAccountsLoading,
|
||||
isCustomersLoading,
|
||||
isContactsLoading,
|
||||
isCurrenciesLoading,
|
||||
isJournalLoading,
|
||||
isSettingsLoading,
|
||||
@@ -72,7 +72,7 @@ function MakeJournalProvider({ journalId, ...props }) {
|
||||
isJournalLoading ||
|
||||
isAccountsLoading ||
|
||||
isCurrenciesLoading ||
|
||||
isCustomersLoading ||
|
||||
isContactsLoading ||
|
||||
isSettingsLoading
|
||||
}
|
||||
name={'make-journal-page'}
|
||||
|
||||
Reference in New Issue
Block a user