View | Details | Raw Unified | Return to bug 12896
Collapse All | Expand All

(-)a/C4/Acquisition.pm (-2 / +2 lines)
Lines 28-37 use C4::Suggestions; Link Here
28
use C4::Biblio;
28
use C4::Biblio;
29
use C4::Contract;
29
use C4::Contract;
30
use C4::Debug;
30
use C4::Debug;
31
use C4::Bookseller qw(GetBookSellerFromId);
32
use C4::Templates qw(gettemplate);
31
use C4::Templates qw(gettemplate);
33
use Koha::DateUtils qw( dt_from_string output_pref );
32
use Koha::DateUtils qw( dt_from_string output_pref );
34
use Koha::Acquisition::Order;
33
use Koha::Acquisition::Order;
34
use Koha::Acquisition::Bookseller;
35
35
36
use Time::localtime;
36
use Time::localtime;
37
use HTML::Entities;
37
use HTML::Entities;
Lines 366-372 sub GetBasketGroupAsCSV { Link Here
366
        my $contract   = GetContract({
366
        my $contract   = GetContract({
367
            contractnumber => $basket->{contractnumber}
367
            contractnumber => $basket->{contractnumber}
368
        });
368
        });
369
        my $bookseller = GetBookSellerFromId( $$basket{booksellerid} );
369
        my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $basket->{booksellerid} });
370
        my $basketgroup = GetBasketgroup( $$basket{basketgroupid} );
370
        my $basketgroup = GetBasketgroup( $$basket{basketgroupid} );
