From 0f0641bcbe152d7da7c1ba091ad97e5b983eecbf Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 8 Mar 2012 17:25:06 +0100 Subject: [PATCH] Bug 7180: Order from staged file improvements This patch adds: - 1 syspref MarcFieldsToOrder - 1 ajax script acqui/ajax-getauthvaluedropbox.pl - 1 routine C4::Budgets::GetBudgetByCode Before this patch you were not able to order 1 or all the records from your staged file. You were allowed to specify some information ("Import All" and "Accounting details" areas) for the order. With this patch, the previous behaviours still exist. But now you can *select* which records you want to ordered. For these ones you can specify independently informations (Quantity, price, budget, sort1 and sort2). The cherry on the cake is that you can pre-fill these information with values Test plan: 1. Fill the new syspref MarcFieldsToOrder with something like: ==BEGIN== price: 947$c quantity: 969$h budget_code: 922$a rrp: 010$d discount: 969$d sort1: 923$a sort2: 924$a ==END== The empty line at the end is mandatory! The budget (corresponding to your budget_code) can be filled with authorized value categories (statistic 1 and 2). The sort1 and sort2 values can be filled with the an authorized value (of the category previously selected) 2. Choose randomly one or more biblio(s) and fill fields with what is relevant. 3. Export the biblio and import it (with the "Stage MARC records for import" tool). 4. Go on a basket and add an order from a staged file. Select your staged file. 5. Well. Now you can see your biblio (or biblios if your had exported more than one). For each one, informations should be pre-filled with the biblio values. The budget should be selected on the budget corresponding to the budget_code (in the field 922$a) and the "planning values" too (with fields 923$a and 924$a). You can modify these values (or not) and choose a default value for budget and planning values (in the "Accounting details" area). 6. Save and check the prices values. Modify the order and check that budget and sort* are good Prices are calculated following some parameters: if there is no price => listprice = 0 else => - the gstrate value for your order is the gstrate value of the bookseller - discount = if filled : the discount value / 100 else: the discount value of the bookseller - if the bookseller includes tax( List item price includes tax: Yes ) if a discount exists: ecost = price rrp = ecost / ( 1 - discount ) else: # a discount does not exist ecost = price * ( 1 - discount ) rrp = price else # the bookseller does not include tax if a discount exists: ecost = price / ( 1 + gstrate ) rrp = ecost / ( 1 - discount ) else: # a discount does not exist rrp = price / ( 1 + gstrate ) ecost = rrp * ( 1 - discount ) - in all cases: listprice = rrp / currency rate unitprice = ecost total = ecost * quantity 7. Retry with different parameters 8. Check the 'Import all' action still works --- C4/Budgets.pm | 24 + acqui/addorderiso2709.pl | 166 +++++-- acqui/ajax-getauthvaluedropbox.pl | 73 +++ installer/data/mysql/updatedatabase.pl | 11 + koha-tmpl/intranet-tmpl/prog/en/js/acq.js | 93 +--- .../prog/en/modules/acqui/addorderiso2709.tt | 475 +++++++++++--------- .../en/modules/admin/preferences/acquisitions.pref | 4 + 7 files changed, 523 insertions(+), 323 deletions(-) create mode 100755 acqui/ajax-getauthvaluedropbox.pl diff --git a/C4/Budgets.pm b/C4/Budgets.pm index 758e98f..1db4eef 100644 --- a/C4/Budgets.pm +++ b/C4/Budgets.pm @@ -35,6 +35,7 @@ BEGIN { &GetBudget &GetBudgetByOrderNumber + &GetBudgetByCode &GetBudgets &GetBudgetHierarchy &AddBudget @@ -697,6 +698,29 @@ sub GetBudgetByOrderNumber { return $result; } +=head2 GetBudgetByCode + + my $budget = &GetBudgetByCode($budget_code); + +Retrieve all aqbudgets fields as a hashref for the budget that has +given budget_code + +=cut + +sub GetBudgetByCode { + my ( $budget_code ) = @_; + + my $dbh = C4::Context->dbh; + my $query = qq{ + SELECT * + FROM aqbudgets + WHERE budget_code = ? + }; + my $sth = $dbh->prepare( $query ); + $sth->execute( $budget_code ); + return $sth->fetchrow_hashref; +} + =head2 GetChildBudgetsSpent &GetChildBudgetsSpent($budget-id); diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl index e56bd06..2946598 100755 --- a/acqui/addorderiso2709.pl +++ b/acqui/addorderiso2709.pl @@ -21,11 +21,11 @@ # with Koha; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -use strict; -use warnings; +use Modern::Perl; use CGI; use Carp; use Number::Format qw(:all); +use YAML qw/Load/; use C4::Context; use C4::Auth; @@ -56,7 +56,7 @@ my ($template, $loggedinuser, $cookie, $userflags) = get_template_and_user({ }); my $cgiparams = $input->Vars; -my $op = $cgiparams->{'op'}; +my $op = $cgiparams->{'op'} || ''; my $booksellerid = $input->param('booksellerid'); my $bookseller = GetBookSellerFromId($booksellerid); my $data; @@ -65,7 +65,6 @@ $template->param(scriptname => "/cgi-bin/koha/acqui/addorderiso2709.pl", booksellerid => $booksellerid, booksellername => $bookseller->{name}, ); -my $ordernumber; if ($cgiparams->{'import_batch_id'} && $op eq ""){ $op = "batch_details"; @@ -124,7 +123,7 @@ if ($op eq ""){ loop_currencies => \@loop_currency, ); import_biblios_list($template, $cgiparams->{'import_batch_id'}); - if ( C4::Context->preference('AcqCreateItem') eq 'ordering' && !$ordernumber ) { + if ( C4::Context->preference('AcqCreateItem') eq 'ordering' ) { # prepare empty item form my $cell = PrepareItemrecordDisplay( '', '', '', 'ACQ' ); @@ -157,19 +156,37 @@ if ($op eq ""){ # retrieve the file you want to import my $import_batch_id = $cgiparams->{'import_batch_id'}; my $biblios = GetImportRecordsRange($import_batch_id); + my @import_record_id_selected = $input->param("import_record_id"); + my @quantities = $input->param('quantity'); + my @prices = $input->param('price'); + my @budgets_id = $input->param('budget_id'); + my @rrp = $input->param('rrp'); + my @discount = $input->param('discount'); + my @sort1 = $input->param('sort1'); + my @sort2 = $input->param('sort2'); + my $cur = GetCurrency(); for my $biblio (@$biblios){ - # 1st insert the biblio, or find it through matcher + # Check if this import_record_id was selected + next if not grep { $_ eq $$biblio{import_record_id} } @import_record_id_selected; my ( $marcblob, $encoding ) = GetImportRecordMarc( $biblio->{'import_record_id'} ); my $marcrecord = MARC::Record->new_from_usmarc($marcblob) || die "couldn't translate marc information"; my $match = GetImportRecordMatches( $biblio->{'import_record_id'}, 1 ); my $biblionumber=$#$match > -1?$match->[0]->{'biblionumber'}:0; + my $c_quantity = shift( @quantities ) || GetMarcQuantity($marcrecord, C4::Context->preference('marcflavour') ) || 1; + my $c_budget_id = shift( @budgets_id ) || $input->param('all_budget_id') || $budget_id; + my $c_rrp = shift( @rrp ); # rrp include tax + my $c_discount = shift ( @discount); + $c_discount = $c_discount / 100 if $c_discount > 100; + my $c_sort1 = shift( @sort1 ) || $input->param('all_sort1') || ''; + my $c_sort2 = shift( @sort2 ) || $input->param('all_sort2') || ''; + # 1st insert the biblio, or find it through matcher unless ( $biblionumber ) { # add the biblio my $bibitemnum; # remove ISBN - - my ( $isbnfield, $isbnsubfield ) = GetMarcFromKohaField( 'biblioitems.isbn', '' ); + my ( $isbnfield, $isbnsubfield ) = GetMarcFromKohaField( 'biblioitems.isbn', '' ); if ( $marcrecord->field($isbnfield) ) { foreach my $field ( $marcrecord->field($isbnfield) ) { foreach my $subfield ( $field->subfield($isbnsubfield) ) { @@ -180,7 +197,6 @@ if ($op eq ""){ } } ( $biblionumber, $bibitemnum ) = AddBiblio( $marcrecord, $cgiparams->{'frameworkcode'} || '' ); - SetImportRecordStatus( $biblio->{'import_record_id'}, 'imported' ); # 2nd add authorities if applicable if (C4::Context->preference("BiblioAddsAuthorities")){ my $headings_linked =BiblioAutoLink($marcrecord, $cgiparams->{'frameworkcode'}); @@ -194,47 +210,53 @@ if ($op eq ""){ # get quantity in the MARC record (1 if none) my $quantity = GetMarcQuantity($marcrecord, C4::Context->preference('marcflavour')) || 1; my %orderinfo = ( - "biblionumber", $biblionumber, "basketno", $cgiparams->{'basketno'}, - "quantity", $quantity, "branchcode", $branch, - "budget_id", $budget_id, "uncertainprice", 1, - "sort1", $cgiparams->{'sort1'},"sort2", $cgiparams->{'sort2'}, - "notes", $cgiparams->{'notes'}, "budget_id", $cgiparams->{'budget_id'}, - "currency",$cgiparams->{'currency'}, + biblionumber => $biblionumber, + basketno => $cgiparams->{'basketno'}, + quantity => $c_quantity, + branchcode => $patron->{branchcode}, + budget_id => $c_budget_id, + uncertainprice => 1, + sort1 => $c_sort1, + sort2 => $c_sort2, + notes => $cgiparams->{'all_notes'}, + currency => $cgiparams->{'all_currency'}, ); - - my $price = GetMarcPrice($marcrecord, C4::Context->preference('marcflavour')); - + # get the price if there is one. + my $price= shift( @prices ) || GetMarcPrice($marcrecord, C4::Context->preference('marcflavour')); if ($price){ - eval { - require C4::Acquisition; - import C4::Acquisition qw/GetBasket/; - }; - if ($@){ - croak $@; - } - eval { - require C4::Bookseller; - import C4::Bookseller qw/GetBookSellerFromId/; - }; - if ($@){ - croak $@; - } - my $basket = GetBasket( $orderinfo{basketno} ); - my $bookseller = GetBookSellerFromId( $basket->{booksellerid} ); + # in France, the cents separator is the , but sometimes, ppl use a . + # in this case, the price will be x100 when unformatted ! Replace the . by a , to get a proper price calculation + $price =~ s/\./,/ if C4::Context->preference("CurrencyFormat") eq "FR"; + $price = $num->unformat_number($price); $orderinfo{gstrate} = $bookseller->{gstrate}; - $orderinfo{rrp} = $price; - $orderinfo{ecost} = $orderinfo{rrp} * ( 1 - $bookseller->{discount} / 100 ); - $orderinfo{listprice} = $orderinfo{rrp}; + my $c = $c_discount ? $c_discount / 100 : $bookseller->{discount} / 100; + if ( $bookseller->{listincgst} ) { + if ( $c_discount ) { + $orderinfo{ecost} = $price; + $orderinfo{rrp} = $orderinfo{ecost} / ( 1 - $c ); + } else { + $orderinfo{ecost} = $price * ( 1 - $c ); + $orderinfo{rrp} = $price; + } + } else { + if ( $c_discount ) { + $orderinfo{ecost} = $price / ( 1 + $orderinfo{gstrate} ); + $orderinfo{rrp} = $orderinfo{ecost} / ( 1 - $c ); + } else { + $orderinfo{rrp} = $price / ( 1 + $orderinfo{gstrate} ); + $orderinfo{ecost} = $orderinfo{rrp} * ( 1 - $c ); + } + } + $orderinfo{listprice} = $orderinfo{rrp} / $cur->{rate}; $orderinfo{unitprice} = $orderinfo{ecost}; - $orderinfo{total} = $orderinfo{ecost}; + $orderinfo{total} = $orderinfo{ecost} * $c_quantity; } else { - $orderinfo{'listprice'} = 0; + $orderinfo{listprice} = 0; } # remove uncertainprice flag if we have found a price in the MARC record $orderinfo{uncertainprice} = 0 if $orderinfo{listprice}; - my $basketno; - ( $basketno, $ordernumber ) = NewOrder( \%orderinfo ); + my ( $basketno, $ordernumber ) = NewOrder( \%orderinfo ); # 4th, add items if applicable # parse the item sent by the form, and create an item just for the import_record_id we are dealing with @@ -254,12 +276,10 @@ if ($op eq ""){ push @{ $item->{indicator} }, $indicator[0]; my $xml = TransformHtmlToXml( \@tags, \@subfields, \@field_values, \@ind_tag, \@indicator ); my $record = MARC::Record::new_from_xml( $xml, 'UTF-8' ); - for (my $qtyloop=1;$qtyloop <=$quantity;$qtyloop++) { + for (my $qtyloop=1;$qtyloop <= $c_quantity;$qtyloop++) { my ( $biblionumber, $bibitemnum, $itemnumber ) = AddItemFromMarc( $record, $biblionumber ); NewOrderItem( $itemnumber, $ordernumber ); } - } else { - SetImportRecordStatus( $biblio->{'import_record_id'}, 'imported' ); } } # go to basket page @@ -276,8 +296,8 @@ my $budget = GetBudget($budget_id); # build budget list my $budget_loop = []; -$budgets = GetBudgetHierarchy; -foreach my $r ( @{$budgets} ) { +my $budgets_hierarchy = GetBudgetHierarchy; +foreach my $r ( @{$budgets_hierarchy} ) { next unless (CanUserUseBudget($borrower, $r, $userflags)); if ( !defined $r->{budget_amount} || $r->{budget_amount} == 0 ) { next; @@ -285,6 +305,8 @@ foreach my $r ( @{$budgets} ) { push @{$budget_loop}, { b_id => $r->{budget_id}, b_txt => $r->{budget_name}, + b_sort1_authcat => $r->{'sort1_authcat'}, + b_sort2_authcat => $r->{'sort2_authcat'}, b_sel => ( $r->{budget_id} == $budget_id ) ? 1 : 0, }; } @@ -296,7 +318,8 @@ if ($budget) { # its a mod .. $CGIsort1 = GetAuthvalueDropbox( $budget->{'sort1_authcat'}, $data->{'sort1'} ); } } elsif ( scalar(@$budgets) ) { - $CGIsort1 = GetAuthvalueDropbox( @$budgets[0]->{'sort1_authcat'}, '' ); +} elsif ( scalar(@$budgets_hierarchy) ) { + $CGIsort1 = GetAuthvalueDropbox( @$budgets_hierarchy[0]->{'sort1_authcat'}, '' ); } # if CGIsort is successfully fetched, the use it # else - failback to plain input-field @@ -311,8 +334,8 @@ if ($budget) { if ( defined $budget->{'sort2_authcat'} ) { $CGIsort2 = GetAuthvalueDropbox( $budget->{'sort2_authcat'}, $data->{'sort2'} ); } -} elsif ( scalar(@$budgets) ) { - $CGIsort2 = GetAuthvalueDropbox( @$budgets[0]->{sort2_authcat}, '' ); +} elsif ( scalar(@$budgets_hierarchy) ) { + $CGIsort2 = GetAuthvalueDropbox( @$budgets_hierarchy[0]->{sort2_authcat}, '' ); } if ($CGIsort2) { $template->param( CGIsort2 => $CGIsort2 ); @@ -377,9 +400,34 @@ sub import_biblios_list { record_sequence => $biblio->{'record_sequence'}, overlay_status => $biblio->{'overlay_status'}, match_biblionumber => $#$match > -1 ? $match->[0]->{'biblionumber'} : 0, - match_citation => $#$match > -1 ? $match->[0]->{'title'} . ' ' . $match->[0]->{'author'} : '', + match_citation => $#$match > -1 ? $match->[0]->{'title'} || '' . ' ' . $match->[0]->{'author'} || '': '', match_score => $#$match > -1 ? $match->[0]->{'score'} : 0, ); + my ( $marcblob, $encoding ) = GetImportRecordMarc( $biblio->{'import_record_id'} ); + my $marcrecord = MARC::Record->new_from_usmarc($marcblob) || die "couldn't translate marc information"; + my $infos = get_infos_syspref($marcrecord, ['price', 'quantity', 'budget_code', 'rrp', 'discount', 'sort1', 'sort2']); + my $price = $infos->{price}; + my $quantity = $infos->{quantity}; + my $budget_code = $infos->{budget_code}; + my $rrp = $infos->{rrp}; + my $discount = $infos->{discount}; + my $sort1 = $infos->{sort1}; + my $sort2 = $infos->{sort2}; + my $budget_id; + if($budget_code) { + my $biblio_budget = GetBudgetByCode($budget_code); + if($biblio_budget) { + $budget_id = $biblio_budget->{budget_id}; + } + } + $cellrecord{price} = $price || ''; + $cellrecord{quantity} = $quantity || ''; + $cellrecord{budget_id} = $budget_id || ''; + $cellrecord{rrp} = $rrp || ''; + $cellrecord{discount} = $discount || ''; + $cellrecord{sort1} = $sort1 || ''; + $cellrecord{sort2} = $sort2 || ''; + push @list, \%cellrecord; } my $num_biblios = $batch->{'num_biblios'}; @@ -439,3 +487,23 @@ sub add_matcher_list { } $template->param(available_matchers => \@matchers); } + +sub get_infos_syspref { + my ($record, $field_list) = @_; + my $syspref = C4::Context->preference('MarcFieldsToOrder'); + my $yaml = YAML::Load($syspref); + my $r; + for my $field_name ( @$field_list ) { + my @fields = split /\|/, $yaml->{$field_name}; + for my $field ( @fields ) { + my ( $f, $sf ) = split /\$/, $field; + next unless $f and $sf; + if ( my $v = $record->subfield( $f, $sf ) ) { + $r->{$field_name} = $v; + } + last if $yaml->{$field}; + } + } + return $r; +} + diff --git a/acqui/ajax-getauthvaluedropbox.pl b/acqui/ajax-getauthvaluedropbox.pl new file mode 100755 index 0000000..86f440c --- /dev/null +++ b/acqui/ajax-getauthvaluedropbox.pl @@ -0,0 +1,73 @@ +#!/usr/bin/perl + +# Copyright 2012 BibLibre +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +=head1 NAME + +ajax-getauthvaluedropbox.pl - returns an authorised values dropbox + +=head1 DESCRIPTION + +this script returns an authorised values dropbox + +=head1 CGI PARAMETERS + +=over 4 + +=item name + +The name of the dropbox. + +=item category + +The category of authorised values. + +=item default + +Default value for the dropbox. + +=back + +=cut + +use Modern::Perl; + +use CGI; +use C4::Budgets; +use C4::Charset; + +my $input = new CGI; +my $name = $input->param('name'); +my $category = $input->param('category'); +my $default = $input->param('default'); +$default = C4::Charset::NormalizeString($default); + +binmode STDOUT, ':encoding(UTF-8)'; +print $input->header(-type => 'text/plain', -charset => 'UTF-8'); +my $avs = GetAuthvalueDropbox($category, $default); +my $html = qq||; + +print $html; diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 1311068..e48f166 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -7931,6 +7931,17 @@ if(CheckVersion($DBversion)) { } + + + + +$DBversion = "3.13.00.XXX"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('MarcFieldsToOrder','','Set the mapping values for a new order line created from a marcrecord (staged file). In a YAML format.', NULL, 'textarea')"); + print "Upgrade to $DBversion done (Bug 7180: Added MarcFieldsToOrder syspref)\n"; + SetVersion ($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js b/koha-tmpl/intranet-tmpl/prog/en/js/acq.js index 3fde6f1..f89bb55 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/acq.js @@ -672,84 +672,29 @@ function calcNewsuggTotal(){ return true; } - -// ---------------------------------------- -//USED BY NEWORDEREMPTY.PL -/* -function fetchSortDropbox(f) { - var budgetId=f.budget_id.value; - var handleSuccess = function(o){ - if(o.responseText !== undefined){ - sort_dropbox.innerHTML = o.responseText; - } - } - - var callback = { success:handleSuccess }; - var sUrl = '../acqui/fetch_sort_dropbox.pl?sort=1&budget_id='+budgetId - var sort_dropbox = document.getElementById('sort1'); - var request1 = YAHOO.util.Connect.asyncRequest('GET', sUrl, callback); - var rr = '00'; - -// FIXME: --------- twice , coz the 2 requests get mixed up otherwise - - var handleSuccess2 = function(o){ - if(o.responseText !== undefined){ - sort2_dropbox.innerHTML = o.responseText; - } - } - - var callback2 = { success:handleSuccess }; - var sUrl2 = '../acqui/fetch_sort_dropbox.pl?sort=2&budget_id='+budgetId; - var sort2_dropbox = document.getElementById('sort2'); - var request2 = YAHOO.util.Connect.asyncRequest('GET', sUrl2, callback2); - -} -*/ - - - -//USED BY NEWORDEREMPTY.PL -function fetchSortDropbox(f) { - var budgetId=f.budget_id.value; - -for (i=1;i<=2;i++) { - - var sort_zone = document.getElementById('sort'+i+'_zone'); - var url = '../acqui/fetch_sort_dropbox.pl?sort='+i+'&budget_id='+budgetId; - - var xmlhttp = null; - xmlhttp = new XMLHttpRequest(); - if ( typeof xmlhttp.overrideMimeType != 'undefined') { - xmlhttp.overrideMimeType('text/xml'); - } - - xmlhttp.open('GET', url, false); - xmlhttp.send(null); - - xmlhttp.onreadystatechange = function() { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { - // stupid JS... - } else { - // wait for the call to complete - } - }; - // rc = eval ( xmlhttp.responseText ); - var retRootType = xmlhttp.responseXML.firstChild.nodeName; - var existingInputs = sort_zone.getElementsByTagName('input'); - if (existingInputs.length > 0 && retRootType == 'input') { - // when sort is already an input, do not override to preseve value +function getAuthValueDropbox( name, cat, destination, selected ) { + if (cat == null || cat == "") { + $(destination).replaceWith(' ' ); return; } - sort_zone.innerHTML = xmlhttp.responseText; -} + $.ajax({ + url: "/cgi-bin/koha/acqui/ajax-getauthvaluedropbox.pl", + data: { + name: name, + category: cat, + default: selected + }, + async: false, + success: function(data){ + if(data === "0"){ + $(destination).replaceWith(' ' ); + }else{ + $(destination).replaceWith(data); + } + } + }); } - - - - - - //USED BY NEWORDEREMPTY.PL function totalExceedsBudget(budgetId, total) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt index 48a21b9..95be656 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt @@ -10,8 +10,8 @@ [% INCLUDE 'doc-head-close.inc' %] [% INCLUDE 'datatables.inc' %] + - @@ -53,208 +114,222 @@
[% IF ( batch_details ) %] -

