X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FGLTransaction.pm;h=1dbf2c813348d8d860497671b0309d1aab5bb4c9;hb=53593baa211863fbf66540cf1bcc36c8fb37257f;hp=50b29c0ff893be81c2b6a1dee1fe8c24bcc03175;hpb=653af2fb9905199b0916ddf704cb983e1a769eb2;p=kivitendo-erp.git diff --git a/SL/DB/GLTransaction.pm b/SL/DB/GLTransaction.pm index 50b29c0ff..1dbf2c813 100644 --- a/SL/DB/GLTransaction.pm +++ b/SL/DB/GLTransaction.pm @@ -2,6 +2,7 @@ package SL::DB::GLTransaction; use strict; +use SL::DB::Helper::LinkedRecords; use SL::DB::MetaSetup::GLTransaction; use SL::Locale::String qw(t8); use List::Util qw(sum); @@ -113,7 +114,7 @@ sub add_chart_booking { require SL::DB::Chart; die "add_chart_booking needs a transdate" unless $self->transdate; die "add_chart_booking needs taxincluded" unless defined $self->taxincluded; - die "chart missing" unless $params{chart} && ref($params{chart}) eq 'SL::DB::Chart'; + die "chart missing" unless $params{chart} && ref($params{chart}) eq 'SL::DB::Chart'; die t8('Booking needs at least one debit and one credit booking!') unless $params{debit} or $params{credit}; # must exist and not be 0 die t8('Cannot have a value in both Debit and Credit!') @@ -212,7 +213,7 @@ sub validate { my $sum = sum map { $_->amount } @{ $self->transactions }; # compare rounded amount to 0, to get around floating point problems, e.g. # $sum = -2.77555756156289e-17 - push @errors, t8('Out of balance transaction!') unless $::form->round_amount($sum,5) == 0; + push @errors, t8('Out of balance transaction!') . $sum unless $::form->round_amount($sum,5) == 0; }; } else { push @errors, t8('Empty transaction!');