@@ -, +, @@ item, from different fund classes, on the same order number --- acqui/addorder.pl | 18 ++- koha-tmpl/intranet-tmpl/prog/en/js/additem.js | 1 + .../prog/en/modules/acqui/neworderempty.tt | 126 +++++++++++++++----- 3 files changed, 115 insertions(+), 30 deletions(-) --- a/acqui/addorder.pl +++ a/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 --- a/koha-tmpl/intranet-tmpl/prog/en/js/additem.js +++ a/koha-tmpl/intranet-tmpl/prog/en/js/additem.js @@ -14,6 +14,7 @@ function addItem( node, unique_item_fields ) { addItemInList(index, unique_item_fields); $("#" + index).find("a[name='buttonPlus']").text("Update"); $("#quantity").val(current_qty + 1).change(); + document.getElementById("quantity").readOnly = false; } else if ( current_qty >= max_qty ) { alert(window.MSG_ADDITEM_JS_CANT_RECEIVE_MORE_ITEMS || "You can't receive any more items."); --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt +++ a/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 ) %] --