feat(Reports): content.

This commit is contained in:
a.bouhuolia
2021-03-31 14:18:13 +02:00
parent a0cee8b56c
commit 3232c7f6ff
10 changed files with 53 additions and 36 deletions

View File

@@ -21,6 +21,7 @@ export default function DashboardContentRoute() {
Component={route.component}
pageTitle={route.pageTitle}
backLink={route.backLink}
hint={route.hint}
sidebarShrink={route.sidebarShrink}
/>
</Route>

View File

@@ -12,12 +12,14 @@ function DashboardPage({
sidebarShrink,
Component,
name,
hint,
// #withDashboardActions
changePageTitle,
setDashboardBackLink,
setSidebarShrink,
resetSidebarPreviousExpand,
changePageHint,
}) {
useEffect(() => {
pageTitle && changePageTitle(pageTitle);
@@ -27,6 +29,14 @@ function DashboardPage({
};
});
useEffect(() => {
hint && changePageHint(hint);
return () => {
hint && changePageHint('');
}
}, [hint, changePageHint]);
useEffect(() => {
backLink && setDashboardBackLink(backLink);

View File

@@ -31,6 +31,7 @@ function DashboardTopbar({
// #withDashboard
pageTitle,
editViewId,
pageHint,
// #withDashboardActions
toggleSidebarExpend,
@@ -97,13 +98,9 @@ function DashboardTopbar({
<div class="dashboard__title">
<h1>{pageTitle}</h1>
<If condition={true}>
<If condition={pageHint}>
<div class="dashboard__hint">
<Hint
content={
'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.'
}
/>
<Hint content={pageHint} />
</div>
</If>
@@ -119,7 +116,7 @@ function DashboardTopbar({
<div class="dashboard__breadcrumbs">
<DashboardBreadcrumbs />
</div>
<DashboardBackLink />
</div>
@@ -132,7 +129,7 @@ function DashboardTopbar({
icon={<Icon icon={'search-24'} iconSize={20} />}
text={<T id={'quick_find'} />}
/>
<QuickNewDropdown/>
<QuickNewDropdown />
<Tooltip
content={<T id={'notifications'} />}
position={Position.BOTTOM}
@@ -161,10 +158,11 @@ function DashboardTopbar({
export default compose(
withSearch,
withDashboard(({ pageTitle, editViewId, sidebarExpended }) => ({
withDashboard(({ pageTitle, pageHint, editViewId, sidebarExpended }) => ({
pageTitle,
editViewId,
sidebarExpended,
pageHint,
})),
withSettings(({ organizationSettings }) => ({
organizationName: organizationSettings.name,

View File

@@ -1,6 +1,3 @@
import React from 'react';
import { FormattedMessage as T } from 'react-intl';
export const financialReportMenus = [
{
sectionTitle: 'Financial Accounting',
@@ -8,43 +5,38 @@ export const financialReportMenus = [
{
title: 'Balance Sheet Report',
desc:
'Shows the average age of unresolved issues for a project or filter. This helps you see whether your backlog is being kept up to date.',
"Reports a company's assets, liabilities and shareholders' equity at a specific point in time with comparison period(s).",
link: '/financial-reports/balance-sheet',
},
{
title: 'Trial Balance Sheet',
desc:
'Shows the average age of unresolved issues for a project or filter. This helps you see whether your backlog is being kept up to date.',
desc: 'Summarizes the credit and debit balance of each account in your chart of accounts at a specific point in time.',
link: '/financial-reports/trial-balance-sheet',
},
{
title: 'Journal Report',
desc:
'Shows the average age of unresolved issues for a project or filter. This helps you see whether your backlog is being kept up to date.',
'The debit and credit entries of system transactions, sorted by date.',
link: '/financial-reports/journal-sheet',
},
{
title: 'Profit/Loss Report',
desc:
'Shows the average age of unresolved issues for a project or filter. This helps you see whether your backlog is being kept up to date.',
desc: "Reports the revenues, costs and expenses incurred during a specific point in time with comparison period(s).",
link: '/financial-reports/profit-loss-sheet',
},
{
title: 'General Ledger Report',
desc:
'Shows the average age of unresolved issues for a project or filter. This helps you see whether your backlog is being kept up to date.',
desc: "Reports every transaction going in and out of your accounts and organized by accounts and date to monitoring activity of accounts.",
link: '/financial-reports/general-ledger',
},
{
title: 'Receivable Aging Summary',
desc:
'Shows the average age of unresolved issues for a project or filter. This helps you see whether your backlog is being kept up to date.',
desc: "Summarize total unpaid balances of customers invoices with number of days the unpaid invoice is overdue.",
link: '/financial-reports/receivable-aging-summary',
},
{
title: 'Payable Aging Summary',
desc:
'Shows the average age of unresolved issues for a project or filter. This helps you see whether your backlog is being kept up to date.',
desc: "Summarize total unpaid balances of vendors purchase invoices with the number of days the unpaid invoice is overdue.",
link: '/financial-reports/payable-aging-summary',
},
],
@@ -64,13 +56,12 @@ export const SalesAndPurchasesReportMenus = [
{
title: 'Sales by Items',
desc:
'Shows the average age of unresolved issues for a project or filter. This helps you see whether your backlog is being kept up to date.',
"Summarize the businesss sold items quantity, income and average income rate of each item during a specific point in time.",
link: '/financial-reports/sales-by-items',
},
{
title: 'Inventory valuation',
desc:
'Shows the average age of unresolved issues for a project or filter. This helps you see whether your backlog is being kept up to date.',
desc: 'Summarize the businesss purchase items quantity, cost and average cost rate of each item during a specific point in time.',
link: '/financial-reports/inventory-valuation',
},
],

View File

@@ -1,8 +1,8 @@
import React from 'react';
import { Formik } from 'formik';
import { Intent } from '@blueprintjs/core';
import { FormattedMessage as T, useIntl } from 'react-intl';
import { pick, defaultTo } from 'lodash';
import { useIntl } from 'react-intl';
import { pick, defaultTo, omit } from 'lodash';
import { AppToaster } from 'components';
import { useQuickPaymentReceiveContext } from './QuickPaymentReceiveFormProvider';
@@ -51,8 +51,7 @@ function QuickPaymentReceiveForm({
};
// Handles the form submit.
const handleFormSubmit = (values, { setSubmitting, setFieldError, status }) => {
debugger;
const handleFormSubmit = (values, { setSubmitting, setFieldError }) => {
const entries = [values]
.filter((entry) => entry.id && entry.payment_amount)
.map((entry) => ({
@@ -61,7 +60,10 @@ function QuickPaymentReceiveForm({
}));
const form = {
...values,
...omit(values, ['payment_receive_no']),
...(!paymentReceiveAutoIncrement && {
payment_receive_no: values.payment_receive_no,
}),
customer_id: values.customer.id,
entries,
};

View File

@@ -111,6 +111,7 @@ export default [
import('containers/FinancialStatements/GeneralLedger/GeneralLedger'),
),
breadcrumb: 'General Ledger',
hint: "Reports every transaction going in and out of your accounts and organized by accounts and date to monitoring activity of accounts.",
hotkey: 'shift+4',
pageTitle: formatMessage({ id: 'general_ledger' }),
backLink: true,
@@ -122,6 +123,7 @@ export default [
import('containers/FinancialStatements/BalanceSheet/BalanceSheet'),
),
breadcrumb: 'Balance Sheet',
hint: "Reports a company's assets, liabilities and shareholders' equity at a specific point in time with comparison period(s).",
hotkey: 'shift+1',
pageTitle: formatMessage({ id: 'balance_sheet' }),
backLink: true,
@@ -135,6 +137,7 @@ export default [
),
),
breadcrumb: 'Trial Balance Sheet',
hint: "Summarizes the credit and debit balance of each account in your chart of accounts at a specific point in time. ",
hotkey: 'shift+5',
pageTitle: formatMessage({ id: 'trial_balance_sheet' }),
backLink: true,
@@ -146,6 +149,7 @@ export default [
import('containers/FinancialStatements/ProfitLossSheet/ProfitLossSheet'),
),
breadcrumb: 'Profit Loss Sheet',
hint: "Reports the revenues, costs and expenses incurred during a specific point in time with comparison period(s).",
hotkey: 'shift+2',
pageTitle: formatMessage({ id: 'profit_loss_sheet' }),
backLink: true,
@@ -157,6 +161,7 @@ export default [
import('containers/FinancialStatements/ARAgingSummary/ARAgingSummary'),
),
breadcrumb: 'Receivable Aging Summary',
hint: "Summarize total unpaid balances of customers invoices with number of days the unpaid invoice is overdue.",
pageTitle: formatMessage({ id: 'receivable_aging_summary' }),
backLink: true,
sidebarShrink: true,
@@ -167,6 +172,7 @@ export default [
import('containers/FinancialStatements/APAgingSummary/APAgingSummary'),
),
breadcrumb: 'Payable Aging Summary',
hint: "Summarize total unpaid balances of vendors purchase invoices with the number of days the unpaid invoice is overdue.",
pageTitle: formatMessage({ id: 'payable_aging_summary' }),
backLink: true,
sidebarShrink: true,
@@ -177,6 +183,7 @@ export default [
import('containers/FinancialStatements/Journal/Journal'),
),
breadcrumb: 'Journal Sheet',
hint: "The debit and credit entries of system transactions, sorted by date.",
hotkey: 'shift+3',
pageTitle: formatMessage({ id: 'journal_sheet' }),
sidebarShrink: true,
@@ -201,8 +208,8 @@ export default [
import('containers/FinancialStatements/SalesByItems/SalesByItems'),
),
breadcrumb: 'Sales by Items',
// hotkey: '',
pageTitle: formatMessage({ id: 'sales_by_items' }),
hint: 'Summarize the businesss sold items quantity, income and average income rate of each item during a specific point in time.',
backLink: true,
sidebarShrink: true,
},
@@ -214,7 +221,7 @@ export default [
),
),
breadcrumb: 'Inventory Valuation ',
// hotkey: '',
hint: 'Summerize your transactions for each inventory item and how they affect quantity, valuation and weighted average.',
pageTitle: formatMessage({ id: 'inventory_valuation' }),
backLink: true,
sidebarShrink: true,

View File

@@ -7,6 +7,13 @@ export function dashboardPageTitle(pageTitle) {
};
}
export function dashboardPageHint(pageHint) {
return {
type: t.CHANGE_DASHBOARD_PAGE_HINT,
pageHint,
};
}
export function openDialog(name, payload) {
return {
type: t.OPEN_DIALOG,

View File

@@ -36,7 +36,7 @@ const reducerInstance = createReducer(initialState, {
},
[t.CHANGE_DASHBOARD_PAGE_HINT]: (state, action) => {
state.pageHint = action.pageHint;
state.pageHint = action.payload.pageHint;
},
[t.CHANGE_PREFERENCES_PAGE_TITLE]: (state, action) => {

View File

@@ -31,7 +31,7 @@
.desc {
color: rgb(31, 50, 85);
line-height: 1.55;
margin-top: 12px;
margin-top: 8px;
margin-bottom: 0;
}
}

View File

@@ -271,6 +271,7 @@ export default class SaleInvoicesController extends BaseController {
next(error);
}
}
/**
* Retrieve paginated sales invoices with custom view metadata.
* @param {Request} req