From 2e7d27dedf5456c7ae595b0d438995fc62a23f01 Mon Sep 17 00:00:00 2001 From: Amit Gupta Date: Thu, 30 May 2013 13:02:05 +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 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. Atleast one quantity and fund will be there if you try to delete it will show one error message. --- acqui/addorder.pl | 11 +- .../prog/en/modules/acqui/neworderempty.tt | 116 +++++++++++++++----- 2 files changed, 97 insertions(+), 30 deletions(-) diff --git a/acqui/addorder.pl b/acqui/addorder.pl index 077adaf..82ff9d7 100755 --- a/acqui/addorder.pl +++ b/acqui/addorder.pl @@ -156,6 +156,8 @@ $orderinfo->{'uncertainprice'} ||= 0; $orderinfo->{subscriptionid} ||= undef; my $user = $input->remote_user; +my @budget_id = $input->param("budget_id"); +my @quantity = $input->param("quantity"); # create, modify or delete biblio # create if $quantity>=0 and $existing='no' @@ -205,7 +207,14 @@ if ( $orderinfo->{quantity} ne '0' ) { ModOrder( $orderinfo); } else { # else, it's a new line - @$orderinfo{qw(basketno ordernumber )} = NewOrder($orderinfo); + my $i = 0; + foreach my $budget_id (@budget_id) { + $$orderinfo{budget_id} = $budget_id; + my $quantity = @quantity[$i]; + $$orderinfo{quantity} = $quantity; + @$orderinfo{qw(basketno ordernumber )} = NewOrder($orderinfo); + $i++; + } } # 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..5d08313 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,61 @@ $(document).ready(function() }); //]]> + @@ -391,13 +446,36 @@ $(document).ready(function() [% END %][%# IF (AcqCreateItemOrdering) %]
Accounting Details -
    -
  1. - [% IF ( close ) %] - Quantity: +
      [% IF ( biblionumber ) %] [% ELSE %] + + + [% END %] + + + + + + + + + + + +
      [% IF ( close ) %] + [% Budget_name %] + [% ELSE %] + [% END %] [% IF ( close ) %] [% quantity %] - [% ELSE %] - + [% ELSE %] [% IF (AcqCreateItemOrdering) %] [% IF subscriptionid %] @@ -413,29 +491,9 @@ $(document).ready(function() [% END %] [% END %] - - -
    1. - [% IF ( close ) %] - Fund: - [% Budget_name %] - [% ELSE %] - - - - - [% END %] +
    2. [% IF ( close ) %] -- 1.7.9.5