mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
feat: sales tax report query
This commit is contained in:
@@ -33,19 +33,17 @@ function SalesTaxLiabilitySummaryActionsBar({
|
||||
numberFormat,
|
||||
onNumberFormatSubmit,
|
||||
}) {
|
||||
const { isLoading, refetchBalanceSheet } =
|
||||
const { isLoading, refetchSalesTaxLiabilitySummary } =
|
||||
useSalesTaxLiabilitySummaryContext();
|
||||
|
||||
// Handle filter toggle click.
|
||||
const handleFilterToggleClick = () => {
|
||||
toggleFilterDrawer();
|
||||
};
|
||||
|
||||
// Handle recalculate the report button.
|
||||
// Handle re-calculate the report button.
|
||||
const handleRecalcReport = () => {
|
||||
refetchBalanceSheet();
|
||||
refetchSalesTaxLiabilitySummary();
|
||||
};
|
||||
|
||||
// Handle number format form submit.
|
||||
const handleNumberFormatSubmit = (values) => {
|
||||
saveInvoke(onNumberFormatSubmit, values);
|
||||
|
||||
@@ -26,6 +26,7 @@ function SalesTaxLiabilitySummaryBoot({ filter, ...props }) {
|
||||
|
||||
const provider = {
|
||||
salesTaxLiabilitySummary,
|
||||
refetchSalesTaxLiabilitySummary: refetch,
|
||||
isFetching,
|
||||
isLoading,
|
||||
query,
|
||||
|
||||
@@ -34,6 +34,9 @@ function SalesTaxLiabilitySummaryHeader({
|
||||
}) {
|
||||
const defaultValues = getDefaultSalesTaxLiablitySummaryQuery();
|
||||
|
||||
// Validation schema.
|
||||
const validationSchema = getSalesTaxLiabilitySummaryQueryValidation();
|
||||
|
||||
// Filter form initial values.
|
||||
const initialValues = transformToForm(
|
||||
{
|
||||
@@ -44,8 +47,6 @@ function SalesTaxLiabilitySummaryHeader({
|
||||
},
|
||||
defaultValues,
|
||||
);
|
||||
// Validation schema.
|
||||
const validationSchema = getSalesTaxLiabilitySummaryQueryValidation();
|
||||
|
||||
// Handle form submit.
|
||||
const handleSubmit = (values, actions) => {
|
||||
@@ -108,6 +109,6 @@ export default compose(
|
||||
|
||||
const SalesTaxSummaryFinancialHeader = styled(FinancialStatementHeader)`
|
||||
.bp3-drawer {
|
||||
max-height: 520px;
|
||||
max-height: 320px;
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// @ts-nocheck
|
||||
import React from 'react';
|
||||
import styled from 'styled-components';
|
||||
import intl from 'react-intl-universal';
|
||||
import { compose } from 'ramda';
|
||||
|
||||
import { TableStyle } from '@/constants';
|
||||
import { ReportDataTable, FinancialSheet } from '@/components';
|
||||
@@ -9,7 +9,6 @@ import { defaultExpanderReducer, tableRowTypesToClassnames } from '@/utils';
|
||||
import { useSalesTaxLiabilitySummaryContext } from './SalesTaxLiabilitySummaryBoot';
|
||||
import withCurrentOrganization from '@/containers/Organization/withCurrentOrganization';
|
||||
import { useSalesTaxLiabilitySummaryColumns } from './utils';
|
||||
import { compose } from 'ramda';
|
||||
|
||||
/**
|
||||
* Balance sheet table.
|
||||
@@ -20,7 +19,7 @@ function SalesTaxLiabilitySummaryTableRoot({
|
||||
}) {
|
||||
// Balance sheet context.
|
||||
const {
|
||||
salesTaxLiabilitySummary: { table },
|
||||
salesTaxLiabilitySummary: { table, query },
|
||||
} = useSalesTaxLiabilitySummaryContext();
|
||||
|
||||
// Retrieve the database columns.
|
||||
@@ -36,7 +35,8 @@ function SalesTaxLiabilitySummaryTableRoot({
|
||||
<FinancialSheet
|
||||
companyName={organizationName}
|
||||
sheetType={'Sales Tax Liability Summary'}
|
||||
asDate={new Date()}
|
||||
fromDate={query.from_date}
|
||||
toDate={query.to_date}
|
||||
basis={''}
|
||||
>
|
||||
<SalesTaxLiabilitySummaryDataTable
|
||||
|
||||
Reference in New Issue
Block a user