From ac8800cd409c6de9df94704b4bf266ca4a491c37 Mon Sep 17 00:00:00 2001 From: Amit Gupta 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() }); //]]> + @@ -391,13 +455,37 @@ $(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 +501,9 @@ $(document).ready(function() [% END %] [% END %] - - -
    1. - [% IF ( close ) %] - Fund: - [% Budget_name %] - [% ELSE %] - - - - - [% END %] +
    2. [% IF ( close ) %] -- 1.7.9.5