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

(-)a/Koha/Schema/Result/Issuingrule.pm (-2 / +24 lines)
Lines 221-226 __PACKAGE__->table("issuingrules"); Link Here
221
  is_nullable: 1
221
  is_nullable: 1
222
  size: 100
222
  size: 100
223
223
224
=head2 recall_due_date_interval
225
226
  data_type: 'integer'
227
  is_nullable: 1
228
229
=head2 recall_overdue_fine
230
231
  data_type: 'decimal'
232
  is_nullable: 1
233
  size: [28,6]
234
235
=head2 recall_shelf_time
236
237
  data_type: 'integer'
238
  is_nullable: 1
239
224
=cut
240
=cut
225
241
226
__PACKAGE__->add_columns(
242
__PACKAGE__->add_columns(
Lines 302-307 __PACKAGE__->add_columns( Link Here
302
  },
318
  },
303
  "note",
319
  "note",
304
  { data_type => "varchar", is_nullable => 1, size => 100 },
320
  { data_type => "varchar", is_nullable => 1, size => 100 },
321
  "recall_due_date_interval",
322
  { data_type => "integer", is_nullable => 1 },
323
  "recall_overdue_fine",
324
  { data_type => "decimal", is_nullable => 1, size => [28, 6] },
325
  "recall_shelf_time",
326
  { data_type => "integer", is_nullable => 1 },
305
);
327
);
306
328
307
=head1 PRIMARY KEY
329
=head1 PRIMARY KEY
Lines 321-328 __PACKAGE__->add_columns( Link Here
321
__PACKAGE__->set_primary_key("branchcode", "categorycode", "itemtype");
343
__PACKAGE__->set_primary_key("branchcode", "categorycode", "itemtype");
322
344
323
345
324
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-10-27 00:07:53
346
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-10-27 03:00:06
325
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2+Buk29soRlr1o0CaAIGWA
347
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1EXjmhkG47JNAOshMjdRqg
326
348
327
349
328
# You can replace this text with custom code or comments, and it will be preserved on regeneration
350
# 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 192-197 $(document).ready(function() { Link Here
192
                <th>Holds per record (count)</th>
192
                <th>Holds per record (count)</th>
193
                <th>On shelf holds allowed</th>
193
                <th>On shelf holds allowed</th>
194
                <th>Item level holds</th>
194
                <th>Item level holds</th>
195
                <th>Recall due date interval (days)</th>
196
                <th>Recall overdue fine amount</th>
197
                <th>Recall pickup period (days)</th>
195
                <th>Article requests</th>
198
                <th>Article requests</th>
196
                <th>Rental discount (%)</th>
199
                <th>Rental discount (%)</th>
197
                <th>Actions</th>
200
                <th>Actions</th>
Lines 286-291 $(document).ready(function() { Link Here
286
                                                                If any unavailable
289
                                                                If any unavailable
287
                                                            [% END %]</td>
290
                                                            [% END %]</td>
288
                                                        <td>[% IF rule.opacitemholds == 'F'%]Force[% ELSIF rule.opacitemholds == 'Y'%]Allow[% ELSE %]Don't allow[% END %]</td>
291
                                                        <td>[% IF rule.opacitemholds == 'F'%]Force[% ELSIF rule.opacitemholds == 'Y'%]Allow[% ELSE %]Don't allow[% END %]</td>
292
                                                        <td>[% rule.recall_due_date_interval %]</td>
293
                                                        <td>[% rule.recall_overdue_fine FILTER format("%.2f") %]</td>
294
                                                        <td>[% rule.recall_shelf_time %]</td>
289
                                                        <td>
295
                                                        <td>
290
                                                            [% IF rule.article_requests == 'no' %]
296
                                                            [% IF rule.article_requests == 'no' %]
291
                                                                No
297
                                                                No
Lines 388-393 $(document).ready(function() { Link Here
388
                            <option value="F">Force</option>
394
                            <option value="F">Force</option>
389
                        </select>
395
                        </select>
390
                    </td>
396
                    </td>
397
                    <td><input type="text" name="recall_due_date_interval" id="recall_due_date_interval" size="3"></td>
398
                    <td><input type="text" name="recall_overdue_fine" id="recall_overdue_fine" size="6"></td>
399
                    <td><input type="text" name="recall_shelf_time" id="recall_shelf_time" size="3"></td>
391
                    <td>
400
                    <td>
392
                        <select id="article_requests" name="article_requests">
401
                        <select id="article_requests" name="article_requests">
393
                            <option value="no">No</option>
402
                            <option value="no">No</option>
Lines 426-436 $(document).ready(function() { Link Here
426
                      <th>No renewal before</th>
435
                      <th>No renewal before</th>
427
                      <th>Automatic renewal</th>
436
                      <th>Automatic renewal</th>
428
                      <th>No automatic renewal after</th>
437
                      <th>No automatic renewal after</th>
429
                       <th>No automatic renewal after (hard limit)</th>
438
                      <th>No automatic renewal after (hard limit)</th>
430
                      <th>Holds allowed (count)</th>
439
                      <th>Holds allowed (count)</th>
431
                      <th>Holds per record (count)</th>
440
                      <th>Holds per record (count)</th>
432
                      <th>On shelf holds allowed</th>
441
                      <th>On shelf holds allowed</th>
433
                      <th>Item level holds</th>
442
                      <th>Item level holds</th>
443
                      <th>Recall due date interval (days)</th>
444
                      <th>Recall overdue fine amount</th>
445
                      <th>Recall pickup period (days)</th>
434
                      <th>Article requests</th>
446
                      <th>Article requests</th>
435
                      <th>Rental discount (%)</th>
447
                      <th>Rental discount (%)</th>
436
                      <th>&nbsp;</th>
448
                      <th>&nbsp;</th>
437
- 

Return to bug 19532