Add orders from [% comments %] +

Add orders from [% comments %] ([% file_name %] staged on [% upload_timestamp | $KohaDates with_hours => 1 %]) -

-
-
- - - - - - - [% FOREACH biblio_lis IN biblio_list %] - - - - - - [% IF ( biblio_lis.match_biblionumber ) %] - - - - [% END %] - [% END %] -
CitationMatch?Order
- [% biblio_lis.citation %] - - [% biblio_lis.overlay_status %]Add order
   Matches biblio [% biblio_lis.match_biblionumber %] (score = [% biblio_lis.match_score %]): [% biblio_lis.match_citation %]
-
-
- [% IF ( pages ) %] -
- Page - [% FOREACH page IN pages %] - [% IF ( page.current_page ) %] - [% page.page_number %] - [% ELSE %] - [% page.page_number %] - [% END %] - [% END %] - [% END %] - [% ELSE %] -
-

Choose the file to add to the basket

- - - - - - - - - - - - - [% FOREACH batch_lis IN batch_list %] - - - - - - - - - [% END %] - -
File nameCommentsStatusStaged# Bibs 
[% batch_lis.file_name %][% batch_lis.comments %][% batch_lis.import_status %][% batch_lis.staged_date | $KohaDates with_hours => 1 %][% batch_lis.num_biblios %]Add orders
-
- [% END %] -
- [% IF ( import_batch_id ) %] -
-

