Revision 5c285a79
Von Sven Schöling vor etwa 15 Jahren hinzugefügt
SL/AM.pm | ||
---|---|---|
64 | 64 |
}; |
65 | 65 |
|
66 | 66 |
|
67 |
$main::lxdebug->message(LXDebug::QUERY, "\$query=\n $query");
|
|
67 |
$main::lxdebug->message(LXDebug->QUERY(), "\$query=\n $query");
|
|
68 | 68 |
my $sth = $dbh->prepare($query); |
69 | 69 |
$sth->execute($form->{id}) || $form->dberror($query . " ($form->{id})"); |
70 | 70 |
|
71 |
my $ref = $sth->fetchrow_hashref(NAME_lc);
|
|
71 |
my $ref = $sth->fetchrow_hashref("NAME_lc");
|
|
72 | 72 |
|
73 | 73 |
foreach my $key (keys %$ref) { |
74 | 74 |
$form->{"$key"} = $ref->{"$key"}; |
... | ... | |
79 | 79 |
# get default accounts |
80 | 80 |
$query = qq|SELECT inventory_accno_id, income_accno_id, expense_accno_id |
81 | 81 |
FROM defaults|; |
82 |
$main::lxdebug->message(LXDebug::QUERY, "\$query=\n $query");
|
|
82 |
$main::lxdebug->message(LXDebug->QUERY(), "\$query=\n $query");
|
|
83 | 83 |
$sth = $dbh->prepare($query); |
84 | 84 |
$sth->execute || $form->dberror($query); |
85 | 85 |
|
86 |
$ref = $sth->fetchrow_hashref(NAME_lc);
|
|
86 |
$ref = $sth->fetchrow_hashref("NAME_lc");
|
|
87 | 87 |
|
88 |
map { $form->{$_} = $ref->{$_} } keys %ref;
|
|
88 |
map { $form->{$_} = $ref->{$_} } keys %{ $ref };
|
|
89 | 89 |
|
90 | 90 |
$sth->finish; |
91 | 91 |
|
... | ... | |
102 | 102 |
rate |
103 | 103 |
FROM tax ORDER BY taxkey |
104 | 104 |
}; |
105 |
$main::lxdebug->message(LXDebug::QUERY, "\$query=\n $query");
|
|
105 |
$main::lxdebug->message(LXDebug->QUERY(), "\$query=\n $query");
|
|
106 | 106 |
$sth = $dbh->prepare($query); |
107 | 107 |
$sth->execute || $form->dberror($query); |
108 | 108 |
|
109 | 109 |
$form->{TAXKEY} = []; |
110 | 110 |
|
111 |
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
|
|
111 |
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
|
|
112 | 112 |
push @{ $form->{TAXKEY} }, $ref; |
113 | 113 |
} |
114 | 114 |
|
... | ... | |
119 | 119 |
FROM chart |
120 | 120 |
WHERE link = ? |
121 | 121 |
ORDER BY accno|; |
122 |
$main::lxdebug->message(LXDebug::QUERY, "\$query=\n $query");
|
|
122 |
$main::lxdebug->message(LXDebug->QUERY(), "\$query=\n $query");
|
|
123 | 123 |
$sth = $dbh->prepare($query); |
124 | 124 |
$sth->execute($form->{link}) || $form->dberror($query . " ($form->{link})"); |
125 | 125 |
|
126 | 126 |
$form->{NEWACCOUNT} = []; |
127 |
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
|
|
127 |
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
|
|
128 | 128 |
push @{ $form->{NEWACCOUNT} }, $ref; |
129 | 129 |
} |
130 | 130 |
|
... | ... | |
150 | 150 |
WHERE tk.chart_id = ? |
151 | 151 |
ORDER BY startdate DESC |
152 | 152 |
}; |
153 |
$main::lxdebug->message(LXDebug::QUERY, "\$query=\n $query");
|
|
153 |
$main::lxdebug->message(LXDebug->QUERY(), "\$query=\n $query");
|
|
154 | 154 |
$sth = $dbh->prepare($query); |
155 | 155 |
|
156 | 156 |
$sth->execute($form->{id}) || $form->dberror($query . " ($form->{id})"); |
157 | 157 |
|
158 | 158 |
$form->{ACCOUNT_TAXKEYS} = []; |
159 | 159 |
|
160 |
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
|
|
160 |
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
|
|
161 | 161 |
push @{ $form->{ACCOUNT_TAXKEYS} }, $ref; |
162 | 162 |
} |
163 | 163 |
|
... | ... | |
167 | 167 |
# check if we have any transactions |
168 | 168 |
$query = qq|SELECT a.trans_id FROM acc_trans a |
169 | 169 |
WHERE a.chart_id = ?|; |
170 |
$main::lxdebug->message(LXDebug::QUERY, "\$query=\n $query");
|
|
170 |
$main::lxdebug->message(LXDebug->QUERY(), "\$query=\n $query");
|
|
171 | 171 |
$sth = $dbh->prepare($query); |
172 | 172 |
$sth->execute($form->{id}) || $form->dberror($query . " ($form->{id})"); |
173 | 173 |
|
... | ... | |
180 | 180 |
if ($form->{new_chart_id}) { |
181 | 181 |
$query = qq|SELECT current_date-valid_from FROM chart |
182 | 182 |
WHERE id = ?|; |
183 |
$main::lxdebug->message(LXDebug::QUERY, "\$query=\n $query");
|
|
183 |
$main::lxdebug->message(LXDebug->QUERY(), "\$query=\n $query");
|
|
184 | 184 |
my ($count) = selectrow_query($form, $dbh, $query, $form->{id}); |
185 | 185 |
if ($count >=0) { |
186 | 186 |
$form->{new_chart_valid} = 1; |
... | ... | |
448 | 448 |
FROM department d |
449 | 449 |
ORDER BY 2|; |
450 | 450 |
|
451 |
$sth = $dbh->prepare($query); |
|
451 |
my $sth = $dbh->prepare($query);
|
|
452 | 452 |
$sth->execute || $form->dberror($query); |
453 | 453 |
|
454 | 454 |
$form->{ALL} = []; |
455 |
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
|
|
455 |
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
|
|
456 | 456 |
push @{ $form->{ALL} }, $ref; |
457 | 457 |
} |
458 | 458 |
|
... | ... | |
476 | 476 |
my $sth = $dbh->prepare($query); |
477 | 477 |
$sth->execute($form->{id}) || $form->dberror($query . " ($form->{id})"); |
478 | 478 |
|
479 |
my $ref = $sth->fetchrow_hashref(NAME_lc);
|
|
479 |
my $ref = $sth->fetchrow_hashref("NAME_lc");
|
|
480 | 480 |
|
481 | 481 |
map { $form->{$_} = $ref->{$_} } keys %$ref; |
482 | 482 |
|
... | ... | |
499 | 499 |
$main::lxdebug->enter_sub(); |
500 | 500 |
|
501 | 501 |
my ($self, $myconfig, $form) = @_; |
502 |
my ($query); |
|
502 | 503 |
|
503 | 504 |
# connect to database |
504 | 505 |
my $dbh = $form->dbconnect($myconfig); |
... | ... | |
525 | 526 |
$main::lxdebug->enter_sub(); |
526 | 527 |
|
527 | 528 |
my ($self, $myconfig, $form) = @_; |
529 |
my ($query); |
|
528 | 530 |
|
529 | 531 |
# connect to database |
530 | 532 |
my $dbh = $form->dbconnect($myconfig); |
... | ... | |
550 | 552 |
FROM leads |
551 | 553 |
ORDER BY 2|; |
552 | 554 |
|
553 |
$sth = $dbh->prepare($query); |
|
555 |
my $sth = $dbh->prepare($query);
|
|
554 | 556 |
$sth->execute || $form->dberror($query); |
555 | 557 |
|
556 |
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
|
|
558 |
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
|
|
557 | 559 |
push @{ $form->{ALL} }, $ref; |
558 | 560 |
} |
559 | 561 |
|
... | ... | |
578 | 580 |
my $sth = $dbh->prepare($query); |
579 | 581 |
$sth->execute($form->{id}) || $form->dberror($query . " ($form->{id})"); |
580 | 582 |
|
581 |
my $ref = $sth->fetchrow_hashref(NAME_lc);
|
|
583 |
my $ref = $sth->fetchrow_hashref("NAME_lc");
|
|
582 | 584 |
|
583 | 585 |
map { $form->{$_} = $ref->{$_} } keys %$ref; |
584 | 586 |
|
... | ... | |
593 | 595 |
$main::lxdebug->enter_sub(); |
594 | 596 |
|
595 | 597 |
my ($self, $myconfig, $form) = @_; |
598 |
my ($query); |
|
596 | 599 |
|
597 | 600 |
# connect to database |
598 | 601 |
my $dbh = $form->dbconnect($myconfig); |
... | ... | |
620 | 623 |
$main::lxdebug->enter_sub(); |
621 | 624 |
|
622 | 625 |
my ($self, $myconfig, $form) = @_; |
626 |
my ($query); |
|
623 | 627 |
|
624 | 628 |
# connect to database |
625 | 629 |
my $dbh = $form->dbconnect($myconfig); |
... | ... | |
645 | 649 |
FROM business |
646 | 650 |
ORDER BY 2|; |
647 | 651 |
|
648 |
$sth = $dbh->prepare($query); |
|
652 |
my $sth = $dbh->prepare($query);
|
|
649 | 653 |
$sth->execute || $form->dberror($query); |
650 | 654 |
|
651 |
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
|
|
655 |
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
|
|
652 | 656 |
push @{ $form->{ALL} }, $ref; |
653 | 657 |
} |
654 | 658 |
|
... | ... | |
673 | 677 |
my $sth = $dbh->prepare($query); |
674 | 678 |
$sth->execute($form->{id}) || $form->dberror($query . " ($form->{id})"); |
675 | 679 |
|
676 |
my $ref = $sth->fetchrow_hashref(NAME_lc);
|
|
680 |
my $ref = $sth->fetchrow_hashref("NAME_lc");
|
|
677 | 681 |
|
678 | 682 |
map { $form->{$_} = $ref->{$_} } keys %$ref; |
679 | 683 |
|
... | ... | |
688 | 692 |
$main::lxdebug->enter_sub(); |
689 | 693 |
|
690 | 694 |
my ($self, $myconfig, $form) = @_; |
695 |
my ($query); |
|
691 | 696 |
|
692 | 697 |
# connect to database |
693 | 698 |
my $dbh = $form->dbconnect($myconfig); |
... | ... | |
722 | 727 |
# connect to database |
723 | 728 |
my $dbh = $form->dbconnect($myconfig); |
724 | 729 |
|
725 |
$query = qq|DELETE FROM business |
|
730 |
my $query = qq|DELETE FROM business
|
|
726 | 731 |
WHERE id = ?|; |
727 | 732 |
do_query($form, $dbh, $query, $form->{id}); |
728 | 733 |
|
... | ... | |
745 | 750 |
" output_numberformat, output_dateformat, output_longdates " . |
746 | 751 |
"FROM language ORDER BY description"; |
747 | 752 |
|
748 |
$sth = $dbh->prepare($query); |
|
753 |
my $sth = $dbh->prepare($query);
|
|
749 | 754 |
$sth->execute || $form->dberror($query); |
750 | 755 |
|
751 | 756 |
my $ary = []; |
752 | 757 |
|
753 |
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
|
|
758 |
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
|
|
754 | 759 |
push(@{ $ary }, $ref); |
755 | 760 |
} |
756 | 761 |
|
... | ... | |
781 | 786 |
my $sth = $dbh->prepare($query); |
782 | 787 |
$sth->execute($form->{"id"}) || $form->dberror($query . " ($form->{id})"); |
783 | 788 |
|
784 |
my $ref = $sth->fetchrow_hashref(NAME_lc);
|
|
789 |
my $ref = $sth->fetchrow_hashref("NAME_lc");
|
|
785 | 790 |
|
786 | 791 |
map { $form->{$_} = $ref->{$_} } keys %$ref; |
787 | 792 |
|
... | ... | |
852 | 857 |
$main::lxdebug->enter_sub(); |
853 | 858 |
|
854 | 859 |
my ($self, $myconfig, $form) = @_; |
860 |
my $query; |
|
855 | 861 |
|
856 | 862 |
# connect to database |
857 | 863 |
my $dbh = $form->dbconnect_noauto($myconfig); |
858 | 864 |
|
859 | 865 |
foreach my $table (qw(translation_payment_terms units_language)) { |
860 |
my $query = qq|DELETE FROM $table WHERE language_id = ?|;
|
|
866 |
$query = qq|DELETE FROM $table WHERE language_id = ?|; |
|
861 | 867 |
do_query($form, $dbh, $query, $form->{"id"}); |
862 | 868 |
} |
863 | 869 |
|
... | ... | |
901 | 907 |
FROM buchungsgruppen |
902 | 908 |
ORDER BY sortkey|; |
903 | 909 |
|
904 |
$sth = $dbh->prepare($query); |
|
910 |
my $sth = $dbh->prepare($query);
|
|
905 | 911 |
$sth->execute || $form->dberror($query); |
906 | 912 |
|
907 | 913 |
$form->{ALL} = []; |
908 |
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
|
|
914 |
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
|
|
909 | 915 |
push @{ $form->{ALL} }, $ref; |
910 | 916 |
} |
911 | 917 |
|
... | ... | |
949 | 955 |
my $sth = $dbh->prepare($query); |
950 | 956 |
$sth->execute($form->{id}) || $form->dberror($query . " ($form->{id})"); |
951 | 957 |
|
952 |
my $ref = $sth->fetchrow_hashref(NAME_lc);
|
|
958 |
my $ref = $sth->fetchrow_hashref("NAME_lc");
|
|
953 | 959 |
|
954 | 960 |
map { $form->{$_} = $ref->{$_} } keys %$ref; |
955 | 961 |
|
... | ... | |
977 | 983 |
|
978 | 984 |
my $sth = $dbh->prepare($query); |
979 | 985 |
$sth->execute || $form->dberror($query); |
980 |
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
|
|
986 |
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
|
|
981 | 987 |
foreach my $key (split(/:/, $ref->{link})) { |
982 | 988 |
if (!$form->{"std_inventory_accno_id"} && ($key eq "IC")) { |
983 | 989 |
$form->{"std_inventory_accno_id"} = $ref->{"id"}; |
... | ... | |
1064 | 1070 |
# connect to database |
1065 | 1071 |
my $dbh = $form->dbconnect($myconfig); |
1066 | 1072 |
|
1067 |
$query = qq|DELETE FROM buchungsgruppen WHERE id = ?|; |
|
1073 |
my $query = qq|DELETE FROM buchungsgruppen WHERE id = ?|;
|
|
1068 | 1074 |
do_query($form, $dbh, $query, $form->{id}); |
1069 | 1075 |
|
1070 | 1076 |
$dbh->disconnect; |
... | ... | |
1112 | 1118 |
FROM printers |
1113 | 1119 |
ORDER BY 2|; |
1114 | 1120 |
|
1115 |
$sth = $dbh->prepare($query); |
|
1121 |
my $sth = $dbh->prepare($query);
|
|
1116 | 1122 |
$sth->execute || $form->dberror($query); |
1117 | 1123 |
|
1118 | 1124 |
$form->{"ALL"} = []; |
1119 |
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
|
|
1125 |
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
|
|
1120 | 1126 |
push @{ $form->{ALL} }, $ref; |
1121 | 1127 |
} |
1122 | 1128 |
|
... | ... | |
1141 | 1147 |
my $sth = $dbh->prepare($query); |
1142 | 1148 |
$sth->execute($form->{id}) || $form->dberror($query . " ($form->{id})"); |
1143 | 1149 |
|
1144 |
my $ref = $sth->fetchrow_hashref(NAME_lc);
|
|
1150 |
my $ref = $sth->fetchrow_hashref("NAME_lc");
|
|
1145 | 1151 |
|
1146 | 1152 |
map { $form->{$_} = $ref->{$_} } keys %$ref; |
1147 | 1153 |
|
... | ... | |
1156 | 1162 |
$main::lxdebug->enter_sub(); |
1157 | 1163 |
|
1158 | 1164 |
my ($self, $myconfig, $form) = @_; |
1165 |
my $query; |
|
1159 | 1166 |
|
1160 | 1167 |
# connect to database |
1161 | 1168 |
my $dbh = $form->dbconnect($myconfig); |
... | ... | |
1190 | 1197 |
# connect to database |
1191 | 1198 |
my $dbh = $form->dbconnect($myconfig); |
1192 | 1199 |
|
1193 |
$query = qq|DELETE FROM printers |
|
1200 |
my $query = qq|DELETE FROM printers
|
|
1194 | 1201 |
WHERE id = ?|; |
1195 | 1202 |
do_query($form, $dbh, $query, $form->{id}); |
1196 | 1203 |
|
... | ... | |
1209 | 1216 |
|
1210 | 1217 |
my $query = qq|SELECT * FROM payment_terms ORDER BY sortkey|; |
1211 | 1218 |
|
1212 |
$sth = $dbh->prepare($query); |
|
1219 |
my $sth = $dbh->prepare($query);
|
|
1213 | 1220 |
$sth->execute || $form->dberror($query); |
1214 | 1221 |
|
1215 | 1222 |
$form->{ALL} = []; |
1216 |
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
|
|
1223 |
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
|
|
1217 | 1224 |
push @{ $form->{ALL} }, $ref; |
1218 | 1225 |
} |
1219 | 1226 |
|
... | ... | |
1235 | 1242 |
my $sth = $dbh->prepare($query); |
1236 | 1243 |
$sth->execute($form->{"id"}) || $form->dberror($query . " ($form->{id})"); |
1237 | 1244 |
|
1238 |
my $ref = $sth->fetchrow_hashref(NAME_lc);
|
|
1245 |
my $ref = $sth->fetchrow_hashref("NAME_lc");
|
|
1239 | 1246 |
map { $form->{$_} = $ref->{$_} } keys %$ref; |
1240 | 1247 |
$sth->finish(); |
1241 | 1248 |
|
... | ... | |
1252 | 1259 |
$sth->execute($form->{"id"}) || $form->dberror($query . " ($form->{id})"); |
1253 | 1260 |
|
1254 | 1261 |
my %mapping; |
1255 |
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
|
|
1262 |
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
|
|
1256 | 1263 |
$mapping{ $ref->{"language_id"} } = $ref |
1257 | 1264 |
unless (defined($mapping{ $ref->{"language_id"} })); |
1258 | 1265 |
} |
... | ... | |
1521 | 1528 |
$myconfig->{$item} = $form->{$item}; |
1522 | 1529 |
} |
1523 | 1530 |
|
1524 |
$myconfig->save_member($memberfile); |
|
1531 |
$myconfig->save_member($main::memberfile);
|
|
1525 | 1532 |
|
1526 | 1533 |
my $auth = $main::auth; |
1527 | 1534 |
|
... | ... | |
1536 | 1543 |
} |
1537 | 1544 |
|
1538 | 1545 |
if ($webdav) { |
1539 |
@webdavdirs = |
|
1546 |
my @webdavdirs =
|
|
1540 | 1547 |
qw(angebote bestellungen rechnungen anfragen lieferantenbestellungen einkaufsrechnungen); |
1541 |
foreach $directory (@webdavdirs) { |
|
1542 |
$file = "webdav/" . $directory . "/webdav-user"; |
|
1548 |
foreach my $directory (@webdavdirs) { |
|
1549 |
my $file = "webdav/" . $directory . "/webdav-user"; |
|
1550 |
my $newfile; |
|
1543 | 1551 |
if ($myconfig->{$directory}) { |
1544 | 1552 |
open(HTACCESS, "$file") or die "cannot open webdav-user $!\n"; |
1545 | 1553 |
while (<HTACCESS>) { |
1546 |
($login, $password) = split(/:/, $_); |
|
1554 |
my ($login, $password) = split(/:/, $_);
|
|
1547 | 1555 |
if ($login ne $form->{login}) { |
1548 | 1556 |
$newfile .= $_; |
1549 | 1557 |
} |
... | ... | |
1557 | 1565 |
$form->{$directory} = 0; |
1558 | 1566 |
open(HTACCESS, "$file") or die "cannot open webdav-user $!\n"; |
1559 | 1567 |
while (<HTACCESS>) { |
1560 |
($login, $password) = split(/:/, $_); |
|
1568 |
my ($login, $password) = split(/:/, $_);
|
|
1561 | 1569 |
if ($login ne $form->{login}) { |
1562 | 1570 |
$newfile .= $_; |
1563 | 1571 |
} |
... | ... | |
1608 | 1616 |
my $sth = $dbh->prepare($query); |
1609 | 1617 |
$sth->execute || $form->dberror($query); |
1610 | 1618 |
|
1611 |
$form->{defaults} = $sth->fetchrow_hashref(NAME_lc);
|
|
1619 |
$form->{defaults} = $sth->fetchrow_hashref("NAME_lc");
|
|
1612 | 1620 |
$form->{defaults}{IC} = $form->{defaults}{inventory_accno_id}; |
1613 | 1621 |
$form->{defaults}{IC_income} = $form->{defaults}{income_accno_id}; |
1614 | 1622 |
$form->{defaults}{IC_expense} = $form->{defaults}{expense_accno_id}; |
... | ... | |
1626 | 1634 |
$sth = $dbh->prepare($query); |
1627 | 1635 |
$sth->execute || $self->dberror($query); |
1628 | 1636 |
|
1629 |
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
|
|
1637 |
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
|
|
1630 | 1638 |
foreach my $key (split(/:/, $ref->{link})) { |
1631 | 1639 |
if ($key =~ /IC/) { |
1632 |
$nkey = $key; |
|
1640 |
my $nkey = $key;
|
|
1633 | 1641 |
if ($key =~ /cogs/) { |
1634 | 1642 |
$nkey = "IC_expense"; |
1635 | 1643 |
} |
... | ... | |
1653 | 1661 |
$sth = $dbh->prepare($query); |
1654 | 1662 |
$sth->execute || $self->dberror($query); |
1655 | 1663 |
|
1656 |
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
|
|
1664 |
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
|
|
1657 | 1665 |
%{ $form->{IC}{FX_gain}{ $ref->{accno} } } = ( |
1658 | 1666 |
id => $ref->{id}, |
1659 | 1667 |
description => $ref->{description} |
... | ... | |
1669 | 1677 |
$sth = $dbh->prepare($query); |
1670 | 1678 |
$sth->execute || $self->dberror($query); |
1671 | 1679 |
|
1672 |
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
|
|
1680 |
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
|
|
1673 | 1681 |
%{ $form->{IC}{FX_loss}{ $ref->{accno} } } = ( |
1674 | 1682 |
id => $ref->{id}, |
1675 | 1683 |
description => $ref->{description} |
... | ... | |
1686 | 1694 |
$sth = $dbh->prepare($query); |
1687 | 1695 |
$sth->execute || $form->dberror($query); |
1688 | 1696 |
|
1689 |
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
|
|
1697 |
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
|
|
1690 | 1698 |
$form->{taxrates}{ $ref->{accno} }{id} = $ref->{id}; |
1691 | 1699 |
$form->{taxrates}{ $ref->{accno} }{description} = $ref->{description}; |
1692 | 1700 |
$form->{taxrates}{ $ref->{accno} }{taxnumber} = $ref->{taxnumber} |
... | ... | |
1784 | 1792 |
$sth = $dbh->prepare($query_lang); |
1785 | 1793 |
$sth->execute() || $form->dberror($query_lang); |
1786 | 1794 |
my @languages; |
1787 |
while ($ref = $sth->fetchrow_hashref()) { |
|
1795 |
while (my $ref = $sth->fetchrow_hashref()) {
|
|
1788 | 1796 |
push(@languages, $ref); |
1789 | 1797 |
} |
1790 | 1798 |
$sth->finish(); |
... | ... | |
1804 | 1812 |
} |
1805 | 1813 |
|
1806 | 1814 |
$sth->execute($unit->{"name"}) || $form->dberror($query_lang . " (" . $unit->{"name"} . ")"); |
1807 |
while ($ref = $sth->fetchrow_hashref()) { |
|
1815 |
while (my $ref = $sth->fetchrow_hashref()) {
|
|
1808 | 1816 |
map({ $unit->{"LANGUAGES"}->{$ref->{"template_code"}}->{$_} = $ref->{$_} } keys(%{$ref})); |
1809 | 1817 |
} |
1810 | 1818 |
} |
... | ... | |
1933 | 1941 |
# else return 1 |
1934 | 1942 |
sub convert_unit { |
1935 | 1943 |
$main::lxdebug->enter_sub(2); |
1936 |
($this, $a, $b, $all_units) = @_; |
|
1944 |
my ($this, $a, $b, $all_units) = @_;
|
|
1937 | 1945 |
|
1938 | 1946 |
$main::lxdebug->leave_sub(2) and return 0 unless $a && $b; |
1939 | 1947 |
$main::lxdebug->leave_sub(2) and return 0 unless $all_units->{$a} && $all_units->{$b}; |
... | ... | |
2016 | 2024 |
|
2017 | 2025 |
$main::lxdebug->leave_sub(); |
2018 | 2026 |
|
2019 |
return wantarray ? ($sum, $baseunit) : $sum; |
|
2027 |
return wantarray ? ($sum, $base_unit) : $sum;
|
|
2020 | 2028 |
} |
2021 | 2029 |
|
2022 | 2030 |
sub add_unit { |
... | ... | |
2162 | 2170 |
FROM tax t |
2163 | 2171 |
ORDER BY taxkey|; |
2164 | 2172 |
|
2165 |
$sth = $dbh->prepare($query); |
|
2173 |
my $sth = $dbh->prepare($query);
|
|
2166 | 2174 |
$sth->execute || $form->dberror($query); |
2167 | 2175 |
|
2168 | 2176 |
$form->{TAX} = []; |
2169 |
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
|
|
2177 |
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
|
|
2170 | 2178 |
push @{ $form->{TAX} }, $ref; |
2171 | 2179 |
} |
2172 | 2180 |
|
... | ... | |
2192 | 2200 |
ORDER BY accno |
2193 | 2201 |
}; |
2194 | 2202 |
|
2195 |
$sth = $dbh->prepare($query); |
|
2203 |
my $sth = $dbh->prepare($query);
|
|
2196 | 2204 |
$sth->execute || $form->dberror($query); |
2197 | 2205 |
|
2198 | 2206 |
$form->{ACCOUNTS} = []; |
2199 |
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
|
|
2207 |
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
|
|
2200 | 2208 |
push @{ $form->{ACCOUNTS} }, $ref; |
2201 | 2209 |
} |
2202 | 2210 |
|
... | ... | |
2226 | 2234 |
my $sth = $dbh->prepare($query); |
2227 | 2235 |
$sth->execute($form->{id}) || $form->dberror($query . " ($form->{id})"); |
2228 | 2236 |
|
2229 |
my $ref = $sth->fetchrow_hashref(NAME_lc);
|
|
2237 |
my $ref = $sth->fetchrow_hashref("NAME_lc");
|
|
2230 | 2238 |
|
2231 | 2239 |
map { $form->{$_} = $ref->{$_} } keys %$ref; |
2232 | 2240 |
|
... | ... | |
2252 | 2260 |
$sth->execute($form->{id}) || $form->dberror($query . " ($form->{id})"); |
2253 | 2261 |
|
2254 | 2262 |
$form->{TAXINUSE} = []; |
2255 |
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
|
|
2263 |
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
|
|
2256 | 2264 |
push @{ $form->{TAXINUSE} }, $ref; |
2257 | 2265 |
} |
2258 | 2266 |
|
... | ... | |
2268 | 2276 |
$main::lxdebug->enter_sub(); |
2269 | 2277 |
|
2270 | 2278 |
my ($self, $myconfig, $form) = @_; |
2279 |
my $query; |
|
2271 | 2280 |
|
2272 | 2281 |
# connect to database |
2273 | 2282 |
my $dbh = $form->get_standard_dbh($myconfig); |
... | ... | |
2307 | 2316 |
$main::lxdebug->enter_sub(); |
2308 | 2317 |
|
2309 | 2318 |
my ($self, $myconfig, $form) = @_; |
2319 |
my $query; |
|
2310 | 2320 |
|
2311 | 2321 |
# connect to database |
2312 | 2322 |
my $dbh = $form->get_standard_dbh($myconfig); |
Auch abrufbar als: Unified diff
strictness.