use Data::Dumper;
use SL::DB::Helper::AccountingPeriod qw(get_balance_starting_date);
use List::Util qw(sum);
+use SL::DB;
# use warnings;
use strict;
my ($self, $myconfig, $form, %options) = @_;
- my $dbh = $form->dbconnect($myconfig);
+ my $dbh = SL::DB->client->dbh;
my ($query, $sth, $ref);
my %balance = ();
}
- $dbh->disconnect;
-
# debits and credits for headings
foreach my $accno (@headingaccounts) {
foreach $ref (@{ $form->{TB} }) {
my ($self, $myconfig, $form) = @_;
# connect to database
- my $dbh = $form->dbconnect($myconfig);
+ my $dbh = SL::DB->client->dbh;
my ($invoice, $arap, $buysell, $ct, $ct_id, $ml);
$sth->finish;
- # disconnect
- $dbh->disconnect;
-
$main::lxdebug->leave_sub();
}
my ($self, $myconfig, $form) = @_;
- # connect to database
- my $dbh = $form->dbconnect($myconfig);
+ my $dbh = SL::DB->client->dbh;
my $ct = $form->{ct} eq "customer" ? "customer" : "vendor";
WHERE ct.id = ?|;
($form->{ $form->{ct} }, $form->{email}, $form->{cc}, $form->{bcc}) =
selectrow_query($form, $dbh, $query, $form->{"${ct}_id"});
- $dbh->disconnect;
$main::lxdebug->leave_sub();
}
my ($self, $myconfig, $form) = @_;
- # connect to database
- my $dbh = $form->dbconnect($myconfig);
+ my $dbh = SL::DB->client->dbh;
my ($null, $department_id) = split /--/, $form->{department};
$form->{TR} = selectall_hashref_query($form, $dbh, $query);
- $dbh->disconnect;
-
$main::lxdebug->leave_sub();
}
my ($self, $myconfig, $form) = @_;
- # connect to database
- my $dbh = $form->dbconnect($myconfig);
+ my $dbh = SL::DB->client->dbh;
my $last_period = 0;
my $category;
}
}
- $dbh->disconnect;
$main::lxdebug->leave_sub();
}