Bug 10013 - Ability to link directly from an item in the Staff client to budget information.
Summary: Ability to link directly from an item in the Staff client to budget information.
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Target Milestone: ---
Assignee: Bugs List
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-09 16:44 UTC by Amit Gupta
Modified: 2019-05-04 21:09 UTC (History)
9 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Bot Control: ---
When did the bot last check this: 2013-10-30 00:00:00
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Ability to link directly from an item in the Staff client to budget information (5.17 KB, patch)
2013-04-22 16:49 UTC, Amit Gupta
Details | Diff | Splinter Review
Screenshot of a dev made in Rennes2 with JQuery (52.50 KB, image/jpeg)
2013-04-23 09:41 UTC, mathieu saby
Details
Bug 10013 - Ability to link directly from an item in the Staff client to budget information. (5.17 KB, patch)
2013-04-23 16:18 UTC, Amit Gupta
Details | Diff | Splinter Review
Add new unit tests for new routine: GetBudgetInfoFromItemnumber (1.04 KB, patch)
2013-04-24 09:28 UTC, Amit Gupta
Details | Diff | Splinter Review
Ability to link directly from an item in the Staff client to budget information. (4.98 KB, patch)
2013-06-03 05:29 UTC, Amit Gupta
Details | Diff | Splinter Review
New unit tests for routine: GetBudgetInfoFromItemnumber (1.01 KB, patch)
2013-06-03 05:39 UTC, Amit Gupta
Details | Diff | Splinter Review
Bug 10013 - Ability to link directly from an item in the Staff client to budget information. (5.00 KB, patch)
2013-08-02 16:02 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug-10013-New unit tests for routine: GetBudgetInfoFromItemnumber (1.07 KB, patch)
2013-08-02 16:03 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug-10013-New unit tests for routine: GetBudgetInfoFromItemnumber (1.02 KB, patch)
2013-08-02 16:07 UTC, Kyle M Hall
Details | Diff | Splinter Review
Unit Test for newly created routine: GetBudgetInfoFromItemnumber (1.96 KB, patch)
2013-10-18 15:38 UTC, Amit Gupta
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Amit Gupta 2013-04-09 16:44:04 UTC
Ability to link directly from an item in the Staff client to budget information.
Comment 1 mathieu saby 2013-04-09 21:55:29 UTC
Hello Amit
Did you see 5336 and 9780 ? 

M. Saby
Comment 2 Amit Gupta 2013-04-22 16:49:38 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2013-04-22 17:44:08 UTC
Comment on attachment 17598 [details] [review]
Ability to link directly from an item in the Staff client to budget information

Review of attachment 17598 [details] [review]:
-----------------------------------------------------------------

Hi Amit,

I found a couple of problems with this patch - I have noted them using the splinter review below. Please take a look at the coding guidelines in the wiki (http://wiki.koha-community.org/wiki/Coding_Guidelines).

Also, I am not sure about the workflow here. Can you perhaps explain the use case for the link to the budget?

::: C4/Acquisition.pm
@@ +75,1 @@
>  

Capitalization seems a bit off here.
Also, unit tests are mandatory for every new sub in the C4 and Koha namespaces.

::: koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt
@@ +370,4 @@
>                  [% IF ( SpineLabelShowPrintOnBibDetails ) %]<th>Spine label</th>[% END %]
>                  [% IF ( hostrecords ) %]<th>Host records</th>[% END %]
>                  [% IF ( analyze ) %]<th>Used in</th><th></th>[% END %]
> +                [% IF ( itemdata_booksellerid ) %]<th>Budget Information</th>[% END %]

Wrong capitalization.

@@ +523,5 @@
>                          <td><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?hostbiblionumber=[% item.biblionumber %]&amp;hostitemnumber=[% item.itemnumber %]">Create analytics</a></td>
> +                    [% END %] 
> +                    [% IF ( itemdata_booksellerid ) %]
> +                        <td><a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% item.budget_period_id %]" >[% item.budget_name %]</a></td>
> +                    [% END %]    

I am not sure this is the right place for this information. If I read the code correctly, this will appear in the holdings table on the detail page. All other acq related information is shown on the holdings tab.
Comment 4 Katrin Fischer 2013-04-22 17:45:32 UTC
Ah, I see I got the wrong line - the first comment refers to the capitalization  of the new sub's name.
Comment 5 mathieu saby 2013-04-23 05:57:06 UTC
Hello Amit.
I will take a look at your patch later, but I think its goal is partially the same as 6777 , 9780 (I did this one), and 7294.
Maybe it could be interesting for you to take a look at them ?
For 9780, it was supposed to show a link between record and Acq, but in a different way than your patch did (not in tabs, but under the record description). 
It is also forbidding librarians to suppress a record if it is used in an order.

BZ9780 was signed off and waiting for QA, but I think I am going to rewrite it, keeping only the last point and removing the display of the link between record and Acq, as maybe your tab solution is better on UX point of view.

For 6777, it is adding a new column in the holding tabs, showing acq info.

For 7294, it is also using the tabs, but doing other things.

