Closed melton-jason closed 9 months ago
Where can we tell Specify which report to run on the 'Generate Invoice on save' command? We seem to be running an outdated query/report which shouldn't even be accessible anymore via that function. I looked through all sorts of backend config files but didn't spot anything.
This is in S7. We only have one Loan report in the list but is seems that we run an old query with it (which results in duplicate records in the Loan Invoice) when run via the generate on save. This is based on comments I received from back in Canberra. I'll give it a spin later tonight to see if I can figure out what's going on.
Ok, I can confirm that I get a pop-up when I go via Generate on Save. I'm selecting the same report as via the Reports menu, but the output is different. The same happens for a specific loan label report we built. It looks like the Generate on Save ignores the determination.present=True query line, which is something we initially forgot but subsequently added into the query. These are the only reports in the system, both built in S6 iReport.
Behavior is different based on where you run the report from for Corinna at CSIRO as well.
Hello - just a bump from us (CSIRO) on this one, as our users have queried us again on this issue. Thanks!
Describe the bug There seems to be an inconsistent generation of labels among all of the different ways one can generate a label.
More specifically, among the 'Generate Label' button on the form ('Generate Label on Save' checkbox produces the same behavior), and manually identifying the Collection Object (in this case via catalog number) in the report in the Reports Dialog.
I have prepared a simple test Collection Object record to demonstrate this issue.
I will be using the
Small Labels
JRXML App Resource as a Label throughout this example.Note that the Report Query is only supposed to fetch records that have a
Small
Label Size for their PreparationsHere are the preparations on the test Collection Object record.
When the Collection Object is saved (when the 'Generate Label on Save' checkbox is checked), or when the Generate Label button is pressed on the form and the
Small Labels
Label selected, the following Label is generated:As shown in the Report Query, this Label should NOT have any information for the Tissue preparation. In fact, Specify will generate a Label for ALL Preparations on the Collection Object, regardless of its data.
If the Catalog Number (000165434) is manually entered into the
Small Labels
Report Query, then the correct and expected Label is generated:Possible Explanation It appears that somehow the Query might be
undefined
when the Label is run. I think that instead of a Query, the Label is using all of the available data on the Collection Object as a substitute for a Query.This would make sense, given the Label Definition. Here is a relevant section.
Nowhere in the logic of the Label does it check for the Label Size of the Preparation (
preparation.remarks
in the database), as this is supposed to be filtered out when the Query is executed.For future and easy reference for the Developer tasked to this issue, the
Generate Label
button is rendered via the following function. https://github.com/specify/specify7/blob/de940f090b68553f063b40fe15be22077b5099b9/specifyweb/frontend/js_src/lib/components/FormCommands/index.tsx#L20-L52Desktop: Replicated on:
Reported By Florida Fish and Wildlife Research Institute (FWRI)