}
my %sort_columns = (
- 'id' => [ qw(id) ],
- 'transdate' => [ qw(transdate id) ],
- 'gldate' => [ qw(gldate id) ],
- 'reference' => [ qw(lower_reference id) ],
- 'description' => [ qw(lower_description id) ],
- 'accno' => [ qw(accno transdate id) ],
- 'department' => [ qw(department transdate id) ],
+ 'id' => [ qw(id) ],
+ 'transdate' => [ qw(transdate id) ],
+ 'gldate' => [ qw(gldate id) ],
+ 'reference' => [ qw(lower_reference id) ],
+ 'description' => [ qw(lower_description id) ],
+ 'accno' => [ qw(accno transdate id) ],
+ 'department' => [ qw(department transdate id) ],
'transaction_description' => [ qw(lower_transaction_description id) ],
);
my %lowered_columns = (
- 'reference' => { 'gl' => 'g.reference', 'arap' => 'a.invnumber', },
- 'source' => { 'gl' => 'ac.source', 'arap' => 'ac.source', },
- 'description' => { 'gl' => 'g.description', 'arap' => 'ct.name', },
- 'transaction_description' => { 'gl' => 'g.transaction_description', 'arap' => 'a.transaction_description', },
+ 'reference' => { 'gl' => 'g.reference', 'arap' => 'a.invnumber', },
+ 'source' => { 'gl' => 'ac.source', 'arap' => 'ac.source', },
+ 'description' => { 'gl' => 'g.description', 'arap' => 'ct.name', },
+ 'transaction_description' => { 'gl' => 'g.transaction_description', 'arap' => 'a.transaction_description', },
);
# sortdir = sort direction (ascending or descending)
g.storno, g.storno_id,
g.department_id, d.description AS department,
e.name AS employee, g.taxincluded, g.gldate,
- g.ob_transaction, g.cb_transaction,
- g.transaction_description
+ g.ob_transaction, g.cb_transaction,
+ g.transaction_description
FROM gl g
LEFT JOIN department d ON (d.id = g.department_id)
LEFT JOIN employee e ON (e.id = g.employee_id)
my $ml = ($form->{ml} =~ /(A|E|Q)/) ? -1 : 1;
my @columns = qw(
- transdate gldate id reference description
- notes transaction_description source doccnt debit debit_accno
- credit credit_accno debit_tax debit_tax_accno
- credit_tax credit_tax_accno balance projectnumbers
- department employee
+ transdate gldate id reference
+ description notes transaction_description source
+ doccnt debit debit_accno
+ credit credit_accno debit_tax debit_tax_accno
+ credit_tax credit_tax_accno balance projectnumbers
+ department employee
);
# add employee here, so that variable is still known and passed in url when choosing a different sort order in resulting table
my $employee = $form->{employee_id} ? SL::DB::Employee->new(id => $form->{employee_id})->load->name : '';
my (@options, @date_options);
- push @options, $locale->text('Account') . " : $form->{accno} $form->{account_description}" if ($form->{accno});
- push @options, $locale->text('Source') . " : $form->{source}" if ($form->{source});
- push @options, $locale->text('Reference') . " : $form->{reference}" if ($form->{reference});
- push @options, $locale->text('Description') . " : $form->{description}" if ($form->{description});
- push @options, $locale->text('Notes') . " : $form->{notes}" if ($form->{notes});
- push @options, $locale->text('Transaction description') . " : $form->{transaction_description}" if $form->{transaction_description};
- push @options, $locale->text('Employee') . " : $employee" if $employee;
+ push @options, $locale->text('Account') . " : $form->{accno} $form->{account_description}" if ($form->{accno});
+ push @options, $locale->text('Source') . " : $form->{source}" if ($form->{source});
+ push @options, $locale->text('Reference') . " : $form->{reference}" if ($form->{reference});
+ push @options, $locale->text('Description') . " : $form->{description}" if ($form->{description});
+ push @options, $locale->text('Notes') . " : $form->{notes}" if ($form->{notes});
+ push @options, $locale->text('Transaction description') . " : $form->{transaction_description}" if $form->{transaction_description};
+ push @options, $locale->text('Employee') . " : $employee" if $employee;
my $datesorttext = $form->{datesort} eq 'transdate' ? $locale->text('Transdate') : $locale->text('Gldate');
push @date_options, "$datesorttext" if ($form->{datesort} and ($form->{datefrom} or $form->{dateto}));
push @date_options, $locale->text('From'), $locale->date(\%myconfig, $form->{datefrom}, 1) if ($form->{datefrom});
$form->{l_doccnt} = $form->{l_source} ? 'Y' : '';
my %column_defs = (
- 'id' => { 'text' => $locale->text('ID'), },
- 'transdate' => { 'text' => $locale->text('Transdate'), },
- 'gldate' => { 'text' => $locale->text('Gldate'), },
- 'reference' => { 'text' => $locale->text('Reference'), },
- 'source' => { 'text' => $locale->text('Source'), },
- 'doccnt' => { 'text' => $locale->text('Document Count'), },
- 'description' => { 'text' => $locale->text('Description'), },
- 'notes' => { 'text' => $locale->text('Notes'), },
- 'debit' => { 'text' => $locale->text('Debit'), },
- 'debit_accno' => { 'text' => $locale->text('Debit Account'), },
- 'credit' => { 'text' => $locale->text('Credit'), },
- 'credit_accno' => { 'text' => $locale->text('Credit Account'), },
- 'debit_tax' => { 'text' => $locale->text('Debit Tax'), },
- 'debit_tax_accno' => { 'text' => $locale->text('Debit Tax Account'), },
- 'credit_tax' => { 'text' => $locale->text('Credit Tax'), },
- 'credit_tax_accno' => { 'text' => $locale->text('Credit Tax Account'), },
- 'balance' => { 'text' => $locale->text('Balance'), },
- 'projectnumbers' => { 'text' => $locale->text('Project Numbers'), },
- 'department' => { 'text' => $locale->text('Department'), },
- 'employee' => { 'text' => $locale->text('Employee'), },
+ 'id' => { 'text' => $locale->text('ID'), },
+ 'transdate' => { 'text' => $locale->text('Transdate'), },
+ 'gldate' => { 'text' => $locale->text('Gldate'), },
+ 'reference' => { 'text' => $locale->text('Reference'), },
+ 'source' => { 'text' => $locale->text('Source'), },
+ 'doccnt' => { 'text' => $locale->text('Document Count'), },
+ 'description' => { 'text' => $locale->text('Description'), },
+ 'notes' => { 'text' => $locale->text('Notes'), },
+ 'debit' => { 'text' => $locale->text('Debit'), },
+ 'debit_accno' => { 'text' => $locale->text('Debit Account'), },
+ 'credit' => { 'text' => $locale->text('Credit'), },
+ 'credit_accno' => { 'text' => $locale->text('Credit Account'), },
+ 'debit_tax' => { 'text' => $locale->text('Debit Tax'), },
+ 'debit_tax_accno' => { 'text' => $locale->text('Debit Tax Account'), },
+ 'credit_tax' => { 'text' => $locale->text('Credit Tax'), },
+ 'credit_tax_accno' => { 'text' => $locale->text('Credit Tax Account'), },
+ 'balance' => { 'text' => $locale->text('Balance'), },
+ 'projectnumbers' => { 'text' => $locale->text('Project Numbers'), },
+ 'department' => { 'text' => $locale->text('Department'), },
+ 'employee' => { 'text' => $locale->text('Employee'), },
'transaction_description' => { 'text' => $locale->text('Transaction description'), },
);