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

(-)a/Koha/Schema/Result/Issuingrule.pm (+22 lines)
Lines 221-226 __PACKAGE__->table("issuingrules"); Link Here
221
  extra: {list => ["no","yes","bib_only","item_only"]}
221
  extra: {list => ["no","yes","bib_only","item_only"]}
222
  is_nullable: 0
222
  is_nullable: 0
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
    extra => { list => ["no", "yes", "bib_only", "item_only"] },
318
    extra => { list => ["no", "yes", "bib_only", "item_only"] },
303
    is_nullable => 0,
319
    is_nullable => 0,
304
  },
320
  },
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
(-)a/admin/smart-rules.pl (-1 / +7 lines)
Lines 156-162 elsif ($op eq 'add') { Link Here
156
    $issuelength = $issuelength eq q{} ? undef : $issuelength;
156
    $issuelength = $issuelength eq q{} ? undef : $issuelength;
157
    my $lengthunit  = $input->param('lengthunit');
157
    my $lengthunit  = $input->param('lengthunit');
158
    my $hardduedate = $input->param('hardduedate') || undef;
158
    my $hardduedate = $input->param('hardduedate') || undef;
159
    $hardduedate = eval { dt_from_string( $input->param('hardduedate') ) } if ( $hardduedate );
159
    $hardduedate = eval { dt_from_string( scalar $input->param('hardduedate') ) } if ( $hardduedate );
160
    $hardduedate = output_pref( { dt => $hardduedate, dateonly => 1, dateformat => 'iso' } ) if ( $hardduedate );
160
    $hardduedate = output_pref( { dt => $hardduedate, dateonly => 1, dateformat => 'iso' } ) if ( $hardduedate );
161
    my $hardduedatecompare = $input->param('hardduedatecompare');
161
    my $hardduedatecompare = $input->param('hardduedatecompare');
162
    my $rentaldiscount = $input->param('rentaldiscount');
162
    my $rentaldiscount = $input->param('rentaldiscount');
Lines 164-169 elsif ($op eq 'add') { Link Here
164
    my $article_requests = $input->param('article_requests') || 'no';
164
    my $article_requests = $input->param('article_requests') || 'no';
165
    my $overduefinescap = $input->param('overduefinescap') || undef;
165
    my $overduefinescap = $input->param('overduefinescap') || undef;
166
    my $cap_fine_to_replacement_price = $input->param('cap_fine_to_replacement_price') eq 'on';
166
    my $cap_fine_to_replacement_price = $input->param('cap_fine_to_replacement_price') eq 'on';
167
    my $recall_due_date_interval = $input->param('recall_due_date_interval');
168
    my $recall_overdue_fine = $input->param('recall_overdue_fine');
169
    my $recall_shelf_time = $input->param('recall_shelf_time');
167
    $debug and warn "Adding $br, $bor, $itemtype, $fine, $maxissueqty, $maxonsiteissueqty, $cap_fine_to_replacement_price";
170
    $debug and warn "Adding $br, $bor, $itemtype, $fine, $maxissueqty, $maxonsiteissueqty, $cap_fine_to_replacement_price";
168
171
169
    my $params = {
172
    my $params = {
Lines 197-202 elsif ($op eq 'add') { Link Here
197
        overduefinescap               => $overduefinescap,
200
        overduefinescap               => $overduefinescap,
198
        cap_fine_to_replacement_price => $cap_fine_to_replacement_price,
201
        cap_fine_to_replacement_price => $cap_fine_to_replacement_price,
199
        article_requests              => $article_requests,
202
        article_requests              => $article_requests,
203
        recall_due_date_interval      => $recall_due_date_interval,
204
        recall_overdue_fine           => $recall_overdue_fine,
205
        recall_shelf_time             => $recall_shelf_time,
200
    };
206
    };
201
207
202
    my $issuingrule = Koha::IssuingRules->find({categorycode => $bor, itemtype => $itemtype, branchcode => $br});
208
    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 / +14 lines)
Lines 91-96 Link Here
91
                <th>Holds per record (count)</th>
91
                <th>Holds per record (count)</th>
92
                <th>On shelf holds allowed</th>
92
                <th>On shelf holds allowed</th>
93
                <th>Item level holds</th>
93
                <th>Item level holds</th>
94
                <th>Recall due date interval (days)</th>
95
                <th>Recall overdue fine amount</th>
96
                <th>Recall pickup period (days)</th>
94
                <th>Article requests</th>
97
                <th>Article requests</th>
95
                <th>Rental discount (%)</th>
98
                <th>Rental discount (%)</th>
96
                <th>Actions</th>
99
                <th>Actions</th>
Lines 201-206 Link Here
201
                                                                <span>Don't allow</span>
204
                                                                <span>Don't allow</span>
202
                                                            [% END %]
205
                                                            [% END %]
203
                                                        </td>
206
                                                        </td>
207
                                                        <td>[% IF rule.opacitemholds == 'F'%]Force[% ELSIF rule.opacitemholds == 'Y'%]Allow[% ELSE %]Don't allow[% END %]</td>
208
                                                        <td>[% rule.recall_due_date_interval %]</td>
209
                                                        <td>[% rule.recall_overdue_fine FILTER format("%.2f") %]</td>
210
                                                        <td>[% rule.recall_shelf_time %]</td>
204
                                                        <td>
211
                                                        <td>
205
                                                            [% IF rule.article_requests == 'no' %]
212
                                                            [% IF rule.article_requests == 'no' %]
206
                                                                <span>No</span>
213
                                                                <span>No</span>
Lines 304-309 Link Here
304
                            <option value="F">Force</option>
311
                            <option value="F">Force</option>
305
                        </select>
312
                        </select>
306
                    </td>
313
                    </td>
314
                    <td><input type="text" name="recall_due_date_interval" id="recall_due_date_interval" size="3"></td>
315
                    <td><input type="text" name="recall_overdue_fine" id="recall_overdue_fine" size="6"></td>
316
                    <td><input type="text" name="recall_shelf_time" id="recall_shelf_time" size="3"></td>
307
                    <td>
317
                    <td>
308
                        <select id="article_requests" name="article_requests">
318
                        <select id="article_requests" name="article_requests">
309
                            <option value="no">No</option>
319
                            <option value="no">No</option>
Lines 343-353 Link Here
343
                      <th>No renewal before</th>
353
                      <th>No renewal before</th>
344
                      <th>Automatic renewal</th>
354
                      <th>Automatic renewal</th>
345
                      <th>No automatic renewal after</th>
355
                      <th>No automatic renewal after</th>
346
                       <th>No automatic renewal after (hard limit)</th>
356
                      <th>No automatic renewal after (hard limit)</th>
347
                      <th>Holds allowed (count)</th>
357
                      <th>Holds allowed (count)</th>
348
                      <th>Holds per record (count)</th>
358
                      <th>Holds per record (count)</th>
349
                      <th>On shelf holds allowed</th>
359
                      <th>On shelf holds allowed</th>
350
                      <th>Item level holds</th>
360
                      <th>Item level holds</th>
361
                      <th>Recall due date interval (days)</th>
362
                      <th>Recall overdue fine amount</th>
363
                      <th>Recall pickup period (days)</th>
351
                      <th>Article requests</th>
364
                      <th>Article requests</th>
352
                      <th>Rental discount (%)</th>
365
                      <th>Rental discount (%)</th>
353
                      <th>&nbsp;</th>
366
                      <th>&nbsp;</th>
354
- 

Return to bug 19532