push(@apvalues, like($form->{notes}));
}
+ if (trim($form->{transaction_description})) {
+ $glwhere .= " AND g.transaction_description ILIKE ?";
+ $arwhere .= " AND a.transaction_description ILIKE ?";
+ $apwhere .= " AND a.transaction_description ILIKE ?";
+ push(@glvalues, like($form->{transaction_description}));
+ push(@arvalues, like($form->{transaction_description}));
+ push(@apvalues, like($form->{transaction_description}));
+ }
+
if ($form->{accno}) {
$glwhere .= " AND c.accno = '$form->{accno}'";
$arwhere .= " AND c.accno = '$form->{accno}'";
'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', },
);
# sortdir = sort direction (ascending or descending)
ac.acc_trans_id, g.id, 'gl' AS type, FALSE AS invoice, g.reference, ac.taxkey, c.link,
g.description, ac.transdate, ac.gldate, ac.source, ac.trans_id,
ac.amount, c.accno, g.notes, t.chart_id,
- d.description AS department,
+ d.description AS department, g.transaction_description,
CASE WHEN (COALESCE(e.name, '') = '') THEN e.login ELSE e.name END AS employee
$project_columns $gl_globalproject_columns
$columns_for_sorting{gl}
SELECT ac.acc_trans_id, a.id, 'ar' AS type, a.invoice, a.invnumber, ac.taxkey, c.link,
ct.name, ac.transdate, ac.gldate, ac.source, ac.trans_id,
ac.amount, c.accno, a.notes, t.chart_id,
- d.description AS department,
+ d.description AS department, a.transaction_description,
CASE WHEN (COALESCE(e.name, '') = '') THEN e.login ELSE e.name END AS employee
$project_columns $arap_globalproject_columns
$columns_for_sorting{arap}
SELECT ac.acc_trans_id, a.id, 'ap' AS type, a.invoice, a.invnumber, ac.taxkey, c.link,
ct.name, ac.transdate, ac.gldate, ac.source, ac.trans_id,
ac.amount, c.accno, a.notes, t.chart_id,
- d.description AS department,
+ d.description AS department, a.transaction_description,
CASE WHEN (COALESCE(e.name, '') = '') THEN e.login ELSE e.name END AS employee
$project_columns $arap_globalproject_columns
$columns_for_sorting{arap}
my @columns = qw(
transdate gldate id reference description
- notes source doccnt debit debit_accno
+ 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 @hidden_variables = qw(accno source reference description notes project_id datefrom dateto employee_id datesort category l_subtotal department_id);
+ my @hidden_variables = qw(accno source reference description notes project_id datefrom dateto employee_id datesort category l_subtotal department_id transaction_description);
push @hidden_variables, map { "l_${_}" } @columns;
my $employee = $form->{employee_id} ? SL::DB::Employee->new(id => $form->{employee_id})->load->name : '';
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}));
'projectnumbers' => { 'text' => $locale->text('Project Numbers'), },
'department' => { 'text' => $locale->text('Department'), },
'employee' => { 'text' => $locale->text('Employee'), },
+ 'transaction_description' => { 'text' => $locale->text('Transaction description'), },
);
- foreach my $name (qw(id transdate gldate reference description debit_accno credit_accno debit_tax_accno credit_tax_accno department)) {
+ foreach my $name (qw(id transdate gldate reference description debit_accno credit_accno debit_tax_accno credit_tax_accno department transaction_description)) {
my $sortname = $name =~ m/accno/ ? 'accno' : $name;
my $sortdir = $sortname eq $form->{sort} ? 1 - $form->{sortdir} : $form->{sortdir};
$column_defs{$name}->{link} = $callback . "&sort=$sortname&sortdir=$sortdir";
$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 gldate employee department);
+ map { $row->{$_}->{data} = $ref->{$_} } qw(id reference description notes gldate employee department transaction_description);
map { $row->{$_}->{data} = \@{ $rows{$_} }; } qw(transdate debit credit debit_accno credit_accno debit_tax_accno credit_tax_accno source);
<th align=right>[% 'Notes' | $T8 %]</th>
<td colspan=3><input name=notes size=40></td>
</tr>
+ <tr>
+ <th align=right>[% 'Transaction description' | $T8 %]</th>
+ <td>[% L.input_tag("transaction_description", "", size=40) %]</td>
+ </tr>
<tr>
<th align=right>[% 'Project Number' | $T8 %]</th>
<td colspan=3>[% L.select_tag('project_id', ALL_PROJECTS, title_key = 'projectnumber', with_empty = 1) %]</td>
<td>[% 'Project Number' | $T8 %]</td>
<td align=right><input name="l_employee" class=checkbox type=checkbox value=Y></td>
<td>[% 'Employee' | $T8 %]</td>
+ <td align=right><input name="l_transaction_description" id="l_transaction_description" class=checkbox type=checkbox value=Y[% IF INSTANCE_CONF.get_require_transaction_description_ps %] checked[% END %]></td>
+ <td>[% 'Transaction description' | $T8 %]</td>
</tr>
<tr>
<td align=right><input name="l_subtotal" class=checkbox type=checkbox value=Y></td>