X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FIO.pm;h=b840e458cae134455ff9f6b81fb5dd1c661ae9a8;hb=7ee5fab89c8ef14f442e686a23635e4a6fd3f2ee;hp=814a452dca3d0dc5fbc0e0ced1726dcd26b7835f;hpb=80f6efd0cd9de22d54ccc605808a74c9955e643c;p=kivitendo-erp.git diff --git a/SL/IO.pm b/SL/IO.pm index 814a452dc..b840e458c 100644 --- a/SL/IO.pm +++ b/SL/IO.pm @@ -1,5 +1,8 @@ package IO; +use List::Util qw(first); +use List::MoreUtils qw(any); + use SL::DBUtils; use strict; @@ -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;