if ($form->{employee} =~ /--/) {
($form->{employee_id},$form->{employee_name}) = split(/--/,$form->{employee});
- $query .= " AND o.employee_id = ?";
- push @values, conv_i($form->{employee_id});
#if ($form->{employee_id}) {
$glwhere .= " AND g.employee_id = ? ";
$arwhere .= " AND a.employee_id = ? ";
CASE WHEN (COALESCE(e.name, '') = '') THEN e.login ELSE e.name END AS employee
$project_columns
$columns_for_sorting{gl}
- FROM gl g, acc_trans ac $project_join, chart c
+ FROM gl g
+ LEFT JOIN employee e ON (g.employee_id = e.id),
+ acc_trans ac $project_join, chart c
LEFT JOIN tax t ON (t.chart_id = c.id)
WHERE $glwhere
AND (ac.chart_id = c.id)
CASE WHEN (COALESCE(e.name, '') = '') THEN e.login ELSE e.name END AS employee
$project_columns
$columns_for_sorting{arap}
- FROM ar a, acc_trans ac $project_join, customer ct, chart c
+ FROM ar a
+ LEFT JOIN employee e ON (a.employee_id = e.id),
+ acc_trans ac $project_join, customer ct, chart c
LEFT JOIN tax t ON (t.chart_id=c.id)
WHERE $arwhere
AND (ac.chart_id = c.id)
CASE WHEN (COALESCE(e.name, '') = '') THEN e.login ELSE e.name END AS employee
$project_columns
$columns_for_sorting{arap}
- FROM ap a, acc_trans ac $project_join, vendor ct, chart c
+ FROM ap a
+ LEFT JOIN employee e ON (a.employee_id = e.id),
+ acc_trans ac $project_join, vendor ct, chart c
LEFT JOIN tax t ON (t.chart_id=c.id)
WHERE $apwhere
AND (ac.chart_id = c.id)
gldate transdate id reference description
notes source debit debit_accno
credit credit_accno debit_tax debit_tax_accno
- credit_tax credit_tax_accno projectnumbers balance
+ credit_tax credit_tax_accno projectnumbers balance employee
);
# add employee here, so that variable is still known and passed in url when choosing a different sort order in resulting table
$row->{balance}->{data} = $data;
$row->{projectnumbers}->{data} = join ", ", sort { lc($a) cmp lc($b) } keys %{ $ref->{projectnumbers} };
- map { $row->{$_}->{data} = $ref->{$_} } qw(id reference description notes);
+ map { $row->{$_}->{data} = $ref->{$_} } qw(id reference description notes gldate employee);
- map { $row->{$_}->{data} = \@{ $rows{$_} }; } qw(transdate gldate debit credit debit_accno credit_accno debit_tax_accno credit_tax_accno source);
+ map { $row->{$_}->{data} = \@{ $rows{$_} }; } qw(transdate debit credit debit_accno credit_accno debit_tax_accno credit_tax_accno source);
foreach my $col (qw(debit_accno credit_accno debit_tax_accno credit_tax_accno)) {
$row->{$col}->{link} = [ map { "${callback}&accno=" . E($_) } @{ $rows{$col} } ];