mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
Merge pull request #120 from bigcapitalhq/BIG-433-fix-base-currency-should-be-enabled-with-account-model
BIG-433-fix-base-currency-should-be-enabled-with-account-model
This commit is contained in:
@@ -3,17 +3,17 @@ import AccountsData from '../data/accounts';
|
||||
|
||||
export default class SeedAccounts extends TenantSeeder {
|
||||
/**
|
||||
* Seeds initial accounts to the organization.
|
||||
* Seeds initial accounts to the organization.
|
||||
*/
|
||||
up(knex) {
|
||||
const data = AccountsData.map((account) => {
|
||||
return {
|
||||
...account,
|
||||
name: this.i18n.__(account.name),
|
||||
description: this.i18n.__(account.description),
|
||||
currencyCode: this.tenant.metadata.baseCurrency,
|
||||
};
|
||||
});
|
||||
const data = AccountsData.map((account) => ({
|
||||
...account,
|
||||
name: this.i18n.__(account.name),
|
||||
description: this.i18n.__(account.description),
|
||||
currencyCode: this.tenant.metadata.baseCurrency,
|
||||
seededAt: new Date(),
|
||||
})
|
||||
);
|
||||
return knex('accounts').then(async () => {
|
||||
// Inserts seed entries.
|
||||
return knex('accounts').insert(data);
|
||||
|
||||
@@ -37,6 +37,9 @@ const commonInvalidateQueries = (queryClient) => {
|
||||
|
||||
// Invalidate item warehouses.
|
||||
queryClient.invalidateQueries(t.ITEM_WAREHOUSES_LOCATION);
|
||||
|
||||
// Invalidate mutate base currency abilities.
|
||||
queryClient.invalidateQueries(t.ORGANIZATION_MUTATE_BASE_CURRENCY_ABILITIES);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,6 +22,9 @@ const commonInvalidateQueries = (queryClient) => {
|
||||
// Invalidate financial reports.
|
||||
queryClient.invalidateQueries(t.FINANCIAL_REPORT);
|
||||
queryClient.invalidateQueries(t.CASH_FLOW_TRANSACTION);
|
||||
|
||||
// Invalidate mutate base currency abilities.
|
||||
queryClient.invalidateQueries(t.ORGANIZATION_MUTATE_BASE_CURRENCY_ABILITIES);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -43,6 +43,9 @@ const commonInvalidateQueries = (queryClient) => {
|
||||
|
||||
// Invalidate financial reports.
|
||||
queryClient.invalidateQueries(t.FINANCIAL_REPORT);
|
||||
|
||||
// Invalidate mutate base currency abilities.
|
||||
queryClient.invalidateQueries(t.ORGANIZATION_MUTATE_BASE_CURRENCY_ABILITIES);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,6 +27,9 @@ const commonInvalidateQueries = (queryClient) => {
|
||||
queryClient.invalidateQueries(t.SALE_INVOICE_SMS_DETAIL);
|
||||
queryClient.invalidateQueries(t.SALE_RECEIPT_SMS_DETAIL);
|
||||
queryClient.invalidateQueries(t.PAYMENT_RECEIVE_SMS_DETAIL);
|
||||
|
||||
// Invalidate mutate base currency abilities.
|
||||
queryClient.invalidateQueries(t.ORGANIZATION_MUTATE_BASE_CURRENCY_ABILITIES);
|
||||
};
|
||||
|
||||
// Customers response selector.
|
||||
|
||||
@@ -30,6 +30,9 @@ const commonInvalidateQueries = (queryClient) => {
|
||||
// Invalidate landed cost.
|
||||
queryClient.invalidateQueries(t.LANDED_COST);
|
||||
queryClient.invalidateQueries(t.LANDED_COST_TRANSACTION);
|
||||
|
||||
// Invalidate mutate base currency abilities.
|
||||
queryClient.invalidateQueries(t.ORGANIZATION_MUTATE_BASE_CURRENCY_ABILITIES);
|
||||
};
|
||||
|
||||
const transformExpenses = (response) => ({
|
||||
|
||||
@@ -20,6 +20,9 @@ const commonInvalidateQueries = (queryClient) => {
|
||||
|
||||
// Invalidate financial reports.
|
||||
queryClient.invalidateQueries(t.FINANCIAL_REPORT);
|
||||
|
||||
// Invalidate mutate base currency abilities.
|
||||
queryClient.invalidateQueries(t.ORGANIZATION_MUTATE_BASE_CURRENCY_ABILITIES);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -38,6 +38,9 @@ const commonInvalidateQueries = (queryClient) => {
|
||||
|
||||
// Invalidate item warehouses.
|
||||
queryClient.invalidateQueries(t.ITEM_WAREHOUSES_LOCATION);
|
||||
|
||||
// Invalidate mutate base currency abilities.
|
||||
queryClient.invalidateQueries(t.ORGANIZATION_MUTATE_BASE_CURRENCY_ABILITIES);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -33,6 +33,9 @@ const commonInvalidateQueries = (queryClient) => {
|
||||
|
||||
// Invalidate the settings.
|
||||
queryClient.invalidateQueries([t.SETTING, t.SETTING_RECEIPTS]);
|
||||
|
||||
// Invalidate mutate base currency abilities.
|
||||
queryClient.invalidateQueries(t.ORGANIZATION_MUTATE_BASE_CURRENCY_ABILITIES);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// @ts-nocheck
|
||||
const Authentication = {
|
||||
AUTH_METADATA_PAGE: 'AUTH_META_PAGE'
|
||||
}
|
||||
AUTH_METADATA_PAGE: 'AUTH_META_PAGE',
|
||||
};
|
||||
|
||||
const ACCOUNTS = {
|
||||
ACCOUNT: 'ACCOUNT',
|
||||
@@ -220,6 +220,10 @@ const DASHBOARD = {
|
||||
DASHBOARD_META: 'DASHBOARD_META',
|
||||
};
|
||||
|
||||
const ORGANIZATION = {
|
||||
ORGANIZATION_MUTATE_BASE_CURRENCY_ABILITIES: 'ORGANIZATION_MUTATE_BASE_CURRENCY_ABILITIES',
|
||||
};
|
||||
|
||||
export default {
|
||||
...Authentication,
|
||||
...ACCOUNTS,
|
||||
@@ -252,4 +256,5 @@ export default {
|
||||
...WAREHOUSE_TRANSFERS,
|
||||
...BRANCHES,
|
||||
...DASHBOARD,
|
||||
...ORGANIZATION,
|
||||
};
|
||||
|
||||
@@ -42,6 +42,9 @@ const commonInvalidateQueries = (queryClient) => {
|
||||
|
||||
// Invalidate financial reports.
|
||||
queryClient.invalidateQueries(t.FINANCIAL_REPORT);
|
||||
|
||||
// Invalidate mutate base currency abilities.
|
||||
queryClient.invalidateQueries(t.ORGANIZATION_MUTATE_BASE_CURRENCY_ABILITIES);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,6 +16,9 @@ const commonInvalidateQueries = (queryClient) => {
|
||||
|
||||
// Invalidate financial reports.
|
||||
queryClient.invalidateQueries(t.FINANCIAL_REPORT);
|
||||
|
||||
// Invalidate mutate base currency abilities.
|
||||
queryClient.invalidateQueries(t.ORGANIZATION_MUTATE_BASE_CURRENCY_ABILITIES);
|
||||
};
|
||||
|
||||
// Transformes vendors response.
|
||||
|
||||
@@ -292,12 +292,12 @@
|
||||
"once_delete_this_exchange_rate_you_will_able_to_restore_it": "Once you delete this exchange rate, you won't be able to restore it later. Are you sure you want to delete this exchange rate?",
|
||||
"once_delete_these_exchange_rates_you_will_not_able_restore_them": "Once you delete these exchange rates, you won't be able to retrieve them later. Are you sure you want to delete them?",
|
||||
"once_delete_this_item_category_you_will_able_to_restore_it": "Once you delete this category, you won't be able to restore it later. Are you sure you want to delete this item?",
|
||||
"select_business_location": "Select Business Location",
|
||||
"select_base_currency": "Select base currency",
|
||||
"select_fiscal_year": "Select fiscal year",
|
||||
"select_language": "Select Language",
|
||||
"select_business_location": "Select Business Location...",
|
||||
"select_base_currency": "Select Base Currency...",
|
||||
"select_fiscal_year": "Select Fiscal Year...",
|
||||
"select_language": "Select Language...",
|
||||
"select_date_format": "Select Date Format",
|
||||
"select_time_zone": "Select Time Zone",
|
||||
"select_time_zone": "Select Time Zone...",
|
||||
"select_currency": "Select Currency",
|
||||
"once_delete_this_currency_you_will_able_to_restore_it": "Once you delete this currency, you won't be able to restore it later. Are you sure you want to delete this item?",
|
||||
"select_parent_category": "Select Parent Category",
|
||||
|
||||
Reference in New Issue
Block a user