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 151-157 elsif ($op eq 'add') { Link Here
151
    $issuelength = $issuelength eq q{} ? undef : $issuelength;
151
    $issuelength = $issuelength eq q{} ? undef : $issuelength;
152
    my $lengthunit  = $input->param('lengthunit');
152
    my $lengthunit  = $input->param('lengthunit');
153
    my $hardduedate = $input->param('hardduedate') || undef;
153
    my $hardduedate = $input->param('hardduedate') || undef;
154
    $hardduedate = eval { dt_from_string( $input->param('hardduedate') ) } if ( $hardduedate );
154
    $hardduedate = eval { dt_from_string( scalar $input->param('hardduedate') ) } if ( $hardduedate );
155
    $hardduedate = output_pref( { dt => $hardduedate, dateonly => 1, dateformat => 'iso' } ) if ( $hardduedate );
155
    $hardduedate = output_pref( { dt => $hardduedate, dateonly => 1, dateformat => 'iso' } ) if ( $hardduedate );
156
    my $hardduedatecompare = $input->param('hardduedatecompare');
156
    my $hardduedatecompare = $input->param('hardduedatecompare');
157
    my $rentaldiscount = $input->param('rentaldiscount');
157
    my $rentaldiscount = $input->param('rentaldiscount');
Lines 159-164 elsif ($op eq 'add') { Link Here
159
    my $article_requests = $input->param('article_requests') || 'no';
159
    my $article_requests = $input->param('article_requests') || 'no';
160
    my $overduefinescap = $input->param('overduefinescap') || undef;
160
    my $overduefinescap = $input->param('overduefinescap') || undef;
161
    my $cap_fine_to_replacement_price = $input->param('cap_fine_to_replacement_price') eq 'on';
161
    my $cap_fine_to_replacement_price = $input->param('cap_fine_to_replacement_price') eq 'on';
162
    my $recall_due_date_interval = $input->param('recall_due_date_interval');
163
    my $recall_overdue_fine = $input->param('recall_overdue_fine');
164
    my $recall_shelf_time = $input->param('recall_shelf_time');
162
    $debug and warn "Adding $br, $bor, $itemtype, $fine, $maxissueqty, $maxonsiteissueqty, $cap_fine_to_replacement_price";
165
    $debug and warn "Adding $br, $bor, $itemtype, $fine, $maxissueqty, $maxonsiteissueqty, $cap_fine_to_replacement_price";
163
166
164
    my $params = {
167
    my $params = {
Lines 191-196 elsif ($op eq 'add') { Link Here
191
        overduefinescap               => $overduefinescap,
194
        overduefinescap               => $overduefinescap,
192
        cap_fine_to_replacement_price => $cap_fine_to_replacement_price,
195
        cap_fine_to_replacement_price => $cap_fine_to_replacement_price,
193
        article_requests              => $article_requests,
196
        article_requests              => $article_requests,
197
        recall_due_date_interval      => $recall_due_date_interval,
198
        recall_overdue_fine           => $recall_overdue_fine,
199
        recall_shelf_time             => $recall_shelf_time,
194
    };
200
    };
195
201
196
    my $issuingrule = Koha::IssuingRules->find({categorycode => $bor, itemtype => $itemtype, branchcode => $br});
202
    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 88-93 Link Here
88
                <th>Holds per record (count)</th>
88
                <th>Holds per record (count)</th>
89
                <th>On shelf holds allowed</th>
89
                <th>On shelf holds allowed</th>
90
                <th>Item level holds</th>
90
                <th>Item level holds</th>
91
                <th>Recall due date interval (days)</th>
92
                <th>Recall overdue fine amount</th>
93
                <th>Recall pickup period (days)</th>
91
                <th>Article requests</th>
94
                <th>Article requests</th>
92
                <th>Rental discount (%)</th>
95
                <th>Rental discount (%)</th>
93
                <th>Actions</th>
96
                <th>Actions</th>
Lines 182-187 Link Here
182
                                                                If any unavailable
185
                                                                If any unavailable
183
                                                            [% END %]</td>
186
                                                            [% END %]</td>
184
                                                        <td>[% IF rule.opacitemholds == 'F'%]Force[% ELSIF rule.opacitemholds == 'Y'%]Allow[% ELSE %]Don't allow[% END %]</td>
187
                                                        <td>[% IF rule.opacitemholds == 'F'%]Force[% ELSIF rule.opacitemholds == 'Y'%]Allow[% ELSE %]Don't allow[% END %]</td>
188
                                                        <td>[% rule.recall_due_date_interval %]</td>
189
                                                        <td>[% rule.recall_overdue_fine FILTER format("%.2f") %]</td>
190
                                                        <td>[% rule.recall_shelf_time %]</td>
185
                                                        <td>
191
                                                        <td>
186
                                                            [% IF rule.article_requests == 'no' %]
192
                                                            [% IF rule.article_requests == 'no' %]
187
                                                                No
193
                                                                No
Lines 284-289 Link Here
284
                            <option value="F">Force</option>
290
                            <option value="F">Force</option>
285
                        </select>
291
                        </select>
286
                    </td>
292
                    </td>
293
                    <td><input type="text" name="recall_due_date_interval" id="recall_due_date_interval" size="3"></td>
294
                    <td><input type="text" name="recall_overdue_fine" id="recall_overdue_fine" size="6"></td>
295
                    <td><input type="text" name="recall_shelf_time" id="recall_shelf_time" size="3"></td>
287
                    <td>
296
                    <td>
288
                        <select id="article_requests" name="article_requests">
297
                        <select id="article_requests" name="article_requests">
289
                            <option value="no">No</option>
298
                            <option value="no">No</option>
Lines 322-332 Link Here
322
                      <th>No renewal before</th>
331
                      <th>No renewal before</th>
323
                      <th>Automatic renewal</th>
332
                      <th>Automatic renewal</th>
324
                      <th>No automatic renewal after</th>
333
                      <th>No automatic renewal after</th>
325
                       <th>No automatic renewal after (hard limit)</th>
334
                      <th>No automatic renewal after (hard limit)</th>
326
                      <th>Holds allowed (count)</th>
335
                      <th>Holds allowed (count)</th>
327
                      <th>Holds per record (count)</th>
336
                      <th>Holds per record (count)</th>
328
                      <th>On shelf holds allowed</th>
337
                      <th>On shelf holds allowed</th>
329
                      <th>Item level holds</th>
338
                      <th>Item level holds</th>
339
                      <th>Recall due date interval (days)</th>
340
                      <th>Recall overdue fine amount</th>
341
                      <th>Recall pickup period (days)</th>
330
                      <th>Article requests</th>
342
                      <th>Article requests</th>
331
                      <th>Rental discount (%)</th>
343
                      <th>Rental discount (%)</th>
332
                      <th>&nbsp;</th>
344
                      <th>&nbsp;</th>
333
- 

Return to bug 19532