Bug 21597: Field 'amount' doesn't have a default value

Fix t/db_dependent/Accounts.t

Default value could be 0, or left as it.
It seems that the different initialisation we have in the code pass a
value for 'amount'

account_offsets.amount
  `amount` decimal(26,6) NOT NULL,

DBIx::Class::Storage::DBI::_dbh_execute(): Field 'amount' doesn't
have a default value at /home/vagrant/kohaclone/Koha/Object.pm line 125

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 82884b0bd8)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2018-10-17 19:11:29 -03:00 committed by Martin Renvoize
parent 64b31d4cc8
commit f8063726ba
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 3 additions and 3 deletions

View File

@ -814,7 +814,7 @@ subtest "Koha::Account::non_issues_charges tests" => sub {
my $debit = Koha::Account::Line->new({ borrowernumber => $patron->id, date => '1900-01-01', amountoutstanding => 0 })->store();
my $credit = Koha::Account::Line->new({ borrowernumber => $patron->id, date => '1900-01-01', amountoutstanding => -5 })->store();
my $offset = Koha::Account::Offset->new({ credit_id => $credit->id, debit_id => $debit->id, type => 'Payment' })->store();
my $offset = Koha::Account::Offset->new({ credit_id => $credit->id, debit_id => $debit->id, type => 'Payment', amount => 0 })->store();
purge_zero_balance_fees( 1 );
my $debit_2 = Koha::Account::Lines->find( $debit->id );
my $credit_2 = Koha::Account::Lines->find( $credit->id );
@ -824,7 +824,7 @@ subtest "Koha::Account::non_issues_charges tests" => sub {
$debit = Koha::Account::Line->new({ borrowernumber => $patron->id, date => '1900-01-01', amountoutstanding => 5 })->store();
$credit = Koha::Account::Line->new({ borrowernumber => $patron->id, date => '1900-01-01', amountoutstanding => 0 })->store();
$offset = Koha::Account::Offset->new({ credit_id => $credit->id, debit_id => $debit->id, type => 'Payment' })->store();
$offset = Koha::Account::Offset->new({ credit_id => $credit->id, debit_id => $debit->id, type => 'Payment', amount => 0 })->store();
purge_zero_balance_fees( 1 );
$debit_2 = $credit_2 = undef;
$debit_2 = Koha::Account::Lines->find( $debit->id );
@ -835,7 +835,7 @@ subtest "Koha::Account::non_issues_charges tests" => sub {
$debit = Koha::Account::Line->new({ borrowernumber => $patron->id, date => '1900-01-01', amountoutstanding => 0 })->store();
$credit = Koha::Account::Line->new({ borrowernumber => $patron->id, date => '1900-01-01', amountoutstanding => 0 })->store();
$offset = Koha::Account::Offset->new({ credit_id => $credit->id, debit_id => $debit->id, type => 'Payment' })->store();
$offset = Koha::Account::Offset->new({ credit_id => $credit->id, debit_id => $debit->id, type => 'Payment', amount => 0 })->store();
purge_zero_balance_fees( 1 );
$debit_2 = Koha::Account::Lines->find( $debit->id );
$credit_2 = Koha::Account::Lines->find( $credit->id );