Mathieu Saby
Comment 6 Colin Campbell 2013-04-23 08:29:33 UTC
The use case for the for this is the desire of a number of sites to access the funding information for copies of titles held from the results of standard staff search.
Comment 7 mathieu saby 2013-04-23 08:40:49 UTC
Yes, it is a very needed feature! For the moment, in my library, we made a hack in JQuery for displaying this information.

I just made previous comment to remark that there are 4 bugs BZ for the same subject. Maybe some ideas developped of the other patchs could be interesting for this one?

M. Saby
Comment 8 Katrin Fischer 2013-04-23 09:10:06 UTC
Ok, I see :) I thought that the link was not very helpful as it will just show you the totals, but I can see that displaying the fund itself would be useful.

I still think acq related information should be grouped together in one place tho - meaning not to add columns to items, but have that in a separate place. The items table already has a lot of columns and display won't get more readable adding more information that is not needed for circ.
Comment 9 mathieu saby 2013-04-23 09:11:56 UTC
I can join a screenshot of what we made in JQuery in Rennes 2.
Comment 10 mathieu saby 2013-04-23 09:41:55 UTC
Created attachment 17610 [details]
Screenshot of a dev made in Rennes2 with JQuery

I don't know if it could be helpful, but I join a screenshot of a dev made in Rennes2 with JQuery.

We create items only when we receive books. So we need a way to show information about pending orders before reception.

We made a little dev in jquery that
1 - creates a new tab for acquisition information :
# order with a link
# basket with a link
Budget
Note
Collection code (our stat1)
Level of public (our stat2)
Date of order
Date of reception
Quantity (received/ordered)
Date of cancellation

2 - show a summary of those information in "item" tab, ONLY if no real items have been created.

3 - show the same information in OPAC

M. Saby
Comment 11 Amit Gupta 2013-04-23 16:18:51 UTC Comment hidden (obsolete)
Comment 12 Katrin Fischer 2013-04-23 16:22:29 UTC
Hi Amit, thank you for fixing the capitalization problems. There is still one open problem - we need a unit test for the new &GetBudgetInfoFromItemnumber.
Comment 13 Amit Gupta 2013-04-24 09:28:46 UTC Comment hidden (obsolete)
Comment 14 Pierre Angot 2013-05-30 07:59:07 UTC
Hello,

I'm questionning about the use of this patch. Why made a link to budget ? 

I've maybe misunderstood the goal of this patch. Can you give me more explaination ?
Comment 15 Amit Gupta 2013-05-30 08:03:30 UTC
Hi,

The purpose of this patch will show under which budget you ordered/purchased the item.
Comment 16 Pierre Angot 2013-05-30 08:26:03 UTC
Ok. 

I think the proposals that Mathieu did are more complete. Have you seen them ? It will be a good idea to work to include what Rennes2 did.

If evebody think this patch (10013) is essential, I can sign it (it works ^^).
Comment 17 Amit Gupta 2013-06-03 05:29:41 UTC Comment hidden (obsolete)
Comment 18 Amit Gupta 2013-06-03 05:39:46 UTC Comment hidden (obsolete)
Comment 19 Kyle M Hall 2013-08-02 16:02:45 UTC
Created attachment 20061 [details] [review]
Bug 10013 - Ability to link directly from an item in the Staff client to budget information.

To Test:
1) Create budget and fund under budget administration.
2) Create Vendor in acquisitons module.
3) Create basket under vendor.
4) Create order and choose budget while creating order.
5) Receive shipment.
6) Check in catalog details, in holding tab budget information column is displayed
, on click it should display the budget information.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 20 Kyle M Hall 2013-08-02 16:03:31 UTC Comment hidden (obsolete)
Comment 21 Kyle M Hall 2013-08-02 16:07:27 UTC Comment hidden (obsolete)
Comment 22 Kyle M Hall 2013-08-02 16:10:09 UTC
The feature patch works as advertised, but I'm a bit confused by the unit test. There is language in it that says it's a stub, it it's not. Additionally, it doesn't mock any data, and fails for me. It makes invalid assumptions.
Comment 23 Amit Gupta 2013-10-18 15:38:45 UTC
Created attachment 22061 [details] [review]
Unit Test for newly created routine: GetBudgetInfoFromItemnumber

Kyle,

I have added the Test case for newly created routine: GetBudgetInfoFromItemnumber
Comment 24 I'm just a bot 2013-10-30 07:37:12 UTC
Applying: Bug 10013 - Ability to link directly from an item in the Staff client to budget information.
Using index info to reconstruct a base tree...
M	C4/Acquisition.pm
M	catalogue/detail.pl
M	koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt
Falling back to patching base and 3-way merge...
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt
Auto-merging catalogue/detail.pl
Auto-merging C4/Acquisition.pm
CONFLICT (content): Merge conflict in C4/Acquisition.pm
Patch failed at 0001 Bug 10013 - Ability to link directly from an item in the Staff client to budget information.
The copy of the patch that failed is found in:
   /home/christopher/git/koha/.git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Comment 25 Jonathan Druart 2015-02-26 12:21:10 UTC
This has been selected by someone for the hackfest in Marseille, but the patches are not testable.
Any chance to see this rebased?
Comment 26 Katrin Fischer 2019-05-04 20:58:08 UTC
I feel like this is covered by the acquisitions tab added to the detail page after this bug was files. Please reopen if I am mistaken with information on what else is needed.