feat (lang) : add Contacts & Sales & Purchases.

This commit is contained in:
elforjani3
2021-06-06 20:32:55 +02:00
parent 366404e1d6
commit a70fd300f2
26 changed files with 161 additions and 122 deletions

View File

@@ -1,20 +1,21 @@
import React from 'react'; import React from 'react';
import { import { formatMessage } from 'services/intl';
ListSelect,
} from 'components';
export default function SalutationList({ import { ListSelect } from 'components';
...restProps
}) { export default function SalutationList({ ...restProps }) {
const saluations = ['Mr.', 'Mrs.', 'Ms.', 'Miss', 'Dr.']; const saluations = ['Mr.', 'Mrs.', 'Ms.', 'Miss', 'Dr.'];
const items = saluations.map((saluation) => ({ key: saluation, label: saluation })); const items = saluations.map((saluation) => ({
key: saluation,
label: saluation,
}));
return ( return (
<ListSelect <ListSelect
items={items} items={items}
selectedItemProp={'key'} selectedItemProp={'key'}
textProp={'label'} textProp={'label'}
defaultText={'Salutation'} defaultText={formatMessage({ id: 'salutation' })}
filterable={false} filterable={false}
{...restProps} {...restProps}
/> />

View File

@@ -6,6 +6,7 @@ import React, {
useCallback, useCallback,
} from 'react'; } from 'react';
import Dragzone from 'components/Dragzone'; import Dragzone from 'components/Dragzone';
import { FormattedMessage as T } from 'react-intl';
function CustomerAttachmentTabs() { function CustomerAttachmentTabs() {
return ( return (
@@ -14,7 +15,7 @@ function CustomerAttachmentTabs() {
initialFiles={[]} initialFiles={[]}
onDrop={null} onDrop={null}
onDeleteFile={[]} onDeleteFile={[]}
hint={'Attachments: Maxiumum size: 20MB'} hint={<T id={'attachments_maximum'} />}
/> />
</div> </div>
); );

View File

@@ -1,10 +1,11 @@
import React from 'react'; import React from 'react';
import { FormGroup, InputGroup, ControlGroup } from '@blueprintjs/core'; import { FormGroup, InputGroup, ControlGroup } from '@blueprintjs/core';
import { FastField, ErrorMessage } from 'formik'; import { FastField, ErrorMessage } from 'formik';
import { FormattedMessage as T } from 'react-intl'; import { FormattedMessage as T, useIntl } from 'react-intl';
import { inputIntent } from 'utils'; import { inputIntent } from 'utils';
export default function CustomerFormAfterPrimarySection({}) { export default function CustomerFormAfterPrimarySection({}) {
const { formatMessage } = useIntl();
return ( return (
<div class="customer-form__after-primary-section-content"> <div class="customer-form__after-primary-section-content">
{/*------------ Customer email -----------*/} {/*------------ Customer email -----------*/}
@@ -33,7 +34,7 @@ export default function CustomerFormAfterPrimarySection({}) {
{({ field, meta: { error, touched } }) => ( {({ field, meta: { error, touched } }) => (
<InputGroup <InputGroup
intent={inputIntent({ error, touched })} intent={inputIntent({ error, touched })}
placeholder={'Work'} placeholder={formatMessage({ id: 'work' })}
{...field} {...field}
/> />
)} )}
@@ -43,7 +44,7 @@ export default function CustomerFormAfterPrimarySection({}) {
{({ field, meta: { error, touched } }) => ( {({ field, meta: { error, touched } }) => (
<InputGroup <InputGroup
intent={inputIntent({ error, touched })} intent={inputIntent({ error, touched })}
placeholder={'Mobile'} placeholder={formatMessage({id:'Mobile'})}
{...field} {...field}
/> />
)} )}

View File

@@ -2,7 +2,8 @@ import React from 'react';
import classNames from 'classnames'; import classNames from 'classnames';
import { FormGroup, InputGroup, ControlGroup } from '@blueprintjs/core'; import { FormGroup, InputGroup, ControlGroup } from '@blueprintjs/core';
import { FastField, Field, ErrorMessage } from 'formik'; import { FastField, Field, ErrorMessage } from 'formik';
import { FormattedMessage as T } from 'react-intl'; import { FormattedMessage as T, useIntl } from 'react-intl';
import { import {
Hint, Hint,
FieldRequiredHint, FieldRequiredHint,
@@ -19,6 +20,7 @@ import { useAutofocus } from 'hooks';
*/ */
export default function CustomerFormPrimarySection({}) { export default function CustomerFormPrimarySection({}) {
const firstNameFieldRef = useAutofocus(); const firstNameFieldRef = useAutofocus();
const { formatMessage } = useIntl();
return ( return (
<div className={'customer-form__primary-section-content'}> <div className={'customer-form__primary-section-content'}>
@@ -53,7 +55,7 @@ export default function CustomerFormPrimarySection({}) {
<FastField name={'first_name'}> <FastField name={'first_name'}>
{({ field, meta: { error, touched } }) => ( {({ field, meta: { error, touched } }) => (
<InputGroup <InputGroup
placeholder={'First Name'} placeholder={formatMessage({ id: 'first_name' })}
intent={inputIntent({ error, touched })} intent={inputIntent({ error, touched })}
className={classNames('input-group--first-name')} className={classNames('input-group--first-name')}
inputRef={(ref) => (firstNameFieldRef.current = ref)} inputRef={(ref) => (firstNameFieldRef.current = ref)}
@@ -65,7 +67,7 @@ export default function CustomerFormPrimarySection({}) {
<FastField name={'last_name'}> <FastField name={'last_name'}>
{({ field, meta: { error, touched } }) => ( {({ field, meta: { error, touched } }) => (
<InputGroup <InputGroup
placeholder={'Last Name'} placeholder={formatMessage({ id: 'last_name' })}
intent={inputIntent({ error, touched })} intent={inputIntent({ error, touched })}
className={classNames('input-group--last-name')} className={classNames('input-group--last-name')}
{...field} {...field}

View File

@@ -2,17 +2,17 @@ import React from 'react';
import { Button, Intent } from '@blueprintjs/core'; import { Button, Intent } from '@blueprintjs/core';
import { useHistory } from 'react-router-dom'; import { useHistory } from 'react-router-dom';
import { EmptyStatus } from 'components'; import { EmptyStatus } from 'components';
import { FormattedMessage as T } from 'react-intl';
export default function CustomersEmptyStatus() { export default function CustomersEmptyStatus() {
const history = useHistory(); const history = useHistory();
return ( return (
<EmptyStatus <EmptyStatus
title={"Create and manage your organization's customers."} title={<T id={'create_and_manage_your_organization_s_customers'} />}
description={ description={
<p> <p>
Here a list of your organization products and services, to be used <T id={'here_a_list_of_your_organization_products_and_services'} />
when you create invoices or bills to your customers or vendors.
</p> </p>
} }
action={ action={
@@ -24,11 +24,11 @@ export default function CustomersEmptyStatus() {
history.push('/customers/new'); history.push('/customers/new');
}} }}
> >
New customer <T id={'new_customer'} />
</Button> </Button>
<Button intent={Intent.NONE} large={true}> <Button intent={Intent.NONE} large={true}>
Learn more <T id={'learn_more'} />
</Button> </Button>
</> </>
} }

View File

@@ -1,6 +1,7 @@
import React, { useCallback } from 'react'; import React, { useCallback } from 'react';
import { DataTable } from 'components'; import { DataTable } from 'components';
import { useInventoryAdjustmentsColumns, ActionsMenu } from './components'; import { useInventoryAdjustmentsColumns, ActionsMenu } from './components';
import { formatMessage } from 'services/intl';
import withAlertsActions from 'containers/Alert/withAlertActions'; import withAlertsActions from 'containers/Alert/withAlertActions';
import withInventoryAdjustmentActions from './withInventoryAdjustmentActions'; import withInventoryAdjustmentActions from './withInventoryAdjustmentActions';
@@ -23,14 +24,14 @@ function InventoryAdjustmentDataTable({
openAlert, openAlert,
// #ownProps // #ownProps
tableProps tableProps,
}) { }) {
const { const {
isAdjustmentsLoading, isAdjustmentsLoading,
isAdjustmentsFetching, isAdjustmentsFetching,
inventoryAdjustments, inventoryAdjustments,
pagination pagination,
} = useInventoryAdjustmentsContext(); } = useInventoryAdjustmentsContext();
// Handle delete inventory adjustment transaction. // Handle delete inventory adjustment transaction.
@@ -47,8 +48,8 @@ function InventoryAdjustmentDataTable({
setInventoryAdjustmentTableState({ setInventoryAdjustmentTableState({
pageSize, pageSize,
pageIndex, pageIndex,
sortBy sortBy,
}) });
}, },
[setInventoryAdjustmentTableState], [setInventoryAdjustmentTableState],
); );
@@ -57,30 +58,25 @@ function InventoryAdjustmentDataTable({
<DataTable <DataTable
columns={columns} columns={columns}
data={inventoryAdjustments} data={inventoryAdjustments}
loading={isAdjustmentsLoading} loading={isAdjustmentsLoading}
headerLoading={isAdjustmentsLoading} headerLoading={isAdjustmentsLoading}
progressBarLoading={isAdjustmentsFetching} progressBarLoading={isAdjustmentsFetching}
initialState={inventoryAdjustmentTableState} initialState={inventoryAdjustmentTableState}
noInitialFetch={true} noInitialFetch={true}
onFetchData={handleDataTableFetchData} onFetchData={handleDataTableFetchData}
manualSortBy={true} manualSortBy={true}
selectionColumn={true} selectionColumn={true}
pagination={true} pagination={true}
pagesCount={pagination.pagesCount} pagesCount={pagination.pagesCount}
autoResetSortBy={false} autoResetSortBy={false}
autoResetPage={false} autoResetPage={false}
payload={{ payload={{
onDelete: handleDeleteAdjustment, onDelete: handleDeleteAdjustment,
}} }}
ContextMenu={ActionsMenu} ContextMenu={ActionsMenu}
noResults={'There is no inventory adjustments transactions yet.'} noResults={formatMessage({
id: 'there_is_no_inventory_adjustments_transactions_yet',
})}
{...tableProps} {...tableProps}
/> />
); );

View File

@@ -2,16 +2,17 @@ import React from 'react';
import { Button, Intent } from '@blueprintjs/core'; import { Button, Intent } from '@blueprintjs/core';
import { useHistory } from 'react-router-dom'; import { useHistory } from 'react-router-dom';
import { EmptyStatus } from 'components'; import { EmptyStatus } from 'components';
import { FormattedMessage as T } from 'react-intl';
export default function ItemsEmptyStatus() { export default function ItemsEmptyStatus() {
const history = useHistory(); const history = useHistory();
return ( return (
<EmptyStatus <EmptyStatus
title={'Manage the organizations services and products.'} title={<T id={'manage_the_organization_s_services_and_products'} />}
description={ description={
<p> <p>
Here a list of your organization products and services, to be used when you create invoices or bills to your customers or vendors. <T id={'here_a_list_of_your_organization_products_and_services'} />
</p> </p>
} }
action={ action={
@@ -23,11 +24,11 @@ export default function ItemsEmptyStatus() {
history.push('/items/new'); history.push('/items/new');
}} }}
> >
New Item <T id={'new_item'} />
</Button> </Button>
<Button intent={Intent.NONE} large={true}> <Button intent={Intent.NONE} large={true}>
Learn more <T id={'learn_more'}/>
</Button> </Button>
</> </>
} }

View File

@@ -12,7 +12,7 @@ import { inputIntent } from 'utils';
export default function BillFormFooter() { export default function BillFormFooter() {
return ( return (
<div class={classNames(CLASSES.PAGE_FORM_FOOTER)}> <div class={classNames(CLASSES.PAGE_FORM_FOOTER)}>
<Postbox title={'Bill details'} defaultOpen={false}> <Postbox title={<T id={'bill_details'} />} defaultOpen={false}>
<Row> <Row>
<Col md={8}> <Col md={8}>
<FastField name={'note'}> <FastField name={'note'}>
@@ -33,7 +33,7 @@ export default function BillFormFooter() {
initialFiles={[]} initialFiles={[]}
// onDrop={onDropFiles} // onDrop={onDropFiles}
// onDeleteFile={onDropFiles} // onDeleteFile={onDropFiles}
hint={'Attachments: Maxiumum size: 20MB'} hint={<T id={'attachments_maximum'} />}
/> />
</Col> </Col>
</Row> </Row>

View File

@@ -2,6 +2,7 @@ import React, { useMemo } from 'react';
import classNames from 'classnames'; import classNames from 'classnames';
import { sumBy } from 'lodash'; import { sumBy } from 'lodash';
import { useFormikContext } from 'formik'; import { useFormikContext } from 'formik';
import { formatMessage } from 'services/intl';
import { CLASSES } from 'common/classes'; import { CLASSES } from 'common/classes';
@@ -28,7 +29,7 @@ function BillFormHeader({
<div className={classNames(CLASSES.PAGE_FORM_HEADER)}> <div className={classNames(CLASSES.PAGE_FORM_HEADER)}>
<BillFormHeaderFields /> <BillFormHeaderFields />
<PageFormBigNumber <PageFormBigNumber
label={'Due Amount'} label={formatMessage({id:'due_amount'})}
amount={totalDueAmount} amount={totalDueAmount}
currencyCode={baseCurrency} currencyCode={baseCurrency}
/> />

View File

@@ -2,16 +2,17 @@ import React from 'react';
import { Button, Intent } from '@blueprintjs/core'; import { Button, Intent } from '@blueprintjs/core';
import { useHistory } from 'react-router-dom'; import { useHistory } from 'react-router-dom';
import { EmptyStatus } from 'components'; import { EmptyStatus } from 'components';
import { FormattedMessage as T } from 'react-intl';
export default function BillsEmptyStatus() { export default function BillsEmptyStatus() {
const history = useHistory(); const history = useHistory();
return ( return (
<EmptyStatus <EmptyStatus
title={'Manage the organizations services and products.'} title={<T id={'manage_the_organization_s_services_and_products'} />}
description={ description={
<p> <p>
Here a list of your organization products and services, to be used when you create invoices or bills to your customers or vendors. <T id={'here_a_list_of_your_organization_products_and_services'} />
</p> </p>
} }
action={ action={
@@ -23,11 +24,11 @@ export default function BillsEmptyStatus() {
history.push('/bills/new'); history.push('/bills/new');
}} }}
> >
New bill <T id={'new_bill'} />
</Button> </Button>
<Button intent={Intent.NONE} large={true}> <Button intent={Intent.NONE} large={true}>
Learn more <T id={'learn_more'} />
</Button> </Button>
</> </>
} }

View File

@@ -1,6 +1,7 @@
import React, { useCallback } from 'react'; import React, { useCallback } from 'react';
import { CloudLoadingIndicator } from 'components'; import { CloudLoadingIndicator } from 'components';
import classNames from 'classnames'; import classNames from 'classnames';
import { FormattedMessage as T } from 'react-intl';
import { CLASSES } from 'common/classes'; import { CLASSES } from 'common/classes';
import { DataTableEditable } from 'components'; import { DataTableEditable } from 'components';
@@ -42,9 +43,15 @@ export default function PaymentMadeEntriesTable({
// Detarmines the right no results message before selecting vendor and aftering // Detarmines the right no results message before selecting vendor and aftering
// selecting vendor id. // selecting vendor id.
const noResultsMessage = vendor_id const noResultsMessage = vendor_id ? (
? 'There is no payable bills for this vendor that can be applied for this payment' <T
: 'Please select a vendor to display all open bills for it.'; id={
'there_is_no_payable_bills_for_this_vendor_that_can_be_applied_for_this_payment'
}
/>
) : (
<T id={'please_select_a_vendor_to_display_all_open_bills_for_it'} />
);
return ( return (
<CloudLoadingIndicator isLoading={isNewEntriesFetching}> <CloudLoadingIndicator isLoading={isNewEntriesFetching}>

View File

@@ -12,7 +12,7 @@ import { CLASSES } from 'common/classes';
export default function PaymentMadeFooter() { export default function PaymentMadeFooter() {
return ( return (
<div className={classNames(CLASSES.PAGE_FORM_FOOTER)}> <div className={classNames(CLASSES.PAGE_FORM_FOOTER)}>
<Postbox title={'Payment made details'} defaultOpen={false}> <Postbox title={<T id={'payment_made_details'} />} defaultOpen={false}>
<Row> <Row>
<Col md={8}> <Col md={8}>
{/* --------- Statement --------- */} {/* --------- Statement --------- */}

View File

@@ -4,9 +4,9 @@ import { useFormikContext } from 'formik';
import { sumBy } from 'lodash'; import { sumBy } from 'lodash';
import { CLASSES } from 'common/classes'; import { CLASSES } from 'common/classes';
import { compose } from 'utils'; import { compose } from 'utils';
import { import { Money } from 'components';
Money, import { FormattedMessage as T } from 'react-intl';
} from 'components';
import PaymentMadeFormHeaderFields from './PaymentMadeFormHeaderFields'; import PaymentMadeFormHeaderFields from './PaymentMadeFormHeaderFields';
import withSettings from 'containers/Settings/withSettings'; import withSettings from 'containers/Settings/withSettings';
@@ -18,7 +18,9 @@ function PaymentMadeFormHeader({
baseCurrency, baseCurrency,
}) { }) {
// Formik form context. // Formik form context.
const { values: { entries } } = useFormikContext(); const {
values: { entries },
} = useFormikContext();
// Calculate the payment amount of the entries. // Calculate the payment amount of the entries.
const amountPaid = useMemo(() => sumBy(entries, 'payment_amount'), [entries]); const amountPaid = useMemo(() => sumBy(entries, 'payment_amount'), [entries]);
@@ -30,7 +32,9 @@ function PaymentMadeFormHeader({
<div className={classNames(CLASSES.PAGE_FORM_HEADER_BIG_NUMBERS)}> <div className={classNames(CLASSES.PAGE_FORM_HEADER_BIG_NUMBERS)}>
<div class="big-amount"> <div class="big-amount">
<span class="big-amount__label">Amount Received</span> <span class="big-amount__label">
<T id={'amount_received'} />
</span>
<h1 class="big-amount__number"> <h1 class="big-amount__number">
<Money amount={amountPaid} currency={baseCurrency} /> <Money amount={amountPaid} currency={baseCurrency} />
</h1> </h1>

View File

@@ -157,7 +157,7 @@ function PaymentMadeFormHeaderFields({ baseCurrency }) {
small={true} small={true}
minimal={true} minimal={true}
> >
Receive full amount ( <T id={'receive_full_amount'} /> (
<Money amount={payableFullAmount} currency={baseCurrency} />) <Money amount={payableFullAmount} currency={baseCurrency} />)
</Button> </Button>
</FormGroup> </FormGroup>

View File

@@ -2,17 +2,17 @@ import React from 'react';
import { Button, Intent } from '@blueprintjs/core'; import { Button, Intent } from '@blueprintjs/core';
import { useHistory } from 'react-router-dom'; import { useHistory } from 'react-router-dom';
import { EmptyStatus } from 'components'; import { EmptyStatus } from 'components';
import { FormattedMessage as T } from 'react-intl';
export default function PaymentMadesEmptyStatus() { export default function PaymentMadesEmptyStatus() {
const history = useHistory(); const history = useHistory();
return ( return (
<EmptyStatus <EmptyStatus
title={'The organization does not have invoices, yet!'} title={<T id={'the_organization_doesn_t_receive_money_yet'} />}
description={ description={
<p> <p>
It is a long established fact that a reader will be distracted by the <T id={'it_is_a_long_established_fact_that_a_reader'} />
readable content of a page when looking at its layout.
</p> </p>
} }
action={ action={
@@ -24,11 +24,11 @@ export default function PaymentMadesEmptyStatus() {
history.push('/payment-mades/new'); history.push('/payment-mades/new');
}} }}
> >
New bill payment <T id={'new_bill_payment'} />
</Button> </Button>
<Button intent={Intent.NONE} large={true}> <Button intent={Intent.NONE} large={true}>
Learn more <T id={'learn_more'} />
</Button> </Button>
</> </>
} }

View File

@@ -1,37 +1,37 @@
import React from 'react'; import React from 'react';
import { Button, Intent } from '@blueprintjs/core'; import { Button, Intent } from '@blueprintjs/core';
import { useHistory } from 'react-router-dom'; import { useHistory } from 'react-router-dom';
import { EmptyStatus } from 'components'; import { EmptyStatus } from 'components';
import { FormattedMessage as T } from 'react-intl';
export default function EstimatesEmptyStatus() { export default function EstimatesEmptyStatus() {
const history = useHistory(); const history = useHistory();
return ( return (
<EmptyStatus <EmptyStatus
title={'The organization does not have invoices, yet!'} title={<T id={'the_organization_doesn_t_receive_money_yet'} />}
description={ description={
<p> <p>
It is a long established fact that a reader will be distracted by the <T id={'it_is_a_long_established_fact_that_a_reader'} />
readable content of a page when looking at its layout. </p>
</p> }
} action={
action={ <>
<> <Button
<Button intent={Intent.PRIMARY}
intent={Intent.PRIMARY} large={true}
large={true} onClick={() => {
onClick={() => { history.push('/invoices/new');
history.push('/invoices/new'); }}
}} >
> <T id={'new_sale_invoice'} />
New sale invoice </Button>
</Button>
<Button intent={Intent.NONE} large={true}> <Button intent={Intent.NONE} large={true}>
Learn more <T id={'learn_more'} />
</Button> </Button>
</> </>
} }
/> />
); );
} }

View File

@@ -4,6 +4,7 @@ import { useIntl } from 'react-intl';
import { Money } from 'components'; import { Money } from 'components';
import { MoneyFieldCell } from 'components/DataTableCells'; import { MoneyFieldCell } from 'components/DataTableCells';
import { safeSumBy, formattedAmount } from 'utils'; import { safeSumBy, formattedAmount } from 'utils';
import { formatMessage } from 'services/intl';
/** /**
* Invoice date cell. * Invoice date cell.
@@ -58,14 +59,14 @@ function MoneyTableCell({ row: { original }, value }) {
} }
function DateFooterCell() { function DateFooterCell() {
return 'Total'; return formatMessage({id:'total'})
} }
/** /**
* Retrieve payment receive form entries columns. * Retrieve payment receive form entries columns.
*/ */
export const usePaymentReceiveEntriesColumns = () => { export const usePaymentReceiveEntriesColumns = () => {
const { formatMessage } = useIntl();
return React.useMemo( return React.useMemo(
() => [ () => [

View File

@@ -10,7 +10,7 @@ import { inputIntent } from 'utils';
export default function ReceiptFormFooter({}) { export default function ReceiptFormFooter({}) {
return ( return (
<div className={classNames(CLASSES.PAGE_FORM_FOOTER)}> <div className={classNames(CLASSES.PAGE_FORM_FOOTER)}>
<Postbox title={'Invoice details'} defaultOpen={false}> <Postbox title={<T id={'receipt_details'}/>} defaultOpen={false}>
<Row> <Row>
<Col md={8}> <Col md={8}>
{/* --------- Receipt message --------- */} {/* --------- Receipt message --------- */}
@@ -45,7 +45,8 @@ export default function ReceiptFormFooter({}) {
initialFiles={[]} initialFiles={[]}
// onDrop={handleDropFiles} // onDrop={handleDropFiles}
// onDeleteFile={handleDeleteFile} // onDeleteFile={handleDeleteFile}
hint={'Attachments: Maxiumum size: 20MB'} hint={<T id={'attachments_maximum'} />}
/> />
</Col> </Col>
</Row> </Row>

View File

@@ -7,6 +7,8 @@ import { CLASSES } from 'common/classes';
import ReceiptFormHeaderFields from './ReceiptFormHeaderFields'; import ReceiptFormHeaderFields from './ReceiptFormHeaderFields';
import { PageFormBigNumber } from 'components'; import { PageFormBigNumber } from 'components';
import { formatMessage } from 'services/intl';
import withSettings from 'containers/Settings/withSettings'; import withSettings from 'containers/Settings/withSettings';
import { compose } from 'redux'; import { compose } from 'redux';
@@ -22,9 +24,10 @@ function ReceiptFormHeader({
const { values } = useFormikContext(); const { values } = useFormikContext();
// Calculate the total due amount of bill entries. // Calculate the total due amount of bill entries.
const totalDueAmount = useMemo(() => sumBy(values.entries, 'total'), [ const totalDueAmount = useMemo(
values.entries, () => sumBy(values.entries, 'total'),
]); [values.entries],
);
return ( return (
<div className={classNames(CLASSES.PAGE_FORM_HEADER)}> <div className={classNames(CLASSES.PAGE_FORM_HEADER)}>
@@ -32,7 +35,7 @@ function ReceiptFormHeader({
onReceiptNumberChanged={onReceiptNumberChanged} onReceiptNumberChanged={onReceiptNumberChanged}
/> />
<PageFormBigNumber <PageFormBigNumber
label={'Due Amount'} label={formatMessage({ id: 'due_amount' })}
amount={totalDueAmount} amount={totalDueAmount}
currencyCode={baseCurrency} currencyCode={baseCurrency}
/> />

View File

@@ -2,16 +2,17 @@ import React from 'react';
import { Button, Intent } from '@blueprintjs/core'; import { Button, Intent } from '@blueprintjs/core';
import { useHistory } from 'react-router-dom'; import { useHistory } from 'react-router-dom';
import { EmptyStatus } from 'components'; import { EmptyStatus } from 'components';
import { FormattedMessage as T } from 'react-intl';
export default function ReceiptsEmptyStatus() { export default function ReceiptsEmptyStatus() {
const history = useHistory(); const history = useHistory();
return ( return (
<EmptyStatus <EmptyStatus
title={'Manage the organizations services and products.'} title={<T id={'manage_the_organization_s_services_and_products'} />}
description={ description={
<p> <p>
Here a list of your organization products and services, to be used when you create invoices or bills to your customers or vendors. <T id={'here_a_list_of_your_organization_products_and_services'} />
</p> </p>
} }
action={ action={
@@ -23,11 +24,11 @@ export default function ReceiptsEmptyStatus() {
history.push('/receipts/new'); history.push('/receipts/new');
}} }}
> >
New receipt <T id={'new_receipt'} />
</Button> </Button>
<Button intent={Intent.NONE} large={true}> <Button intent={Intent.NONE} large={true}>
Learn more <T id={'learn_more'}/>
</Button> </Button>
</> </>
} }

View File

@@ -1,5 +1,6 @@
import React from 'react'; import React from 'react';
import Dragzone from 'components/Dragzone'; import Dragzone from 'components/Dragzone';
import { FormattedMessage as T } from 'react-intl';
/** /**
* Vendor Attahment Tab. * Vendor Attahment Tab.
@@ -11,7 +12,7 @@ function VendorAttahmentTab() {
initialFiles={[]} initialFiles={[]}
onDrop={null} onDrop={null}
onDeleteFile={[]} onDeleteFile={[]}
hint={'Attachments: Maxiumum size: 20MB'} hint={<T id={'attachments_maximum'} />}
/> />
</div> </div>
); );

View File

@@ -1,13 +1,15 @@
import React from 'react'; import React from 'react';
import { FormGroup, InputGroup, ControlGroup } from '@blueprintjs/core'; import { FormGroup, InputGroup, ControlGroup } from '@blueprintjs/core';
import { FastField, ErrorMessage } from 'formik'; import { FastField, ErrorMessage } from 'formik';
import { FormattedMessage as T } from 'react-intl'; import { FormattedMessage as T, useIntl } from 'react-intl';
import { inputIntent } from 'utils'; import { inputIntent } from 'utils';
/** /**
* Vendor form after primary section. * Vendor form after primary section.
*/ */
function VendorFormAfterPrimarySection() { function VendorFormAfterPrimarySection() {
const { formatMessage } = useIntl();
return ( return (
<div class="customer-form__after-primary-section-content"> <div class="customer-form__after-primary-section-content">
{/*------------ Vendor email -----------*/} {/*------------ Vendor email -----------*/}
@@ -36,7 +38,7 @@ function VendorFormAfterPrimarySection() {
{({ field, meta: { error, touched } }) => ( {({ field, meta: { error, touched } }) => (
<InputGroup <InputGroup
intent={inputIntent({ error, touched })} intent={inputIntent({ error, touched })}
placeholder={'Work'} placeholder={formatMessage({ id: 'work' })}
{...field} {...field}
/> />
)} )}
@@ -45,7 +47,7 @@ function VendorFormAfterPrimarySection() {
{({ field, meta: { error, touched } }) => ( {({ field, meta: { error, touched } }) => (
<InputGroup <InputGroup
intent={inputIntent({ error, touched })} intent={inputIntent({ error, touched })}
placeholder={'Mobile'} placeholder={formatMessage({ id: 'Mobile' })}
{...field} {...field}
/> />
)} )}

View File

@@ -2,7 +2,7 @@ import React from 'react';
import classNames from 'classnames'; import classNames from 'classnames';
import { FormGroup, InputGroup, ControlGroup } from '@blueprintjs/core'; import { FormGroup, InputGroup, ControlGroup } from '@blueprintjs/core';
import { FastField, Field, ErrorMessage } from 'formik'; import { FastField, Field, ErrorMessage } from 'formik';
import { FormattedMessage as T } from 'react-intl'; import { FormattedMessage as T, useIntl } from 'react-intl';
import { import {
Hint, Hint,
FieldRequiredHint, FieldRequiredHint,
@@ -20,6 +20,7 @@ import { useAutofocus } from 'hooks';
*/ */
function VendorFormPrimarySection() { function VendorFormPrimarySection() {
const firstNameFieldRef = useAutofocus(); const firstNameFieldRef = useAutofocus();
const { formatMessage } = useIntl();
return ( return (
<div className={'customer-form__primary-section-content'}> <div className={'customer-form__primary-section-content'}>
@@ -51,7 +52,7 @@ function VendorFormPrimarySection() {
<FastField name={'first_name'}> <FastField name={'first_name'}>
{({ field, meta: { error, touched } }) => ( {({ field, meta: { error, touched } }) => (
<InputGroup <InputGroup
placeholder={'First Name'} placeholder={formatMessage({ id: 'first_name' })}
intent={inputIntent({ error, touched })} intent={inputIntent({ error, touched })}
className={classNames('input-group--first-name')} className={classNames('input-group--first-name')}
inputRef={(ref) => (firstNameFieldRef.current = ref)} inputRef={(ref) => (firstNameFieldRef.current = ref)}
@@ -63,7 +64,7 @@ function VendorFormPrimarySection() {
<FastField name={'last_name'}> <FastField name={'last_name'}>
{({ field, meta: { error, touched } }) => ( {({ field, meta: { error, touched } }) => (
<InputGroup <InputGroup
placeholder={'Last Name'} placeholder={formatMessage({ id: 'last_name' })}
intent={inputIntent({ error, touched })} intent={inputIntent({ error, touched })}
className={classNames('input-group--last-name')} className={classNames('input-group--last-name')}
{...field} {...field}

View File

@@ -2,17 +2,17 @@ import React from 'react';
import { Button, Intent } from '@blueprintjs/core'; import { Button, Intent } from '@blueprintjs/core';
import { useHistory } from 'react-router-dom'; import { useHistory } from 'react-router-dom';
import { EmptyStatus } from 'components'; import { EmptyStatus } from 'components';
import { FormattedMessage as T } from 'react-intl';
export default function VendorsEmptyStatus() { export default function VendorsEmptyStatus() {
const history = useHistory(); const history = useHistory();
return ( return (
<EmptyStatus <EmptyStatus
title={"Create and manage your organization's vendors."} title={<T id={'create_and_manage_your_organization_s_vendors'} />}
description={ description={
<p> <p>
Here a list of your organization products and services, to be used <T id={'here_a_list_of_your_organization_products_and_services'} />
when you create invoices or bills to your customers or vendors.
</p> </p>
} }
action={ action={
@@ -24,11 +24,11 @@ export default function VendorsEmptyStatus() {
history.push('/vendors/new'); history.push('/vendors/new');
}} }}
> >
New vendor <T id={'new_vendor'} />
</Button> </Button>
<Button intent={Intent.NONE} large={true}> <Button intent={Intent.NONE} large={true}>
Learn more <T id={'learn_more'} />
</Button> </Button>
</> </>
} }

View File

@@ -902,7 +902,6 @@
"manage_your_products_inventory_or_non_inventory": "Manage your products (inventory or non-inventory) and services and place them into categories.", "manage_your_products_inventory_or_non_inventory": "Manage your products (inventory or non-inventory) and services and place them into categories.",
"products_services_categories": "Products & Services Categories", "products_services_categories": "Products & Services Categories",
"group_your_products_and_service": "Group your products and service into different categories.", "group_your_products_and_service": "Group your products and service into different categories.",
"inventory_adjustments": "Inventory Adjustments",
"manage_your_inventory_adjustment_of_inventory_items": "Manage your inventory adjustment of inventory items.", "manage_your_inventory_adjustment_of_inventory_items": "Manage your inventory adjustment of inventory items.",
"page_size": "Page size", "page_size": "Page size",
"there_is_no_items_categories_in_table_yet": "There is no items categories in table yet.", "there_is_no_items_categories_in_table_yet": "There is no items categories in table yet.",
@@ -927,9 +926,25 @@
"setting_your_auto_generated_invoice_number": "Setting your auto-generated invoice number", "setting_your_auto_generated_invoice_number": "Setting your auto-generated invoice number",
"setting_your_auto_generated_payment_receive_number": "Setting your auto-generated Payment Receive number", "setting_your_auto_generated_payment_receive_number": "Setting your auto-generated Payment Receive number",
"the_organization_doesn_t_receive_money_yet": "The organization doesn't receive money, yet!", "the_organization_doesn_t_receive_money_yet": "The organization doesn't receive money, yet!",
"new_payment_receive": "New payment receive",
"there_is_no_receivable_invoices_for_this_customer": "There is no receivable invoices for this customer that can be applied for this payment", "there_is_no_receivable_invoices_for_this_customer": "There is no receivable invoices for this customer that can be applied for this payment",
"please_select_a_customer_to_display_all_open_invoices_for_it": "Please select a customer to display all open invoices for it.", "please_select_a_customer_to_display_all_open_invoices_for_it": "Please select a customer to display all open invoices for it.",
"payment_receive_details": "Payment receive details", "payment_receive_details": "Payment receive details",
"receive_full_amount": "Receive full amount" "receive_full_amount": "Receive full amount",
"manage_the_organization_s_services_and_products": "Manage the organizations services and products.",
"here_a_list_of_your_organization_products_and_services": " Here a list of your organization products and services, to be used when you create invoices or bills to your customers or vendors.",
"receipt_details": "Receipt details",
"bill_details": "Bill details",
"new_bill_payment": "New bill payment",
"new_sale_invoice": " New sale invoice",
"there_is_no_payable_bills_for_this_vendor_that_can_be_applied_for_this_payment": "There is no payable bills for this vendor that can be applied for this payment",
"please_select_a_vendor_to_display_all_open_bills_for_it": "Please select a vendor to display all open bills for it.",
"payment_made_details": "Payment made details",
"there_is_no_inventory_adjustments_transactions_yet":"There is no inventory adjustments transactions yet.",
"create_and_manage_your_organization_s_customers":"Create and manage your organization's customers.",
"salutation":"Salutation",
"work":"work",
"mobile":"Mobile",
"phone":"Phone",
"create_and_manage_your_organization_s_vendors":"Create and manage your organization's vendors."
} }

View File

@@ -26,7 +26,6 @@ DB_MANAGER_SUPER_PASSWORD=root
MONGODB_DATABASE_URL=mongodb://localhost/bigcapital MONGODB_DATABASE_URL=mongodb://localhost/bigcapital
EASY_SMS_TOKEN=b0JDZW56RnV6aEthb0RGPXVEcUI
JWT_SECRET=b0JDZW56RnV6aEthb0RGPXVEcUI JWT_SECRET=b0JDZW56RnV6aEthb0RGPXVEcUI