Apply COG sibling logic to loan returns#6038
Conversation
alesan99
left a comment
There was a problem hiding this comment.
- See that both of the loan preps have been fully returned. See that the quantity returned and quantity resolved are both 2.
- Verify that the behavior for prep CO that are not a part of consolidated COG is the same as before.
If I'm understanding correctly, I believe something is wrong here?
I returned the 2nd prep with quantity and quantity resolved set to 1.
The values were maxed out to 2 for the 1st prep, but not the 2nd.
|
@alesan99 Thanks, I'll check it out. After refreshing the page, the quantity returned and quantity resolved should both be 2. |
pashiav
left a comment
There was a problem hiding this comment.
- See that both of the loan preps have been fully returned. See that the quantity returned and quantity resolved are both 2.
- Verify that the behavior for prep CO that are not a part of consolidated COG is the same as before.
(I tried 2 preps and 6 preps following the same directions)
When testing 2 preps, I had the same behavior as #6038 (review).
When testing 6 preps, only one loan prep was fully returned. The other prep only had 1 prep fully returned.

alesan99
left a comment
There was a problem hiding this comment.
That fixed it!
Also tried it with >2 preps, with varying counts per prep, and with partial loans. It properly recognizes the maximums those cases too 👍
emenslin
left a comment
There was a problem hiding this comment.
- See that both of the loan preps have been fully returned. See that the quantity returned and quantity resolved are both 2.
- Verify that the behavior for prep CO that are not a part of consolidated COG is the same as before.
Returning consolidated loan preps sometimes triggers unload protect
cZCYCm4uCt.mp4
Preparations that are not part of a nonconsolidated COG also return the full amount even if you only select 1, is this the intended behavior?
lF9FLhEuJF.mp4
|
@emenslin Good catch. Pushed a commit that should fix it so that loan preps not in consolidated preps can still be partially returned. |
This might be because the counts get modified in the back-end without the front-end knowing, so it thinks there are changes that need to be saved. It seems that the loan return preps are being saved properly. After pressing the save button again, the save button is greyed out, like it should be. This isn't a major issue, so I think we'll be ok with this behavior for now. |
|
Are we sure this behavior is okay and wouldn't be confusing considering this doesn't happen anywhere else? |
pashiav
left a comment
There was a problem hiding this comment.
- See that both of the loan preps have been fully returned. See that the quantity returned and quantity resolved are both 2.
- Verify that the behavior for prep CO that are not a part of consolidated COG is the same as before.
#6038 (review) fixed!
#6038 (review) still occurs:
'Is resolved' is checked when the preparation is only partially resolved, the box should only be checked when the full amount of preps have been resolved
https://ciscollections21524gen-issue-5501.test.specifysystems.org/specify/view/loan/253/

|
@pashiav Thanks, the isresolved logic should work now for both consolidated and unconsolidated cogs. Sorry I didn't catch that sooner. |
emenslin
left a comment
There was a problem hiding this comment.
- See that both of the loan preps have been fully returned. See that the quantity returned and quantity resolved are both 2.
- Verify that the behavior for prep CO that are not a part of consolidated COG is the same as before.
Is Resolved issue is fixed, however, I could be wrong but I thought the ability to search COGs was removed from this pr? I just want to make sure this is supposed to be implemented here before approving

|
@emenslin, indeed it is supposed to be removed |
emenslin
left a comment
There was a problem hiding this comment.
- See that both of the loan preps have been fully returned. See that the quantity returned and quantity resolved are both 2.
- Verify that the behavior for prep CO that are not a part of consolidated COG is the same as before.
Searching for COGS was removed, looks good
pashiav
left a comment
There was a problem hiding this comment.
- See that both of the loan preps have been fully returned. See that the quantity returned and quantity resolved are both 2.
- Verify that the behavior for prep CO that are not a part of consolidated COG is the same as before.
Looks good! Working as expected.
Triggered by 0608e6e on branch refs/heads/issue-5501


Fixes #5501
Extend the COG sibling relationship logic from loans to loan returns. So, when a loan return is added, there will also be loan returns created for it's siblings.
The complication with the return counts is handled in the following ways:
Checklist
self-explanatory (or properly documented)
Testing instructions
==> The purpose of these tests is to verify that the count returned is set to the maximum, whatever the number entered by the user + verify that all siblings of a prep CO that is a part of a consolidated COG are also returned to they max.