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}'";
}
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', },
+ '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}
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)