mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-23 15:40:32 -06:00
Looks like somebody had to google how the decimal thing works.
This commit is contained in:
parent
fe9344cd0a
commit
eaefb7136a
@ -89,7 +89,7 @@ class CreateMainTables extends Migration
|
||||
$table->integer('user_id', false, true);
|
||||
$table->integer('account_type_id', false, true);
|
||||
$table->string('name', 1024);
|
||||
$table->decimal('virtual_balance', 14, 12)->nullable();
|
||||
$table->decimal('virtual_balance', 22, 12)->nullable();
|
||||
$table->string('iban', 255)->nullable();
|
||||
$table->boolean('active')->default(1);
|
||||
$table->boolean('encrypted')->default(0);
|
||||
@ -160,8 +160,8 @@ class CreateMainTables extends Migration
|
||||
$table->integer('user_id', false, true);
|
||||
$table->string('name', 1024);
|
||||
$table->string('match', 1024);
|
||||
$table->decimal('amount_min', 14, 12);
|
||||
$table->decimal('amount_max', 14, 12);
|
||||
$table->decimal('amount_min', 22, 12);
|
||||
$table->decimal('amount_max', 22, 12);
|
||||
$table->date('date');
|
||||
$table->string('repeat_freq', 30);
|
||||
$table->smallInteger('skip', false, true)->default(0);
|
||||
@ -205,7 +205,7 @@ class CreateMainTables extends Migration
|
||||
$table->timestamps();
|
||||
$table->integer('budget_id', false, true);
|
||||
$table->date('startdate');
|
||||
$table->decimal('amount', 14, 12);
|
||||
$table->decimal('amount', 22, 12);
|
||||
$table->string('repeat_freq', 30);
|
||||
$table->boolean('repeats')->default(0);
|
||||
$table->foreign('budget_id')->references('id')->on('budgets')->onDelete('cascade');
|
||||
@ -221,7 +221,7 @@ class CreateMainTables extends Migration
|
||||
$table->integer('budget_limit_id', false, true);
|
||||
$table->date('startdate');
|
||||
$table->date('enddate');
|
||||
$table->decimal('amount', 14, 12);
|
||||
$table->decimal('amount', 22, 12);
|
||||
$table->foreign('budget_limit_id')->references('id')->on('budget_limits')->onDelete('cascade');
|
||||
}
|
||||
);
|
||||
@ -299,7 +299,7 @@ class CreateMainTables extends Migration
|
||||
$table->softDeletes();
|
||||
$table->integer('account_id', false, true);
|
||||
$table->string('name', 1024);
|
||||
$table->decimal('targetamount', 14, 12);
|
||||
$table->decimal('targetamount', 22, 12);
|
||||
$table->date('startdate')->nullable();
|
||||
$table->date('targetdate')->nullable();
|
||||
$table->integer('order', false, true)->default(0);
|
||||
@ -318,7 +318,7 @@ class CreateMainTables extends Migration
|
||||
$table->integer('piggy_bank_id', false, true);
|
||||
$table->date('startdate')->nullable();
|
||||
$table->date('targetdate')->nullable();
|
||||
$table->decimal('currentamount', 14, 12);
|
||||
$table->decimal('currentamount', 22, 12);
|
||||
$table->foreign('piggy_bank_id')->references('id')->on('piggy_banks')->onDelete('cascade');
|
||||
}
|
||||
);
|
||||
@ -472,8 +472,8 @@ class CreateMainTables extends Migration
|
||||
$table->string('tagMode', 1024);
|
||||
$table->date('date')->nullable();
|
||||
$table->text('description')->nullable();
|
||||
$table->decimal('latitude', 18, 12)->nullable();
|
||||
$table->decimal('longitude', 18, 12)->nullable();
|
||||
$table->decimal('latitude', 24, 12)->nullable();
|
||||
$table->decimal('longitude', 24, 12)->nullable();
|
||||
$table->boolean('zoomLevel')->nullable();
|
||||
|
||||
// link user id to users table
|
||||
@ -579,7 +579,7 @@ class CreateMainTables extends Migration
|
||||
$table->integer('piggy_bank_id', false, true);
|
||||
$table->integer('transaction_journal_id', false, true)->nullable();
|
||||
$table->date('date');
|
||||
$table->decimal('amount', 14, 12);
|
||||
$table->decimal('amount', 22, 12);
|
||||
|
||||
$table->foreign('piggy_bank_id')->references('id')->on('piggy_banks')->onDelete('cascade');
|
||||
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('set null');
|
||||
@ -596,7 +596,7 @@ class CreateMainTables extends Migration
|
||||
$table->integer('account_id', false, true);
|
||||
$table->integer('transaction_journal_id', false, true);
|
||||
$table->string('description', 1024)->nullable();
|
||||
$table->decimal('amount', 14, 12);
|
||||
$table->decimal('amount', 22, 12);
|
||||
|
||||
$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
||||
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade');
|
||||
|
@ -30,7 +30,7 @@ class ChangesForV430 extends Migration
|
||||
$table->softDeletes();
|
||||
$table->integer('user_id', false, true);
|
||||
$table->integer('transaction_currency_id', false, true);
|
||||
$table->decimal('amount', 14, 12);
|
||||
$table->decimal('amount', 22, 12);
|
||||
$table->date('start_date');
|
||||
$table->date('end_date');
|
||||
|
||||
|
@ -23,12 +23,13 @@ class TransactionCurrencySeeder extends Seeder
|
||||
{
|
||||
DB::table('transaction_currencies')->delete();
|
||||
|
||||
TransactionCurrency::create(['code' => 'EUR', 'name' => 'Euro', 'symbol' => '€']);
|
||||
TransactionCurrency::create(['code' => 'USD', 'name' => 'US Dollar', 'symbol' => '$']);
|
||||
TransactionCurrency::create(['code' => 'HUF', 'name' => 'Hungarian forint', 'symbol' => 'Ft']);
|
||||
TransactionCurrency::create(['code' => 'BRL', 'name' => 'Real', 'symbol' => 'R$']);
|
||||
TransactionCurrency::create(['code' => 'GBP', 'name' => 'British Pound', 'symbol' => '£']);
|
||||
TransactionCurrency::create(['code' => 'IDR', 'name' => 'Indonesian rupiah', 'symbol' => 'Rp']);
|
||||
TransactionCurrency::create(['code' => 'EUR', 'name' => 'Euro', 'symbol' => '€', 'decimal_places' => 2]);
|
||||
TransactionCurrency::create(['code' => 'USD', 'name' => 'US Dollar', 'symbol' => '$', 'decimal_places' => 2]);
|
||||
TransactionCurrency::create(['code' => 'HUF', 'name' => 'Hungarian forint', 'symbol' => 'Ft', 'decimal_places' => 2]);
|
||||
TransactionCurrency::create(['code' => 'BRL', 'name' => 'Real', 'symbol' => 'R$', 'decimal_places' => 2]);
|
||||
TransactionCurrency::create(['code' => 'GBP', 'name' => 'British Pound', 'symbol' => '£', 'decimal_places' => 2]);
|
||||
TransactionCurrency::create(['code' => 'IDR', 'name' => 'Indonesian rupiah', 'symbol' => 'Rp', 'decimal_places' => 2]);
|
||||
TransactionCurrency::create(['code' => 'XBT', 'name' => 'Bitcoin', 'symbol' => 'B', 'decimal_places' => 8]);
|
||||
}
|
||||
|
||||
}
|
||||
|
Binary file not shown.
@ -109,9 +109,10 @@ class CurrencyControllerTest extends TestCase
|
||||
{
|
||||
$this->session(['currencies.create.url' => 'http://localhost']);
|
||||
$data = [
|
||||
'name' => 'XX',
|
||||
'code' => 'XXX',
|
||||
'symbol' => 'x',
|
||||
'name' => 'XX',
|
||||
'code' => 'XXX',
|
||||
'symbol' => 'x',
|
||||
'decimal_places' => 2,
|
||||
];
|
||||
$this->be($this->user());
|
||||
$this->call('post', route('currencies.store'), $data);
|
||||
@ -126,9 +127,10 @@ class CurrencyControllerTest extends TestCase
|
||||
{
|
||||
$this->session(['currencies.edit.url' => 'http://localhost']);
|
||||
$data = [
|
||||
'name' => 'XA',
|
||||
'code' => 'XAX',
|
||||
'symbol' => 'a',
|
||||
'name' => 'XA',
|
||||
'code' => 'XAX',
|
||||
'symbol' => 'a',
|
||||
'decimal_places' => 2,
|
||||
];
|
||||
$this->be($this->user());
|
||||
$this->call('post', route('currencies.update', [2]), $data);
|
||||
|
Loading…
Reference in New Issue
Block a user