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

(-)a/Koha/Schema/Result/Issuingrule.pm (+22 lines)
Lines 226-231 __PACKAGE__->table("issuingrules"); Link Here
226
  extra: {list => ["no","yes","bib_only","item_only"]}
226
  extra: {list => ["no","yes","bib_only","item_only"]}
227
  is_nullable: 0
227
  is_nullable: 0
228
228
229
=head2 recall_due_date_interval
230
231
  data_type: 'integer'
232
  is_nullable: 1
233
234
=head2 recall_overdue_fine
235
236
  data_type: 'decimal'
237
  is_nullable: 1
238
  size: [28,6]
239
240
=head2 recall_shelf_time
241
242
  data_type: 'integer'
243
  is_nullable: 1
244
229
=cut
245
=cut
230
246
231
__PACKAGE__->add_columns(
247
__PACKAGE__->add_columns(
Lines 309-314 __PACKAGE__->add_columns( Link Here
309
    extra => { list => ["no", "yes", "bib_only", "item_only"] },
325
    extra => { list => ["no", "yes", "bib_only", "item_only"] },
310
    is_nullable => 0,
326
    is_nullable => 0,
311
  },
327
  },
328
  "recall_due_date_interval",
329
  { data_type => "integer", is_nullable => 1 },
330
  "recall_overdue_fine",
331
  { data_type => "decimal", is_nullable => 1, size => [28, 6] },
332
  "recall_shelf_time",
333
  { data_type => "integer", is_nullable => 1 },
312
);
334
);
313
335
314
=head1 PRIMARY KEY
336
=head1 PRIMARY KEY
(-)a/admin/smart-rules.pl (-1 / +7 lines)
Lines 177-183 elsif ($op eq 'add') { Link Here
177
    $issuelength = $issuelength eq q{} ? undef : $issuelength;
177
    $issuelength = $issuelength eq q{} ? undef : $issuelength;
178
    my $lengthunit  = $input->param('lengthunit');
178
    my $lengthunit  = $input->param('lengthunit');
179
    my $hardduedate = $input->param('hardduedate') || undef;
179
    my $hardduedate = $input->param('hardduedate') || undef;
180
    $hardduedate = eval { dt_from_string( $input->param('hardduedate') ) } if ( $hardduedate );
180
    $hardduedate = eval { dt_from_string( scalar $input->param('hardduedate') ) } if ( $hardduedate );
181
    $hardduedate = output_pref( { dt => $hardduedate, dateonly => 1, dateformat => 'iso' } ) if ( $hardduedate );
181
    $hardduedate = output_pref( { dt => $hardduedate, dateonly => 1, dateformat => 'iso' } ) if ( $hardduedate );
182
    my $hardduedatecompare = $input->param('hardduedatecompare');
182
    my $hardduedatecompare = $input->param('hardduedatecompare');
183
    my $rentaldiscount = $input->param('rentaldiscount');
183
    my $rentaldiscount = $input->param('rentaldiscount');
Lines 185-190 elsif ($op eq 'add') { Link Here
185
    my $article_requests = $input->param('article_requests') || 'no';
185
    my $article_requests = $input->param('article_requests') || 'no';
186
    my $overduefinescap = $input->param('overduefinescap') || undef;
186
    my $overduefinescap = $input->param('overduefinescap') || undef;
187
    my $cap_fine_to_replacement_price = $input->param('cap_fine_to_replacement_price') eq 'on';
187
    my $cap_fine_to_replacement_price = $input->param('cap_fine_to_replacement_price') eq 'on';
188
    my $recall_due_date_interval = $input->param('recall_due_date_interval');
189
    my $recall_overdue_fine = $input->param('recall_overdue_fine');
190
    my $recall_shelf_time = $input->param('recall_shelf_time');
188
    $debug and warn "Adding $br, $bor, $itemtype, $fine, $maxissueqty, $maxonsiteissueqty, $cap_fine_to_replacement_price";
191
    $debug and warn "Adding $br, $bor, $itemtype, $fine, $maxissueqty, $maxonsiteissueqty, $cap_fine_to_replacement_price";
189
192
190
    my $params = {
193
    my $params = {
Lines 219-224 elsif ($op eq 'add') { Link Here
219
        overduefinescap               => $overduefinescap,
222
        overduefinescap               => $overduefinescap,
220
        cap_fine_to_replacement_price => $cap_fine_to_replacement_price,
223
        cap_fine_to_replacement_price => $cap_fine_to_replacement_price,
221
        article_requests              => $article_requests,
224
        article_requests              => $article_requests,
225
        recall_due_date_interval      => $recall_due_date_interval,
226
        recall_overdue_fine           => $recall_overdue_fine,
227
        recall_shelf_time             => $recall_shelf_time,
222
    };
228
    };
223
229
224
    my $issuingrule = Koha::IssuingRules->find({categorycode => $bor, itemtype => $itemtype, branchcode => $br});
230
    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 (-1 / +13 lines)
Lines 95-100 Link Here
95
                <th>Holds per record (count)</th>
95
                <th>Holds per record (count)</th>
96
                <th>On shelf holds allowed</th>
96
                <th>On shelf holds allowed</th>
97
                <th>Item level holds</th>
97
                <th>Item level holds</th>
98
                <th>Recall due date interval (days)</th>
99
                <th>Recall overdue fine amount</th>
100
                <th>Recall pickup period (days)</th>
98
                <th>Article requests</th>
101
                <th>Article requests</th>
99
                <th>Rental discount (%)</th>
102
                <th>Rental discount (%)</th>
100
                <th>Actions</th>
103
                <th>Actions</th>
Lines 211-216 Link Here
211
                                                                <span>Don't allow</span>
214
                                                                <span>Don't allow</span>
212
                                                            [% END %]
215
                                                            [% END %]
213
                                                        </td>
216
                                                        </td>
217
                                                        <td>[% IF rule.opacitemholds == 'F'%]Force[% ELSIF rule.opacitemholds == 'Y'%]Allow[% ELSE %]Don't allow[% END %]</td>
218
                                                        <td>[% rule.recall_due_date_interval %]</td>
219
                                                        <td>[% rule.recall_overdue_fine FILTER format("%.2f") %]</td>
220
                                                        <td>[% rule.recall_shelf_time %]</td>
214
                                                        <td>
221
                                                        <td>
215
                                                            [% IF rule.article_requests == 'no' %]
222
                                                            [% IF rule.article_requests == 'no' %]
216
                                                                <span>No</span>
223
                                                                <span>No</span>
Lines 315-320 Link Here
315
                            <option value="F">Force</option>
322
                            <option value="F">Force</option>
316
                        </select>
323
                        </select>
317
                    </td>
324
                    </td>
325
                    <td><input type="text" name="recall_due_date_interval" id="recall_due_date_interval" size="3"></td>
326
                    <td><input type="text" name="recall_overdue_fine" id="recall_overdue_fine" size="6"></td>
327
                    <td><input type="text" name="recall_shelf_time" id="recall_shelf_time" size="3"></td>
318
                    <td>
328
                    <td>
319
                        <select id="article_requests" name="article_requests">
329
                        <select id="article_requests" name="article_requests">
320
                            <option value="no">No</option>
330
                            <option value="no">No</option>
Lines 360-365 Link Here
360
                      <th>Holds per record (count)</th>
370
                      <th>Holds per record (count)</th>
361
                      <th>On shelf holds allowed</th>
371
                      <th>On shelf holds allowed</th>
362
                      <th>Item level holds</th>
372
                      <th>Item level holds</th>
373
                      <th>Recall due date interval (days)</th>
374
                      <th>Recall overdue fine amount</th>
375
                      <th>Recall pickup period (days)</th>
363
                      <th>Article requests</th>
376
                      <th>Article requests</th>
364
                      <th>Rental discount (%)</th>
377
                      <th>Rental discount (%)</th>
365
                      <th>&nbsp;</th>
378
                      <th>&nbsp;</th>
366
- 

Return to bug 19532