Bugzilla – Attachment 18834 Details for
Bug 10209
The ability to order multiple copies of the same item from different funds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
The ability to order multiple copies of the same item, from different fund classes, on the same order number
0001-Bug-10209-The-ability-to-order-multiple-copies-of-th.patch (text/plain), 9.46 KB, created by
Amit Gupta
on 2013-06-11 05:28:42 UTC
(
hide
)
Description:
The ability to order multiple copies of the same item, from different fund classes, on the same order number
Filename:
MIME Type:
Creator:
Amit Gupta
Created:
2013-06-11 05:28:42 UTC
Size:
9.46 KB
patch
obsolete
>From ac8800cd409c6de9df94704b4bf266ca4a491c37 Mon Sep 17 00:00:00 2001 >From: Amit Gupta <amitddng135@gmail.com> >Date: Tue, 11 Jun 2013 10:54:33 +0530 >Subject: [PATCH] Bug 10209 - The ability to order multiple copies of the same > item, from different fund classes, on the same order number > >To Test: >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. > >You can not delete first budget and quantity. >--- > acqui/addorder.pl | 18 ++- > .../prog/en/modules/acqui/neworderempty.tt | 126 +++++++++++++++----- > 2 files changed, 114 insertions(+), 30 deletions(-) > >diff --git a/acqui/addorder.pl b/acqui/addorder.pl >index 077adaf..ba82e25 100755 >--- a/acqui/addorder.pl >+++ b/acqui/addorder.pl >@@ -156,6 +156,9 @@ $orderinfo->{'uncertainprice'} ||= 0; > $orderinfo->{subscriptionid} ||= undef; > > my $user = $input->remote_user; >+my $budget_id = $input->param('budget_id'); >+my $quantity = $input->param('quantity'); >+my $max_budget = $input->param('max_budget'); > > # create, modify or delete biblio > # create if $quantity>=0 and $existing='no' >@@ -204,8 +207,21 @@ if ( $orderinfo->{quantity} ne '0' ) { > if ($$orderinfo{ordernumber}) { > ModOrder( $orderinfo); > } >- else { # else, it's a new line >+ else { # else, it's a new line >+ $orderinfo->{budget_id} = $budget_id; >+ $orderinfo->{quantity} = $quantity; > @$orderinfo{qw(basketno ordernumber )} = NewOrder($orderinfo); >+ >+ for (my $j = 2; $j <= $max_budget; $j++) { >+ my $b = $input->param("b"."$j"); >+ my $q = $input->param("q"."$j"); >+ if (defined $b) { >+ $orderinfo->{budget_id} = $b; >+ $orderinfo->{quantity} = $q; >+ @$orderinfo{qw(basketno ordernumber )} = NewOrder($orderinfo); >+ } >+ } >+ > } > > # now, add items if applicable >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >index 87cfa8a..5c81add 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >@@ -149,6 +149,70 @@ $(document).ready(function() > }); > //]]> > </script> >+<script language="javascript"> >+ var maximum_budget = 1; >+ >+ function addRow(tableID) { >+ maximum_budget++; >+ document.getElementById('max_budget').value = maximum_budget; >+ var table = document.getElementById(tableID); >+ var rowCount = table.rows.length; >+ var row = table.insertRow(rowCount); >+ var cell1 = row.insertCell(0); >+ var element1 = document.createElement("input"); >+ element1.type = "checkbox"; >+ element1.name="chkbox[]"; >+ cell1.appendChild(element1); >+ >+ var cell2 = row.insertCell(1); >+ var b_id = 'b' + maximum_budget; >+ var createSelect = "<select name='" + b_id +"'"+ "id='" + b_id +"'>"; >+ var createOption = ""; >+ var object1 = document.getElementById('budget_id'); >+ for (i = 1; i < object1.options.length; i++) { >+ createOption = createOption + "<option value ='" + object1.options[i].value+"'>"+object1.options[i].text + "</option>"; >+ >+ } >+ >+ createSelect = createSelect + createOption + "</select>"; >+ cell2.innerHTML = createSelect; >+ var cell3 = row.insertCell(2); >+ var element2 = document.createElement("input"); >+ var q_id = 'q' + maximum_budget; >+ element2.type = "text"; >+ element2.name = q_id; >+ element2.id= q_id; >+ element2.value = 1; >+ cell3.appendChild(element2); >+ } >+ >+ function deleteRow(tableID) { >+ try { >+ var table = document.getElementById(tableID); >+ var rowCount = table.rows.length; >+ var checkedRowCount = 1; >+ for(var i=0; i<rowCount; i++) { >+ var row = table.rows[i]; >+ var chkbox = row.cells[0].childNodes[0]; >+ if(null != chkbox && true == chkbox.checked) { >+ checkedRowCount ++; >+ } >+ } >+ >+ for(var i=0; i<rowCount; i++) { >+ var row = table.rows[i]; >+ var chkbox = row.cells[0].childNodes[0]; >+ if(null != chkbox && true == chkbox.checked) { >+ table.deleteRow(i); >+ rowCount--; >+ i--; >+ } >+ } >+ } catch(e) { >+ alert(e); >+ } >+ } >+</script> > </head> > <body id="acq_neworderempty" class="acq"> > >@@ -391,13 +455,37 @@ $(document).ready(function() > [% END %][%# IF (AcqCreateItemOrdering) %] > <fieldset class="rows"> > <legend>Accounting Details</legend> >- <ol> >- <li> >- [% IF ( close ) %] >- <span class="label required">Quantity: </span> >+ <ol>[% IF ( biblionumber ) %] [% ELSE %] >+ <input type="button" value="Add fund and quantity" onclick="addRow('dataTable')" /> >+ <input type="button" value="Delete fund and quantity" onclick="deleteRow('dataTable')" /> >+ <input type="hidden" size="20" name="max_budget" id ="max_budget" value= 1 /> >+ [% END %] >+ <table id="dataTable" width="350px" border="1"> >+ <tr> >+ <td></td> >+ <td><label class="required" for="budget_id">Fund: </label></td> >+ <td><label class="required" for="quantity">Quantity: </label></td> >+ </tr> >+ <tr> >+ <td> </td> >+ <td> [% IF ( close ) %] >+ <input type="hidden" size="20" name="budget_id" id="budget_id" value="[% budget_id %]" />[% Budget_name %] >+ [% ELSE %] >+ <select id="budget_id" onchange="fetchSortDropbox(this.form)" size="1" name="budget_id"> >+ <option value="">Select a budget</option> >+ [% FOREACH budget_loo IN budget_loop %] >+ [% IF ( budget_loo.b_sel ) %] >+ <option value="[% budget_loo.b_id %]" selected="selected">[% budget_loo.b_txt %]</option> >+ [% ELSE %] >+ [% IF ( budget_loo.b_active ) %]<option value="[% budget_loo.b_id %]">[% budget_loo.b_txt %]</option> >+ [% ELSE %]<option value="[% budget_loo.b_id %]" class="b_inactive">[% budget_loo.b_txt %]</option> >+ [% END %] >+ [% END %] >+ [% END %] >+ </select> [% END %]</td> >+ <td> [% IF ( close ) %] > <input type="hidden" size="20" name="quantity" value="[% quantity %]" />[% quantity %] >- [% ELSE %] >- <label class="required" for="quantity">Quantity: </label> >+ [% ELSE %] > [% IF (AcqCreateItemOrdering) %] > [% IF subscriptionid %] > <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="1" /> >@@ -413,29 +501,9 @@ $(document).ready(function() > [% END %] > [% END %] > <!-- origquantityrec only here for javascript compatibility (additem.js needs it, useless here, usefull when receiveing an order --> >- <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="1" /> >- </li> >- <li> >- [% IF ( close ) %] >- <span class="label required">Fund: </span> >- <input type="hidden" size="20" name="budget_id" id="budget_id" value="[% budget_id %]" />[% Budget_name %] >- [% ELSE %] >- <label class="required" for="budget_id">Fund: </label> >- <select id="budget_id" onchange="fetchSortDropbox(this.form)" size="1" name="budget_id"> >- <option value="">Select a budget</option> >- [% FOREACH budget_loo IN budget_loop %] >- [% IF ( budget_loo.b_sel ) %] >- <option value="[% budget_loo.b_id %]" selected="selected">[% budget_loo.b_txt %]</option> >- [% ELSE %] >- [% IF ( budget_loo.b_active ) %]<option value="[% budget_loo.b_id %]">[% budget_loo.b_txt %]</option> >- [% ELSE %]<option value="[% budget_loo.b_id %]" class="b_inactive">[% budget_loo.b_txt %]</option> >- [% END %] >- [% END %] >- [% END %] >- </select> >- <label for="showallbudgets" style="float:none;width:auto;"> Show all:</label> >- <input type="checkbox" id="showallbudgets" /> >- [% END %] >+ <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="1" /></td> >+ </tr> >+ </table> > </li> > <li> > [% IF ( close ) %] >-- >1.7.9.5 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10209
:
18515
|
18588
|
18792
|
18834
|
18854