Compare commits

...

26 Commits

Author SHA1 Message Date
a.bouhuolia
98a02396a9 Merge branch 'develop' into main 2022-02-21 15:02:35 +02:00
a.bouhuolia
c7673f57cd dump v1.6.3. 2022-02-21 15:02:08 +02:00
a.bouhuolia
aa39aab93a fix(Billing): display payment methods only if subscription is not active. 2022-02-21 14:56:55 +02:00
a.bouhuolia
8e6b0b496f fix: BIG-337 Display billing page once the organization subscription is inactive. 2022-02-21 14:38:41 +02:00
a.bouhuolia
96635ffa84 Merge branch 'develop' into main 2022-02-18 20:44:42 +02:00
a.bouhuolia
e874b89d2d fix: try to fix styled-components. 2022-02-18 20:32:21 +02:00
a.bouhuolia
60d37e3424 Revert "fix: try to comment FinancialSkeletonTable component."
This reverts commit e3f2c82a38.
2022-02-18 20:10:53 +02:00
a.bouhuolia
8ae39bf04c fix: styled-components components. 2022-02-18 19:52:37 +02:00
a.bouhuolia
e3f2c82a38 fix: try to comment FinancialSkeletonTable component. 2022-02-18 19:29:12 +02:00
a.bouhuolia
68c0678dc3 Merge branch 'develop' into main 2022-02-17 12:10:20 +02:00
a.bouhuolia
030be9652c feat: add BS and PL reports to page of financial reports list. 2022-02-17 11:40:40 +02:00
a.bouhuolia
554527f17d fix(VendorTransaction): column accessor/id. 2022-02-16 18:47:36 +02:00
a.bouhuolia
79144ad4a5 fix: re-structure the system tables reports. 2022-02-16 18:44:10 +02:00
a.bouhuolia
e6fcbfeea6 fix: control report drawer header. 2022-02-16 17:49:28 +02:00
a.bouhuolia
7eacaa0660 fix: financial report data tables. 2022-02-14 14:09:17 +02:00
a.bouhuolia
673808cceb feat: add sticky table head to specific item transactions table. 2022-02-13 17:22:29 +02:00
a.bouhuolia
f27ef2c9b0 fix: style of vendor/customer balance summary. 2022-02-13 17:17:09 +02:00
a.bouhuolia
da699a766a Merge branch 'develop' into main 2022-01-13 15:40:55 +02:00
a.bouhuolia
f1899e1ce1 Merge branch 'develop' into main 2022-01-08 18:20:08 +02:00
Ahmed Bouhuolia
11851d114d Merge pull request #16 from bigcapitalhq/develop
Release 1.5.5
2022-01-04 22:35:49 +02:00
a.bouhuolia
21779007be fix: application version. 2022-01-03 23:14:11 +02:00
a.bouhuolia
4fc1ecdc2d Merge branch 'main' of https://github.com/bigcapitalhq/client into main 2022-01-03 19:42:48 +02:00
a.bouhuolia
c9b5cecf7a Merge branch 'develop' into main 2022-01-03 19:42:23 +02:00
elforjani13
c31e9dcd29 fix: inventory adjustment & contacts drawer. 2022-01-03 14:35:50 +02:00
elforjani13
430ab95dc3 landed cost localiztion. 2022-01-03 13:38:22 +02:00
Ahmed Bouhuolia
8100a57195 Merge pull request #15 from bigcapitalhq/develop
Merge `develop` to `main`
2022-01-03 12:31:14 +02:00
67 changed files with 512 additions and 213 deletions

View File

@@ -2,6 +2,26 @@
All notable changes to Bigcapital server-side will be in this file.
## [1.6.3] - 21-02-2022
### Fixed
- `BIG-337` Display billing page once the organization subscription is inactive.
## [1.6.2] - 19-02-2022
### Fixed
- fix syled components dependency with imported as default components.
## [1.6.0] - 18-02-2022
### Added
- Balance sheet comparison of previous period (PP).
- Balance sheet comparison of previous year (PY).
- Balance sheet percentage analysis columns and rows basis.
- Profit & loss sheet comparison of preivous period (PP).
- Profit & loss sheet comparison of previous year (PY).
- Profit & loss sheet percentage analysis columns, rows, income and expenses basis.
## [1.5.8] - 13-01-2022
### Added

View File

@@ -85,6 +85,9 @@ function getClientEnvironment(publicUrl) {
WDS_SOCKET_HOST: process.env.WDS_SOCKET_HOST,
WDS_SOCKET_PATH: process.env.WDS_SOCKET_PATH,
WDS_SOCKET_PORT: process.env.WDS_SOCKET_PORT,
// Application version.
VERSION: paths.appVersion
}
);
// Stringify all values so we can feed into webpack DefinePlugin

View File

