crater icon indicating copy to clipboard operation
crater copied to clipboard

Swap currency position

Open gokkstudio opened this issue 2 years ago • 2 comments

I think this worked nicely in SQL: swap_currency_symbol: 'true', but in SQLite I can't swap currency position from left to right, with a space, like so: 2.500,00 €

It works in dashboard, but not on generated PDF's. I've tried: swap_currency_symbol: 'true' swap_currency_symbol: 'false' swap_currency_symbol: '1' swap_currency_symbol: '0' no luck.. it's always the same

Can someone please help me configure this for SQLite db, image is attached. Thanks swap-currency

gokkstudio avatar Feb 02 '22 13:02 gokkstudio

Any news on this one?

gokkstudio avatar Feb 26 '22 12:02 gokkstudio

@gokkstudio I'll try and submit a PR soon but for now you can fix this by editing app/Models/Currency.php and adding a Laravel $casts definition to force casting swap_currency_symbol to a boolean.

class Currency extends Model
{
    use HasFactory;

    protected $guarded = [
        'id'
    ];

    protected $casts = [
        'swap_currency_symbol' => 'boolean'
    ];
}

The issue is (at least with SQLite) swap_currency_symbol: false is passed as "0" to JS and evaluates as true!

southan avatar May 24 '22 22:05 southan