Import all

-

Import all the lines in the basket with the following parameters:

-
- - - - - - - [% FOREACH loop_currencie IN loop_currencies %] - - [% END %] + +
+ Check All + Uncheck All + + + + + + - [% IF ( items ) %] -
- Item - [% IF ( NoACQframework ) %] -
No ACQ framework, using default. You should create a framework with code ACQ, the items framework would be used
- [% END %] + [% FOREACH cur IN loop_currencies %] + + [% END %] - [% FOREACH item IN items %] -
-
-
    [% FOREACH iteminformatio IN item.iteminformation %]
  1. -
    - [% IF (iteminformatio.mandatory) %] - + [% FOREACH biblio IN biblio_list %] +
    + + + + [% biblio.overlay_status %] + [% IF ( biblio.match_biblionumber ) %] + Matches biblio [% biblio.match_biblionumber %] (score = [% biblio.match_score %]): [% biblio.match_citation %] + [% END %] + + Quantity: + + + Price: + + + Discount: + + + [% IF ( close ) %] + Budget: + [% Budget_name %] [% ELSE %] - + + [% END %] - [% iteminformatio.marc_value %] - - - - - - [% IF ( iteminformatio.mandatory ) %] Required[% END %] -
  2. + + + + + + + + + +
[% END %] - -
-
+
+

