while (my ($accno, $description) = $sth->fetchrow_array) {
$gifi{$accno} = $description;
}
while (my ($accno, $description) = $sth->fetchrow_array) {
$gifi{$accno} = $description;
}
if ($form->{todate}) {
$fromto .= " AND ac.transdate <= '$form->{todate}'";
$subwhere .= " AND transdate <= '$form->{todate}'";
if ($form->{todate}) {
$fromto .= " AND ac.transdate <= '$form->{todate}'";
$subwhere .= " AND transdate <= '$form->{todate}'";
- if ($form->{eur}) {
- $AR_PAID = qq|AND ac.trans_id IN
- (
- SELECT trans_id
- FROM acc_trans
- JOIN chart ON (chart_id = id)
- WHERE link LIKE '%AR_paid%'
- $subwhere
- )|;
- $AP_PAID = qq|AND ac.trans_id IN
- (
- SELECT trans_id
- FROM acc_trans
- JOIN chart ON (chart_id = id)
- WHERE link LIKE '%AP_paid%'
- $subwhere
- )|;
- } else {
- $where .= $fromto;
- $AR_PAID = "";
- $AP_PAID = "";
- $glwhere = ""; # note! gl will be aliased as "a" later...
- }
+
+ $where .= $fromto;
+ $AR_PAID = "";
+ $AP_PAID = "";
+ $glwhere = ""; # note! gl will be aliased as "a" later...
my $sortorder = join ', ',
$form->sort_columns(qw(transdate reference description));
my $false = ($myconfig->{dbdriver} eq 'Pg') ? FALSE: q|'0'|;
my $sortorder = join ', ',
$form->sort_columns(qw(transdate reference description));
my $false = ($myconfig->{dbdriver} eq 'Pg') ? FALSE: q|'0'|;
- # NOTE:
- # Postgres is really picky about the order of implicit CROSS JOINs with ','
- # if you alias the tables and want to use the alias later in another JOIN.
- # the alias you want to use has to be the most recent in the list, otherwise
- # Postgres will overwrite the alias internally and complain.
- # For this reason, in the next 3 SELECTs, the 'a' alias is last in the list.
- # Don't change this, and if you do, substitute the ',' with CROSS JOIN
- # ... that also works.
+ # NOTE:
+ # Postgres is really picky about the order of implicit CROSS JOINs with ','
+ # if you alias the tables and want to use the alias later in another JOIN.
+ # the alias you want to use has to be the most recent in the list, otherwise
+ # Postgres will overwrite the alias internally and complain.
+ # For this reason, in the next 3 SELECTs, the 'a' alias is last in the list.
+ # Don't change this, and if you do, substitute the ',' with CROSS JOIN
+ # ... that also works.