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 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 193-198 elsif ($op eq 'add') { Link Here
193
        overduefinescap               => $overduefinescap,
196
        overduefinescap               => $overduefinescap,
194
        cap_fine_to_replacement_price => $cap_fine_to_replacement_price,
197
        cap_fine_to_replacement_price => $cap_fine_to_replacement_price,
195
        article_requests              => $article_requests,
198
        article_requests              => $article_requests,
199
        recall_due_date_interval      => $recall_due_date_interval,
200
        recall_overdue_fine           => $recall_overdue_fine,
201
        recall_shelf_time             => $recall_shelf_time,
196
    };
202
    };
197
203
198
    my $issuingrule = Koha::IssuingRules->find({categorycode => $bor, itemtype => $itemtype, branchcode => $br});
204
    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 90-95 Link Here
90
                <th>Holds per record (count)</th>
90
                <th>Holds per record (count)</th>
91
                <th>On shelf holds allowed</th>
91
                <th>On shelf holds allowed</th>
92
                <th>Item level holds</th>
92
                <th>Item level holds</th>
93
                <th>Recall due date interval (days)</th>
94
                <th>Recall overdue fine amount</th>
95
                <th>Recall pickup period (days)</th>
93
                <th>Article requests</th>
96
                <th>Article requests</th>
94
                <th>Rental discount (%)</th>
97
                <th>Rental discount (%)</th>
95
                <th>Actions</th>
98
                <th>Actions</th>
Lines 200-205 Link Here
200
                                                                <span>Don't allow</span>
203
                                                                <span>Don't allow</span>
201
                                                            [% END %]
204
                                                            [% END %]
202
                                                        </td>
205
                                                        </td>
206
                                                        <td>[% IF rule.opacitemholds == 'F'%]Force[% ELSIF rule.opacitemholds == 'Y'%]Allow[% ELSE %]Don't allow[% END %]</td>
207
                                                        <td>[% rule.recall_due_date_interval %]</td>
208
                                                        <td>[% rule.recall_overdue_fine FILTER format("%.2f") %]</td>
209
                                                        <td>[% rule.recall_shelf_time %]</td>
203
                                                        <td>
210
                                                        <td>
204
                                                            [% IF rule.article_requests == 'no' %]
211
                                                            [% IF rule.article_requests == 'no' %]
205
                                                                <span>No</span>
212
                                                                <span>No</span>
Lines 303-308 Link Here
303
                            <option value="F">Force</option>
310
                            <option value="F">Force</option>
304
                        </select>
311
                        </select>
305
                    </td>
312
                    </td>
313
                    <td><input type="text" name="recall_due_date_interval" id="recall_due_date_interval" size="3"></td>
314
                    <td><input type="text" name="recall_overdue_fine" id="recall_overdue_fine" size="6"></td>
315
                    <td><input type="text" name="recall_shelf_time" id="recall_shelf_time" size="3"></td>
306
                    <td>
316
                    <td>
307
                        <select id="article_requests" name="article_requests">
317
                        <select id="article_requests" name="article_requests">
308
                            <option value="no">No</option>
318
                            <option value="no">No</option>
Lines 342-352 Link Here
342
                      <th>No renewal before</th>
352
                      <th>No renewal before</th>
343
                      <th>Automatic renewal</th>
353
                      <th>Automatic renewal</th>
344
                      <th>No automatic renewal after</th>
354
                      <th>No automatic renewal after</th>
345
                       <th>No automatic renewal after (hard limit)</th>
355
                      <th>No automatic renewal after (hard limit)</th>
346
                      <th>Holds allowed (count)</th>
356
                      <th>Holds allowed (count)</th>
347
                      <th>Holds per record (count)</th>
357
                      <th>Holds per record (count)</th>
348
                      <th>On shelf holds allowed</th>
358
                      <th>On shelf holds allowed</th>
349
                      <th>Item level holds</th>
359
                      <th>Item level holds</th>
360
                      <th>Recall due date interval (days)</th>
361
                      <th>Recall overdue fine amount</th>
362
                      <th>Recall pickup period (days)</th>
350
                      <th>Article requests</th>
363
                      <th>Article requests</th>
351
                      <th>Rental discount (%)</th>
364
                      <th>Rental discount (%)</th>
352
                      <th>&nbsp;</th>
365
                      <th>&nbsp;</th>
353
- 

Return to bug 19532