use Koha::Items;
use Koha::Checkouts;
use Koha::Patrons;
+use Koha::CirculationRules;
use Koha::Subscriptions;
use Koha::Account::Lines;
use Koha::Account::Offsets;
# Set a simple circ policy
$dbh->do('DELETE FROM issuingrules');
+Koha::CirculationRules->search()->delete();
$dbh->do(
q{INSERT INTO issuingrules (categorycode, branchcode, itemtype, reservesallowed,
- maxissueqty, issuelength, lengthunit,
+ issuelength, lengthunit,
renewalsallowed, renewalperiod,
norenewalbefore, auto_renew,
fine, chargeperiod)
VALUES (?, ?, ?, ?,
- ?, ?, ?,
+ ?, ?,
?, ?,
?, ?,
?, ?
},
{},
'*', '*', '*', 25,
- 20, 14, 'days',
+ 14, 'days',
1, 7,
undef, 0,
.10, 1
$dbh->do('DELETE FROM issues');
$dbh->do('DELETE FROM items');
$dbh->do('DELETE FROM issuingrules');
+ Koha::CirculationRules->search()->delete();
$dbh->do(
q{
- INSERT INTO issuingrules ( categorycode, branchcode, itemtype, reservesallowed, maxissueqty, issuelength, lengthunit, renewalsallowed, renewalperiod,
- norenewalbefore, auto_renew, fine, chargeperiod ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )
+ INSERT INTO issuingrules ( categorycode, branchcode, itemtype, reservesallowed, issuelength, lengthunit, renewalsallowed, renewalperiod,
+ norenewalbefore, auto_renew, fine, chargeperiod ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )
},
{},
'*', '*', '*', 25,
- 20, 14, 'days',
+ 14, 'days',
1, 7,
undef, 0,
.10, 1
);
+ Koha::CirculationRules->set_rules(
+ {
+ categorycode => '*',
+ itemtype => '*',
+ branchcode => '*',
+ rules => {
+ maxissueqty => 20
+ }
+ }
+ );
my $biblio = $builder->build_sample_biblio();
my $item_1 = $builder->build_sample_item(
categorycode => '*',
itemtype => '*',
branchcode => '*',
- maxissueqty => 99,
issuelength => 1,
firstremind => 1, # 1 day of grace
finedays => 2, # 2 days of fine per day of overdue