use CGI qw ( -utf8 );
use C4::Context;
-use C4::Auth;
-use C4::Budgets;
-
-use C4::Acquisition;
-use C4::Contract;
-use C4::Suggestions; # GetSuggestion
-use C4::Biblio; # GetBiblioData GetMarcPrice
-use C4::Items; #PrepareItemRecord
-use C4::Output;
-use C4::Koha;
+use C4::Auth qw( get_template_and_user );
+use C4::Budgets qw( GetBudget GetBudgetHierarchy CanUserUseBudget );
+
+use C4::Acquisition qw( GetOrder GetBasket FillWithDefaultValues GetOrderUsers );
+use C4::Contract qw( GetContract );
+use C4::Suggestions qw( GetSuggestion GetSuggestionInfo );
+use C4::Biblio qw(
+ AddBiblio
+ GetBiblioData
+ GetMarcBiblio
+ GetMarcFromKohaField
+ GetMarcPrice
+ GetMarcStructure
+ IsMarcStructureInternal
+);
+use C4::Output qw( output_and_exit output_html_with_http_headers );
use C4::Members;
-use C4::Search qw/FindDuplicate/;
+use C4::Search qw( FindDuplicate );
#needed for z3950 import:
-use C4::ImportBatch qw/GetImportRecordMarc SetImportRecordStatus/;
+use C4::ImportBatch qw( SetImportRecordStatus SetMatchedBiblionumber GetImportRecordMarc );
use Koha::Acquisition::Booksellers;
-use Koha::Acquisition::Currencies;
+use Koha::Acquisition::Currencies qw( get_active );
use Koha::BiblioFrameworks;
use Koha::DateUtils qw( dt_from_string );
use Koha::MarcSubfieldStructures;
use Koha::RecordProcessor;
use Koha::Subscriptions;
-our $input = new CGI;
+our $input = CGI->new;
my $booksellerid = $input->param('booksellerid'); # FIXME: else ERROR!
my $budget_id = $input->param('budget_id') || 0;
my $title = $input->param('title');
template_name => "acqui/neworderempty.tt",
query => $input,
type => "intranet",
- authnotrequired => 0,
flagsrequired => { acquisition => 'order_manage' },
- debug => 1,
}
);
output_and_exit( $input, $cookie, $template, 'unknown_basket') unless $basketobj;
output_and_exit( $input, $cookie, $template, 'unknown_vendor') unless $bookseller;
+$template->param(
+ ordernumber => $ordernumber,
+ basketno => $basketno,
+ basket => $basket,
+ booksellerid => $basket->{'booksellerid'},
+ name => $bookseller->name,
+);
+output_and_exit( $input, $cookie, $template, 'order_cannot_be_edited' )
+ if $ordernumber and $basketobj->closedate;
+
my $contract = GetContract({
contractnumber => $basket->{contractnumber}
});
# get the price if there is one.
$listprice = GetMarcPrice($marcrecord, $marcflavour);
SetImportRecordStatus($params->{'breedingid'}, 'imported');
+
+ SetMatchedBiblionumber( $params->{breedingid}, $biblionumber );
}
my $suggestion;
$suggestion = GetSuggestionInfo($suggestionid) if $suggestionid;
-my @currencies = Koha::Acquisition::Currencies->search;
+my @currencies = Koha::Acquisition::Currencies->search->as_list;
my $active_currency = Koha::Acquisition::Currencies->get_active;
# build bookfund list
# Get the item types list, but only if item_level_itype is YES. Otherwise, it will be in the item, no need to display it in the biblio
my @itemtypes;
-@itemtypes = Koha::ItemTypes->search unless C4::Context->preference('item-level_itypes');
+@itemtypes = Koha::ItemTypes->search->as_list unless C4::Context->preference('item-level_itypes');
if ( defined $from_subscriptionid ) {
# Get the last received order for this subscription
my (undef, $barcode_subfield) = GetMarcFromKohaField( 'items.barcode' );
-# get option values for gist syspref
+# get option values for TaxRates syspref
my @gst_values = map {
option => $_ + 0.0
-}, split( '\|', C4::Context->preference("gist") );
+}, split( '\|', C4::Context->preference("TaxRates") );
my $quantity = $input->param('rr_quantity_to_order') ?
$input->param('rr_quantity_to_order') :
# fill template
$template->param(
existing => $biblionumber,
- ordernumber => $ordernumber,
# basket informations
- basketno => $basketno,
- basket => $basket,
basketname => $basket->{'basketname'},
basketnote => $basket->{'note'},
booksellerid => $basket->{'booksellerid'},
order_vendornote => $data->{'order_vendornote'},
listincgst => $bookseller->listincgst,
invoiceincgst => $bookseller->invoiceincgst,
- name => $bookseller->name,
cur_active_sym => $active_currency->symbol,
cur_active => $active_currency->currency,
currencies => \@currencies,
template_name => "acqui/neworderempty_duplicate.tt",
query => $input,
type => "intranet",
- authnotrequired => 0,
flagsrequired => { acquisition => 'order_manage' },
-# debug => 1,
}
);