Skip to content

Commit

Permalink
fix(patients): revert bugs in debtor_group search (#1735)
Browse files Browse the repository at this point in the history
* Remove comment in filter
* Fix the link between the list of debtor groups and Patient
- Update the filter equals remove the alternative who check if there are a
  Default Uuid Partial Key

* Using db.convert for cash.debtor_uuid
  • Loading branch information
lomamech authored and jniles committed Jun 1, 2017
1 parent f609830 commit 63a0c20
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
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']);
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

0 comments on commit 63a0c20

Please sign in to comment.