};
- $main::lxdebug->message(LXDebug::QUERY, "\$query=\n $query");
+ $main::lxdebug->message(LXDebug->QUERY(), "\$query=\n $query");
my $sth = $dbh->prepare($query);
$sth->execute($form->{id}) || $form->dberror($query . " ($form->{id})");
- my $ref = $sth->fetchrow_hashref(NAME_lc);
+ my $ref = $sth->fetchrow_hashref("NAME_lc");
foreach my $key (keys %$ref) {
$form->{"$key"} = $ref->{"$key"};
# get default accounts
$query = qq|SELECT inventory_accno_id, income_accno_id, expense_accno_id
FROM defaults|;
- $main::lxdebug->message(LXDebug::QUERY, "\$query=\n $query");
+ $main::lxdebug->message(LXDebug->QUERY(), "\$query=\n $query");
$sth = $dbh->prepare($query);
$sth->execute || $form->dberror($query);
- $ref = $sth->fetchrow_hashref(NAME_lc);
+ $ref = $sth->fetchrow_hashref("NAME_lc");
- map { $form->{$_} = $ref->{$_} } keys %ref;
+ map { $form->{$_} = $ref->{$_} } keys %{ $ref };
$sth->finish;
rate
FROM tax ORDER BY taxkey
};
- $main::lxdebug->message(LXDebug::QUERY, "\$query=\n $query");
+ $main::lxdebug->message(LXDebug->QUERY(), "\$query=\n $query");
$sth = $dbh->prepare($query);
$sth->execute || $form->dberror($query);
$form->{TAXKEY} = [];
- while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
push @{ $form->{TAXKEY} }, $ref;
}
FROM chart
WHERE link = ?
ORDER BY accno|;
- $main::lxdebug->message(LXDebug::QUERY, "\$query=\n $query");
+ $main::lxdebug->message(LXDebug->QUERY(), "\$query=\n $query");
$sth = $dbh->prepare($query);
$sth->execute($form->{link}) || $form->dberror($query . " ($form->{link})");
$form->{NEWACCOUNT} = [];
- while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
push @{ $form->{NEWACCOUNT} }, $ref;
}
WHERE tk.chart_id = ?
ORDER BY startdate DESC
};
- $main::lxdebug->message(LXDebug::QUERY, "\$query=\n $query");
+ $main::lxdebug->message(LXDebug->QUERY(), "\$query=\n $query");
$sth = $dbh->prepare($query);
$sth->execute($form->{id}) || $form->dberror($query . " ($form->{id})");
$form->{ACCOUNT_TAXKEYS} = [];
- while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
push @{ $form->{ACCOUNT_TAXKEYS} }, $ref;
}
# check if we have any transactions
$query = qq|SELECT a.trans_id FROM acc_trans a
WHERE a.chart_id = ?|;
- $main::lxdebug->message(LXDebug::QUERY, "\$query=\n $query");
+ $main::lxdebug->message(LXDebug->QUERY(), "\$query=\n $query");
$sth = $dbh->prepare($query);
$sth->execute($form->{id}) || $form->dberror($query . " ($form->{id})");
if ($form->{new_chart_id}) {
$query = qq|SELECT current_date-valid_from FROM chart
WHERE id = ?|;
- $main::lxdebug->message(LXDebug::QUERY, "\$query=\n $query");
+ $main::lxdebug->message(LXDebug->QUERY(), "\$query=\n $query");
my ($count) = selectrow_query($form, $dbh, $query, $form->{id});
if ($count >=0) {
$form->{new_chart_valid} = 1;
FROM department d
ORDER BY 2|;
- $sth = $dbh->prepare($query);
+ my $sth = $dbh->prepare($query);
$sth->execute || $form->dberror($query);
$form->{ALL} = [];
- while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
push @{ $form->{ALL} }, $ref;
}
my $sth = $dbh->prepare($query);
$sth->execute($form->{id}) || $form->dberror($query . " ($form->{id})");
- my $ref = $sth->fetchrow_hashref(NAME_lc);
+ my $ref = $sth->fetchrow_hashref("NAME_lc");
map { $form->{$_} = $ref->{$_} } keys %$ref;
$main::lxdebug->enter_sub();
my ($self, $myconfig, $form) = @_;
+ my ($query);
# connect to database
my $dbh = $form->dbconnect($myconfig);
$main::lxdebug->enter_sub();
my ($self, $myconfig, $form) = @_;
+ my ($query);
# connect to database
my $dbh = $form->dbconnect($myconfig);
FROM leads
ORDER BY 2|;
- $sth = $dbh->prepare($query);
+ my $sth = $dbh->prepare($query);
$sth->execute || $form->dberror($query);
- while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
push @{ $form->{ALL} }, $ref;
}
my $sth = $dbh->prepare($query);
$sth->execute($form->{id}) || $form->dberror($query . " ($form->{id})");
- my $ref = $sth->fetchrow_hashref(NAME_lc);
+ my $ref = $sth->fetchrow_hashref("NAME_lc");
map { $form->{$_} = $ref->{$_} } keys %$ref;
$main::lxdebug->enter_sub();
my ($self, $myconfig, $form) = @_;
+ my ($query);
# connect to database
my $dbh = $form->dbconnect($myconfig);
$main::lxdebug->enter_sub();
my ($self, $myconfig, $form) = @_;
+ my ($query);
# connect to database
my $dbh = $form->dbconnect($myconfig);
FROM business
ORDER BY 2|;
- $sth = $dbh->prepare($query);
+ my $sth = $dbh->prepare($query);
$sth->execute || $form->dberror($query);
- while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
push @{ $form->{ALL} }, $ref;
}
my $sth = $dbh->prepare($query);
$sth->execute($form->{id}) || $form->dberror($query . " ($form->{id})");
- my $ref = $sth->fetchrow_hashref(NAME_lc);
+ my $ref = $sth->fetchrow_hashref("NAME_lc");
map { $form->{$_} = $ref->{$_} } keys %$ref;
$main::lxdebug->enter_sub();
my ($self, $myconfig, $form) = @_;
+ my ($query);
# connect to database
my $dbh = $form->dbconnect($myconfig);
# connect to database
my $dbh = $form->dbconnect($myconfig);
- $query = qq|DELETE FROM business
+ my $query = qq|DELETE FROM business
WHERE id = ?|;
do_query($form, $dbh, $query, $form->{id});
" output_numberformat, output_dateformat, output_longdates " .
"FROM language ORDER BY description";
- $sth = $dbh->prepare($query);
+ my $sth = $dbh->prepare($query);
$sth->execute || $form->dberror($query);
my $ary = [];
- while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
push(@{ $ary }, $ref);
}
my $sth = $dbh->prepare($query);
$sth->execute($form->{"id"}) || $form->dberror($query . " ($form->{id})");
- my $ref = $sth->fetchrow_hashref(NAME_lc);
+ my $ref = $sth->fetchrow_hashref("NAME_lc");
map { $form->{$_} = $ref->{$_} } keys %$ref;
$main::lxdebug->enter_sub();
my ($self, $myconfig, $form) = @_;
+ my $query;
# connect to database
my $dbh = $form->dbconnect_noauto($myconfig);
foreach my $table (qw(translation_payment_terms units_language)) {
- my $query = qq|DELETE FROM $table WHERE language_id = ?|;
+ $query = qq|DELETE FROM $table WHERE language_id = ?|;
do_query($form, $dbh, $query, $form->{"id"});
}
FROM buchungsgruppen
ORDER BY sortkey|;
- $sth = $dbh->prepare($query);
+ my $sth = $dbh->prepare($query);
$sth->execute || $form->dberror($query);
$form->{ALL} = [];
- while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
push @{ $form->{ALL} }, $ref;
}
my $sth = $dbh->prepare($query);
$sth->execute($form->{id}) || $form->dberror($query . " ($form->{id})");
- my $ref = $sth->fetchrow_hashref(NAME_lc);
+ my $ref = $sth->fetchrow_hashref("NAME_lc");
map { $form->{$_} = $ref->{$_} } keys %$ref;
my $sth = $dbh->prepare($query);
$sth->execute || $form->dberror($query);
- while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
foreach my $key (split(/:/, $ref->{link})) {
if (!$form->{"std_inventory_accno_id"} && ($key eq "IC")) {
$form->{"std_inventory_accno_id"} = $ref->{"id"};
# connect to database
my $dbh = $form->dbconnect($myconfig);
- $query = qq|DELETE FROM buchungsgruppen WHERE id = ?|;
+ my $query = qq|DELETE FROM buchungsgruppen WHERE id = ?|;
do_query($form, $dbh, $query, $form->{id});
$dbh->disconnect;
FROM printers
ORDER BY 2|;
- $sth = $dbh->prepare($query);
+ my $sth = $dbh->prepare($query);
$sth->execute || $form->dberror($query);
$form->{"ALL"} = [];
- while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
push @{ $form->{ALL} }, $ref;
}
my $sth = $dbh->prepare($query);
$sth->execute($form->{id}) || $form->dberror($query . " ($form->{id})");
- my $ref = $sth->fetchrow_hashref(NAME_lc);
+ my $ref = $sth->fetchrow_hashref("NAME_lc");
map { $form->{$_} = $ref->{$_} } keys %$ref;
$main::lxdebug->enter_sub();
my ($self, $myconfig, $form) = @_;
+ my $query;
# connect to database
my $dbh = $form->dbconnect($myconfig);
# connect to database
my $dbh = $form->dbconnect($myconfig);
- $query = qq|DELETE FROM printers
+ my $query = qq|DELETE FROM printers
WHERE id = ?|;
do_query($form, $dbh, $query, $form->{id});
my $query = qq|SELECT * FROM payment_terms ORDER BY sortkey|;
- $sth = $dbh->prepare($query);
+ my $sth = $dbh->prepare($query);
$sth->execute || $form->dberror($query);
$form->{ALL} = [];
- while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
push @{ $form->{ALL} }, $ref;
}
my $sth = $dbh->prepare($query);
$sth->execute($form->{"id"}) || $form->dberror($query . " ($form->{id})");
- my $ref = $sth->fetchrow_hashref(NAME_lc);
+ my $ref = $sth->fetchrow_hashref("NAME_lc");
map { $form->{$_} = $ref->{$_} } keys %$ref;
$sth->finish();
$sth->execute($form->{"id"}) || $form->dberror($query . " ($form->{id})");
my %mapping;
- while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
$mapping{ $ref->{"language_id"} } = $ref
unless (defined($mapping{ $ref->{"language_id"} }));
}
$myconfig->{$item} = $form->{$item};
}
- $myconfig->save_member($memberfile);
+ $myconfig->save_member($main::memberfile);
my $auth = $main::auth;
}
if ($webdav) {
- @webdavdirs =
+ my @webdavdirs =
qw(angebote bestellungen rechnungen anfragen lieferantenbestellungen einkaufsrechnungen);
- foreach $directory (@webdavdirs) {
- $file = "webdav/" . $directory . "/webdav-user";
+ foreach my $directory (@webdavdirs) {
+ my $file = "webdav/" . $directory . "/webdav-user";
+ my $newfile;
if ($myconfig->{$directory}) {
open(HTACCESS, "$file") or die "cannot open webdav-user $!\n";
while (<HTACCESS>) {
- ($login, $password) = split(/:/, $_);
+ my ($login, $password) = split(/:/, $_);
if ($login ne $form->{login}) {
$newfile .= $_;
}
$form->{$directory} = 0;
open(HTACCESS, "$file") or die "cannot open webdav-user $!\n";
while (<HTACCESS>) {
- ($login, $password) = split(/:/, $_);
+ my ($login, $password) = split(/:/, $_);
if ($login ne $form->{login}) {
$newfile .= $_;
}
my $sth = $dbh->prepare($query);
$sth->execute || $form->dberror($query);
- $form->{defaults} = $sth->fetchrow_hashref(NAME_lc);
+ $form->{defaults} = $sth->fetchrow_hashref("NAME_lc");
$form->{defaults}{IC} = $form->{defaults}{inventory_accno_id};
$form->{defaults}{IC_income} = $form->{defaults}{income_accno_id};
$form->{defaults}{IC_expense} = $form->{defaults}{expense_accno_id};
$sth = $dbh->prepare($query);
$sth->execute || $self->dberror($query);
- while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
foreach my $key (split(/:/, $ref->{link})) {
if ($key =~ /IC/) {
- $nkey = $key;
+ my $nkey = $key;
if ($key =~ /cogs/) {
$nkey = "IC_expense";
}
$sth = $dbh->prepare($query);
$sth->execute || $self->dberror($query);
- while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
%{ $form->{IC}{FX_gain}{ $ref->{accno} } } = (
id => $ref->{id},
description => $ref->{description}
$sth = $dbh->prepare($query);
$sth->execute || $self->dberror($query);
- while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
%{ $form->{IC}{FX_loss}{ $ref->{accno} } } = (
id => $ref->{id},
description => $ref->{description}
$sth = $dbh->prepare($query);
$sth->execute || $form->dberror($query);
- while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
$form->{taxrates}{ $ref->{accno} }{id} = $ref->{id};
$form->{taxrates}{ $ref->{accno} }{description} = $ref->{description};
$form->{taxrates}{ $ref->{accno} }{taxnumber} = $ref->{taxnumber}
$sth = $dbh->prepare($query_lang);
$sth->execute() || $form->dberror($query_lang);
my @languages;
- while ($ref = $sth->fetchrow_hashref()) {
+ while (my $ref = $sth->fetchrow_hashref()) {
push(@languages, $ref);
}
$sth->finish();
}
$sth->execute($unit->{"name"}) || $form->dberror($query_lang . " (" . $unit->{"name"} . ")");
- while ($ref = $sth->fetchrow_hashref()) {
+ while (my $ref = $sth->fetchrow_hashref()) {
map({ $unit->{"LANGUAGES"}->{$ref->{"template_code"}}->{$_} = $ref->{$_} } keys(%{$ref}));
}
}
# else return 1
sub convert_unit {
$main::lxdebug->enter_sub(2);
- ($this, $a, $b, $all_units) = @_;
+ my ($this, $a, $b, $all_units) = @_;
$main::lxdebug->leave_sub(2) and return 0 unless $a && $b;
$main::lxdebug->leave_sub(2) and return 0 unless $all_units->{$a} && $all_units->{$b};
$main::lxdebug->leave_sub();
- return wantarray ? ($sum, $baseunit) : $sum;
+ return wantarray ? ($sum, $base_unit) : $sum;
}
sub add_unit {
FROM tax t
ORDER BY taxkey|;
- $sth = $dbh->prepare($query);
+ my $sth = $dbh->prepare($query);
$sth->execute || $form->dberror($query);
$form->{TAX} = [];
- while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
push @{ $form->{TAX} }, $ref;
}
ORDER BY accno
};
- $sth = $dbh->prepare($query);
+ my $sth = $dbh->prepare($query);
$sth->execute || $form->dberror($query);
$form->{ACCOUNTS} = [];
- while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
push @{ $form->{ACCOUNTS} }, $ref;
}
my $sth = $dbh->prepare($query);
$sth->execute($form->{id}) || $form->dberror($query . " ($form->{id})");
- my $ref = $sth->fetchrow_hashref(NAME_lc);
+ my $ref = $sth->fetchrow_hashref("NAME_lc");
map { $form->{$_} = $ref->{$_} } keys %$ref;
$sth->execute($form->{id}) || $form->dberror($query . " ($form->{id})");
$form->{TAXINUSE} = [];
- while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
push @{ $form->{TAXINUSE} }, $ref;
}
$main::lxdebug->enter_sub();
my ($self, $myconfig, $form) = @_;
+ my $query;
# connect to database
my $dbh = $form->get_standard_dbh($myconfig);
$main::lxdebug->enter_sub();
my ($self, $myconfig, $form) = @_;
+ my $query;
# connect to database
my $dbh = $form->get_standard_dbh($myconfig);