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