X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FIO.pm;h=c0d6987f36ed0508261e170c4d908d631ed5952d;hb=abafb475d9742e3a6c28427477235c923b21eeef;hp=32537e5477a30b42ef5dd0ad6b6b8e3574b03f30;hpb=60e14abfddb3e3bf68e19e586a0ad9cff615fcd6;p=kivitendo-erp.git diff --git a/SL/IO.pm b/SL/IO.pm index 32537e547..c0d6987f3 100644 --- a/SL/IO.pm +++ b/SL/IO.pm @@ -1,8 +1,12 @@ package IO; -use strict; +use List::Util qw(first); +use List::MoreUtils qw(any); use SL::DBUtils; +use SL::DB; + +use strict; sub retrieve_partunits { $main::lxdebug->enter_sub(); @@ -26,4 +30,52 @@ 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; + + SL::DB->client->with_transaction(sub { + my $dbh = $params{dbh} || SL::DB->client->dbh; + 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 = <client->error }; + + $main::lxdebug->leave_sub(); +} + + 1;