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

SRY - Fixing invoice report misalignment with notes filter #514

Merged
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2019_06_14_012215) do
ActiveRecord::Schema.define(version: 2019_07_01_115421) do

create_table "appointment_statuses", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin", force: :cascade do |t|
t.string "status"
Expand Down Expand Up @@ -199,7 +199,7 @@
t.string "last_name", collation: "utf8_unicode_ci"
t.string "mrn"
t.string "status"
t.datetime "date_of_birth"
t.date "date_of_birth"
t.string "gender"
t.string "ethnicity"
t.string "race"
Expand Down Expand Up @@ -267,7 +267,7 @@
t.index ["sub_service_request_id"], name: "index_protocols_on_sub_service_request_id"
end

create_table "protocols_participants", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
create_table "protocols_participants", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin", force: :cascade do |t|
t.bigint "protocol_id"
t.bigint "participant_id"
t.bigint "arm_id"
Expand Down
16 changes: 14 additions & 2 deletions lib/reports/invoice_report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ def display_modified_rate_column(procedure)
end
end

def insert_blank_column_for_notes(totals)
totals.insert(0,"") if @params[:include_notes] == "true"
totals
end

def generate(document)
#We want to filter from 00:00:00 in the local time zone,
#then convert to UTC to match database times
Expand Down Expand Up @@ -227,8 +232,15 @@ def generate(document)
end
if fulfillments.any? or procedures.any?
csv << [""]
csv << ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "Non-clinical and Clinical Services Total:", display_cost(total)]
csv << ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "Total Cost after Subsidy:", display_cost(total_with_subsidy)] if protocol.sub_service_request.subsidy

total_services = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "Non-clinical and Clinical Services Total:", display_cost(total)]
csv << insert_blank_column_for_notes(total_services)

if protocol.sub_service_request.subsidy
total_subsidy = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "Total Cost after Subsidy:", display_cost(total_with_subsidy)]
csv << insert_blank_column_for_notes(total_subsidy)
end

csv << [""]
csv << [""]
end
Expand Down