diff --git a/app/Libraries/Utils.php b/app/Libraries/Utils.php index e79d82643917..ee50d233222b 100644 --- a/app/Libraries/Utils.php +++ b/app/Libraries/Utils.php @@ -344,7 +344,7 @@ class Utils $decimal = $currency->decimal_separator; $precision = $currency->precision; $code = $currency->code; - $swapSymbol = false; + $swapSymbol = $currency->swap_currency_symbol; if ($countryId && $currencyId == CURRENCY_EURO) { $country = self::getFromCache($countryId, 'countries'); diff --git a/database/migrations/2016_05_16_102925_add_swap_currency_symbol_to_currency.php b/database/migrations/2016_05_16_102925_add_swap_currency_symbol_to_currency.php new file mode 100644 index 000000000000..31eafbaf9615 --- /dev/null +++ b/database/migrations/2016_05_16_102925_add_swap_currency_symbol_to_currency.php @@ -0,0 +1,32 @@ +boolean('swap_currency_symbol')->default(false); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table(self::TABLE_NAME,function(Blueprint $table){ + $table->dropColumn('swap_currency_symbol'); + }); + } +} diff --git a/database/seeds/CurrenciesSeeder.php b/database/seeds/CurrenciesSeeder.php index 857dbe628405..f88e1b12cc66 100644 --- a/database/seeds/CurrenciesSeeder.php +++ b/database/seeds/CurrenciesSeeder.php @@ -58,7 +58,7 @@ class CurrenciesSeeder extends Seeder ['name' => 'Maldivian Rufiyaa', 'code' => 'MVR', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['name' => 'Costa Rican Colón', 'code' => 'CRC', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['name' => 'Pakistani Rupee', 'code' => 'PKR', 'symbol' => 'Rs ', 'precision' => '0', 'thousand_separator' => ',', 'decimal_separator' => '.'], - ['name' => 'Polish Zloty', 'code' => 'PLN', 'symbol' => 'zł', 'precision' => '2', 'thousand_separator' => ' ', 'decimal_separator' => ','], + ['name' => 'Polish Zloty', 'code' => 'PLN', 'symbol' => 'zł', 'precision' => '2', 'thousand_separator' => ' ', 'decimal_separator' => ',', 'swap_currency_symbol' => true], ]; foreach ($currencies as $currency) { diff --git a/resources/views/money_script.blade.php b/resources/views/money_script.blade.php index 0dc44eac6455..4cfd3efc6521 100644 --- a/resources/views/money_script.blade.php +++ b/resources/views/money_script.blade.php @@ -70,7 +70,7 @@ var thousand = currency.thousand_separator; var decimal = currency.decimal_separator; var code = currency.code; - var swapSymbol = false; + var swapSymbol = currency.swap_currency_symbol; if (countryId && currencyId == {{ CURRENCY_EURO }}) { var country = countryMap[countryId];