From 5a260a84c4024c4be7a29d8cfaae9f13911230b5 Mon Sep 17 00:00:00 2001 From: "G. Richardson" Date: Thu, 31 Oct 2019 14:19:36 +0100 Subject: [PATCH] Dev Record - create_{ar|ap|gl}_transaction mit assign_attributes MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Damit kann man auch Felder setzen, die nicht explizit abgefragt und geprüft werden, z.B. itime manuell setzen. Wird für manche Tests benötigt. --- SL/Dev/Record.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/SL/Dev/Record.pm b/SL/Dev/Record.pm index e9bd05929..2f289d0b4 100644 --- a/SL/Dev/Record.pm +++ b/SL/Dev/Record.pm @@ -384,7 +384,8 @@ sub create_ap_transaction { type => undef, # isn't set for ap employee_id => SL::DB::Manager::Employee->current->id, ); - # $ap_transaction->assign_attributes(%params) if %params; + # assign any parameters that weren't explicitly handled above, e.g. itime + $ap_transaction->assign_attributes(%params) if %params; foreach my $booking ( @{$bookings} ) { my $chart = delete $booking->{chart}; @@ -504,7 +505,8 @@ sub create_ar_transaction { type => undef, # isn't set for ar employee_id => SL::DB::Manager::Employee->current->id, ); - # $ar_transaction->assign_attributes(%params) if %params; + # assign any parameters that weren't explicitly handled above, e.g. itime + $ar_transaction->assign_attributes(%params) if %params; foreach my $booking ( @{$bookings} ) { my $chart = delete $booking->{chart}; @@ -610,6 +612,8 @@ sub create_gl_transaction { storno_id => undef, transactions => [], ); + # assign any parameters that weren't explicitly handled above, e.g. itime + $gl_transaction->assign_attributes(%params) if %params; my @acc_trans; if ( scalar @{$bookings} ) { -- 2.20.1