feat: add project select to sales & purchases

This commit is contained in:
elforjani13
2022-08-11 11:20:52 +02:00
parent 95137f4fcd
commit 69c4519647
18 changed files with 228 additions and 23 deletions

View File

@@ -2,6 +2,7 @@ import React, { createContext, useState } from 'react';
import { Features } from '@/constants';
import { useFeatureCan } from '@/hooks/state';
import { DashboardInsider } from '@/components/Dashboard';
import { useProjects } from '@/containers/Projects/hooks';
import {
useAccounts,
useVendors,
@@ -80,6 +81,12 @@ function BillFormProvider({ billId, ...props }) {
isSuccess: isBranchesSuccess,
} = useBranches({}, { enabled: isBranchFeatureCan });
// Fetches the projects list.
const {
data: { projects },
isLoading: isProjectsLoading,
} = useProjects();
// Handle fetching bill settings.
const { isFetching: isSettingLoading } = useSettings();
@@ -102,6 +109,7 @@ function BillFormProvider({ billId, ...props }) {
bill,
warehouses,
branches,
projects,
submitPayload,
isNewMode,