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

(-)a/Koha/Schema/Result/Issuingrule.pm (-2 / +24 lines)
Lines 215-220 __PACKAGE__->table("issuingrules"); Link Here
215
  extra: {list => ["no","yes","bib_only","item_only"]}
215
  extra: {list => ["no","yes","bib_only","item_only"]}
216
  is_nullable: 0
216
  is_nullable: 0
217
217
218
=head2 recall_due_date_interval
219
220
  data_type: 'integer'
221
  is_nullable: 1
222
223
=head2 recall_overdue_fine
224
225
  data_type: 'decimal'
226
  is_nullable: 1
227
  size: [28,6]
228
229
=head2 recall_shelf_time
230
231
  data_type: 'integer'
232
  is_nullable: 1
233
218
=cut
234
=cut
219
235
220
__PACKAGE__->add_columns(
236
__PACKAGE__->add_columns(
Lines 294-299 __PACKAGE__->add_columns( Link Here
294
    extra => { list => ["no", "yes", "bib_only", "item_only"] },
310
    extra => { list => ["no", "yes", "bib_only", "item_only"] },
295
    is_nullable => 0,
311
    is_nullable => 0,
296
  },
312
  },
313
  "recall_due_date_interval",
314
  { data_type => "integer", is_nullable => 1 },
315
  "recall_overdue_fine",
316
  { data_type => "decimal", is_nullable => 1, size => [28, 6] },
317
  "recall_shelf_time",
318
  { data_type => "integer", is_nullable => 1 },
297
);
319
);
298
320
299
=head1 PRIMARY KEY
321
=head1 PRIMARY KEY
Lines 313-320 __PACKAGE__->add_columns( Link Here
313
__PACKAGE__->set_primary_key("branchcode", "categorycode", "itemtype");
335
__PACKAGE__->set_primary_key("branchcode", "categorycode", "itemtype");
314
336
315
337
316
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-04-27 19:15:48
338
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-10-27 03:00:06
317
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:D1443VWPcoIXN3+lIkckIQ
339
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1EXjmhkG47JNAOshMjdRqg
318
340
319
341
320
# You can replace this text with custom code or comments, and it will be preserved on regeneration
342
# You can replace this text with custom code or comments, and it will be preserved on regeneration
(-)a/admin/smart-rules.pl (-1 / +7 lines)
Lines 152-158 elsif ($op eq 'add') { Link Here
152
    $issuelength = $issuelength eq q{} ? undef : $issuelength;
152
    $issuelength = $issuelength eq q{} ? undef : $issuelength;
153
    my $lengthunit  = $input->param('lengthunit');
153
    my $lengthunit  = $input->param('lengthunit');
154
    my $hardduedate = $input->param('hardduedate') || undef;
154
    my $hardduedate = $input->param('hardduedate') || undef;
155
    $hardduedate = eval { dt_from_string( $input->param('hardduedate') ) } if ( $hardduedate );
155
    $hardduedate = eval { dt_from_string( scalar $input->param('hardduedate') ) } if ( $hardduedate );
156
    $hardduedate = output_pref( { dt => $hardduedate, dateonly => 1, dateformat => 'iso' } ) if ( $hardduedate );
156
    $hardduedate = output_pref( { dt => $hardduedate, dateonly => 1, dateformat => 'iso' } ) if ( $hardduedate );
157
    my $hardduedatecompare = $input->param('hardduedatecompare');
157
    my $hardduedatecompare = $input->param('hardduedatecompare');
158
    my $rentaldiscount = $input->param('rentaldiscount');
158
    my $rentaldiscount = $input->param('rentaldiscount');
Lines 160-165 elsif ($op eq 'add') { Link Here
160
    my $article_requests = $input->param('article_requests') || 'no';
160
    my $article_requests = $input->param('article_requests') || 'no';
161
    my $overduefinescap = $input->param('overduefinescap') || undef;
161
    my $overduefinescap = $input->param('overduefinescap') || undef;
162
    my $cap_fine_to_replacement_price = $input->param('cap_fine_to_replacement_price') eq 'on';
162
    my $cap_fine_to_replacement_price = $input->param('cap_fine_to_replacement_price') eq 'on';
163
    my $recall_due_date_interval = $input->param('recall_due_date_interval');
164
    my $recall_overdue_fine = $input->param('recall_overdue_fine');
165
    my $recall_shelf_time = $input->param('recall_shelf_time');
163
    $debug and warn "Adding $br, $bor, $itemtype, $fine, $maxissueqty, $maxonsiteissueqty, $cap_fine_to_replacement_price";
166
    $debug and warn "Adding $br, $bor, $itemtype, $fine, $maxissueqty, $maxonsiteissueqty, $cap_fine_to_replacement_price";
164
167
165
    my $params = {
168
    my $params = {
Lines 192-197 elsif ($op eq 'add') { Link Here
192
        overduefinescap               => $overduefinescap,
195
        overduefinescap               => $overduefinescap,
193
        cap_fine_to_replacement_price => $cap_fine_to_replacement_price,
196
        cap_fine_to_replacement_price => $cap_fine_to_replacement_price,
194
        article_requests              => $article_requests,
197
        article_requests              => $article_requests,
198
        recall_due_date_interval      => $recall_due_date_interval,
199
        recall_overdue_fine           => $recall_overdue_fine,
200
        recall_shelf_time             => $recall_shelf_time,
195
    };
201
    };
196
202
197
    my $issuingrule = Koha::IssuingRules->find({categorycode => $bor, itemtype => $itemtype, branchcode => $br});
203
    my $issuingrule = Koha::IssuingRules->find({categorycode => $bor, itemtype => $itemtype, branchcode => $br});
(-)a/installer/data/mysql/atomicupdate/bug_19532_-_adding_recalls_circ_rules.perl (+15 lines)
Line 0 Link Here
1
$DBversion = 'XXX';
2
if( CheckVersion( $DBversion ) ) {
3
    unless( column_exists( 'issuingrules', 'recall_due_date_interval' ) ) {
4
        $dbh->do(q|ALTER TABLE issuingrules ADD recall_due_date_interval int(11) default NULL AFTER note|);
5
    }
6
    unless( column_exists( 'issuingrules', 'recall_overdue_fine' ) ) {
7
        $dbh->do(q|ALTER TABLE issuingrules ADD recall_overdue_fine decimal(28,6) default NULL AFTER recall_due_date_interval|);
8
    }
9
    unless( column_exists( 'issuingrules', 'recall_shelf_time' ) ) {
10
        $dbh->do(q|ALTER TABLE issuingrules ADD recall_shelf_time int(11) default NULL AFTER recall_overdue_fine|);
11
    }
12
13
    SetVersion( $DBversion );
14
    print "Upgrade to $DBversion done (Bug 19532: Add columns issuingrules.recall_due_date_interval, issuingrules.recall_overdue_fine and issuingrules.recall_shelf_time)\n";
15
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt (-2 / +13 lines)
Lines 208-213 $(document).ready(function() { Link Here
208
                <th>Holds per record (count)</th>
208
                <th>Holds per record (count)</th>
209
                <th>On shelf holds allowed</th>
209
                <th>On shelf holds allowed</th>
210
                <th>Item level holds</th>
210
                <th>Item level holds</th>
211
                <th>Recall due date interval (days)</th>
212
                <th>Recall overdue fine amount</th>
213
                <th>Recall pickup period (days)</th>
211
                <th>Article requests</th>
214
                <th>Article requests</th>
212
                <th>Rental discount (%)</th>
215
                <th>Rental discount (%)</th>
213
                <th>Actions</th>
216
                <th>Actions</th>
Lines 302-307 $(document).ready(function() { Link Here
302
                                                                If any unavailable
305
                                                                If any unavailable
303
                                                            [% END %]</td>
306
                                                            [% END %]</td>
304
                                                        <td>[% IF rule.opacitemholds == 'F'%]Force[% ELSIF rule.opacitemholds == 'Y'%]Allow[% ELSE %]Don't allow[% END %]</td>
307
                                                        <td>[% IF rule.opacitemholds == 'F'%]Force[% ELSIF rule.opacitemholds == 'Y'%]Allow[% ELSE %]Don't allow[% END %]</td>
308
                                                        <td>[% rule.recall_due_date_interval %]</td>
309
                                                        <td>[% rule.recall_overdue_fine FILTER format("%.2f") %]</td>
310
                                                        <td>[% rule.recall_shelf_time %]</td>
305
                                                        <td>
311
                                                        <td>
306
                                                            [% IF rule.article_requests == 'no' %]
312
                                                            [% IF rule.article_requests == 'no' %]
307
                                                                No
313
                                                                No
Lines 404-409 $(document).ready(function() { Link Here
404
                            <option value="F">Force</option>
410
                            <option value="F">Force</option>
405
                        </select>
411
                        </select>
406
                    </td>
412
                    </td>
413
                    <td><input type="text" name="recall_due_date_interval" id="recall_due_date_interval" size="3"></td>
414
                    <td><input type="text" name="recall_overdue_fine" id="recall_overdue_fine" size="6"></td>
415
                    <td><input type="text" name="recall_shelf_time" id="recall_shelf_time" size="3"></td>
407
                    <td>
416
                    <td>
408
                        <select id="article_requests" name="article_requests">
417
                        <select id="article_requests" name="article_requests">
409
                            <option value="no">No</option>
418
                            <option value="no">No</option>
Lines 442-452 $(document).ready(function() { Link Here
442
                      <th>No renewal before</th>
451
                      <th>No renewal before</th>
443
                      <th>Automatic renewal</th>
452
                      <th>Automatic renewal</th>
444
                      <th>No automatic renewal after</th>
453
                      <th>No automatic renewal after</th>
445
                       <th>No automatic renewal after (hard limit)</th>
454
                      <th>No automatic renewal after (hard limit)</th>
446
                      <th>Holds allowed (count)</th>
455
                      <th>Holds allowed (count)</th>
447
                      <th>Holds per record (count)</th>
456
                      <th>Holds per record (count)</th>
448
                      <th>On shelf holds allowed</th>
457
                      <th>On shelf holds allowed</th>
449
                      <th>Item level holds</th>
458
                      <th>Item level holds</th>
459
                      <th>Recall due date interval (days)</th>
460
                      <th>Recall overdue fine amount</th>
461
                      <th>Recall pickup period (days)</th>
450
                      <th>Article requests</th>
462
                      <th>Article requests</th>
451
                      <th>Rental discount (%)</th>
463
                      <th>Rental discount (%)</th>
452
                      <th>&nbsp;</th>
464
                      <th>&nbsp;</th>
453
- 

Return to bug 19532