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

(-)a/C4/Serials.pm (-41 / +61 lines)
Lines 134-150 sub GetSuppliersWithLateIssues { Link Here
134
    my $dbh   = C4::Context->dbh;
134
    my $dbh   = C4::Context->dbh;
135
    my $statuses = join(',', ( LATE, MISSING_STATUSES, CLAIMED ) );
135
    my $statuses = join(',', ( LATE, MISSING_STATUSES, CLAIMED ) );
136
    my $query = qq|
136
    my $query = qq|
137
    SELECT DISTINCT id, name
137
        SELECT DISTINCT aqbooksellers.id, aqbooksellers.name
138
    FROM            subscription
138
        FROM aqbooksellers
139
    LEFT JOIN       serial ON serial.subscriptionid=subscription.subscriptionid
139
        LEFT JOIN serial ON serial.aqbooksellerid = aqbooksellers.id
140
    LEFT JOIN aqbooksellers ON subscription.aqbooksellerid = aqbooksellers.id
140
        LEFT JOIN subscription ON serial.subscriptionid = subscription.subscriptionid
141
    WHERE id > 0
141
        WHERE (
142
        AND (
142
                (serial.planneddate < NOW() AND serial.status = 1)
143
            (planneddate < now() AND serial.status=1)
143
                OR serial.status IN ( $statuses )
144
            OR serial.STATUS IN ( $statuses )
144
            )
145
        )
145
            AND subscription.closed = 0
146
        AND subscription.closed = 0
146
        ORDER BY name
147
    ORDER BY name|;
147
    |;
148
    return $dbh->selectall_arrayref($query, { Slice => {} });
148
    return $dbh->selectall_arrayref($query, { Slice => {} });
149
}
149
}
150
150
Lines 1321-1326 sub ModSubscription { Link Here
1321
    $itemtype, $previousitemtype, $mana_id
1321
    $itemtype, $previousitemtype, $mana_id
1322
    ) = @_;
1322
    ) = @_;
1323
1323
1324
    $aqbooksellerid ||= undef;
1325
1324
    my $subscription = Koha::Subscriptions->find($subscriptionid);
1326
    my $subscription = Koha::Subscriptions->find($subscriptionid);
