http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12905 Bug ID: 12905 Summary: Deleting parent fund will orphan child funds, leaving them un-editable. Change sponsored?: --- Product: Koha Version: 3.14 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Acquisitions Assignee: koha-bugs@lists.koha-community.org Reporter: barton@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org It is possible to create two aqbudgets records with a parent-child relationship (i.e. budget_parent_id of the 'child' record is the 'budget_id' of the parent), then delete the parent record. The Child record will then be un-editable, because it will always trigger a 'Fund amount exceeds parent allocation' message. Replicating issue:
From acqui-home.pl on staff client,
1) Click 'funds' link, navigating to cgi-bin/koha/admin/aqbudgets.pl 2) Click 'New budget' link. 3) Populate Start Date, End date, description and amount. Click 'Make budget active' and save changes. 4) Click on budget description, this will navigate to cgi-bin/koha/admin/aqbudgets.pl 5) Click 'New', select 'New fund for ...' 6) Populate Fund code (I used PARENT01) Fund name (Parent 1) Amount (Will be less than or equal to budget amound populated earlier). 7) Click submit 8) For Parent 1, click 'Actions', then 'Add Child Fund'. 9) Populate Child: Fund code (I used CHILD01) Fund name (Child 1) Amount (Will be less than or equal to amount for Parent 1) 10) Click submit 11) Choose Actions->delete for 'Parent 1' fund. Choose 'Delete' when prompted. 12) Find 'Child 1' fund, click actions->edit 13) Click Submit. A pop-up will appear with the following text: Form not submitted because of the following problem(s) ------------------------------------------------------------------------------------ - Fund amount exceeds parent allocation I see the following problems * There should be a referential integrity check for aqbudgets.budget_parent_id: if it exists, it must point to a valid parent record. * Deleting an aqbudgets record with a child should issue an explicit warning that the fund has children. * The user should have the choice of deleting children with the parent or removing the link to the parent, thus promoting them to first class funds. * function budgetExceedsParent in acq.js should be able to handle an unknown error * cgi-bin/admin/check_parent_total.pl should check that the parent record exists, and should *not* pass $returncode = 1 if the parent record does not exist, even if budget_parent_id is not NULL. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.