$dbh->do("DELETE FROM tmp_holdsqueue");
$dbh->do("DELETE FROM hold_fill_targets");
$dbh->do("DELETE FROM reserves");
- $dbh->do("DELETE FROM issuingrules");
$dbh->do("DELETE FROM circulation_rules");
Koha::Biblios->delete();
Koha::Patrons->search->delete;
Koha::Items->search->delete;
Koha::Libraries->search->delete;
+ Koha::CirculationRules->search->delete;
$dbh->do('DELETE FROM issues');
- $dbh->do('DELETE FROM issuingrules');
- $dbh->do(
- q{INSERT INTO issuingrules (categorycode, branchcode, itemtype, reservesallowed)
- VALUES (?, ?, ?, ?)},
- {},
- '*', '*', '*', 25
+ Koha::CirculationRules->set_rules(
+ {
+ categorycode => undef,
+ itemtype => undef,
+ branchcode => undef,
+ rules => {
+ reservesallowed => 25,
+ }
+ }
);
- $dbh->do('DELETE FROM circulation_rules');
my $root1 = $builder->build_object( { class => 'Koha::Library::Groups', value => { ft_local_hold_group => 1 } } );
my $root2 = $builder->build_object( { class => 'Koha::Library::Groups', value => { ft_local_hold_group => 1 } } );
{
branchcode => $library1->branchcode,
itemtype => undef,
- categorycode => undef,
rules => {
holdallowed => 1,
hold_fulfillment_policy => 'any',
{
branchcode => $library2->branchcode,
itemtype => undef,
- categorycode => undef,
rules => {
holdallowed => 3,
hold_fulfillment_policy => 'holdgroup',
{
branchcode => $library3->branchcode,
itemtype => undef,
- categorycode => undef,
rules => {
holdallowed => 3,
hold_fulfillment_policy => 'patrongroup',
{
branchcode => $library4->branchcode,
itemtype => undef,
- categorycode => undef,
rules => {
holdallowed => 2,
hold_fulfillment_policy => 'holdingbranch',
{
branchcode => $library5->branchcode,
itemtype => undef,
- categorycode => undef,
rules => {
holdallowed => 2,
hold_fulfillment_policy => 'homebranch',
{
branchcode => $library6->branchcode,
itemtype => undef,
- categorycode => undef,
rules => {
holdallowed => 1,
hold_fulfillment_policy => 'holdgroup',
{
branchcode => $library7->branchcode,
itemtype => undef,
- categorycode => undef,
rules => {
holdallowed => 3,
hold_fulfillment_policy => 'holdingbranch',
{
branchcode => $library8->branchcode,
itemtype => undef,
- categorycode => undef,
rules => {
holdallowed => 2,
hold_fulfillment_policy => 'patrongroup',
Koha::Items->search->delete;
Koha::Libraries->search->delete;
$dbh->do('DELETE FROM issues');
- $dbh->do('DELETE FROM issuingrules');
- $dbh->do(
- q{INSERT INTO issuingrules (categorycode, branchcode, itemtype, reservesallowed)
- VALUES (?, ?, ?, ?)},
- {},
- '*', '*', '*', 25
+ Koha::CirculationRules->search->delete;
+ Koha::CirculationRules->set_rules(
+ {
+ categorycode => undef,
+ itemtype => undef,
+ branchcode => undef,
+ rules => {
+ reservesallowed => 25,
+ }
+ }
);
- $dbh->do('DELETE FROM circulation_rules');
my $root1 = $builder->build_object( { class => 'Koha::Library::Groups', value => { ft_local_hold_group => 1 } } );
my $root2 = $builder->build_object( { class => 'Koha::Library::Groups', value => { ft_local_hold_group => 1 } } );
{
branchcode => undef,
itemtype => undef,
- categorycode => undef,
rules => {
holdallowed => $ha,
hold_fulfillment_policy => $hfp,
issuingrule => {
categorycode => 'test_cat',
itemtype => 'IT4test',
- branchcode => '*',
+ branchcode => undef,
maxissueqty => '5',
issuelength => '5',
lengthunit => 'days',
};
our ( $borrowernumber, $start, $prev_time, $cleanup_needed );
+$dbh->do(q|INSERT INTO itemtypes(itemtype) VALUES (?)|, undef, $sample_data->{itemtype}{itemtype});
+
SKIP: {
eval { require Selenium::Remote::Driver; };
skip "Selenium::Remote::Driver is needed for selenium tests.", 20 if $@;
time_diff("add biblio");
my $itemtype = $sample_data->{itemtype};
- $dbh->do(q|INSERT INTO itemtypes (itemtype, description, rentalcharge, notforloan) VALUES (?, ?, ?, ?)|, undef, $itemtype->{itemtype}, $itemtype->{description}, $itemtype->{rentalcharge}, $itemtype->{notforloan});
my $issuing_rules = $sample_data->{issuingrule};
- $dbh->do(q|INSERT INTO issuingrules (categorycode, itemtype, branchcode, issuelength, lengthunit, renewalperiod) VALUES (?, ?, ?, ?, ?, ?)|, undef, $issuing_rules->{categorycode}, $issuing_rules->{itemtype}, $issuing_rules->{branchcode}, $issuing_rules->{issuelength}, $issuing_rules->{lengthunit}, $issuing_rules->{renewalperiod});
Koha::CirculationRules->set_rules(
{
categorycode => $issuing_rules->{categorycode},
itemtype => $issuing_rules->{itemtype},
branchcode => $issuing_rules->{branchcode},
rules => {
- maxissueqty => $issuing_rules->{maxissueqty}
+ maxissueqty => $issuing_rules->{maxissueqty},
+ issuelength => $issuing_rules->{issuelength},
+ lengthunit => $issuing_rules->{lengthunit},
+ renewalperiod => $issuing_rules->{renewalperiod},
}
}
);
$dbh->do(qq|DELETE FROM biblio WHERE title = "test biblio $i"|);
};
$dbh->do(q|DELETE FROM itemtypes WHERE itemtype=?|, undef, $sample_data->{itemtype}{itemtype});
- $dbh->do(q|DELETE FROM issuingrules WHERE categorycode=? AND itemtype=? AND branchcode=?|, undef, $sample_data->{issuingrule}{categorycode}, $sample_data->{issuingrule}{itemtype}, $sample_data->{issuingrule}{branchcode});
+ $dbh->do(q|DELETE FROM circulation_rules WHERE categorycode=? AND itemtype=? AND branchcode=?|, undef, $sample_data->{issuingrule}{categorycode}, $sample_data->{issuingrule}{itemtype}, $sample_data->{issuingrule}{branchcode});
}
sub time_diff {