Skip to content

Commit

Permalink
fix(stock report) correctly calculate sum when details are not displayed
Browse files Browse the repository at this point in the history
closes #4384
  • Loading branch information
jeremielodi committed May 4, 2020
1 parent 870b717 commit 48400df
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion server/controllers/stock/reports/stock/exit/exitToDepot.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function fetch(depotUuid, dateFrom, dateTo, showDetails) {
const sql = `
SELECT
i.code, i.text, iu.text AS unit_text, BUID(m.document_uuid) AS document_uuid,
(m.quantity * m.unit_cost) AS cost, m.unit_cost,
SUM(m.quantity * m.unit_cost) AS cost, m.unit_cost,
SUM(m.quantity) as quantity, m.date, m.description,
u.display_name AS user_display_name,
dm.text AS document_reference, dd.text AS depot_name
Expand Down
2 changes: 1 addition & 1 deletion server/controllers/stock/reports/stock/exit/exitToLoss.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function fetch(depotUuid, dateFrom, dateTo, showDetails) {
const sql = `
SELECT
i.code, i.text, iu.text AS unit_text, BUID(m.document_uuid) AS document_uuid,
(m.quantity * m.unit_cost) AS cost, m.unit_cost,
SUM(m.quantity * m.unit_cost) AS cost, m.unit_cost,
SUM(m.quantity) as quantity, m.date, m.description,
u.display_name AS user_display_name,
dm.text AS document_reference
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function fetch(depotUuid, dateFrom, dateTo, showDetails) {
const sql = `
SELECT
i.code, i.text, iu.text AS unit_text, BUID(m.document_uuid) AS document_uuid,
(m.quantity * m.unit_cost) AS cost, m.unit_cost,
SUM(m.quantity * m.unit_cost) AS cost, m.unit_cost,
SUM(m.quantity) as quantity, m.date, m.description,
u.display_name AS user_display_name, p.display_name AS patient_display_name,
dm.text AS document_reference, d.text AS depot_name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function fetch(depotUuid, dateFrom, dateTo, showDetails) {
const sql = `
SELECT
i.code, i.text, iu.text AS unit_text, BUID(m.document_uuid) AS document_uuid,
(m.quantity * m.unit_cost) AS cost, m.unit_cost,
SUM(m.quantity * m.unit_cost) AS cost, m.unit_cost,
SUM(m.quantity) as quantity, m.date, m.description,
u.display_name AS user_display_name,
dm.text AS document_reference, d.text AS depot_name,
Expand Down

0 comments on commit 48400df

Please sign in to comment.