diff --git a/packages/server/src/constants/accounts.ts b/packages/server/src/constants/accounts.ts index b6055e852..43cd994e5 100644 --- a/packages/server/src/constants/accounts.ts +++ b/packages/server/src/constants/accounts.ts @@ -5,7 +5,7 @@ export const ACCOUNT_TYPE = { INVENTORY: 'inventory', OTHER_CURRENT_ASSET: 'other-current-asset', FIXED_ASSET: 'fixed-asset', - NON_CURRENT_ASSET: 'none-current-asset', + NON_CURRENT_ASSET: 'non-current-asset', ACCOUNTS_PAYABLE: 'accounts-payable', CREDIT_CARD: 'credit-card', diff --git a/packages/server/src/database/tenant/migrations/20260316000000_fix_account_type_typos.ts b/packages/server/src/database/tenant/migrations/20260316000000_fix_account_type_typos.ts new file mode 100644 index 000000000..81d8b345c --- /dev/null +++ b/packages/server/src/database/tenant/migrations/20260316000000_fix_account_type_typos.ts @@ -0,0 +1,19 @@ +/** + * Fix account type typos in the database. + * + * This migration corrects the following typos: + * - 'none-current-asset' -> 'non-current-asset' + * + * Related GitHub issue: #1041 + */ +exports.up = function (knex) { + return knex('accounts') + .where('account_type', 'none-current-asset') + .update({ account_type: 'non-current-asset' }); +}; + +exports.down = function (knex) { + return knex('accounts') + .where('account_type', 'non-current-asset') + .update({ account_type: 'none-current-asset' }); +}; diff --git a/packages/server/src/modules/Accounts/Accounts.constants.ts b/packages/server/src/modules/Accounts/Accounts.constants.ts index f35aecef0..f116353de 100644 --- a/packages/server/src/modules/Accounts/Accounts.constants.ts +++ b/packages/server/src/modules/Accounts/Accounts.constants.ts @@ -412,7 +412,7 @@ export const ACCOUNT_TYPE = { INVENTORY: 'inventory', OTHER_CURRENT_ASSET: 'other-current-asset', FIXED_ASSET: 'fixed-asset', - NON_CURRENT_ASSET: 'none-current-asset', + NON_CURRENT_ASSET: 'non-current-asset', ACCOUNTS_PAYABLE: 'accounts-payable', CREDIT_CARD: 'credit-card', diff --git a/packages/webapp/src/constants/accountTypes.tsx b/packages/webapp/src/constants/accountTypes.tsx index 5cb08e13f..4ff41984d 100644 --- a/packages/webapp/src/constants/accountTypes.tsx +++ b/packages/webapp/src/constants/accountTypes.tsx @@ -26,7 +26,7 @@ export const ACCOUNT_TYPE = { export const ACCOUNT_PARENT_TYPE = { CURRENT_ASSET: 'current-asset', FIXED_ASSET: 'fixed-asset', - NON_CURRENT_ASSET: 'non-ACCOUNT_PARENT_TYPE.CURRENT_ASSET', + NON_CURRENT_ASSET: 'non-current-asset', CURRENT_LIABILITY: 'current-liability', LOGN_TERM_LIABILITY: 'long-term-liability', @@ -41,7 +41,7 @@ export const ACCOUNT_ROOT_TYPE = { ASSET: 'asset', LIABILITY: 'liability', EQUITY: 'equity', - EXPENSE: 'expene', + EXPENSE: 'expense', INCOME: 'income', };