mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 06:40:31 +00:00
fix(server): 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 {
|
export default class SeedAccounts extends TenantSeeder {
|
||||||
/**
|
/**
|
||||||
* Seeds initial accounts to the organization.
|
* Seeds initial accounts to the organization.
|
||||||
*/
|
*/
|
||||||
up(knex) {
|
up(knex) {
|
||||||
const data = AccountsData.map((account) => {
|
const data = AccountsData.map((account) => ({
|
||||||
return {
|
...account,
|
||||||
...account,
|
name: this.i18n.__(account.name),
|
||||||
name: this.i18n.__(account.name),
|
description: this.i18n.__(account.description),
|
||||||
description: this.i18n.__(account.description),
|
currencyCode: this.tenant.metadata.baseCurrency,
|
||||||
currencyCode: this.tenant.metadata.baseCurrency,
|
seededAt: new Date(),
|
||||||
};
|
})
|
||||||
});
|
);
|
||||||
return knex('accounts').then(async () => {
|
return knex('accounts').then(async () => {
|
||||||
// Inserts seed entries.
|
// Inserts seed entries.
|
||||||
return knex('accounts').insert(data);
|
return knex('accounts').insert(data);
|
||||||
|
|||||||
@@ -37,6 +37,9 @@ const commonInvalidateQueries = (queryClient) => {
|
|||||||
|
|
||||||
// Invalidate item warehouses.
|
// Invalidate item warehouses.
|
||||||
queryClient.invalidateQueries(t.ITEM_WAREHOUSES_LOCATION);
|
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.
|
// Invalidate financial reports.
|
||||||
queryClient.invalidateQueries(t.FINANCIAL_REPORT);
|
queryClient.invalidateQueries(t.FINANCIAL_REPORT);
|
||||||
queryClient.invalidateQueries(t.CASH_FLOW_TRANSACTION);
|
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.
|
// Invalidate financial reports.
|
||||||
queryClient.invalidateQueries(t.FINANCIAL_REPORT);
|
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_INVOICE_SMS_DETAIL);
|
||||||
queryClient.invalidateQueries(t.SALE_RECEIPT_SMS_DETAIL);
|
queryClient.invalidateQueries(t.SALE_RECEIPT_SMS_DETAIL);
|
||||||
queryClient.invalidateQueries(t.PAYMENT_RECEIVE_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.
|
// Customers response selector.
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ const commonInvalidateQueries = (queryClient) => {
|
|||||||
// Invalidate landed cost.
|
// Invalidate landed cost.
|
||||||
queryClient.invalidateQueries(t.LANDED_COST);
|
queryClient.invalidateQueries(t.LANDED_COST);
|
||||||
queryClient.invalidateQueries(t.LANDED_COST_TRANSACTION);
|
queryClient.invalidateQueries(t.LANDED_COST_TRANSACTION);
|
||||||
|
|
||||||
|
// Invalidate mutate base currency abilities.
|
||||||
|
queryClient.invalidateQueries(t.ORGANIZATION_MUTATE_BASE_CURRENCY_ABILITIES);
|
||||||
};
|
};
|
||||||
|
|
||||||
const transformExpenses = (response) => ({
|
const transformExpenses = (response) => ({
|
||||||
|
|||||||
@@ -20,6 +20,9 @@ const commonInvalidateQueries = (queryClient) => {
|
|||||||
|
|
||||||
// Invalidate financial reports.
|
// Invalidate financial reports.
|
||||||
queryClient.invalidateQueries(t.FINANCIAL_REPORT);
|
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.
|
// Invalidate item warehouses.
|
||||||
queryClient.invalidateQueries(t.ITEM_WAREHOUSES_LOCATION);
|
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.
|
// Invalidate the settings.
|
||||||
queryClient.invalidateQueries([t.SETTING, t.SETTING_RECEIPTS]);
|
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
|
// @ts-nocheck
|
||||||
const Authentication = {
|
const Authentication = {
|
||||||
AUTH_METADATA_PAGE: 'AUTH_META_PAGE'
|
AUTH_METADATA_PAGE: 'AUTH_META_PAGE',
|
||||||
}
|
};
|
||||||
|
|
||||||
const ACCOUNTS = {
|
const ACCOUNTS = {
|
||||||
ACCOUNT: 'ACCOUNT',
|
ACCOUNT: 'ACCOUNT',
|
||||||
@@ -220,6 +220,10 @@ const DASHBOARD = {
|
|||||||
DASHBOARD_META: 'DASHBOARD_META',
|
DASHBOARD_META: 'DASHBOARD_META',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const ORGANIZATION = {
|
||||||
|
ORGANIZATION_MUTATE_BASE_CURRENCY_ABILITIES: 'ORGANIZATION_MUTATE_BASE_CURRENCY_ABILITIES',
|
||||||
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
...Authentication,
|
...Authentication,
|
||||||
...ACCOUNTS,
|
...ACCOUNTS,
|
||||||
@@ -252,4 +256,5 @@ export default {
|
|||||||
...WAREHOUSE_TRANSFERS,
|
...WAREHOUSE_TRANSFERS,
|
||||||
...BRANCHES,
|
...BRANCHES,
|
||||||
...DASHBOARD,
|
...DASHBOARD,
|
||||||
|
...ORGANIZATION,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -42,6 +42,9 @@ const commonInvalidateQueries = (queryClient) => {
|
|||||||
|
|
||||||
// Invalidate financial reports.
|
// Invalidate financial reports.
|
||||||
queryClient.invalidateQueries(t.FINANCIAL_REPORT);
|
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.
|
// Invalidate financial reports.
|
||||||
queryClient.invalidateQueries(t.FINANCIAL_REPORT);
|
queryClient.invalidateQueries(t.FINANCIAL_REPORT);
|
||||||
|
|
||||||
|
// Invalidate mutate base currency abilities.
|
||||||
|
queryClient.invalidateQueries(t.ORGANIZATION_MUTATE_BASE_CURRENCY_ABILITIES);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Transformes vendors response.
|
// Transformes vendors response.
|
||||||
|
|||||||
Reference in New Issue
Block a user