@@ -, +, @@ Koha::Acquisition namespace --- C4/Acquisition.pm | 8 +++- Koha/Acquisition/Basket.pm | 56 +++------------------- Koha/{ => Acquisition}/Basketgroup.pm | 8 ++-- Koha/{ => Acquisition}/Basketgroups.pm | 6 +-- Koha/Acquisition/Baskets.pm | 28 +---------- Koha/Acquisition/Order.pm | 11 +++-- Koha/Acquisition/Orders.pm | 20 -------- Koha/Basket.pm | 36 -------------- Koha/Baskets.pm | 32 ------------- Koha/Bookseller.pm | 26 ---------- Koha/Booksellers.pm | 32 ------------- Koha/Order.pm | 26 ---------- Koha/Orders.pm | 32 ------------- admin/currency.pl | 1 + t/db_dependent/Acquisition.t | 1 - .../Acquisition/GetOrdersByBiblionumber.t | 9 ++-- t/db_dependent/Acquisition/Invoices.t | 25 ++++++---- t/db_dependent/Acquisition/NewOrder.t | 2 +- t/db_dependent/Acquisition/OrderFromSubscription.t | 8 ++-- t/db_dependent/Acquisition/OrderUsers.t | 1 - t/db_dependent/Acquisition/close_reopen_basket.t | 4 +- t/db_dependent/Bookseller.t | 20 ++++---- t/db_dependent/Budgets.t | 7 ++- 23 files changed, 66 insertions(+), 333 deletions(-) rename Koha/{ => Acquisition}/Basketgroup.pm (87%) rename Koha/{ => Acquisition}/Basketgroups.pm (87%) delete mode 100644 Koha/Basket.pm delete mode 100644 Koha/Baskets.pm delete mode 100644 Koha/Bookseller.pm delete mode 100644 Koha/Booksellers.pm delete mode 100644 Koha/Order.pm delete mode 100644 Koha/Orders.pm --- a/C4/Acquisition.pm +++ a/C4/Acquisition.pm @@ -1508,7 +1508,9 @@ sub ModReceiveOrder { $order->{datereceived} = $datereceived; $order->{invoiceid} = $invoice->{invoiceid}; $order->{orderstatus} = 'complete'; - $new_ordernumber = Koha::Acquisition::Order->new($order)->store->ordernumber; # TODO What if the store fails? + my @columns = Koha::Acquisition::Orders->columns; + my %filtered_order = map { exists $order->{$_} ? ($_ => $order->{$_}) : () } @columns; + $new_ordernumber = Koha::Acquisition::Order->new(\%filtered_order)->store->ordernumber; if ($received_items) { foreach my $itemnumber (@$received_items) { @@ -1998,7 +2000,9 @@ sub TransferOrder { delete $order->{parent_ordernumber}; $order->{'basketno'} = $basketno; - my $newordernumber = Koha::Acquisition::Order->new($order)->store->ordernumber; + my @columns = Koha::Acquisition::Orders->columns; + my %filtered_order = map { exists $order->{$_} ? ($_ => $order->{$_}) : () } @columns; + my $newordernumber = Koha::Acquisition::Order->new(\%filtered_order)->store->ordernumber; $query = q{ UPDATE aqorders_items --- a/Koha/Acquisition/Basket.pm +++ a/Koha/Acquisition/Basket.pm @@ -1,7 +1,5 @@ package Koha::Acquisition::Basket; -# Copyright 2017 Aleisha Amohia -# # This file is part of Koha. # # Koha is free software; you can redistribute it and/or modify it under the @@ -19,60 +17,20 @@ package Koha::Acquisition::Basket; use Modern::Perl; -use Koha::Database; - -use base qw( Koha::Object ); - -=head1 NAME - -Koha::Acquisition::Basket - Koha Basket Object class - -=head1 API - -=head2 Class Methods - -=cut - -=head3 bookseller - -Returns the vendor - -=cut - -sub bookseller { - my ($self) = @_; - my $bookseller_rs = $self->_result->booksellerid; - return Koha::Acquisition::Bookseller->_new_from_dbic( $bookseller_rs ); -} - - -=head3 effective_create_items - -Returns C for this basket, falling back to C if unset. - -=cut - -sub effective_create_items { - my ( $self ) = @_; +use Koha::Acquisition::Orders; - return $self->create_items || C4::Context->preference('AcqCreateItem'); -} - -=head2 Internal methods - -=head3 _type - -=cut +use base qw(Koha::Object); sub _type { return 'Aqbasket'; } -=head1 AUTHOR +sub orders { + my ($self) = @_; -Aleisha Amohia -Catalyst IT + $self->{_orders} ||= Koha::Acquisition::Orders->search({ basketno => $self->basketno }); -=cut + return wantarray ? $self->{_orders}->as_list : $self->{_orders}; +} 1; --- a/Koha/Basketgroup.pm +++ a/Koha/Basketgroup.pm @@ -1,4 +1,4 @@ -package Koha::Basketgroup; +package Koha::Acquisition::Basketgroup; # This file is part of Koha. # @@ -19,7 +19,7 @@ use Modern::Perl; use List::MoreUtils qw/uniq/; -use Koha::Baskets; +use Koha::Acquisition::Baskets; use base qw(Koha::Object); @@ -30,13 +30,13 @@ sub _type { sub bookseller { my ($self) = @_; - return Koha::Booksellers->find($self->booksellerid); + return scalar Koha::Acquisition::Booksellers->find($self->booksellerid); } sub baskets { my ($self) = @_; - $self->{_baskets} ||= Koha::Baskets->search({ basketgroupid => $self->id }); + $self->{_baskets} ||= Koha::Acquisition::Baskets->search({ basketgroupid => $self->id }); return wantarray ? $self->{_baskets}->as_list : $self->{_baskets}; } --- a/Koha/Basketgroups.pm +++ a/Koha/Basketgroups.pm @@ -1,4 +1,4 @@ -package Koha::Basketgroups; +package Koha::Acquisition::Basketgroups; # This file is part of Koha. # @@ -17,7 +17,7 @@ package Koha::Basketgroups; use Modern::Perl; -use Koha::Basketgroup; +use Koha::Acquisition::Basketgroup; use base qw(Koha::Objects); @@ -26,7 +26,7 @@ sub _type { } sub object_class { - return 'Koha::Basketgroup'; + return 'Koha::Acquisition::Basketgroup'; } 1; --- a/Koha/Acquisition/Baskets.pm +++ a/Koha/Acquisition/Baskets.pm @@ -1,7 +1,5 @@ package Koha::Acquisition::Baskets; -# Copyright 2017 Aleisha Amohia -# # This file is part of Koha. # # Koha is free software; you can redistribute it and/or modify it under the @@ -19,40 +17,16 @@ package Koha::Acquisition::Baskets; use Modern::Perl; -use Koha::Database; use Koha::Acquisition::Basket; -use base qw( Koha::Objects ); - -=head1 NAME - -Koha::Acquisition::Baskets - Koha Baskets object set class - -=head1 API - -=head2 Internal methods - -=head3 _type - -=cut +use base qw(Koha::Objects); sub _type { return 'Aqbasket'; } -=head3 object_class - -=cut - sub object_class { return 'Koha::Acquisition::Basket'; } -=head1 AUTHOR - -Aleisha Amohia -Catalyst IT - -=cut - 1; --- a/Koha/Acquisition/Order.pm +++ a/Koha/Acquisition/Order.pm @@ -16,12 +16,14 @@ package Koha::Acquisition::Order; # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. use Modern::Perl; +use Carp qw( croak ); use Carp qw( croak ); use Koha::Acquisition::Baskets; use Koha::Database; use Koha::DateUtils qw( dt_from_string output_pref ); +use Koha::Acquisition::Baskets; use base qw(Koha::Object); @@ -59,9 +61,12 @@ Overloaded I method for backwards compatibility. sub store { my ($self) = @_; - my $schema = Koha::Database->new->schema; - # Override quantity for standing orders - $self->quantity(1) if ( $self->basketno && $schema->resultset('Aqbasket')->find( $self->basketno )->is_standing ); + if ($self->basketno) { + my $basket = Koha::Acquisition::Baskets->find($self->basketno); + if ($basket->is_standing) { + $self->quantity(1); + } + } # if these parameters are missing, we can't continue for my $key (qw( basketno quantity biblionumber budget_id )) { --- a/Koha/Acquisition/Orders.pm +++ a/Koha/Acquisition/Orders.pm @@ -17,34 +17,14 @@ package Koha::Acquisition::Orders; use Modern::Perl; -use Carp; - -use Koha::Database; - use Koha::Acquisition::Order; use base qw(Koha::Objects); -=head1 NAME - -Koha::Acquisition::Orders object set class - -=head1 API - -=head2 Internal methods - -=head3 _type (internal) - -=cut - sub _type { return 'Aqorder'; } -=head3 object_class (internal) - -=cut - sub object_class { return 'Koha::Acquisition::Order'; } --- a/Koha/Basket.pm +++ a/Koha/Basket.pm @@ -1,36 +0,0 @@ -package Koha::Basket; - -# 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 3 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. - -use Modern::Perl; - -use Koha::Orders; - -use base qw(Koha::Object); - -sub _type { - return 'Aqbasket'; -} - -sub orders { - my ($self) = @_; - - $self->{_orders} ||= Koha::Orders->search({ basketno => $self->basketno }); - - return wantarray ? $self->{_orders}->as_list : $self->{_orders}; -} - -1; --- a/Koha/Baskets.pm +++ a/Koha/Baskets.pm @@ -1,32 +0,0 @@ -package Koha::Baskets; - -# 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 3 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. - -use Modern::Perl; - -use Koha::Basket; - -use base qw(Koha::Objects); - -sub _type { - return 'Aqbasket'; -} - -sub object_class { - return 'Koha::Basket'; -} - -1; --- a/Koha/Bookseller.pm +++ a/Koha/Bookseller.pm @@ -1,26 +0,0 @@ -package Koha::Bookseller; - -# 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 3 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. - -use Modern::Perl; - -use base qw(Koha::Object); - -sub _type { - return 'Aqbookseller'; -} - -1; --- a/Koha/Booksellers.pm +++ a/Koha/Booksellers.pm @@ -1,32 +0,0 @@ -package Koha::Booksellers; - -# 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 3 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. - -use Modern::Perl; - -use Koha::Bookseller; - -use base qw(Koha::Objects); - -sub _type { - return 'Aqbookseller'; -} - -sub object_class { - return 'Koha::Bookseller'; -} - -1; --- a/Koha/Order.pm +++ a/Koha/Order.pm @@ -1,26 +0,0 @@ -package Koha::Order; - -# 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 3 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. - -use Modern::Perl; - -use base qw(Koha::Object); - -sub _type { - return 'Aqorder'; -} - -1; --- a/Koha/Orders.pm +++ a/Koha/Orders.pm @@ -1,32 +0,0 @@ -package Koha::Orders; - -# 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 3 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. - -use Modern::Perl; - -use Koha::Order; - -use base qw(Koha::Objects); - -sub _type { - return 'Aqorder'; -} - -sub object_class { - return 'Koha::Order'; -} - -1; --- a/admin/currency.pl +++ a/admin/currency.pl @@ -27,6 +27,7 @@ use C4::Output; use Koha::Acquisition::Booksellers; use Koha::Acquisition::Currencies; +use Koha::Acquisition::Currency; use Koha::Acquisition::Orders; my $input = CGI->new; --- a/t/db_dependent/Acquisition.t +++ a/t/db_dependent/Acquisition.t @@ -180,7 +180,6 @@ my @order_content = ( uncertainprice => 0, order_internalnote => "internal note", order_vendornote => "vendor note", - ordernumber => '', }, num => { quantity => 24, --- a/t/db_dependent/Acquisition/GetOrdersByBiblionumber.t +++ a/t/db_dependent/Acquisition/GetOrdersByBiblionumber.t @@ -41,7 +41,7 @@ my $budget = C4::Budgets::GetBudget( $budgetid ); my ($biblionumber1, $biblioitemnumber1) = AddBiblio(MARC::Record->new, ''); my ($biblionumber2, $biblioitemnumber2) = AddBiblio(MARC::Record->new, ''); -my $order1 = Koha::Acquisition::Order->new( +Koha::Acquisition::Order->new( { basketno => $basketno, quantity => 24, @@ -49,9 +49,8 @@ my $order1 = Koha::Acquisition::Order->new( budget_id => $budget->{budget_id}, } )->store; -my $ordernumber1 = $order1->ordernumber; -my $order2 = Koha::Acquisition::Order->new( +Koha::Acquisition::Order->new( { basketno => $basketno, quantity => 42, @@ -59,9 +58,8 @@ my $order2 = Koha::Acquisition::Order->new( budget_id => $budget->{budget_id}, } )->store; -my $ordernumber2 = $order2->ordernumber; -my $order3 = Koha::Acquisition::Order->new( +Koha::Acquisition::Order->new( { basketno => $basketno, quantity => 4, @@ -69,7 +67,6 @@ my $order3 = Koha::Acquisition::Order->new( budget_id => $budget->{budget_id}, } )->store; -my $ordernumber3 = $order3->ordernumber; my @orders = GetOrdersByBiblionumber(); is(scalar(@orders), 0, 'GetOrdersByBiblionumber : no argument, return undef'); --- a/t/db_dependent/Acquisition/Invoices.t +++ a/t/db_dependent/Acquisition/Invoices.t @@ -44,12 +44,22 @@ my $budgetid = C4::Budgets::AddBudget( my $budget = C4::Budgets::GetBudget( $budgetid ); my $bibrec1 = MARC::Record->new(); -$bibrec1->append_fields( - MARC::Field->new('020', '', '', 'a' => '1234567890'), - MARC::Field->new('100', '', '', 'a' => 'Shakespeare, Billy'), - MARC::Field->new('245', '', '', 'a' => 'Bug 8854'), - MARC::Field->new('260', '', '', 'b' => 'Scholastic Publishing', c => 'c2012'), -); +if (C4::Context->preference('marcflavour') eq 'UNIMARC') { + $bibrec1->append_fields( + MARC::Field->new('010', '', '', 'a' => '1234567890'), + MARC::Field->new('200', '', '', 'f' => 'Shakespeare, Billy'), + MARC::Field->new('200', '', '', 'a' => 'Bug 8854'), + MARC::Field->new('210', '', '', 'c' => 'Scholastic Publishing', d => '2012'), + ); +} else { + $bibrec1->append_fields( + MARC::Field->new('020', '', '', 'a' => '1234567890'), + MARC::Field->new('100', '', '', 'a' => 'Shakespeare, Billy'), + MARC::Field->new('245', '', '', 'a' => 'Bug 8854'), + MARC::Field->new('260', '', '', 'b' => 'Scholastic Publishing', c => '2012'), + ); +} + my ($biblionumber1, $biblioitemnumber1) = AddBiblio($bibrec1, ''); my ($biblionumber2, $biblioitemnumber2) = AddBiblio(MARC::Record->new, ''); my ($biblionumber3, $biblioitemnumber3) = AddBiblio(MARC::Record->new, ''); @@ -62,7 +72,6 @@ my $order1 = Koha::Acquisition::Order->new( budget_id => $budget->{budget_id}, } )->store; -my $ordernumber1 = $order1->ordernumber; my $order2 = Koha::Acquisition::Order->new( { @@ -72,7 +81,6 @@ my $order2 = Koha::Acquisition::Order->new( budget_id => $budget->{budget_id}, } )->store; -my $ordernumber2 = $order2->ordernumber; my $order3 = Koha::Acquisition::Order->new( { @@ -84,7 +92,6 @@ my $order3 = Koha::Acquisition::Order->new( rrp => 42, } )->store; -my $ordernumber3 = $order3->ordernumber; my $invoiceid1 = AddInvoice(invoicenumber => 'invoice1', booksellerid => $booksellerid, unknown => "unknown"); my $invoiceid2 = AddInvoice(invoicenumber => 'invoice2', booksellerid => $booksellerid, unknown => "unknown", --- a/t/db_dependent/Acquisition/NewOrder.t +++ a/t/db_dependent/Acquisition/NewOrder.t @@ -84,7 +84,7 @@ $order = Koha::Acquisition::Order->new( )->store; my $ordernumber = $order->ordernumber; $order = Koha::Acquisition::Orders->find( $ordernumber ); -is( $order->quantityreceived, 0, 'Koha::Acquisition::Order->insert set quantityreceivedto 0 if undef is given' ); +is( $order->quantityreceived, 0, 'Koha::Acquisition::Order->store set quantityreceivedto 0 if undef is given' ); is( $order->entrydate, output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }), 'Koha::Acquisition::Order->store set entrydate to today' ); $schema->storage->txn_rollback(); --- a/t/db_dependent/Acquisition/OrderFromSubscription.t +++ a/t/db_dependent/Acquisition/OrderFromSubscription.t @@ -31,7 +31,6 @@ my $bookseller = Koha::Acquisition::Bookseller->new( )->store; my ($biblionumber, $biblioitemnumber) = AddBiblio(MARC::Record->new, ''); -my $budgetid; my $bpid = AddBudgetPeriod({ budget_period_startdate => '01-01-2015', budget_period_enddate => '12-31-2015', @@ -56,13 +55,13 @@ my $subscriptionid = NewSubscription( ); die unless $subscriptionid; -my ($basket, $basketno); +my $basketno; ok($basketno = NewBasket($bookseller->id, 1), "NewBasket( " . $bookseller->id . ", 1 ) returns $basketno"); my $cost = 42.00; my $subscription = GetSubscription( $subscriptionid ); -my $order = Koha::Acquisition::Order->new({ +Koha::Acquisition::Order->new({ biblionumber => $subscription->{biblionumber}, entrydate => '01-01-2013', quantity => 1, @@ -75,12 +74,11 @@ my $order = Koha::Acquisition::Order->new({ subscriptionid => $subscription->{subscriptionid}, budget_id => $budget_id, })->store; -my $ordernumber = $order->ordernumber; my $is_currently_on_order = subscriptionCurrentlyOnOrder( $subscription->{subscriptionid} ); is ( $is_currently_on_order, 1, "The subscription is currently on order"); -$order = GetLastOrderNotReceivedFromSubscriptionid( $subscription->{subscriptionid} ); +my $order = GetLastOrderNotReceivedFromSubscriptionid( $subscription->{subscriptionid} ); is ( $order->{subscriptionid}, $subscription->{subscriptionid}, "test subscriptionid for the last order not received"); ok( $order->{ecost} == $cost, "test cost for the last order not received"); --- a/t/db_dependent/Acquisition/OrderUsers.t +++ a/t/db_dependent/Acquisition/OrderUsers.t @@ -40,7 +40,6 @@ my $budgetid = C4::Budgets::AddBudget( ); my $budget = C4::Budgets::GetBudget($budgetid); -my @ordernumbers; my ( $biblionumber, $biblioitemnumber ) = C4::Biblio::AddBiblio( MARC::Record->new, '' ); my $order = Koha::Acquisition::Order->new( --- a/t/db_dependent/Acquisition/close_reopen_basket.t +++ a/t/db_dependent/Acquisition/close_reopen_basket.t @@ -47,7 +47,7 @@ my $budget = C4::Budgets::GetBudget( $budgetid ); my ($biblionumber1, $biblioitemnumber1) = AddBiblio(MARC::Record->new, ''); my ($biblionumber2, $biblioitemnumber2) = AddBiblio(MARC::Record->new, ''); -my $order1 = Koha::Acquisition::Order->new( +Koha::Acquisition::Order->new( { basketno => $basketno, quantity => 24, @@ -57,7 +57,7 @@ my $order1 = Koha::Acquisition::Order->new( )->store; my $ordernumber1 = $order1->ordernumber; -my $order2 = Koha::Acquisition::Order->new( +Koha::Acquisition::Order->new( { basketno => $basketno, quantity => 42, --- a/t/db_dependent/Bookseller.t +++ a/t/db_dependent/Bookseller.t @@ -348,7 +348,7 @@ is(scalar(@subscriptions), 1, 'search for subscriptions by call number'); is(scalar(@subscriptions), 1, 'search for subscriptions by location'); #Add 4 orders -my $order1 = Koha::Acquisition::Order->new( +Koha::Acquisition::Order->new( { basketno => $basketno1, quantity => 24, @@ -357,7 +357,7 @@ my $order1 = Koha::Acquisition::Order->new( entrydate => '01-01-2013', currency => $curcode, notes => "This is a note1", - tax_rate => 0.0500, + tax_rate_on_ordering => 0.0500, orderstatus => 1, subscriptionid => $id_subscription1, quantityreceived => 2, @@ -366,9 +366,8 @@ my $order1 = Koha::Acquisition::Order->new( datereceived => '01-06-2013' } )->store; -my $ordernumber1 = $order1->ordernumber; -my $order2 = Koha::Acquisition::Order->new( +Koha::Acquisition::Order->new( { basketno => $basketno2, quantity => 20, @@ -377,16 +376,15 @@ my $order2 = Koha::Acquisition::Order->new( entrydate => '01-01-2013', currency => $curcode, notes => "This is a note2", - tax_rate => 0.0500, + tax_rate_on_ordering => 0.0500, orderstatus => 1, subscriptionid => $id_subscription2, rrp => 10, ecost => 10, } )->store; -my $ordernumber2 = $order2->ordernumber; -my $order3 = Koha::Acquisition::Order->new( +Koha::Acquisition::Order->new( { basketno => $basketno3, quantity => 20, @@ -395,16 +393,15 @@ my $order3 = Koha::Acquisition::Order->new( entrydate => '02-02-2013', currency => $curcode, notes => "This is a note3", - tax_rate => 0.0500, + tax_rate_on_ordering => 0.0500, orderstatus => 2, subscriptionid => $id_subscription3, rrp => 11, ecost => 11, } )->store; -my $ordernumber3 = $order3->ordernumber; -my $order4 = Koha::Acquisition::Order->new( +Koha::Acquisition::Order->new( { basketno => $basketno4, quantity => 20, @@ -413,7 +410,7 @@ my $order4 = Koha::Acquisition::Order->new( entrydate => '02-02-2013', currency => $curcode, notes => "This is a note3", - tax_rate => 0.0500, + tax_rate_on_ordering => 0.0500, orderstatus => 2, subscriptionid => $id_subscription3, rrp => 11, @@ -421,7 +418,6 @@ my $order4 = Koha::Acquisition::Order->new( quantityreceived => 20 } )->store; -my $ordernumber4 = $order4->ordernumber; #Test cases: # Sample datas : --- a/t/db_dependent/Budgets.t +++ a/t/db_dependent/Budgets.t @@ -350,10 +350,10 @@ for my $infos (@order_infos) { order_internalnote => "internal note", order_vendornote => "vendor note", quantity => 2, - cost_tax_included => $item_price, + ecost_tax_included => $item_price, rrp_tax_included => $item_price, listprice => $item_price, - ecost_tax_include => $item_price, + ecost_tax_included => $item_price, discount => 0, uncertainprice => 0, } @@ -371,7 +371,7 @@ for my $infos (@order_infos) { order_internalnote => "internal note", order_vendornote => "vendor note", quantity => $item_quantity, - cost => $item_price, + ecost => $item_price, rrp_tax_included => $item_price, listprice => $item_price, ecost_tax_included => $item_price, @@ -379,7 +379,6 @@ for my $infos (@order_infos) { uncertainprice => 0, } )->store; - my $ordernumber = $order->ordernumber; ModReceiveOrder({ biblionumber => $biblionumber, order => $order->unblessed, --