Skip to content

Commit

Permalink
Fix issue #996
Browse files Browse the repository at this point in the history
  • Loading branch information
mbayopanda authored and jniles committed Dec 1, 2016
1 parent 3696afb commit b7560d3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion server/controllers/finance/cash.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,20 @@ function listPayment(params) {

if (params) {
let reference = params.reference;
let userId = params.user_id;

if (reference) {
delete params.reference;
}

if (userId) {
params[`u.id`] = userId;
delete params.user_id;
}

let qc =
params.dateFrom && params.dateTo ?
util.queryCondition(sql, params, null, 'DATE(date) BETWEEN DATE(?) AND DATE(?)') :
util.queryCondition(sql, params, null, 'DATE(cash.date) BETWEEN DATE(?) AND DATE(?)') :
util.queryCondition(sql, params);

if (reference) {
Expand Down

0 comments on commit b7560d3

Please sign in to comment.