Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix (Research DebtorGroup) #1735

Merged
merged 3 commits into from
Jun 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions server/controllers/finance/cash.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ function read(req, res, next) {
* @description list all payment made
*/
function listPayment(options) {
// ensure epected options are parsed appropriately as binary
db.convert(options, ['debtor_uuid']);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am sorry to say that I introduced this bug :(

Good catch!

const filters = new FilterParser(options, { tableAlias : 'cash', autoParseStatements : false });

const sql = `
Expand Down Expand Up @@ -180,6 +182,7 @@ function listPayment(options) {

const query = filters.applyQuery(sql);
const parameters = filters.parameters();

return db.exec(query, parameters);
}

Expand Down
4 changes: 0 additions & 4 deletions server/lib/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,6 @@ class FilterParser {

if (this._filters[filterKey]) {
let valueString = '?';
if (filterKey.includes(DEFAULT_UUID_PARTIAL_KEY)) {
valueString = 'HUID(?)';
}

const preparedStatement = `${tableString}${columnAlias} = ${valueString}`;

this._addFilter(preparedStatement, this._filters[filterKey]);
Expand Down