Disva/DMSLite

Store Receipt Data

Closed this issue · 12 comments

Receipt data needs to be stored somewhere. The actual receipts (PDFs) don't need to be stored but the data from them must be to satisfy CRA guidelines.

Demo Steps

  • create a donation to an open batch with a known donor
  • print the receipt for that batch and that donor
  • change the donor's address
  • check the receipt by viewing the donation again and selecting "Receipt"
  • confirm that the donor's old address was used
    Alternately:

The simplest evidence of this is that donor Stan Lee has a donation of $40 to the batch solid snake: the receipt lists his old address 5353 Evergreen Terrace, and Stan Lee's current address is at 9999 Evergreen Terrace.

As a user I want to store receipt data so that I can review it at a later date.
-Story Points (5)
-Priority (1)
-Risk: Medium

As of the last release, the data for a receipt technically is already stored in the database, and the only way to currently view the receipt data is in the PDF the program generates when requested. The user can view the receipt where a donation is featured at any time if it's been receipted. I interpret the issue now in two ways:

  • We need some way of accessing a receipt at any time, and that's all (this is already done)
  • We need some way of accessing a receipt at any time, but not just as a PDF

Is the receipt record the donation record or is it its own record?

It's more about the data. Does the system regenerate the receipt every time the receipt button is clicked? If I generate a receipt and then change the donor's address will the system still give me a receipt with the old address?

A receipt is its own record for now. Receipts are found as a table in our database, and a receipt has its own ID and Issue Date. When it gets printed, donations with the receipt's ID as a foreign key are fetched.

Yes, the receipt is regenerated every time the receipt button is clicked: if the donor's address changes, then the generated receipt would have the donor's new address, which is definitely a problem that should be addressed within this issue.

As of the last push, donors can have their addresses edited, and it won't affect the address written on any receipts they were issued in the past. The simplest evidence of this is that donor Stan Lee has a donation of $40 to the batch solid snake: the receipt lists his old address 5353 Evergreen Terrace, and Stan Lee's current address is at 9999 Evergreen Terrace.

Demo Steps

  • create a donation to an open batch with a known donor
  • print the receipt for that batch and that donor
  • change the donor's address
  • check the receipt by viewing the donation again and selecting "Receipt"
  • confirm that the donor's old address was used
    Alternately:

The simplest evidence of this is that donor Stan Lee has a donation of $40 to the batch solid snake: the receipt lists his old address 5353 Evergreen Terrace, and Stan Lee's current address is at 9999 Evergreen Terrace.

Unable to test as the system outputs a file without an extension called "application-pdf" when attempting to regenerate a receipt.

Good catch, sorry about that! I switched up the "content type" and "filename" fields when I wrote the method.

@scott-brereton waiting for your approval.

Confirmed to be working now.

Note: I discovered that you can enter donations with more than two decimal places.

Created #355