mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 15:20:34 +00:00
fix: bill, payment made, receipt loading state.
This commit is contained in:
@@ -17,12 +17,12 @@ const BillFormContext = createContext();
|
|||||||
*/
|
*/
|
||||||
function BillFormProvider({ billId, ...props }) {
|
function BillFormProvider({ billId, ...props }) {
|
||||||
// Handle fetch accounts.
|
// Handle fetch accounts.
|
||||||
const { data: accounts, isFetching: isAccountsLoading } = useAccounts();
|
const { data: accounts, isLoading: isAccountsLoading } = useAccounts();
|
||||||
|
|
||||||
// Handle fetch vendors data table
|
// Handle fetch vendors data table
|
||||||
const {
|
const {
|
||||||
data: { vendors },
|
data: { vendors },
|
||||||
isFetching: isVendorsLoading,
|
isLoading: isVendorsLoading,
|
||||||
} = useVendors({ page_size: 10000 });
|
} = useVendors({ page_size: 10000 });
|
||||||
|
|
||||||
// Filter all purchasable items only.
|
// Filter all purchasable items only.
|
||||||
@@ -38,14 +38,14 @@ function BillFormProvider({ billId, ...props }) {
|
|||||||
// Handle fetch Items data table or list
|
// Handle fetch Items data table or list
|
||||||
const {
|
const {
|
||||||
data: { items },
|
data: { items },
|
||||||
isFetching: isItemsLoading,
|
isLoading: isItemsLoading,
|
||||||
} = useItems({
|
} = useItems({
|
||||||
page_size: 10000,
|
page_size: 10000,
|
||||||
stringified_filter_roles: stringifiedFilterRoles,
|
stringified_filter_roles: stringifiedFilterRoles,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Handle fetch bill details.
|
// Handle fetch bill details.
|
||||||
const { data: bill, isFetching: isBillLoading } = useBill(billId, {
|
const { data: bill, isLoading: isBillLoading } = useBill(billId, {
|
||||||
enabled: !!billId,
|
enabled: !!billId,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,6 @@ function PaymentMadeFormProvider({ paymentMadeId, ...props }) {
|
|||||||
isVendorsLoading ||
|
isVendorsLoading ||
|
||||||
isItemsFetching ||
|
isItemsFetching ||
|
||||||
isAccountsLoading ||
|
isAccountsLoading ||
|
||||||
isPaymentFetching ||
|
|
||||||
isPaymentLoading
|
isPaymentLoading
|
||||||
}
|
}
|
||||||
name={'payment-made'}
|
name={'payment-made'}
|
||||||
|
|||||||
@@ -17,19 +17,19 @@ const ReceiptFormContext = createContext();
|
|||||||
*/
|
*/
|
||||||
function ReceiptFormProvider({ receiptId, ...props }) {
|
function ReceiptFormProvider({ receiptId, ...props }) {
|
||||||
// Fetch sale receipt details.
|
// Fetch sale receipt details.
|
||||||
const { data: receipt, isFetching: isReceiptLoading } = useReceipt(
|
const { data: receipt, isLoading: isReceiptLoading } = useReceipt(
|
||||||
receiptId,
|
receiptId,
|
||||||
{
|
{
|
||||||
enabled: !!receiptId,
|
enabled: !!receiptId,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
// Fetch accounts list.
|
// Fetch accounts list.
|
||||||
const { data: accounts, isFetching: isAccountsLoading } = useAccounts();
|
const { data: accounts, isLoading: isAccountsLoading } = useAccounts();
|
||||||
|
|
||||||
// Fetch customers list.
|
// Fetch customers list.
|
||||||
const {
|
const {
|
||||||
data: { customers },
|
data: { customers },
|
||||||
isFetching: isCustomersLoading,
|
isLoading: isCustomersLoading,
|
||||||
} = useCustomers({ page_size: 10000 });
|
} = useCustomers({ page_size: 10000 });
|
||||||
|
|
||||||
// Filter all sellable items only.
|
// Filter all sellable items only.
|
||||||
@@ -45,7 +45,7 @@ function ReceiptFormProvider({ receiptId, ...props }) {
|
|||||||
// Handle fetch Items data table or list
|
// Handle fetch Items data table or list
|
||||||
const {
|
const {
|
||||||
data: { items },
|
data: { items },
|
||||||
isFetching: isItemsLoading,
|
isLoading: isItemsLoading,
|
||||||
} = useItems({
|
} = useItems({
|
||||||
page_size: 10000,
|
page_size: 10000,
|
||||||
stringified_filter_roles: stringifiedFilterRoles,
|
stringified_filter_roles: stringifiedFilterRoles,
|
||||||
|
|||||||
Reference in New Issue
Block a user