|
Lines 28-33
use C4::Debug;
Link Here
|
| 28 |
use C4::Branch; # GetBranches |
28 |
use C4::Branch; # GetBranches |
| 29 |
use Koha::DateUtils; |
29 |
use Koha::DateUtils; |
| 30 |
use Koha::Database; |
30 |
use Koha::Database; |
|
|
31 |
use Koha::IssuingRule; |
| 31 |
|
32 |
|
| 32 |
my $input = CGI->new; |
33 |
my $input = CGI->new; |
| 33 |
my $dbh = C4::Context->dbh; |
34 |
my $dbh = C4::Context->dbh; |
|
Lines 136-144
elsif ($op eq 'add') {
Link Here
|
| 136 |
my $overduefinescap = $input->param('overduefinescap') || undef; |
137 |
my $overduefinescap = $input->param('overduefinescap') || undef; |
| 137 |
$debug and warn "Adding $br, $bor, $itemtype, $fine, $maxissueqty, $maxonsiteissueqty"; |
138 |
$debug and warn "Adding $br, $bor, $itemtype, $fine, $maxissueqty, $maxonsiteissueqty"; |
| 138 |
|
139 |
|
| 139 |
my $schema = Koha::Database->new()->schema(); |
|
|
| 140 |
my $rs = $schema->resultset('Issuingrule'); |
| 141 |
|
| 142 |
my $params = { |
140 |
my $params = { |
| 143 |
branchcode => $br, |
141 |
branchcode => $br, |
| 144 |
categorycode => $bor, |
142 |
categorycode => $bor, |
|
Lines 166-172
elsif ($op eq 'add') {
Link Here
|
| 166 |
overduefinescap => $overduefinescap, |
164 |
overduefinescap => $overduefinescap, |
| 167 |
}; |
165 |
}; |
| 168 |
|
166 |
|
| 169 |
$rs->update_or_create($params); |
167 |
Koha::IssuingRule->new()->set($params)->store(); |
| 170 |
|
168 |
|
| 171 |
} |
169 |
} |
| 172 |
elsif ($op eq "set-branch-defaults") { |
170 |
elsif ($op eq "set-branch-defaults") { |
| 173 |
- |
|
|