1325
    $subscription->set(
1327
    $subscription->set(
1326
        {
1328
        {
Lines 1402-1407 sub NewSubscription { Link Here
1402
    ) = @_;
1404
    ) = @_;
1403
    my $dbh = C4::Context->dbh;
1405
    my $dbh = C4::Context->dbh;
1404
1406
1407
    $aqbooksellerid ||= undef;
1408
1405
    my $subscription = Koha::Subscription->new(
1409
    my $subscription = Koha::Subscription->new(
1406
        {
1410
        {
1407
            librarian         => $auser,
1411
            librarian         => $auser,
Lines 1480-1485 sub NewSubscription { Link Here
1480
            serialseq_y    => $subscription->{'lastvalue2'},
1484
            serialseq_y    => $subscription->{'lastvalue2'},
1481
            serialseq_z    => $subscription->{'lastvalue3'},
1485
            serialseq_z    => $subscription->{'lastvalue3'},
1482
            subscriptionid => $subscriptionid,
1486
            subscriptionid => $subscriptionid,
1487
            aqbooksellerid => $subscription->{aqbooksellerid},
1483
            biblionumber   => $biblionumber,
1488
            biblionumber   => $biblionumber,
1484
            status         => EXPECTED,
1489
            status         => EXPECTED,
1485
            planneddate    => $firstacquidate,
1490
            planneddate    => $firstacquidate,
Lines 1623-1628 sub NewIssue { Link Here
1623
            serialseq_y       => $subscription->lastvalue2(),
1628
            serialseq_y       => $subscription->lastvalue2(),
1624
            serialseq_z       => $subscription->lastvalue3(),
1629
            serialseq_z       => $subscription->lastvalue3(),
1625
            subscriptionid    => $subscriptionid,
1630
            subscriptionid    => $subscriptionid,
1631
            aqbooksellerid    => $subscription->aqbooksellerid(),
1626
            biblionumber      => $biblionumber,
1632
            biblionumber      => $biblionumber,
1627
            status            => $status,
1633
            status            => $status,
1628
            planneddate       => $planneddate,
1634
            planneddate       => $planneddate,
Lines 1848-1854 sub GetLateOrMissingIssues { Link Here
1848
    my $sth;
1854
    my $sth;
1849
    my $byserial = '';
1855
    my $byserial = '';
1850
    if ($serialid) {
1856
    if ($serialid) {
1851
        $byserial = "and serialid = " . $serialid;
1857
        $byserial = "and s.serialid = " . $serialid;
1852
    }
1858
    }
1853
    if ($order) {
1859
    if ($order) {
1854
        $order .= ", title";
1860
        $order .= ", title";
Lines 1857-1895 sub GetLateOrMissingIssues { Link Here
1857
    }
1863
    }
1858
    my $missing_statuses_string = join ',', (MISSING_STATUSES);
1864
    my $missing_statuses_string = join ',', (MISSING_STATUSES);
1859
    if ($supplierid) {
1865
    if ($supplierid) {
1860
        $sth = $dbh->prepare(
1866
        $sth = $dbh->prepare(qq{
1861
            "SELECT
1867
            SELECT
1862
                serialid,      aqbooksellerid,        name,
1868
                s.serialid, s.aqbooksellerid, aqbooksellers.name,
1863
                biblio.title,  biblioitems.issn,      planneddate,    serialseq,
1869
                biblio.title, biblioitems.issn, s.planneddate, s.serialseq,
1864
                serial.status, serial.subscriptionid, claimdate, claims_count,
1870
                s.status, s.subscriptionid, s.claimdate, s.claims_count,
1865
                subscription.branchcode
1871
                subscription.branchcode
1866
            FROM      serial
1872
            FROM serial s
1867
                LEFT JOIN subscription  ON serial.subscriptionid=subscription.subscriptionid
1873
                LEFT JOIN subscription  ON s.subscriptionid = subscription.subscriptionid
1868
                LEFT JOIN biblio        ON subscription.biblionumber=biblio.biblionumber
1874
                LEFT JOIN biblio        ON subscription.biblionumber = biblio.biblionumber
1869
                LEFT JOIN biblioitems   ON subscription.biblionumber=biblioitems.biblionumber
1875
                LEFT JOIN biblioitems   ON subscription.biblionumber = biblioitems.biblionumber
1870
                LEFT JOIN aqbooksellers ON subscription.aqbooksellerid = aqbooksellers.id
1876
                LEFT JOIN aqbooksellers ON s.aqbooksellerid = aqbooksellers.id
1871
                WHERE subscription.subscriptionid = serial.subscriptionid
1877
                WHERE
1872
                AND (serial.STATUS IN ($missing_statuses_string) OR ((planneddate < now() AND serial.STATUS = ?) OR serial.STATUS = ? OR serial.STATUS = ?))
1878
                    (
1873
                AND subscription.aqbooksellerid=$supplierid
1879
                        s.status IN ($missing_statuses_string)
1874
                $byserial
1880
                        OR (
1875
                ORDER BY $order"
1881
                            (s.planneddate < NOW() AND s.status = ?)
1876
        );
1882
                            OR s.status = ?
1883
                            OR s.status = ?
1884
                        )
1885
                    )
1886
                    AND s.aqbooksellerid = $supplierid
1887
                    $byserial
1888
                ORDER BY $order
1889
        });
1877
    } else {
1890
    } else {
1878
        $sth = $dbh->prepare(
1891
        $sth = $dbh->prepare(qq{
1879
            "SELECT
1892
            SELECT
1880
            serialid,      aqbooksellerid,         name,
1893
                s.serialid, s.aqbooksellerid, aqbooksellers.name,
1881
            biblio.title,  planneddate,           serialseq,
1894
                biblio.title, s.planneddate, s.serialseq,
1882
                serial.status, serial.subscriptionid, claimdate, claims_count,
1895
                s.status, s.subscriptionid, s.claimdate, s.claims_count,
1883
                subscription.branchcode
1896
                subscription.branchcode
1884
            FROM serial
1897
            FROM serial s
1885
                LEFT JOIN subscription ON serial.subscriptionid=subscription.subscriptionid
1898
                LEFT JOIN subscription ON s.subscriptionid = subscription.subscriptionid
1886
                LEFT JOIN biblio ON subscription.biblionumber=biblio.biblionumber
1899
                LEFT JOIN biblio ON subscription.biblionumber = biblio.biblionumber
1887
                LEFT JOIN aqbooksellers ON subscription.aqbooksellerid = aqbooksellers.id
1900
                LEFT JOIN aqbooksellers ON s.aqbooksellerid = aqbooksellers.id
1888
                WHERE subscription.subscriptionid = serial.subscriptionid
1901
            WHERE
1889
                        AND (serial.STATUS IN ($missing_statuses_string) OR ((planneddate < now() AND serial.STATUS = ?) OR serial.STATUS = ? OR serial.STATUS = ?))
1902
                (
1903
                    s.status IN ($missing_statuses_string)
1904
                    OR (
1905
                        (s.planneddate < now() AND s.status = ?)
1906
                        OR s.status = ?
1907
                        OR s.status = ?
1908
                    )
1909
                )
1890
                $byserial
1910
                $byserial
1891
                ORDER BY $order"
1911
            ORDER BY $order
1892
        );
1912
        });
1893
    }
1913
    }
1894
    $sth->execute( EXPECTED, LATE, CLAIMED );
1914
    $sth->execute( EXPECTED, LATE, CLAIMED );
1895
    my @issuelist;
1915
    my @issuelist;
(-)a/Koha/Schema/Result/AccountOffset.pm (-6 / +4 lines)
Lines 51-59 The id of the accountline that decreased the patron's balance Link Here
51
51
52
  data_type: 'enum'
52
  data_type: 'enum'
53
  extra: {list => ["CREATE","APPLY","VOID","OVERDUE_INCREASE","OVERDUE_DECREASE"]}
53
  extra: {list => ["CREATE","APPLY","VOID","OVERDUE_INCREASE","OVERDUE_DECREASE"]}
54
  is_nullable: 0
54
  is_nullable: 1
55
56
The type of offset this is
57
55
58
=head2 amount
56
=head2 amount
59
57
Lines 91-97 __PACKAGE__->add_columns( Link Here
91
        "OVERDUE_DECREASE",
89
        "OVERDUE_DECREASE",
92
      ],
90
      ],
93
    },
91
    },
94
    is_nullable => 0,
92
    is_nullable => 1,
95
  },
93
  },
96
  "amount",
94
  "amount",
97
  { data_type => "decimal", is_nullable => 0, size => [26, 6] },
95
  { data_type => "decimal", is_nullable => 0, size => [26, 6] },
Lines 159-166 __PACKAGE__->belongs_to( Link Here
159
);
157
);
160
158
161
159
162
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-06-21 15:27:32
160
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-09-17 09:22:32
163
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zCeE/SWvdz898zlfcvfRGg
161
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vXNylpNHjCFtzZTeRy6MfA
164
162
165
sub koha_object_class {
163
sub koha_object_class {
166
    'Koha::Account::Offset';
164
    'Koha::Account::Offset';
(-)a/Koha/Schema/Result/AdditionalContent.pm (-14 / +14 lines)
Lines 30-36 __PACKAGE__->table("additional_contents"); Link Here
30
  is_auto_increment: 1
30
  is_auto_increment: 1
31
  is_nullable: 0
31
  is_nullable: 0
32
32
33
unique identifier for the additional content
33
unique identifier for the news article
34
34
35
=head2 category
35
=head2 category
36
36
Lines 44-50 category for the additional content Link Here
44
44
45
  data_type: 'varchar'
45
  data_type: 'varchar'
46
  is_nullable: 0
46
  is_nullable: 0
47
  size: 20
47
  size: 100
48
48
49
code to group content per lang
49
code to group content per lang
50
50
Lines 63-69 location of the additional content Link Here
63
  is_nullable: 1
63
  is_nullable: 1
64
  size: 10
64
  size: 10
65
65
66
branch code users to create branch specific additional content, NULL is every branch.
66
branch code users to create branch specific news, NULL is every branch.
67
67
68
=head2 title
68
=head2 title
69
69
Lines 72-94 branch code users to create branch specific additional content, NULL is every br Link Here
72
  is_nullable: 0
72
  is_nullable: 0
73
  size: 250
73
  size: 250
74
74
75
title of the additional content
75
title of the news article
76
76
77
=head2 content
77
=head2 content
78
78
79
  data_type: 'mediumtext'
79
  data_type: 'mediumtext'
80
  is_nullable: 0
80
  is_nullable: 0
81
81
82
the body of your additional content
82
the body of your news article
83
83
84
=head2 lang
84
=head2 lang
85
85
86
  data_type: 'varchar'
86
  data_type: 'varchar'
87
  default_value: (empty string)
87
  default_value: (empty string)
88
  is_nullable: 0
88
  is_nullable: 0
89
  size: 25
89
  size: 50
90
90
91
location for the additional content(koha is the staff interface, slip is the circulation receipt and language codes are for the opac)
91
location for the article (koha is the staff interface, slip is the circulation receipt and language codes are for the opac)
92
92
93
=head2 published_on
93
=head2 published_on
94
94
Lines 113-126 last modification Link Here
113
  datetime_undef_if_invalid: 1
113
  datetime_undef_if_invalid: 1
114
  is_nullable: 1
114
  is_nullable: 1
115
115
116
date the additional content is set to expire or no longer be visible
116
date the article is set to expire or no longer be visible
117
117
118
=head2 number
118
=head2 number
119
119
120
  data_type: 'integer'
120
  data_type: 'integer'
121
  is_nullable: 1
121
  is_nullable: 1
122
122
123
the order in which this additional content appears in that specific location
123
the order in which this article appears in that specific location
124
124
125
=head2 borrowernumber
125
=head2 borrowernumber
126
126
Lines 128-134 the order in which this additional content appears in that specific location Link Here
128
  is_foreign_key: 1
128
  is_foreign_key: 1
129
  is_nullable: 1
129
  is_nullable: 1
130
130
131
The user who created the additional content
131
The user who created the news article
132
132
133
=cut
133
=cut
134
134
Lines 143-149 __PACKAGE__->add_columns( Link Here
143
  "category",
143
  "category",
144
  { data_type => "varchar", is_nullable => 0, size => 20 },
144
  { data_type => "varchar", is_nullable => 0, size => 20 },
145
  "code",
145
  "code",
146
  { data_type => "varchar", is_nullable => 0, size => 20 },
146
  { data_type => "varchar", is_nullable => 0, size => 100 },
147
  "location",
147
  "location",
148
  { data_type => "varchar", is_nullable => 0, size => 255 },
148
  { data_type => "varchar", is_nullable => 0, size => 255 },
149
  "branchcode",
149
  "branchcode",
Lines 153-159 __PACKAGE__->add_columns( Link Here
153
  "content",
153
  "content",
154
  { data_type => "mediumtext", is_nullable => 0 },
154
  { data_type => "mediumtext", is_nullable => 0 },
155
  "lang",
155
  "lang",
156
  { data_type => "varchar", default_value => "", is_nullable => 0, size => 25 },
156
  { data_type => "varchar", default_value => "", is_nullable => 0, size => 50 },
157
  "published_on",
157
  "published_on",
158
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
158
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
159
  "updated_on",
159
  "updated_on",
Lines 249-256 __PACKAGE__->belongs_to( Link Here
249
);
249
);
250
250
251
251
252
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-07-16 07:12:03
252
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-09-17 09:22:32
253
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0HtqQpArwFtGrsivukyG1Q
253
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qJR5e6KEWvkVqH0SQjXFGw
254
254
255
255
256
# You can replace this text with custom code or comments, and it will be preserved on regeneration
256
# You can replace this text with custom code or comments, and it will be preserved on regeneration
(-)a/Koha/Schema/Result/Aqbookseller.pm (-2 / +32 lines)
Lines 371-376 __PACKAGE__->belongs_to( Link Here
371
  },
371
  },
372
);
372
);
373
373
374
=head2 serials
375
376
Type: has_many
377
378
Related object: L<Koha::Schema::Result::Serial>
379
380
=cut
381
382
__PACKAGE__->has_many(
383
  "serials",
384
  "Koha::Schema::Result::Serial",
385
  { "foreign.aqbooksellerid" => "self.id" },
386
  { cascade_copy => 0, cascade_delete => 0 },
387
);
388
389
=head2 subscriptions
390
391
Type: has_many
392
393
Related object: L<Koha::Schema::Result::Subscription>
394
395
=cut
396
397
__PACKAGE__->has_many(
398
  "subscriptions",
399
  "Koha::Schema::Result::Subscription",
400
  { "foreign.aqbooksellerid" => "self.id" },
401
  { cascade_copy => 0, cascade_delete => 0 },
402
);
403
374
=head2 vendor_edi_accounts
404
=head2 vendor_edi_accounts
375
405
376
Type: has_many
406
Type: has_many
Lines 387-394 __PACKAGE__->has_many( Link Here
387
);
417
);
388
418
389
419
390
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29
420
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-09-17 09:22:32
391
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qu4OqSCsEKEeJD9VtOEd4g
421
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:iFntfA33lumUkMYAVyzfeA
392
422
393
__PACKAGE__->add_columns(
423
__PACKAGE__->add_columns(
394
    '+active' => { is_boolean => 1 },
424
    '+active' => { is_boolean => 1 },
(-)a/Koha/Schema/Result/Borrower.pm (-6 / +2 lines)
Lines 368-375 a note on the patron/borrower's account that is only visible in the staff interf Link Here
368
  is_nullable: 1
368
  is_nullable: 1
369
  size: 100
369
  size: 100
370
370
371
used for children to include the relationship to their guarantor
372
373
=head2 sex
371
=head2 sex
374
372
375
  data_type: 'varchar'
373
  data_type: 'varchar'
Lines 607-614 flag for allowing auto-renewal Link Here
607
  is_nullable: 1
605
  is_nullable: 1
608
  size: 45
606
  size: 45
609
607
610
useful for reporting purposes
611
612
=cut
608
=cut
613
609
614
__PACKAGE__->add_columns(
610
__PACKAGE__->add_columns(
Lines 1890-1897 Composing rels: L</aqorder_users> -> ordernumber Link Here
1890
__PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber");
1886
__PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber");
1891
1887
1892
1888
1893
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-27 08:42:21
1889
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-09-17 09:22:32
1894
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:AyU2Z+V4O3ZWV8VhYqXyVg
1890
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:EPudzl0z7jcJNjMV5QIeFw
1895
1891
1896
__PACKAGE__->add_columns(
1892
__PACKAGE__->add_columns(
1897
    '+anonymized'    => { is_boolean => 1 },
1893
    '+anonymized'    => { is_boolean => 1 },
(-)a/Koha/Schema/Result/BorrowerModification.pm (-4 / +2 lines)
Lines 429-436 data processing consent Link Here
429
  is_nullable: 1
429
  is_nullable: 1
430
  size: 45
430
  size: 45
431
431
432
useful for reporting purposes
433
434
=cut
432
=cut
435
433
436
__PACKAGE__->add_columns(
434
__PACKAGE__->add_columns(
Lines 622-629 __PACKAGE__->add_columns( Link Here
622
__PACKAGE__->set_primary_key("verification_token", "borrowernumber");
620
__PACKAGE__->set_primary_key("verification_token", "borrowernumber");
623
621
624
622
625
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-07-12 13:40:00
623
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-09-17 09:22:32
626
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:6giYT5URks8+6VnAs/rtkg
624
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2qg6+X6LGQYIhmdI6W8Qqg
627
625
628
sub koha_object_class {
626
sub koha_object_class {
629
    'Koha::Patron::Modification';
627
    'Koha::Patron::Modification';
(-)a/Koha/Schema/Result/Branchtransfer.pm (-14 / +12 lines)
Lines 100-120 the branch the transfer was going to Link Here
100
100
101
any comments related to the transfer
101
any comments related to the transfer
102
102
103
=head2 reason
103
=head2 cancellation_reason
104
104
105
  data_type: 'enum'
105
  data_type: 'enum'
106
  extra: {list => ["Manual","StockrotationAdvance","StockrotationRepatriation","ReturnToHome","ReturnToHolding","RotatingCollection","Reserve","LostReserve","CancelReserve","TransferCancellation"]}
106
  extra: {list => ["Manual","StockrotationAdvance","StockrotationRepatriation","ReturnToHome","ReturnToHolding","RotatingCollection","Reserve","LostReserve","CancelReserve","ItemLost","WrongTransfer"]}
107
  is_nullable: 1
107
  is_nullable: 1
108
108
109
what triggered the transfer
109
=head2 reason
110
111
=head2 cancellation_reason
112
110
113
  data_type: 'enum'
111
  data_type: 'enum'
114
  extra: {list => ["Manual","StockrotationAdvance","StockrotationRepatriation","ReturnToHome","ReturnToHolding","RotatingCollection","Reserve","LostReserve","CancelReserve","ItemLost","WrongTransfer"]}
112
  extra: {list => ["Manual","StockrotationAdvance","StockrotationRepatriation","ReturnToHome","ReturnToHolding","RotatingCollection","Reserve","LostReserve","CancelReserve","TransferCancellation"]}
115
  is_nullable: 1
113
  is_nullable: 1
116
114
117
what triggered the transfer cancellation
115
what triggered the transfer
118
116
119
=cut
117
=cut
120
118
Lines 171-177 __PACKAGE__->add_columns( Link Here
171
  },
169
  },
172
  "comments",
170
  "comments",
173
  { data_type => "longtext", is_nullable => 1 },
171
  { data_type => "longtext", is_nullable => 1 },
174
  "reason",
172
  "cancellation_reason",
175
  {
173
  {
176
    data_type => "enum",
174
    data_type => "enum",
177
    extra => {
175
    extra => {
Lines 185-196 __PACKAGE__->add_columns( Link Here
185
        "Reserve",
183
        "Reserve",
186
        "LostReserve",
184
        "LostReserve",
187
        "CancelReserve",
185
        "CancelReserve",
188
        "TransferCancellation",
186
        "ItemLost",
187
        "WrongTransfer",
189
      ],
188
      ],
190
    },
189
    },
191
    is_nullable => 1,
190
    is_nullable => 1,
192
  },
191
  },
193
  "cancellation_reason",
192
  "reason",
194
  {
193
  {
195
    data_type => "enum",
194
    data_type => "enum",
196
    extra => {
195
    extra => {
Lines 204-211 __PACKAGE__->add_columns( Link Here
204
        "Reserve",
203
        "Reserve",
205
        "LostReserve",
204
        "LostReserve",
206
        "CancelReserve",
205
        "CancelReserve",
207
        "ItemLost",
206
        "TransferCancellation",
208
        "WrongTransfer",
209
      ],
207
      ],
210
    },
208
    },
211
    is_nullable => 1,
209
    is_nullable => 1,
Lines 272-279 __PACKAGE__->belongs_to( Link Here
272
);
270
);
273
271
274
272
275
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-06-08 08:13:08
273
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-09-17 09:22:32
276
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+ABUZOo6IHbiRH1LTy3t+A
274
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:eatBBQVEi1TjvAWr99KMqg
277
275
278
sub koha_object_class {
276
sub koha_object_class {
279
    'Koha::Item::Transfer';
277
    'Koha::Item::Transfer';
(-)a/Koha/Schema/Result/CourseItem.pm (-6 / +2 lines)
Lines 37-52 course item id Link Here
37
  is_foreign_key: 1
37
  is_foreign_key: 1
38
  is_nullable: 1
38
  is_nullable: 1
39
39
40
items.itemnumber for the item on reserve
41
42
=head2 biblionumber
40
=head2 biblionumber
43
41
44
  data_type: 'integer'
42
  data_type: 'integer'
45
  is_foreign_key: 1
43
  is_foreign_key: 1
46
  is_nullable: 0
44
  is_nullable: 0
47
45
48
biblio.biblionumber for the bibliographic record on reserve
49
50
=head2 itype
46
=head2 itype
51
47
52
  data_type: 'varchar'
48
  data_type: 'varchar'
Lines 380-387 __PACKAGE__->belongs_to( Link Here
380
);
376
);
381
377
382
378
383
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2021-06-11 18:35:38
379
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-09-17 09:22:32
384
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:3fFJ3uJr+5pMZniZ1glIpg
380
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:p8jX7J6nuARFwQkmWk98ZA
385
381
386
__PACKAGE__->add_columns(
382
__PACKAGE__->add_columns(
387
    '+itype_enabled'         => { is_boolean => 1 },
383
    '+itype_enabled'         => { is_boolean => 1 },
(-)a/Koha/Schema/Result/Deletedborrower.pm (-4 / +2 lines)
Lines 604-611 flag for allowing auto-renewal Link Here
604
  is_nullable: 1
604
  is_nullable: 1
605
  size: 45
605
  size: 45
606
606
607
useful for reporting purposes
608
609
=cut
607
=cut
610
608
611
__PACKAGE__->add_columns(
609
__PACKAGE__->add_columns(
Lines 785-792 __PACKAGE__->add_columns( Link Here
785
);
783
);
786
784
787
785
788
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-07-12 13:40:00
786
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-09-17 09:22:32
789
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9q8LmKrfO6bAAFaJ4Z3Jrg
787
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:kv30nVGZX7XzeqYuksBjMg
790
788
791
__PACKAGE__->add_columns(
789
__PACKAGE__->add_columns(
792
    '+anonymized'    => { is_boolean => 1 },
790
    '+anonymized'    => { is_boolean => 1 },
(-)a/Koha/Schema/Result/LanguageDescription.pm (-2 / +20 lines)
Lines 80-88 __PACKAGE__->add_columns( Link Here
80
80
81
__PACKAGE__->set_primary_key("id");
81
__PACKAGE__->set_primary_key("id");
82
82
83
=head1 UNIQUE CONSTRAINTS
83
84
84
# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21
85
=head2 C<uniq_desc>
85
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:fQEN7ks3f7aLuoDQWqEv+Q
86
87
=over 4
88
89
=item * L</subtag>
90
91
=item * L</type>
92
93
=item * L</lang>
94
95
=back
96
97
=cut
98
99
__PACKAGE__->add_unique_constraint("uniq_desc", ["subtag", "type", "lang"]);
100
101
102
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-09-17 09:22:32
103
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qe9j3WniHRYQr02i8mbf3Q
86
104
87
105
88
# You can replace this text with custom content, and it will be preserved on regeneration
106
# You can replace this text with custom content, and it will be preserved on regeneration
(-)a/Koha/Schema/Result/LanguageRfc4646ToIso639.pm (-2 / +18 lines)
Lines 64-72 __PACKAGE__->add_columns( Link Here
64
64
65
__PACKAGE__->set_primary_key("id");
65
__PACKAGE__->set_primary_key("id");
66
66
67
=head1 UNIQUE CONSTRAINTS
67
68
68
# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21
69
=head2 C<uniq_code>
69
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:80baGnx1j4ZZjs0Qn5VMsw
70
71
=over 4
72
73
=item * L</rfc4646_subtag>
74
75
=item * L</iso639_2_code>
76
77
=back
78
79
=cut
80
81
__PACKAGE__->add_unique_constraint("uniq_code", ["rfc4646_subtag", "iso639_2_code"]);
82
83
84
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-09-17 09:22:32
85
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zPavbX28u/JWNjA/DRo/Xg
70
86
71
87
72
# You can replace this text with custom content, and it will be preserved on regeneration
88
# You can replace this text with custom content, and it will be preserved on regeneration
(-)a/Koha/Schema/Result/LanguageSubtagRegistry.pm (-2 / +18 lines)
Lines 84-92 __PACKAGE__->add_columns( Link Here
84
84
85
__PACKAGE__->set_primary_key("id");
85
__PACKAGE__->set_primary_key("id");
86
86
87
=head1 UNIQUE CONSTRAINTS
87
88
88
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29
89
=head2 C<uniq_lang>
89
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:M4QL1kgte1o/Wz+XjSduWA
90
91
=over 4
92
93
=item * L</subtag>
94
95
=item * L</type>
96
97
=back
98
99
=cut
100
101
__PACKAGE__->add_unique_constraint("uniq_lang", ["subtag", "type"]);
102
103
104
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-09-17 09:22:32
105
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:JxOAlQQ/DwMZPBuFa0QOLQ
90
106
91
107
92
# You can replace this text with custom content, and it will be preserved on regeneration
108
# You can replace this text with custom content, and it will be preserved on regeneration
(-)a/Koha/Schema/Result/Serial.pm (-2 / +30 lines)
Lines 47-52 foreign key for the biblio.biblionumber that this issue is attached to Link Here
47
47
48
foreign key to the subscription.subscriptionid that this issue is part of
48
foreign key to the subscription.subscriptionid that this issue is part of
49
49
50
=head2 aqbooksellerid
51
52
  data_type: 'integer'
53
  is_foreign_key: 1
54
  is_nullable: 1
55
50
=head2 serialseq
56
=head2 serialseq
51
57
52
  data_type: 'varchar'
58
  data_type: 'varchar'
Lines 151-156 __PACKAGE__->add_columns( Link Here
151
  { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
157
  { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
152
  "subscriptionid",
158
  "subscriptionid",
153
  { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
159
  { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
160
  "aqbooksellerid",
161
  { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
154
  "serialseq",
162
  "serialseq",
155
  { data_type => "varchar", default_value => "", is_nullable => 0, size => 100 },
163
  { data_type => "varchar", default_value => "", is_nullable => 0, size => 100 },
156
  "serialseq_x",
164
  "serialseq_x",
Lines 191-196 __PACKAGE__->set_primary_key("serialid"); Link Here
191
199
192
=head1 RELATIONS
200
=head1 RELATIONS
193
201
202
=head2 aqbooksellerid
203
204
Type: belongs_to
205
206
Related object: L<Koha::Schema::Result::Aqbookseller>
207
208
=cut
209
210
__PACKAGE__->belongs_to(
211
  "aqbooksellerid",
212
  "Koha::Schema::Result::Aqbookseller",
213
  { id => "aqbooksellerid" },
214
  {
215
    is_deferrable => 1,
216
    join_type     => "LEFT",
217
    on_delete     => "RESTRICT",
218
    on_update     => "RESTRICT",
219
  },
220
);
221
194
=head2 biblionumber
222
=head2 biblionumber
195
223
196
Type: belongs_to
224
Type: belongs_to
Lines 237-244 __PACKAGE__->belongs_to( Link Here
237
);
265
);
238
266
239
267
240
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29
268
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-09-17 09:22:32
241
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SD7llCvCO+/67cXetzRKPQ
269
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ysyfk1S/EaT8Msd5m1yVKg
242
270
243
271
244
# You can replace this text with custom code or comments, and it will be preserved on regeneration
272
# You can replace this text with custom code or comments, and it will be preserved on regeneration
(-)a/Koha/Schema/Result/Subscription.pm (-6 / +24 lines)
Lines 59-69 start date for this subscription Link Here
59
=head2 aqbooksellerid
59
=head2 aqbooksellerid
60
60
61
  data_type: 'integer'
61
  data_type: 'integer'
62
  default_value: 0
62
  is_foreign_key: 1
63
  is_nullable: 1
63
  is_nullable: 1
64
64
65
foreign key for aqbooksellers.id to link to the vendor
66
67
=head2 cost
65
=head2 cost
68
66
69
  data_type: 'integer'
67
  data_type: 'integer'
Lines 340-346 __PACKAGE__->add_columns( Link Here
340
  "startdate",
338
  "startdate",
341
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
339
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
342
  "aqbooksellerid",
340
  "aqbooksellerid",
343
  { data_type => "integer", default_value => 0, is_nullable => 1 },
341
  { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
344
  "cost",
342
  "cost",
345
  { data_type => "integer", default_value => 0, is_nullable => 1 },
343
  { data_type => "integer", default_value => 0, is_nullable => 1 },
346
  "aqbudgetid",
344
  "aqbudgetid",
Lines 433-438 __PACKAGE__->set_primary_key("subscriptionid"); Link Here
433
431
434
=head1 RELATIONS
432
=head1 RELATIONS
435
433
434
=head2 aqbooksellerid
435
436
Type: belongs_to
437
438
Related object: L<Koha::Schema::Result::Aqbookseller>
439
440
=cut
441
442
__PACKAGE__->belongs_to(
443
  "aqbooksellerid",
444
  "Koha::Schema::Result::Aqbookseller",
445
  { id => "aqbooksellerid" },
446
  {
447
    is_deferrable => 1,
448
    join_type     => "LEFT",
449
    on_delete     => "RESTRICT",
450
    on_update     => "CASCADE",
451
  },
452
);
453
436
=head2 aqorders
454
=head2 aqorders
437
455
438
Type: has_many
456
Type: has_many
Lines 549-556 __PACKAGE__->has_many( Link Here
549
);
567
);
550
568
551
569
552
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29
570
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-09-17 09:22:32
553
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:RA/Z4pcP53tB0kXgo0W6fQ
571
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:C71M+F/3HWXquMi0Eon/qw
554
572
555
__PACKAGE__->has_many(
573
__PACKAGE__->has_many(
556
  "additional_field_values",
574
  "additional_field_values",
(-)a/installer/data/mysql/atomicupdate/bug_18745.perl (+29 lines)
Line 0 Link Here
1
$DBversion = 'XXX';
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do(q{
4
       UPDATE subscription
5
       SET aqbooksellerid = NULL
6
       WHERE aqbooksellerid = 0
7
    });
8
    $dbh->do(q{
9
        ALTER TABLE subscription
10
        MODIFY COLUMN aqbooksellerid int(11) NULL DEFAULT NULL,
11
        ADD CONSTRAINT subscription_ibfk_aqbooksellerid FOREIGN KEY (aqbooksellerid) REFERENCES aqbooksellers (id) ON DELETE RESTRICT ON UPDATE CASCADE
12
    });
13
14
    if (!column_exists('serial', 'aqbooksellerid')) {
15
        $dbh->do(q{
16
            ALTER TABLE `serial`
17
            ADD COLUMN `aqbooksellerid` int(11) NULL DEFAULT NULL AFTER `subscriptionid`,
18
            ADD CONSTRAINT `serial_aqbooksellerid_fk` FOREIGN KEY (`aqbooksellerid`) REFERENCES `aqbooksellers` (`id`)
19
        });
20
        $dbh->do(q{
21
            UPDATE serial s
22
            JOIN subscription sub ON s.subscriptionid = sub.subscriptionid
23
            SET s.aqbooksellerid = sub.aqbooksellerid
24
        });
25
    }
26
27
    SetVersion( $DBversion );
28
    print "Upgrade to $DBversion done (Bug 18745 - Serial claims: save supplier info on serial-level)\n";
29
}
(-)a/installer/data/mysql/kohastructure.sql (-3 / +6 lines)
Lines 4537-4542 CREATE TABLE `serial` ( Link Here
4537
  `serialid` int(11) NOT NULL AUTO_INCREMENT COMMENT 'unique key for the issue',
4537
  `serialid` int(11) NOT NULL AUTO_INCREMENT COMMENT 'unique key for the issue',
4538
  `biblionumber` int(11) NOT NULL COMMENT 'foreign key for the biblio.biblionumber that this issue is attached to',
4538
  `biblionumber` int(11) NOT NULL COMMENT 'foreign key for the biblio.biblionumber that this issue is attached to',
4539
  `subscriptionid` int(11) NOT NULL COMMENT 'foreign key to the subscription.subscriptionid that this issue is part of',
4539
  `subscriptionid` int(11) NOT NULL COMMENT 'foreign key to the subscription.subscriptionid that this issue is part of',
4540
  `aqbooksellerid` int(11) NULL DEFAULT NULL COMMENT 'the subscription''s bookseller at the time of creation (used for claims)'
4540
  `serialseq` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'issue information (volume, number, etc)',
4541
  `serialseq` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'issue information (volume, number, etc)',
4541
  `serialseq_x` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'first part of issue information',
4542
  `serialseq_x` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'first part of issue information',
4542
  `serialseq_y` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'second part of issue information',
4543
  `serialseq_y` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'second part of issue information',
Lines 4553-4559 CREATE TABLE `serial` ( Link Here
4553
  KEY `serial_ibfk_1` (`biblionumber`),
4554
  KEY `serial_ibfk_1` (`biblionumber`),
4554
  KEY `serial_ibfk_2` (`subscriptionid`),
4555
  KEY `serial_ibfk_2` (`subscriptionid`),
4555
  CONSTRAINT `serial_ibfk_1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
4556
  CONSTRAINT `serial_ibfk_1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
4556
  CONSTRAINT `serial_ibfk_2` FOREIGN KEY (`subscriptionid`) REFERENCES `subscription` (`subscriptionid`) ON DELETE CASCADE ON UPDATE CASCADE
4557
  CONSTRAINT `serial_ibfk_2` FOREIGN KEY (`subscriptionid`) REFERENCES `subscription` (`subscriptionid`) ON DELETE CASCADE ON UPDATE CASCADE,
4558
  CONSTRAINT `serial_ibfk_3` FOREIGN KEY (`aqbooksellerid`) REFERENCES `aqbooksellers` (`id`)
4557
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4559
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4558
/*!40101 SET character_set_client = @saved_cs_client */;
4560
/*!40101 SET character_set_client = @saved_cs_client */;
4559
4561
Lines 4764-4770 CREATE TABLE `subscription` ( Link Here
4764
  `subscriptionid` int(11) NOT NULL AUTO_INCREMENT COMMENT 'unique key for this subscription',
4766
  `subscriptionid` int(11) NOT NULL AUTO_INCREMENT COMMENT 'unique key for this subscription',
4765
  `librarian` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT 'the librarian''s username from borrowers.userid',
4767
  `librarian` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT 'the librarian''s username from borrowers.userid',
4766
  `startdate` date DEFAULT NULL COMMENT 'start date for this subscription',
4768
  `startdate` date DEFAULT NULL COMMENT 'start date for this subscription',
4767
  `aqbooksellerid` int(11) DEFAULT 0 COMMENT 'foreign key for aqbooksellers.id to link to the vendor',
4769
  `aqbooksellerid` int(11) NULL DEFAULT NULL COMMENT 'foreign key for aqbooksellers.id to link to the vendor',
4768
  `cost` int(11) DEFAULT 0,
4770
  `cost` int(11) DEFAULT 0,
4769
  `aqbudgetid` int(11) DEFAULT 0,
4771
  `aqbudgetid` int(11) DEFAULT 0,
4770
  `weeklength` int(11) DEFAULT 0 COMMENT 'subscription length in weeks (will not be filled in if monthlength or numberlength is set)',
4772
  `weeklength` int(11) DEFAULT 0 COMMENT 'subscription length in weeks (will not be filled in if monthlength or numberlength is set)',
Lines 4809-4815 CREATE TABLE `subscription` ( Link Here
4809
  KEY `subscription_ibfk_3` (`biblionumber`),
4811
  KEY `subscription_ibfk_3` (`biblionumber`),
4810
  CONSTRAINT `subscription_ibfk_1` FOREIGN KEY (`periodicity`) REFERENCES `subscription_frequencies` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
4812
  CONSTRAINT `subscription_ibfk_1` FOREIGN KEY (`periodicity`) REFERENCES `subscription_frequencies` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
4811
  CONSTRAINT `subscription_ibfk_2` FOREIGN KEY (`numberpattern`) REFERENCES `subscription_numberpatterns` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
4813
  CONSTRAINT `subscription_ibfk_2` FOREIGN KEY (`numberpattern`) REFERENCES `subscription_numberpatterns` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
4812
  CONSTRAINT `subscription_ibfk_3` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
4814
  CONSTRAINT `subscription_ibfk_3` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
4815
  CONSTRAINT `subscription_ibfk_4` FOREIGN KEY (`aqbooksellerid`) REFERENCES `aqbooksellers` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE
4813
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4816
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4814
/*!40101 SET character_set_client = @saved_cs_client */;
4817
/*!40101 SET character_set_client = @saved_cs_client */;
4815
4818
(-)a/serials/subscription-add.pl (-2 / +2 lines)
Lines 296-302 sub redirect_add_subscription { Link Here
296
296
297
    my $auser          = $query->param('user');
297
    my $auser          = $query->param('user');
298
    my $branchcode     = $query->param('branchcode');
298
    my $branchcode     = $query->param('branchcode');
299
    my $aqbooksellerid = $query->param('aqbooksellerid');
299
    my $aqbooksellerid = $query->param('aqbooksellerid') || undef;
300
    my $cost           = $query->param('cost');
300
    my $cost           = $query->param('cost');
301
    my $aqbudgetid     = $query->param('aqbudgetid');
301
    my $aqbudgetid     = $query->param('aqbudgetid');
302
    my @irregularity   = $query->multi_param('irregularity');
302
    my @irregularity   = $query->multi_param('irregularity');
Lines 390-396 sub redirect_mod_subscription { Link Here
390
    my $librarian => scalar $query->param('librarian'),
390
    my $librarian => scalar $query->param('librarian'),
391
    my $branchcode = $query->param('branchcode');
391
    my $branchcode = $query->param('branchcode');
392
    my $cost = $query->param('cost');
392
    my $cost = $query->param('cost');
393
    my $aqbooksellerid = $query->param('aqbooksellerid');
393
    my $aqbooksellerid = $query->param('aqbooksellerid') || undef;
394
    my $biblionumber = $query->param('biblionumber');
394
    my $biblionumber = $query->param('biblionumber');
395
    my $aqbudgetid = $query->param('aqbudgetid');
395
    my $aqbudgetid = $query->param('aqbudgetid');
396
396
(-)a/t/db_dependent/Serials/Claims.t (-3 / +26 lines)
Lines 1-11 Link Here
1
use Modern::Perl;
1
use Modern::Perl;
2
use Test::More tests => 17;
2
use Test::More tests => 18;
3
3
4
use C4::Acquisition;
4
use C4::Acquisition;
5
use C4::Budgets qw( AddBudgetPeriod AddBudget );
5
use C4::Budgets qw( AddBudgetPeriod AddBudget );
6
use Koha::Database;
6
use Koha::Database;
7
use Koha::Acquisition::Booksellers;
7
use Koha::Acquisition::Booksellers;
8
use_ok('C4::Serials', qw( GetSuppliersWithLateIssues NewSubscription GetLateOrMissingIssues updateClaim ));
8
use_ok('C4::Serials', qw( GetSuppliersWithLateIssues NewSubscription GetLateOrMissingIssues updateClaim NewIssue ));
9
9
10
use Koha::DateUtils qw( dt_from_string output_pref );
10
use Koha::DateUtils qw( dt_from_string output_pref );
11
11
Lines 162-164 is( $serial_claimed->{claims_count}, 1, 'The serial should have been claimed' ); Link Here
162
my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
162
my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
163
# FIXME: This test should pass. The GetLateOrMissingIssues should not deal with date format!
163
# FIXME: This test should pass. The GetLateOrMissingIssues should not deal with date format!
164
#is( $serial_claimed->{claimdate}, $today, 'The serial should have been claimed today' );
164
#is( $serial_claimed->{claimdate}, $today, 'The serial should have been claimed today' );
165
- 
165
166
subtest "Claims when subscription's supplier has changed" => sub {
167
    plan tests => 2;
168
169
    my $bookseller1 = Koha::Acquisition::Bookseller->new({ name => 'Bookseller #1' })->store;
170
    my $bookseller2 = Koha::Acquisition::Bookseller->new({ name => 'Bookseller #2' })->store;
171
    my $subscriptionid = NewSubscription(
172
        undef, $branchcode, $bookseller1->id, undef, $budget_id, $biblionumber,
173
        '2013-01-01', undef, undef, undef,  undef,
174
        undef,      undef,  undef, undef, undef, undef,
175
        1,          "notes",undef, '2013-01-01', undef, undef,
176
        undef,       undef,  0,    "intnotes",  0,
177
        undef, undef, 0,          undef,         '2013-12-31', 0
178
    );
179
    NewIssue('2', $subscriptionid, $biblionumber, 3, '2013-01-02', '2013-01-02'); # 3 is late
180
    my $subscription = Koha::Subscriptions->find($subscriptionid);
181
    $subscription->aqbooksellerid($bookseller2->id)->store();
182
    NewIssue('3', $subscriptionid, $biblionumber, 3, '2013-01-03', '2013-01-03'); # 3 is late
183
184
    my @lateissues = GetLateOrMissingIssues($bookseller1->id);
185
    is(scalar @lateissues, 2, '2 late issues for bookseller1');
186
    @lateissues = GetLateOrMissingIssues($bookseller2->id);
187
    is(scalar @lateissues, 1, '1 late issue for bookseller2');
188
};

Return to bug 18745