From 519278e23fe1a4d320d1c2a3cd08fbecf0c4e05c Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 20 Jan 2022 11:11:21 +1100 Subject: [PATCH] Fixes for recurring invoice opt out autobilling --- .../2022_01_19_232436_add_kyd_currency.php | 52 +++++++++++++++++++ ...ring-invoices-switch-autobilling.blade.php | 2 +- 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 database/migrations/2022_01_19_232436_add_kyd_currency.php diff --git a/database/migrations/2022_01_19_232436_add_kyd_currency.php b/database/migrations/2022_01_19_232436_add_kyd_currency.php new file mode 100644 index 000000000000..adc77d17ed8e --- /dev/null +++ b/database/migrations/2022_01_19_232436_add_kyd_currency.php @@ -0,0 +1,52 @@ + 112, 'name' => 'Cayman Island Dollar', 'code' => 'KYD', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], + + ]; + + foreach ($currencies as $currency) { + $record = Currency::whereCode($currency['code'])->first(); + if ($record) { + $record->name = $currency['name']; + $record->symbol = $currency['symbol']; + $record->precision = $currency['precision']; + $record->thousand_separator = $currency['thousand_separator']; + $record->decimal_separator = $currency['decimal_separator']; + if (isset($currency['swap_currency_symbol'])) { + $record->swap_currency_symbol = $currency['swap_currency_symbol']; + } + $record->save(); + } else { + Currency::create($currency); + } + } + + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +} diff --git a/resources/views/portal/ninja2020/components/livewire/recurring-invoices-switch-autobilling.blade.php b/resources/views/portal/ninja2020/components/livewire/recurring-invoices-switch-autobilling.blade.php index 18fd1ca6e122..c9c080cd41b2 100644 --- a/resources/views/portal/ninja2020/components/livewire/recurring-invoices-switch-autobilling.blade.php +++ b/resources/views/portal/ninja2020/components/livewire/recurring-invoices-switch-autobilling.blade.php @@ -1,6 +1,6 @@