-
-
Notifications
You must be signed in to change notification settings - Fork 504
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
Add an option to control whether "in-kind value" of each item should be added in export of donations and distributions #4897
base: main
Are you sure you want to change the base?
Conversation
41722bc
to
a21bf2d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Light testing looks good. User manual changes for the organization bit are outstanding, though.
The relevant area for that updating are: docs/user_guide/bank/getting_started_customization.md
I'll review the user manual stuff later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm suggesting some expanded text around the instructions.
@@ -129,6 +129,9 @@ For each of the distributions in the filtered list: | |||
|
|||
[!NOTE] This includes inactive Items as well as active ones. | |||
|
|||
### Add In-Kind Value for each item |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add something like "The default export includes the number of items exported, but not the values. If you want to also have the export include the in-kind value for each item in the distributions, you can set that option." before the instructions.
And after, please add a "[!NOTE] Setting this affects both the donation and distribution exports."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK.
@@ -157,6 +160,9 @@ For each of the Donations in the filtered list: | |||
- Comments, | |||
- and the quantity of each of your organization's Items in the Donations. | |||
|
|||
### Add In-Kind Value for each item | |||
Click "My Organization" in the left hand manu. Click "Edit" button. Set the "Include in-kind value in donation and distribution exports?" to "yes". | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add similar text as noted above in the distribution section.
@@ -129,6 +129,9 @@ For each of the distributions in the filtered list: | |||
|
|||
[!NOTE] This includes inactive Items as well as active ones. | |||
|
|||
### Add In-Kind Value for each item | |||
Click "My Organization" in the left hand manu. Click "Edit" button. Set the "Include in-kind value in donation and distribution exports?" to "yes". | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to "yes", then click "Save".
62279c2
to
4ae30dc
Compare
What contents should I add in this file? |
Well -- I would add a section, at the same level as "customizing the distribution printout", called "Configuring exports", then a subsection for the field. In that, I would talk about what the default distribution and donation exports are (as you did in the exports section), and the effect that setting this field to "yes' will have. IIRC, your new field is just before "Distribution Email Content". If that's right, put the new section there. |
4ae30dc
to
d8051fe
Compare
It seems odd to me that there is a second-level section between two fourth-level sections. |
Yeah (haven't checked yet) We need to do some reorganization of that screen so that same-concepted things are together - but that's out of scope for this change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of tweaks, please, and over to @dorner for technical input.
@@ -182,6 +182,16 @@ Partners can't submit Requests until they are approved by the bank. | |||
The full partner approval process requires the partner to fill in their profile and submit it for approval. Some banks handle that for their partners, gather the information through other means (such as a phone conversation). | |||
Checking this will change the process so that the partners are automatically approved when they are invited. Note that any invited partners that are not yet approved will still need to be approved by the bank. | |||
|
|||
## Configuring exports | |||
|
|||
### Add In-Kind Value for each item |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this the whole field name -- i.e. Include in-kind value in donation and distribution exports?
This matches the practice for the field-level sections in the rest of the file.
|
||
### Add In-Kind Value for each item | ||
|
||
You can configure whether the export file includes the "In-Kind Value" column for each item. By default, these values are excluded. To include them, set the "Include in-kind value in donation and distribution exports?" option to "Yes". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please change "the export file includes " to "the exports for donations and distributions include "
…be added in export of donations and distributions
d8051fe
to
a15b1de
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @nozomirin . This looks pretty good to me from a functional pov.
One note -- when you do a force push it makes it harder for the reviewers, because they can't see the incremental changes.
Over to @dorner for technical review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks great - I had a request for the tests.
@@ -0,0 +1,6 @@ | |||
class AddIncludeInKindValuesInExportedFilesToOrganizations < ActiveRecord::Migration[7.2] | |||
def change | |||
add_column :organizations, :include_in_kind_values_in_exported_files, :boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be NOT NULL. Otherwise it's got three values, true false and null. :)
distribution.comment | ||
] | ||
|
||
row += quantities_and_values_of_item.flat_map { |item| [item[:quantity], item[:value].to_f] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We really should be setting up the data using explicit values rather than trying to calculate aggregations of random values. If it's not too much work, would you be able to make that change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nozomirin FYI, we will be addressing those inconsistencies in PR4924. I'd like to get this one in first if we can.
I will change this test later in another PR.
|
||
row += item_quantities | ||
|
||
expect(item_quantities.sum).to eq(total_item_quantity) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
I understand that I should not force push after a review. Got it—this won't happen again. |
If the filter is set to item A, the total number is the number of A. But what is the 'total value'? Is it the value of A or the value of the entire distribution? |
We recently merged a change to make it so that the filtered values on the index reflect only the values for the items in the filter. The export should match that. I don't recall immediately if the export was addressed at that time, but suggest you merge main into your branch and confirm. |
I pulled and tested it on the main branch. The total value represents the value of the entire distribution. |
Huh. I thought we'd addressed that. I'm going to have to track down what happened there (and I can't do that in the next few minutes. Maybe later today). The export should match the index. |
I've dug into this a bit more. For the scope of this PR, leave the total value as is. We have some inconsistencies between how we are handling filtering by item and filtering by item category in the export that need to be resolved, but it's out of scope for this PR. |
@nozomirin FYI, we will be addressing those inconsistencies in PR4924. I'd like to get this one in first if we can. |
Resolves #4858
Description
in-kind value
for each item in exported donation and distribution files when theInclude in-kind value in donation and distribution exports?
is set toyes
.Note: I changed the "In-Kind Value" header to "In-Kind Total" in the exported donation file to avoid ambiguity. However, I used "Header + In-Kind Value" for the in-kind value of items, so perhaps the change is unnecessary. If there’s anything incorrect or unclear, please let me know.
Type of change
How Has This Been Tested?
Screenshots