Import all

+

Import all the lines in the basket with the following parameters:

- [% END %] - - [% END %] -
- Accounting details -
    -
  1. - - -
  2. -
  3. - [% IF ( close ) %] - Budget: - [% Budget_name %] - [% ELSE %] -
  4. - - -
  5. -
  6. - - -
  7. - [% END %] - -
  8. - - -
  9. -
  10. The 2 following fields are available for your own usage. They can be useful for statistical purposes
    - - - [% IF CGIsort1 %] - + + + + + [% IF ( iteminformatio.mandatory ) %] Required[% END %] +
+ [% END %] + +
+
+ [% END %] + + [% END %] + +
+ Accounting details +
    +
  1. + + +
  2. +
  3. + [% IF ( close ) %] + Budget: + [% Budget_name %] [% ELSE %] - +
  4. + + +
  5. +
  6. + + +
  7. [% END %] - [% END %] - - [% ELSE %] - - [% END %] - - -
  8. - - - [% IF CGIsort2 %] - +
  9. +
  10. +
    The 2 following fields are available for your own usage. They can be useful for statistical purposes
    + + [% IF CGIsort1 %] + [% ELSE %] - + [% END %] - [% END %] - - [% ELSE %] - - [% END %] - -
  11. -
  12. - -
  13. -
-
-
- Cancel -
- -
- [% END %] + +
  • + + + [% IF CGIsort2 %] + + [% ELSE %] + + [% END %] + +
  • + + +
    + Cancel +
    + + + + [% ELSE %] +
    +

    Choose the file to add to the basket

    + + + + + + + + + + + + + [% FOREACH batch_lis IN batch_list %] + + + + + + + + + [% END %] + +
    File nameCommentsStatusStaged# Bibs 
    [% batch_lis.file_name %][% batch_lis.comments %][% batch_lis.import_status %][% batch_lis.staged_date | $KohaDates with_hours => 1 %][% batch_lis.num_biblios %]Add orders
    +
    + [% END %] + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref index 60ba8be..7e703e6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref @@ -45,6 +45,10 @@ Acquisitions: - - Upon receiving items, update their subfields if they were created when placing an order (e.g. o=5|a="foo bar"). - pref: AcqItemSetSubfieldsWhenReceived + - + - Set the mapping values for a new order line created from a marcrecord (staged file). In a YAML format, so you have to finished with an empty line. + - pref: MarcFieldsToOrder + type: textarea Printing: - -- 1.7.10.4