Bugzilla – Attachment 72699 Details for
Bug 11708
Display all basketgroups on one page, and new column aqbasketgroups.closeddate
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11708: Move acq related Koha::Objects to Koha::Acquisition namespace
Bug-11708-Move-acq-related-KohaObjects-to-KohaAcqu.patch (text/plain), 28.49 KB, created by
Séverine Queune
on 2018-03-12 14:29:36 UTC
(
hide
)
Description:
Bug 11708: Move acq related Koha::Objects to Koha::Acquisition namespace
Filename:
MIME Type:
Creator:
Séverine Queune
Created:
2018-03-12 14:29:36 UTC
Size:
28.49 KB
patch
obsolete
>From d7d076bfb9167d613a37e90f933dc22ca9529cd6 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Tue, 10 Jan 2017 17:08:51 +0100 >Subject: [PATCH] Bug 11708: Move acq related Koha::Objects to > Koha::Acquisition namespace >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >and fix Koha::Acquisition::Order usage everywhere > >Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> >--- > C4/Acquisition.pm | 8 +++-- > Koha/Acquisition/Basket.pm | 26 +++++++++++++--- > 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, 81 insertions(+), 288 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 > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index 92ab382..c8c19c7 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -1510,7 +1510,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) { >@@ -2000,7 +2002,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 >diff --git a/Koha/Acquisition/Basket.pm b/Koha/Acquisition/Basket.pm >index 98e4bd4..b0329f1 100644 >--- a/Koha/Acquisition/Basket.pm >+++ b/Koha/Acquisition/Basket.pm >@@ -19,7 +19,7 @@ package Koha::Acquisition::Basket; > > use Modern::Perl; > >-use Koha::Database; >+use Koha::Acquisition::Orders; > > use base qw( Koha::Object ); > >@@ -31,8 +31,6 @@ Koha::Acquisition::Basket - Koha Basket Object class > > =head2 Class Methods > >-=cut >- > =head3 bookseller > > Returns the vendor >@@ -45,7 +43,6 @@ sub bookseller { > return Koha::Acquisition::Bookseller->_new_from_dbic( $bookseller_rs ); > } > >- > =head3 effective_create_items > > Returns C<create_items> for this basket, falling back to C<AcqCreateItem> if unset. >@@ -58,6 +55,27 @@ sub effective_create_items { > return $self->create_items || C4::Context->preference('AcqCreateItem'); > } > >+=head3 orders >+ >+Returns basket's orders >+ >+ # As an arrayref >+ my $orders = $basket->orders; >+ >+ # As an array >+ my @orders = $basket->orders; >+ >+=cut >+ >+sub orders { >+ my ($self) = @_; >+ >+ $self->{_orders} ||= Koha::Acquisition::Orders->search({ basketno => $self->basketno }); >+ >+ return wantarray ? $self->{_orders}->as_list : $self->{_orders}; >+} >+ >+ > =head2 Internal methods > > =head3 _type >diff --git a/Koha/Basketgroup.pm b/Koha/Acquisition/Basketgroup.pm >similarity index 87% >rename from Koha/Basketgroup.pm >rename to Koha/Acquisition/Basketgroup.pm >index e624a35..dd7ece6 100644 >--- a/Koha/Basketgroup.pm >+++ b/Koha/Acquisition/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}; > } >diff --git a/Koha/Basketgroups.pm b/Koha/Acquisition/Basketgroups.pm >similarity index 87% >rename from Koha/Basketgroups.pm >rename to Koha/Acquisition/Basketgroups.pm >index 1dbc6d1..6f648cc 100644 >--- a/Koha/Basketgroups.pm >+++ b/Koha/Acquisition/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; >diff --git a/Koha/Acquisition/Baskets.pm b/Koha/Acquisition/Baskets.pm >index 2de4683..e29f2e1 100644 >--- a/Koha/Acquisition/Baskets.pm >+++ b/Koha/Acquisition/Baskets.pm >@@ -1,7 +1,5 @@ > package Koha::Acquisition::Baskets; > >-# Copyright 2017 Aleisha Amohia <aleisha@catalyst.net.nz> >-# > # 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 <aleisha@catalyst.net.nz> >-Catalyst IT >- >-=cut >- > 1; >diff --git a/Koha/Acquisition/Order.pm b/Koha/Acquisition/Order.pm >index 79fb056..7eefeed 100644 >--- a/Koha/Acquisition/Order.pm >+++ b/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<store> 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 )) { >diff --git a/Koha/Acquisition/Orders.pm b/Koha/Acquisition/Orders.pm >index 56c2fb4..9af45ee 100644 >--- a/Koha/Acquisition/Orders.pm >+++ b/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'; > } >diff --git a/Koha/Basket.pm b/Koha/Basket.pm >deleted file mode 100644 >index 4703101..0000000 >--- a/Koha/Basket.pm >+++ /dev/null >@@ -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; >diff --git a/Koha/Baskets.pm b/Koha/Baskets.pm >deleted file mode 100644 >index badd91a..0000000 >--- a/Koha/Baskets.pm >+++ /dev/null >@@ -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; >diff --git a/Koha/Bookseller.pm b/Koha/Bookseller.pm >deleted file mode 100644 >index 1979f62..0000000 >--- a/Koha/Bookseller.pm >+++ /dev/null >@@ -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; >diff --git a/Koha/Booksellers.pm b/Koha/Booksellers.pm >deleted file mode 100644 >index fb689c7..0000000 >--- a/Koha/Booksellers.pm >+++ /dev/null >@@ -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; >diff --git a/Koha/Order.pm b/Koha/Order.pm >deleted file mode 100644 >index 7ab7ed1..0000000 >--- a/Koha/Order.pm >+++ /dev/null >@@ -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; >diff --git a/Koha/Orders.pm b/Koha/Orders.pm >deleted file mode 100644 >index 49f616b..0000000 >--- a/Koha/Orders.pm >+++ /dev/null >@@ -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; >diff --git a/admin/currency.pl b/admin/currency.pl >index 1719498..bb6cebb 100755 >--- a/admin/currency.pl >+++ b/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; >diff --git a/t/db_dependent/Acquisition.t b/t/db_dependent/Acquisition.t >index 0475872..e39e3cc 100755 >--- a/t/db_dependent/Acquisition.t >+++ b/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, >diff --git a/t/db_dependent/Acquisition/GetOrdersByBiblionumber.t b/t/db_dependent/Acquisition/GetOrdersByBiblionumber.t >index b622ced..804f076 100644 >--- a/t/db_dependent/Acquisition/GetOrdersByBiblionumber.t >+++ b/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'); >diff --git a/t/db_dependent/Acquisition/Invoices.t b/t/db_dependent/Acquisition/Invoices.t >index b472ce7..5e84a6b 100644 >--- a/t/db_dependent/Acquisition/Invoices.t >+++ b/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", >diff --git a/t/db_dependent/Acquisition/NewOrder.t b/t/db_dependent/Acquisition/NewOrder.t >index b327a8d..3929317 100644 >--- a/t/db_dependent/Acquisition/NewOrder.t >+++ b/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(); >diff --git a/t/db_dependent/Acquisition/OrderFromSubscription.t b/t/db_dependent/Acquisition/OrderFromSubscription.t >index cc691d0..39bbe51 100644 >--- a/t/db_dependent/Acquisition/OrderFromSubscription.t >+++ b/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 => '2015-01-01', > budget_period_enddate => '2015-12-31', >@@ -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 => '2013-01-01', > 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"); > >diff --git a/t/db_dependent/Acquisition/OrderUsers.t b/t/db_dependent/Acquisition/OrderUsers.t >index 5b142f7..cef22d5 100644 >--- a/t/db_dependent/Acquisition/OrderUsers.t >+++ b/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( >diff --git a/t/db_dependent/Acquisition/close_reopen_basket.t b/t/db_dependent/Acquisition/close_reopen_basket.t >index adc1d9c..71a2c15 100644 >--- a/t/db_dependent/Acquisition/close_reopen_basket.t >+++ b/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, >diff --git a/t/db_dependent/Bookseller.t b/t/db_dependent/Bookseller.t >index b9de02c..f25969c 100644 >--- a/t/db_dependent/Bookseller.t >+++ b/t/db_dependent/Bookseller.t >@@ -349,7 +349,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, >@@ -358,7 +358,7 @@ my $order1 = Koha::Acquisition::Order->new( > entrydate => '2013-01-01', > currency => $curcode, > notes => "This is a note1", >- tax_rate => 0.0500, >+ tax_rate_on_ordering => 0.0500, > orderstatus => 1, > subscriptionid => $id_subscription1, > quantityreceived => 2, >@@ -367,9 +367,8 @@ my $order1 = Koha::Acquisition::Order->new( > datereceived => '2013-06-01' > } > )->store; >-my $ordernumber1 = $order1->ordernumber; > >-my $order2 = Koha::Acquisition::Order->new( >+Koha::Acquisition::Order->new( > { > basketno => $basketno2, > quantity => 20, >@@ -378,16 +377,15 @@ my $order2 = Koha::Acquisition::Order->new( > entrydate => '2013-01-01', > 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, >@@ -396,16 +394,15 @@ my $order3 = Koha::Acquisition::Order->new( > entrydate => '2013-02-02', > 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, >@@ -414,7 +411,7 @@ my $order4 = Koha::Acquisition::Order->new( > entrydate => '2013-02-02', > currency => $curcode, > notes => "This is a note3", >- tax_rate => 0.0500, >+ tax_rate_on_ordering => 0.0500, > orderstatus => 2, > subscriptionid => $id_subscription3, > rrp => 11, >@@ -422,7 +419,6 @@ my $order4 = Koha::Acquisition::Order->new( > quantityreceived => 20 > } > )->store; >-my $ordernumber4 = $order4->ordernumber; > > #Test cases: > # Sample datas : >diff --git a/t/db_dependent/Budgets.t b/t/db_dependent/Budgets.t >index 21f2d59..f13eae8 100755 >--- a/t/db_dependent/Budgets.t >+++ b/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, >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11708
:
25115
|
25116
|
25117
|
26003
|
26004
|
26006
|
28868
|
28869
|
28870
|
28871
|
28872
|
31305
|
31306
|
31307
|
31308
|
31309
|
31530
|
31531
|
31532
|
31533
|
31534
|
31535
|
31536
|
31537
|
31538
|
31539
|
31540
|
31541
|
31542
|
31543
|
31544
|
31702
|
31703
|
31704
|
31705
|
31748
|
31749
|
31750
|
31751
|
31752
|
31753
|
32909
|
32910
|
32911
|
32912
|
32913
|
32914
|
33308
|
33309
|
33310
|
33311
|
33312
|
33313
|
34936
|
34937
|
34938
|
34939
|
34940
|
34941
|
34977
|
35748
|
35749
|
35750
|
35751
|
35752
|
35753
|
35754
|
35755
|
35756
|
35971
|
35972
|
35973
|
35974
|
35975
|
35976
|
35977
|
35978
|
35979
|
40260
|
40261
|
40262
|
40263
|
40264
|
40265
|
40266
|
40267
|
40268
|
40272
|
48992
|
48993
|
48994
|
48995
|
48996
|
52417
|
52418
|
52419
|
52420
|
52421
|
55277
|
55278
|
55279
|
58770
|
58771
|
58772
|
58773
|
58774
|
58775
|
58776
|
58777
|
58778
|
59301
|
59302
|
59303
|
59304
|
59305
|
59306
|
59307
|
59308
|
59309
|
61018
|
61019
|
61020
|
61021
|
61022
|
61023
|
61024
|
61025
|
61026
|
71260
|
71261
|
71262
|
71263
|
71264
|
71265
|
71266
|
71267
|
71268
|
72069
|
72070
|
72071
|
72072
|
72073
|
72074
|
72075
|
72076
|
72077
|
72691
|
72692
|
72693
|
72694
|
72695
|
72696
|
72697
|
72698
|
72699
|
74213
|
74214
|
74215
|
74216
|
74217
|
74218
|
74219
|
74220
|
74221
|
74222
|
74302
|
74303
|
74304
|
74305
|
74306
|
74307
|
74308
|
74309
|
74310
|
74311
|
74349
|
74350
|
74351
|
74352
|
74353
|
74354
|
74355
|
74356
|
74357
|
74358
|
75003
|
75004
|
75908
|
75909
|
78662
|
78663
|
78664
|
80697
|
80698
|
80699
|
80700
|
80979
|
80980
|
80981
|
80982
|
85786
|
85787
|
91285
|
91286
|
92378
|
92379
|
92380
|
92381
|
92382
|
93460
|
93461
|
93462
|
93463
|
93464
|
93482
|
93483
|
93484
|
93485
|
93487
|
104928
|
104929
|
104930
|
104931
|
104932
|
104933
|
104934
|
104935