371
371
372
        foreach my $order (@orders) {
372
        foreach my $order (@orders) {
(-)a/C4/Bookseller.pm (-51 / +2 lines)
Lines 28-34 use C4::Bookseller::Contact; Link Here
28
# set the version for version checking
28
# set the version for version checking
29
our $VERSION   = 3.07.00.049;
29
our $VERSION   = 3.07.00.049;
30
our @EXPORT_OK = qw(
30
our @EXPORT_OK = qw(
31
  GetBookSeller GetBooksellersWithLateOrders GetBookSellerFromId
31
  GetBooksellersWithLateOrders
32
  ModBookseller
32
  ModBookseller
33
  DelBookseller
33
  DelBookseller
34
  AddBookseller
34
  AddBookseller
Lines 50-104 a bookseller. Link Here
50
50
51
=head1 FUNCTIONS
51
=head1 FUNCTIONS
52
52
53
=head2 GetBookSeller
54
55
@results = GetBookSeller($searchstring);
56
57
Looks up a book seller. C<$searchstring> is a string to look for in the
58
book seller's name.
59
60
C<@results> is an array of hash_refs whose keys are the fields of of the
61
aqbooksellers table in the Koha database.
62
63
=cut
64
65
sub GetBookSeller {
66
    my $searchstring = shift;
67
    $searchstring = q{%} . $searchstring . q{%};
68
    my $query = "
69
        SELECT aqbooksellers.*, count(*) AS basketcount
70
        FROM aqbooksellers
71
        LEFT JOIN aqbasket ON aqbasket.booksellerid = aqbooksellers.id
72
        WHERE name LIKE ? GROUP BY aqbooksellers.id ORDER BY name
73
    ";
74
75
    my $dbh           = C4::Context->dbh;
76
    my $sth           = $dbh->prepare($query);
77
    $sth->execute($searchstring);
78
    my $resultset_ref = $sth->fetchall_arrayref( {} );
79
    return @{$resultset_ref};
80
}
81
82
sub GetBookSellerFromId {
83
    my $id = shift or return;
84
    my $dbh = C4::Context->dbh;
85
    my $vendor =
86
      $dbh->selectrow_hashref( 'SELECT * FROM aqbooksellers WHERE id = ?',
87
        {}, $id );
88
    if ($vendor) {
89
        ( $vendor->{basketcount} ) = $dbh->selectrow_array(
90
            'SELECT count(*) FROM aqbasket where booksellerid = ?',
91
            {}, $id );
92
        ( $vendor->{subscriptioncount} ) = $dbh->selectrow_array(
93
            'SELECT count(*) FROM subscription WHERE aqbooksellerid = ?',
94
            {}, $id );
95
        $vendor->{'contacts'} = C4::Bookseller::Contact->get_from_bookseller($id);
96
    }
97
    return $vendor;
98
}
99
100
#-----------------------------------------------------------------#
101
102
=head2 GetBooksellersWithLateOrders
53
=head2 GetBooksellersWithLateOrders
103
54
104
%results = GetBooksellersWithLateOrders( $delay, $estimateddeliverydatefrom, $estimateddeliverydateto );
55
%results = GetBooksellersWithLateOrders( $delay, $estimateddeliverydatefrom, $estimateddeliverydateto );
Lines 231-237 in the Koha database. It must contain entries for all of the fields. Link Here
231
The entry to modify is determined by C<$bookseller-E<gt>{id}>.
182
The entry to modify is determined by C<$bookseller-E<gt>{id}>.
232
183
233
The easiest way to get all of the necessary fields is to look up a
184
The easiest way to get all of the necessary fields is to look up a
234
book seller with C<&GetBookseller>, modify what's necessary, then call
185
book seller with C<Koha::Acquisition::Bookseller>, modify what's necessary, then call
235
C<&ModBookseller> with the result.
186
C<&ModBookseller> with the result.
236
187
237
=cut
188
=cut
(-)a/Koha/Acquisition/Bookseller.pm (+124 lines)
Line 0 Link Here
1
package Koha::Acquisition::Bookseller;
2
3
use Modern::Perl;
4
5
use Koha::Database;
6
use Koha::DateUtils qw( dt_from_string output_pref );
7
8
use Carp qw( croak );
9
10
use base qw( Class::Accessor );
11
12
use C4::Bookseller::Contact;
13
14
sub fetch {
15
    my ( $class, $params ) = @_;
16
    my $id = $params->{id};
17
    return unless $id;
18
    my $schema = Koha::Database->new->schema;
19
20
    my $bookseller =
21
      $schema->resultset('Aqbookseller')->find( { id => $id },
22
        { result_class => 'DBIx::Class::ResultClass::HashRefInflator' } );
23
24
    return unless $bookseller;
25
26
    my $self = $class->new( $bookseller );
27
    $self->contacts; # TODO: This should be generated on demand.
28
    return $self;
29
}
30
31
sub search {
32
    my ( $class, $params ) = @_;
33
34
    croak "Cannot search on other fields than aqbooksellers.name" if $params and grep { $_ !~ /^name$/ } keys %$params;
35
36
    my $schema = Koha::Database->new->schema;
37
38
    my $search_params;
39
    while ( my ( $field, $value ) = each %$params ) {
40
        if ( $field eq 'name' ) {
41
            # Use "like" if search on name
42
            $search_params->{name} = { -like => "%$value%" };
43
        } else {
44
            $search_params->{$field} = $value;
45
        }
46
    }
47
    my $rs = $schema->resultset('Aqbookseller')->search(
48
        $search_params,
49
        { order_by => 'name' }
50
    );
51
52
    my @booksellers;
53
    while ( my $b = $rs->next ) {
54
        my $t = Koha::Acquisition::Bookseller->fetch({ id => $b->id });
55
        push @booksellers, $t;
56
    }
57
    return @booksellers;
58
}
59
60
sub basket_count {
61
    my ( $self ) = @_;
62
    my $schema = Koha::Database->new->schema;
63
64
    return $schema->resultset('Aqbasket')->count( { booksellerid => $self->{id} });
65
}
66
67
sub subscription_count {
68
    my ( $self ) = @_;
69
70
    my $schema = Koha::Database->new->schema;
71
72
    return $schema->resultset('Subscription')->count( { aqbooksellerid => $self->{id} });
73
}
74
75
sub contacts {
76
    my ( $self ) = @_;
77
78
    return $self->{contacts} if $self->{contacts};
79
    $self->{contacts} = C4::Bookseller::Contact->get_from_bookseller($self->{id});
80
    return $self->{contacts};
81
}
82
83
sub insert {
84
    my ($self) = @_;
85
86
    # if these parameters are missing, we can't continue
87
    for my $key (qw( id )) {
88
        croak "Cannot insert bookseller: Mandatory parameter $key is missing"
89
          unless $self->{$key};
90
    }
91
92
    $self->{quantityreceived} ||= 0;
93
    $self->{entrydate} ||=
94
      output_pref( { dt => dt_from_string, dateformat => 'iso' } );
95
96
    my $schema  = Koha::Database->new->schema;
97
    my @columns = $schema->source('Aqorder')->columns;
98
    my $rs = $schema->resultset('Aqorder')->create(
99
        {
100
            map {
101
                exists $self->{$_} ? ( $_ => $self->{$_} ) : ()
102
            } @columns
103
        }
104
    );
105
    $self->{ordernumber} = $rs->id;
106
107
    unless ( $self->{parent_ordernumber} ) {
108
        $rs->update( { parent_ordernumber => $self->{ordernumber} } );
109
    }
110
111
    return $self;
112
}
113
114
# TODO Move code from ModBookseller
115
sub update {
116
    die "not implemented yet";
117
}
118
119
# TODO Move code from DelBookseller
120
sub delete {
121
    die "not implemented yet";
122
}
123
124
1;
(-)a/acqui/addorderiso2709.pl (-2 / +2 lines)
Lines 40-51 use C4::Items; Link Here
40
use C4::Koha;
40
use C4::Koha;
41
use C4::Budgets;
41
use C4::Budgets;
42
use C4::Acquisition;
42
use C4::Acquisition;
43
use C4::Bookseller qw/GetBookSellerFromId/;
44
use C4::Suggestions;    # GetSuggestion
43
use C4::Suggestions;    # GetSuggestion
45
use C4::Branch;         # GetBranches
44
use C4::Branch;         # GetBranches
46
use C4::Members;
45
use C4::Members;
47
46
48
use Koha::Acquisition::Order;
47
use Koha::Acquisition::Order;
48
use Koha::Acquisition::Bookseller;
49
49
50
my $input = new CGI;
50
my $input = new CGI;
51
my ($template, $loggedinuser, $cookie, $userflags) = get_template_and_user({
51
my ($template, $loggedinuser, $cookie, $userflags) = get_template_and_user({
Lines 60-66 my ($template, $loggedinuser, $cookie, $userflags) = get_template_and_user({ Link Here
60
my $cgiparams = $input->Vars;
60
my $cgiparams = $input->Vars;
61
my $op = $cgiparams->{'op'} || '';
61
my $op = $cgiparams->{'op'} || '';
62
my $booksellerid  = $input->param('booksellerid');
62
my $booksellerid  = $input->param('booksellerid');
63
my $bookseller = GetBookSellerFromId($booksellerid);
63
my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
64
my $data;
64
my $data;
65
65
66
$template->param(scriptname => "/cgi-bin/koha/acqui/addorderiso2709.pl",
66
$template->param(scriptname => "/cgi-bin/koha/acqui/addorderiso2709.pl",
(-)a/acqui/basket.pl (-3 / +2 lines)
Lines 29-35 use CGI; Link Here
29
use C4::Acquisition;
29
use C4::Acquisition;
30
use C4::Budgets;
30
use C4::Budgets;
31
use C4::Branch;
31
use C4::Branch;
32
use C4::Bookseller qw( GetBookSellerFromId);
33
use C4::Contract;
32
use C4::Contract;
34
use C4::Debug;
33
use C4::Debug;
35
use C4::Biblio;
34
use C4::Biblio;
Lines 83-89 my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user( Link Here
83
82
84
my $basket = GetBasket($basketno);
83
my $basket = GetBasket($basketno);
85
$booksellerid = $basket->{booksellerid} unless $booksellerid;
84
$booksellerid = $basket->{booksellerid} unless $booksellerid;
86
my ($bookseller) = GetBookSellerFromId($booksellerid);
85
my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
87
86
88
unless (CanUserManageBasket($loggedinuser, $basket, $userflags)) {
87
unless (CanUserManageBasket($loggedinuser, $basket, $userflags)) {
89
    $template->param(
88
    $template->param(
Lines 519-525 sub get_order_infos { Link Here
519
        if ($line{$key}) {
518
        if ($line{$key}) {
520
            my $order = GetOrder($line{$key});
519
            my $order = GetOrder($line{$key});
521
            my $basket = GetBasket($order->{basketno});
520
            my $basket = GetBasket($order->{basketno});
522
            my $bookseller = GetBookSellerFromId($basket->{booksellerid});
521
            my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $basket->{booksellerid} });
523
            $line{$key} = {
522
            $line{$key} = {
524
                order => $order,
523
                order => $order,
525
                basket => $basket,
524
                basket => $basket,
(-)a/acqui/basketgroup.pl (-5 / +5 lines)
Lines 52-64 use C4::Auth; Link Here
52
use C4::Output;
52
use C4::Output;
53
use CGI;
53
use CGI;
54
54
55
use C4::Bookseller qw/GetBookSellerFromId/;
56
use C4::Budgets qw/ConvertCurrency/;
55
use C4::Budgets qw/ConvertCurrency/;
57
use C4::Acquisition qw/CloseBasketgroup ReOpenBasketgroup GetOrders GetBasketsByBasketgroup GetBasketsByBookseller ModBasketgroup NewBasketgroup DelBasketgroup GetBasketgroups ModBasket GetBasketgroup GetBasket GetBasketGroupAsCSV/;
56
use C4::Acquisition qw/CloseBasketgroup ReOpenBasketgroup GetOrders GetBasketsByBasketgroup GetBasketsByBookseller ModBasketgroup NewBasketgroup DelBasketgroup GetBasketgroups ModBasket GetBasketgroup GetBasket GetBasketGroupAsCSV/;
58
use C4::Bookseller qw/GetBookSellerFromId/;
59
use C4::Branch qw/GetBranches/;
57
use C4::Branch qw/GetBranches/;
60
use C4::Members qw/GetMember/;
58
use C4::Members qw/GetMember/;
61
59
60
use Koha::Acquisition::Bookseller;
61
62
our $input=new CGI;
62
our $input=new CGI;
63
63
64
our ($template, $loggedinuser, $cookie)
64
our ($template, $loggedinuser, $cookie)
Lines 144-150 sub printbasketgrouppdf{ Link Here
144
    }
144
    }
145
    
145
    
146
    my $basketgroup = GetBasketgroup($basketgroupid);
146
    my $basketgroup = GetBasketgroup($basketgroupid);
147
    my $bookseller = GetBookSellerFromId($basketgroup->{'booksellerid'});
147
    my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $basketgroup->{booksellerid} });
148
    my $baskets = GetBasketsByBasketgroup($basketgroupid);
148
    my $baskets = GetBasketsByBasketgroup($basketgroupid);
149
    
149
    
150
    my %orders;
150
    my %orders;
Lines 255-261 if ( $op eq "add" ) { Link Here
255
# else, edit (if it is open) or display (if it is close) the basketgroup basketgroupid
255
# else, edit (if it is open) or display (if it is close) the basketgroup basketgroupid
256
# the template will know if basketgroup must be displayed or edited, depending on the value of closed key
256
# the template will know if basketgroup must be displayed or edited, depending on the value of closed key
257
#
257
#
258
    my $bookseller = &GetBookSellerFromId($booksellerid);
258
    my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
259
    my $basketgroupid = $input->param('basketgroupid');
259
    my $basketgroupid = $input->param('basketgroupid');
260
    my $billingplace;
260
    my $billingplace;
261
    my $deliveryplace;
261
    my $deliveryplace;
Lines 402-408 if ( $op eq "add" ) { Link Here
402
}else{
402
}else{
403
# no param : display the list of all basketgroups for a given vendor
403
# no param : display the list of all basketgroups for a given vendor
404
    my $basketgroups = &GetBasketgroups($booksellerid);
404
    my $basketgroups = &GetBasketgroups($booksellerid);
405
    my $bookseller = &GetBookSellerFromId($booksellerid);
405
    my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
406
    my $baskets = &GetBasketsByBookseller($booksellerid);
406
    my $baskets = &GetBasketsByBookseller($booksellerid);
407
407
408
    displaybasketgroups($basketgroups, $bookseller, $baskets);
408
    displaybasketgroups($basketgroups, $bookseller, $baskets);
(-)a/acqui/basketheader.pl (-3 / +3 lines)
Lines 53-61 use C4::Auth; Link Here
53
use C4::Branch;
53
use C4::Branch;
54
use C4::Output;
54
use C4::Output;
55
use C4::Acquisition qw/GetBasket NewBasket ModBasketHeader/;
55
use C4::Acquisition qw/GetBasket NewBasket ModBasketHeader/;
56
use C4::Bookseller qw/GetBookSellerFromId GetBookSeller/;
57
use C4::Contract qw/GetContracts/;
56
use C4::Contract qw/GetContracts/;
58
57
58
use Koha::Acquisition::Bookseller;
59
59
60
my $input = new CGI;
60
my $input = new CGI;
61
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
61
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Lines 106-118 if ( $op eq 'add_form' ) { Link Here
106
        });
106
        });
107
        push(@contractloop, @$contracts);
107
        push(@contractloop, @$contracts);
108
    }
108
    }
109
    my $bookseller = GetBookSellerFromId($booksellerid);
109
    my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
110
    my $count = scalar @contractloop;
110
    my $count = scalar @contractloop;
111
    if ( $count > 0) {
111
    if ( $count > 0) {
112
        $template->param(contractloop => \@contractloop,
112
        $template->param(contractloop => \@contractloop,
113
                         basketcontractnumber => $basket->{'contractnumber'});
113
                         basketcontractnumber => $basket->{'contractnumber'});
114
    }
114
    }
115
    my @booksellers = C4::Bookseller::GetBookSeller();
115
    my @booksellers = Koha::Acquisition::Bookseller->search;
116
    $template->param( add_form => 1,
116
    $template->param( add_form => 1,
117
                    basketname => $basket->{'basketname'},
117
                    basketname => $basket->{'basketname'},
118
                    basketnote => $basket->{'note'},
118
                    basketnote => $basket->{'note'},
(-)a/acqui/booksellers.pl (-3 / +4 lines)
Lines 60-69 use C4::Output; Link Here
60
use CGI;
60
use CGI;
61
61
62
use C4::Acquisition qw/ GetBasketsInfosByBookseller CanUserManageBasket /;
62
use C4::Acquisition qw/ GetBasketsInfosByBookseller CanUserManageBasket /;
63
use C4::Bookseller qw/ GetBookSellerFromId GetBookSeller /;
64
use C4::Members qw/GetMember/;
63
use C4::Members qw/GetMember/;
65
use C4::Context;
64
use C4::Context;
66
65
66
use Koha::Acquisition::Bookseller;
67
67
my $query = CGI->new;
68
my $query = CGI->new;
68
my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user(
69
my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user(
69
    {   template_name   => 'acqui/booksellers.tt',
70
    {   template_name   => 'acqui/booksellers.tt',
Lines 82-90 my $allbaskets= $query->param('allbaskets')||0; Link Here
82
my @suppliers;
83
my @suppliers;
83
84
84
if ($booksellerid) {
85
if ($booksellerid) {
85
    push @suppliers, GetBookSellerFromId($booksellerid);
86
    push @suppliers, Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
86
} else {
87
} else {
87
    @suppliers = GetBookSeller($supplier);
88
    @suppliers = Koha::Acquisition::Bookseller->search({ name => $supplier });
88
}
89
}
89
90
90
my $supplier_count = @suppliers;
91
my $supplier_count = @suppliers;
(-)a/acqui/finishreceive.pl (-1 / +4 lines)
Lines 31-36 use C4::Biblio; Link Here
31
use C4::Bookseller;
31
use C4::Bookseller;
32
use C4::Items;
32
use C4::Items;
33
use C4::Search;
33
use C4::Search;
34
35
use Koha::Acquisition::Bookseller;
36
34
use List::MoreUtils qw/any/;
37
use List::MoreUtils qw/any/;
35
38
36
my $input=new CGI;
39
my $input=new CGI;
Lines 83-89 if ($quantityrec > $origquantityrec ) { Link Here
83
    $order->{rrp} = $rrp;
86
    $order->{rrp} = $rrp;
84
    $order->{ecost} = $ecost;
87
    $order->{ecost} = $ecost;
85
    $order->{unitprice} = $unitprice;
88
    $order->{unitprice} = $unitprice;
86
    my $bookseller = C4::Bookseller::GetBookSellerFromId($booksellerid);
89
    my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
87
    if ( $bookseller->{listincgst} ) {
90
    if ( $bookseller->{listincgst} ) {
88
        if ( not $bookseller->{invoiceincgst} ) {
91
        if ( not $bookseller->{invoiceincgst} ) {
89
            $order->{rrp} = $order->{rrp} * ( 1 + $order->{gstrate} );
92
            $order->{rrp} = $order->{rrp} * ( 1 + $order->{gstrate} );
(-)a/acqui/invoice.pl (-2 / +3 lines)
Lines 33-40 use CGI; Link Here
33
use C4::Auth;
33
use C4::Auth;
34
use C4::Output;
34
use C4::Output;
35
use C4::Acquisition;
35
use C4::Acquisition;
36
use C4::Bookseller qw/GetBookSellerFromId/;
37
use C4::Budgets;
36
use C4::Budgets;
37
38
use Koha::Acquisition::Bookseller;
38
use Koha::Misc::Files;
39
use Koha::Misc::Files;
39
40
40
my $input = new CGI;
41
my $input = new CGI;
Lines 109-115 elsif ( $op && $op eq 'delete' ) { Link Here
109
110
110
111
111
my $details = GetInvoiceDetails($invoiceid);
112
my $details = GetInvoiceDetails($invoiceid);
112
my $bookseller = GetBookSellerFromId($details->{booksellerid});
113
my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $details->{booksellerid} });
113
my @orders_loop = ();
114
my @orders_loop = ();
114
my $orders = $details->{'orders'};
115
my $orders = $details->{'orders'};
115
my $qty_total;
116
my $qty_total;
(-)a/acqui/invoices.pl (-2 / +1 lines)
Lines 34-40 use C4::Auth; Link Here
34
use C4::Output;
34
use C4::Output;
35
35
36
use C4::Acquisition qw/GetInvoices/;
36
use C4::Acquisition qw/GetInvoices/;
37
use C4::Bookseller qw/GetBookSeller/;
38
use C4::Branch qw/GetBranches/;
37
use C4::Branch qw/GetBranches/;
39
use C4::Budgets;
38
use C4::Budgets;
40
39
Lines 87-93 if ( $op and $op eq 'do_search' ) { Link Here
87
}
86
}
88
87
89
# Build suppliers list
88
# Build suppliers list
90
my @suppliers      = GetBookSeller(undef);
89
my @suppliers      = Koha::Acquisition::Bookseller->search;
91
my $suppliers_loop = [];
90
my $suppliers_loop = [];
92
my $suppliername;
91
my $suppliername;
93
foreach (@suppliers) {
92
foreach (@suppliers) {
(-)a/acqui/modordernotes.pl (-2 / +3 lines)
Lines 32-38 use CGI; Link Here
32
use C4::Auth;
32
use C4::Auth;
33
use C4::Output;
33
use C4::Output;
34
use C4::Acquisition;
34
use C4::Acquisition;
35
use C4::Bookseller qw( GetBookSellerFromId);
35
36
use Koha::Acquisition::Bookseller;
36
37
37
my $input = new CGI;
38
my $input = new CGI;
38
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
39
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
Lines 50-56 my $referrer = $input->param('referrer') || $input->referer(); Link Here
50
my $type = $input->param('type');
51
my $type = $input->param('type');
51
my $order = GetOrder($ordernumber);
52
my $order = GetOrder($ordernumber);
52
my $basket = GetBasket($order->{basketno});
53
my $basket = GetBasket($order->{basketno});
53
my ($bookseller) = GetBookSellerFromId($basket->{booksellerid});
54
my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $basket->{booksellerid} });
54
55
55
56
56
if($op and $op eq 'save') {
57
if($op and $op eq 'save') {
(-)a/acqui/neworderbiblio.pl (-2 / +3 lines)
Lines 60-66 use strict; Link Here
60
60
61
use C4::Search;
61
use C4::Search;
62
use CGI;
62
use CGI;
63
use C4::Bookseller qw/ GetBookSellerFromId /;
64
use C4::Biblio;
63
use C4::Biblio;
65
use C4::Auth;
64
use C4::Auth;
66
use C4::Output;
65
use C4::Output;
Lines 68-73 use C4::Koha; Link Here
68
use C4::Members qw/ GetMember /;
67
use C4::Members qw/ GetMember /;
69
use C4::Budgets qw/ GetBudgetHierarchy /;
68
use C4::Budgets qw/ GetBudgetHierarchy /;
70
69
70
use Koha::Acquisition::Bookseller;
71
71
my $input = new CGI;
72
my $input = new CGI;
72
73
73
#getting all CGI params into a hash.
74
#getting all CGI params into a hash.
Lines 79-85 my $results_per_page = $params->{'num'} || 20; Link Here
79
my $booksellerid     = $params->{'booksellerid'};
80
my $booksellerid     = $params->{'booksellerid'};
80
my $basketno         = $params->{'basketno'};
81
my $basketno         = $params->{'basketno'};
81
my $sub              = $params->{'sub'};
82
my $sub              = $params->{'sub'};
82
my $bookseller = GetBookSellerFromId($booksellerid);
83
my $bookseller       = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
83
84
84
# getting the template
85
# getting the template
85
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
86
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
(-)a/acqui/neworderempty.pl (-2 / +3 lines)
Lines 76-82 use C4::Auth; Link Here
76
use C4::Budgets;
76
use C4::Budgets;
77
use C4::Input;
77
use C4::Input;
78
78
79
use C4::Bookseller  qw/ GetBookSellerFromId /;
80
use C4::Acquisition;
79
use C4::Acquisition;
81
use C4::Contract;
80
use C4::Contract;
82
use C4::Suggestions;	# GetSuggestion
81
use C4::Suggestions;	# GetSuggestion
Lines 92-97 use C4::Search qw/FindDuplicate/; Link Here
92
#needed for z3950 import:
91
#needed for z3950 import:
93
use C4::ImportBatch qw/GetImportRecordMarc SetImportRecordStatus/;
92
use C4::ImportBatch qw/GetImportRecordMarc SetImportRecordStatus/;
94
93
94
use Koha::Acquisition::Bookseller;
95
95
our $input           = new CGI;
96
our $input           = new CGI;
96
my $booksellerid    = $input->param('booksellerid');	# FIXME: else ERROR!
97
my $booksellerid    = $input->param('booksellerid');	# FIXME: else ERROR!
97
my $budget_id       = $input->param('budget_id') || 0;
98
my $budget_id       = $input->param('budget_id') || 0;
Lines 131-137 if(!$basketno) { Link Here
131
132
132
our $basket = GetBasket($basketno);
133
our $basket = GetBasket($basketno);
133
$booksellerid = $basket->{booksellerid} unless $booksellerid;
134
$booksellerid = $basket->{booksellerid} unless $booksellerid;
134
my $bookseller = GetBookSellerFromId($booksellerid);
135
my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
135
136
136
my $contract = GetContract({
137
my $contract = GetContract({
137
    contractnumber => $basket->{contractnumber}
138
    contractnumber => $basket->{contractnumber}
(-)a/acqui/newordersubscription.pl (-2 / +3 lines)
Lines 21-32 use Modern::Perl; Link Here
21
use CGI;
21
use CGI;
22
use C4::Acquisition;
22
use C4::Acquisition;
23
use C4::Auth;
23
use C4::Auth;
24
use C4::Bookseller qw/GetBookSellerFromId/;
25
use C4::Branch;
24
use C4::Branch;
26
use C4::Context;
25
use C4::Context;
27
use C4::Output;
26
use C4::Output;
28
use C4::Serials;
27
use C4::Serials;
29
28
29
use Koha::Acquisition::Bookseller;
30
30
my $query        = new CGI;
31
my $query        = new CGI;
31
my $title        = $query->param('title_filter');
32
my $title        = $query->param('title_filter');
32
my $ISSN         = $query->param('ISSN_filter');
33
my $ISSN         = $query->param('ISSN_filter');
Lines 52-58 my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( Link Here
52
53
53
my $basket = GetBasket($basketno);
54
my $basket = GetBasket($basketno);
54
$booksellerid = $basket->{booksellerid} unless $booksellerid;
55
$booksellerid = $basket->{booksellerid} unless $booksellerid;
55
my ($bookseller) = GetBookSellerFromId($booksellerid);
56
my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
56
57
57
my @subscriptions;
58
my @subscriptions;
58
if ($searched) {
59
if ($searched) {
(-)a/acqui/newordersuggestion.pl (-2 / +3 lines)
Lines 95-103 use CGI; Link Here
95
use C4::Auth;    # get_template_and_user
95
use C4::Auth;    # get_template_and_user
96
use C4::Output;
96
use C4::Output;
97
use C4::Suggestions;
97
use C4::Suggestions;
98
use C4::Bookseller qw/ GetBookSellerFromId /;
99
use C4::Biblio;
98
use C4::Biblio;
100
99
100
use Koha::Acquisition::Bookseller;
101
101
my $input = new CGI;
102
my $input = new CGI;
102
103
103
# getting the CGI params
104
# getting the CGI params
Lines 135-141 my $suggestions_loop = Link Here
135
                title			=> $title, 
136
                title			=> $title, 
136
                publishercode	=> $publishercode,
137
                publishercode	=> $publishercode,
137
                STATUS        => 'ACCEPTED'});
138
                STATUS        => 'ACCEPTED'});
138
my $vendor = GetBookSellerFromId($booksellerid);
139
my $vendor = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
139
$template->param(
140
$template->param(
140
    suggestions_loop        => $suggestions_loop,
141
    suggestions_loop        => $suggestions_loop,
141
    basketno                => $basketno,
142
    basketno                => $basketno,
(-)a/acqui/orderreceive.pl (-2 / +3 lines)
Lines 68-74 use C4::Acquisition; Link Here
68
use C4::Auth;
68
use C4::Auth;
69
use C4::Output;
69
use C4::Output;
70
use C4::Dates qw/format_date/;
70
use C4::Dates qw/format_date/;
71
use C4::Bookseller qw/ GetBookSellerFromId /;
72
use C4::Budgets qw/ GetBudget GetBudgetHierarchy CanUserUseBudget GetBudgetPeriods /;
71
use C4::Budgets qw/ GetBudget GetBudgetHierarchy CanUserUseBudget GetBudgetPeriods /;
73
use C4::Members;
72
use C4::Members;
74
use C4::Branch;    # GetBranches
73
use C4::Branch;    # GetBranches
Lines 76-81 use C4::Items; Link Here
76
use C4::Biblio;
75
use C4::Biblio;
77
use C4::Suggestions;
76
use C4::Suggestions;
78
77
78
use Koha::Acquisition::Bookseller;
79
79
80
80
my $input      = new CGI;
81
my $input      = new CGI;
81
82
Lines 89-95 my $ordernumber = $input->param('ordernumber'); Link Here
89
90
90
$datereceived = $datereceived ? C4::Dates->new($datereceived, 'iso') : C4::Dates->new();
91
$datereceived = $datereceived ? C4::Dates->new($datereceived, 'iso') : C4::Dates->new();
91
92
92
my $bookseller = GetBookSellerFromId($booksellerid);
93
my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
93
my $results;
94
my $results;
94
$results = SearchOrders({
95
$results = SearchOrders({
95
    ordernumber => $ordernumber
96
    ordernumber => $ordernumber
(-)a/acqui/parcel.pl (-2 / +4 lines)
Lines 60-66 use warnings; Link Here
60
use C4::Auth;
60
use C4::Auth;
61
use C4::Acquisition;
61
use C4::Acquisition;
62
use C4::Budgets;
62
use C4::Budgets;
63
use C4::Bookseller qw/ GetBookSellerFromId /;
64
use C4::Biblio;
63
use C4::Biblio;
65
use C4::Items;
64
use C4::Items;
66
use CGI;
65
use CGI;
Lines 68-73 use C4::Output; Link Here
68
use C4::Dates qw/format_date format_date_in_iso/;
67
use C4::Dates qw/format_date format_date_in_iso/;
69
use C4::Suggestions;
68
use C4::Suggestions;
70
use C4::Reserves qw/GetReservesFromBiblionumber/;
69
use C4::Reserves qw/GetReservesFromBiblionumber/;
70
71
use Koha::Acquisition::Bookseller;
72
71
use JSON;
73
use JSON;
72
74
73
my $input=new CGI;
75
my $input=new CGI;
Lines 145-151 unless( $invoiceid and $invoice->{invoiceid} ) { Link Here
145
}
147
}
146
148
147
my $booksellerid = $invoice->{booksellerid};
149
my $booksellerid = $invoice->{booksellerid};
148
my $bookseller = GetBookSellerFromId($booksellerid);
150
my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
149
my $gst = $bookseller->{gstrate} // C4::Context->preference("gist") // 0;
151
my $gst = $bookseller->{gstrate} // C4::Context->preference("gist") // 0;
150
my $datereceived = C4::Dates->new();
152
my $datereceived = C4::Dates->new();
151
153
(-)a/acqui/parcels.pl (-2 / +3 lines)
Lines 74-82 use C4::Output; Link Here
74
74
75
use C4::Dates qw/format_date/;
75
use C4::Dates qw/format_date/;
76
use C4::Acquisition;
76
use C4::Acquisition;
77
use C4::Bookseller qw/ GetBookSellerFromId /;
78
use C4::Budgets;
77
use C4::Budgets;
79
78
79
use Koha::Acquisition::Bookseller;
80
80
my $input          = CGI->new;
81
my $input          = CGI->new;
81
my $booksellerid     = $input->param('booksellerid');
82
my $booksellerid     = $input->param('booksellerid');
82
my $order          = $input->param('orderby') || 'shipmentdate desc';
83
my $order          = $input->param('orderby') || 'shipmentdate desc';
Lines 140-146 if ($op and $op eq 'confirm') { Link Here
140
    }
141
    }
141
}
142
}
142
143
143
my $bookseller = GetBookSellerFromId($booksellerid);
144
my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
144
my @parcels = GetInvoices(
145
my @parcels = GetInvoices(
145
    supplierid => $booksellerid,
146
    supplierid => $booksellerid,
146
    invoicenumber => $code,
147
    invoicenumber => $code,
(-)a/acqui/supplier.pl (-2 / +4 lines)
Lines 48-57 use C4::Biblio; Link Here
48
use C4::Output;
48
use C4::Output;
49
use CGI;
49
use CGI;
50
50
51
use C4::Bookseller qw( GetBookSellerFromId DelBookseller );
51
use C4::Bookseller qw( DelBookseller );
52
use C4::Bookseller::Contact;
52
use C4::Bookseller::Contact;
53
use C4::Budgets;
53
use C4::Budgets;
54
54
55
use Koha::Acquisition::Bookseller;
56
55
my $query    = CGI->new;
57
my $query    = CGI->new;
56
my $op = $query->param('op') || 'display';
58
my $op = $query->param('op') || 'display';
57
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
59
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Lines 66-72 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
66
my $booksellerid       = $query->param('booksellerid');
68
my $booksellerid       = $query->param('booksellerid');
67
my $supplier = {};
69
my $supplier = {};
68
if ($booksellerid) {
70
if ($booksellerid) {
69
    $supplier = GetBookSellerFromId($booksellerid);
71
    $supplier = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
70
    foreach ( keys %{$supplier} ) {
72
    foreach ( keys %{$supplier} ) {
71
        $template->{'VARS'}->{$_} = $supplier->{$_};
73
        $template->{'VARS'}->{$_} = $supplier->{$_};
72
    }
74
    }
(-)a/acqui/transferorder.pl (-6 / +5 lines)
Lines 26-32 use C4::Auth; Link Here
26
use C4::Output;
26
use C4::Output;
27
use C4::Context;
27
use C4::Context;
28
use C4::Acquisition;
28
use C4::Acquisition;
29
use C4::Bookseller qw/GetBookSellerFromId GetBookSeller/;
30
use C4::Members;
29
use C4::Members;
31
use C4::Dates qw/format_date_in_iso/;
30
use C4::Dates qw/format_date_in_iso/;
32
use Date::Calc qw/Today/;
31
use Date::Calc qw/Today/;
Lines 55-66 if($order) { Link Here
55
    $bookselleridfrom = $basket->{booksellerid} if $basket;
54
    $bookselleridfrom = $basket->{booksellerid} if $basket;
56
}
55
}
57
56
58
my $booksellerfrom = GetBookSellerFromId($bookselleridfrom);
57
my $booksellerfrom = Koha::Acquisition::Bookseller->fetch({ id => $bookselleridfrom });
59
my $booksellerfromname;
58
my $booksellerfromname;
60
if($booksellerfrom){
59
if($booksellerfrom){
61
    $booksellerfromname = $booksellerfrom->{name};
60
    $booksellerfromname = $booksellerfrom->{name};
62
}
61
}
63
my $booksellerto = GetBookSellerFromId($bookselleridto);
62
my $booksellerto = Koha::Acquisition::Bookseller->fetch({ id => $bookselleridto });
64
my $booksellertoname;
63
my $booksellertoname;
65
if($booksellerto){
64
if($booksellerto){
66
    $booksellertoname = $booksellerto->{name};
65
    $booksellertoname = $booksellerto->{name};
Lines 70-76 if( $basketno && $ordernumber) { Link Here
70
    # Transfer order and exit
69
    # Transfer order and exit
71
    my $order = GetOrder( $ordernumber );
70
    my $order = GetOrder( $ordernumber );
72
    my $basket = GetBasket($order->{basketno});
71
    my $basket = GetBasket($order->{basketno});
73
    my $booksellerfrom = GetBookSellerFromId($basket->{booksellerid});
72
    my $booksellerfrom = Koha::Acquisition::Bookseller->fetch({ id => $basket->{booksellerid} });
74
    my $bookselleridfrom = $booksellerfrom->{id};
73
    my $bookselleridfrom = $booksellerfrom->{id};
75
74
76
    TransferOrder($ordernumber, $basketno);
75
    TransferOrder($ordernumber, $basketno);
Lines 80-86 if( $basketno && $ordernumber) { Link Here
80
    # Show open baskets for this bookseller
79
    # Show open baskets for this bookseller
81
    my $order = GetOrder( $ordernumber );
80
    my $order = GetOrder( $ordernumber );
82
    my $basketfrom = GetBasket( $order->{basketno} );
81
    my $basketfrom = GetBasket( $order->{basketno} );
83
    my $booksellerfrom = GetBookSellerFromId( $basketfrom->{booksellerid} );
82
    my $booksellerfrom = Koha::Acquisition::Bookseller->fetch({ id => $basketfrom->{booksellerid} });
84
    $booksellerfromname = $booksellerfrom->{name};
83
    $booksellerfromname = $booksellerfrom->{name};
85
    my $baskets = GetBasketsByBookseller( $bookselleridto );
84
    my $baskets = GetBasketsByBookseller( $bookselleridto );
86
    my $basketscount = scalar @$baskets;
85
    my $basketscount = scalar @$baskets;
Lines 117-123 if( $basketno && $ordernumber) { Link Here
117
    # Search for booksellers to transfer from/to
116
    # Search for booksellers to transfer from/to
118
    $op = '' unless $op;
117
    $op = '' unless $op;
119
    if( $op eq "do_search" ) {
118
    if( $op eq "do_search" ) {
120
        my @booksellers = GetBookSeller($query);
119
        my @booksellers = Koha::Acquisition::Bookseller->search({ name => $query });
121
        $template->param(
120
        $template->param(
122
            query => $query,
121
            query => $query,
123
            do_search => 1,
122
            do_search => 1,
(-)a/acqui/uncertainprice.pl (-2 / +3 lines)
Lines 51-61 use C4::Auth; Link Here
51
use C4::Output;
51
use C4::Output;
52
use CGI;
52
use CGI;
53
53
54
use C4::Bookseller qw/GetBookSellerFromId/;
55
use C4::Bookseller::Contact;
54
use C4::Bookseller::Contact;
56
use C4::Acquisition qw/SearchOrders GetOrder ModOrder/;
55
use C4::Acquisition qw/SearchOrders GetOrder ModOrder/;
57
use C4::Biblio qw/GetBiblioData/;
56
use C4::Biblio qw/GetBiblioData/;
58
57
58
use Koha::Acquisition::Bookseller;
59
59
my $input=new CGI;
60
my $input=new CGI;
60
61
61
my ($template, $loggedinuser, $cookie)
62
my ($template, $loggedinuser, $cookie)
Lines 71-77 my $booksellerid = $input->param('booksellerid'); Link Here
71
my $basketno     = $input->param('basketno');
72
my $basketno     = $input->param('basketno');
72
my $op = $input->param('op');
73
my $op = $input->param('op');
73
my $owner = $input->param('owner') || 0 ; # flag to see only "my" orders, or everyone orders
74
my $owner = $input->param('owner') || 0 ; # flag to see only "my" orders, or everyone orders
74
my $bookseller = &GetBookSellerFromId($booksellerid);
75
my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
75
76
76
#show all orders that have uncertain price for the bookseller
77
#show all orders that have uncertain price for the bookseller
77
my $pendingorders = SearchOrders({
78
my $pendingorders = SearchOrders({
(-)a/acqui/z3950_search.pl (-2 / +3 lines)
Lines 28-34 use C4::Output; Link Here
28
use C4::Context;
28
use C4::Context;
29
use C4::Breeding;
29
use C4::Breeding;
30
use C4::Koha;
30
use C4::Koha;
31
use C4::Bookseller qw/ GetBookSellerFromId /;
31
32
use Koha::Acquisition::Bookseller;
32
33
33
my $input           = new CGI;
34
my $input           = new CGI;
34
my $biblionumber    = $input->param('biblionumber')||0;
35
my $biblionumber    = $input->param('biblionumber')||0;
Lines 62-68 foreach my $thisframeworkcode ( keys %$frameworks ) { Link Here
62
    push @frameworkcodeloop, \%row;
63
    push @frameworkcodeloop, \%row;
63
}
64
}
64
65
65
my $vendor = GetBookSellerFromId($booksellerid);
66
my $vendor = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
66
67
67
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
68
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
68
    {
69
    {
(-)a/admin/aqcontract.pl (-2 / +3 lines)
Lines 27-41 use C4::Context; Link Here
27
use C4::Auth;
27
use C4::Auth;
28
use C4::Output;
28
use C4::Output;
29
use C4::Dates qw/format_date format_date_in_iso/;
29
use C4::Dates qw/format_date format_date_in_iso/;
30
use C4::Bookseller qw/GetBookSellerFromId/;
31
use C4::Contract;
30
use C4::Contract;
32
31
32
use Koha::Acquisition::Bookseller;
33
33
my $input          = new CGI;
34
my $input          = new CGI;
34
my $contractnumber = $input->param('contractnumber');
35
my $contractnumber = $input->param('contractnumber');
35
my $booksellerid   = $input->param('booksellerid');
36
my $booksellerid   = $input->param('booksellerid');
36
my $op             = $input->param('op') || 'list';
37
my $op             = $input->param('op') || 'list';
37
38
38
my $bookseller = GetBookSellerFromId($booksellerid);
39
my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
39
40
40
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
41
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
41
    {   template_name   => "admin/aqcontract.tt",
42
    {   template_name   => "admin/aqcontract.tt",
(-)a/catalogue/moredetail.pl (-2 / +3 lines)
Lines 27-33 use C4::Biblio; Link Here
27
use C4::Items;
27
use C4::Items;
28
use C4::Branch;
28
use C4::Branch;
29
use C4::Acquisition;
29
use C4::Acquisition;
30
use C4::Bookseller qw(GetBookSellerFromId);
31
use C4::Output;
30
use C4::Output;
32
use C4::Auth;
31
use C4::Auth;
33
use C4::Serials;
32
use C4::Serials;
Lines 36-41 use C4::Members; # to use GetMember Link Here
36
use C4::Search;		# enabled_staff_search_views
35
use C4::Search;		# enabled_staff_search_views
37
use C4::Members qw/GetHideLostItemsPreference/;
36
use C4::Members qw/GetHideLostItemsPreference/;
38
use C4::Reserves qw(GetReservesFromBiblionumber);
37
use C4::Reserves qw(GetReservesFromBiblionumber);
38
39
use Koha::Acquisition::Bookseller;
39
use Koha::DateUtils;
40
use Koha::DateUtils;
40
41
41
my $query=new CGI;
42
my $query=new CGI;
Lines 161-167 foreach my $item (@items){ Link Here
161
    $item->{'orderdate'}               = $order->{'entrydate'};
162
    $item->{'orderdate'}               = $order->{'entrydate'};
162
    if ($item->{'basketno'}){
163
    if ($item->{'basketno'}){
163
	    my $basket = GetBasket($item->{'basketno'});
164
	    my $basket = GetBasket($item->{'basketno'});
164
	    my $bookseller = GetBookSellerFromId($basket->{'booksellerid'});
165
        my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $basket->{booksellerid} });
165
	    $item->{'vendor'} = $bookseller->{'name'};
166
	    $item->{'vendor'} = $bookseller->{'name'};
166
    }
167
    }
167
    $item->{'invoiceid'}               = $order->{'invoiceid'};
168
    $item->{'invoiceid'}               = $order->{'invoiceid'};
(-)a/serials/acqui-search-result.pl (-2 / +3 lines)
Lines 48-54 use C4::Output; Link Here
48
use CGI;
48
use CGI;
49
use C4::Acquisition qw( SearchOrders );
49
use C4::Acquisition qw( SearchOrders );
50
use C4::Dates qw/format_date/;
50
use C4::Dates qw/format_date/;
51
use C4::Bookseller qw( GetBookSeller );
51
52
use Koha::Acquisition::Bookseller;
52
53
53
my $query=new CGI;
54
my $query=new CGI;
54
my ($template, $loggedinuser, $cookie)
55
my ($template, $loggedinuser, $cookie)
Lines 61-67 my ($template, $loggedinuser, $cookie) Link Here
61
                 });
62
                 });
62
63
63
my $supplier=$query->param('supplier');
64
my $supplier=$query->param('supplier');
64
my @suppliers = GetBookSeller($supplier);
65
my @suppliers = Koha::Acquisition::Bookseller->search({ name => $supplier });
65
#my $count = scalar @suppliers;
66
#my $count = scalar @suppliers;
66
67
67
#build result page
68
#build result page
(-)a/serials/subscription-detail.pl (-3 / +5 lines)
Lines 19-25 use Modern::Perl; Link Here
19
use CGI;
19
use CGI;
20
use C4::Acquisition;
20
use C4::Acquisition;
21
use C4::Auth;
21
use C4::Auth;
22
use C4::Bookseller qw/GetBookSellerFromId/;
23
use C4::Budgets;
22
use C4::Budgets;
24
use C4::Koha;
23
use C4::Koha;
25
use C4::Dates qw/format_date/;
24
use C4::Dates qw/format_date/;
Lines 27-32 use C4::Serials; Link Here
27
use C4::Output;
26
use C4::Output;
28
use C4::Context;
27
use C4::Context;
29
use C4::Search qw/enabled_staff_search_views/;
28
use C4::Search qw/enabled_staff_search_views/;
29
30
use Koha::Acquisition::Bookseller;
31
30
use Date::Calc qw/Today Day_of_Year Week_of_Year Add_Delta_Days/;
32
use Date::Calc qw/Today Day_of_Year Week_of_Year Add_Delta_Days/;
31
use Carp;
33
use Carp;
32
34
Lines 117-123 if ( defined $subscriptionid ) { Link Here
117
    my $lastOrderReceived = GetLastOrderReceivedFromSubscriptionid $subscriptionid;
119
    my $lastOrderReceived = GetLastOrderReceivedFromSubscriptionid $subscriptionid;
118
    if ( defined $lastOrderNotReceived ) {
120
    if ( defined $lastOrderNotReceived ) {
119
        my $basket = GetBasket $lastOrderNotReceived->{basketno};
121
        my $basket = GetBasket $lastOrderNotReceived->{basketno};
120
        my $bookseller = GetBookSellerFromId $basket->{booksellerid};
122
        my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $basket->{booksellerid} });
121
        ( $tmpl_infos->{valuegsti_ordered}, $tmpl_infos->{valuegste_ordered} ) = get_value_with_gst_params ( $lastOrderNotReceived->{ecost}, $lastOrderNotReceived->{gstrate}, $bookseller );
123
        ( $tmpl_infos->{valuegsti_ordered}, $tmpl_infos->{valuegste_ordered} ) = get_value_with_gst_params ( $lastOrderNotReceived->{ecost}, $lastOrderNotReceived->{gstrate}, $bookseller );
122
        $tmpl_infos->{valuegsti_ordered} = sprintf( "%.2f", $tmpl_infos->{valuegsti_ordered} );
124
        $tmpl_infos->{valuegsti_ordered} = sprintf( "%.2f", $tmpl_infos->{valuegsti_ordered} );
123
        $tmpl_infos->{valuegste_ordered} = sprintf( "%.2f", $tmpl_infos->{valuegste_ordered} );
125
        $tmpl_infos->{valuegste_ordered} = sprintf( "%.2f", $tmpl_infos->{valuegste_ordered} );
Lines 127-133 if ( defined $subscriptionid ) { Link Here
127
    }
129
    }
128
    if ( defined $lastOrderReceived ) {
130
    if ( defined $lastOrderReceived ) {
129
        my $basket = GetBasket $lastOrderReceived->{basketno};
131
        my $basket = GetBasket $lastOrderReceived->{basketno};
130
        my $bookseller = GetBookSellerFromId $basket->{booksellerid};
132
        my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $basket->{booksellerid} });
131
        ( $tmpl_infos->{valuegsti_spent}, $tmpl_infos->{valuegste_spent} ) = get_value_with_gst_params ( $lastOrderReceived->{unitprice}, $lastOrderReceived->{gstrate}, $bookseller );
133
        ( $tmpl_infos->{valuegsti_spent}, $tmpl_infos->{valuegste_spent} ) = get_value_with_gst_params ( $lastOrderReceived->{unitprice}, $lastOrderReceived->{gstrate}, $bookseller );
132
        $tmpl_infos->{valuegsti_spent} = sprintf( "%.2f", $tmpl_infos->{valuegsti_spent} );
134
        $tmpl_infos->{valuegsti_spent} = sprintf( "%.2f", $tmpl_infos->{valuegsti_spent} );
133
        $tmpl_infos->{valuegste_spent} = sprintf( "%.2f", $tmpl_infos->{valuegste_spent} );
135
        $tmpl_infos->{valuegste_spent} = sprintf( "%.2f", $tmpl_infos->{valuegste_spent} );
(-)a/t/db_dependent/Acquisition.t (-4 / +3 lines)
Lines 6-14 Link Here
6
use Modern::Perl;
6
use Modern::Perl;
7
use POSIX qw(strftime);
7
use POSIX qw(strftime);
8
8
9
use C4::Bookseller qw( GetBookSellerFromId );
9
use Test::More tests => 76;
10
11
use Test::More tests => 75;
12
10
13
BEGIN {
11
BEGIN {
14
    use_ok('C4::Acquisition');
12
    use_ok('C4::Acquisition');
Lines 17-22 BEGIN { Link Here
17
    use_ok('C4::Budgets');
15
    use_ok('C4::Budgets');
18
    use_ok('C4::Bookseller');
16
    use_ok('C4::Bookseller');
19
    use_ok('Koha::Acquisition::Order');
17
    use_ok('Koha::Acquisition::Order');
18
    use_ok('Koha::Acquisition::Bookseller');
20
}
19
}
21
20
22
# Sub used for testing C4::Acquisition subs returning order(s):
21
# Sub used for testing C4::Acquisition subs returning order(s):
Lines 119-125 my $booksellerid = C4::Bookseller::AddBookseller( Link Here
119
    }
118
    }
120
);
119
);
121
120
122
my $booksellerinfo = C4::Bookseller::GetBookSellerFromId($booksellerid);
121
my $booksellerinfo = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
123
122
124
is( $booksellerinfo->{deliverytime},
123
is( $booksellerinfo->{deliverytime},
125
    5, 'set deliverytime when creating vendor (Bug 10556)' );
124
    5, 'set deliverytime when creating vendor (Bug 10556)' );
(-)a/t/db_dependent/Acquisition/Invoices.t (-4 / +4 lines)
Lines 3-15 Link Here
3
# This Koha test module is a stub!
3
# This Koha test module is a stub!
4
# Add more tests here!!!
4
# Add more tests here!!!
5
5
6
use strict;
6
use Modern::Perl;
7
use warnings;
8
7
9
use C4::Bookseller qw( GetBookSellerFromId );
10
use C4::Biblio qw( AddBiblio );
8
use C4::Biblio qw( AddBiblio );
9
use C4::Bookseller qw( AddBookseller );
11
10
12
use Koha::Acquisition::Order;
11
use Koha::Acquisition::Order;
12
use Koha::Acquisition::Bookseller;
13
13
14
use Test::More tests => 22;
14
use Test::More tests => 22;
15
15
Lines 32-38 my $booksellerid = C4::Bookseller::AddBookseller( Link Here
32
    }
32
    }
33
);
33
);
34
34
35
my $booksellerinfo = GetBookSellerFromId( $booksellerid );
35
my $booksellerinfo = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
36
my $basketno = NewBasket($booksellerid, 1);
36
my $basketno = NewBasket($booksellerid, 1);
37
my $basket   = GetBasket($basketno);
37
my $basket   = GetBasket($basketno);
38
38
(-)a/t/db_dependent/Acquisition/OrderFromSubscription.t (-2 / +2 lines)
Lines 1-10 Link Here
1
use Modern::Perl;
1
use Modern::Perl;
2
2
3
use Test::More tests => 12;
3
use Test::More tests => 13;
4
use Data::Dumper;
5
4
6
use_ok('C4::Acquisition');
5
use_ok('C4::Acquisition');
7
use_ok('C4::Biblio');
6
use_ok('C4::Biblio');
7
use_ok('C4::Bookseller');
8
use_ok('C4::Budgets');
8
use_ok('C4::Budgets');
9
use_ok('C4::Serials');
9
use_ok('C4::Serials');
10
10
(-)a/t/db_dependent/Bookseller.t (-46 / +44 lines)
Lines 2-8 Link Here
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
4
5
use Test::More tests => 86;
5
use Test::More tests => 88;
6
use Test::MockModule;
6
use Test::MockModule;
7
use Test::Warn;
7
use Test::Warn;
8
8
Lines 18-23 use Koha::Acquisition::Order; Link Here
18
18
19
BEGIN {
19
BEGIN {
20
    use_ok('C4::Bookseller');
20
    use_ok('C4::Bookseller');
21
    use_ok('Koha::Acquisition::Bookseller');
21
}
22
}
22
23
23
can_ok(
24
can_ok(
Lines 25-32 can_ok( Link Here
25
    'C4::Bookseller', qw(
26
    'C4::Bookseller', qw(
26
      AddBookseller
27
      AddBookseller
27
      DelBookseller
28
      DelBookseller
28
      GetBookSeller
29
      GetBookSellerFromId
30
      GetBooksellersWithLateOrders
29
      GetBooksellersWithLateOrders
31
      ModBookseller )
30
      ModBookseller )
32
);
31
);
Lines 43-49 $dbh->do(q|DELETE FROM aqbooksellers|); Link Here
43
$dbh->do(q|DELETE FROM subscription|);
42
$dbh->do(q|DELETE FROM subscription|);
44
43
45
#Test AddBookseller
44
#Test AddBookseller
46
my $count            = scalar( C4::Bookseller::GetBookSeller('') );
45
my $count            = scalar( Koha::Acquisition::Bookseller->search() );
47
my $sample_supplier1 = {
46
my $sample_supplier1 = {
48
    name          => 'Name1',
47
    name          => 'Name1',
49
    address1      => 'address1_1',
48
    address1      => 'address1_1',
Lines 92-122 my $id_supplier2 = C4::Bookseller::AddBookseller($sample_supplier2); Link Here
92
91
93
like( $id_supplier1, '/^\d+$/', "AddBookseller for supplier1 return an id" );
92
like( $id_supplier1, '/^\d+$/', "AddBookseller for supplier1 return an id" );
94
like( $id_supplier2, '/^\d+$/', "AddBookseller for supplier2 return an id" );
93
like( $id_supplier2, '/^\d+$/', "AddBookseller for supplier2 return an id" );
95
is( scalar( C4::Bookseller::GetBookSeller('') ),
94
my @b = Koha::Acquisition::Bookseller->search();
95
is ( scalar(@b),
96
    $count + 2, "Supplier1 and Supplier2 have been added" );
96
    $count + 2, "Supplier1 and Supplier2 have been added" );
97
97
98
#Test DelBookseller
98
#Test DelBookseller
99
my $del = C4::Bookseller::DelBookseller($id_supplier1);
99
my $del = C4::Bookseller::DelBookseller($id_supplier1);
100
is( $del, 1, "DelBookseller returns 1 - 1 supplier has been deleted " );
100
is( $del, 1, "DelBookseller returns 1 - 1 supplier has been deleted " );
101
is( C4::Bookseller::GetBookSellerFromId($id_supplier1),
101
my $b = Koha::Acquisition::Bookseller->fetch({id => $id_supplier1});
102
    undef, "Supplier1  has been deleted - id_supplier1 doesnt exist anymore" );
102
is( $b,
103
    undef, "Supplier1  has been deleted - id_supplier1 $id_supplier1 doesnt exist anymore" );
103
104
104
#Test GetBookSeller
105
#Test GetBookSeller
105
my @bookseller2 = C4::Bookseller::GetBookSeller( $sample_supplier2->{name} );
106
my @bookseller2 = Koha::Acquisition::Bookseller->search({name => $sample_supplier2->{name} });
106
is( scalar(@bookseller2), 1, "Get only  Supplier2" );
107
is( scalar(@bookseller2), 1, "Get only  Supplier2" );
107
$bookseller2[0] = field_filter( $bookseller2[0] );
108
$bookseller2[0] = field_filter( $bookseller2[0] );
108
delete $bookseller2[0]->{basketcount};
109
109
110
$sample_supplier2->{id} = $id_supplier2;
110
$sample_supplier2->{id} = $id_supplier2;
111
is_deeply( $bookseller2[0], $sample_supplier2,
111
is_deeply( $bookseller2[0], $sample_supplier2,
112
    "GetBookSeller returns the right informations about $sample_supplier2" );
112
    "Koha::Acquisition::Bookseller->search returns the right informations about $sample_supplier2" );
113
113
114
$id_supplier1 = C4::Bookseller::AddBookseller($sample_supplier1);
114
$id_supplier1 = C4::Bookseller::AddBookseller($sample_supplier1);
115
my @booksellers = C4::Bookseller::GetBookSeller('')
115
my @booksellers = Koha::Acquisition::Bookseller->search(); #NOTE :without params, it returns all the booksellers
116
  ;    #NOTE :without params, it returns all the booksellers
117
for my $i ( 0 .. scalar(@booksellers) - 1 ) {
116
for my $i ( 0 .. scalar(@booksellers) - 1 ) {
118
    $booksellers[$i] = field_filter( $booksellers[$i] );
117
    $booksellers[$i] = field_filter( $booksellers[$i] );
119
    delete $booksellers[$i]->{basketcount};
120
}
118
}
121
119
122
$sample_supplier1->{id} = $id_supplier1;
120
$sample_supplier1->{id} = $id_supplier1;
Lines 125-157 my @tab = ( $sample_supplier1, $sample_supplier2 ); Link Here
125
is_deeply( \@booksellers, \@tab,
123
is_deeply( \@booksellers, \@tab,
126
    "Returns right fields of Supplier1 and Supplier2" );
124
    "Returns right fields of Supplier1 and Supplier2" );
127
125
128
#Test basketcount
126
#Test basket_count
129
my @bookseller1 = C4::Bookseller::GetBookSeller( $sample_supplier1->{name} );
127
my @bookseller1 = Koha::Acquisition::Bookseller->search({name => $sample_supplier1->{name} });
130
#FIXME : if there is 0 basket, GetBookSeller returns 1 as basketcount
128
is( $bookseller1[0]->basket_count, 0, 'Supplier1 has 0 basket' );
131
#is( $bookseller1[0]->{basketcount}, 0, 'Supplier1 has 0 basket' );
132
my $basketno1 =
129
my $basketno1 =
133
  C4::Acquisition::NewBasket( $id_supplier1, 'authorisedby1', 'basketname1' );
130
  C4::Acquisition::NewBasket( $id_supplier1, 'authorisedby1', 'basketname1' );
134
my $basketno2 =
131
my $basketno2 =
135
  C4::Acquisition::NewBasket( $id_supplier1, 'authorisedby2', 'basketname2' );
132
  C4::Acquisition::NewBasket( $id_supplier1, 'authorisedby2', 'basketname2' );
136
@bookseller1 = C4::Bookseller::GetBookSeller( $sample_supplier1->{name} );
133
@bookseller1 = Koha::Acquisition::Bookseller::search({ name => $sample_supplier1->{name} });
137
is( $bookseller1[0]->{basketcount}, 2, 'Supplier1 has 2 baskets' );
134
is( $bookseller1[0]->basket_count, 2, 'Supplier1 has 2 baskets' );
138
135
139
#Test GetBookSellerFromId
136
#Test Koha::Acquisition::Bookseller->new using id
140
my $bookseller1fromid = C4::Bookseller::GetBookSellerFromId();
137
my $bookseller1fromid = Koha::Acquisition::Bookseller->fetch;
141
is( $bookseller1fromid, undef,
138
is( $bookseller1fromid, undef,
142
    "GetBookSellerFromId returns undef if no id given" );
139
    "fetch returns undef if no id given" );
143
$bookseller1fromid = C4::Bookseller::GetBookSellerFromId($id_supplier1);
140
$bookseller1fromid = Koha::Acquisition::Bookseller->fetch({ id => $id_supplier1});
144
$bookseller1fromid = field_filter($bookseller1fromid);
141
$bookseller1fromid = field_filter($bookseller1fromid);
145
delete $bookseller1fromid->{basketcount};
146
delete $bookseller1fromid->{subscriptioncount};
147
is_deeply( $bookseller1fromid, $sample_supplier1,
142
is_deeply( $bookseller1fromid, $sample_supplier1,
148
    "Get Supplier1 (GetBookSellerFromId)" );
143
    "Get Supplier1 (GetBookSellerFromId)" );
149
144
150
#Test basketcount
145
#Test basket_count
151
$bookseller1fromid = C4::Bookseller::GetBookSellerFromId($id_supplier1);
146
$bookseller1fromid = Koha::Acquisition::Bookseller->fetch({ id => $id_supplier1});
152
is( $bookseller1fromid->{basketcount}, 2, 'Supplier1 has 2 baskets' );
147
is( $bookseller1fromid->basket_count, 2, 'Supplier1 has 2 baskets' );
153
148
154
#Test subscriptioncount
149
#Test subscription_count
155
my $dt_today    = dt_from_string;
150
my $dt_today    = dt_from_string;
156
my $today       = output_pref({ dt => $dt_today, dateformat => 'iso', timeformat => '24hr', dateonly => 1 });
151
my $today       = output_pref({ dt => $dt_today, dateformat => 'iso', timeformat => '24hr', dateonly => 1 });
157
152
Lines 178-185 $bib->append_fields( Link Here
178
    MARC::Field->new('500', ' ', ' ', a => 'bib notes'),
173
    MARC::Field->new('500', ' ', ' ', a => 'bib notes'),
179
);
174
);
180
my ($biblionumber, $biblioitemnumber) = AddBiblio($bib, '');
175
my ($biblionumber, $biblioitemnumber) = AddBiblio($bib, '');
181
$bookseller1fromid = C4::Bookseller::GetBookSellerFromId($id_supplier1);
176
$bookseller1fromid = Koha::Acquisition::Bookseller->fetch({ id => $id_supplier1 });
182
is( $bookseller1fromid->{subscriptioncount},
177
is( $bookseller1fromid->subscription_count,
183
    0, 'Supplier1 has 0 subscription' );
178
    0, 'Supplier1 has 0 subscription' );
184
179
185
my $id_subscription1 = NewSubscription(
180
my $id_subscription1 = NewSubscription(
Lines 203-210 my $id_subscription2 = NewSubscription( Link Here
203
    undef, undef, 0,          undef,         '2013-07-31', 0
198
    undef, undef, 0,          undef,         '2013-07-31', 0
204
);
199
);
205
200
206
$bookseller1fromid = C4::Bookseller::GetBookSellerFromId($id_supplier1);
201
$bookseller1fromid = Koha::Acquisition::Bookseller->fetch({ id => $id_supplier1 });
207
is( $bookseller1fromid->{subscriptioncount},
202
is( $bookseller1fromid->subscription_count,
208
    2, 'Supplier1 has 2 subscriptions' );
203
    2, 'Supplier1 has 2 subscriptions' );
209
204
210
#Test ModBookseller
205
#Test ModBookseller
Lines 235-241 is( $modif1, undef, Link Here
235
    "ModBookseller returns undef if no params given - Nothing happened" );
230
    "ModBookseller returns undef if no params given - Nothing happened" );
236
$modif1 = C4::Bookseller::ModBookseller($sample_supplier2);
231
$modif1 = C4::Bookseller::ModBookseller($sample_supplier2);
237
is( $modif1, 1, "ModBookseller modifies only the supplier2" );
232
is( $modif1, 1, "ModBookseller modifies only the supplier2" );
238
is( scalar( C4::Bookseller::GetBookSeller('') ),
233
is( scalar( Koha::Acquisition::Bookseller->search ),
239
    $count + 2, "Supplier2 has been modified - Nothing added" );
234
    $count + 2, "Supplier2 has been modified - Nothing added" );
240
235
241
$modif1 = C4::Bookseller::ModBookseller(
236
$modif1 = C4::Bookseller::ModBookseller(
Lines 695-711 my $booksellerid = C4::Bookseller::AddBookseller( Link Here
695
    ]
690
    ]
696
);
691
);
697
692
698
@booksellers = C4::Bookseller::GetBookSeller('my vendor');
693
@booksellers = Koha::Acquisition::Bookseller->search({ name => 'my vendor' });
699
ok(
694
ok(
700
    ( grep { $_->{'id'} == $booksellerid } @booksellers ),
695
    ( grep { $_->{'id'} == $booksellerid } @booksellers ),
701
    'GetBookSeller returns correct record when passed a name'
696
    'Koha::Acquisition::Bookseller->search returns correct record when passed a name'
702
);
697
);
703
698
704
my $bookseller = C4::Bookseller::GetBookSellerFromId($booksellerid);
699
my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
705
is( $bookseller->{'id'}, $booksellerid, 'Retrieved desired record' );
700
is( $bookseller->{'id'}, $booksellerid, 'Retrieved desired record' );
706
is( $bookseller->{'phone'}, '0123456', 'New bookseller has expected phone' );
701
is( $bookseller->{'phone'}, '0123456', 'New bookseller has expected phone' );
707
is( ref $bookseller->{'contacts'},
702
my $contacts = $bookseller->contacts;
708
    'ARRAY', 'GetBookSellerFromId returns arrayref of contacts' );
703
is( ref $bookseller->contacts,
704
    'ARRAY', 'Koha::Acquisition::Bookseller->fetch returns arrayref of contacts' );
709
is(
705
is(
710
    ref $bookseller->{'contacts'}->[0],
706
    ref $bookseller->{'contacts'}->[0],
711
    'C4::Bookseller::Contact',
707
    'C4::Bookseller::Contact',
Lines 720-746 $bookseller->{'name'} = 'your vendor'; Link Here
720
$bookseller->{'contacts'}->[0]->phone('654321');
716
$bookseller->{'contacts'}->[0]->phone('654321');
721
C4::Bookseller::ModBookseller($bookseller);
717
C4::Bookseller::ModBookseller($bookseller);
722
718
723
$bookseller = C4::Bookseller::GetBookSellerFromId($booksellerid);
719
$bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
720
$contacts = $bookseller->contacts;
724
is( $bookseller->{'name'}, 'your vendor',
721
is( $bookseller->{'name'}, 'your vendor',
725
    'Successfully changed name of vendor' );
722
    'Successfully changed name of vendor' );
726
is( $bookseller->{'contacts'}->[0]->phone,
723
is( $contacts->[0]->phone,
727
    '654321',
724
    '654321',
728
    'Successfully changed contact phone number by modifying bookseller hash' );
725
    'Successfully changed contact phone number by modifying bookseller hash' );
729
is( scalar @{ $bookseller->{'contacts'} },
726
is( scalar @$contacts,
730
    1, 'Only one contact after modification' );
727
    1, 'Only one contact after modification' );
731
728
732
C4::Bookseller::ModBookseller( $bookseller,
729
C4::Bookseller::ModBookseller( $bookseller,
733
    [ { name => 'John Jacob Jingleheimer Schmidt' } ] );
730
    [ { name => 'John Jacob Jingleheimer Schmidt' } ] );
734
731
735
$bookseller = C4::Bookseller::GetBookSellerFromId($booksellerid);
732
$bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
733
$contacts = $bookseller->contacts;
736
is(
734
is(
737
    $bookseller->{'contacts'}->[0]->name,
735
    $contacts->[0]->name,
738
    'John Jacob Jingleheimer Schmidt',
736
    'John Jacob Jingleheimer Schmidt',
739
    'Changed name of contact'
737
    'Changed name of contact'
740
);
738
);
741
is( $bookseller->{'contacts'}->[0]->phone,
739
is( $contacts->[0]->phone,
742
    undef, 'Removed phone number from contact' );
740
    undef, 'Removed phone number from contact' );
743
is( scalar @{ $bookseller->{'contacts'} },
741
is( scalar @$contacts,
744
    1, 'Only one contact after modification' );
742
    1, 'Only one contact after modification' );
745
743
746
#End transaction
744
#End transaction
(-)a/t/db_dependent/Letters.t (-4 / +4 lines)
Lines 44-49 use_ok('C4::Letters'); Link Here
44
use t::lib::Mocks;
44
use t::lib::Mocks;
45
use Koha::DateUtils qw( dt_from_string output_pref );
45
use Koha::DateUtils qw( dt_from_string output_pref );
46
use Koha::Acquisition::Order;
46
use Koha::Acquisition::Order;
47
use Koha::Acquisition::Bookseller;
47
48
48
my $dbh = C4::Context->dbh;
49
my $dbh = C4::Context->dbh;
49
50
Lines 326-335 warning_like { Link Here
326
    "SendAlerts prints a warning";
327
    "SendAlerts prints a warning";
327
is($err->{'error'}, 'no_email', "Trying to send an alert when there's no e-mail results in an error");
328
is($err->{'error'}, 'no_email', "Trying to send an alert when there's no e-mail results in an error");
328
329
329
my $bookseller = C4::Bookseller::GetBookSellerFromId($booksellerid);
330
my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
330
$bookseller->{'contacts'}->[0]->email('testemail@mydomain.com');
331
$bookseller->contacts->[0]->email('testemail@mydomain.com');
331
C4::Bookseller::ModBookseller($bookseller);
332
C4::Bookseller::ModBookseller($bookseller);
332
$bookseller = C4::Bookseller::GetBookSellerFromId($booksellerid);
333
$bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
333
334
334
warning_is {
335
warning_is {
335
    $err = SendAlerts( 'claimacquisition', [ $ordernumber ], 'TESTACQCLAIM' ) }
336
    $err = SendAlerts( 'claimacquisition', [ $ordernumber ], 'TESTACQCLAIM' ) }
336
- 

Return to bug 12896