@jjlmoya/utils-finance 1.42.0 → 1.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/package.json +1 -1
  2. package/src/category/index.ts +2 -1
  3. package/src/entries.ts +4 -1
  4. package/src/index.ts +1 -0
  5. package/src/tests/locale_completeness.test.ts +2 -2
  6. package/src/tests/tool_validation.test.ts +2 -2
  7. package/src/tool/capitalGainsTaxScenarioCalculator/bibliography.astro +11 -0
  8. package/src/tool/capitalGainsTaxScenarioCalculator/bibliography.ts +12 -0
  9. package/src/tool/capitalGainsTaxScenarioCalculator/capital-gains-tax-scenario-calculator.css +469 -0
  10. package/src/tool/capitalGainsTaxScenarioCalculator/component.astro +328 -0
  11. package/src/tool/capitalGainsTaxScenarioCalculator/entry.ts +26 -0
  12. package/src/tool/capitalGainsTaxScenarioCalculator/i18n/de.ts +3 -0
  13. package/src/tool/capitalGainsTaxScenarioCalculator/i18n/en.ts +181 -0
  14. package/src/tool/capitalGainsTaxScenarioCalculator/i18n/es.ts +3 -0
  15. package/src/tool/capitalGainsTaxScenarioCalculator/i18n/fr.ts +3 -0
  16. package/src/tool/capitalGainsTaxScenarioCalculator/i18n/id.ts +3 -0
  17. package/src/tool/capitalGainsTaxScenarioCalculator/i18n/it.ts +3 -0
  18. package/src/tool/capitalGainsTaxScenarioCalculator/i18n/ja.ts +3 -0
  19. package/src/tool/capitalGainsTaxScenarioCalculator/i18n/ko.ts +3 -0
  20. package/src/tool/capitalGainsTaxScenarioCalculator/i18n/nl.ts +3 -0
  21. package/src/tool/capitalGainsTaxScenarioCalculator/i18n/pl.ts +3 -0
  22. package/src/tool/capitalGainsTaxScenarioCalculator/i18n/pt.ts +3 -0
  23. package/src/tool/capitalGainsTaxScenarioCalculator/i18n/ru.ts +3 -0
  24. package/src/tool/capitalGainsTaxScenarioCalculator/i18n/shared.ts +153 -0
  25. package/src/tool/capitalGainsTaxScenarioCalculator/i18n/sv.ts +3 -0
  26. package/src/tool/capitalGainsTaxScenarioCalculator/i18n/tr.ts +3 -0
  27. package/src/tool/capitalGainsTaxScenarioCalculator/i18n/zh.ts +3 -0
  28. package/src/tool/capitalGainsTaxScenarioCalculator/index.ts +11 -0
  29. package/src/tool/capitalGainsTaxScenarioCalculator/logic.test.ts +71 -0
  30. package/src/tool/capitalGainsTaxScenarioCalculator/logic.ts +137 -0
  31. package/src/tool/capitalGainsTaxScenarioCalculator/seo.astro +11 -0
  32. package/src/tool/capitalGainsTaxScenarioCalculator/ui.ts +40 -0
  33. package/src/tool/capitalGainsTaxScenarioCalculator/validation.ts +34 -0
  34. package/src/tools.ts +2 -1
@@ -0,0 +1,11 @@
1
+ ---
2
+ import { SEORenderer } from '@jjlmoya/utils-shared';
3
+ import { capitalGainsTaxScenarioCalculator } from './entry';
4
+ import type { KnownLocale } from '../../types';
5
+
6
+ interface Props { locale?: KnownLocale; }
7
+ const { locale = 'en' } = Astro.props;
8
+ const content = await capitalGainsTaxScenarioCalculator.i18n[locale]?.() ?? await capitalGainsTaxScenarioCalculator.i18n.en?.();
9
+ ---
10
+
11
+ {content?.seo && <SEORenderer content={{ locale, sections: content.seo }} />}
@@ -0,0 +1,40 @@
1
+ export interface CapitalGainsTaxScenarioCalculatorUI extends Record<string, string> {
2
+ labelPurchasePrice: string;
3
+ labelAcquisitionCosts: string;
4
+ labelImprovements: string;
5
+ labelSalePrice: string;
6
+ labelSellingCosts: string;
7
+ labelTaxRate: string;
8
+ labelAlternativeSalePrice: string;
9
+ labelAlternativeSellingCosts: string;
10
+ labelCurrency: string;
11
+ labelCurrentScenario: string;
12
+ labelAlternativeScenario: string;
13
+ labelAcquisitionBasis: string;
14
+ labelNetSaleValue: string;
15
+ labelGainOrLoss: string;
16
+ labelEstimatedTax: string;
17
+ labelNetGainAfterTax: string;
18
+ labelNetProceeds: string;
19
+ labelBetterScenario: string;
20
+ labelCurrentIsBetter: string;
21
+ labelAlternativeIsBetter: string;
22
+ labelSameOutcome: string;
23
+ labelGainStatus: string;
24
+ labelLossStatus: string;
25
+ labelBreakEvenStatus: string;
26
+ labelTaxableGainNote: string;
27
+ labelLossNote: string;
28
+ labelVisual: string;
29
+ labelComparison: string;
30
+ labelDifference: string;
31
+ labelCopy: string;
32
+ labelCopied: string;
33
+ labelReset: string;
34
+ labelInvalidInput: string;
35
+ labelMethodTitle: string;
36
+ labelMethodText: string;
37
+ labelPrivacyNote: string;
38
+ labelAmountPlaceholder: string;
39
+ labelPercentPlaceholder: string;
40
+ }
@@ -0,0 +1,34 @@
1
+ export const validationEvidence = {
2
+ reviewedAt: '2026-09-06',
3
+ methodology:
4
+ 'The tool estimates a user-defined scenario as net sale value minus an entered acquisition basis, then applies the entered percentage only to a positive gain. It is a planning model, not a tax return or a jurisdiction-specific assessment.',
5
+ sources: [
6
+ {
7
+ title: 'Agencia Tributaria: Reglas generales de cálculo',
8
+ url: 'https://sede.agenciatributaria.gob.es/Sede/ayuda/manuales-videos-folletos/manuales-practicos/irpf-2025/c11-ganancias-perdidas-patrimoniales/determinacion-importe-ganancias-perdidas-patrimon-generales/derivadas-transmisiones-onerosas-lucrativas/reglas-generales-calculo.html',
9
+ role: 'Primary Spanish reference for acquisition and transmission value components.',
10
+ },
11
+ {
12
+ title: 'IRS Publication 551: Basis of Assets',
13
+ url: 'https://www.irs.gov/publications/p551',
14
+ role: 'Primary reference for basis and sale gain/loss concepts.',
15
+ },
16
+ ],
17
+ referenceCases: [
18
+ {
19
+ name: 'Gain scenario',
20
+ input: { purchasePrice: 100000, acquisitionCosts: 5000, improvements: 10000, salePrice: 180000, sellingCosts: 6000, taxRate: 20 },
21
+ expected: { acquisitionBasis: 115000, gainOrLoss: 59000, estimatedTax: 11800, netGainAfterTax: 47200 },
22
+ },
23
+ {
24
+ name: 'Loss scenario',
25
+ input: { purchasePrice: 100000, acquisitionCosts: 5000, improvements: 10000, salePrice: 90000, sellingCosts: 6000, taxRate: 20 },
26
+ expected: { taxableGain: 0, estimatedTax: 0 },
27
+ },
28
+ ],
29
+ limitations: [
30
+ 'The entered percentage is not looked up or validated against any country, year, asset type or taxpayer situation.',
31
+ 'The model does not include allowances, losses carried forward, depreciation, exemptions, inflation adjustments, separate improvements, or special regimes.',
32
+ 'Use the result to compare private scenarios and prepare questions; consult the relevant tax authority or a qualified adviser for a filing.',
33
+ ],
34
+ } as const;
package/src/tools.ts CHANGED
@@ -24,5 +24,6 @@ import { INFLATION_PURCHASING_POWER_TOOL } from './tool/inflationPurchasingPower
24
24
  import { SUBSCRIPTION_COST_ANNUALIZER_TOOL } from './tool/subscriptionCostAnnualizer';
25
25
  import { LOAN_TO_INCOME_RATIO_TOOL } from './tool/loanToIncomeRatio';
26
26
  import { RENTAL_DEPOSIT_RETURN_TOOL } from './tool/rentalDepositReturn';
27
+ import { CAPITAL_GAINS_TAX_SCENARIO_CALCULATOR_TOOL } from './tool/capitalGainsTaxScenarioCalculator';
27
28
 
28
- export const ALL_TOOLS: ToolDefinition[] = [COMPOUND_INTEREST_TOOL, FINANCIAL_FREEDOM_TOOL, SAVINGS_RATE_TOOL, PROFITABILITY_TOOL, MORTGAGE_TOOL, INFLATION_TOOL, PERCENTAGE_CALCULATOR_TOOL, LATE_INTEREST_TOOL, IBAN_BIC_SWIFT_TOOL, RENT_INCREASE_TOOL, LOTTERY_OPTIMIZER_TOOL, COURT_FEE_CALCULATOR_TOOL, LEGAL_INTEREST_RATE_TOOL, FIRE_CALCULATOR_TOOL, DEBT_SNOWBALL_TOOL, REVOLVING_CARD_CALCULATOR_TOOL, PESETA_VALUE_TOOL, SALARY_EMPLOYER_COST_TOOL, DIVIDEND_YIELD_TOOL, MORTGAGE_EXTRA_PAYMENT_PLANNER_TOOL, INFLATION_PURCHASING_POWER_TOOL, SUBSCRIPTION_COST_ANNUALIZER_TOOL, LOAN_TO_INCOME_RATIO_TOOL, RENTAL_DEPOSIT_RETURN_TOOL];
29
+ export const ALL_TOOLS: ToolDefinition[] = [COMPOUND_INTEREST_TOOL, FINANCIAL_FREEDOM_TOOL, SAVINGS_RATE_TOOL, PROFITABILITY_TOOL, MORTGAGE_TOOL, INFLATION_TOOL, PERCENTAGE_CALCULATOR_TOOL, LATE_INTEREST_TOOL, IBAN_BIC_SWIFT_TOOL, RENT_INCREASE_TOOL, LOTTERY_OPTIMIZER_TOOL, COURT_FEE_CALCULATOR_TOOL, LEGAL_INTEREST_RATE_TOOL, FIRE_CALCULATOR_TOOL, DEBT_SNOWBALL_TOOL, REVOLVING_CARD_CALCULATOR_TOOL, PESETA_VALUE_TOOL, SALARY_EMPLOYER_COST_TOOL, DIVIDEND_YIELD_TOOL, MORTGAGE_EXTRA_PAYMENT_PLANNER_TOOL, INFLATION_PURCHASING_POWER_TOOL, SUBSCRIPTION_COST_ANNUALIZER_TOOL, LOAN_TO_INCOME_RATIO_TOOL, RENTAL_DEPOSIT_RETURN_TOOL, CAPITAL_GAINS_TAX_SCENARIO_CALCULATOR_TOOL];