mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
re-structure to monorepo.
This commit is contained in:
187
packages/webapp/src/constants/abilityOption.tsx
Normal file
187
packages/webapp/src/constants/abilityOption.tsx
Normal file
@@ -0,0 +1,187 @@
|
||||
// @ts-nocheck
|
||||
export const AbilitySubject = {
|
||||
Item: 'Item',
|
||||
InventoryAdjustment: 'InventoryAdjustment',
|
||||
Estimate: 'SaleEstimate',
|
||||
Invoice: 'SaleInvoice',
|
||||
Receipt: 'SaleReceipt',
|
||||
PaymentReceive: 'PaymentReceive',
|
||||
Bill: 'Bill',
|
||||
PaymentMade: 'PaymentMade',
|
||||
Customer: 'Customer',
|
||||
Vendor: 'Vendor',
|
||||
Account: 'Account',
|
||||
ManualJournal: 'ManualJournal',
|
||||
Expense: 'Expense',
|
||||
Cashflow: 'Cashflow',
|
||||
Report: 'Report',
|
||||
Preferences: 'Preferences',
|
||||
ExchangeRate: 'ExchangeRate',
|
||||
SubscriptionBilling: 'SubscriptionBilling',
|
||||
CreditNote: 'CreditNote',
|
||||
VendorCredit: 'VendorCredit',
|
||||
Project:'Project'
|
||||
};
|
||||
|
||||
export const ItemAction = {
|
||||
View: 'View',
|
||||
Create: 'Create',
|
||||
Edit: 'Edit',
|
||||
Delete: 'Delete',
|
||||
};
|
||||
|
||||
export const InventoryAdjustmentAction = {
|
||||
Create: 'Create',
|
||||
Edit: 'Edit',
|
||||
View: 'View',
|
||||
Delete: 'Delete',
|
||||
};
|
||||
|
||||
export const SaleEstimateAction = {
|
||||
View: 'View',
|
||||
Create: 'Create',
|
||||
Edit: 'Edit',
|
||||
Delete: 'Delete',
|
||||
NotifyBySms: 'NotifyBySms',
|
||||
};
|
||||
|
||||
export const SaleInvoiceAction = {
|
||||
View: 'View',
|
||||
Create: 'Create',
|
||||
Edit: 'Edit',
|
||||
Delete: 'Delete',
|
||||
Writeoff: 'bad-debt',
|
||||
NotifyBySms: 'NotifyBySms',
|
||||
};
|
||||
|
||||
export const SaleReceiptAction = {
|
||||
View: 'View',
|
||||
Create: 'Create',
|
||||
Edit: 'Edit',
|
||||
Delete: 'Delete',
|
||||
NotifyBySms: 'NotifyBySms',
|
||||
};
|
||||
|
||||
export const PaymentReceiveAction = {
|
||||
View: 'View',
|
||||
Create: 'Create',
|
||||
Edit: 'Edit',
|
||||
Delete: 'Delete',
|
||||
NotifyBySms: 'NotifyBySms',
|
||||
};
|
||||
|
||||
export const CreditNoteAction = {
|
||||
View: 'View',
|
||||
Create: 'Create',
|
||||
Edit: 'Edit',
|
||||
Delete: 'Delete',
|
||||
Refund: 'Refund',
|
||||
};
|
||||
|
||||
export const VendorCreditAction = {
|
||||
View: 'View',
|
||||
Create: 'Create',
|
||||
Edit: 'Edit',
|
||||
Delete: 'Delete',
|
||||
Refund: 'Refund',
|
||||
};
|
||||
export const BillAction = {
|
||||
View: 'View',
|
||||
Create: 'Create',
|
||||
Edit: 'Edit',
|
||||
Delete: 'Delete',
|
||||
NotifyBySms: 'NotifyBySms',
|
||||
};
|
||||
|
||||
export const PaymentMadeAction = {
|
||||
View: 'View',
|
||||
Create: 'Create',
|
||||
Edit: 'Edit',
|
||||
Delete: 'Delete',
|
||||
};
|
||||
|
||||
export const CustomerAction = {
|
||||
View: 'View',
|
||||
Create: 'Create',
|
||||
Edit: 'Edit',
|
||||
Delete: 'Delete',
|
||||
};
|
||||
|
||||
export const VendorAction = {
|
||||
View: 'View',
|
||||
Create: 'Create',
|
||||
Edit: 'Edit',
|
||||
Delete: 'Delete',
|
||||
};
|
||||
|
||||
export const AccountAction = {
|
||||
View: 'View',
|
||||
Create: 'Create',
|
||||
Edit: 'Edit',
|
||||
Delete: 'Delete',
|
||||
TransactionsLocking: 'TransactionsLocking',
|
||||
};
|
||||
|
||||
export const ManualJournalAction = {
|
||||
View: 'View',
|
||||
Create: 'Create',
|
||||
Edit: 'Edit',
|
||||
Delete: 'Delete',
|
||||
TransactionLocking: 'TransactionLocking',
|
||||
};
|
||||
|
||||
export const ExpenseAction = {
|
||||
View: 'View',
|
||||
Create: 'Create',
|
||||
Edit: 'Edit',
|
||||
Delete: 'Delete',
|
||||
};
|
||||
|
||||
export const CashflowAction = {
|
||||
View: 'View',
|
||||
Create: 'Create',
|
||||
Delete: 'Delete',
|
||||
};
|
||||
|
||||
export const ProjectAction = {
|
||||
View: 'View',
|
||||
Create: 'Create',
|
||||
Edit: 'Edit',
|
||||
Delete: 'Delete',
|
||||
};
|
||||
|
||||
export const ReportsAction = {
|
||||
ALL: 'all',
|
||||
READ_BALANCE_SHEET: 'read-balance-sheet',
|
||||
READ_TRIAL_BALANCE_SHEET: 'read-trial-balance-sheet',
|
||||
READ_PROFIT_LOSS: 'read-profit-loss',
|
||||
READ_JOURNAL: 'read-journal',
|
||||
READ_GENERAL_LEDGET: 'read-general-ledger',
|
||||
READ_CASHFLOW: 'read-cashflow',
|
||||
READ_AR_AGING_SUMMARY: 'read-ar-aging-summary',
|
||||
READ_AP_AGING_SUMMARY: 'read-ap-aging-summary',
|
||||
READ_PURCHASES_BY_ITEMS: 'read-purchases-by-items',
|
||||
READ_SALES_BY_ITEMS: 'read-sales-by-items',
|
||||
READ_CUSTOMERS_TRANSACTIONS: 'read-customers-transactions',
|
||||
READ_VENDORS_TRANSACTIONS: 'read-vendors-transactions',
|
||||
READ_CUSTOMERS_SUMMARY_BALANCE: 'read-customers-summary-balance',
|
||||
READ_VENDORS_SUMMARY_BALANCE: 'read-vendors-summary-balance',
|
||||
READ_INVENTORY_VALUATION_SUMMARY: 'read-inventory-valuation-summary',
|
||||
READ_INVENTORY_ITEM_DETAILS: 'read-inventory-item-details',
|
||||
READ_CASHFLOW_ACCOUNT_TRANSACTION: 'read-cashflow-account-transactions',
|
||||
};
|
||||
|
||||
export const PreferencesAbility = {
|
||||
Mutate: 'Mutate',
|
||||
};
|
||||
|
||||
export const ExchangeRateAbility = {
|
||||
View: 'view',
|
||||
Create: 'create',
|
||||
Delete: 'delete',
|
||||
};
|
||||
|
||||
export const SubscriptionBillingAbility = {
|
||||
View: 'view',
|
||||
Payment: 'payment',
|
||||
};
|
||||
226
packages/webapp/src/constants/accountTypes.tsx
Normal file
226
packages/webapp/src/constants/accountTypes.tsx
Normal file
@@ -0,0 +1,226 @@
|
||||
// @ts-nocheck
|
||||
export const ACCOUNT_TYPE = {
|
||||
CASH: 'cash',
|
||||
BANK: 'bank',
|
||||
ACCOUNTS_RECEIVABLE: 'accounts-receivable',
|
||||
INVENTORY: 'inventory',
|
||||
OTHER_CURRENT_ASSET: 'other-ACCOUNT_PARENT_TYPE.CURRENT_ASSET',
|
||||
FIXED_ASSET: 'fixed-asset',
|
||||
NON_CURRENT_ASSET: 'non-ACCOUNT_PARENT_TYPE.CURRENT_ASSET',
|
||||
|
||||
ACCOUNTS_PAYABLE: 'accounts-payable',
|
||||
CREDIT_CARD: 'credit-card',
|
||||
TAX_PAYABLE: 'tax-payable',
|
||||
OTHER_CURRENT_LIABILITY: 'other-current-liability',
|
||||
LOGN_TERM_LIABILITY: 'long-term-liability',
|
||||
NON_CURRENT_LIABILITY: 'non-current-liability',
|
||||
|
||||
EQUITY: 'equity',
|
||||
INCOME: 'income',
|
||||
OTHER_INCOME: 'other-income',
|
||||
COST_OF_GOODS_SOLD: 'cost-of-goods-sold',
|
||||
EXPENSE: 'expense',
|
||||
OTHER_EXPENSE: 'other-expense',
|
||||
};
|
||||
|
||||
export const ACCOUNT_PARENT_TYPE = {
|
||||
CURRENT_ASSET: 'current-asset',
|
||||
FIXED_ASSET: 'fixed-asset',
|
||||
NON_CURRENT_ASSET: 'non-ACCOUNT_PARENT_TYPE.CURRENT_ASSET',
|
||||
|
||||
CURRENT_LIABILITY: 'current-liability',
|
||||
LOGN_TERM_LIABILITY: 'long-term-liability',
|
||||
NON_CURRENT_LIABILITY: 'non-current-liability',
|
||||
|
||||
EQUITY: 'equity',
|
||||
EXPENSE: 'expense',
|
||||
INCOME: 'income',
|
||||
};
|
||||
|
||||
export const ACCOUNT_ROOT_TYPE = {
|
||||
ASSET: 'asset',
|
||||
LIABILITY: 'liability',
|
||||
EQUITY: 'equity',
|
||||
EXPENSE: 'expene',
|
||||
INCOME: 'income',
|
||||
};
|
||||
|
||||
export const ACCOUNT_NORMAL = {
|
||||
CREDIT: 'credit',
|
||||
DEBIT: 'debit',
|
||||
};
|
||||
export const ACCOUNT_TYPES = [
|
||||
{
|
||||
label: 'Cash',
|
||||
key: ACCOUNT_TYPE.CASH,
|
||||
normal: ACCOUNT_NORMAL.DEBIT,
|
||||
parentType: ACCOUNT_PARENT_TYPE.CURRENT_ASSET,
|
||||
rootType: ACCOUNT_ROOT_TYPE.ASSET,
|
||||
balanceSheet: true,
|
||||
incomeSheet: false,
|
||||
},
|
||||
{
|
||||
label: 'Bank',
|
||||
key: ACCOUNT_TYPE.BANK,
|
||||
normal: ACCOUNT_NORMAL.DEBIT,
|
||||
parentType: ACCOUNT_PARENT_TYPE.CURRENT_ASSET,
|
||||
rootType: ACCOUNT_ROOT_TYPE.ASSET,
|
||||
balanceSheet: true,
|
||||
incomeSheet: false,
|
||||
},
|
||||
{
|
||||
label: 'Accounts Receivable',
|
||||
key: ACCOUNT_TYPE.ACCOUNTS_RECEIVABLE,
|
||||
normal: ACCOUNT_NORMAL.DEBIT,
|
||||
rootType: ACCOUNT_ROOT_TYPE.ASSET,
|
||||
parentType: ACCOUNT_PARENT_TYPE.CURRENT_ASSET,
|
||||
balanceSheet: true,
|
||||
incomeSheet: false,
|
||||
},
|
||||
{
|
||||
label: 'Inventory',
|
||||
key: ACCOUNT_TYPE.INVENTORY,
|
||||
normal: ACCOUNT_NORMAL.DEBIT,
|
||||
rootType: ACCOUNT_ROOT_TYPE.ASSET,
|
||||
parentType: ACCOUNT_PARENT_TYPE.CURRENT_ASSET,
|
||||
balanceSheet: true,
|
||||
incomeSheet: false,
|
||||
},
|
||||
{
|
||||
label: 'Other Current Asset',
|
||||
key: ACCOUNT_TYPE.OTHER_CURRENT_ASSET,
|
||||
normal: ACCOUNT_NORMAL.DEBIT,
|
||||
rootType: ACCOUNT_ROOT_TYPE.ASSET,
|
||||
parentType: ACCOUNT_PARENT_TYPE.CURRENT_ASSET,
|
||||
balanceSheet: true,
|
||||
incomeSheet: false,
|
||||
},
|
||||
{
|
||||
label: 'Fixed Asset',
|
||||
key: ACCOUNT_TYPE.FIXED_ASSET,
|
||||
normal: ACCOUNT_NORMAL.DEBIT,
|
||||
rootType: ACCOUNT_ROOT_TYPE.ASSET,
|
||||
parentType: ACCOUNT_PARENT_TYPE.FIXED_ASSET,
|
||||
balanceSheet: true,
|
||||
incomeSheet: false,
|
||||
},
|
||||
{
|
||||
label: 'Non-Current Asset',
|
||||
key: ACCOUNT_TYPE.NON_CURRENT_ASSET,
|
||||
normal: ACCOUNT_NORMAL.DEBIT,
|
||||
rootType: ACCOUNT_ROOT_TYPE.ASSET,
|
||||
parentType: ACCOUNT_PARENT_TYPE.FIXED_ASSET,
|
||||
balanceSheet: true,
|
||||
incomeSheet: false,
|
||||
},
|
||||
{
|
||||
label: 'Accounts Payable',
|
||||
key: ACCOUNT_TYPE.ACCOUNTS_PAYABLE,
|
||||
normal: ACCOUNT_NORMAL.CREDIT,
|
||||
rootType: ACCOUNT_ROOT_TYPE.LIABILITY,
|
||||
parentType: ACCOUNT_PARENT_TYPE.CURRENT_LIABILITY,
|
||||
balanceSheet: true,
|
||||
incomeSheet: false,
|
||||
},
|
||||
{
|
||||
label: 'Credit Card',
|
||||
key: ACCOUNT_TYPE.CREDIT_CARD,
|
||||
normal: ACCOUNT_NORMAL.CREDIT,
|
||||
rootType: ACCOUNT_ROOT_TYPE.LIABILITY,
|
||||
parentType: ACCOUNT_PARENT_TYPE.CURRENT_LIABILITY,
|
||||
balanceSheet: true,
|
||||
incomeSheet: false,
|
||||
},
|
||||
{
|
||||
label: 'Tax Payable',
|
||||
key: ACCOUNT_TYPE.TAX_PAYABLE,
|
||||
normal: ACCOUNT_NORMAL.CREDIT,
|
||||
rootType: ACCOUNT_ROOT_TYPE.LIABILITY,
|
||||
parentType: ACCOUNT_PARENT_TYPE.CURRENT_LIABILITY,
|
||||
balanceSheet: true,
|
||||
incomeSheet: false,
|
||||
},
|
||||
{
|
||||
label: 'Other Current Liability',
|
||||
key: ACCOUNT_TYPE.OTHER_CURRENT_LIABILITY,
|
||||
normal: ACCOUNT_NORMAL.CREDIT,
|
||||
rootType: ACCOUNT_ROOT_TYPE.LIABILITY,
|
||||
parentType: ACCOUNT_PARENT_TYPE.CURRENT_LIABILITY,
|
||||
balanceSheet: false,
|
||||
incomeSheet: true,
|
||||
},
|
||||
{
|
||||
label: 'Long Term Liability',
|
||||
key: ACCOUNT_TYPE.LOGN_TERM_LIABILITY,
|
||||
normal: ACCOUNT_NORMAL.CREDIT,
|
||||
rootType: ACCOUNT_ROOT_TYPE.LIABILITY,
|
||||
parentType: ACCOUNT_PARENT_TYPE.LOGN_TERM_LIABILITY,
|
||||
balanceSheet: false,
|
||||
incomeSheet: true,
|
||||
},
|
||||
{
|
||||
label: 'Non-Current Liability',
|
||||
key: ACCOUNT_TYPE.NON_CURRENT_LIABILITY,
|
||||
normal: ACCOUNT_NORMAL.CREDIT,
|
||||
rootType: ACCOUNT_ROOT_TYPE.LIABILITY,
|
||||
parentType: ACCOUNT_PARENT_TYPE.NON_CURRENT_LIABILITY,
|
||||
balanceSheet: false,
|
||||
incomeSheet: true,
|
||||
},
|
||||
{
|
||||
label: 'Equity',
|
||||
key: ACCOUNT_TYPE.EQUITY,
|
||||
normal: ACCOUNT_NORMAL.CREDIT,
|
||||
rootType: ACCOUNT_ROOT_TYPE.EQUITY,
|
||||
parentType: ACCOUNT_PARENT_TYPE.EQUITY,
|
||||
balanceSheet: true,
|
||||
incomeSheet: false,
|
||||
},
|
||||
{
|
||||
label: 'Income',
|
||||
key: ACCOUNT_TYPE.INCOME,
|
||||
normal: ACCOUNT_NORMAL.CREDIT,
|
||||
rootType: ACCOUNT_ROOT_TYPE.INCOME,
|
||||
parentType: ACCOUNT_PARENT_TYPE.INCOME,
|
||||
balanceSheet: false,
|
||||
incomeSheet: true,
|
||||
},
|
||||
{
|
||||
label: 'Other Income',
|
||||
key: ACCOUNT_TYPE.OTHER_INCOME,
|
||||
normal: ACCOUNT_NORMAL.CREDIT,
|
||||
rootType: ACCOUNT_ROOT_TYPE.INCOME,
|
||||
parentType: ACCOUNT_PARENT_TYPE.INCOME,
|
||||
balanceSheet: false,
|
||||
incomeSheet: true,
|
||||
},
|
||||
{
|
||||
label: 'Cost of Goods Sold',
|
||||
key: ACCOUNT_TYPE.COST_OF_GOODS_SOLD,
|
||||
normal: ACCOUNT_NORMAL.DEBIT,
|
||||
rootType: ACCOUNT_ROOT_TYPE.EXPENSE,
|
||||
parentType: ACCOUNT_PARENT_TYPE.EXPENSE,
|
||||
balanceSheet: false,
|
||||
incomeSheet: true,
|
||||
},
|
||||
{
|
||||
label: 'Expense',
|
||||
key: ACCOUNT_TYPE.EXPENSE,
|
||||
normal: ACCOUNT_NORMAL.DEBIT,
|
||||
rootType: ACCOUNT_ROOT_TYPE.EXPENSE,
|
||||
parentType: ACCOUNT_PARENT_TYPE.EXPENSE,
|
||||
balanceSheet: false,
|
||||
incomeSheet: true,
|
||||
},
|
||||
{
|
||||
label: 'Other Expense',
|
||||
key: ACCOUNT_TYPE.OTHER_EXPENSE,
|
||||
normal: ACCOUNT_NORMAL.DEBIT,
|
||||
rootType: ACCOUNT_ROOT_TYPE.EXPENSE,
|
||||
parentType: ACCOUNT_PARENT_TYPE.EXPENSE,
|
||||
balanceSheet: false,
|
||||
incomeSheet: true,
|
||||
},
|
||||
];
|
||||
|
||||
export const FOREIGN_CURRENCY_ACCOUNTS = ['cash', 'bank'];
|
||||
7
packages/webapp/src/constants/adjustmentType.tsx
Normal file
7
packages/webapp/src/constants/adjustmentType.tsx
Normal file
@@ -0,0 +1,7 @@
|
||||
// @ts-nocheck
|
||||
import intl from 'react-intl-universal';
|
||||
|
||||
export default [
|
||||
{ name: intl.get('decrement'), value: 'decrement' },
|
||||
{ name: intl.get('increment'), value: 'increment' },
|
||||
]
|
||||
7
packages/webapp/src/constants/allocateLandedCostType.tsx
Normal file
7
packages/webapp/src/constants/allocateLandedCostType.tsx
Normal file
@@ -0,0 +1,7 @@
|
||||
// @ts-nocheck
|
||||
import intl from 'react-intl-universal';
|
||||
|
||||
export default [
|
||||
{ name: intl.get('bills'), value: 'Bill' },
|
||||
{ name: intl.get('expenses'), value: 'Expense' },
|
||||
];
|
||||
5
packages/webapp/src/constants/app.tsx
Normal file
5
packages/webapp/src/constants/app.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
// @ts-nocheck
|
||||
export default {
|
||||
"app_name": "BigCapital",
|
||||
"app_version": "0.0.1 (build 12344)",
|
||||
}
|
||||
41
packages/webapp/src/constants/cashflowOptions.tsx
Normal file
41
packages/webapp/src/constants/cashflowOptions.tsx
Normal file
@@ -0,0 +1,41 @@
|
||||
// @ts-nocheck
|
||||
import intl from 'react-intl-universal';
|
||||
|
||||
export const getAddMoneyInOptions = () => [
|
||||
{
|
||||
name: intl.get('cash_flow.owner_contribution'),
|
||||
value: 'owner_contribution',
|
||||
},
|
||||
{
|
||||
name: intl.get('cash_flow.other_income'),
|
||||
value: 'other_income',
|
||||
},
|
||||
{
|
||||
name: intl.get('cash_flow.transfer_form_account'),
|
||||
value: 'transfer_from_account',
|
||||
},
|
||||
];
|
||||
|
||||
export const getAddMoneyOutOptions = () => [
|
||||
{
|
||||
name: intl.get('cash_flow.owner_drawings'),
|
||||
value: 'OwnerDrawing',
|
||||
},
|
||||
{
|
||||
name: intl.get('cash_flow.expenses'),
|
||||
value: 'other_expense',
|
||||
},
|
||||
{
|
||||
name: intl.get('cash_flow.transfer_to_account'),
|
||||
value: 'transfer_to_account',
|
||||
},
|
||||
];
|
||||
|
||||
export const TRANSACRIONS_TYPE = [
|
||||
'OwnerContribution',
|
||||
'OtherIncome',
|
||||
'TransferFromAccount',
|
||||
'OnwersDrawing',
|
||||
'OtherExpense',
|
||||
'TransferToAccount',
|
||||
];
|
||||
8
packages/webapp/src/constants/cellTypes.tsx
Normal file
8
packages/webapp/src/constants/cellTypes.tsx
Normal file
@@ -0,0 +1,8 @@
|
||||
// @ts-nocheck
|
||||
|
||||
|
||||
export const CellType = {
|
||||
Text: 'text',
|
||||
Field: 'field',
|
||||
Button: 'button'
|
||||
}
|
||||
105
packages/webapp/src/constants/classes.tsx
Normal file
105
packages/webapp/src/constants/classes.tsx
Normal file
@@ -0,0 +1,105 @@
|
||||
// @ts-nocheck
|
||||
import { Classes } from '@blueprintjs/core';
|
||||
|
||||
const CLASSES = {
|
||||
DASHBOARD_PAGE: 'dashboard__page',
|
||||
DASHBOARD_DATATABLE: 'dashboard__datatable',
|
||||
DASHBOARD_CARD: 'dashboard__card',
|
||||
DASHBOARD_CARD_PAGE: 'dashboard__card--page',
|
||||
|
||||
DATATABLE_EDITOR: 'datatable-editor',
|
||||
DATATABLE_EDITOR_ACTIONS: 'datatable-editor__actions',
|
||||
DATATABLE_EDITOR_ITEMS_ENTRIES: 'items-entries-table',
|
||||
DATATABLE_EDITOR_HAS_TOTAL_ROW: 'has-total-row',
|
||||
|
||||
DASHBOARD_CONTENT: 'dashboard-content',
|
||||
DASHBOARD_CONTENT_PREFERENCES: 'dashboard-content--preferences',
|
||||
DASHBOARD_CONTENT_PANE: 'Pane2',
|
||||
DASHBOARD_CENTERED_EMPTY_STATUS: 'dashboard__centered-empty-status',
|
||||
|
||||
PAGE_FORM: 'page-form',
|
||||
PAGE_FORM_HEADER: 'page-form__header',
|
||||
PAGE_FORM_HEADER_PRIMARY: 'page-form__primary-section',
|
||||
PAGE_FORM_HEADER_FIELDS: 'page-form__header-fields',
|
||||
PAGE_FORM_HEADER_BIG_NUMBERS: 'page-form__big-numbers',
|
||||
PAGE_FORM_TABS: 'page-form__tabs',
|
||||
PAGE_FORM_BODY: 'page-form__body',
|
||||
PAGE_FORM_STRIP_STYLE: 'page-form--strip',
|
||||
|
||||
PAGE_FORM_FOOTER: 'page-form__footer',
|
||||
PAGE_FORM_FLOATING_ACTIONS: 'page-form__floating-actions',
|
||||
|
||||
PAGE_FORM_BILL: 'page-form--bill',
|
||||
PAGE_FORM_ESTIMATE: 'page-form--estimate',
|
||||
PAGE_FORM_INVOICE: 'page-form--invoice',
|
||||
PAGE_FORM_RECEIPT: 'page-form--receipt',
|
||||
PAGE_FORM_PAYMENT_MADE: 'page-form--payment-made',
|
||||
PAGE_FORM_PAYMENT_RECEIVE: 'page-form--payment-receive',
|
||||
PAGE_FORM_CUSTOMER: 'page-form--customer',
|
||||
PAGE_FORM_VENDOR: 'page-form--vendor',
|
||||
PAGE_FORM_ITEM: 'page-form--item',
|
||||
PAGE_FORM_MAKE_JOURNAL: 'page-form--make-journal-entries',
|
||||
PAGE_FORM_EXPENSE: 'page-form--expense',
|
||||
PAGE_FORM_CREDIT_NOTE:'page-form--credit-note',
|
||||
PAGE_FORM_VENDOR_CREDIT_NOTE:'page-form--vendor-credit-note',
|
||||
PAGE_FORM_WAREHOUSE_TRANSFER:'page-form--warehouse-transfer',
|
||||
|
||||
FORM_GROUP_LIST_SELECT: 'form-group--select-list',
|
||||
|
||||
CLOUD_SPINNER: 'cloud-spinner',
|
||||
IS_LOADING: 'is-loading',
|
||||
|
||||
DATATABLE_EMPTY_STATUS: 'datatable-empty-status',
|
||||
DATATABLE_EMPTY_STATUS_TITLE: 'datatable-empty-status__title',
|
||||
DATATABLE_EMPTY_STATUS_DESC: 'datatable-empty-status__desc',
|
||||
DATATABLE_EMPTY_STATUS_ACTIONS: 'datatable-empty-status__actions',
|
||||
|
||||
SELECT_LIST_FILL_POPOVER: 'select-list--fill-popover',
|
||||
|
||||
PREFERENCES_PAGE: 'preferences-page',
|
||||
PREFERENCES_PAGE_SIDEBAR: 'preferences-page__sidebar',
|
||||
PREFERENCES_PAGE_TOPBAR: 'preferences-page__topbar',
|
||||
PREFERENCES_PAGE_CONTENT: 'preferences-page__content',
|
||||
PREFERENCES_PAGE_TABS: 'preferences-page__tabs',
|
||||
|
||||
PREFERENCES_SIDEBAR: 'preferences-sidebar',
|
||||
PREFERENCES_TOPBAR: 'preferences-topbar',
|
||||
|
||||
PREFERENCES_PAGE_INSIDE_CONTENT: 'preferences-page__inside-content',
|
||||
PREFERENCES_PAGE_INSIDE_CONTENT_GENERAL: 'preferences-page__inside-content--general',
|
||||
PREFERENCES_PAGE_INSIDE_CONTENT_USERS: 'preferences-page__inside-content--users',
|
||||
PREFERENCES_PAGE_INSIDE_CONTENT_CURRENCIES: 'preferences-page__inside-content--currencies',
|
||||
PREFERENCES_PAGE_INSIDE_CONTENT_ACCOUNTANT: 'preferences-page__inside-content--accountant',
|
||||
PREFERENCES_PAGE_INSIDE_CONTENT_SMS_INTEGRATION: 'preferences-page__inside-content--sms-integration',
|
||||
PREFERENCES_PAGE_INSIDE_CONTENT_ROLES_FORM: 'preferences-page__inside-content--roles-form',
|
||||
PREFERENCES_PAGE_INSIDE_CONTENT_BRANCHES: 'preferences-page__inside-content--branches',
|
||||
PREFERENCES_PAGE_INSIDE_CONTENT_WAREHOUSES: 'preferences-page__inside-content--warehouses',
|
||||
|
||||
FINANCIAL_REPORT_INSIDER: 'dashboard__insider--financial-report',
|
||||
|
||||
|
||||
UNIVERSAL_SEARCH: 'universal-search',
|
||||
UNIVERSAL_SEARCH_OMNIBAR: 'universal-search__omnibar',
|
||||
UNIVERSAL_SEARCH_OVERLAY: 'universal-search-overlay',
|
||||
UNIVERSAL_SEARCH_INPUT: 'universal-search__input',
|
||||
UNIVERSAL_SEARCH_INPUT_RIGHT_ELEMENTS: 'universal-search-input-right-elements',
|
||||
UNIVERSAL_SEARCH_TYPE_SELECT_OVERLAY: 'universal-search__type-select-overlay',
|
||||
UNIVERSAL_SEARCH_TYPE_SELECT_BTN: 'universal-search__type-select-btn',
|
||||
UNIVERSAL_SEARCH_FOOTER: 'universal-search__footer',
|
||||
|
||||
UNIVERSAL_SEARCH_ACTIONS: 'universal-search__actions',
|
||||
UNIVERSAL_SEARCH_ACTION_SELECT: 'universal-search__action universal-search__action--select',
|
||||
UNIVERSAL_SEARCH_ACTION_CLOSE: 'universal-search__action universal-search__action--close',
|
||||
UNIVERSAL_SEARCH_ACTION_ARROWS: 'universal-search__action universal-search__action--arrows',
|
||||
|
||||
DIALOG_PDF_PREVIEW: 'dialog--pdf-preview-dialog',
|
||||
|
||||
...Classes,
|
||||
CARD: 'card',
|
||||
ALIGN_RIGHT: 'align-right',
|
||||
FONT_BOLD: 'font-bold',
|
||||
};
|
||||
|
||||
export {
|
||||
CLASSES,
|
||||
}
|
||||
8
packages/webapp/src/constants/contactsOptions.tsx
Normal file
8
packages/webapp/src/constants/contactsOptions.tsx
Normal file
@@ -0,0 +1,8 @@
|
||||
// @ts-nocheck
|
||||
import React from 'react';
|
||||
import intl from 'react-intl-universal';
|
||||
|
||||
export default [
|
||||
{ name: intl.get('customer'), path: 'customers' },
|
||||
{ name: intl.get('vendor'), path: 'vendors' },
|
||||
];
|
||||
9
packages/webapp/src/constants/countries.tsx
Normal file
9
packages/webapp/src/constants/countries.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
// @ts-nocheck
|
||||
import intl from 'react-intl-universal';
|
||||
|
||||
export const getCountries = () => [
|
||||
{
|
||||
name: intl.get('libya'),
|
||||
value: 'libya',
|
||||
},
|
||||
];
|
||||
24
packages/webapp/src/constants/currencies.tsx
Normal file
24
packages/webapp/src/constants/currencies.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
// @ts-nocheck
|
||||
import intl from 'react-intl-universal';
|
||||
import currencies from 'js-money/lib/currency';
|
||||
import { sortBy } from 'lodash';
|
||||
|
||||
export const getCurrencies = () => [
|
||||
{ name: intl.get('us_dollar'), code: 'USD' },
|
||||
{ name: intl.get('euro'), code: 'EUR' },
|
||||
{ name: intl.get('libyan_diner'), code: 'LYD' },
|
||||
];
|
||||
|
||||
export const getAllCurrenciesOptions = () => {
|
||||
const codes = Object.keys(currencies);
|
||||
const sortedCodes = sortBy(codes);
|
||||
|
||||
return sortedCodes.map((code) => {
|
||||
const currency = currencies[code];
|
||||
|
||||
return {
|
||||
key: code,
|
||||
name: `${code} - ${currency.name}`,
|
||||
};
|
||||
});
|
||||
};
|
||||
8
packages/webapp/src/constants/dataTypes.tsx
Normal file
8
packages/webapp/src/constants/dataTypes.tsx
Normal file
@@ -0,0 +1,8 @@
|
||||
// @ts-nocheck
|
||||
export const DATATYPES_LENGTH = {
|
||||
STRING: 255,
|
||||
TEXT: 65535,
|
||||
INT_10: 4294967295,
|
||||
DECIMAL_13_3: 9999999999.999,
|
||||
DECIMAL_15_5: 999999999999.999,
|
||||
};
|
||||
42
packages/webapp/src/constants/dateFormatsOptions.tsx
Normal file
42
packages/webapp/src/constants/dateFormatsOptions.tsx
Normal file
@@ -0,0 +1,42 @@
|
||||
// @ts-nocheck
|
||||
import moment from 'moment';
|
||||
import intl from 'react-intl-universal';
|
||||
|
||||
export const getDateFormats =()=> [
|
||||
{
|
||||
id: 1,
|
||||
name: intl.get('mm_dd_yy'),
|
||||
label: `${moment().format('MM/DD/YYYY')}`,
|
||||
value: 'mm/dd/yy',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: intl.get('dd_mm_yy'),
|
||||
label: `${moment().format('DD/MM/YYYY')}`,
|
||||
value: 'dd/mm/yy',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: intl.get('yy_mm_dd'),
|
||||
label: `${moment().format('YYYY/MM/DD')}`,
|
||||
value: 'yy/mm/dd',
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: intl.get('mm_dd_yy'),
|
||||
label: `${moment().format('MM-DD-YYYY')}`,
|
||||
value: 'mm-dd-yy',
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
name: intl.get('dd_mm_yy_'),
|
||||
label: `${moment().format('DD-MM-YYYY')}`,
|
||||
value: 'dd-mm-yy',
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
name: intl.get('yy_mm_dd_'),
|
||||
label: `${moment().format('YYYY-MM-DD')}`,
|
||||
value: 'yy-mm-dd',
|
||||
},
|
||||
];
|
||||
49
packages/webapp/src/constants/dialogs.ts
Normal file
49
packages/webapp/src/constants/dialogs.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
// @ts-nocheck
|
||||
export enum DialogsName {
|
||||
AccountForm = 'account-form',
|
||||
CurrencyForm = 'currency-form',
|
||||
InviteForm = 'invite-user',
|
||||
UserForm = 'user-form',
|
||||
ExchangeRateForm = 'exchangeRate-form',
|
||||
ItemCategoryForm = 'item-category-form',
|
||||
InventoryAdjustmentForm = 'inventory-adjustment',
|
||||
PaymentViaVoucherForm = 'payment-via-voucher',
|
||||
KeyboardShortcutForm = 'keyboard-shortcuts',
|
||||
ContactDuplicateForm = 'contact-duplicate',
|
||||
QuickPaymentReceiveForm = 'quick-payment-receive',
|
||||
QuickPaymentMadeForm = 'quick-payment-made',
|
||||
AllocateLandedCostForm = 'allocate-landed-cost',
|
||||
InvoicePdfForm = 'invoice-pdf-preview',
|
||||
EstimatePdfForm = 'estimate-pdf-preview',
|
||||
ReceiptPdfForm = 'receipt-pdf-preview',
|
||||
CreditNotePdfForm = 'credit-note-pdf-preview',
|
||||
PaymentPdfForm = 'payment-pdf-preview',
|
||||
MoneyInForm = 'money-in',
|
||||
MoneyOutForm = 'money-out',
|
||||
NotifyInvoiceViaForm = 'notify-invoice-via-sms',
|
||||
NotifyReceiptViaForm = 'notify-receipt-via-sms',
|
||||
NotifyEstimateViaForm = 'notify-estimate-via-sms',
|
||||
NotifyPaymentViaForm = 'notify-payment-via-sms',
|
||||
BadDebtForm = 'write-off-bad-debt',
|
||||
SMSMessageForm = 'sms-message-form',
|
||||
RefundCreditNote = 'refund-credit-note',
|
||||
RefundVendorCredit = 'refund-vendor-credit',
|
||||
ReconcileCreditNote = 'reconcile-credit-note',
|
||||
ReconcileVendorCredit = 'reconcile-vendor-credit',
|
||||
TransactionsLocking = 'locking-transactions',
|
||||
TransactionsUnlocking = 'unlocking-transactions',
|
||||
PartialTransactionsUnlocking = 'unlocking-partial-transactions',
|
||||
WarehouseForm = 'warehouse-form',
|
||||
BranchForm = 'branch-form',
|
||||
BranchActivateForm = 'branch-activate',
|
||||
WarehouseActivateForm = 'warehouse-activate',
|
||||
CustomerOpeningBalanceForm = 'customer-opening-balance',
|
||||
VendorOpeningBalanceForm = 'vendor-opening-balance',
|
||||
ProjectForm = 'project-form',
|
||||
ProjectTaskForm = 'project-task-form',
|
||||
ProjectTimeEntryForm = 'project-time-entry-form',
|
||||
ProjectExpenseForm = 'project-expense-form',
|
||||
EstimateExpenseForm = 'estimate-expense-form',
|
||||
ProjectInvoicingForm = 'project-invoicing-form',
|
||||
ProjectBillableEntriesForm = 'project-billable-entries',
|
||||
}
|
||||
25
packages/webapp/src/constants/drawers.ts
Normal file
25
packages/webapp/src/constants/drawers.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
// @ts-nocheck
|
||||
export enum DRAWERS {
|
||||
ACCOUNT = 'account-drawer',
|
||||
JOURNAL = 'journal-drawer',
|
||||
EXPENSE = 'expense-drawer',
|
||||
BILL = 'bill-drawer',
|
||||
INVOICE = 'invoice-detail-drawer',
|
||||
RECEIPT = 'receipt-detail-drawer',
|
||||
PAYMENT_RECEIVE = 'payment-receive-detail-drawer',
|
||||
PAYMENT_MADE = 'payment-made-drawer',
|
||||
ESTIMATE = 'estimate-detail-drawer',
|
||||
ITEM = 'item-detail-drawer',
|
||||
CUSTOMER = 'customer-detail-drawer',
|
||||
VENDOR = 'vendor-detail-drawer',
|
||||
INVENTORY_ADJUSTMENT = 'inventory-adjustment-drawer',
|
||||
CASHFLOW_TRNASACTION = 'cashflow-transaction-drawer',
|
||||
QUICK_CREATE_CUSTOMER = 'quick-create-customer',
|
||||
QUICK_CREATE_ITEM = 'quick-create-item',
|
||||
QUICK_WRITE_VENDOR = 'quick-write-vendor',
|
||||
CREDIT_NOTE = 'credit-note-detail-drawer',
|
||||
VENDOR_CREDIT = 'vendor-credit-detail-drawer',
|
||||
REFUND_CREDIT_NOTE = 'refund-credit-detail-drawer',
|
||||
REFUND_VENDOR_CREDIT = 'refund-vendor-detail-drawer',
|
||||
WAREHOUSE_TRANSFER = 'warehouse-transfer-detail-drawer',
|
||||
}
|
||||
22
packages/webapp/src/constants/errors.tsx
Normal file
22
packages/webapp/src/constants/errors.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
// @ts-nocheck
|
||||
export const ERROR = {
|
||||
// Sales Estimates
|
||||
ESTIMATE_NUMBER_IS_NOT_UNQIUE: 'ESTIMATE.NUMBER.IS.NOT.UNQIUE',
|
||||
SALE_ESTIMATE_NO_IS_REQUIRED: 'SALE_ESTIMATE_NO_IS_REQUIRED',
|
||||
|
||||
// Sales Invoices
|
||||
SALE_INVOICE_NUMBER_IS_EXISTS: 'SALE.INVOICE.NUMBER.IS.EXISTS',
|
||||
SALE_INVOICE_NO_NOT_UNIQUE: 'SALE_INVOICE_NO_NOT_UNIQUE',
|
||||
SALE_ESTIMATE_IS_ALREADY_CONVERTED_TO_INVOICE:
|
||||
'SALE_ESTIMATE_IS_ALREADY_CONVERTED_TO_INVOICE',
|
||||
|
||||
// Sales Receipts
|
||||
SALE_RECEIPT_NUMBER_NOT_UNIQUE: 'SALE_RECEIPT_NUMBER_NOT_UNIQUE',
|
||||
SALE_RECEIPT_NO_IS_REQUIRED: 'SALE_RECEIPT_NO_IS_REQUIRED',
|
||||
|
||||
// Bills
|
||||
BILL_NUMBER_EXISTS: 'BILL.NUMBER.EXISTS',
|
||||
SALE_INVOICE_NO_IS_REQUIRED: 'SALE_INVOICE_NO_IS_REQUIRED',
|
||||
ENTRIES_ALLOCATED_COST_COULD_NOT_DELETED:"ENTRIES_ALLOCATED_COST_COULD_NOT_DELETED",
|
||||
|
||||
};
|
||||
9
packages/webapp/src/constants/features.tsx
Normal file
9
packages/webapp/src/constants/features.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
// @ts-nocheck
|
||||
|
||||
|
||||
export const Features = {
|
||||
Warehouses: 'warehouses',
|
||||
Branches: 'branches',
|
||||
ManualJournal: 'manualJournal',
|
||||
Projects:'Projects'
|
||||
}
|
||||
192
packages/webapp/src/constants/financialReportsMenu.tsx
Normal file
192
packages/webapp/src/constants/financialReportsMenu.tsx
Normal file
@@ -0,0 +1,192 @@
|
||||
// @ts-nocheck
|
||||
import React from 'react';
|
||||
import { FormattedMessage as T } from '@/components';
|
||||
import { ReportsAction, AbilitySubject } from '@/constants/abilityOption';
|
||||
|
||||
export const financialReportMenus = [
|
||||
{
|
||||
sectionTitle: <T id={'financial_accounting'} />,
|
||||
reports: [
|
||||
{
|
||||
title: <T id={'balance_sheet_report'} />,
|
||||
desc: (
|
||||
<T id={'reports_a_company_s_assets_liabilities_and_shareholders'} />
|
||||
),
|
||||
link: '/financial-reports/balance-sheet',
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.READ_BALANCE_SHEET,
|
||||
},
|
||||
{
|
||||
title: <T id={'trial_balance_sheet'} />,
|
||||
desc: (
|
||||
<T id={'summarizes_the_credit_and_debit_balance_of_each_account'} />
|
||||
),
|
||||
link: '/financial-reports/trial-balance-sheet',
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.READ_TRIAL_BALANCE_SHEET,
|
||||
},
|
||||
{
|
||||
title: <T id={'profit_loss_report'} />,
|
||||
desc: <T id={'reports_the_revenues_costs_and_expenses'} />,
|
||||
link: '/financial-reports/profit-loss-sheet',
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.READ_PROFIT_LOSS,
|
||||
},
|
||||
{
|
||||
title: <T id={'cash_flow_statement'} />,
|
||||
desc: (
|
||||
<T id={'reports_inflow_and_outflow_of_cash_and_cash_equivalents'} />
|
||||
),
|
||||
link: '/financial-reports/cash-flow',
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.READ_CASHFLOW,
|
||||
},
|
||||
{
|
||||
title: <T id={'journal_report'} />,
|
||||
desc: <T id={'the_debit_and_credit_entries_of_system_transactions'} />,
|
||||
link: '/financial-reports/journal-sheet',
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.READ_JOURNAL,
|
||||
},
|
||||
{
|
||||
title: <T id={'general_ledger_report'} />,
|
||||
desc: <T id={'reports_every_transaction_going_in_and_out_of_your'} />,
|
||||
link: '/financial-reports/general-ledger',
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.READ_GENERAL_LEDGET,
|
||||
},
|
||||
{
|
||||
title: <T id={'receivable_aging_summary'} />,
|
||||
desc: (
|
||||
<T id={'summarize_total_unpaid_balances_of_customers_invoices'} />
|
||||
),
|
||||
link: '/financial-reports/receivable-aging-summary',
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.READ_AR_AGING_SUMMARY,
|
||||
},
|
||||
{
|
||||
title: <T id={'payable_aging_summary'} />,
|
||||
desc: <T id={'summarize_total_unpaid_balances_of_vendors_purchase'} />,
|
||||
link: '/financial-reports/payable-aging-summary',
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.READ_AP_AGING_SUMMARY,
|
||||
},
|
||||
{
|
||||
title: <T id={'report.balance_sheet_comparison.title'} />,
|
||||
desc: <T id={'report.balance_sheet_comparison.desc'} />,
|
||||
link: 'financial-reports/balance-sheet?previousYear=true&previousYearAmountChange=true&previousYearPercentageChange=true',
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.READ_BALANCE_SHEET,
|
||||
},
|
||||
{
|
||||
title: <T id={'report.profit_loss_sheet_comparison.title'} />,
|
||||
desc: <T id={'report.profit_loss_sheet_comparison.desc'} />,
|
||||
link: '/financial-reports/profit-loss-sheet?previousYear=true&previousYearAmountChange=true&previousYearPercentageChange=true',
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.READ_PROFIT_LOSS,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export const SalesAndPurchasesReportMenus = [
|
||||
{
|
||||
sectionTitle: <T id={'sales_purchases_reports'} />,
|
||||
reports: [
|
||||
{
|
||||
title: <T id={'purchases_by_items'} />,
|
||||
desc: (
|
||||
<T
|
||||
id={
|
||||
'summarize_the_business_s_purchase_items_quantity_cost_and_average'
|
||||
}
|
||||
/>
|
||||
),
|
||||
link: '/financial-reports/purchases-by-items',
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.READ_PURCHASES_BY_ITEMS,
|
||||
},
|
||||
{
|
||||
title: <T id={'sales_by_items'} />,
|
||||
desc: (
|
||||
<T
|
||||
id={
|
||||
'summarize_the_business_s_sold_items_quantity_income_and_average_income_rate'
|
||||
}
|
||||
/>
|
||||
),
|
||||
link: '/financial-reports/sales-by-items',
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.READ_SALES_BY_ITEMS,
|
||||
},
|
||||
{
|
||||
title: <T id={'inventory_valuation'} />,
|
||||
desc: (
|
||||
<T
|
||||
id={
|
||||
'summarize_the_business_s_purchase_items_quantity_cost_and_average'
|
||||
}
|
||||
/>
|
||||
),
|
||||
link: '/financial-reports/inventory-valuation',
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.READ_INVENTORY_VALUATION_SUMMARY,
|
||||
},
|
||||
{
|
||||
title: <T id={'customers_balance_summary'} />,
|
||||
desc: (
|
||||
<T
|
||||
id={
|
||||
'summerize_the_total_amount_of_each_customer_owes_your_business'
|
||||
}
|
||||
/>
|
||||
),
|
||||
link: '/financial-reports/customers-balance-summary',
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.READ_CUSTOMERS_SUMMARY_BALANCE,
|
||||
},
|
||||
{
|
||||
title: <T id={'vendors_balance_summary'} />,
|
||||
desc: (
|
||||
<T id={'summerize_the_total_amount_your_business_owes_each_vendor'} />
|
||||
),
|
||||
link: '/financial-reports/vendors-balance-summary',
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.READ_VENDORS_SUMMARY_BALANCE,
|
||||
},
|
||||
{
|
||||
title: <T id={'customers_transactions'} />,
|
||||
desc: (
|
||||
<T
|
||||
id={'reports_every_transaction_going_in_and_out_of_each_customer'}
|
||||
/>
|
||||
),
|
||||
link: '/financial-reports/transactions-by-customers',
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.READ_CUSTOMERS_TRANSACTIONS,
|
||||
},
|
||||
{
|
||||
title: <T id={'vendors_transactions'} />,
|
||||
desc: (
|
||||
<T
|
||||
id={
|
||||
'reports_every_transaction_going_in_and_out_of_each_vendor_supplier'
|
||||
}
|
||||
/>
|
||||
),
|
||||
link: '/financial-reports/transactions-by-vendors',
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.READ_VENDORS_TRANSACTIONS,
|
||||
},
|
||||
{
|
||||
title: <T id={'inventory_item_details'} />,
|
||||
desc: (
|
||||
<T id={'reports_every_transaction_going_in_and_out_of_your_items'} />
|
||||
),
|
||||
link: '/financial-reports/inventory-item-details',
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.READ_INVENTORY_ITEM_DETAILS,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
53
packages/webapp/src/constants/fiscalYearOptions.tsx
Normal file
53
packages/webapp/src/constants/fiscalYearOptions.tsx
Normal file
@@ -0,0 +1,53 @@
|
||||
// @ts-nocheck
|
||||
import intl from 'react-intl-universal';
|
||||
|
||||
export const getFiscalYear = () => [
|
||||
{
|
||||
name: `${intl.get('january')} - ${intl.get('december')}`,
|
||||
key: 'january',
|
||||
},
|
||||
{
|
||||
name: `${intl.get('february')} - ${intl.get('january')}`,
|
||||
key: 'february',
|
||||
},
|
||||
{
|
||||
name: `${intl.get('march')} - ${intl.get('february')}`,
|
||||
key: 'march',
|
||||
},
|
||||
{
|
||||
name: `${intl.get('april')} - ${intl.get('march')}`,
|
||||
key: 'april',
|
||||
},
|
||||
{
|
||||
name: `${intl.get('may')} - ${intl.get('april')}`,
|
||||
key: 'may',
|
||||
},
|
||||
{
|
||||
name: `${intl.get('june')} - ${intl.get('may')}`,
|
||||
key: 'june',
|
||||
},
|
||||
{
|
||||
name: `${intl.get('july')} - ${intl.get('june')}`,
|
||||
key: 'july',
|
||||
},
|
||||
{
|
||||
name: `${intl.get('august')} - ${intl.get('july')}`,
|
||||
key: 'august',
|
||||
},
|
||||
{
|
||||
name: `${intl.get('september')} - ${intl.get('august')}`,
|
||||
key: 'september',
|
||||
},
|
||||
{
|
||||
name: `${intl.get('october')} - ${intl.get('november')}`,
|
||||
key: 'october',
|
||||
},
|
||||
{
|
||||
name: `${intl.get('november')} - ${intl.get('october')}`,
|
||||
key: 'november',
|
||||
},
|
||||
{
|
||||
name: `${intl.get('december')} - ${intl.get('november')}`,
|
||||
key: 'december',
|
||||
},
|
||||
]
|
||||
33
packages/webapp/src/constants/footerLinks.tsx
Normal file
33
packages/webapp/src/constants/footerLinks.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
// @ts-nocheck
|
||||
import intl from 'react-intl-universal';
|
||||
|
||||
export const getFooterLinks = () => [
|
||||
{
|
||||
title: intl.get('blog'),
|
||||
link: '#',
|
||||
},
|
||||
{
|
||||
title: intl.get('support'),
|
||||
link: '#',
|
||||
},
|
||||
{
|
||||
title: intl.get('service_status'),
|
||||
link: '#',
|
||||
},
|
||||
{
|
||||
title: intl.get('pricing'),
|
||||
link: '#',
|
||||
},
|
||||
{
|
||||
title: intl.get('reseller_partner'),
|
||||
link: '#',
|
||||
},
|
||||
{
|
||||
title: intl.get('docs'),
|
||||
link: '#',
|
||||
},
|
||||
{
|
||||
title: 'Bigcapital',
|
||||
link: 'http://bigcapital.ly',
|
||||
}
|
||||
]
|
||||
176
packages/webapp/src/constants/homepageOptions.tsx
Normal file
176
packages/webapp/src/constants/homepageOptions.tsx
Normal file
@@ -0,0 +1,176 @@
|
||||
// @ts-nocheck
|
||||
import React from 'react';
|
||||
import { FormattedMessage as T } from '@/components';
|
||||
import {
|
||||
SaleInvoiceAction,
|
||||
SaleEstimateAction,
|
||||
AbilitySubject,
|
||||
SaleReceiptAction,
|
||||
CustomerAction,
|
||||
PaymentReceiveAction,
|
||||
BillAction,
|
||||
VendorAction,
|
||||
PaymentMadeAction,
|
||||
AccountAction,
|
||||
ManualJournalAction,
|
||||
ExpenseAction,
|
||||
ItemAction,
|
||||
ReportsAction,
|
||||
} from './abilityOption';
|
||||
|
||||
export const accountsReceivable = [
|
||||
{
|
||||
sectionTitle: <T id={'accounts_receivable_a_r'} />,
|
||||
shortcuts: [
|
||||
{
|
||||
title: <T id={'sales_invoices'} />,
|
||||
description: <T id={'tracking_sales_invoices_with_your_customers'} />,
|
||||
link: '/invoices',
|
||||
subject: AbilitySubject.Invoice,
|
||||
ability: SaleInvoiceAction.View,
|
||||
},
|
||||
{
|
||||
title: <T id={'sales_estimates'} />,
|
||||
description: <T id={'manage_your_sales_estimates_to_create_quotes'} />,
|
||||
link: '/estimates',
|
||||
subject: AbilitySubject.Estimate,
|
||||
ability: SaleEstimateAction.View,
|
||||
},
|
||||
{
|
||||
title: <T id={'sales_receipts'} />,
|
||||
description: <T id={'manage_sales_receipts_for_sales_that_get_paid'} />,
|
||||
link: '/receipts',
|
||||
subject: AbilitySubject.Receipt,
|
||||
ability: SaleReceiptAction.View,
|
||||
},
|
||||
{
|
||||
title: <T id={'customers'} />,
|
||||
description: <T id={'manage_the_customers_relations_with_customer'} />,
|
||||
link: '/customers',
|
||||
subject: AbilitySubject.Customer,
|
||||
ability: CustomerAction.View,
|
||||
},
|
||||
{
|
||||
title: <T id={'customers_payments'} />,
|
||||
description: (
|
||||
<T id={'manage_payment_transactions_from_your_customers'} />
|
||||
),
|
||||
link: '/payment-receives',
|
||||
subject: AbilitySubject.PaymentReceive,
|
||||
ability: PaymentReceiveAction.View,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export const accountsPayable = [
|
||||
{
|
||||
sectionTitle: <T id={'accounts_payable_a_p'} />,
|
||||
shortcuts: [
|
||||
{
|
||||
title: <T id={'purchase_invoices'} />,
|
||||
description: (
|
||||
<T id={'manage_the_purchase_invoices_with_your_vendors'} />
|
||||
),
|
||||
link: '/bills',
|
||||
subject: AbilitySubject.Bill,
|
||||
ability: BillAction.View,
|
||||
},
|
||||
{
|
||||
title: <T id={'vendors'} />,
|
||||
description: (
|
||||
<T id={'manage_the_vendors_relations_with_vendor_relations'} />
|
||||
),
|
||||
link: '/vendors',
|
||||
subject: AbilitySubject.Vendor,
|
||||
ability: VendorAction.View,
|
||||
},
|
||||
{
|
||||
title: <T id={'vendors_payments'} />,
|
||||
description: <T id={'manage_payments_transactions_to_your_vendors'} />,
|
||||
link: '/payment-mades',
|
||||
subject: AbilitySubject.PaymentMade,
|
||||
ability: PaymentMadeAction.View,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export const financialAccounting = [
|
||||
{
|
||||
sectionTitle: <T id={'financial_accounting'} />,
|
||||
shortcuts: [
|
||||
{
|
||||
title: <T id={'chart_of_accounts'} />,
|
||||
description: (
|
||||
<T
|
||||
id={
|
||||
'manage_your_accounts_chart_to_record_your_transactions_and_categories'
|
||||
}
|
||||
/>
|
||||
),
|
||||
link: '/accounts',
|
||||
subject: AbilitySubject.Account,
|
||||
ability: AccountAction.View,
|
||||
},
|
||||
{
|
||||
title: <T id={'manual_journal'} />,
|
||||
description: (
|
||||
<T id={'manage_manual_journal_transactions_on_accounts'} />
|
||||
),
|
||||
link: '/manual-journals',
|
||||
subject: AbilitySubject.ManualJournal,
|
||||
ability: ManualJournalAction.View,
|
||||
},
|
||||
{
|
||||
title: <T id={'expenses'} />,
|
||||
description: (
|
||||
<T id={'track_your_indirect_expenses_under_specific_categories'} />
|
||||
),
|
||||
link: '/expenses',
|
||||
subject: AbilitySubject.Expense,
|
||||
ability: ExpenseAction.View,
|
||||
},
|
||||
{
|
||||
title: <T id={'financial_statements'} />,
|
||||
description: (
|
||||
<T id={'show_financial_reports_about_your_organization'} />
|
||||
),
|
||||
link: '/financial-reports',
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.ALL,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export const productsServices = [
|
||||
{
|
||||
sectionTitle: <T id={'products_services_inventory'} />,
|
||||
shortcuts: [
|
||||
{
|
||||
title: <T id={'products_services'} />,
|
||||
description: (
|
||||
<T id={'manage_your_products_inventory_or_non_inventory'} />
|
||||
),
|
||||
link: '/items',
|
||||
subject: AbilitySubject.Item,
|
||||
ability: ItemAction.View,
|
||||
},
|
||||
{
|
||||
title: <T id={'products_services_categories'} />,
|
||||
description: <T id={'group_your_products_and_service'} />,
|
||||
link: 'items/categories',
|
||||
},
|
||||
{
|
||||
title: <T id={'inventory_adjustments'} />,
|
||||
description: (
|
||||
<T id={'manage_your_inventory_adjustment_of_inventory_items'} />
|
||||
),
|
||||
link: '/inventory-adjustments',
|
||||
subject: AbilitySubject.InventoryAdjustment,
|
||||
ability: SaleInvoiceAction.View,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
10
packages/webapp/src/constants/index.tsx
Normal file
10
packages/webapp/src/constants/index.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
// @ts-nocheck
|
||||
export * from './accountTypes';
|
||||
export * from './tableStyle';
|
||||
export * from './features';
|
||||
export * from './cellTypes';
|
||||
export * from './classes';
|
||||
export * from './adjustmentType';
|
||||
export * from './cashflowOptions';
|
||||
|
||||
export const Align = { Left: 'left', Right: 'right', Center: 'center' };
|
||||
@@ -0,0 +1,52 @@
|
||||
// @ts-nocheck
|
||||
import intl from 'react-intl-universal';
|
||||
import {
|
||||
AbilitySubject,
|
||||
SaleEstimateAction,
|
||||
SaleReceiptAction,
|
||||
SaleInvoiceAction,
|
||||
BillAction,
|
||||
} from './abilityOption';
|
||||
import { useAbilitiesFilter } from '../hooks';
|
||||
|
||||
export const getItemPaymentTransactions = () => [
|
||||
{
|
||||
name: 'invoices',
|
||||
label: intl.get('invoices'),
|
||||
permission: {
|
||||
subject: AbilitySubject.Invoice,
|
||||
ability: SaleInvoiceAction.View,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'estimates',
|
||||
label: intl.get('estimates'),
|
||||
permission: {
|
||||
subject: AbilitySubject.Estimate,
|
||||
ability: SaleEstimateAction.View,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'receipts',
|
||||
label: intl.get('receipts'),
|
||||
permission: {
|
||||
subject: AbilitySubject.Receipt,
|
||||
ability: SaleReceiptAction.View,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'bills',
|
||||
label: intl.get('bills'),
|
||||
permission: {
|
||||
subject: AbilitySubject.Bill,
|
||||
ability: BillAction.View,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export const useGetItemPaymentTransactionsMenu = () => {
|
||||
const itemTransactionMenu = getItemPaymentTransactions();
|
||||
const abilitiesFilter = useAbilitiesFilter();
|
||||
|
||||
return abilitiesFilter(itemTransactionMenu);
|
||||
};
|
||||
232
packages/webapp/src/constants/keyboardShortcutsOptions.tsx
Normal file
232
packages/webapp/src/constants/keyboardShortcutsOptions.tsx
Normal file
@@ -0,0 +1,232 @@
|
||||
// @ts-nocheck
|
||||
import intl from 'react-intl-universal';
|
||||
import {
|
||||
AbilitySubject,
|
||||
AccountAction,
|
||||
BillAction,
|
||||
CashflowAction,
|
||||
CustomerAction,
|
||||
ExpenseAction,
|
||||
ItemAction,
|
||||
ManualJournalAction,
|
||||
ReportsAction,
|
||||
SaleEstimateAction,
|
||||
SaleInvoiceAction,
|
||||
SaleReceiptAction,
|
||||
VendorAction,
|
||||
} from './abilityOption';
|
||||
|
||||
export default [
|
||||
{
|
||||
shortcut_key: 'Shift + I',
|
||||
description: intl.get('jump_to_the_invoices'),
|
||||
permission: {
|
||||
ability: SaleInvoiceAction.View,
|
||||
subject: AbilitySubject.Invoice,
|
||||
},
|
||||
},
|
||||
{
|
||||
shortcut_key: 'Shift + E',
|
||||
description: intl.get('jump_to_the_estimates'),
|
||||
permission: {
|
||||
ability: SaleEstimateAction.View,
|
||||
subject: AbilitySubject.Estimate,
|
||||
},
|
||||
},
|
||||
{
|
||||
shortcut_key: 'Shift + R',
|
||||
description: intl.get('jump_to_the_receipts'),
|
||||
permission: {
|
||||
ability: SaleReceiptAction.View,
|
||||
subject: AbilitySubject.Receipt,
|
||||
},
|
||||
},
|
||||
{
|
||||
shortcut_key: 'Shift + X',
|
||||
description: intl.get('jump_to_the_expenses'),
|
||||
permission: {
|
||||
ability: ExpenseAction.View,
|
||||
subject: AbilitySubject.Expense,
|
||||
},
|
||||
},
|
||||
{
|
||||
shortcut_key: 'Shift + C',
|
||||
description: intl.get('jump_to_the_customers'),
|
||||
permission: {
|
||||
ability: CustomerAction.View,
|
||||
subject: AbilitySubject.Customer,
|
||||
},
|
||||
},
|
||||
{
|
||||
shortcut_key: 'Shift + V',
|
||||
description: intl.get('jump_to_the_vendors'),
|
||||
permission: {
|
||||
ability: VendorAction.View,
|
||||
subject: AbilitySubject.Vendor,
|
||||
},
|
||||
},
|
||||
{
|
||||
shortcut_key: 'Shift + A',
|
||||
description: intl.get('jump_to_the_chart_of_accounts'),
|
||||
permission: {
|
||||
ability: AccountAction.View,
|
||||
subject: AbilitySubject.Account,
|
||||
},
|
||||
},
|
||||
{
|
||||
shortcut_key: 'Shift + B',
|
||||
description: intl.get('jump_to_the_bills'),
|
||||
permission: {
|
||||
ability: BillAction.View,
|
||||
subject: AbilitySubject.Bill,
|
||||
},
|
||||
},
|
||||
{
|
||||
shortcut_key: 'Shift + M',
|
||||
description: intl.get('jump_to_the_manual_journals'),
|
||||
permission: {
|
||||
ability: ManualJournalAction.View,
|
||||
subject: AbilitySubject.ManualJournal,
|
||||
},
|
||||
},
|
||||
{
|
||||
shortcut_key: 'Shift + W',
|
||||
description: intl.get('jump_to_the_items'),
|
||||
permission: {
|
||||
ability: ItemAction.View,
|
||||
subject: AbilitySubject.Item,
|
||||
},
|
||||
},
|
||||
{
|
||||
shortcut_key: 'Shift + D',
|
||||
description: intl.get('jump_to_the_add_money_in'),
|
||||
permission: {
|
||||
ability: CashflowAction.Create,
|
||||
subject: AbilitySubject.Cashflow,
|
||||
},
|
||||
},
|
||||
{
|
||||
shortcut_key: 'Shift + Q',
|
||||
description: intl.get('jump_to_the_add_money_out'),
|
||||
permission: {
|
||||
ability: CashflowAction.Create,
|
||||
subject: AbilitySubject.Cashflow,
|
||||
},
|
||||
},
|
||||
{
|
||||
shortcut_key: 'Shift + 1',
|
||||
description: intl.get('jump_to_the_balance_sheet'),
|
||||
permission: {
|
||||
ability: ReportsAction.READ_BALANCE_SHEET,
|
||||
subject: AbilitySubject.Report,
|
||||
},
|
||||
},
|
||||
{
|
||||
shortcut_key: 'Shift + 2',
|
||||
description: intl.get('jump_to_the_profit_loss_sheet'),
|
||||
permission: {
|
||||
ability: ReportsAction.READ_PROFIT_LOSS,
|
||||
subject: AbilitySubject.Report,
|
||||
},
|
||||
},
|
||||
{
|
||||
shortcut_key: 'Shift + 3',
|
||||
description: intl.get('jump_to_the_journal_sheet'),
|
||||
permission: {
|
||||
ability: ReportsAction.READ_JOURNAL,
|
||||
subject: AbilitySubject.Report,
|
||||
},
|
||||
},
|
||||
{
|
||||
shortcut_key: 'Shift + 4',
|
||||
description: intl.get('jump_to_the_general_ledger_sheet'),
|
||||
permission: {
|
||||
ability: ReportsAction.READ_GENERAL_LEDGET,
|
||||
subject: AbilitySubject.Report,
|
||||
},
|
||||
},
|
||||
{
|
||||
shortcut_key: 'Shift + 5',
|
||||
description: intl.get('jump_to_the_trial_balance_sheet'),
|
||||
permission: {
|
||||
ability: ReportsAction.READ_TRIAL_BALANCE_SHEET,
|
||||
subject: AbilitySubject.Report,
|
||||
},
|
||||
},
|
||||
{
|
||||
shortcut_key: 'Ctrl + Shift + I ',
|
||||
description: intl.get('create_a_new_invoice'),
|
||||
permission: {
|
||||
ability: SaleInvoiceAction.Create,
|
||||
subject: AbilitySubject.Invoice,
|
||||
},
|
||||
},
|
||||
{
|
||||
shortcut_key: 'Ctrl + Shift + E ',
|
||||
description: intl.get('create_a_new_estimate'),
|
||||
permission: {
|
||||
ability: SaleEstimateAction.Create,
|
||||
subject: AbilitySubject.Estimate,
|
||||
},
|
||||
},
|
||||
{
|
||||
shortcut_key: 'Ctrl + Shift + R ',
|
||||
description: intl.get('create_a_new_receipt'),
|
||||
permission: {
|
||||
ability: SaleReceiptAction.Create,
|
||||
subject: AbilitySubject.Receipt,
|
||||
},
|
||||
},
|
||||
{
|
||||
shortcut_key: 'Ctrl + Shift + X ',
|
||||
description: intl.get('create_a_new_expense'),
|
||||
permission: {
|
||||
ability: ExpenseAction.Create,
|
||||
subject: AbilitySubject.Expense,
|
||||
},
|
||||
},
|
||||
{
|
||||
shortcut_key: 'Ctrl + Shift + C ',
|
||||
description: intl.get('create_a_new_customer'),
|
||||
permission: {
|
||||
ability: CustomerAction.Create,
|
||||
subject: AbilitySubject.Customer,
|
||||
},
|
||||
},
|
||||
{
|
||||
shortcut_key: 'Ctrl + Shift + V ',
|
||||
description: intl.get('create_a_new_vendor'),
|
||||
permission: {
|
||||
ability: VendorAction.Create,
|
||||
subject: AbilitySubject.Vendor,
|
||||
},
|
||||
},
|
||||
{
|
||||
shortcut_key: 'Ctrl + Shift + B ',
|
||||
description: intl.get('create_a_new_bill'),
|
||||
permission: {
|
||||
ability: BillAction.Create,
|
||||
subject: AbilitySubject.Bill,
|
||||
},
|
||||
},
|
||||
{
|
||||
shortcut_key: 'Ctrl + Shift + M ',
|
||||
description: intl.get('create_a_new_journal'),
|
||||
permission: {
|
||||
ability: ManualJournalAction.Create,
|
||||
subject: AbilitySubject.ManualJournal,
|
||||
},
|
||||
},
|
||||
{
|
||||
shortcut_key: 'Ctrl + Shift + W ',
|
||||
description: intl.get('create_a_new_item'),
|
||||
permission: {
|
||||
ability: ItemAction.Create,
|
||||
subject: AbilitySubject.Item,
|
||||
},
|
||||
},
|
||||
{
|
||||
shortcut_key: 'Ctrl + / ',
|
||||
description: intl.get('close_and_open_sidebar'),
|
||||
},
|
||||
];
|
||||
7
packages/webapp/src/constants/languagesOptions.tsx
Normal file
7
packages/webapp/src/constants/languagesOptions.tsx
Normal file
@@ -0,0 +1,7 @@
|
||||
// @ts-nocheck
|
||||
import intl from 'react-intl-universal';
|
||||
|
||||
export const getLanguages = () => [
|
||||
{ name: intl.get('english'), value: 'en' },
|
||||
{ name: intl.get('arabic'), value: 'ar' },
|
||||
];
|
||||
8
packages/webapp/src/constants/modalChargeOptions.tsx
Normal file
8
packages/webapp/src/constants/modalChargeOptions.tsx
Normal file
@@ -0,0 +1,8 @@
|
||||
// @ts-nocheck
|
||||
import intl from 'react-intl-universal';
|
||||
|
||||
export const modalChargeOptions = [
|
||||
{ name: 'Hourly rate', value: 'Hourly rate' },
|
||||
{ name: 'Fixed price', value: 'Fixed price' },
|
||||
{ name: 'Non-chargeable', value: 'Non-chargeable' },
|
||||
];
|
||||
13
packages/webapp/src/constants/moreVertOptions.tsx
Normal file
13
packages/webapp/src/constants/moreVertOptions.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
// @ts-nocheck
|
||||
import intl from 'react-intl-universal';
|
||||
|
||||
export const moreVertOptions = [
|
||||
{
|
||||
name: intl.get('bad_debt.dialog.bad_debt'),
|
||||
value: 'bad debt',
|
||||
},
|
||||
{
|
||||
name: intl.get('bad_debt.dialog.cancel_bad_debt'),
|
||||
value: 'cancel bad debt',
|
||||
},
|
||||
];
|
||||
22
packages/webapp/src/constants/numberFormatsOptions.tsx
Normal file
22
packages/webapp/src/constants/numberFormatsOptions.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
// @ts-nocheck
|
||||
import intl from 'react-intl-universal';
|
||||
|
||||
export const moneyFormat = [
|
||||
{ key: 'total', text: intl.get('total_rows') },
|
||||
{ key: 'always', text: intl.get('always') },
|
||||
{ key: 'none', text: intl.get('none') },
|
||||
];
|
||||
|
||||
export const negativeFormat = [
|
||||
{ key: 'parentheses', text: '($1000)' },
|
||||
{ key: 'mines', text: '-$1000' },
|
||||
];
|
||||
|
||||
export const decimalPlaces = [
|
||||
{ text: '$1', key: 0 },
|
||||
{ text: '$0.1', key: 1 },
|
||||
{ text: '$0.01', key: 2 },
|
||||
{ text: '$0.001', key: 3 },
|
||||
{ text: '$0.0001', key: 4 },
|
||||
{ text: '$0.00001', key: 5 },
|
||||
];
|
||||
660
packages/webapp/src/constants/permissionsSchema.tsx
Normal file
660
packages/webapp/src/constants/permissionsSchema.tsx
Normal file
@@ -0,0 +1,660 @@
|
||||
// @ts-nocheck
|
||||
import { chain } from 'lodash';
|
||||
import intl from 'react-intl-universal';
|
||||
import {
|
||||
AbilitySubject,
|
||||
AccountAction,
|
||||
BillAction,
|
||||
CreditNoteAction,
|
||||
CustomerAction,
|
||||
ExpenseAction,
|
||||
ItemAction,
|
||||
ManualJournalAction,
|
||||
PaymentMadeAction,
|
||||
PaymentReceiveAction,
|
||||
ReportsAction,
|
||||
SaleEstimateAction,
|
||||
SaleInvoiceAction,
|
||||
SaleReceiptAction,
|
||||
VendorAction,
|
||||
VendorCreditAction,
|
||||
} from './abilityOption';
|
||||
|
||||
export const ModulePermissionsStyle = {
|
||||
Columns: 'columns',
|
||||
Vertical: 'vertical',
|
||||
};
|
||||
|
||||
const PermissionColumn = {
|
||||
View: 'view',
|
||||
Create: 'create',
|
||||
Delete: 'delete',
|
||||
Edit: 'edit',
|
||||
};
|
||||
|
||||
export const getPermissionsSchema = () => [
|
||||
{
|
||||
label: intl.get('permissions.items_inventory'),
|
||||
type: ModulePermissionsStyle.Columns,
|
||||
serviceFullAccess: true,
|
||||
columns: [
|
||||
{ label: intl.get('permissions.column.view'), key: 'view' },
|
||||
{ label: intl.get('permissions.column.create'), key: 'create' },
|
||||
{ label: intl.get('permissions.column.edit'), key: 'edit' },
|
||||
{ label: intl.get('permissions.column.delete'), key: 'delete' },
|
||||
],
|
||||
services: [
|
||||
{
|
||||
label: intl.get('permissions.items'),
|
||||
subject: AbilitySubject.Item,
|
||||
permissions: [
|
||||
{
|
||||
label: intl.get('permissions.column.view'),
|
||||
key: ItemAction.View,
|
||||
relatedColumn: PermissionColumn.View,
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.create'),
|
||||
key: ItemAction.Create,
|
||||
relatedColumn: PermissionColumn.Create,
|
||||
depend: [{ key: ItemAction.View }],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.edit'),
|
||||
key: ItemAction.Edit,
|
||||
relatedColumn: PermissionColumn.Edit,
|
||||
depend: [{ key: ItemAction.Create }],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.delete'),
|
||||
key: ItemAction.Delete,
|
||||
relatedColumn: PermissionColumn.Delete,
|
||||
depend: [{ key: ItemAction.Edit }],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.inventory_adjustment'),
|
||||
subject: AbilitySubject.InventoryAdjustment,
|
||||
permissions: [
|
||||
{
|
||||
label: 'View',
|
||||
key: ItemAction.View,
|
||||
relatedColumn: PermissionColumn.View,
|
||||
},
|
||||
{
|
||||
label: 'Create',
|
||||
key: ItemAction.Create,
|
||||
relatedColumn: PermissionColumn.Create,
|
||||
depend: [{ key: ItemAction.View }],
|
||||
},
|
||||
{
|
||||
label: 'Edit',
|
||||
key: ItemAction.Edit,
|
||||
relatedColumn: PermissionColumn.Edit,
|
||||
depend: [{ key: ItemAction.Create }],
|
||||
},
|
||||
{
|
||||
label: 'Delete',
|
||||
key: ItemAction.Delete,
|
||||
relatedColumn: PermissionColumn.Delete,
|
||||
depend: [{ key: ItemAction.Edit }],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.contacts'),
|
||||
type: ModulePermissionsStyle.Columns,
|
||||
serviceFullAccess: true,
|
||||
moduleFullAccess: true,
|
||||
columns: [
|
||||
{ label: intl.get('permissions.column.view'), key: 'view' },
|
||||
{ label: intl.get('permissions.column.create'), key: 'create' },
|
||||
{ label: intl.get('permissions.column.edit'), key: 'edit' },
|
||||
{ label: intl.get('permissions.column.delete'), key: 'delete' },
|
||||
],
|
||||
services: [
|
||||
{
|
||||
label: intl.get('permissions.customers'),
|
||||
subject: AbilitySubject.Customer,
|
||||
permissions: [
|
||||
{
|
||||
label: intl.get('permissions.column.view'),
|
||||
key: CustomerAction.View,
|
||||
relatedColumn: PermissionColumn.View,
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.create'),
|
||||
key: CustomerAction.Create,
|
||||
relatedColumn: PermissionColumn.Create,
|
||||
depend: [{ key: CustomerAction.View }],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.edit'),
|
||||
key: CustomerAction.Edit,
|
||||
relatedColumn: PermissionColumn.Edit,
|
||||
depend: [{ key: CustomerAction.Create }],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.delete'),
|
||||
key: CustomerAction.Delete,
|
||||
relatedColumn: PermissionColumn.Delete,
|
||||
depend: [{ key: CustomerAction.Edit }],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.vendors'),
|
||||
subject: AbilitySubject.Vendor,
|
||||
permissions: [
|
||||
{
|
||||
label: intl.get('permissions.column.view'),
|
||||
key: VendorAction.View,
|
||||
relatedColumn: PermissionColumn.View,
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.create'),
|
||||
key: VendorAction.Create,
|
||||
relatedColumn: PermissionColumn.Create,
|
||||
depend: [{ key: VendorAction.View }],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.edit'),
|
||||
key: VendorAction.Edit,
|
||||
relatedColumn: PermissionColumn.Edit,
|
||||
depend: [{ key: VendorAction.Create }],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.delete'),
|
||||
key: VendorAction.Delete,
|
||||
relatedColumn: PermissionColumn.Delete,
|
||||
depend: [{ key: VendorAction.Edit }],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.sales'),
|
||||
type: ModulePermissionsStyle.Columns,
|
||||
serviceFullAccess: true,
|
||||
moduleFullAccess: true,
|
||||
columns: [
|
||||
{ label: intl.get('permissions.column.view'), key: 'view' },
|
||||
{ label: intl.get('permissions.column.create'), key: 'create' },
|
||||
{ label: intl.get('permissions.column.edit'), key: 'edit' },
|
||||
{ label: intl.get('permissions.column.delete'), key: 'delete' },
|
||||
],
|
||||
services: [
|
||||
{
|
||||
label: intl.get('permissions.sale_invoice'),
|
||||
subject: AbilitySubject.Invoice,
|
||||
permissions: [
|
||||
{
|
||||
label: intl.get('permissions.column.view'),
|
||||
key: SaleInvoiceAction.View,
|
||||
relatedColumn: PermissionColumn.View,
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.create'),
|
||||
key: SaleInvoiceAction.Create,
|
||||
relatedColumn: PermissionColumn.Create,
|
||||
depend: [{ key: SaleInvoiceAction.View }],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.edit'),
|
||||
key: SaleInvoiceAction.Edit,
|
||||
relatedColumn: PermissionColumn.Edit,
|
||||
depend: [{ key: SaleInvoiceAction.Create }],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.delete'),
|
||||
key: SaleInvoiceAction.Delete,
|
||||
relatedColumn: PermissionColumn.Delete,
|
||||
depend: [{ key: SaleInvoiceAction.Edit }],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.written_off_invoice'),
|
||||
key: SaleInvoiceAction.Writeoff,
|
||||
depend: [{ key: SaleInvoiceAction.Edit }],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.sale_estimate'),
|
||||
subject: AbilitySubject.Estimate,
|
||||
permissions: [
|
||||
{
|
||||
label: intl.get('permissions.column.view'),
|
||||
key: SaleEstimateAction.View,
|
||||
relatedColumn: PermissionColumn.View,
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.create'),
|
||||
key: SaleEstimateAction.Create,
|
||||
relatedColumn: PermissionColumn.Create,
|
||||
depend: [{ key: SaleEstimateAction.View }],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.edit'),
|
||||
key: SaleEstimateAction.Edit,
|
||||
relatedColumn: PermissionColumn.Edit,
|
||||
depend: [{ key: SaleEstimateAction.Create }],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.delete'),
|
||||
key: SaleEstimateAction.Delete,
|
||||
relatedColumn: PermissionColumn.Delete,
|
||||
depend: [{ key: SaleEstimateAction.Edit }],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.sale_receipt'),
|
||||
subject: AbilitySubject.Receipt,
|
||||
permissions: [
|
||||
{
|
||||
label: intl.get('permissions.column.view'),
|
||||
key: SaleReceiptAction.View,
|
||||
relatedColumn: PermissionColumn.View,
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.create'),
|
||||
key: SaleReceiptAction.Create,
|
||||
relatedColumn: PermissionColumn.Create,
|
||||
depend: [{ key: SaleReceiptAction.View }],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.edit'),
|
||||
key: SaleReceiptAction.Edit,
|
||||
relatedColumn: PermissionColumn.Edit,
|
||||
depend: [{ key: SaleReceiptAction.Create }],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.delete'),
|
||||
key: SaleReceiptAction.Delete,
|
||||
relatedColumn: PermissionColumn.Delete,
|
||||
depend: [{ key: SaleReceiptAction.Edit }],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.credit_note'),
|
||||
subject: AbilitySubject.CreditNote,
|
||||
permissions: [
|
||||
{
|
||||
label: intl.get('permissions.column.view'),
|
||||
key: CreditNoteAction.View,
|
||||
relatedColumn: PermissionColumn.View,
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.create'),
|
||||
key: CreditNoteAction.Create,
|
||||
relatedColumn: PermissionColumn.Create,
|
||||
depend: [{ key: CreditNoteAction.View }],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.edit'),
|
||||
key: CreditNoteAction.Edit,
|
||||
relatedColumn: PermissionColumn.Edit,
|
||||
depend: [{ key: CreditNoteAction.Create }],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.delete'),
|
||||
key: CreditNoteAction.Delete,
|
||||
relatedColumn: PermissionColumn.Delete,
|
||||
depend: [{ key: CreditNoteAction.Edit }],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.refund_credit_note'),
|
||||
key: CreditNoteAction.Refund,
|
||||
depend: [{ key: CreditNoteAction.View }],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.payment_receive'),
|
||||
subject: AbilitySubject.PaymentReceive,
|
||||
permissions: [
|
||||
{
|
||||
label: intl.get('permissions.column.view'),
|
||||
key: PaymentReceiveAction.View,
|
||||
relatedColumn: PermissionColumn.View,
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.create'),
|
||||
key: PaymentReceiveAction.Create,
|
||||
relatedColumn: PermissionColumn.Create,
|
||||
depend: [{ key: PaymentReceiveAction.View }],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.edit'),
|
||||
key: PaymentReceiveAction.Edit,
|
||||
relatedColumn: PermissionColumn.Edit,
|
||||
depend: [{ key: PaymentReceiveAction.Create }],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.delete'),
|
||||
key: PaymentReceiveAction.Delete,
|
||||
relatedColumn: PermissionColumn.Delete,
|
||||
depend: [{ key: PaymentReceiveAction.Edit }],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.purchases'),
|
||||
type: ModulePermissionsStyle.Columns,
|
||||
serviceFullAccess: true,
|
||||
moduleFullAccess: true,
|
||||
columns: [
|
||||
{ label: intl.get('permissions.column.view'), key: 'view' },
|
||||
{ label: intl.get('permissions.column.create'), key: 'create' },
|
||||
{ label: intl.get('permissions.column.edit'), key: 'edit' },
|
||||
{ label: intl.get('permissions.column.delete'), key: 'delete' },
|
||||
],
|
||||
services: [
|
||||
{
|
||||
label: intl.get('permissions.bills'),
|
||||
subject: AbilitySubject.Bill,
|
||||
permissions: [
|
||||
{
|
||||
label: intl.get('permissions.column.view'),
|
||||
key: BillAction.View,
|
||||
relatedColumn: PermissionColumn.View,
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.create'),
|
||||
key: BillAction.Create,
|
||||
relatedColumn: PermissionColumn.Create,
|
||||
depend: [{ key: BillAction.View }],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.edit'),
|
||||
key: BillAction.Edit,
|
||||
relatedColumn: PermissionColumn.Edit,
|
||||
depend: [{ key: BillAction.Create }],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.delete'),
|
||||
key: BillAction.Delete,
|
||||
relatedColumn: PermissionColumn.Delete,
|
||||
depend: [{ key: BillAction.Edit }],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.vendor_credits'),
|
||||
subject: AbilitySubject.VendorCredit,
|
||||
permissions: [
|
||||
{
|
||||
label: intl.get('permissions.column.view'),
|
||||
key: VendorCreditAction.View,
|
||||
relatedColumn: PermissionColumn.View,
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.create'),
|
||||
key: VendorCreditAction.Create,
|
||||
relatedColumn: PermissionColumn.Create,
|
||||
depend: [{ key: VendorCreditAction.View }],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.edit'),
|
||||
key: VendorCreditAction.Edit,
|
||||
relatedColumn: PermissionColumn.Edit,
|
||||
depend: [{ key: VendorCreditAction.Create }],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.delete'),
|
||||
key: VendorCreditAction.Delete,
|
||||
relatedColumn: PermissionColumn.Delete,
|
||||
depend: [{ key: VendorCreditAction.Edit }],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.refund_vendor_credit'),
|
||||
key: VendorCreditAction.Refund,
|
||||
depend: [{ key: VendorCreditAction.View }],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.payment_made'),
|
||||
subject: AbilitySubject.PaymentMade,
|
||||
permissions: [
|
||||
{
|
||||
label: intl.get('permissions.column.view'),
|
||||
key: PaymentMadeAction.View,
|
||||
relatedColumn: PermissionColumn.View,
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.create'),
|
||||
key: PaymentMadeAction.Create,
|
||||
relatedColumn: PermissionColumn.Create,
|
||||
depend: [{ key: PaymentMadeAction.View }],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.edit'),
|
||||
key: PaymentMadeAction.Edit,
|
||||
relatedColumn: PermissionColumn.Edit,
|
||||
depend: [{ key: PaymentMadeAction.Create }],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.delete'),
|
||||
key: PaymentMadeAction.Delete,
|
||||
relatedColumn: PermissionColumn.Delete,
|
||||
depend: [{ key: PaymentMadeAction.Edit }],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.financial_accounting'),
|
||||
type: ModulePermissionsStyle.Columns,
|
||||
serviceFullAccess: true,
|
||||
moduleFullAccess: true,
|
||||
columns: [
|
||||
{ label: intl.get('permissions.column.view'), key: 'view' },
|
||||
{ label: intl.get('permissions.column.create'), key: 'create' },
|
||||
{ label: intl.get('permissions.column.edit'), key: 'edit' },
|
||||
{ label: intl.get('permissions.column.delete'), key: 'delete' },
|
||||
],
|
||||
services: [
|
||||
{
|
||||
label: intl.get('permissions.manual_journals'),
|
||||
subject: AbilitySubject.ManualJournal,
|
||||
permissions: [
|
||||
{
|
||||
label: intl.get('permissions.column.view'),
|
||||
key: ManualJournalAction.View,
|
||||
relatedColumn: PermissionColumn.View,
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.create'),
|
||||
key: ManualJournalAction.Create,
|
||||
relatedColumn: PermissionColumn.Create,
|
||||
depend: [{ key: ManualJournalAction.View }],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.edit'),
|
||||
key: ManualJournalAction.Edit,
|
||||
relatedColumn: PermissionColumn.Edit,
|
||||
depend: [{ key: ManualJournalAction.Create }],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.delete'),
|
||||
key: ManualJournalAction.Delete,
|
||||
relatedColumn: PermissionColumn.Delete,
|
||||
depend: [{ key: ManualJournalAction.Edit }],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.chart_of_accounts'),
|
||||
subject: AbilitySubject.Account,
|
||||
permissions: [
|
||||
{
|
||||
label: intl.get('permissions.column.view'),
|
||||
key: AccountAction.View,
|
||||
relatedColumn: PermissionColumn.View,
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.create'),
|
||||
key: AccountAction.Create,
|
||||
relatedColumn: PermissionColumn.Create,
|
||||
depend: [{ key: AccountAction.View }],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.edit'),
|
||||
key: AccountAction.Edit,
|
||||
relatedColumn: PermissionColumn.Edit,
|
||||
depend: [{ key: AccountAction.Create }],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.delete'),
|
||||
key: AccountAction.Delete,
|
||||
relatedColumn: PermissionColumn.Delete,
|
||||
depend: [{ key: AccountAction.Edit }],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.transactions_locking'),
|
||||
key: AccountAction.TransactionsLocking,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.expenses'),
|
||||
subject: AbilitySubject.Expense,
|
||||
permissions: [
|
||||
{
|
||||
label: intl.get('permissions.column.view'),
|
||||
key: ExpenseAction.View,
|
||||
relatedColumn: PermissionColumn.View,
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.create'),
|
||||
key: ExpenseAction.Create,
|
||||
relatedColumn: PermissionColumn.Create,
|
||||
depend: [{ key: ExpenseAction.View }],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.edit'),
|
||||
key: ExpenseAction.Edit,
|
||||
relatedColumn: PermissionColumn.Edit,
|
||||
depend: [{ key: ExpenseAction.Create }],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.column.delete'),
|
||||
key: ExpenseAction.Delete,
|
||||
relatedColumn: PermissionColumn.Delete,
|
||||
depend: [{ key: ExpenseAction.Edit }],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.reports'),
|
||||
type: ModulePermissionsStyle.Vertical,
|
||||
serviceFullAccess: true,
|
||||
moduleFullAccess: true,
|
||||
services: [
|
||||
{
|
||||
label: intl.get('permissions.financial_reports'),
|
||||
subject: AbilitySubject.Report,
|
||||
permissions: [
|
||||
{
|
||||
label: intl.get('permissions.balance_sheet'),
|
||||
key: ReportsAction.READ_BALANCE_SHEET,
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.trial_balance_sheet'),
|
||||
key: ReportsAction.READ_TRIAL_BALANCE_SHEET,
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.profit_loss_sheet'),
|
||||
key: ReportsAction.READ_PROFIT_LOSS,
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.cash_flow_sheet'),
|
||||
key: ReportsAction.READ_CASHFLOW,
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.journal_sheet'),
|
||||
key: ReportsAction.READ_JOURNAL,
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.general_ledger'),
|
||||
key: ReportsAction.READ_GENERAL_LEDGET,
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.a_r_aging_summary_report'),
|
||||
key: ReportsAction.READ_AR_AGING_SUMMARY,
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.a_r_aging_summary_report'),
|
||||
key: ReportsAction.READ_AP_AGING_SUMMARY,
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.purchases_by_items'),
|
||||
key: ReportsAction.READ_PURCHASES_BY_ITEMS,
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.sales_by_items'),
|
||||
key: ReportsAction.READ_SALES_BY_ITEMS,
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.customers_transactions'),
|
||||
key: ReportsAction.READ_CUSTOMERS_TRANSACTIONS,
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.vendors_transactions'),
|
||||
key: ReportsAction.READ_VENDORS_TRANSACTIONS,
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.customers_summary_balance'),
|
||||
key: ReportsAction.READ_CUSTOMERS_SUMMARY_BALANCE,
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.vendors_summary_balance'),
|
||||
key: ReportsAction.READ_VENDORS_SUMMARY_BALANCE,
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.inventory_valuation_summary'),
|
||||
key: ReportsAction.READ_INVENTORY_VALUATION_SUMMARY,
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.inventory_items_details'),
|
||||
key: ReportsAction.READ_INVENTORY_ITEM_DETAILS,
|
||||
},
|
||||
{
|
||||
label: intl.get('permissions.cashflow_account_transactions'),
|
||||
key: ReportsAction.READ_CASHFLOW_ACCOUNT_TRANSACTION,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export function getPermissionsSchemaService(subject) {
|
||||
const permissions = getPermissionsSchema();
|
||||
|
||||
return chain(permissions)
|
||||
.map((perm) => perm.services)
|
||||
.flatten()
|
||||
.find((service) => service.subject === subject)
|
||||
.value();
|
||||
}
|
||||
|
||||
export function getPermissionsSchemaServices() {
|
||||
const permissions = getPermissionsSchema();
|
||||
|
||||
return chain(permissions)
|
||||
.map((module) => module.services)
|
||||
.flatten()
|
||||
.value();
|
||||
}
|
||||
42
packages/webapp/src/constants/preferencesMenu.tsx
Normal file
42
packages/webapp/src/constants/preferencesMenu.tsx
Normal file
@@ -0,0 +1,42 @@
|
||||
// @ts-nocheck
|
||||
import React from 'react';
|
||||
import { FormattedMessage as T } from '@/components';
|
||||
|
||||
export default [
|
||||
{
|
||||
text: <T id={'general'} />,
|
||||
disabled: false,
|
||||
href: '/preferences/general',
|
||||
},
|
||||
{
|
||||
text: <T id={'users'} />,
|
||||
href: '/preferences/users',
|
||||
},
|
||||
{
|
||||
text: <T id={'currencies'} />,
|
||||
href: '/preferences/currencies',
|
||||
},
|
||||
{
|
||||
text: <T id={'branches.label'} />,
|
||||
href: '/preferences/branches',
|
||||
},
|
||||
{
|
||||
text: <T id={'warehouses.label'} />,
|
||||
href: '/preferences/warehouses',
|
||||
},
|
||||
{
|
||||
text: <T id={'accountant'} />,
|
||||
disabled: false,
|
||||
href: '/preferences/accountant',
|
||||
},
|
||||
{
|
||||
text: <T id={'items'} />,
|
||||
disabled: false,
|
||||
href: '/preferences/items',
|
||||
},
|
||||
{
|
||||
text: <T id={'sms_integration.label'} />,
|
||||
disabled: false,
|
||||
href: '/preferences/sms-message',
|
||||
},
|
||||
];
|
||||
72
packages/webapp/src/constants/quickNewOptions.tsx
Normal file
72
packages/webapp/src/constants/quickNewOptions.tsx
Normal file
@@ -0,0 +1,72 @@
|
||||
// @ts-nocheck
|
||||
import intl from 'react-intl-universal';
|
||||
import {
|
||||
AbilitySubject,
|
||||
SaleInvoiceAction,
|
||||
CustomerAction,
|
||||
VendorAction,
|
||||
ManualJournalAction,
|
||||
ExpenseAction,
|
||||
} from './abilityOption';
|
||||
import { useAbilitiesFilter } from '../hooks';
|
||||
|
||||
export const getQuickNewActions = () => [
|
||||
{
|
||||
path: 'invoices/new',
|
||||
name: intl.get('sale_invoice'),
|
||||
permission: {
|
||||
subject: AbilitySubject.Invoice,
|
||||
ability: SaleInvoiceAction.Create,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'bills/new',
|
||||
name: intl.get('purchase_invoice'),
|
||||
permission: {
|
||||
subject: AbilitySubject.Invoice,
|
||||
ability: SaleInvoiceAction.Create,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'make-journal-entry',
|
||||
name: intl.get('manual_journal'),
|
||||
permission: {
|
||||
subject: AbilitySubject.ManualJournal,
|
||||
ability: ManualJournalAction.Create,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'expenses/new',
|
||||
name: intl.get('expense'),
|
||||
permission: {
|
||||
subject: AbilitySubject.Expense,
|
||||
ability: ExpenseAction.Create,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'customers/new',
|
||||
name: intl.get('customer'),
|
||||
permission: {
|
||||
subject: AbilitySubject.Customer,
|
||||
ability: CustomerAction.Create,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'vendors/new',
|
||||
name: intl.get('vendor'),
|
||||
permission: {
|
||||
subject: AbilitySubject.Vendor,
|
||||
ability: VendorAction.Vendor,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
* Retrieve the dashboard quick new menu items.
|
||||
*/
|
||||
export const useGetQuickNewMenu = () => {
|
||||
const quickNewMenu = getQuickNewActions();
|
||||
const abilitiesFilter = useAbilitiesFilter();
|
||||
|
||||
return abilitiesFilter(quickNewMenu);
|
||||
};
|
||||
17
packages/webapp/src/constants/registerWizard.tsx
Normal file
17
packages/webapp/src/constants/registerWizard.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
// @ts-nocheck
|
||||
import intl from 'react-intl-universal';
|
||||
|
||||
export const getSetupWizardSteps = () => [
|
||||
{
|
||||
label: intl.get('setup.plan.plans'),
|
||||
},
|
||||
{
|
||||
label: intl.get('setup.plan.getting_started'),
|
||||
},
|
||||
{
|
||||
label: intl.get('setup.plan.initializing'),
|
||||
},
|
||||
{
|
||||
label: intl.get('setup.plan.congrats'),
|
||||
},
|
||||
];
|
||||
17
packages/webapp/src/constants/resourcesTypes.tsx
Normal file
17
packages/webapp/src/constants/resourcesTypes.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
// @ts-nocheck
|
||||
export const RESOURCES_TYPES = {
|
||||
INVOICE: 'invoice',
|
||||
ESTIMATE: 'estimate',
|
||||
RECEIPT: 'receipt',
|
||||
PAYMENT_RECEIVE: 'payment_receive',
|
||||
PAYMENT_MADE: 'payment_made',
|
||||
CUSTOMER: 'customer',
|
||||
VENDOR: 'vendor',
|
||||
ITEM: 'item',
|
||||
BILL: 'bill',
|
||||
EXPENSE: 'expense',
|
||||
MANUAL_JOURNAL: 'manual_journal',
|
||||
ACCOUNT: 'account',
|
||||
CREDIT_NOTE: 'credit_note',
|
||||
VENDOR_CREDIT:'vendor_credit'
|
||||
};
|
||||
799
packages/webapp/src/constants/sidebarMenu.tsx
Normal file
799
packages/webapp/src/constants/sidebarMenu.tsx
Normal file
@@ -0,0 +1,799 @@
|
||||
// @ts-nocheck
|
||||
import React from 'react';
|
||||
import { FormattedMessage as T } from '@/components';
|
||||
import { Features } from '@/constants/features';
|
||||
import {
|
||||
ISidebarMenuItemType,
|
||||
ISidebarMenuOverlayIds,
|
||||
ISidebarSubscriptionAbility,
|
||||
} from '@/containers/Dashboard/Sidebar/interfaces';
|
||||
import {
|
||||
ReportsAction,
|
||||
AbilitySubject,
|
||||
ItemAction,
|
||||
InventoryAdjustmentAction,
|
||||
SaleEstimateAction,
|
||||
SaleInvoiceAction,
|
||||
SaleReceiptAction,
|
||||
PaymentReceiveAction,
|
||||
BillAction,
|
||||
PaymentMadeAction,
|
||||
CustomerAction,
|
||||
VendorAction,
|
||||
AccountAction,
|
||||
ManualJournalAction,
|
||||
ExpenseAction,
|
||||
CashflowAction,
|
||||
ProjectAction,
|
||||
PreferencesAbility,
|
||||
SubscriptionBillingAbility,
|
||||
} from '@/constants/abilityOption';
|
||||
|
||||
export const SidebarMenu = [
|
||||
// ---------------
|
||||
// # Homepage
|
||||
// ---------------
|
||||
{
|
||||
text: <T id={'homepage'} />,
|
||||
type: ISidebarMenuItemType.Link,
|
||||
disabled: false,
|
||||
href: '/',
|
||||
matchExact: true,
|
||||
},
|
||||
// ---------------
|
||||
// # Sales & Inventory
|
||||
// ---------------
|
||||
{
|
||||
text: <T id={'sales_inventory'} />,
|
||||
type: ISidebarMenuItemType.Group,
|
||||
children: [
|
||||
{
|
||||
text: <T id={'items'} />,
|
||||
type: ISidebarMenuItemType.Overlay,
|
||||
overlayId: ISidebarMenuOverlayIds.Items,
|
||||
children: [
|
||||
{
|
||||
text: <T id={'items'} />,
|
||||
type: ISidebarMenuItemType.Group,
|
||||
children: [
|
||||
{
|
||||
text: <T id={'items'} />,
|
||||
href: '/items',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Item,
|
||||
ability: ItemAction.View,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: <T id={'inventory_adjustments'} />,
|
||||
href: '/inventory-adjustments',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.InventoryAdjustment,
|
||||
ability: InventoryAdjustmentAction.View,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: <T id={'sidebar_warehouse_transfer'} />,
|
||||
href: '/warehouses-transfers',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
feature: Features.Warehouses,
|
||||
},
|
||||
{
|
||||
text: <T id={'category_list'} />,
|
||||
href: '/items/categories',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Item,
|
||||
ability: ItemAction.View,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: <T id={'New tasks'} />,
|
||||
type: ISidebarMenuItemType.Group,
|
||||
children: [
|
||||
{
|
||||
text: <T id={'New inventory item'} />,
|
||||
href: '/items/new',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Item,
|
||||
ability: ItemAction.Create,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: (
|
||||
<T id={'warehouse_transfer.label.new_warehouse_transfer'} />
|
||||
),
|
||||
href: '/warehouses-transfers/new',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
feature: Features.Warehouses,
|
||||
},
|
||||
{
|
||||
text: <T id={'New service'} />,
|
||||
href: '/items/new',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Item,
|
||||
ability: ItemAction.Create,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: <T id={'New item category'} />,
|
||||
href: '/items/categories/new',
|
||||
type: ISidebarMenuItemType.Dialog,
|
||||
dialogName: 'item-category-form',
|
||||
permission: {
|
||||
subject: AbilitySubject.Item,
|
||||
ability: ItemAction.Create,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
// ---------------
|
||||
// # Sales
|
||||
// ---------------
|
||||
{
|
||||
text: <T id={'sales'} />,
|
||||
type: ISidebarMenuItemType.Overlay,
|
||||
overlayId: ISidebarMenuOverlayIds.Sales,
|
||||
children: [
|
||||
{
|
||||
text: <T id={'sales'} />,
|
||||
type: ISidebarMenuItemType.Group,
|
||||
children: [
|
||||
{
|
||||
text: <T id={'estimates'} />,
|
||||
href: '/estimates',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Estimate,
|
||||
ability: SaleEstimateAction.View,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: <T id={'invoices'} />,
|
||||
href: '/invoices',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Invoice,
|
||||
ability: SaleInvoiceAction.View,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: <T id={'receipts'} />,
|
||||
href: '/receipts',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Receipt,
|
||||
ability: SaleReceiptAction.View,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: <T id={'sidebar_credit_note'} />,
|
||||
href: '/credit-notes',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
},
|
||||
{
|
||||
text: <T id={'payment_receives'} />,
|
||||
href: '/payment-receives',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.PaymentReceive,
|
||||
ability: PaymentReceiveAction.View,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: <T id={'New tasks'} />,
|
||||
type: ISidebarMenuItemType.Group,
|
||||
children: [
|
||||
{
|
||||
text: <T id={'new_estimate'} />,
|
||||
href: '/estimates/new',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Estimate,
|
||||
ability: SaleEstimateAction.Create,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: <T id={'new_invoice'} />,
|
||||
href: '/invoices/new',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Invoice,
|
||||
ability: SaleInvoiceAction.Create,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: <T id={'new_receipt'} />,
|
||||
href: '/receipts/new',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Receipt,
|
||||
ability: SaleReceiptAction.Create,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: <T id={'credit_note.label.new_credit_note'} />,
|
||||
href: '/credit-notes/new',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
},
|
||||
{
|
||||
text: <T id={'new_payment_receive'} />,
|
||||
href: '/payment-receives/new',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.PaymentReceive,
|
||||
ability: PaymentReceiveAction.Create,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
// ---------------
|
||||
// # Purchases
|
||||
// ---------------
|
||||
{
|
||||
text: <T id={'purchases'} />,
|
||||
type: ISidebarMenuItemType.Overlay,
|
||||
overlayId: ISidebarMenuOverlayIds.Purchases,
|
||||
children: [
|
||||
{
|
||||
text: <T id={'purchases'} />,
|
||||
type: ISidebarMenuItemType.Group,
|
||||
children: [
|
||||
{
|
||||
text: <T id={'bills'} />,
|
||||
href: '/bills',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Bill,
|
||||
ability: BillAction.View,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: <T id={'sidebar_vendor_credits'} />,
|
||||
href: '/vendor-credits',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
},
|
||||
{
|
||||
text: <T id={'payment_mades'} />,
|
||||
href: '/payment-mades',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.PaymentMade,
|
||||
ability: PaymentMadeAction.View,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: <T id={'New tasks'} />,
|
||||
type: ISidebarMenuItemType.Group,
|
||||
children: [
|
||||
{
|
||||
text: <T id={'New purchase invoice'} />,
|
||||
href: '/bills/new',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Bill,
|
||||
ability: BillAction.Create,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: <T id={'vendor_credits.label.new_vendor_credit'} />,
|
||||
href: '/vendor-credits/new',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Bill,
|
||||
ability: BillAction.Create,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: <T id={'new_payment_made'} />,
|
||||
href: '/payment-mades/new',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.PaymentMade,
|
||||
ability: PaymentMadeAction.Create,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
// ---------------
|
||||
// # Contacts
|
||||
// ---------------
|
||||
{
|
||||
text: <T id={'contacts'} />,
|
||||
type: ISidebarMenuItemType.Overlay,
|
||||
overlayId: ISidebarMenuOverlayIds.Contacts,
|
||||
children: [
|
||||
{
|
||||
text: <T id={'contacts'} />,
|
||||
type: ISidebarMenuItemType.Group,
|
||||
children: [
|
||||
{
|
||||
text: <T id={'customers'} />,
|
||||
href: '/customers',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Customer,
|
||||
ability: CustomerAction.View,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: <T id={'vendors'} />,
|
||||
href: '/vendors',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Vendor,
|
||||
ability: VendorAction.Create,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: <T id={'New tasks'} />,
|
||||
type: ISidebarMenuItemType.Group,
|
||||
children: [
|
||||
{
|
||||
text: <T id={'new_customer'} />,
|
||||
href: '/customers/new',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Customer,
|
||||
ability: CustomerAction.View,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: <T id={'new_vendor'} />,
|
||||
href: '/vendors/new',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Vendor,
|
||||
ability: VendorAction.View,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
// ---------------
|
||||
// # Accounting
|
||||
// ---------------
|
||||
{
|
||||
text: <T id={'accounting'} />,
|
||||
type: ISidebarMenuItemType.Group,
|
||||
children: [
|
||||
{
|
||||
text: <T id={'financial'} />,
|
||||
type: ISidebarMenuItemType.Overlay,
|
||||
overlayId: ISidebarMenuOverlayIds.Financial,
|
||||
children: [
|
||||
{
|
||||
text: <T id={'financial'} />,
|
||||
type: ISidebarMenuItemType.Group,
|
||||
children: [
|
||||
{
|
||||
text: <T id={'accounts_chart'} />,
|
||||
href: '/accounts',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Account,
|
||||
ability: AccountAction.View,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: <T id={'manual_journals'} />,
|
||||
href: '/manual-journals',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.ManualJournal,
|
||||
ability: ManualJournalAction.View,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: <T id={'sidebar.transactions_locaking'} />,
|
||||
href: '/transactions-locking',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: <T id={'New tasks'} />,
|
||||
type: ISidebarMenuItemType.Group,
|
||||
children: [
|
||||
{
|
||||
text: <T id={'make_journal_entry'} />,
|
||||
href: '/make-journal-entry',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.ManualJournal,
|
||||
ability: ManualJournalAction.Create,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
// ---------------
|
||||
// # Cashflow
|
||||
// ---------------
|
||||
{
|
||||
text: <T id={'siebar.cashflow'} />,
|
||||
type: ISidebarMenuItemType.Overlay,
|
||||
overlayId: ISidebarMenuOverlayIds.Cashflow,
|
||||
children: [
|
||||
{
|
||||
text: <T id={'siebar.cashflow'} />,
|
||||
type: ISidebarMenuItemType.Group,
|
||||
children: [
|
||||
{
|
||||
text: <T id={'siebar.cashflow.label_cash_and_bank_accounts'} />,
|
||||
href: '/cashflow-accounts',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Cashflow,
|
||||
ability: CashflowAction.View,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: <T id={'New tasks'} />,
|
||||
type: ISidebarMenuItemType.Group,
|
||||
divider: true,
|
||||
children: [
|
||||
{
|
||||
text: <T id={'cash_flow.label.add_money_in'} />,
|
||||
href: '/cashflow-accounts',
|
||||
type: ISidebarMenuItemType.Dialog,
|
||||
dialogName: 'money-in',
|
||||
permission: {
|
||||
subject: AbilitySubject.Cashflow,
|
||||
ability: CashflowAction.Create,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: <T id={'cash_flow.label.add_money_out'} />,
|
||||
href: '/cashflow-accounts',
|
||||
type: ISidebarMenuItemType.Dialog,
|
||||
permission: {
|
||||
subject: AbilitySubject.Cashflow,
|
||||
ability: CashflowAction.Create,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: <T id={'cash_flow.label.add_cash_account'} />,
|
||||
href: '/cashflow-accounts',
|
||||
type: ISidebarMenuItemType.Dialog,
|
||||
permission: {
|
||||
subject: AbilitySubject.Cashflow,
|
||||
ability: CashflowAction.Create,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: <T id={'cash_flow.label.add_bank_account'} />,
|
||||
href: '/cashflow-accounts',
|
||||
type: ISidebarMenuItemType.Dialog,
|
||||
permission: {
|
||||
subject: AbilitySubject.Cashflow,
|
||||
ability: CashflowAction.Create,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
// ---------------
|
||||
// # Expenses
|
||||
// ---------------
|
||||
{
|
||||
text: <T id={'expenses'} />,
|
||||
type: ISidebarMenuItemType.Overlay,
|
||||
overlayId: ISidebarMenuOverlayIds.Expenses,
|
||||
children: [
|
||||
{
|
||||
text: <T id={'expenses'} />,
|
||||
type: ISidebarMenuItemType.Group,
|
||||
children: [
|
||||
{
|
||||
text: <T id={'expenses'} />,
|
||||
href: '/expenses',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Expense,
|
||||
ability: ExpenseAction.View,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: <T id={'New tasks'} />,
|
||||
type: ISidebarMenuItemType.Group,
|
||||
children: [
|
||||
{
|
||||
text: <T id={'new_expense'} />,
|
||||
href: '/expenses/new',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Expense,
|
||||
ability: ExpenseAction.Create,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
// ---------------------
|
||||
// # Projects Management
|
||||
// ---------------------
|
||||
// {
|
||||
// text: 'Projects',
|
||||
// type: ISidebarMenuItemType.Overlay,
|
||||
// overlayId: ISidebarMenuOverlayIds.Projects,
|
||||
// children: [
|
||||
// {
|
||||
// text: 'Projects',
|
||||
// type: ISidebarMenuItemType.Group,
|
||||
// children: [
|
||||
// {
|
||||
// text: 'Projects',
|
||||
// href: '/projects',
|
||||
// type: ISidebarMenuItemType.Link,
|
||||
// permission: {
|
||||
// subject: AbilitySubject.Project,
|
||||
// ability: ProjectAction.View,
|
||||
// },
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// text: <T id={'New tasks'} />,
|
||||
// type: ISidebarMenuItemType.Group,
|
||||
// children: [
|
||||
// {
|
||||
// text: <T id={'projects.label.new_project'} />,
|
||||
// type: ISidebarMenuItemType.Dialog,
|
||||
// dialogName: 'project-form',
|
||||
// permission: {
|
||||
// subject: AbilitySubject.Project,
|
||||
// ability: ProjectAction.Create,
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// text: <T id={'projects.label.new_time_entry'} />,
|
||||
// type: ISidebarMenuItemType.Dialog,
|
||||
// dialogName: 'project-time-entry-form',
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// text: <T id={'Reports'} />,
|
||||
// type: ISidebarMenuItemType.Group,
|
||||
// children: [
|
||||
// {
|
||||
// text: <T id={'project_profitability_summary'} />,
|
||||
// href: '/financial-reports/project-profitability-summary',
|
||||
// type: ISidebarMenuItemType.Link,
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// ---------------
|
||||
// # Reports
|
||||
// ---------------
|
||||
{
|
||||
text: <T id={'Reports'} />,
|
||||
type: ISidebarMenuItemType.Overlay,
|
||||
overlayId: ISidebarMenuOverlayIds.Reports,
|
||||
children: [
|
||||
{
|
||||
text: <T id={'Reports'} />,
|
||||
type: ISidebarMenuItemType.Group,
|
||||
children: [
|
||||
{
|
||||
text: <T id={'balance_sheet'} />,
|
||||
href: '/financial-reports/balance-sheet',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.READ_BALANCE_SHEET,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: <T id={'trial_balance_sheet'} />,
|
||||
href: '/financial-reports/trial-balance-sheet',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.READ_TRIAL_BALANCE_SHEET,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: <T id={'journal'} />,
|
||||
href: '/financial-reports/journal-sheet',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.READ_JOURNAL,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: <T id={'general_ledger'} />,
|
||||
href: '/financial-reports/general-ledger',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.READ_GENERAL_LEDGET,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: <T id={'profit_loss_sheet'} />,
|
||||
href: '/financial-reports/profit-loss-sheet',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.READ_PROFIT_LOSS,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: <T id={'cash_flow_statement'} />,
|
||||
href: '/financial-reports/cash-flow',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.READ_CASHFLOW_ACCOUNT_TRANSACTION,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: <T id={'AR_Aging_Summary'} />,
|
||||
href: '/financial-reports/receivable-aging-summary',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.READ_AR_AGING_SUMMARY,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: <T id={'AP_Aging_Summary'} />,
|
||||
href: '/financial-reports/payable-aging-summary',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.READ_AP_AGING_SUMMARY,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: <T id={'Sales/Purchases'} />,
|
||||
type: ISidebarMenuItemType.Group,
|
||||
children: [
|
||||
{
|
||||
text: <T id={'purchases_by_items'} />,
|
||||
type: ISidebarMenuItemType.Link,
|
||||
href: '/financial-reports/purchases-by-items',
|
||||
permission: {
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.READ_PURCHASES_BY_ITEMS,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: <T id={'sales_by_items'} />,
|
||||
href: '/financial-reports/sales-by-items',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.READ_SALES_BY_ITEMS,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: <T id={'customers_transactions'} />,
|
||||
href: '/financial-reports/transactions-by-customers',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.READ_CUSTOMERS_TRANSACTIONS,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: <T id={'vendors_transactions'} />,
|
||||
href: '/financial-reports/transactions-by-vendors',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.READ_VENDORS_TRANSACTIONS,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: <T id={'customers_balance_summary'} />,
|
||||
href: '/financial-reports/customers-balance-summary',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.READ_CUSTOMERS_SUMMARY_BALANCE,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: <T id={'vendors_balance_summary'} />,
|
||||
href: '/financial-reports/vendors-balance-summary',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.READ_VENDORS_SUMMARY_BALANCE,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: <T id={'inventory'} />,
|
||||
type: ISidebarMenuItemType.Group,
|
||||
children: [
|
||||
{
|
||||
text: <T id={'inventory_item_details'} />,
|
||||
href: '/financial-reports/inventory-item-details',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.READ_INVENTORY_ITEM_DETAILS,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: <T id={'inventory_valuation'} />,
|
||||
href: '/financial-reports/inventory-valuation',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Report,
|
||||
ability: ReportsAction.READ_INVENTORY_VALUATION_SUMMARY,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: <T id={'system'} />,
|
||||
type: ISidebarMenuItemType.Group,
|
||||
children: [
|
||||
{
|
||||
text: <T id={'preferences'} />,
|
||||
href: '/preferences',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
permission: {
|
||||
subject: AbilitySubject.Preferences,
|
||||
ability: PreferencesAbility.Mutate,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: <T id={'billing'} />,
|
||||
href: '/billing',
|
||||
type: ISidebarMenuItemType.Link,
|
||||
subscription: [
|
||||
ISidebarSubscriptionAbility.Expired,
|
||||
ISidebarSubscriptionAbility.Active,
|
||||
],
|
||||
permission: {
|
||||
subject: AbilitySubject.SubscriptionBilling,
|
||||
ability: SubscriptionBillingAbility.View,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
10
packages/webapp/src/constants/subscriptionModels.tsx
Normal file
10
packages/webapp/src/constants/subscriptionModels.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
// @ts-nocheck
|
||||
// Subscription plans.
|
||||
export const plans = [
|
||||
|
||||
];
|
||||
|
||||
// Payment methods.
|
||||
export const paymentMethods = [
|
||||
|
||||
];
|
||||
7
packages/webapp/src/constants/tableStyle.tsx
Normal file
7
packages/webapp/src/constants/tableStyle.tsx
Normal file
@@ -0,0 +1,7 @@
|
||||
// @ts-nocheck
|
||||
|
||||
|
||||
export const TableStyle = {
|
||||
Constrant: 'constrant',
|
||||
Regular: 'regular'
|
||||
}
|
||||
30
packages/webapp/src/constants/tables.tsx
Normal file
30
packages/webapp/src/constants/tables.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
// @ts-nocheck
|
||||
export const TABLES = {
|
||||
ITEMS: 'items',
|
||||
INVENTORY_ADJUSTMENTS: 'inventory_adjustment',
|
||||
ESTIMATES: 'estimates',
|
||||
INVOICES: 'invoices',
|
||||
RECEIPTS: 'receipts',
|
||||
PAYMENT_RECEIVES: 'payment_receives',
|
||||
BILLS: 'bills',
|
||||
PAYMENT_MADES: 'payment_mades',
|
||||
CUSTOMER: 'customers',
|
||||
VENDORS: 'vendors',
|
||||
ACCOUNTS: 'accounts',
|
||||
MANUAL_JOURNALS: 'manual_journal',
|
||||
EXPENSES: 'expenses',
|
||||
CASHFLOW_ACCOUNTS: 'cashflow_accounts',
|
||||
CASHFLOW_Transactions: 'cashflow_transactions',
|
||||
CREDIT_NOTES: 'credit_notes',
|
||||
VENDOR_CREDITS: 'vendor_credits',
|
||||
WAREHOUSE_TRANSFERS: 'warehouse_transfers',
|
||||
PROJECTS: 'projects',
|
||||
TIMESHEETS: 'timesheets',
|
||||
PROJECT_TASKS: 'project_tasks',
|
||||
};
|
||||
|
||||
export const TABLE_SIZE = {
|
||||
COMPACT: 'compact',
|
||||
SMALL: 'small',
|
||||
MEDIUM: 'medium',
|
||||
};
|
||||
Reference in New Issue
Block a user