X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/60e14abfddb3e3bf68e19e586a0ad9cff615fcd6..f16b77358a0cbedf9681c6ea95bd2a076b8b78a9:/SL/IO.pm 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;