@@ -48,6 +48,8 @@ const resolveModule = (resolveFn, filePath) => {
return resolveFn(`${filePath}.js`);
};
const appVersion = require(resolveApp('package.json')).version;
// config after eject: we're in ./config/
module.exports = {
dotenv: resolveApp('.env'),
@@ -65,6 +67,7 @@ module.exports = {
proxySetup: resolveApp('src/setupProxy.js'),
appNodeModules: resolveApp('node_modules'),
publicUrlOrPath,
appVersion
};

View File

@@ -1,6 +1,6 @@
{
"name": "bigcapital-client",
"version": "1.5.8",
"version": "1.6.3",
"private": true,
"dependencies": {
"@babel/core": "7.8.4",

View File

@@ -1,3 +1 @@
export * from './ButtonLink';

View File

@@ -1,7 +1,7 @@
import React from 'react';
import * as R from 'ramda';
import { ButtonLink } from 'components';
import { ButtonLink } from '../Button';
import withDrawerActions from 'containers/Drawer/withDrawerActions';
function CustomerDrawerLinkComponent({

View File

@@ -1,7 +1,8 @@
import React from 'react';
import { Ability } from '@casl/ability';
import { createContextualCan } from '@casl/react';
import { useDashboardMeta } from '../../hooks/query';
import { useDashboardMetaBoot } from './DashboardBoot';
export const AbilityContext = React.createContext();
export const Can = createContextualCan(AbilityContext.Consumer);
@@ -11,8 +12,8 @@ export const Can = createContextualCan(AbilityContext.Consumer);
*/
export function DashboardAbilityProvider({ children }) {
const {
data: { abilities },
} = useDashboardMeta();
meta: { abilities },
} = useDashboardMetaBoot();
// Ability instance.
const ability = new Ability(abilities);

View File

@@ -6,18 +6,26 @@ import {
} from '../../hooks/query';
import { useSplashLoading } from '../../hooks/state';
import { useWatch, useWatchImmediate, useWhen } from '../../hooks';
import { useSubscription } from '../../hooks/state';
import { setCookie, getCookie } from '../../utils';
/**
* Dashboard meta async booting.
* - Fetches the dashboard meta only if the organization subscribe is active.
* - Once the dashboard meta query is loading display dashboard splash screen.
*/
export function useDashboardMetaBoot() {
const { isSubscriptionActive } = useSubscription();
const {
data: dashboardMeta,
isLoading: isDashboardMetaLoading,
isSuccess: isDashboardMetaSuccess,
} = useDashboardMeta({
keepPreviousData: true,
// Avoid run the query if the organization subscription is not active.
enabled: isSubscriptionActive,
});
const [startLoading, stopLoading] = useSplashLoading();
@@ -30,20 +38,12 @@ export function useDashboardMetaBoot() {
}, isDashboardMetaSuccess);
return {
meta: dashboardMeta,
isLoading: isDashboardMetaLoading,
isSuccess: isDashboardMetaSuccess
};
}
/**
* Dashboard async booting.
* @returns {{ isLoading: boolean }}
*/
export function useDashboardBoot() {
const { isLoading } = useDashboardMetaBoot();
return { isLoading };
}
/**
* Application async booting.
*/

View File

@@ -1,12 +1,12 @@
import React from 'react';
import { DashboardAbilityProvider } from '../../components';
import { useDashboardBoot } from './DashboardBoot';
import { useDashboardMetaBoot } from './DashboardBoot';
/**
* Dashboard provider.
*/
export default function DashboardProvider({ children }) {
const { isLoading } = useDashboardBoot();
const { isLoading } = useDashboardMetaBoot();
// Avoid display any dashboard component before complete booting.
if (isLoading) {

View File

@@ -2,7 +2,8 @@ import React, { useMemo, useCallback } from 'react';
import moment from 'moment';
import intl from 'react-intl-universal';
import { If, FormattedMessage as T } from 'components';
import If from '../Utils/If';
import { FormattedMessage as T } from '../FormattedMessage';
import {
FinancialSheetRoot,
FinancialSheetFooterCurrentTime,

View File

@@ -2,7 +2,8 @@ import React from 'react';
import styled from 'styled-components';
import { Align } from 'common';
import { SkeletonText, DataTable } from 'components';
import { SkeletonText } from 'components';
import DataTable from '../../components/DataTable'
import TableSkeletonRows from 'components/Datatable/TableSkeletonRows';
import TableSkeletonHeader from 'components/Datatable/TableHeaderSkeleton';

View File

@@ -0,0 +1,9 @@
import styled from 'styled-components';
import DataTable from '../DataTable';
export const ReportDataTable = styled(DataTable)`
.table .tbody .tr.no-results:last-of-type .td {
border-bottom: 1px solid #ddd;
}
`;

View File

@@ -1,2 +1,3 @@
export * from './FinancialSheet';
export * from './FinancialSheetSkeleton';
export * from './FinancialSheetSkeleton';
export * from './ReportDataTable';

View File

@@ -28,7 +28,7 @@ export default function Sidebar({ dashboardContentRef }) {
* @returns {React.JSX}
*/
function SidebarFooterVersion() {
const { REACT_APP_VERSION: VERSION } = process.env;
const { VERSION } = process.env;
if (!VERSION) {
return null;

View File

@@ -1,7 +1,7 @@
import React from 'react';
import * as R from 'ramda';
import { ButtonLink } from 'components';
import { ButtonLink } from '../Button';
import withDrawerActions from 'containers/Drawer/withDrawerActions';
function VendorDrawerLinkComponent({

View File

@@ -70,6 +70,20 @@ export const financialReportMenus = [
subject: AbilitySubject.Report,
ability: ReportsAction.READ_AP_AGING_SUMMARY,
},
{
title: <T id={'report.balance_sheet_comparison.title'} />,
desc: <T id={'report.balance_sheet_comparison.desc'} />,
link: 'financial-reports/balance-sheet?previousYear=true&previousYearAmountChange=true&previousYearPercentageChange=true',
subject: AbilitySubject.Report,
ability: ReportsAction.READ_BALANCE_SHEET,
},
{
title: <T id={'report.profit_loss_sheet_comparison.title'} />,
desc: <T id={'report.profit_loss_sheet_comparison.desc'} />,
link: '/financial-reports/profit-loss-sheet?previousYear=true&previousYearAmountChange=true&previousYearPercentageChange=true',
subject: AbilitySubject.Report,
ability: ReportsAction.READ_PROFIT_LOSS,
},
],
},
];

View File

@@ -57,9 +57,7 @@ function BillTransactionDeleteAlert({
loading={isLoading}
>
<p>
<T
id={`Once your delete this located landed cost, you won't be able to restore it later, Are your sure you want to delete this transaction?`}
/>
<T id={`landed_cost.once_your_delete_this_located_landed_cost`} />
</p>
</Alert>
);

View File

@@ -79,6 +79,10 @@ export const handleCashFlowTransactionType = (reference, openDrawer) => {
return openDrawer('refund-vendor-detail-drawer', {
refundTransactionId: reference.reference_id,
});
case 'InventoryAdjustment':
return openDrawer('inventory-adjustment-drawer', {
inventoryId: reference.reference_id,
});
default:
return openDrawer('cashflow-transaction-drawer', {

View File

@@ -37,7 +37,7 @@ function AllocateLandedCostFloatingActions({
<DialogFooterActions alignment={'left'}>
{costTransactionEntry && (
<UnallocatedAmount>
Unallocated cost Amount:{' '}
<T id={'landed_cost.dialog.label_unallocated_cost_amount'}/>
<strong>{formattedUnallocatedCostAmount}</strong>
</UnallocatedAmount>
)}

View File

@@ -42,7 +42,10 @@ function AllocateLandedCostForm({
.map((entry) => transformToForm(entry, defaultInitialValues.items[0]));
if (entries.length <= 0) {
AppToaster.show({ message: 'Something wrong!', intent: Intent.DANGER });
AppToaster.show({
message: intl.get('something_wrong'),
intent: Intent.DANGER,
});
return;
}
const form = {
@@ -69,13 +72,14 @@ function AllocateLandedCostForm({
)
) {
AppToaster.show({
message:
'The total located cost is bigger than the transaction line.',
message: intl.get(
'landed_cost.error.the_total_located_cost_is_bigger_than_the_transaction_line',
),
intent: Intent.DANGER,
});
} else {
AppToaster.show({
message: 'Something went wrong!',
message: intl.get('something_went_wrong'),
intent: Intent.DANGER,
});
}

View File

@@ -64,6 +64,7 @@ function BillPaymentTransactions({
}}
styleName={TableStyle.Constrant}
TableLoadingRenderer={TableSkeletonRows}
sticky={true}
/>
);
}

View File

@@ -66,6 +66,7 @@ function EstimatePaymentTransactions({
}}
styleName={TableStyle.Constrant}
TableLoadingRenderer={TableSkeletonRows}
sticky={true}
/>
);
}

View File

@@ -68,6 +68,7 @@ function InvoicePaymentTransactions({
}}
styleName={TableStyle.Constrant}
TableLoadingRenderer={TableSkeletonRows}
sticky={true}
/>
);
}

View File

@@ -66,6 +66,7 @@ function ReceiptPaymentTransactions({
}}
styleName={TableStyle.Constrant}
TableLoadingRenderer={TableSkeletonRows}
sticky={true}
/>
);
}

View File

@@ -4,6 +4,7 @@ import { Formik, Form } from 'formik';
import * as Yup from 'yup';
import moment from 'moment';
import { Tabs, Tab, Button, Intent } from '@blueprintjs/core';
import styled from 'styled-components';
import FinancialStatementHeader from 'containers/FinancialStatements/FinancialStatementHeader';
import APAgingSummaryHeaderGeneral from './APAgingSummaryHeaderGeneral';
@@ -11,8 +12,8 @@ import APAgingSummaryHeaderGeneral from './APAgingSummaryHeaderGeneral';
import withAPAgingSummary from './withAPAgingSummary';
import withAPAgingSummaryActions from './withAPAgingSummaryActions';
import { compose } from 'utils';
import { transformToForm } from '../../../utils';
import { compose } from 'utils';
/**
* AP Aging Summary Report - Drawer Header.
@@ -72,7 +73,7 @@ function APAgingSummaryHeader({
};
return (
<FinancialStatementHeader
<APAgingDrawerHeader
isOpen={isFilterDrawerOpen}
drawerProps={{ onClose: handleDrawerClose }}
>
@@ -99,7 +100,7 @@ function APAgingSummaryHeader({
</div>
</Form>
</Formik>
</FinancialStatementHeader>
</APAgingDrawerHeader>
);
}
@@ -109,3 +110,9 @@ export default compose(
isFilterDrawerOpen: APAgingSummaryFilterDrawer,
})),
)(APAgingSummaryHeader);
const APAgingDrawerHeader = styled(FinancialStatementHeader)`
.bp3-drawer {
max-height: 520px;
}
`;

View File

@@ -2,7 +2,7 @@ import React from 'react';
import intl from 'react-intl-universal';
import styled from 'styled-components';
import { DataTable, FinancialSheet } from 'components';
import { ReportDataTable, FinancialSheet } from 'components';
import { TableStyle } from 'common';
import { useAPAgingSummaryContext } from './APAgingSummaryProvider';
@@ -29,7 +29,6 @@ export default function APAgingSummaryTable({
return (
<FinancialSheet
companyName={organizationName}
name={'payable-aging-summary'}
sheetType={intl.get('payable_aging_summary')}
asDate={new Date()}
loading={isAPAgingLoading}
@@ -46,7 +45,7 @@ export default function APAgingSummaryTable({
);
}
const APAgingSummaryDataTable = styled(DataTable)`
const APAgingSummaryDataTable = styled(ReportDataTable)`
.table {
.tbody .tr {
.td {

View File

@@ -4,6 +4,7 @@ import { Formik, Form } from 'formik';
import * as Yup from 'yup';
import moment from 'moment';
import { Tabs, Tab, Button, Intent } from '@blueprintjs/core';
import styled from 'styled-components';
import FinancialStatementHeader from 'containers/FinancialStatements/FinancialStatementHeader';
import ARAgingSummaryHeaderGeneral from './ARAgingSummaryHeaderGeneral';
@@ -57,14 +58,12 @@ function ARAgingSummaryHeader({
},
defaultValues,
);
// Handle form submit.
const handleSubmit = (values, { setSubmitting }) => {
onSubmitFilter(values);
toggleFilterDrawerDisplay(false);
setSubmitting(false);
};
// Handle cancel button click.
const handleCancelClick = () => {
toggleFilterDrawerDisplay(false);
@@ -75,7 +74,7 @@ function ARAgingSummaryHeader({
};
return (
<FinancialStatementHeader
<ARAgingDrawerHeader
isOpen={isFilterDrawerOpen}
drawerProps={{ onClose: handleDrawerClose }}
>
@@ -103,7 +102,7 @@ function ARAgingSummaryHeader({
</div>
</Form>
</Formik>
</FinancialStatementHeader>
</ARAgingDrawerHeader>
);
}
@@ -113,3 +112,9 @@ export default compose(
isFilterDrawerOpen: ARAgingSummaryFilterDrawer,
})),
)(ARAgingSummaryHeader);
const ARAgingDrawerHeader = styled(FinancialStatementHeader)`
.bp3-drawer {
max-height: 520px;
}
`;

View File

@@ -2,7 +2,7 @@ import React from 'react';
import intl from 'react-intl-universal';
import styled from 'styled-components';
import { DataTable, FinancialSheet } from 'components';
import { ReportDataTable, FinancialSheet } from 'components';
import { TableStyle } from 'common';
import { useARAgingSummaryContext } from './ARAgingSummaryProvider';
@@ -26,7 +26,6 @@ export default function ReceivableAgingSummaryTable({
return (
<FinancialSheet
companyName={organizationName}
name={'receivable-aging-summary'}
sheetType={intl.get('receivable_aging_summary')}
asDate={new Date()}
loading={isARAgingLoading}
@@ -43,7 +42,7 @@ export default function ReceivableAgingSummaryTable({
);
}
const ARAgingSummaryDataTable = styled(DataTable)`
const ARAgingSummaryDataTable = styled(ReportDataTable)`
.table {
.tbody .tr {
.td {

View File

@@ -1,8 +1,10 @@
import React from 'react';
import { Tabs, Tab, Button, Intent } from '@blueprintjs/core';
import { FormattedMessage as T } from 'components';
import moment from 'moment';
import { Formik, Form } from 'formik';
import styled from 'styled-components';
import { FormattedMessage as T } from 'components';
import withBalanceSheet from './withBalanceSheet';
import withBalanceSheetActions from './withBalanceSheetActions';
@@ -64,9 +66,11 @@ function BalanceSheetHeader({
};
return (
<FinancialStatementHeader
<BalanceSheetFinancialHeader
isOpen={balanceSheetDrawerFilter}
drawerProps={{ onClose: handleDrawerClose }}
drawerProps={{
onClose: handleDrawerClose,
}}
>
<Formik
initialValues={initialValues}
@@ -97,7 +101,7 @@ function BalanceSheetHeader({
</div>
</Form>
</Formik>
</FinancialStatementHeader>
</BalanceSheetFinancialHeader>
);
}
@@ -107,3 +111,9 @@ export default compose(
})),
withBalanceSheetActions,
)(BalanceSheetHeader);
const BalanceSheetFinancialHeader = styled(FinancialStatementHeader)`
.bp3-drawer {
max-height: 520px;
}
`;

View File

@@ -2,7 +2,7 @@ import React from 'react';
import styled from 'styled-components';
import intl from 'react-intl-universal';
import { DataTable, FinancialSheet } from 'components';
import { ReportDataTable, FinancialSheet } from 'components';
import { useBalanceSheetContext } from './BalanceSheetProvider';
@@ -56,7 +56,7 @@ export default function BalanceSheetTable({
);
}
const BalanceSheetDataTable = styled(DataTable)`
const BalanceSheetDataTable = styled(ReportDataTable)`
.table {
.tbody .tr {
.td {
@@ -81,7 +81,7 @@ const BalanceSheetDataTable = styled(DataTable)`
}
&.row_type--TOTAL.row-id--ASSETS,
&.row_type--TOTAL.row-id--LIABILITY_EQUITY {
.td{
.td {
border-bottom: 3px double #000;
}
}

View File

@@ -17,6 +17,7 @@ const accountNameMapper = (column) => ({
textOverview: true,
width: 400,
disableSortBy: true,
sticky: Align.Left,
});
/**

View File

@@ -3,6 +3,8 @@ import * as Yup from 'yup';
import { Formik, Form } from 'formik';
import moment from 'moment';
import { Tabs, Tab, Button, Intent } from '@blueprintjs/core';
import styled from 'styled-components';
import { FormattedMessage as T } from 'components';
import FinancialStatementHeader from 'containers/FinancialStatements/FinancialStatementHeader';
@@ -30,7 +32,6 @@ function CustomersBalanceSummaryHeader({
const validationSchema = Yup.object().shape({
asDate: Yup.date().required().label('asDate'),
});
// Default form values.
const defaultValues = {
...pageFilter,
@@ -47,21 +48,19 @@ function CustomersBalanceSummaryHeader({
},
defaultValues,
);
// handle form submit.
const handleSubmit = (values, { setSubmitting }) => {
onSubmitFilter(values);
toggleCustomerBalanceFilterDrawer(false);
setSubmitting(false);
};
// handle close drawer.
const handleDrawerClose = () => {
toggleCustomerBalanceFilterDrawer(false);
};
return (
<FinancialStatementHeader
<CustomerBalanceDrawerHeader
isOpen={customersBalanceDrawerFilter}
drawerProps={{ onClose: handleDrawerClose }}
>
@@ -89,7 +88,7 @@ function CustomersBalanceSummaryHeader({
</div>
</Form>
</Formik>
</FinancialStatementHeader>
</CustomerBalanceDrawerHeader>
);
}
@@ -99,3 +98,9 @@ export default compose(
})),
withCustomersBalanceSummaryActions,
)(CustomersBalanceSummaryHeader);
const CustomerBalanceDrawerHeader = styled(FinancialStatementHeader)`
.bp3-drawer {
max-height: 450px;
}
`;

View File

@@ -1,15 +1,17 @@
import React from 'react';
import intl from 'react-intl-universal';
import styled from 'styled-components';
import { DataTable, FinancialSheet } from 'components';
import { ReportDataTable, FinancialSheet } from 'components';
import { useCustomersBalanceSummaryContext } from './CustomersBalanceSummaryProvider';
import { useCustomersSummaryColumns } from './components';
import { TableStyle } from 'common';
import { tableRowTypesToClassnames } from 'utils';
/**
* customers balance summary table.
* Customers balance summary table.
*/
export default function CustomersBalanceSummaryTable({
// #ownProps
@@ -19,6 +21,7 @@ export default function CustomersBalanceSummaryTable({
CustomerBalanceSummary: { table },
} = useCustomersBalanceSummaryContext();
// Retrieves the customers summary columns.
const columns = useCustomersSummaryColumns();
return (
@@ -27,12 +30,36 @@ export default function CustomersBalanceSummaryTable({
sheetType={intl.get('customers_balance_summary')}
asDate={new Date()}
>
<DataTable
<CustomerBalanceDataTable
columns={columns}
data={table.data}
rowClassNames={tableRowTypesToClassnames}
noInitialFetch={true}
styleName={TableStyle.Constrant}
/>
</FinancialSheet>
);
}
const CustomerBalanceDataTable = styled(ReportDataTable)`
.table {
.tbody {
.tr:not(.no-results) {
.td {
border-bottom: 0;
padding-top: 0.4rem;
padding-bottom: 0.4rem;
}
&.row_type--TOTAL {
font-weight: 500;
.td {
border-top: 1px solid #bbb;
border-bottom: 3px double #333;
}
}
}
}
}
`;

View File

@@ -6,6 +6,8 @@ import { If } from 'components';
import FinancialLoadingBar from '../FinancialLoadingBar';
import { useCustomersBalanceSummaryContext } from './CustomersBalanceSummaryProvider';
import { Align } from 'common';
/**
* Retrieve customers balance summary columns.
*/
@@ -37,6 +39,7 @@ const totalColumnAccessor = () => ({
accessor: 'cells[1].value',
className: 'total',
width: 140,
align: Align.Right,
});
/**
@@ -47,6 +50,7 @@ const percentageColumnAccessor = () => ({
accessor: 'cells[2].value',
className: 'total',
width: 140,
align: Align.Right,
});
const dynamicColumns = (columns) => {
@@ -54,7 +58,10 @@ const dynamicColumns = (columns) => {
R.compose(
R.when(R.pathEq(['key'], 'name'), accountNameColumnAccessor),
R.when(R.pathEq(['key'], 'total'), totalColumnAccessor),
R.when(R.pathEq(['key'], 'percentage_of_column'), percentageColumnAccessor),
R.when(
R.pathEq(['key'], 'percentage_of_column'),
percentageColumnAccessor,
),
),
)(columns);
};

View File

@@ -5,6 +5,7 @@ import intl from 'react-intl-universal';
import moment from 'moment';
import * as Yup from 'yup';
import { Formik, Form } from 'formik';
import styled from 'styled-components';
import FinancialStatementHeader from 'containers/FinancialStatements/FinancialStatementHeader';
import CustomersTransactionsHeaderGeneralPanel from './CustomersTransactionsHeaderGeneralPanel';
@@ -67,7 +68,7 @@ function CustomersTransactionsHeader({
};
return (
<FinancialStatementHeader
<CustomerTransactionsDrawerHeader
isOpen={isFilterDrawerOpen}
drawerProps={{ onClose: handleDrawerClose }}
>
@@ -95,7 +96,7 @@ function CustomersTransactionsHeader({
</div>
</Form>
</Formik>
</FinancialStatementHeader>
</CustomerTransactionsDrawerHeader>
);
}
@@ -105,3 +106,9 @@ export default compose(
})),
withCustomersTransactionsActions,
)(CustomersTransactionsHeader);
const CustomerTransactionsDrawerHeader = styled(FinancialStatementHeader)`
.bp3-drawer {
max-height: 450px;
}
`;

View File

@@ -58,10 +58,10 @@ const CustomersTransactionsDataTable = styled(DataTable)`
.table {
.tbody {
.tr .td {
padding-top: 0.2rem;
padding-bottom: 0.2rem;
padding-top: 0.36rem;
padding-bottom: 0.36rem;
}
.tr:not(.no-results) .td {
.tr:not(.no-results) .td:not(:first-of-type) {
border-left: 1px solid #ececec;
}
.tr:last-child .td {
@@ -73,6 +73,11 @@ const CustomersTransactionsDataTable = styled(DataTable)`
.td {
&.customer_name {
font-weight: 500;
.cell-inner {
white-space: nowrap;
position: relative;
}
}
}
&:not(:first-child).is-expanded .td {

View File

@@ -3,14 +3,13 @@ import intl from 'react-intl-universal';
import { If } from 'components';
import { useCustomersTransactionsContext } from './CustomersTransactionsProvider';
import FinancialLoadingBar from '../FinancialLoadingBar';
import { getForceWidth, getColumnWidth } from 'utils';
import { getColumnWidth } from 'utils';
import { Align } from 'common';
/**
* Retrieve customers transactions columns.
*/
export const useCustomersTransactionsColumns = () => {
const {
customersTransactions: { tableRows },
@@ -20,16 +19,7 @@ export const useCustomersTransactionsColumns = () => {
() => [
{
Header: intl.get('customer_name'),
accessor: ({ cells }) => {
return (
<span
className={'force-width'}
style={{ minWidth: getForceWidth(cells[0].value) }}
>
{cells[0].value}
</span>
);
},
accessor: 'cells[0].value',
className: 'customer_name',
},
{

View File

@@ -3,10 +3,15 @@ import classNames from 'classnames';
import { Position, Drawer } from '@blueprintjs/core';
import 'style/containers/FinancialStatements/DrawerHeader.scss';
/**
* Financial statement header.
* @returns {JSX.Element}
*/
export default function FinancialStatementHeader({
children,
isOpen,
drawerProps,
className,
}) {
const timeoutRef = React.useRef();
const [isDrawerOpen, setIsDrawerOpen] = useState(false);
@@ -42,6 +47,7 @@ export default function FinancialStatementHeader({
{
'is-hidden': !isDrawerOpen,
},
className,
)}
>
<Drawer

View File

@@ -3,6 +3,8 @@ import moment from 'moment';
import * as Yup from 'yup';
import { Formik, Form } from 'formik';
import { Tabs, Tab, Button, Intent } from '@blueprintjs/core';
import styled from 'styled-components';
import { FormattedMessage as T } from 'components';
import FinancialStatementHeader from 'containers/FinancialStatements/FinancialStatementHeader';
@@ -68,7 +70,7 @@ function GeneralLedgerHeader({
};
return (
<FinancialStatementHeader
<GeneralLedgerDrawerHeader
isOpen={isFilterDrawerOpen}
drawerProps={{ onClose: handleDrawerClose }}
>
@@ -97,7 +99,7 @@ function GeneralLedgerHeader({
</div>
</Form>
</Formik>
</FinancialStatementHeader>
</GeneralLedgerDrawerHeader>
);
}
@@ -107,3 +109,9 @@ export default compose(
})),
withGeneralLedgerActions,
)(GeneralLedgerHeader);
const GeneralLedgerDrawerHeader = styled(FinancialStatementHeader)`
.bp3-drawer {
max-height: 520px;
}
`;

View File

@@ -4,7 +4,7 @@ import styled from 'styled-components';
import { defaultExpanderReducer, tableRowTypesToClassnames } from 'utils';
import { FinancialSheet, DataTable } from 'components';
import { FinancialSheet, ReportDataTable } from 'components';
import TableVirtualizedListRows from 'components/Datatable/TableVirtualizedRows';
import TableFastCell from 'components/Datatable/TableFastCell';
@@ -66,7 +66,7 @@ export default function GeneralLedgerTable({ companyName }) {
);
}
const GeneralLedgerDataTable = styled(DataTable)`
const GeneralLedgerDataTable = styled(ReportDataTable)`
.tbody {
.tr .td {
padding-top: 0.2rem;
@@ -78,7 +78,7 @@ const GeneralLedgerDataTable = styled(DataTable)`
}
}
.tr:not(.no-results) .td {
.tr:not(.no-results) .td:not(:first-of-type) {
border-left: 1px solid #ececec;
}
.tr:last-child .td {
@@ -90,13 +90,13 @@ const GeneralLedgerDataTable = styled(DataTable)`
.td {
&.date {
font-weight: 500;
}
&.name {
border-left-color: transparent;
.cell-inner {
white-space: nowrap;
position: relative;
}
}
}
&:not(:first-child).is-expanded .td {
border-top: 1px solid #ddd;
}
@@ -108,7 +108,6 @@ const GeneralLedgerDataTable = styled(DataTable)`
font-weight: 500;
}
}
&--CLOSING_BALANCE {
.name {
font-weight: 500;

View File

@@ -2,7 +2,7 @@ import React from 'react';
import intl from 'react-intl-universal';
import { Button } from '@blueprintjs/core';
import { Icon, If } from 'components';
import { ForceWidth, FormattedMessage as T } from 'components';
import { FormattedMessage as T } from 'components';
import { getColumnWidth } from 'utils';
import { useGeneralLedgerContext } from './GeneralLedgerProvider';
@@ -23,12 +23,7 @@ export function useGeneralLedgerTableColumns() {
() => [
{
Header: intl.get('date'),
accessor: (row) => {
if (row.rowType === 'ACCOUNT_ROW') {
return <ForceWidth children={row.date} />;
}
return row.date;
},
accessor: 'date',
className: 'date',
width: 120,
},

View File

@@ -3,8 +3,10 @@ import * as Yup from 'yup';
import moment from 'moment';
import { Formik, Form } from 'formik';
import { Tabs, Tab, Button, Intent } from '@blueprintjs/core';
import { FormattedMessage as T } from 'components';
import intl from 'react-intl-universal';
import styled from 'styled-components';
import { FormattedMessage as T } from 'components';
import FinancialStatementHeader from 'containers/FinancialStatements/FinancialStatementHeader';
import InventoryItemDetailsHeaderGeneralPanel from './InventoryItemDetailsHeaderGeneralPanel';
@@ -35,24 +37,23 @@ function InventoryItemDetailsHeader({
};
// Filter form initial values.
const initialValues = transformToForm({
...pageFilter,
fromDate: moment(pageFilter.fromDate).toDate(),
toDate: moment(pageFilter.toDate).toDate(),
}, defaultValues);
const initialValues = transformToForm(
{
...pageFilter,
fromDate: moment(pageFilter.fromDate).toDate(),
toDate: moment(pageFilter.toDate).toDate(),
},
defaultValues,
);
// Validation schema.
const validationSchema = Yup.object().shape({
fromDate: Yup.date()
.required()
.label(intl.get('fromDate')),
fromDate: Yup.date().required().label(intl.get('fromDate')),
toDate: Yup.date()
.min(Yup.ref('fromDate'))
.required()
.label(intl.get('toDate')),
});
;
// Handle form submit.
const handleSubmit = (values, { setSubmitting }) => {
onSubmitFilter(values);
@@ -61,10 +62,12 @@ function InventoryItemDetailsHeader({
};
// Handle drawer close action.
const handleDrawerClose = () => { toggleFilterDrawer(false); };
const handleDrawerClose = () => {
toggleFilterDrawer(false);
};
return (
<FinancialStatementHeader
<InventoryItemDetailsDrawerHeader
isOpen={isFilterDrawerOpen}
drawerProps={{ onClose: handleDrawerClose }}
>
@@ -91,7 +94,7 @@ function InventoryItemDetailsHeader({
</div>
</Form>
</Formik>
</FinancialStatementHeader>
</InventoryItemDetailsDrawerHeader>
);
}
@@ -101,3 +104,9 @@ export default compose(
})),
withInventoryItemDetailsActions,
)(InventoryItemDetailsHeader);
const InventoryItemDetailsDrawerHeader = styled(FinancialStatementHeader)`
.bp3-drawer {
max-height: 400px;
}
`;

View File

@@ -2,12 +2,11 @@ import React, { useMemo } from 'react';
import intl from 'react-intl-universal';
import styled from 'styled-components';
import { DataTable, FinancialSheet } from 'components';
import { ReportDataTable, FinancialSheet } from 'components';
import { useInventoryItemDetailsColumns } from './components';
import { useInventoryItemDetailsContext } from './InventoryItemDetailsProvider';
import { defaultExpanderReducer, tableRowTypesToClassnames } from 'utils';
import { TableStyle } from 'common';
/**
@@ -37,6 +36,7 @@ export function InventoryItemDetailsTable({
loading={isInventoryItemDetailsLoading}
fromDate={query.from_date}
toDate={query.to_date}
fullWidth={true}
>
<InventoryItemDetailsDataTable
columns={columns}
@@ -53,27 +53,15 @@ export function InventoryItemDetailsTable({
);
}
const InventoryItemDetailsDataTable = styled(DataTable)`
const InventoryItemDetailsDataTable = styled(ReportDataTable)`
.table {
.tbody {
.tr .td {
padding-top: 0.2rem;
padding-bottom: 0.2rem;
border-top-color: transparent;
border-bottom-color: transparent;
&.date {
> div {
display: flex;
}
span.force-width {
position: relative;
}
}
padding-top: 0.3rem;
padding-bottom: 0.3rem;
}
.tr:not(.no-results) .td {
.tr:not(.no-results) .td:not(:first-of-type) {
border-left: 1px solid #ececec;
}
@@ -87,8 +75,14 @@ const InventoryItemDetailsDataTable = styled(DataTable)`
&.transaction_type {
border-left-color: transparent;
}
}
&.date {
.cell-inner {
white-space: nowrap;
position: relative;
}
}
}
&:not(:first-child).is-expanded .td {
border-top: 1px solid #ddd;
}

View File

@@ -1,17 +1,43 @@
import * as R from 'ramda';
import { getColumnWidth } from 'utils';
import { CellForceWidth } from '../../../components';
import { Align } from 'common';
const itemNameOrDateColumn = R.curry((data, index, column) => ({
id: column.key,
key: column.key,
Header: column.label,
accessor: `cells[${index}].value`,
className: column.key,
width: getColumnWidth(data, `cells.${index}.key`, {
minWidth: 130,
magicSpacing: 10,
}),
disableSortBy: true,
}));
const numericColumn = R.curry((data, index, column) => ({
id: column.key,
key: column.key,
Header: column.label,
accessor: `cells[${index}].value`,
className: column.key,
width: getColumnWidth(data, `cells.${index}.key`, {
minWidth: 130,
magicSpacing: 10,
}),
disableSortBy: true,
align: Align.Right,
}));
/**
* columns mapper.
*/
const columnsMapper = (data, index, column) => ({
const columnsMapper = R.curry((data, index, column) => ({
id: column.key,
key: column.key,
Header: column.label,
Cell: CellForceWidth,
accessor: `cells[${index}].value`,
forceWidthAccess: `cells[0].value`,
className: column.key,
width: getColumnWidth(data, `cells.${index}.key`, {
minWidth: 130,
@@ -19,7 +45,7 @@ const columnsMapper = (data, index, column) => ({
}),
disableSortBy: true,
textOverview: true,
});
}));
/**
* Inventory item details columns.
@@ -27,7 +53,17 @@ const columnsMapper = (data, index, column) => ({
export const dynamicColumns = (columns, data) => {
const mapper = (column, index) => {
return R.compose(
R.when(R.pathEq(['key']), R.curry(columnsMapper)(data, index)),
R.cond([
[R.pathEq(['key'], 'date'), itemNameOrDateColumn(data, index)],
[R.pathEq(['key'], 'running_quantity'), numericColumn(data, index)],
[R.pathEq(['key'], 'profit_margin'), numericColumn(data, index)],
[R.pathEq(['key'], 'running_value'), numericColumn(data, index)],
[R.pathEq(['key'], 'quantity'), numericColumn(data, index)],
[R.pathEq(['key'], 'rate'), numericColumn(data, index)],
[R.pathEq(['key'], 'total'), numericColumn(data, index)],
[R.pathEq(['key'], 'value'), numericColumn(data, index)],
[R.T, columnsMapper(data, index)],
]),
)(column);
};
return columns.map(mapper);

View File

@@ -1,9 +1,11 @@
import React from 'react';
import * as Yup from 'yup';
import moment from 'moment';
import { FormattedMessage as T } from 'components';
import { Formik, Form } from 'formik';
import { Tabs, Tab, Button, Intent } from '@blueprintjs/core';
import styled from 'styled-components';
import { FormattedMessage as T } from 'components';
import FinancialStatementHeader from 'containers/FinancialStatements/FinancialStatementHeader';
import InventoryValuationHeaderGeneralPanel from './InventoryValuationHeaderGeneralPanel';
@@ -38,11 +40,14 @@ function InventoryValuationHeader({
itemsIds: [],
};
// Initial values.
const initialValues = transformToForm({
...pageFilter,
...defaultValues,
asDate: moment(pageFilter.asDate).toDate(),
}, defaultValues);
const initialValues = transformToForm(
{
...pageFilter,
...defaultValues,
asDate: moment(pageFilter.asDate).toDate(),
},
defaultValues,
);
// Handle the form of header submit.
const handleSubmit = (values, { setSubmitting }) => {
@@ -62,7 +67,7 @@ function InventoryValuationHeader({
};
return (
<FinancialStatementHeader
<InventoryValuationDrawerHeader
isOpen={isFilterDrawerOpen}
drawerProps={{ onClose: handleDrawerClose }}
>
@@ -89,7 +94,7 @@ function InventoryValuationHeader({
</div>
</Form>
</Formik>
</FinancialStatementHeader>
</InventoryValuationDrawerHeader>
);
}
@@ -99,3 +104,9 @@ export default compose(
})),
withInventoryValuationActions,
)(InventoryValuationHeader);
const InventoryValuationDrawerHeader = styled(FinancialStatementHeader)`
.bp3-drawer {
max-height: 450px;
}
`;

View File

@@ -2,7 +2,7 @@ import React from 'react';
import intl from 'react-intl-universal';
import styled from 'styled-components';
import { DataTable, FinancialSheet } from 'components';
import { ReportDataTable, FinancialSheet } from 'components';
import { useInventoryValuationContext } from './InventoryValuationProvider';
import { useInventoryValuationTableColumns } from './components';
@@ -54,7 +54,7 @@ const InventoryValuationSheet = styled(FinancialSheet)`
min-width: 850px;
`;
const InventoryValuationDataTable = styled(DataTable)`
const InventoryValuationDataTable = styled(ReportDataTable)`
.table {
.tbody {
.tr .td {

View File

@@ -3,6 +3,8 @@ import moment from 'moment';
import { Formik, Form } from 'formik';
import { Tab, Tabs, Button, Intent } from '@blueprintjs/core';
import * as Yup from 'yup';
import styled from 'styled-components';
import { FormattedMessage as T } from 'components';
import JournalSheetHeaderGeneral from './JournalSheetHeaderGeneral';
@@ -55,7 +57,7 @@ function JournalHeader({
};
return (
<FinancialStatementHeader
<JournalDrawerHeader
isOpen={journalSheetDrawerFilter}
drawerProps={{ onClose: handleDrawerClose }}
>
@@ -83,7 +85,7 @@ function JournalHeader({
</div>
</Form>
</Formik>
</FinancialStatementHeader>
</JournalDrawerHeader>
);
}
@@ -93,3 +95,9 @@ export default compose(
})),
withJournalActions,
)(JournalHeader);
const JournalDrawerHeader = styled(FinancialStatementHeader)`
.bp3-drawer {
max-height: 350px;
}
`;

View File

@@ -2,7 +2,7 @@ import React, { useMemo } from 'react';
import intl from 'react-intl-universal';
import styled from 'styled-components';
import { DataTable, FinancialSheet } from 'components';
import { ReportDataTable, FinancialSheet } from 'components';
import TableVirtualizedListRows from 'components/Datatable/TableVirtualizedRows';
import TableFastCell from 'components/Datatable/TableFastCell';
@@ -60,7 +60,7 @@ export function JournalTable({ companyName }) {
);
}
const JournalDataTable = styled(DataTable)`
const JournalDataTable = styled(ReportDataTable)`
.table {
.tbody {
.tr:not(.no-results) .td {

View File

@@ -3,6 +3,7 @@ import moment from 'moment';
import { Formik, Form } from 'formik';
import * as R from 'ramda';
import { Tabs, Tab, Button, Intent } from '@blueprintjs/core';
import styled from 'styled-components';
import { FormattedMessage as T } from 'components';
import FinancialStatementHeader from 'containers/FinancialStatements/FinancialStatementHeader';
@@ -52,8 +53,8 @@ function ProfitLossHeader({
toggleFilterDrawer(false);
};
return (
<FinancialStatementHeader
return (
<ProfitLossSheetHeader
isOpen={profitLossDrawerFilter}
drawerProps={{ onClose: handleDrawerClose }}
>
@@ -86,7 +87,7 @@ function ProfitLossHeader({
</div>
</Form>
</Formik>
</FinancialStatementHeader>
</ProfitLossSheetHeader>
);
}
@@ -96,3 +97,9 @@ export default R.compose(
})),
withProfitLossActions,
)(ProfitLossHeader);
const ProfitLossSheetHeader = styled(FinancialStatementHeader)`
.bp3-drawer {
max-height: 520px;
}
`;

View File

@@ -2,7 +2,11 @@ import React from 'react';
import styled from 'styled-components';
import { TableStyle } from 'common';
import { DataTable, FinancialSheet, FormattedMessage as T } from 'components';
import {
ReportDataTable,
FinancialSheet,
FormattedMessage as T,
} from 'components';
import { tableRowTypesToClassnames, defaultExpanderReducer } from 'utils';
import { useProfitLossSheetColumns } from './hooks';
@@ -49,7 +53,7 @@ export default function ProfitLossSheetTable({
);
}
const ProfitLossDataTable = styled(DataTable)`
const ProfitLossDataTable = styled(ReportDataTable)`
.table {
.tbody .tr {
.td {

View File

@@ -1,10 +1,12 @@
import React from 'react';
import * as Yup from 'yup';
import moment from 'moment';
import { FormattedMessage as T } from 'components';
import intl from 'react-intl-universal';
import { Formik, Form } from 'formik';
import { Tabs, Tab, Button, Intent } from '@blueprintjs/core';
import styled from 'styled-components';
import { FormattedMessage as T } from 'components';
import FinancialStatementHeader from 'containers/FinancialStatements/FinancialStatementHeader';
import PurchasesByItemsGeneralPanel from './PurchasesByItemsGeneralPanel';
@@ -36,7 +38,6 @@ function PurchasesByItemsHeader({
.required()
.label(intl.get('to_date')),
});
// Default form values.
const defaultValues = {
...pageFilter,
@@ -68,7 +69,7 @@ function PurchasesByItemsHeader({
};
return (
<FinancialStatementHeader
<PurchasesByItemsDrawerHeader
isOpen={purchasesByItemsDrawerFilter}
drawerProps={{ onClose: handleDrawerClose }}
>
@@ -95,7 +96,7 @@ function PurchasesByItemsHeader({
</div>
</Form>
</Formik>
</FinancialStatementHeader>
</PurchasesByItemsDrawerHeader>
);
}
@@ -105,3 +106,9 @@ export default compose(
})),
withPurchasesByItemsActions,
)(PurchasesByItemsHeader);
const PurchasesByItemsDrawerHeader = styled(FinancialStatementHeader)`
.bp3-drawer {
max-height: 450px;
}
`;

View File

@@ -2,7 +2,7 @@ import React from 'react';
import intl from 'react-intl-universal';
import styled from 'styled-components';
import { DataTable, FinancialSheet } from 'components';
import { ReportDataTable, FinancialSheet } from 'components';
import { usePurchaseByItemsContext } from './PurchasesByItemsProvider';
import { usePurchasesByItemsTableColumns } from './components';
@@ -50,7 +50,7 @@ const PurchasesByItemsSheet = styled(FinancialSheet)`
min-width: 850px;
`;
const PurchasesByItemsDataTable = styled(DataTable)`
const PurchasesByItemsDataTable = styled(ReportDataTable)`
.table {
.tbody {
.tr .td {

View File

@@ -1,10 +1,12 @@
import React from 'react';
import * as Yup from 'yup';
import moment from 'moment';
import { FormattedMessage as T } from 'components';
import intl from 'react-intl-universal';
import { Formik, Form } from 'formik';
import { Tabs, Tab, Button, Intent } from '@blueprintjs/core';
import styled from 'styled-components';
import { FormattedMessage as T } from 'components';
import FinancialStatementHeader from 'containers/FinancialStatements/FinancialStatementHeader';
import SalesByItemsHeaderGeneralPanel from './SalesByItemsHeaderGeneralPanel';
@@ -61,7 +63,7 @@ function SalesByItemsHeader({
};
return (
<FinancialStatementHeader
<SalesByItemsDrawerHeader
isOpen={salesByItemsDrawerFilter}
drawerProps={{ onClose: handleDrawerClose }}
>
@@ -88,7 +90,7 @@ function SalesByItemsHeader({
</div>
</Form>
</Formik>
</FinancialStatementHeader>
</SalesByItemsDrawerHeader>
);
}
@@ -98,3 +100,9 @@ export default compose(
})),
withSalesByItemsActions,
)(SalesByItemsHeader);
const SalesByItemsDrawerHeader = styled(FinancialStatementHeader)`
.bp3-drawer {
max-height: 450px;
}
`;

View File

@@ -2,7 +2,7 @@ import React from 'react';
import intl from 'react-intl-universal';
import styled from 'styled-components';
import { DataTable, FinancialSheet } from 'components';
import { ReportDataTable, FinancialSheet } from 'components';
import { useSalesByItemsContext } from './SalesByItemProvider';
import { useSalesByItemsTableColumns } from './components';
@@ -52,7 +52,7 @@ const SalesByItemsSheet = styled(FinancialSheet)`
min-width: 850px;
`;
const SalesByItemsDataTable = styled(DataTable)`
const SalesByItemsDataTable = styled(ReportDataTable)`
.table {
.tbody {
.tr .td {

View File

@@ -22,9 +22,6 @@ import { compose } from 'utils';
* Trial balance sheet.
*/
function TrialBalanceSheet({
// #withPreferences
organizationName,
// #withTrialBalanceSheetActions
toggleTrialBalanceFilterDrawer: toggleFilterDrawer,
}) {
@@ -44,7 +41,6 @@ function TrialBalanceSheet({
},
[setFilter],
);
// Handle numebr format form submit.
const handleNumberFormatSubmit = (numberFormat) => {
setFilter({

View File

@@ -1,10 +1,12 @@
import React from 'react';
import * as Yup from 'yup';
import moment from 'moment';
import { FormattedMessage as T } from 'components';
import intl from 'react-intl-universal';
import { Formik, Form } from 'formik';
import intl from 'react-intl-universal';
import { Tabs, Tab, Button, Intent } from '@blueprintjs/core';
import styled from 'styled-components';
import { FormattedMessage as T } from 'components';
import FinancialStatementHeader from 'containers/FinancialStatements/FinancialStatementHeader';
import TrialBalanceSheetHeaderGeneralPanel from './TrialBalanceSheetHeaderGeneralPanel';
@@ -59,13 +61,17 @@ function TrialBalanceSheetHeader({
toggleFilterDrawer(false);
};
// Handle drawer close action.
const handleDrawerClose = () => { toggleFilterDrawer(false); };
const handleDrawerClose = () => {
toggleFilterDrawer(false);
};
// Handle cancel button click.
const handleCancelClick = () => { toggleFilterDrawer(false); };
const handleCancelClick = () => {
toggleFilterDrawer(false);
};
return (
<FinancialStatementHeader
<TrialBalanceSheetDrawerHeader
isOpen={trialBalanceDrawerFilter}
drawerProps={{ onClose: handleDrawerClose }}
>
@@ -93,7 +99,7 @@ function TrialBalanceSheetHeader({
</div>
</Form>
</Formik>
</FinancialStatementHeader>
</TrialBalanceSheetDrawerHeader>
);
}
@@ -103,3 +109,9 @@ export default compose(
})),
withTrialBalanceActions,
)(TrialBalanceSheetHeader);
const TrialBalanceSheetDrawerHeader = styled(FinancialStatementHeader)`
.bp3-drawer {
max-height: 450px;
}
`;

View File

@@ -2,7 +2,7 @@ import React from 'react';
import intl from 'react-intl-universal';
import styled from 'styled-components';
import { DataTable, FinancialSheet } from 'components';
import { ReportDataTable, FinancialSheet } from 'components';
import { useTrialBalanceSheetContext } from './TrialBalanceProvider';
import { useTrialBalanceTableColumns } from './components';
@@ -47,7 +47,7 @@ export default function TrialBalanceSheetTable({ companyName }) {
);
}
const TrialBalanceDataTable = styled(DataTable)`
const TrialBalanceDataTable = styled(ReportDataTable)`
.table {
.tbody {
.tr .td {

View File

@@ -13,6 +13,7 @@ import { VendorBalanceSummaryBody } from './VendorsBalanceSummaryBody';
import withVendorsBalanceSummaryActions from './withVendorsBalanceSummaryActions';
import { TableStyle } from 'common';
import { getDefaultVendorsBalanceQuery } from './utils';
import { compose } from 'utils';

View File

@@ -3,6 +3,8 @@ import * as Yup from 'yup';
import { Formik, Form } from 'formik';
import moment from 'moment';
import { Tabs, Tab, Button, Intent } from '@blueprintjs/core';
import styled from 'styled-components';
import { FormattedMessage as T } from 'components';
import FinancialStatementHeader from 'containers/FinancialStatements/FinancialStatementHeader';
@@ -61,7 +63,7 @@ function VendorsBalanceSummaryHeader({
};
return (
<FinancialStatementHeader
<VendorBalanceDrawerHeader
isOpen={VendorsSummaryFilterDrawer}
drawerProps={{ onClose: handleCancelClick }}
>
@@ -88,7 +90,7 @@ function VendorsBalanceSummaryHeader({
</div>
</Form>
</Formik>
</FinancialStatementHeader>
</VendorBalanceDrawerHeader>
);
}
@@ -98,3 +100,9 @@ export default compose(
})),
withVendorsBalanceSummaryActions,
)(VendorsBalanceSummaryHeader);
const VendorBalanceDrawerHeader = styled(FinancialStatementHeader)`
.bp3-drawer {
max-height: 450px;
}
`;

View File

@@ -2,11 +2,12 @@ import React from 'react';
import intl from 'react-intl-universal';
import styled from 'styled-components';
import { DataTable, FinancialSheet } from 'components';
import { ReportDataTable, FinancialSheet } from 'components';
import { useVendorsBalanceColumns } from './components';
import { useVendorsBalanceSummaryContext } from './VendorsBalanceSummaryProvider';
import { TableStyle } from 'common';
import { tableRowTypesToClassnames } from 'utils';
/**
@@ -34,6 +35,7 @@ export default function VendorsBalanceSummaryTable({
data={table.data}
rowClassNames={tableRowTypesToClassnames}
noInitialFetch={true}
styleName={TableStyle.Constrant}
/>
</VendorBalanceFinancialSheet>
);
@@ -41,7 +43,7 @@ export default function VendorsBalanceSummaryTable({
const VendorBalanceFinancialSheet = styled(FinancialSheet)``;
const VendorBalanceDataTable = styled(DataTable)`
const VendorBalanceDataTable = styled(ReportDataTable)`
.table {
.tbody {
.tr:not(.no-results) {
@@ -51,7 +53,7 @@ const VendorBalanceDataTable = styled(DataTable)`
padding-bottom: 0.4rem;
}
&.row-type--TOTAL {
&.row_type--TOTAL {
font-weight: 500;
.td {

View File

@@ -6,6 +6,8 @@ import { If } from 'components';
import FinancialLoadingBar from '../FinancialLoadingBar';
import { useVendorsBalanceSummaryContext } from './VendorsBalanceSummaryProvider';
import { Align } from 'common';
/**
* Retrieve vendors balance summary columns.
*/
@@ -39,8 +41,8 @@ const percentageColumnAccessor = () => ({
accessor: 'cells[2].value',
className: 'total',
width: 140,
align: 'right',
textOverview: true,
align: Align.Right,
});
/**
@@ -51,8 +53,8 @@ const totalColumnAccessor = () => ({
accessor: 'cells[1].value',
className: 'total',
width: 140,
align: 'right',
textOverview: true,
align: Align.Right,
});
/**

View File

@@ -1,9 +1,10 @@
import React from 'react';
import intl from 'react-intl-universal';
import { If } from 'components';
import { useVendorsTransactionsContext } from './VendorsTransactionsProvider';
import FinancialLoadingBar from '../FinancialLoadingBar';
import { getColumnWidth, getForceWidth } from 'utils';
import { getColumnWidth } from 'utils';
/**
* Retrieve vendors transactions columns.
@@ -17,19 +18,8 @@ export const useVendorsTransactionsColumns = () => {
() => [
{
Header: intl.get('vendor_name'),
accessor: ({ cells }) => {
return (
<span
className={'force-width'}
style={{ minWidth: getForceWidth(cells[0].value) }}
>
{cells[0].value}
</span>
);
},
accessor: 'cells[0].value',
className: 'vendor_name',
// textOverview: true,
// width: 240,
},
{
Header: intl.get('account_name'),

View File

@@ -0,0 +1,15 @@
import React from 'react';
import { T } from 'components';
import { PaymentMethodTabs } from './SubscriptionTabs';
export default ({ formik, title, description }) => {
return (
<section class="billing-plans__section">
<h1 className="title"><T id={'setup.plans.payment_methods.title'} /></h1>
<p className="paragraph"><T id={'setup.plans.payment_methods.description' } /></p>
<PaymentMethodTabs formik={formik} />
</section>
);
};

View File

@@ -1,10 +1,13 @@
import React from 'react';
import * as R from 'ramda';
import 'style/pages/Subscription/BillingPlans.scss';
import BillingPlansInput from './BillingPlansInput';
import BillingPeriodsInput from './BillingPeriodsInput';
// import BillingPaymentMethod from './BillingPaymentMethod';
import BillingPaymentMethod from './BillingPaymentMethod';
import withSubscriptions from './withSubscriptions';
/**
* Billing plans form.
@@ -14,7 +17,24 @@ export default function BillingPlansForm() {
<div class="billing-plans">
<BillingPlansInput />
<BillingPeriodsInput />
{/* <BillingPaymentMethod /> */}
<BillingPaymentMethodWhenSubscriptionInactive />
</div>
);
}
/**
* Billing payment methods when subscription is inactive.
* @returns {JSX.Element}
*/
function BillingPaymentMethodWhenSubscriptionInactiveJSX({
// # withSubscriptions
isSubscriptionActive,
...props
}) {
return !isSubscriptionActive ? <BillingPaymentMethod {...props} /> : null;
}
const BillingPaymentMethodWhenSubscriptionInactive = R.compose(
withSubscriptions(({ isSubscriptionActive }) => ({ isSubscriptionActive })),
)(BillingPaymentMethodWhenSubscriptionInactiveJSX);

View File

@@ -1,6 +1,11 @@
import { useCallback } from "react"
import { useDispatch } from "react-redux";
import { useDispatch, useSelector } from "react-redux";
import { setSubscriptions } from 'store/subscription/subscription.actions';
import {
isSubscriptionOnTrialFactory,
isSubscriptionInactiveFactory,
isSubscriptionActiveFactory,
} from 'store/subscription/subscription.selectors';
/**
* Sets subscriptions.
@@ -12,3 +17,20 @@ export const useSetSubscriptions = () => {
dispatch(setSubscriptions(subscriptions));
}, [dispatch]);
}
/**
* The organization subscription selector.
* @param {string} slug
* @returns {}
*/
export const useSubscription = (slug = 'main') => {
const isSubscriptionOnTrial = useSelector(isSubscriptionOnTrialFactory(slug));
const isSubscriptionInactive = useSelector(isSubscriptionInactiveFactory(slug));
const isSubscriptionActive = useSelector(isSubscriptionActiveFactory(slug));
return {
isSubscriptionActive,
isSubscriptionInactive,
isSubscriptionOnTrial
}
}

View File

@@ -1173,7 +1173,6 @@
"From transaction": "من معاملة",
"Landed": "Landed",
"This options allows you to be able to add additional cost eg. freight then allocate cost to the items in your bills.": "يتيح لك هذا الخيار إمكانية إضافة تكلفة إضافية على سبيل المثال اضافة تكلفة الشحن ومن ثم تخصيص التكلفة لفواتير الشراء.",
"Once your delete this located landed cost, you won't be able to restore it later, Are your sure you want to delete this transaction?": "بمجرد حذف معاملة تحميل التكلفة ، لن تتمكن من استعادتها لاحقًا ، هل أنت متأكد من أنك تريد حذف هذه المعاملة؟",
"journal_entries": "القيود",
"contact": "جهة الاتصال",
"invoice_details": "تفاصيل الفاتورة",
@@ -1384,7 +1383,7 @@
"filter.value": "قيمة",
"payment_made.empty_status.title": "المنشأة لم تدفع اي اموال إلي الموردين ، إلي حد الأن!.",
"estimate.delete.error.estimate_converted_to_invoice": "لا يمكن حذف عملية عرض اسعار الذي تم تحويلها إلي فاتورة بيع.",
"landed_cost.action.delete.success_message": "The landed cost has been deleted successfully.",
"landed_cost.action.delete.success_message": "تم حذف تكلفة اضافية بنجاح. ",
"items.option.only_active": "Only active",
"items.option_all_items.hint": "جميع الاصناف ، بما في ذلك تلك الاصناف لديها رصيد صفر.",
"items.option_with_transactions": "الاصناف مع معاملات",
@@ -1583,6 +1582,9 @@
"refund": "استرجاع",
"landed_cost.dialog.label_select_transaction": "حدد المعاملة ",
"landed_cost.dialog.label_select_transaction_entry": "حدد سطر المعاملة ",
"landed_cost.dialog.label_unallocated_cost_amount":"قيمة التكلفة غير المحملة:",
"landed_cost.error.the_total_located_cost_is_bigger_than_the_transaction_line":"إجمالي قيمة التكلفة المحملة أكبر من قيمة سطر المعاملة.",
"landed_cost.once_your_delete_this_located_landed_cost": "بمجرد حذف معاملة تحميل التكلفة ، لن تتمكن من استعادتها لاحقًا ، هل أنت متأكد من أنك تريد حذف هذه المعاملة؟",
"refund_credit_note.dialog.label": "استرجاع اموال",
"refund_credit_note.dialog.success_message": "تم انشاء معاملة استرجاع الاموال لإشعار الدائن بنجاح.",
"refund_credit_note.dialog.refund_date": "تاريخ الاسترجاع",
@@ -1782,5 +1784,11 @@
"profit_loss_sheet.percentage_of_column": "% التغير العمودي",
"profit_loss_sheet.percentage_of_row": "% التغير الأفقي",
"profit_loss_sheet.percentage_of_expense": "% التغير في المصاريف",
"profit_loss_sheet.percentage_of_income": "% التغير الإيرادات"
"profit_loss_sheet.percentage_of_income": "% التغير الإيرادات",
"report.balance_sheet_comparison.title": "مقارنة الميزانية العمومية",
"report.balance_sheet_comparison.desc": "يعرض أصول الشركة والتزاماتها وحقوق المساهمين في نقطة زمنية محددة مقارنة بالسنة الماضية.",
"report.profit_loss_sheet_comparison.title": "مقارنة قائمة الدخل",
"report.profit_loss_sheet_comparison.desc": "يعرض الإيرادات والتكاليف والمصاريف المتكبدة في نقطة محددة ومقارنة بالعام السابق."
}

View File

@@ -1145,7 +1145,6 @@
"From transaction": "From transaction",
"landed": "Landed",
"This options allows you to be able to add additional cost eg. freight then allocate cost to the items in your bills.": "This options allows you to be able to add additional cost eg. freight then allocate cost to the items in your bills.",
"Once your delete this located landed cost, you won't be able to restore it later, Are your sure you want to delete this transaction?": "Once your delete this located landed cost, you won't be able to restore it later, Are your sure you want to delete this transaction?",
"journal_entries": "Journal Entries",
"contact": "Contact",
"invoice_details": "Invoice details",
@@ -1289,11 +1288,11 @@
"inventory_adjustment.details_drawer.title": "Inventory adjustment details",
"setup.organization.location": "Location",
"preferences.general.success_message": "The general preferences has been saved.",
"customer.drawer.action.new_invoice": "New invoice",
"customer.drawer.action.new_estimate": "New estimate",
"customer.drawer.action.new_payment": "New payment",
"customer.drawer.action.new_receipt": "New receipt",
"customer.drawer.action.new_transaction": "New transaction",
"customer.drawer.action.new_invoice": "New Invoice",
"customer.drawer.action.new_estimate": "New Estimate",
"customer.drawer.action.new_payment": "New Payment",
"customer.drawer.action.new_receipt": "New Receipt",
"customer.drawer.action.new_transaction": "New Transaction",
"customer.drawer.action.edit": "Edit",
"customer.drawer.label.outstanding_receivable": "Outstanding receivable",
"customer.drawer.label.customer_name": "Customer name",
@@ -1319,9 +1318,9 @@
"vendor.drawer.label.note": "Note",
"vendor.drawer.action.edit_vendor": "Edit vendor",
"vendor.drawer.action.delete": "Delete",
"vendor.drawer.action.new_transaction": "New transaction",
"vendor.drawer.action.new_payment": "New payment",
"vendor.drawer.action.new_invoice": "New purchase invoice",
"vendor.drawer.action.new_transaction": "New Transaction",
"vendor.drawer.action.new_payment": "New Payment",
"vendor.drawer.action.new_invoice": "New Purchase Invoice",
"vendor.drawer.action.edit": "Edit",
"manual_journals.empty_status.description": "Manual journals can be used to record financial transactions manually, used by accountants to work with the ledger.",
"manual_journals.empty_status.title": "Create your first journal entries on accounts chart.",
@@ -1569,6 +1568,9 @@
"refund": "Refund",
"landed_cost.dialog.label_select_transaction": "Select transaction",
"landed_cost.dialog.label_select_transaction_entry": "Select transaction entry",
"landed_cost.dialog.label_unallocated_cost_amount": "Unallocated cost Amount:",
"landed_cost.error.the_total_located_cost_is_bigger_than_the_transaction_line": "The total located cost is bigger than the transaction line.",
"landed_cost.once_your_delete_this_located_landed_cost": "Once your delete this located landed cost, you won't be able to restore it later, Are your sure you want to delete this transaction?",
"refund_credit_note.dialog.label": "Refund Credit Note",
"refund_credit_note.dialog.success_message": "The customer credit note refund has been created successfully.",
"refund_credit_note.dialog.refund_date": "Refund date",
@@ -1769,5 +1771,11 @@
"customer.alert.are_you_sure_want_to_inactivate_this_customer": "Are you sure want to inactivate this customer? You will to able to activate it later.",
"credit_note_preview.dialog.title": "Credit Note PDF Preview",
"payment_receive_preview.dialog.title": "Payment Receive PDF Preview"
"payment_receive_preview.dialog.title": "Payment Receive PDF Preview",
"report.balance_sheet_comparison.title": "Balance Sheet Comparison",
"report.balance_sheet_comparison.desc": "Reports a company's assets, liabilities and shareholders' equity compared to previous year.",
"report.profit_loss_sheet_comparison.title": "Profit/Loss Comparison",
"report.profit_loss_sheet_comparison.desc": "Reports the revenues, costs and expenses incurred at a specific point and compared to previous year."
}