mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 05:40:31 +00:00
feat(ManualJournals): Auto-increment.
fix(BillPayment): Validate the opened payment bills. fix(redux): presist redux state. fix(useRequestQuery): hook.
This commit is contained in:
@@ -35,10 +35,10 @@ function ItemsEntriesTable({
|
||||
const [cellsLoading, setCellsLoading] = React.useState(null);
|
||||
|
||||
// Fetches the item details.
|
||||
const { data: item, isFetching: isItemFetching } = useItem(
|
||||
const { data: item, isFetching: isItemFetching, isSuccess: isItemSuccess } = useItem(
|
||||
rowItem && rowItem.itemId,
|
||||
{
|
||||
enabled: !!rowItem,
|
||||
enabled: !!(rowItem && rowItem.itemId),
|
||||
},
|
||||
);
|
||||
|
||||
@@ -58,7 +58,7 @@ function ItemsEntriesTable({
|
||||
|
||||
// Once the item selected and fetched set the initial details to the table.
|
||||
useEffect(() => {
|
||||
if (item && rowItem) {
|
||||
if (isItemSuccess && item && rowItem) {
|
||||
const { rowIndex } = rowItem;
|
||||
const price =
|
||||
itemType === ITEM_TYPE.PURCHASABLE
|
||||
@@ -82,7 +82,7 @@ function ItemsEntriesTable({
|
||||
setRowItem(null);
|
||||
saveInvoke(onUpdateData, newRows);
|
||||
}
|
||||
}, [item, rowItem, rows, itemType, onUpdateData]);
|
||||
}, [item, rowItem, rows, itemType, onUpdateData, isItemSuccess]);
|
||||
|
||||
// Allows to observes `entries` to make table rows outside controlled.
|
||||
useEffect(() => {
|
||||
|
||||
@@ -20,17 +20,18 @@ function ItemFormProvider({ itemId, ...props }) {
|
||||
const { state } = useLocation();
|
||||
|
||||
const duplicateId = state?.action;
|
||||
|
||||
// Fetches the accounts list.
|
||||
const { isFetching: isAccountsLoading, data: accounts } = useAccounts();
|
||||
const { isLoading: isAccountsLoading, data: accounts } = useAccounts();
|
||||
|
||||
// Fetches the items categories list.
|
||||
const {
|
||||
isFetching: isItemsCategoriesLoading,
|
||||
isLoading: isItemsCategoriesLoading,
|
||||
data: { itemsCategories },
|
||||
} = useItemsCategories();
|
||||
|
||||
// Fetches the given item details.
|
||||
const { isFetching: isItemLoading, data: item } = useItem(
|
||||
const { isLoading: isItemLoading, data: item } = useItem(
|
||||
itemId || duplicateId,
|
||||
{
|
||||
enabled: !!itemId || !!duplicateId,
|
||||
|
||||
@@ -16,13 +16,13 @@ function PaymentMadesListProvider({ query, ...props }) {
|
||||
// Fetch accounts resource views and fields.
|
||||
const {
|
||||
data: paymentMadesViews,
|
||||
isFetching: isViewsLoading,
|
||||
isLoading: isViewsLoading,
|
||||
} = useResourceViews('bill_payments');
|
||||
|
||||
// Fetch the accounts resource fields.
|
||||
const {
|
||||
data: paymentMadesFields,
|
||||
isFetching: isFieldsLoading,
|
||||
isLoading: isFieldsLoading,
|
||||
} = useResourceFields('bill_payments');
|
||||
|
||||
// Fetch accounts list according to the given custom view id.
|
||||
|
||||
Reference in New Issue
Block a user