Skip to content

fix: company settings mapped to incorrect fields in frontend#121

Merged
kittendevv merged 1 commit into
kittendevv:mainfrom
LarssonOliver:settings-save-fix
May 9, 2026
Merged

fix: company settings mapped to incorrect fields in frontend#121
kittendevv merged 1 commit into
kittendevv:mainfrom
LarssonOliver:settings-save-fix

Conversation

@LarssonOliver
Copy link
Copy Markdown
Contributor

Hi!

Been looking into this project for a while, really like the idea of it all.

Have encountered a few bugs while playing around with the 2.0.1 version.

Seems more people have encountered this one specifically: #120

The bug:

Some company settings fields will always render the default values to invoices. This is due to the ui setting the fields email, phone, taxId, countryCode instead of companyEmail, companyPhone, companyTaxId, companyCountryCode that is referenced by templates.

There is some mention of potential aliases here:

const shouldClear = [
"companyTaxId",
"taxId", // alias that may slip through
"companyPhone",
"phone", // alias
"companyEmail",
"email", // alias
"companyCountryCode",
"countryCode", // alias
"companyCity",
"companyPostalCode",
"locale",
].includes(key) && String(raw).trim() === "";

That is never handled in anyway though and as a result, both versions are stored in the settings table in db.

companyPhone: default
phone: user-saved

This pr simply makes the UI reference the fields the way the rest of the app expects it to.

@LarssonOliver
Copy link
Copy Markdown
Contributor Author

As far as I can tell, this also solves the issue in #117

@kittendevv kittendevv merged commit 0e07c2d into kittendevv:main May 9, 2026
3 checks passed
@LarssonOliver LarssonOliver deleted the settings-save-fix branch May 9, 2026 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants