When purchasing/scanning a product (PurchaseProductView), the price field always displays the currency code "USD", regardless of the currency configured on the Grocy server (e.g. CURRENCY=EUR).
Steps to reproduce:
- Set up a Grocy server with
CURRENCY=EUR (confirmed correct via the web frontend, which shows "€" properly)
- Open the app, go to Purchase for any product
- The "Price" field shows e.g. "1,00 USD" instead of "1,00 EUR" / "1,00 €"
Root cause:
Grocy Mobile/Helper/CurrencySymbol.swift is hardcoded:
func getCurrencySymbol() -> String {
return "USD"
}
This is called directly in PurchaseProductView.swift (line 228):
MyDoubleStepperOptional(..., currencySymbol: getCurrencySymbol())
Meanwhile, SystemConfigModel.swift already correctly decodes the server's actual currency into SystemConfig.currency (from the CURRENCY config key), and it's used correctly elsewhere, e.g. via grocyVM.getFormattedCurrency(...) in the same file (line 231).
Suggested fix:
Replace the hardcoded stub with the actual value from the fetched system config, e.g. something like grocyVM.systemConfig?.currency ?? "USD", instead of the hardcoded "USD" literal — consistent with how getFormattedCurrency already does it.
When purchasing/scanning a product (
PurchaseProductView), the price field always displays the currency code "USD", regardless of the currency configured on the Grocy server (e.g.CURRENCY=EUR).Steps to reproduce:
CURRENCY=EUR(confirmed correct via the web frontend, which shows "€" properly)Root cause:
Grocy Mobile/Helper/CurrencySymbol.swiftis hardcoded:This is called directly in
PurchaseProductView.swift(line 228):Meanwhile,
SystemConfigModel.swiftalready correctly decodes the server's actual currency intoSystemConfig.currency(from theCURRENCYconfig key), and it's used correctly elsewhere, e.g. viagrocyVM.getFormattedCurrency(...)in the same file (line 231).Suggested fix:
Replace the hardcoded stub with the actual value from the fetched system config, e.g. something like
grocyVM.systemConfig?.currency ?? "USD", instead of the hardcoded "USD" literal — consistent with howgetFormattedCurrencyalready does it.