Skip to content

[Settings]: Amounts — Currency Format #249

Description

@nielsdrost7

SMART Plan — Set currency for the company in Amount Settings

Specific

A Select field labelled "Currency" in the Amounts tab of the Company Settings page. The options list ISO 4217 currency codes (e.g. USD, EUR, GBP). Stores the selected code as a string under the key currency_code, scoped to the current company. The value controls the currency symbol and code shown on invoices and quotes.

Measurable

  • The field appears in the Amounts section of the Company Settings page
  • Saving the form persists the value to the settings table with key currency_code and company_id scope
  • The value is read back correctly on page reload

Achievable

  1. Create/extend Modules/Core/Filament/Company/Pages/CompanySettings.php (Filament page with tabs)
  2. Add a Select::make('currency_code')->label('Currency')->options([...ISO 4217 list...]) field to the Amounts tab section
  3. Add const CURRENCY_CODE = 'currency_code'; to Modules/Core/Models/Setting.php constants
  4. Register the page in CompanyPanelProvider

Relevant

Multi-tenant setups commonly serve companies operating in different countries. Storing a per-company currency code ensures all monetary values are rendered and exported with the correct symbol and ISO code, avoiding confusion on client-facing documents.

Time-bound

Sprint 6.


Arrange · Act · Assert

// Modules/Core/Tests/Feature/CompanySettingsTest.php

#[Test]
public function it_saves_currency_code_setting(): void
{
    /* Arrange */
    $page = Livewire::actingAs($this->user)
        ->test(\Modules\Core\Filament\Company\Pages\CompanySettings::class);

    /* Act */
    $page->set('data.currency_code', 'EUR')
         ->call('save');

    /* Assert */
    $page->assertSuccessful();
    $this->assertDatabaseHas('settings', [
        'company_id' => $this->company->id,
        'key'        => 'currency_code',
        'value'      => 'EUR',
    ]);
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

refinedRefined with SMART plan / test suggestions

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions