Bug 10209 - The ability to order multiple copies of the same item, from different fund classes
Summary: The ability to order multiple copies of the same item, from different fund cl...
Status: Patch doesn't apply
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Amit Gupta
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-06 23:19 UTC by Amit Gupta
Modified: 2018-05-18 12:27 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Text to go in the release notes:
Version(s) released in:


Attachments
The ability to order multiple copies of the same item, from different fund classes, on the same order number (8.62 KB, patch)
2013-05-30 11:01 UTC, Amit Gupta
Details | Diff | Splinter Review
The ability to order multiple copies of the same item, from different fund classes, on the same order number (8.62 KB, patch)
2013-06-02 07:48 UTC, Amit Gupta
Details | Diff | Splinter Review
The ability to order multiple copies of the same item, from different fund classes, on the same order number (9.40 KB, patch)
2013-06-10 03:15 UTC, Amit Gupta
Details | Diff | Splinter Review
The ability to order multiple copies of the same item, from different fund classes, on the same order number (9.46 KB, patch)
2013-06-11 05:28 UTC, Amit Gupta
Details | Diff | Splinter Review
The ability to order multiple copies of the same item, from different fund classes, on the same order number (10.18 KB, patch)
2013-06-11 18:08 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-05-06 23:19:12 UTC
The ability to order multiple copies of the same item, from different fund classes, on the same order number
Comment 1 Amit Gupta 2013-05-30 11:01:59 UTC Comment hidden (obsolete)
Comment 2 Amit Gupta 2013-06-02 07:48:30 UTC Comment hidden (obsolete)
Comment 3 Srdjan Jankovic 2013-06-03 05:05:44 UTC
Amit,
I know it works this way, but would you please consider changing it to create separate var names, like budget_1 quantity_1, budget_2 quantity_2 etc, and maybe maintain num_budgets var or similar. As I said, I know it works without it, but html spec does not guarantee submission of multiple values in any particular order.
Thanks.
Comment 4 Amit Gupta 2013-06-03 18:09:00 UTC
Hi Srdjan Jankovic,

If we have three row say budget1 quantity1, budget2 quantity2, budget3 quantity3 etc suppose if i delete the second row so i we identify the remaining items ID.
Comment 5 Srdjan Jankovic 2013-06-04 00:22:02 UTC
You can maintain hidden num_budgets or max_budget input var. Upon submit, you go through budget1, budget2, ... budget[max_]budget], and skip if not set
Comment 6 Katrin Fischer 2013-06-06 06:33:15 UTC
Hi Amit,

can you please take a look at Srdjan's comments?  I would also like to point out that our use of budget/fund is a bit confusing, as we are actually displaying what we call a fund in Koha, but it's called budget all over the place in the code. Not sure if there is a way to resolve this at this point in time.

Can you please also check the wording of the alert message?
Failing the patch for now, because the Javascript contains untranslatable strings.
Comment 7 Amit Gupta 2013-06-06 06:43:49 UTC
Hi Kartin,

I am looking your and Srdjan's comments and will recreate the patch.
Comment 8 Amit Gupta 2013-06-10 03:15:03 UTC Comment hidden (obsolete)
Comment 9 Srdjan Jankovic 2013-06-11 02:00:38 UTC
Amit,

You have a line there
my $i = 0;

$i is never used. Is that ok?

Also, $$orderinfo{budget_id} is correct, however $orderinfo->{budget_id} is a bit easier to read, and I believe is standard in Koha.

I'm going away for a month, so please ask someone else to sign it off if you are in a hurry. Otherwise, I'll do it when I'm back.
Comment 10 Amit Gupta 2013-06-11 04:48:05 UTC
Hi Srdjan,

By mistaken variable $i is declared i will clean up the code and send it to again.
Comment 11 Srdjan Jankovic 2013-06-11 05:08:30 UTC
Oh yes, and another thing - I'm not sure if

if ($b ne undef)

works as you would expect. Usually you would say if (defined $b). But if ($b) should be enough (and best I believe, because it protects from '').
Comment 12 Amit Gupta 2013-06-11 05:28:42 UTC Comment hidden (obsolete)
Comment 13 Amit Gupta 2013-06-11 18:08:48 UTC
Created attachment 18854 [details] [review]
The ability to order multiple copies of the same  item, from different fund classes, on the same order number

Hi Srdjan,

I have apply your comment's. Please look the patch

Test Plan:
1) Create a basket.
2) Click on new order empty record.
3) Give title, quantity and select fund.
4) Order multiple copies of the same item click
on Add fund and quantity button it will add one more
fund and quantity by default quantity will be 1.
5) For delete fund and quantity simply click on
Delete fund and quantity.
Comment 14 Srdjan Jankovic 2013-07-10 03:26:41 UTC
Amit, it looks to me that you are creating multiple orders, with different  ordernumber. Is that what you intended?
Comment 15 Amit Gupta 2013-07-10 03:56:49 UTC
Yes creating multiple order with different ordernumber.
Comment 16 Srdjan Jankovic 2013-07-10 06:04:58 UTC
This won't work for AcqCreateItem 'ordering'. It will create all order items for the last order only.
What needs to be done is store ordernumber and quantity from the loop (together with the first values), and use that when calling NewOrderItem().
Comment 17 I'm just a bot 2013-09-18 09:54:45 UTC
Applying: Bug 10209 - The ability to order multiple copies of the same item, from different fund classes, on the same order number
Using index info to reconstruct a base tree...
M	acqui/addorder.pl
M	koha-tmpl/intranet-tmpl/prog/en/js/additem.js
M	koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt
Falling back to patching base and 3-way merge...
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt
CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt
Auto-merging koha-tmpl/intranet-tmpl/prog/en/js/additem.js
Auto-merging acqui/addorder.pl
Patch failed at 0001 Bug 10209 - The ability to order multiple copies of the same item, from different fund classes, on the same order number
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 18 Marjorie Barry-Vila 2015-01-23 16:17:00 UTC
Hi,
Is anyone working on this?


Regards,
Marjorie