X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FIO.pm;h=b840e458cae134455ff9f6b81fb5dd1c661ae9a8;hb=dabad44338f4217a5d89cde64201a445a23de3f1;hp=32537e5477a30b42ef5dd0ad6b6b8e3574b03f30;hpb=60e14abfddb3e3bf68e19e586a0ad9cff615fcd6;p=kivitendo-erp.git diff --git a/SL/IO.pm b/SL/IO.pm index 32537e547..b840e458c 100644 --- a/SL/IO.pm +++ b/SL/IO.pm @@ -1,9 +1,12 @@ package IO; -use strict; +use List::Util qw(first); +use List::MoreUtils qw(any); use SL::DBUtils; +use strict; + sub retrieve_partunits { $main::lxdebug->enter_sub(); @@ -26,4 +29,50 @@ sub retrieve_partunits { } +sub set_datepaid { + $main::lxdebug->enter_sub(); + + my $self = shift; + my %params = @_; + + Common::check_params(\%params, qw(id table)); + + my $myconfig = \%main::myconfig; + my $form = $main::form; + + my $dbh = $params{dbh} || $form->get_standard_dbh($myconfig); + my $id = conv_i($params{id}); + my $table = (any { $_ eq $params{table} } qw(ar ap gl)) ? $params{table} : 'ar'; + + my ($curr_datepaid, $curr_paid) = selectfirst_array_query($form, $dbh, qq|SELECT datepaid, paid FROM $table WHERE id = ?|, $id); + + my $query = <commit() unless $params{dbh}; + + $main::lxdebug->leave_sub(); +} + + 1;