Revision fbe66f59
Von Udo Spallek vor fast 18 Jahren hinzugefügt
SL/Form.pm | ||
---|---|---|
1960 | 1960 |
ORDER BY c.accno|; |
1961 | 1961 |
|
1962 | 1962 |
$sth = $dbh->prepare($query); |
1963 |
$sth->execute || $self->dberror($query); |
|
1964 |
|
|
1963 |
|
|
1964 |
do_statement($form, $sth, $query); |
|
1965 |
|
|
1965 | 1966 |
$self->{accounts} = ""; |
1966 | 1967 |
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) { |
1967 | 1968 |
|
... | ... | |
2012 | 2013 |
LEFT JOIN department d ON (d.id = a.department_id) |
2013 | 2014 |
WHERE a.id = $self->{id}|; |
2014 | 2015 |
$sth = $dbh->prepare($query); |
2015 |
$sth->execute || $self->dberror($query);
|
|
2016 |
do_statement($form, $sth, $query);
|
|
2016 | 2017 |
|
2017 | 2018 |
$ref = $sth->fetchrow_hashref(NAME_lc); |
2018 | 2019 |
foreach $key (keys %$ref) { |
... | ... | |
2027 | 2028 |
} |
2028 | 2029 |
|
2029 | 2030 |
# now get the account numbers |
2030 |
$query = qq|SELECT c.accno, c.description, c.link, c.taxkey_id, tk.tax_id |
|
2031 |
FROM chart c, taxkeys tk |
|
2032 |
WHERE c.link LIKE '%$module%' AND (((tk.chart_id=c.id) AND NOT(c.link like '%_tax%')) OR (NOT(tk.chart_id=c.id) AND (c.link like '%_tax%'))) AND (((tk.id = (SELECT id from taxkeys where taxkeys.chart_id =c.id AND startdate<=$transdate ORDER BY startdate desc LIMIT 1)) AND NOT(c.link like '%_tax%')) OR (c.link like '%_tax%')) |
|
2033 |
ORDER BY c.accno|; |
|
2034 |
|
|
2031 |
$query = qq| |
|
2032 |
SELECT |
|
2033 |
c.accno, |
|
2034 |
c.description, |
|
2035 |
c.link, |
|
2036 |
c.taxkey_id, |
|
2037 |
tk.tax_id |
|
2038 |
FROM chart c |
|
2039 |
LEFT JOIN taxkeys tk ON (tk.chart_id = c.id) |
|
2040 |
WHERE |
|
2041 |
c.link LIKE ? |
|
2042 |
AND |
|
2043 |
(tk.chart_id = c.id AND NOT c.link like '%_tax%') |
|
2044 |
OR (NOT tk.chart_id = c.id AND c.link like '%_tax%') |
|
2045 |
AND |
|
2046 |
tk.id = ( SELECT id from taxkeys |
|
2047 |
WHERE taxkeys.chart_id = c.id |
|
2048 |
AND startdate <= ? |
|
2049 |
ORDER BY startdate desc LIMIT 1 |
|
2050 |
) |
|
2051 |
ORDER BY c.accno|; |
|
2052 |
|
|
2035 | 2053 |
$sth = $dbh->prepare($query); |
2036 |
$sth->execute || $self->dberror($query);
|
|
2054 |
do_statement($form, $sth, $query, "%$module%", $transdate);
|
|
2037 | 2055 |
|
2038 | 2056 |
$self->{accounts} = ""; |
2039 | 2057 |
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) { |
... | ... | |
2067 | 2085 |
AND a.fx_transaction = '0' |
2068 | 2086 |
ORDER BY a.oid,a.transdate|; |
2069 | 2087 |
$sth = $dbh->prepare($query); |
2070 |
$sth->execute || $self->dberror($query);
|
|
2088 |
do_statement($form, $sth, $query);
|
|
2071 | 2089 |
|
2072 | 2090 |
my $fld = ($table eq 'customer') ? 'buy' : 'sell'; |
2073 | 2091 |
|
... | ... | |
2101 | 2119 |
WHERE d.fxloss_accno_id = c.id) AS fxloss_accno |
2102 | 2120 |
FROM defaults d|; |
2103 | 2121 |
$sth = $dbh->prepare($query); |
2104 |
$sth->execute || $self->dberror($query);
|
|
2122 |
do_statement($form, $sth, $query);
|
|
2105 | 2123 |
|
2106 | 2124 |
$ref = $sth->fetchrow_hashref(NAME_lc); |
2107 | 2125 |
map { $self->{$_} = $ref->{$_} } keys %$ref; |
... | ... | |
2118 | 2136 |
WHERE d.fxloss_accno_id = c.id) AS fxloss_accno |
2119 | 2137 |
FROM defaults d|; |
2120 | 2138 |
$sth = $dbh->prepare($query); |
2121 |
$sth->execute || $self->dberror($query);
|
|
2139 |
do_statement($form, $sth, $query);
|
|
2122 | 2140 |
|
2123 | 2141 |
$ref = $sth->fetchrow_hashref(NAME_lc); |
2124 | 2142 |
map { $self->{$_} = $ref->{$_} } keys %$ref; |
Auch abrufbar als: Unified diff
Betr. Frontendfunktionen ar, ap, ir, is Zahlungskonto.
Die Abfrage von $form->create_links verbessert (vor Inf. Regress geschützt) und aufgeräumt.
Vereinheitlichung: Umstellung der Datenbankanfragen auf SL::DBUtils.