summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xLedgerSMB/AM.pm4
-rwxr-xr-xLedgerSMB/CP.pm4
-rwxr-xr-xLedgerSMB/CT.pm2
-rwxr-xr-xLedgerSMB/IS.pm2
4 files changed, 6 insertions, 6 deletions
diff --git a/LedgerSMB/AM.pm b/LedgerSMB/AM.pm
index 91df2123..15558597 100755
--- a/LedgerSMB/AM.pm
+++ b/LedgerSMB/AM.pm
@@ -233,7 +233,7 @@ sub delete_account {
$sth->execute($form->{id});
my ($rowcount) = $sth->fetchrow_array();
- if ($dbh->selectrow_array($query)) {
+ if ($rowcount) {
$form->error(
"Cannot delete accounts with associated transactions!"
);
@@ -345,7 +345,7 @@ sub get_gifi {
$sth = $dbh->prepare($query);
$sth->execute($form->{accno}) || $form->dberror($query);
- ($numrows) = $dbh->selectrow_array($query);
+ ($numrows) = $sth->fetchrow_array;
if (($numrows * 1) == 0){
$form->{orphaned} = 1;
} else {
diff --git a/LedgerSMB/CP.pm b/LedgerSMB/CP.pm
index b5f0df2d..33d47bcf 100755
--- a/LedgerSMB/CP.pm
+++ b/LedgerSMB/CP.pm
@@ -406,7 +406,7 @@ sub post_payment {
my $sth = $dbh->prepare($query);
$sth->execute($form->{"id_$i"});
- my ($id) = $dbh->selectrow_array($query);
+ my ($id) = $sth->fetchrow_array;
$amount =
$form->round_amount(
@@ -671,7 +671,7 @@ sub post_payments {
$sth = $sbh->prepare($query);
$sth->execute($form->{currency}, $form->{"id_$i"})
|| $form->dberror($query, 'CP.pm', 671);
- my ($exchangerate) = $dbh->selectrow_array($query);
+ my ($exchangerate) = $sth->fetchrow_array;
$exchangerate ||= 1;
diff --git a/LedgerSMB/CT.pm b/LedgerSMB/CT.pm
index 421444b7..62cc45ae 100755
--- a/LedgerSMB/CT.pm
+++ b/LedgerSMB/CT.pm
@@ -427,7 +427,7 @@ sub save_vendor {
$sth = $dbh->prepare($query);
$sth->execute($form->{id}) || $form->dberror($query);
- if (! $dbh->selectrow_array($query)) {
+ if (! $sth->fetchrow_array) {
$query = qq|INSERT INTO vendor (id)
VALUES (?)|;
diff --git a/LedgerSMB/IS.pm b/LedgerSMB/IS.pm
index c14bc920..2796d5ba 100755
--- a/LedgerSMB/IS.pm
+++ b/LedgerSMB/IS.pm
@@ -840,7 +840,7 @@ sub post_invoice {
$sth = $dbh->prepare($query);
$sth->execute($form->{id});
- if ($dbh->selectrow_array($query)) {
+ if ($sth->fetchrow_array) {
&reverse_invoice($dbh, $form);
} else {
$query = qq|INSERT INTO ar (id) VALUES (?)|;