This commit is contained in:
a.bouhuolia
2021-09-27 20:17:11 +02:00
75 changed files with 417 additions and 265 deletions

View File

@@ -0,0 +1,10 @@
import React from 'react';
import { firstLettersArgs } from 'utils';
export default function AvatarCell({ row: { original }, size }) {
return (
<span className="avatar" data-size={size}>
{firstLettersArgs(original?.display_name)}
</span>
);
}

View File

@@ -86,7 +86,7 @@ function Pagination({
currentPage, currentPage,
total, total,
size, size,
pageSizesOptions = [5, 12, 20, 30, 50, 75, 100, 150], pageSizesOptions = [20, 30, 50, 75, 100, 150],
onPageChange, onPageChange,
onPageSizeChange, onPageSizeChange,
}) { }) {

View File

@@ -141,7 +141,6 @@ function UniversalSearchBar({ isOpen, onSearchTypeChange, ...listProps }) {
{...handlers} {...handlers}
> >
<InputGroup <InputGroup
autoFocus={true}
large={true} large={true}
leftIcon={<Icon icon={'universal-search'} iconSize={20} />} leftIcon={<Icon icon={'universal-search'} iconSize={20} />}
placeholder={intl.get('universal_search.placeholder')} placeholder={intl.get('universal_search.placeholder')}

View File

@@ -58,6 +58,7 @@ import AccountsSuggestField from './AccountsSuggestField';
import MaterialProgressBar from './MaterialProgressBar'; import MaterialProgressBar from './MaterialProgressBar';
import { MoneyFieldCell } from './DataTableCells'; import { MoneyFieldCell } from './DataTableCells';
import Card from './Card'; import Card from './Card';
import AvaterCell from './AvaterCell';
import { ItemsMultiSelect } from './Items'; import { ItemsMultiSelect } from './Items';
@@ -71,13 +72,13 @@ export * from './PdfPreview';
export * from './Details'; export * from './Details';
export * from './Drawer/DrawerInsider'; export * from './Drawer/DrawerInsider';
export * from './Drawer/DrawerMainTabs'; export * from './Drawer/DrawerMainTabs';
export * from './TotalLines/index' export * from './TotalLines/index';
export * from './Alert'; export * from './Alert';
export * from './Subscriptions'; export * from './Subscriptions';
export * from './Dashboard'; export * from './Dashboard';
export * from './Drawer'; export * from './Drawer';
export * from './Forms'; export * from './Forms';
export * from './MultiSelectTaggable' export * from './MultiSelectTaggable';
export * from './Utils/FormatNumber'; export * from './Utils/FormatNumber';
export * from './Utils/FormatDate'; export * from './Utils/FormatDate';
@@ -150,4 +151,5 @@ export {
MoneyFieldCell, MoneyFieldCell,
ItemsMultiSelect, ItemsMultiSelect,
Card, Card,
AvaterCell,
}; };

View File

@@ -73,7 +73,7 @@ function ManualJournalActionsBar({
// Handle table row size change. // Handle table row size change.
const handleTableRowSizeChange = (size) => { const handleTableRowSizeChange = (size) => {
addSetting('manual_journal', 'tableSize', size); addSetting('manualJournals', 'tableSize', size);
}; };
return ( return (

View File

@@ -13,6 +13,7 @@ import withManualJournals from './withManualJournals';
import withManualJournalsActions from './withManualJournalsActions'; import withManualJournalsActions from './withManualJournalsActions';
import withAlertsActions from 'containers/Alert/withAlertActions'; import withAlertsActions from 'containers/Alert/withAlertActions';
import withDrawerActions from 'containers/Drawer/withDrawerActions'; import withDrawerActions from 'containers/Drawer/withDrawerActions';
import withSettings from '../../Settings/withSettings';
import { useManualJournalsContext } from './ManualJournalsListProvider'; import { useManualJournalsContext } from './ManualJournalsListProvider';
import { useMemorizedColumnsWidths } from 'hooks'; import { useMemorizedColumnsWidths } from 'hooks';
@@ -38,6 +39,9 @@ function ManualJournalsDataTable({
// #ownProps // #ownProps
onSelectedRowsChange, onSelectedRowsChange,
// #withSettings
manualJournalsTableSize,
}) { }) {
// Manual journals context. // Manual journals context.
const { const {
@@ -125,6 +129,7 @@ function ManualJournalsDataTable({
onCellClick={handleCellClick} onCellClick={handleCellClick}
initialColumnsWidths={initialColumnsWidths} initialColumnsWidths={initialColumnsWidths}
onColumnResizing={handleColumnResizing} onColumnResizing={handleColumnResizing}
size={manualJournalsTableSize}
payload={{ payload={{
onDelete: handleDeleteJournal, onDelete: handleDeleteJournal,
onPublish: handlePublishJournal, onPublish: handlePublishJournal,
@@ -143,4 +148,7 @@ export default compose(
})), })),
withAlertsActions, withAlertsActions,
withDrawerActions, withDrawerActions,
withSettings(({ manualJournalsSettings }) => ({
manualJournalsTableSize: manualJournalsSettings?.tableSize,
})),
)(ManualJournalsDataTable); )(ManualJournalsDataTable);

View File

@@ -37,6 +37,7 @@ export const useManualJournalsColumns = () => {
className: 'journal_number', className: 'journal_number',
width: 100, width: 100,
clickable: true, clickable: true,
textOverview: true,
}, },
{ {
id: 'journal_type', id: 'journal_type',
@@ -44,6 +45,7 @@ export const useManualJournalsColumns = () => {
accessor: 'journal_type', accessor: 'journal_type',
width: 110, width: 110,
clickable: true, clickable: true,
textOverview: true,
}, },
{ {
id: 'status', id: 'status',

View File

@@ -17,7 +17,7 @@ import {
If, If,
DashboardActionViewsList, DashboardActionViewsList,
DashboardFilterButton, DashboardFilterButton,
DashboardRowsHeightButton DashboardRowsHeightButton,
} from 'components'; } from 'components';
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar'; import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
@@ -28,7 +28,8 @@ import withDialogActions from 'containers/Dialog/withDialogActions';
import withAccounts from 'containers/Accounts/withAccounts'; import withAccounts from 'containers/Accounts/withAccounts';
import withAlertActions from 'containers/Alert/withAlertActions'; import withAlertActions from 'containers/Alert/withAlertActions';
import withAccountsTableActions from './withAccountsTableActions'; import withAccountsTableActions from './withAccountsTableActions';
import withSettings from '../Settings/withSettings';
import withSettingsActions from '../Settings/withSettingsActions';
import { compose } from 'utils'; import { compose } from 'utils';
/** /**
@@ -51,6 +52,12 @@ function AccountsActionsBar({
// #ownProps // #ownProps
onFilterChanged, onFilterChanged,
// #withSettings
accountsTableSize,
// #withSettingsActions
addSetting,
}) { }) {
const { resourceViews, fields } = useAccountsChartContext(); const { resourceViews, fields } = useAccountsChartContext();
@@ -94,6 +101,10 @@ function AccountsActionsBar({
refresh(); refresh();
}; };
// Handle table row size change.
const handleTableRowSizeChange = (size) => {
addSetting('accounts', 'tableSize', size);
};
return ( return (
<DashboardActionsBar> <DashboardActionsBar>
<NavbarGroup> <NavbarGroup>
@@ -167,7 +178,10 @@ function AccountsActionsBar({
text={<T id={'import'} />} text={<T id={'import'} />}
/> />
<NavbarDivider /> <NavbarDivider />
<DashboardRowsHeightButton /> <DashboardRowsHeightButton
initialValue={accountsTableSize}
onChange={handleTableRowSizeChange}
/>
<NavbarDivider /> <NavbarDivider />
<Switch <Switch
labelElement={<T id={'inactive'} />} labelElement={<T id={'inactive'} />}
@@ -189,10 +203,14 @@ function AccountsActionsBar({
export default compose( export default compose(
withDialogActions, withDialogActions,
withAlertActions, withAlertActions,
withSettingsActions,
withAccounts(({ accountsSelectedRows, accountsTableState }) => ({ withAccounts(({ accountsSelectedRows, accountsTableState }) => ({
accountsSelectedRows, accountsSelectedRows,
accountsInactiveMode: accountsTableState.inactiveMode, accountsInactiveMode: accountsTableState.inactiveMode,
accountsFilterConditions: accountsTableState.filterRoles, accountsFilterConditions: accountsTableState.filterRoles,
})), })),
withSettings(({ accountsSettings }) => ({
accountsTableSize: accountsSettings.tableSize,
})),
withAccountsTableActions, withAccountsTableActions,
)(AccountsActionsBar); )(AccountsActionsBar);

View File

@@ -10,6 +10,7 @@ import { TABLES } from 'common/tables';
import TableVirtualizedListRows from 'components/Datatable/TableVirtualizedRows'; import TableVirtualizedListRows from 'components/Datatable/TableVirtualizedRows';
import TableSkeletonRows from 'components/Datatable/TableSkeletonRows'; import TableSkeletonRows from 'components/Datatable/TableSkeletonRows';
import TableSkeletonHeader from 'components/Datatable/TableHeaderSkeleton'; import TableSkeletonHeader from 'components/Datatable/TableHeaderSkeleton';
import withSettings from '../Settings/withSettings';
import { useAccountsChartContext } from './AccountsChartProvider'; import { useAccountsChartContext } from './AccountsChartProvider';
import { useMemorizedColumnsWidths } from '../../hooks'; import { useMemorizedColumnsWidths } from '../../hooks';
@@ -30,6 +31,9 @@ function AccountsDataTable({
// #withDrawerActions // #withDrawerActions
openDrawer, openDrawer,
// #withSettings
accountsTableSize,
}) { }) {
const { isAccountsLoading, isAccountsFetching, accounts } = const { isAccountsLoading, isAccountsFetching, accounts } =
useAccountsChartContext(); useAccountsChartContext();
@@ -102,11 +106,12 @@ function AccountsDataTable({
TableHeaderSkeletonRenderer={TableSkeletonHeader} TableHeaderSkeletonRenderer={TableSkeletonHeader}
ContextMenu={ActionsMenu} ContextMenu={ActionsMenu}
// #TableVirtualizedListRows props. // #TableVirtualizedListRows props.
vListrowHeight={42} vListrowHeight={accountsTableSize == 'small' ? 40 : 42}
vListOverscanRowCount={0} vListOverscanRowCount={0}
onCellClick={handleCellClick} onCellClick={handleCellClick}
initialColumnsWidths={initialColumnsWidths} initialColumnsWidths={initialColumnsWidths}
onColumnResizing={handleColumnResizing} onColumnResizing={handleColumnResizing}
size={accountsTableSize}
payload={{ payload={{
onEdit: handleEditAccount, onEdit: handleEditAccount,
onDelete: handleDeleteAccount, onDelete: handleDeleteAccount,
@@ -123,4 +128,7 @@ export default compose(
withAlertsActions, withAlertsActions,
withDrawerActions, withDrawerActions,
withDialogActions, withDialogActions,
withSettings(({ accountsSettings }) => ({
accountsTableSize: accountsSettings.tableSize,
})),
)(AccountsDataTable); )(AccountsDataTable);

View File

@@ -31,7 +31,7 @@ function CustomerBulkDeleteAlert({
closeAlert(name); closeAlert(name);
}; };
console.log(customersIds, 'EE');
// Handle confirm customers bulk delete. // Handle confirm customers bulk delete.
const handleConfirmBulkDelete = useCallback(() => { const handleConfirmBulkDelete = useCallback(() => {

View File

@@ -89,7 +89,7 @@ function CustomerActionsBar({
// Handle table row size change. // Handle table row size change.
const handleTableRowSizeChange = (size) => { const handleTableRowSizeChange = (size) => {
addSetting('customer', 'tableSize', size); addSetting('custoemrs', 'tableSize', size);
}; };
return ( return (
@@ -177,8 +177,8 @@ export default compose(
accountsInactiveMode: customersTableState.inactiveMode, accountsInactiveMode: customersTableState.inactiveMode,
customersFilterConditions: customersTableState.filterRoles, customersFilterConditions: customersTableState.filterRoles,
})), })),
// withSettings(({ }) => ({ withSettings(({ customersSettings }) => ({
// customersTableSize: customersTableSize: customersSettings?.tableSize,
// })), })),
withAlertActions, withAlertActions,
)(CustomerActionsBar); )(CustomerActionsBar);

View File

@@ -14,6 +14,7 @@ import withCustomersActions from './withCustomersActions';
import withAlertsActions from 'containers/Alert/withAlertActions'; import withAlertsActions from 'containers/Alert/withAlertActions';
import withDialogActions from 'containers/Dialog/withDialogActions'; import withDialogActions from 'containers/Dialog/withDialogActions';
import withDrawerActions from 'containers/Drawer/withDrawerActions'; import withDrawerActions from 'containers/Drawer/withDrawerActions';
import withSettings from '../../Settings/withSettings';
import { useCustomersListContext } from './CustomersListProvider'; import { useCustomersListContext } from './CustomersListProvider';
import { useMemorizedColumnsWidths } from 'hooks'; import { useMemorizedColumnsWidths } from 'hooks';
@@ -38,6 +39,9 @@ function CustomersTable({
// #withDialogActions // #withDialogActions
openDialog, openDialog,
// #withSettings
customersTableSize,
}) { }) {
const history = useHistory(); const history = useHistory();
@@ -135,6 +139,7 @@ function CustomersTable({
onCellClick={handleCellClick} onCellClick={handleCellClick}
initialColumnsWidths={initialColumnsWidths} initialColumnsWidths={initialColumnsWidths}
onColumnResizing={handleColumnResizing} onColumnResizing={handleColumnResizing}
size={customersTableSize}
payload={{ payload={{
onDelete: handleCustomerDelete, onDelete: handleCustomerDelete,
onEdit: handleCustomerEdit, onEdit: handleCustomerEdit,
@@ -155,4 +160,7 @@ export default compose(
withCustomersActions, withCustomersActions,
withDrawerActions, withDrawerActions,
withCustomers(({ customersTableState }) => ({ customersTableState })), withCustomers(({ customersTableState }) => ({ customersTableState })),
withSettings(({ customersSettings }) => ({
customersTableSize: customersSettings?.tableSize,
})),
)(CustomersTable); )(CustomersTable);

View File

@@ -1,17 +1,12 @@
import React, { useMemo } from 'react'; import React, { useMemo } from 'react';
import { import { Menu, MenuItem, MenuDivider, Intent } from '@blueprintjs/core';
Menu,
MenuItem,
MenuDivider,
Intent,
} from '@blueprintjs/core';
import clsx from 'classnames'; import clsx from 'classnames';
import intl from 'react-intl-universal'; import intl from 'react-intl-universal';
import { CLASSES } from '../../../common/classes'; import { Icon, Money, If, AvaterCell } from 'components';
import { Icon, Money, If } from 'components';
import { } from 'utils'; import { safeCallback } from 'utils';
import { safeCallback, firstLettersArgs } from 'utils';
/** /**
* Actions menu. * Actions menu.
@@ -69,13 +64,6 @@ export function ActionsMenu({
); );
} }
/**
* Avatar cell.
*/
export function AvatarCell(row) {
return <span className="avatar">{firstLettersArgs(row.display_name)}</span>;
}
/** /**
* Phone number accessor. * Phone number accessor.
*/ */
@@ -99,7 +87,7 @@ export function useCustomersTableColumns() {
{ {
id: 'avatar', id: 'avatar',
Header: '', Header: '',
accessor: AvatarCell, Cell: AvaterCell,
className: 'avatar', className: 'avatar',
width: 45, width: 45,
disableResizing: true, disableResizing: true,

View File

@@ -21,7 +21,7 @@ export const transformErrors = (errors, { setFieldError }) => {
intl.get('payment_number_is_not_unique'), intl.get('payment_number_is_not_unique'),
); );
} }
if (getError('INVALID_PAYMENT_AMOUNT')) { if (getError('INVALID_BILL_PAYMENT_AMOUNT')) {
setFieldError( setFieldError(
'payment_amount', 'payment_amount',
intl.get('the_payment_amount_bigger_than_invoice_due_amount'), intl.get('the_payment_amount_bigger_than_invoice_due_amount'),

View File

@@ -16,7 +16,7 @@ import withDialogActions from 'containers/Dialog/withDialogActions';
import withAlertsActions from 'containers/Alert/withAlertActions'; import withAlertsActions from 'containers/Alert/withAlertActions';
import withDrawerActions from 'containers/Drawer/withDrawerActions'; import withDrawerActions from 'containers/Drawer/withDrawerActions';
import { Icon, FormattedMessage as T } from 'components'; import { If, Icon, FormattedMessage as T } from 'components';
import { safeCallback, compose } from 'utils'; import { safeCallback, compose } from 'utils';
@@ -32,7 +32,7 @@ function BillDetailActionsBar({
}) { }) {
const history = useHistory(); const history = useHistory();
const { billId } = useBillDrawerContext(); const { billId, bill } = useBillDrawerContext();
// Handle edit bill. // Handle edit bill.
const onEditBill = () => { const onEditBill = () => {
@@ -45,6 +45,11 @@ function BillDetailActionsBar({
openAlert('bill-delete', { billId }); openAlert('bill-delete', { billId });
}; };
// Handle quick bill payment .
const handleQuickBillPayment = () => {
openDialog('quick-payment-made', { billId });
};
return ( return (
<DashboardActionsBar> <DashboardActionsBar>
<NavbarGroup> <NavbarGroup>
@@ -54,6 +59,14 @@ function BillDetailActionsBar({
text={<T id={'edit_bill'} />} text={<T id={'edit_bill'} />}
onClick={safeCallback(onEditBill)} onClick={safeCallback(onEditBill)}
/> />
<If condition={bill.is_open && !bill.is_fully_paid}>
<Button
className={Classes.MINIMAL}
icon={<Icon icon="quick-payment-16" iconSize={16} />}
text={<T id={'payment_divider'} />}
onClick={handleQuickBillPayment}
/>
</If>
<NavbarDivider /> <NavbarDivider />
<Button <Button
className={Classes.MINIMAL} className={Classes.MINIMAL}

View File

@@ -16,7 +16,7 @@ import withDialogActions from 'containers/Dialog/withDialogActions';
import withAlertsActions from 'containers/Alert/withAlertActions'; import withAlertsActions from 'containers/Alert/withAlertActions';
import withDrawerActions from 'containers/Drawer/withDrawerActions'; import withDrawerActions from 'containers/Drawer/withDrawerActions';
import { Icon, FormattedMessage as T } from 'components'; import { If, Icon, FormattedMessage as T } from 'components';
import { compose } from 'utils'; import { compose } from 'utils';
@@ -36,7 +36,7 @@ function InvoiceDetailActionsBar({
const history = useHistory(); const history = useHistory();
// Invoice detail drawer context. // Invoice detail drawer context.
const { invoiceId } = useInvoiceDetailDrawerContext(); const { invoiceId, invoice } = useInvoiceDetailDrawerContext();
// Handle edit sale invoice. // Handle edit sale invoice.
const handleEditInvoice = () => { const handleEditInvoice = () => {
@@ -54,6 +54,11 @@ function InvoiceDetailActionsBar({
openDialog('invoice-pdf-preview', { invoiceId }); openDialog('invoice-pdf-preview', { invoiceId });
}; };
// Handle quick payment invoice.
const handleQuickPaymentInvoice = () => {
openDialog('quick-payment-receive', { invoiceId });
};
return ( return (
<DashboardActionsBar> <DashboardActionsBar>
<NavbarGroup> <NavbarGroup>
@@ -63,6 +68,14 @@ function InvoiceDetailActionsBar({
text={<T id={'edit_invoice'} />} text={<T id={'edit_invoice'} />}
onClick={handleEditInvoice} onClick={handleEditInvoice}
/> />
<If condition={invoice.is_delivered && !invoice.is_fully_paid}>
<Button
className={Classes.MINIMAL}
icon={<Icon icon="quick-payment-16" iconSize={16} />}
text={<T id={'payment_divider'} />}
onClick={handleQuickPaymentInvoice}
/>
</If>
<NavbarDivider /> <NavbarDivider />
<Button <Button
className={Classes.MINIMAL} className={Classes.MINIMAL}

View File

@@ -1,4 +1,5 @@
import { AppToaster } from 'components'; import { AppToaster } from 'components';
import { Intent } from '@blueprintjs/core';
import moment from 'moment'; import moment from 'moment';
import intl from 'react-intl-universal'; import intl from 'react-intl-universal';
import * as R from 'ramda'; import * as R from 'ramda';
@@ -6,11 +7,13 @@ import {
defaultFastFieldShouldUpdate, defaultFastFieldShouldUpdate,
transformToForm, transformToForm,
repeatValue, repeatValue,
ensureEntriesHasEmptyLine ensureEntriesHasEmptyLine,
} from 'utils'; } from 'utils';
const ERROR = { const ERROR = {
EXPENSE_ALREADY_PUBLISHED: 'EXPENSE.ALREADY.PUBLISHED', EXPENSE_ALREADY_PUBLISHED: 'EXPENSE.ALREADY.PUBLISHED',
ENTRIES_ALLOCATED_COST_COULD_NOT_DELETED:
'ENTRIES_ALLOCATED_COST_COULD_NOT_DELETED',
}; };
// Transform API errors in toasts messages. // Transform API errors in toasts messages.
@@ -24,6 +27,14 @@ export const transformErrors = (errors, { setErrors }) => {
}), }),
); );
} }
if (hasError(ERROR.ENTRIES_ALLOCATED_COST_COULD_NOT_DELETED)) {
setErrors(
AppToaster.show({
intent: Intent.DANGER,
message: 'ENTRIES_ALLOCATED_COST_COULD_NOT_DELETED',
}),
);
}
}; };
export const MIN_LINES_NUMBER = 4; export const MIN_LINES_NUMBER = 4;

View File

@@ -80,7 +80,7 @@ function ExpensesActionsBar({
// Handle table row size change. // Handle table row size change.
const handleTableRowSizeChange = (size) => { const handleTableRowSizeChange = (size) => {
addSetting('expense', 'tableSize', size); addSetting('expenses', 'tableSize', size);
}; };
return ( return (
<DashboardActionsBar> <DashboardActionsBar>

View File

@@ -16,6 +16,7 @@ import withDashboardActions from 'containers/Dashboard/withDashboardActions';
import withExpensesActions from './withExpensesActions'; import withExpensesActions from './withExpensesActions';
import withAlertsActions from 'containers/Alert/withAlertActions'; import withAlertsActions from 'containers/Alert/withAlertActions';
import withDrawerActions from 'containers/Drawer/withDrawerActions'; import withDrawerActions from 'containers/Drawer/withDrawerActions';
import withSettings from '../../Settings/withSettings';
import { ActionsMenu, useExpensesTableColumns } from './components'; import { ActionsMenu, useExpensesTableColumns } from './components';
@@ -31,6 +32,9 @@ function ExpensesDataTable({
// #withAlertsActions // #withAlertsActions
openAlert, openAlert,
// #withSettings
expensesTableSize,
}) { }) {
// Expenses list context. // Expenses list context.
const { const {
@@ -119,6 +123,7 @@ function ExpensesDataTable({
onCellClick={handleCellClick} onCellClick={handleCellClick}
initialColumnsWidths={initialColumnsWidths} initialColumnsWidths={initialColumnsWidths}
onColumnResizing={handleColumnResizing} onColumnResizing={handleColumnResizing}
size={expensesTableSize}
payload={{ payload={{
onPublish: handlePublishExpense, onPublish: handlePublishExpense,
onDelete: handleDeleteExpense, onDelete: handleDeleteExpense,
@@ -135,4 +140,7 @@ export default compose(
withAlertsActions, withAlertsActions,
withDrawerActions, withDrawerActions,
withExpensesActions, withExpensesActions,
withSettings(({ expenseSettings }) => ({
expensesTableSize: expenseSettings?.tableSize,
})),
)(ExpensesDataTable); )(ExpensesDataTable);

View File

@@ -50,7 +50,7 @@ function ItemsCategoryActionsBar({
}); });
}; };
console.log(fields, categoriesFilterConditions, 'XXXX');
return ( return (
<DashboardActionsBar> <DashboardActionsBar>

View File

@@ -62,6 +62,18 @@ function BillForm({
bill_number: intl.get('bill_number_exists'), bill_number: intl.get('bill_number_exists'),
}); });
} }
if (
errors.some(
(e) => e.type === ERROR.ENTRIES_ALLOCATED_COST_COULD_NOT_DELETED,
)
) {
setErrors(
AppToaster.show({
intent: Intent.DANGER,
message: 'ENTRIES_ALLOCATED_COST_COULD_NOT_DELETED',
}),
);
}
}; };
// Handles form submit. // Handles form submit.

View File

@@ -72,7 +72,7 @@ function BillActionsBar({
// Handle table row size change. // Handle table row size change.
const handleTableRowSizeChange = (size) => { const handleTableRowSizeChange = (size) => {
addSetting('bill', 'tableSize', size); addSetting('bills', 'tableSize', size);
}; };
return ( return (
@@ -156,7 +156,7 @@ export default compose(
withBills(({ billsTableState }) => ({ withBills(({ billsTableState }) => ({
billsConditionsRoles: billsTableState.filterRoles, billsConditionsRoles: billsTableState.filterRoles,
})), })),
withSettings(({ billPaymentSettings }) => ({ withSettings(({ billsettings }) => ({
billsTableSize: billPaymentSettings?.tableSize, // fix to bill billsTableSize: billsettings?.tableSize,
})), })),
)(BillActionsBar); )(BillActionsBar);

View File

@@ -15,6 +15,7 @@ import withBillActions from './withBillsActions';
import withAlertsActions from 'containers/Alert/withAlertActions'; import withAlertsActions from 'containers/Alert/withAlertActions';
import withDialogActions from 'containers/Dialog/withDialogActions'; import withDialogActions from 'containers/Dialog/withDialogActions';
import withDrawerActions from 'containers/Drawer/withDrawerActions'; import withDrawerActions from 'containers/Drawer/withDrawerActions';
import withSettings from '../../../Settings/withSettings';
import { useBillsTableColumns, ActionsMenu } from './components'; import { useBillsTableColumns, ActionsMenu } from './components';
import { useBillsListContext } from './BillsListProvider'; import { useBillsListContext } from './BillsListProvider';
@@ -40,6 +41,9 @@ function BillsDataTable({
// #withDrawerActions // #withDrawerActions
openDrawer, openDrawer,
// #withSettings
billsTableSize,
}) { }) {
// Bills list context. // Bills list context.
const { bills, pagination, isBillsLoading, isBillsFetching, isEmptyStatus } = const { bills, pagination, isBillsLoading, isBillsFetching, isEmptyStatus } =
@@ -125,6 +129,7 @@ function BillsDataTable({
onCellClick={handleCellClick} onCellClick={handleCellClick}
initialColumnsWidths={initialColumnsWidths} initialColumnsWidths={initialColumnsWidths}
onColumnResizing={handleColumnResizing} onColumnResizing={handleColumnResizing}
size={billsTableSize}
payload={{ payload={{
onDelete: handleDeleteBill, onDelete: handleDeleteBill,
onEdit: handleEditBill, onEdit: handleEditBill,
@@ -144,4 +149,7 @@ export default compose(
withAlertsActions, withAlertsActions,
withDrawerActions, withDrawerActions,
withDialogActions, withDialogActions,
withSettings(({ billsettings }) => ({
billsTableSize: billsettings?.tableSize,
})),
)(BillsDataTable); )(BillsDataTable);

View File

@@ -57,7 +57,7 @@ export function ActionsMenu({
<If condition={original.is_open && !original.is_fully_paid}> <If condition={original.is_open && !original.is_fully_paid}>
<MenuItem <MenuItem
icon={<Icon icon="quick-payment-16" iconSize={16} />} icon={<Icon icon="quick-payment-16" iconSize={16} />}
text={intl.get('add_payment')} text={intl.get('payment_divider')}
onClick={safeCallback(onQuick, original)} onClick={safeCallback(onQuick, original)}
/> />
</If> </If>

View File

@@ -73,7 +73,7 @@ function PaymentMadeActionsBar({
// Handle table row size change. // Handle table row size change.
const handleTableRowSizeChange = (size) => { const handleTableRowSizeChange = (size) => {
addSetting('payment_made', 'tableSize', size); addSetting('billPayments', 'tableSize', size);
}; };
return ( return (

View File

@@ -16,6 +16,7 @@ import withCurrentOrganization from 'containers/Organization/withCurrentOrganiza
import withAlertsActions from 'containers/Alert/withAlertActions'; import withAlertsActions from 'containers/Alert/withAlertActions';
import withDrawerActions from 'containers/Drawer/withDrawerActions'; import withDrawerActions from 'containers/Drawer/withDrawerActions';
import withSettings from '../../../Settings/withSettings';
import { usePaymentMadesTableColumns, ActionsMenu } from './components'; import { usePaymentMadesTableColumns, ActionsMenu } from './components';
import { usePaymentMadesListContext } from './PaymentMadesListProvider'; import { usePaymentMadesListContext } from './PaymentMadesListProvider';
@@ -36,6 +37,9 @@ function PaymentMadesTable({
// #withDrawerActions // #withDrawerActions
openDrawer, openDrawer,
// #withSettings
paymentMadesTableSize,
}) { }) {
// Payment mades table columns. // Payment mades table columns.
const columns = usePaymentMadesTableColumns(); const columns = usePaymentMadesTableColumns();
@@ -114,6 +118,7 @@ function PaymentMadesTable({
onCellClick={handleCellClick} onCellClick={handleCellClick}
initialColumnsWidths={initialColumnsWidths} initialColumnsWidths={initialColumnsWidths}
onColumnResizing={handleColumnResizing} onColumnResizing={handleColumnResizing}
size={paymentMadesTableSize}
payload={{ payload={{
onEdit: handleEditPaymentMade, onEdit: handleEditPaymentMade,
onDelete: handleDeletePaymentMade, onDelete: handleDeletePaymentMade,
@@ -130,4 +135,7 @@ export default compose(
withAlertsActions, withAlertsActions,
withDrawerActions, withDrawerActions,
withCurrentOrganization(), withCurrentOrganization(),
withSettings(({ billPaymentSettings }) => ({
paymentMadesTableSize: billPaymentSettings?.tableSize,
})),
)(PaymentMadesTable); )(PaymentMadesTable);

View File

@@ -73,7 +73,7 @@ function EstimateActionsBar({
// Handle table row size change. // Handle table row size change.
const handleTableRowSizeChange = (size) => { const handleTableRowSizeChange = (size) => {
addSetting('estimate', 'tableSize', size); addSetting('salesEstimates', 'tableSize', size);
}; };
return ( return (

View File

@@ -10,6 +10,7 @@ import withEstimatesActions from './withEstimatesActions';
import withAlertsActions from 'containers/Alert/withAlertActions'; import withAlertsActions from 'containers/Alert/withAlertActions';
import withDrawerActions from 'containers/Drawer/withDrawerActions'; import withDrawerActions from 'containers/Drawer/withDrawerActions';
import withDialogActions from 'containers/Dialog/withDialogActions'; import withDialogActions from 'containers/Dialog/withDialogActions';
import withSettings from '../../../Settings/withSettings';
import { useEstimatesListContext } from './EstimatesListProvider'; import { useEstimatesListContext } from './EstimatesListProvider';
import { useMemorizedColumnsWidths } from 'hooks'; import { useMemorizedColumnsWidths } from 'hooks';
@@ -33,6 +34,9 @@ function EstimatesDataTable({
// #withDialogAction // #withDialogAction
openDialog, openDialog,
// #withSettings
estimatesTableSize,
}) { }) {
const history = useHistory(); const history = useHistory();
@@ -135,6 +139,7 @@ function EstimatesDataTable({
onCellClick={handleCellClick} onCellClick={handleCellClick}
initialColumnsWidths={initialColumnsWidths} initialColumnsWidths={initialColumnsWidths}
onColumnResizing={handleColumnResizing} onColumnResizing={handleColumnResizing}
size={estimatesTableSize}
payload={{ payload={{
onApprove: handleApproveEstimate, onApprove: handleApproveEstimate,
onEdit: handleEditEstimate, onEdit: handleEditEstimate,
@@ -155,4 +160,7 @@ export default compose(
withAlertsActions, withAlertsActions,
withDrawerActions, withDrawerActions,
withDialogActions, withDialogActions,
withSettings(({ estimatesSettings }) => ({
estimatesTableSize: estimatesSettings?.tableSize,
})),
)(EstimatesDataTable); )(EstimatesDataTable);

View File

@@ -71,7 +71,7 @@ function InvoiceActionsBar({
// Handle table row size change. // Handle table row size change.
const handleTableRowSizeChange = (size) => { const handleTableRowSizeChange = (size) => {
addSetting('invoice', 'tableSize', size); addSetting('salesInvoices', 'tableSize', size);
}; };
return ( return (

View File

@@ -16,6 +16,7 @@ import withInvoiceActions from './withInvoiceActions';
import withAlertsActions from 'containers/Alert/withAlertActions'; import withAlertsActions from 'containers/Alert/withAlertActions';
import withDrawerActions from 'containers/Drawer/withDrawerActions'; import withDrawerActions from 'containers/Drawer/withDrawerActions';
import withDialogActions from 'containers/Dialog/withDialogActions'; import withDialogActions from 'containers/Dialog/withDialogActions';
import withSettings from '../../../Settings/withSettings';
import { useInvoicesTableColumns, ActionsMenu } from './components'; import { useInvoicesTableColumns, ActionsMenu } from './components';
import { useInvoicesListContext } from './InvoicesListProvider'; import { useInvoicesListContext } from './InvoicesListProvider';
@@ -40,6 +41,9 @@ function InvoicesDataTable({
// #withDialogAction // #withDialogAction
openDialog, openDialog,
// #withSettings
invoicesTableSize,
}) { }) {
const history = useHistory(); const history = useHistory();
@@ -135,6 +139,7 @@ function InvoicesDataTable({
onCellClick={handleCellClick} onCellClick={handleCellClick}
initialColumnsWidths={initialColumnsWidths} initialColumnsWidths={initialColumnsWidths}
onColumnResizing={handleColumnResizing} onColumnResizing={handleColumnResizing}
size={invoicesTableSize}
payload={{ payload={{
onDelete: handleDeleteInvoice, onDelete: handleDeleteInvoice,
onDeliver: handleDeliverInvoice, onDeliver: handleDeliverInvoice,
@@ -155,4 +160,7 @@ export default compose(
withDrawerActions, withDrawerActions,
withDialogActions, withDialogActions,
withInvoices(({ invoicesTableState }) => ({ invoicesTableState })), withInvoices(({ invoicesTableState }) => ({ invoicesTableState })),
withSettings(({ invoiceSettings }) => ({
invoicesTableSize: invoiceSettings?.tableSize,
})),
)(InvoicesDataTable); )(InvoicesDataTable);

View File

@@ -55,6 +55,7 @@ export const statusAccessor = (row) => {
})} })}
</span> </span>
<ProgressBar <ProgressBar
animate={false} animate={false}
stripes={false} stripes={false}
intent={Intent.PRIMARY} intent={Intent.PRIMARY}
@@ -130,7 +131,7 @@ export function ActionsMenu({
<If condition={original.is_delivered && !original.is_fully_paid}> <If condition={original.is_delivered && !original.is_fully_paid}>
<MenuItem <MenuItem
icon={<Icon icon="quick-payment-16" iconSize={16} />} icon={<Icon icon="quick-payment-16" iconSize={16} />}
text={intl.get('add_payment')} text={intl.get('payment_divider')}
onClick={safeCallback(onQuick, original)} onClick={safeCallback(onQuick, original)}
/> />
</If> </If>

View File

@@ -73,7 +73,7 @@ function PaymentReceiveActionsBar({
// Handle table row size change. // Handle table row size change.
const handleTableRowSizeChange = (size) => { const handleTableRowSizeChange = (size) => {
addSetting('payment_receive', 'tableSize', size); addSetting('paymentReceives', 'tableSize', size);
}; };
return ( return (

View File

@@ -13,6 +13,7 @@ import withPaymentReceives from './withPaymentReceives';
import withPaymentReceivesActions from './withPaymentReceivesActions'; import withPaymentReceivesActions from './withPaymentReceivesActions';
import withAlertsActions from 'containers/Alert/withAlertActions'; import withAlertsActions from 'containers/Alert/withAlertActions';
import withDrawerActions from 'containers/Drawer/withDrawerActions'; import withDrawerActions from 'containers/Drawer/withDrawerActions';
import withSettings from '../../../Settings/withSettings';
import { usePaymentReceivesColumns, ActionsMenu } from './components'; import { usePaymentReceivesColumns, ActionsMenu } from './components';
import { usePaymentReceivesListContext } from './PaymentReceiptsListProvider'; import { usePaymentReceivesListContext } from './PaymentReceiptsListProvider';
@@ -33,6 +34,9 @@ function PaymentReceivesDataTable({
// #withDrawerActions // #withDrawerActions
openDrawer, openDrawer,
// #withSettings
paymentReceivesTableSize,
}) { }) {
const history = useHistory(); const history = useHistory();
@@ -115,6 +119,7 @@ function PaymentReceivesDataTable({
onCellClick={handleCellClick} onCellClick={handleCellClick}
initialColumnsWidths={initialColumnsWidths} initialColumnsWidths={initialColumnsWidths}
onColumnResizing={handleColumnResizing} onColumnResizing={handleColumnResizing}
size={paymentReceivesTableSize}
payload={{ payload={{
onDelete: handleDeletePaymentReceive, onDelete: handleDeletePaymentReceive,
onEdit: handleEditPaymentReceive, onEdit: handleEditPaymentReceive,
@@ -132,4 +137,7 @@ export default compose(
withPaymentReceives(({ paymentReceivesTableState }) => ({ withPaymentReceives(({ paymentReceivesTableState }) => ({
paymentReceivesTableState, paymentReceivesTableState,
})), })),
withSettings(({ paymentReceiveSettings }) => ({
paymentReceivesTableSize: paymentReceiveSettings?.tableSize,
})),
)(PaymentReceivesDataTable); )(PaymentReceivesDataTable);

View File

@@ -72,7 +72,7 @@ function ReceiptActionsBar({
// Handle table row size change. // Handle table row size change.
const handleTableRowSizeChange = (size) => { const handleTableRowSizeChange = (size) => {
addSetting('receipt', 'tableSize', size); addSetting('salesReceipts', 'tableSize', size);
}; };
return ( return (

View File

@@ -14,6 +14,7 @@ import withDrawerActions from 'containers/Drawer/withDrawerActions';
import withDialogActions from 'containers/Dialog/withDialogActions'; import withDialogActions from 'containers/Dialog/withDialogActions';
import withReceipts from './withReceipts'; import withReceipts from './withReceipts';
import withReceiptsActions from './withReceiptsActions'; import withReceiptsActions from './withReceiptsActions';
import withSettings from '../../../Settings/withSettings';
import { useReceiptsListContext } from './ReceiptsListProvider'; import { useReceiptsListContext } from './ReceiptsListProvider';
import { useReceiptsTableColumns, ActionsMenu } from './components'; import { useReceiptsTableColumns, ActionsMenu } from './components';
@@ -37,6 +38,9 @@ function ReceiptsDataTable({
// #withDialogAction // #withDialogAction
openDialog, openDialog,
// #withSettings
receiptsTableSize,
}) { }) {
const history = useHistory(); const history = useHistory();
@@ -125,6 +129,7 @@ function ReceiptsDataTable({
onCellClick={handleCellClick} onCellClick={handleCellClick}
initialColumnsWidths={initialColumnsWidths} initialColumnsWidths={initialColumnsWidths}
onColumnResizing={handleColumnResizing} onColumnResizing={handleColumnResizing}
size={receiptsTableSize}
payload={{ payload={{
onEdit: handleEditReceipt, onEdit: handleEditReceipt,
onDelete: handleDeleteReceipt, onDelete: handleDeleteReceipt,
@@ -145,4 +150,7 @@ export default compose(
withReceipts(({ receiptTableState }) => ({ withReceipts(({ receiptTableState }) => ({
receiptTableState, receiptTableState,
})), })),
withSettings(({ receiptSettings }) => ({
receiptsTableSize: receiptSettings?.tableSize,
})),
)(ReceiptsDataTable); )(ReceiptsDataTable);

View File

@@ -6,6 +6,7 @@ export default (mapState) => {
organizationSettings: state.settings.data.organization, organizationSettings: state.settings.data.organization,
manualJournalsSettings: state.settings.data.manualJournals, manualJournalsSettings: state.settings.data.manualJournals,
billPaymentSettings: state.settings.data.billPayments, billPaymentSettings: state.settings.data.billPayments,
billsettings: state.settings.data.bills,
paymentReceiveSettings: state.settings.data.paymentReceives, paymentReceiveSettings: state.settings.data.paymentReceives,
estimatesSettings: state.settings.data.salesEstimates, estimatesSettings: state.settings.data.salesEstimates,
receiptSettings: state.settings.data.salesReceipts, receiptSettings: state.settings.data.salesReceipts,
@@ -13,6 +14,8 @@ export default (mapState) => {
itemsSettings: state.settings.data.items, itemsSettings: state.settings.data.items,
expenseSettings: state.settings.data.expenses, expenseSettings: state.settings.data.expenses,
accountsSettings: state.settings.data.accounts, accountsSettings: state.settings.data.accounts,
customersSettings: state.settings.data.custoemrs,
vendorsSettings: state.settings.data.vendors,
}; };
return mapState ? mapState(mapped, state, props) : mapped; return mapState ? mapState(mapped, state, props) : mapped;
}; };

View File

@@ -79,7 +79,7 @@ function VendorActionsBar({
}; };
const handleTableRowSizeChange = (size) => { const handleTableRowSizeChange = (size) => {
addSetting('vendor', 'tableSize', size); addSetting('vendors', 'tableSize', size);
}; };
return ( return (
<DashboardActionsBar> <DashboardActionsBar>
@@ -160,7 +160,7 @@ export default compose(
vendorsInactiveMode: vendorsTableState.inactiveMode, vendorsInactiveMode: vendorsTableState.inactiveMode,
vendorsFilterConditions: vendorsTableState.filterRoles, vendorsFilterConditions: vendorsTableState.filterRoles,
})), })),
// withSettings(({ }) => ({ withSettings(({ vendorsSettings }) => ({
// vendorsTableSize: vendorsTableSize: vendorsSettings?.tableSize,
// })), })),
)(VendorActionsBar); )(VendorActionsBar);

View File

@@ -17,6 +17,7 @@ import withVendors from './withVendors';
import withAlertsActions from 'containers/Alert/withAlertActions'; import withAlertsActions from 'containers/Alert/withAlertActions';
import withDialogActions from 'containers/Dialog/withDialogActions'; import withDialogActions from 'containers/Dialog/withDialogActions';
import withDrawerActions from 'containers/Drawer/withDrawerActions'; import withDrawerActions from 'containers/Drawer/withDrawerActions';
import withSettings from '../../Settings/withSettings';
import { ActionsMenu, useVendorsTableColumns } from './components'; import { ActionsMenu, useVendorsTableColumns } from './components';
@@ -40,6 +41,9 @@ function VendorsTable({
// #withDialogActions // #withDialogActions
openDialog, openDialog,
// #withSettings
vendorsTableSize,
}) { }) {
// Vendors list context. // Vendors list context.
const { const {
@@ -141,6 +145,7 @@ function VendorsTable({
onCellClick={handleCellClick} onCellClick={handleCellClick}
initialColumnsWidths={initialColumnsWidths} initialColumnsWidths={initialColumnsWidths}
onColumnResizing={handleColumnResizing} onColumnResizing={handleColumnResizing}
size={vendorsTableSize}
payload={{ payload={{
onEdit: handleEditVendor, onEdit: handleEditVendor,
onDelete: handleDeleteVendor, onDelete: handleDeleteVendor,
@@ -161,4 +166,7 @@ export default compose(
withDrawerActions, withDrawerActions,
withVendors(({ vendorsTableState }) => ({ vendorsTableState })), withVendors(({ vendorsTableState }) => ({ vendorsTableState })),
withSettings(({ vendorsSettings }) => ({
vendorsTableSize: vendorsSettings?.tableSize,
})),
)(VendorsTable); )(VendorsTable);

View File

@@ -10,7 +10,7 @@ import {
} from '@blueprintjs/core'; } from '@blueprintjs/core';
import intl from 'react-intl-universal'; import intl from 'react-intl-universal';
import { Icon, Money, If } from 'components'; import { Icon, Money, If, AvaterCell } from 'components';
import { safeCallback, firstLettersArgs } from 'utils'; import { safeCallback, firstLettersArgs } from 'utils';
/** /**
@@ -113,7 +113,7 @@ export function useVendorsTableColumns() {
{ {
id: 'avatar', id: 'avatar',
Header: '', Header: '',
accessor: AvatarAccessor, Cell: AvaterCell,
className: 'avatar', className: 'avatar',
width: 45, width: 45,
disableResizing: true, disableResizing: true,

View File

@@ -5,7 +5,7 @@ import useApiRequest from '../useRequest';
import t from './types'; import t from './types';
const defaultPagination = { const defaultPagination = {
pageSize: 12, pageSize: 20,
page: 0, page: 0,
pagesCount: 0, pagesCount: 0,
}; };

View File

@@ -86,7 +86,7 @@ export function useEstimates(query, props) {
estimates: [], estimates: [],
pagination: { pagination: {
page: 1, page: 1,
pageSize: 12, pageSize: 20,
total: 0, total: 0,
}, },
filterMeta: {}, filterMeta: {},

View File

@@ -5,7 +5,7 @@ import { transformPagination } from 'utils';
import useApiRequest from '../useRequest'; import useApiRequest from '../useRequest';
const defaultPagination = { const defaultPagination = {
pageSize: 12, pageSize: 20,
page: 0, page: 0,
pagesCount: 0, pagesCount: 0,
}; };
@@ -82,7 +82,7 @@ export function useExchangeRates(query, props) {
exchangesRates: [], exchangesRates: [],
pagination: { pagination: {
page: 1, page: 1,
pageSize: 12, pageSize: 20,
total: 0, total: 0,
}, },
filterMeta: {}, filterMeta: {},

View File

@@ -5,7 +5,7 @@ import { transformPagination } from 'utils';
import t from './types'; import t from './types';
const defaultPagination = { const defaultPagination = {
pageSize: 12, pageSize: 20,
page: 0, page: 0,
pagesCount: 0, pagesCount: 0,
}; };

View File

@@ -76,7 +76,7 @@ export function useInventoryAdjustments(query, props) {
transactions: [], transactions: [],
pagination: { pagination: {
page: 1, page: 1,
pageSize: 12, pageSize: 20,
total: 0, total: 0,
pagesCount: 0, pagesCount: 0,
}, },

View File

@@ -110,7 +110,7 @@ export function useInvoices(query, props) {
invoices: [], invoices: [],
pagination: { pagination: {
page: 1, page: 1,
pageSize: 12, pageSize: 20,
total: 0, total: 0,
}, },
filterMeta: {}, filterMeta: {},

View File

@@ -5,7 +5,7 @@ import useApiRequest from '../useRequest';
import t from './types'; import t from './types';
const DEFAULT_PAGINATION = { const DEFAULT_PAGINATION = {
pageSize: 12, pageSize: 20,
page: 0, page: 0,
pagesCount: 0, pagesCount: 0,
}; };
@@ -75,7 +75,7 @@ export function useDeleteItem(props) {
/** /**
* Activate the given item. * Activate the given item.
*/ */
export function useActivateItem(props) { export function useActivateItem(props) {
const queryClient = useQueryClient(); const queryClient = useQueryClient();
const apiRequest = useApiRequest(); const apiRequest = useApiRequest();
@@ -114,7 +114,9 @@ export function useInactivateItem(props) {
const transformItemsResponse = (response) => { const transformItemsResponse = (response) => {
return { return {
items: response.data.items, items: response.data.items,
pagination: transformPagination(transformResponse(response.data.pagination)), pagination: transformPagination(
transformResponse(response.data.pagination),
),
filterMeta: transformResponse(response.data.filter_meta), filterMeta: transformResponse(response.data.filter_meta),
}; };
}; };
@@ -137,8 +139,8 @@ export function useItems(query, props) {
pagination: DEFAULT_PAGINATION, pagination: DEFAULT_PAGINATION,
filterMeta: {}, filterMeta: {},
}, },
...props ...props,
} },
); );
} }
@@ -149,7 +151,7 @@ export function useRefreshItems() {
refresh: () => { refresh: () => {
queryClient.invalidateQueries(t.ITEMS); queryClient.invalidateQueries(t.ITEMS);
}, },
} };
} }
/** /**
@@ -166,7 +168,7 @@ export function useItem(id, props) {
{ {
select: (response) => response.data.item, select: (response) => response.data.item,
defaultData: {}, defaultData: {},
...props ...props,
}, },
); );
} }

View File

@@ -44,7 +44,7 @@ export function usePaymentReceives(query, props) {
select: transformPaymentReceives, select: transformPaymentReceives,
defaultData: { defaultData: {
paymentReceives: [], paymentReceives: [],
pagination: { page: 1, pageSize: 12, total: 0 }, pagination: { page: 1, pageSize: 20, total: 0 },
filterMeta: {}, filterMeta: {},
}, },
...props, ...props,

View File

@@ -833,7 +833,7 @@
"the_payment_amount_that_received": "مبلغ الدفع الذي تم استلامه من الزبون أكبر من المبلغ المستحق لهذه الفاتورة.", "the_payment_amount_that_received": "مبلغ الدفع الذي تم استلامه من الزبون أكبر من المبلغ المستحق لهذه الفاتورة.",
"invoice_number": "رقم الفاتورة", "invoice_number": "رقم الفاتورة",
"make_payment": "قم بالدفع", "make_payment": "قم بالدفع",
"add_payment": "إضافة الدفع", "payment_divider": "إضافة الدفع",
"quick_receive_payment": "سند قبض سريع", "quick_receive_payment": "سند قبض سريع",
"amount_received": "تم استلام المبلغ", "amount_received": "تم استلام المبلغ",
"payment_receive_number_required": "مطلوب رقم استلام الدفعة", "payment_receive_number_required": "مطلوب رقم استلام الدفعة",

View File

@@ -820,7 +820,7 @@
"invoice_date": "Invoice date", "invoice_date": "Invoice date",
"invoice_amount": "Invoice amount", "invoice_amount": "Invoice amount",
"make_payment": "Make Payment", "make_payment": "Make Payment",
"add_payment": "Add Payment", "payment_divider": "Payment divider",
"quick_receive_payment": "Quick Receive Payment", "quick_receive_payment": "Quick Receive Payment",
"amount_received": "Amount Received", "amount_received": "Amount Received",
"payment_no": "Payment No.", "payment_no": "Payment No.",

View File

@@ -5,7 +5,7 @@ import { createTableStateReducers } from 'store/tableState.reducer';
import t from 'store/types'; import t from 'store/types';
export const defaultTableQuery = { export const defaultTableQuery = {
pageSize: 12, pageSize: 20,
pageIndex: 0, pageIndex: 0,
filterRoles: [], filterRoles: [],
viewSlug: null, viewSlug: null,

View File

@@ -1,13 +1,11 @@
import { createReducer } from '@reduxjs/toolkit'; import { createReducer } from '@reduxjs/toolkit';
import { persistReducer, purgeStoredState } from 'redux-persist'; import { persistReducer, purgeStoredState } from 'redux-persist';
import storage from 'redux-persist/lib/storage'; import storage from 'redux-persist/lib/storage';
import { import { createTableStateReducers } from 'store/tableState.reducer';
createTableStateReducers,
} from 'store/tableState.reducer';
import t from 'store/types'; import t from 'store/types';
export const defaultTableQuery = { export const defaultTableQuery = {
pageSize: 12, pageSize: 20,
pageIndex: 0, pageIndex: 0,
filterRoles: [], filterRoles: [],
viewSlug: null, viewSlug: null,
@@ -33,7 +31,4 @@ const reducerInstance = createReducer(initialState, {
}, },
}); });
export default persistReducer( export default persistReducer(CONFIG, reducerInstance);
CONFIG,
reducerInstance,
);

View File

@@ -3,7 +3,7 @@ import { createTableStateReducers } from 'store/tableState.reducer';
const initialState = { const initialState = {
tableState: { tableState: {
pageSize: 12, pageSize: 20,
pageIndex: 0, pageIndex: 0,
}, },
}; };

View File

@@ -1,13 +1,11 @@
import { createReducer } from '@reduxjs/toolkit'; import { createReducer } from '@reduxjs/toolkit';
import { persistReducer, purgeStoredState } from 'redux-persist'; import { persistReducer, purgeStoredState } from 'redux-persist';
import storage from 'redux-persist/lib/storage'; import storage from 'redux-persist/lib/storage';
import { import { createTableStateReducers } from 'store/tableState.reducer';
createTableStateReducers,
} from 'store/tableState.reducer';
import t from 'store/types'; import t from 'store/types';
export const defaultTableQuery = { export const defaultTableQuery = {
pageSize: 12, pageSize: 20,
pageIndex: 0, pageIndex: 0,
filterRoles: [], filterRoles: [],
viewSlug: null, viewSlug: null,
@@ -30,10 +28,7 @@ const reducerInstance = createReducer(initialState, {
[t.RESET]: () => { [t.RESET]: () => {
purgeStoredState(CONFIG); purgeStoredState(CONFIG);
} },
}); });
export default persistReducer( export default persistReducer(CONFIG, reducerInstance);
CONFIG,
reducerInstance,
);

View File

@@ -5,7 +5,7 @@ import { createTableStateReducers } from 'store/tableState.reducer';
import t from 'store/types'; import t from 'store/types';
export const defaultTableQuery = { export const defaultTableQuery = {
pageSize: 12, pageSize: 20,
pageIndex: 0, pageIndex: 0,
filterRoles: [], filterRoles: [],
sortBy: [], sortBy: [],

View File

@@ -1,13 +1,11 @@
import { createReducer } from '@reduxjs/toolkit'; import { createReducer } from '@reduxjs/toolkit';
import { persistReducer, purgeStoredState } from 'redux-persist'; import { persistReducer, purgeStoredState } from 'redux-persist';
import storage from 'redux-persist/lib/storage'; import storage from 'redux-persist/lib/storage';
import { import { createTableStateReducers } from 'store/tableState.reducer';
createTableStateReducers,
} from 'store/tableState.reducer';
import t from 'store/types'; import t from 'store/types';
export const defaultTableQuery = { export const defaultTableQuery = {
pageSize: 12, pageSize: 20,
pageIndex: 0, pageIndex: 0,
filterRoles: [], filterRoles: [],
viewSlug: null, viewSlug: null,
@@ -33,7 +31,4 @@ const reducerInstance = createReducer(initialState, {
}, },
}); });
export default persistReducer( export default persistReducer(CONFIG, reducerInstance);
CONFIG,
reducerInstance,
);

View File

@@ -4,9 +4,8 @@ import storage from 'redux-persist/lib/storage';
import { createTableStateReducers } from 'store/tableState.reducer'; import { createTableStateReducers } from 'store/tableState.reducer';
import t from 'store/types'; import t from 'store/types';
export const defaultTableQuery = { export const defaultTableQuery = {
pageSize: 12, pageSize: 20,
pageIndex: 0, pageIndex: 0,
filterRoles: [], filterRoles: [],
}; };
@@ -28,7 +27,7 @@ const reducerInstance = createReducer(initialState, {
[t.RESET]: () => { [t.RESET]: () => {
purgeStoredState(CONFIG); purgeStoredState(CONFIG);
} },
}); });
export default persistReducer(CONFIG, reducerInstance); export default persistReducer(CONFIG, reducerInstance);

View File

@@ -5,7 +5,7 @@ import { createTableStateReducers } from 'store/tableState.reducer';
// Default table query state. // Default table query state.
export const defaultTableQueryState = { export const defaultTableQueryState = {
pageSize: 12, pageSize: 20,
pageIndex: 0, pageIndex: 0,
inactiveMode: false, inactiveMode: false,
filterRoles: [], filterRoles: [],

View File

@@ -6,7 +6,7 @@ import t from 'store/types';
// Default table query. // Default table query.
export const defaultTableQuery = { export const defaultTableQuery = {
pageSize: 12, pageSize: 20,
pageIndex: 0, pageIndex: 0,
filterRoles: [], filterRoles: [],
viewSlug: null, viewSlug: null,
@@ -30,7 +30,7 @@ const reducerInstance = createReducer(initialState, {
[t.RESET]: () => { [t.RESET]: () => {
purgeStoredState(CONFIG); purgeStoredState(CONFIG);
} },
}); });
export default persistReducer(CONFIG, reducerInstance); export default persistReducer(CONFIG, reducerInstance);

View File

@@ -6,7 +6,7 @@ import t from 'store/types';
const initialState = { const initialState = {
tableState: { tableState: {
pageSize: 12, pageSize: 20,
pageIndex: 0, pageIndex: 0,
sortBy: [], sortBy: [],
}, },

View File

@@ -5,7 +5,7 @@ import { createTableStateReducers } from 'store/tableState.reducer';
import t from 'store/types'; import t from 'store/types';
export const defaultTableQuery = { export const defaultTableQuery = {
pageSize: 12, pageSize: 20,
pageIndex: 0, pageIndex: 0,
filterRoles: [], filterRoles: [],
inactiveMode: false, inactiveMode: false,

View File

@@ -5,11 +5,11 @@ import { createTableStateReducers } from 'store/tableState.reducer';
import t from 'store/types'; import t from 'store/types';
export const defaultTableQuery = { export const defaultTableQuery = {
pageSize: 12, pageSize: 20,
pageIndex: 0, pageIndex: 0,
filterRoles: [], filterRoles: [],
viewSlug: null, viewSlug: null,
} };
const initialState = { const initialState = {
tableState: defaultTableQuery, tableState: defaultTableQuery,

View File

@@ -5,7 +5,7 @@ import { createTableStateReducers } from 'store/tableState.reducer';
import t from 'store/types'; import t from 'store/types';
export const defaultTableQuery = { export const defaultTableQuery = {
pageSize: 12, pageSize: 20,
pageIndex: 0, pageIndex: 0,
filterRoles: [], filterRoles: [],
viewSlug: null, viewSlug: null,

View File

@@ -10,13 +10,39 @@ const initialState = {
organization: { organization: {
name: 'Bigcapital, LLC', name: 'Bigcapital, LLC',
}, },
manualJournals: {}, manualJournals: {
bills: {}, tableSize: 'medium',
billPayments: {}, },
salesEstimates: {}, bills: {
tableSize: 'medium',
},
billPayments: {
tableSize: 'medium',
},
paymentReceives: {
tableSize: 'medium',
},
salesEstimates: {
tableSize: 'medium',
},
items: { items: {
tableSize: 'medium', tableSize: 'medium',
}, },
salesInvoices: {
tableSize: 'medium',
},
salesReceipts: {
tableSize: 'medium',
},
expenses: {
tableSize: 'medium',
},
customers: {
tableSize: 'medium',
},
vendors: {
tableSize: 'medium',
},
}, },
}; };

View File

@@ -5,7 +5,7 @@ import { createTableStateReducers } from 'store/tableState.reducer';
import t from 'store/types'; import t from 'store/types';
export const defaultTableQueryState = { export const defaultTableQueryState = {
pageSize: 12, pageSize: 20,
pageIndex: 0, pageIndex: 0,
inactiveMode: false, inactiveMode: false,
filterRoles: [], filterRoles: [],

View File

@@ -34,7 +34,7 @@
border-radius: 8px; border-radius: 8px;
} }
} }
.account-desc{ .account-desc {
font-size: 11px; font-size: 11px;
color: hsl(0, 0%, 50%); color: hsl(0, 0%, 50%);
margin-top: 2px; margin-top: 2px;
@@ -57,5 +57,15 @@
} }
} }
} }
.table-size--small {
.tbody .tr {
.normal {
svg {
width: 14px;
height: 14px;
}
}
}
}
} }
} }

View File

@@ -1,9 +1,6 @@
.dashboard__insider--bills { .dashboard__insider--bills {
.bigcapital-datatable { .bigcapital-datatable {
.tbody { .tbody {
.tr {
min-height: 46px;
}
.td.amount { .td.amount {
.cell-inner { .cell-inner {
> span { > span {

View File

@@ -1,27 +1,33 @@
.dashboard__insider--customers-list {
.bigcapital-datatable {
.dashboard__insider--customers-list{ .tbody {
.tr .td {
.bigcapital-datatable{
.tr .td{
padding-top: 0.5rem; padding-top: 0.5rem;
padding-bottom: 0.5rem; padding-bottom: 0.5rem;
} }
.avatar.td{ .avatar.td {
.avatar {
.avatar{
height: 30px;
width: 30px;
display: inline-block; display: inline-block;
background: #adbcc9; background: #adbcc9;
border-radius: 50%; border-radius: 50%;
line-height: 30px;
text-align: center; text-align: center;
font-weight: 400; font-weight: 400;
font-size: 14px;
color: #fff; color: #fff;
&[data-size='medium'] {
height: 30px;
width: 30px;
line-height: 30px;
font-size: 14px;
}
&[data-size='small'] {
height: 25px;
width: 25px;
line-height: 25px;
font-size: 12px;
}
}
} }
} }
} }

View File

@@ -5,10 +5,6 @@
.bigcapital-datatable { .bigcapital-datatable {
.table { .table {
.tbody { .tbody {
.tr{
min-height: 46px;
}
.td.amount { .td.amount {
span { span {
font-weight: 600; font-weight: 600;

View File

@@ -4,9 +4,9 @@
} }
.tbody { .tbody {
.tr .td{ // .tr .td{
padding: 0.8rem 0.5rem; // padding: 0.8rem 0.5rem;
} // }
.td.amount { .td.amount {
.bp3-popover-target { .bp3-popover-target {
border-bottom: 1px solid #e7e7e7; border-bottom: 1px solid #e7e7e7;

View File

@@ -1,17 +1,9 @@
.dashboard__insider--payment-mades-list {
.dashboard__insider--payment-mades-list{ .bigcapital-datatable {
.tbody {
.bigcapital-datatable{
.tbody{
.tr{
min-height: 46px;
}
.td.amount { .td.amount {
.cell-inner {
.cell-inner{ > span {
> span{
font-weight: 600; font-weight: 600;
} }
} }

View File

@@ -1,17 +1,9 @@
.dashboard__insider--payment-receives-list {
.dashboard__insider--payment-receives-list{ .bigcapital-datatable {
.tbody {
.bigcapital-datatable{
.tbody{
.tr .td{
min-height: 46px;
}
.td.amount { .td.amount {
.cell-inner {
.cell-inner{ > span {
> span{
font-weight: 600; font-weight: 600;
} }
} }

View File

@@ -1,22 +1,9 @@
.dashboard__insider--sale_estimate {
.dashboard__insider--sale_estimate{ .bigcapital-datatable {
.tbody {
.bigcapital-datatable{
.tbody{
.tr{
min-height: 46px;
}
.tr .td{
padding-top: 0.88rem;
padding-bottom: 0.88rem;
}
.td.amount { .td.amount {
.cell-inner {
.cell-inner{ > span {
> span{
font-weight: 600; font-weight: 600;
} }
} }

View File

@@ -1,43 +1,38 @@
.dashboard__insider--sales-invoices-list {
.bigcapital-datatable {
.dashboard__insider--sales-invoices-list{ .tbody {
.balance.td {
.bigcapital-datatable{ .cell-inner {
.tbody{ > span {
.balance.td{
.cell-inner{
> span{
font-weight: 600; font-weight: 600;
} }
} }
} }
.status.td{ .status.td {
.overdue-status, .overdue-status,
.due-status{ .due-status {
display: block; display: block;
font-size: 13.5px; font-size: 13.5px;
line-height: 1.4; line-height: 1.4;
+ .partial-paid{ + .partial-paid {
margin-top: 2px; margin-top: 2px;
} }
} }
.overdue-status{ .overdue-status {
color: #ec5b0a; color: #ec5b0a;
} }
.due-status{ .due-status {
color: #1652c8; color: #1652c8;
} }
.partial-paid{ .partial-paid {
font-size: 12px; font-size: 12px;
line-height: 1; line-height: 1;
display: block; display: block;
margin-bottom: 6px; margin-bottom: 6px;
opacity: 0.7; opacity: 0.7;
} }
.fully-paid-icon{ .fully-paid-icon {
width: 18px; width: 18px;
height: 18px; height: 18px;
margin-right: 8px; margin-right: 8px;
@@ -46,19 +41,26 @@
fill: #2ba01d; fill: #2ba01d;
} }
} }
.fully-paid-text{ .fully-paid-text {
font-size: 13.5px; font-size: 13.5px;
} }
.bp3-progress-bar{ .bp3-progress-bar {
height: 4px; height: 4px;
max-width: 180px; max-width: 180px;
&, &,
.bp3-progress-meter{ .bp3-progress-meter {
border-radius: 0; border-radius: 0;
} }
} }
} }
} }
.table-size--small {
.status.td {
.bp3-progress-bar {
height: 3px;
}
}
}
} }
} }

View File

@@ -1,17 +1,9 @@
.dashboard__insider--sales_receipts {
.dashboard__insider--sales_receipts{ .bigcapital-datatable {
.tbody {
.bigcapital-datatable{
.tbody{
.tr{
min-height: 46px;
}
.td.amount { .td.amount {
.cell-inner {
.cell-inner{ > span {
> span{
font-weight: 600; font-weight: 600;
} }
} }

View File

@@ -1,7 +1,5 @@
.dashboard__insider--vendors-list { .dashboard__insider--vendors-list {
.bigcapital-datatable { .bigcapital-datatable {
tbody { tbody {
.tr .td { .tr .td {
padding-top: 0.5rem; padding-top: 0.5rem;
@@ -10,18 +8,26 @@
} }
.avatar.td { .avatar.td {
.avatar { .avatar {
height: 30px;
width: 30px;
display: inline-block; display: inline-block;
background: #adbcc9; background: #adbcc9;
border-radius: 50%; border-radius: 50%;
line-height: 30px;
text-align: center; text-align: center;
font-weight: 400; font-weight: 400;
font-size: 14px;
color: #fff; color: #fff;
&[data-size='medium'] {
height: 30px;
width: 30px;
line-height: 30px;
font-size: 14px;
}
&[data-size='small'] {
height: 25px;
width: 25px;
line-height: 25px;
font-size: 12px;
}
} }
} }
} }