|
Lines 60-65
my $itemtype = $builder->build(
Link Here
|
| 60 |
value => { notforloan => undef, rentalcharge => 0 } |
60 |
value => { notforloan => undef, rentalcharge => 0 } |
| 61 |
} |
61 |
} |
| 62 |
)->{itemtype}; |
62 |
)->{itemtype}; |
|
|
63 |
my $category = $builder->build({ |
| 64 |
source => 'Category', |
| 65 |
}); |
| 66 |
my $categorycode = $category->{categorycode}; |
| 63 |
|
67 |
|
| 64 |
my $CircControl = C4::Context->preference('CircControl'); |
68 |
my $CircControl = C4::Context->preference('CircControl'); |
| 65 |
my $HomeOrHoldingBranch = C4::Context->preference('HomeOrHoldingBranch'); |
69 |
my $HomeOrHoldingBranch = C4::Context->preference('HomeOrHoldingBranch'); |
|
Lines 192-198
my $sth = C4::Context->dbh->prepare("SELECT COUNT(*) FROM accountlines WHERE amo
Link Here
|
| 192 |
$sth->execute(); |
196 |
$sth->execute(); |
| 193 |
my ( $original_count ) = $sth->fetchrow_array(); |
197 |
my ( $original_count ) = $sth->fetchrow_array(); |
| 194 |
|
198 |
|
| 195 |
C4::Context->dbh->do("INSERT INTO borrowers ( cardnumber, surname, firstname, categorycode, branchcode ) VALUES ( '99999999999', 'Hall', 'Kyle', 'S', ? )", undef, $library2->{branchcode} ); |
199 |
C4::Context->dbh->do("INSERT INTO borrowers ( cardnumber, surname, firstname, categorycode, branchcode ) VALUES ( '99999999999', 'Hall', 'Kyle', ?, ? )", undef, $categorycode, $library2->{branchcode} ); |
| 196 |
|
200 |
|
| 197 |
C4::Circulation::ProcessOfflinePayment({ cardnumber => '99999999999', amount => '123.45' }); |
201 |
C4::Circulation::ProcessOfflinePayment({ cardnumber => '99999999999', amount => '123.45' }); |
| 198 |
|
202 |
|
|
Lines 210-219
C4::Context->dbh->do("DELETE FROM accountlines");
Link Here
|
| 210 |
# Generate test biblio |
214 |
# Generate test biblio |
| 211 |
my $biblio = MARC::Record->new(); |
215 |
my $biblio = MARC::Record->new(); |
| 212 |
my $title = 'Silence in the library'; |
216 |
my $title = 'Silence in the library'; |
| 213 |
$biblio->append_fields( |
217 |
|
| 214 |
MARC::Field->new('100', ' ', ' ', a => 'Moffat, Steven'), |
218 |
if (C4::Context->preference('marcflavour') eq 'UNIMARC') { |
| 215 |
MARC::Field->new('245', ' ', ' ', a => $title), |
219 |
$biblio->append_fields( |
| 216 |
); |
220 |
MARC::Field->new('200', ' ', ' ', f => 'Moffat, Steven'), |
|
|
221 |
MARC::Field->new('200', ' ', ' ', a => $title), |
| 222 |
); |
| 223 |
} else { |
| 224 |
$biblio->append_fields( |
| 225 |
MARC::Field->new('100', ' ', ' ', a => 'Moffat, Steven'), |
| 226 |
MARC::Field->new('245', ' ', ' ', a => $title), |
| 227 |
); |
| 228 |
} |
| 217 |
|
229 |
|
| 218 |
my ($biblionumber, $biblioitemnumber) = AddBiblio($biblio, ''); |
230 |
my ($biblionumber, $biblioitemnumber) = AddBiblio($biblio, ''); |
| 219 |
|
231 |
|
|
Lines 262-289
C4::Context->dbh->do("DELETE FROM accountlines");
Link Here
|
| 262 |
my %renewing_borrower_data = ( |
274 |
my %renewing_borrower_data = ( |
| 263 |
firstname => 'John', |
275 |
firstname => 'John', |
| 264 |
surname => 'Renewal', |
276 |
surname => 'Renewal', |
| 265 |
categorycode => 'S', |
277 |
categorycode => $categorycode, |
| 266 |
branchcode => $branch, |
278 |
branchcode => $branch, |
| 267 |
); |
279 |
); |
| 268 |
|
280 |
|
| 269 |
my %reserving_borrower_data = ( |
281 |
my %reserving_borrower_data = ( |
| 270 |
firstname => 'Katrin', |
282 |
firstname => 'Katrin', |
| 271 |
surname => 'Reservation', |
283 |
surname => 'Reservation', |
| 272 |
categorycode => 'S', |
284 |
categorycode => $categorycode, |
| 273 |
branchcode => $branch, |
285 |
branchcode => $branch, |
| 274 |
); |
286 |
); |
| 275 |
|
287 |
|
| 276 |
my %hold_waiting_borrower_data = ( |
288 |
my %hold_waiting_borrower_data = ( |
| 277 |
firstname => 'Kyle', |
289 |
firstname => 'Kyle', |
| 278 |
surname => 'Reservation', |
290 |
surname => 'Reservation', |
| 279 |
categorycode => 'S', |
291 |
categorycode => $categorycode, |
| 280 |
branchcode => $branch, |
292 |
branchcode => $branch, |
| 281 |
); |
293 |
); |
| 282 |
|
294 |
|
| 283 |
my %restricted_borrower_data = ( |
295 |
my %restricted_borrower_data = ( |
| 284 |
firstname => 'Alice', |
296 |
firstname => 'Alice', |
| 285 |
surname => 'Reservation', |
297 |
surname => 'Reservation', |
| 286 |
categorycode => 'S', |
298 |
categorycode => $categorycode, |
| 287 |
debarred => '3228-01-01', |
299 |
debarred => '3228-01-01', |
| 288 |
branchcode => $branch, |
300 |
branchcode => $branch, |
| 289 |
); |
301 |
); |
|
Lines 674-679
C4::Context->dbh->do("DELETE FROM accountlines");
Link Here
|
| 674 |
undef, $renewing_borrower->{borrowernumber} |
686 |
undef, $renewing_borrower->{borrowernumber} |
| 675 |
); |
687 |
); |
| 676 |
|
688 |
|
|
|
689 |
my $accountlines = Koha::Account::Lines->search({itemnumber => $itemnumber, borrowernumber => $renewing_borrower->{borrowernumber}, amount => '15.00'}); |
| 690 |
my $accouline = $accountlines->next(); |
| 691 |
my $itembranch = $item->get_column('holdingbranch'); |
| 692 |
ok($accouline->description =~ /Silence in the library Branch:$itembranch Barcode:R00000342/); |
| 693 |
|
| 677 |
ok( $total_due == 12, 'Borrower only charged replacement fee with both WhenLostForgiveFine and WhenLostChargeReplacementFee enabled' ); |
694 |
ok( $total_due == 12, 'Borrower only charged replacement fee with both WhenLostForgiveFine and WhenLostChargeReplacementFee enabled' ); |
| 678 |
|
695 |
|
| 679 |
C4::Context->dbh->do("DELETE FROM accountlines"); |
696 |
C4::Context->dbh->do("DELETE FROM accountlines"); |
|
Lines 728-737
C4::Context->dbh->do("DELETE FROM accountlines");
Link Here
|
| 728 |
#Create another record |
745 |
#Create another record |
| 729 |
my $biblio2 = MARC::Record->new(); |
746 |
my $biblio2 = MARC::Record->new(); |
| 730 |
my $title2 = 'Something is worng here'; |
747 |
my $title2 = 'Something is worng here'; |
| 731 |
$biblio2->append_fields( |
748 |
if (C4::Context->preference('marcflavour') eq 'UNIMARC') { |
| 732 |
MARC::Field->new('100', ' ', ' ', a => 'Anonymous'), |
749 |
$biblio2->append_fields( |
| 733 |
MARC::Field->new('245', ' ', ' ', a => $title2), |
750 |
MARC::Field->new('200', ' ', ' ', f => 'Anonymous'), |
| 734 |
); |
751 |
MARC::Field->new('200', ' ', ' ', a => $title2), |
|
|
752 |
); |
| 753 |
} else { |
| 754 |
$biblio2->append_fields( |
| 755 |
MARC::Field->new('100', ' ', ' ', a => 'Anonymous'), |
| 756 |
MARC::Field->new('245', ' ', ' ', a => $title2), |
| 757 |
); |
| 758 |
} |
| 735 |
my ($biblionumber2, $biblioitemnumber2) = AddBiblio($biblio2, ''); |
759 |
my ($biblionumber2, $biblioitemnumber2) = AddBiblio($biblio2, ''); |
| 736 |
|
760 |
|
| 737 |
#Create third item |
761 |
#Create third item |
|
Lines 749-755
C4::Context->dbh->do("DELETE FROM accountlines");
Link Here
|
| 749 |
my %a_borrower_data = ( |
773 |
my %a_borrower_data = ( |
| 750 |
firstname => 'Fridolyn', |
774 |
firstname => 'Fridolyn', |
| 751 |
surname => 'SOMERS', |
775 |
surname => 'SOMERS', |
| 752 |
categorycode => 'S', |
776 |
categorycode => $categorycode, |
| 753 |
branchcode => $branch, |
777 |
branchcode => $branch, |
| 754 |
); |
778 |
); |
| 755 |
|
779 |
|
|
Lines 829-835
C4::Context->dbh->do("DELETE FROM accountlines");
Link Here
|
| 829 |
my %a_borrower_data = ( |
853 |
my %a_borrower_data = ( |
| 830 |
firstname => 'Kyle', |
854 |
firstname => 'Kyle', |
| 831 |
surname => 'Hall', |
855 |
surname => 'Hall', |
| 832 |
categorycode => 'S', |
856 |
categorycode => $categorycode, |
| 833 |
branchcode => $branch, |
857 |
branchcode => $branch, |
| 834 |
); |
858 |
); |
| 835 |
|
859 |
|
|
Lines 895-907
C4::Context->dbh->do("DELETE FROM accountlines");
Link Here
|
| 895 |
my $borrowernumber1 = AddMember( |
919 |
my $borrowernumber1 = AddMember( |
| 896 |
firstname => 'Kyle', |
920 |
firstname => 'Kyle', |
| 897 |
surname => 'Hall', |
921 |
surname => 'Hall', |
| 898 |
categorycode => 'S', |
922 |
categorycode => $categorycode, |
| 899 |
branchcode => $library2->{branchcode}, |
923 |
branchcode => $library2->{branchcode}, |
| 900 |
); |
924 |
); |
| 901 |
my $borrowernumber2 = AddMember( |
925 |
my $borrowernumber2 = AddMember( |
| 902 |
firstname => 'Chelsea', |
926 |
firstname => 'Chelsea', |
| 903 |
surname => 'Hall', |
927 |
surname => 'Hall', |
| 904 |
categorycode => 'S', |
928 |
categorycode => $categorycode, |
| 905 |
branchcode => $library2->{branchcode}, |
929 |
branchcode => $library2->{branchcode}, |
| 906 |
); |
930 |
); |
| 907 |
|
931 |
|
|
Lines 953-962
C4::Context->dbh->do("DELETE FROM accountlines");
Link Here
|
| 953 |
|
977 |
|
| 954 |
#Create another record |
978 |
#Create another record |
| 955 |
my $biblio = MARC::Record->new(); |
979 |
my $biblio = MARC::Record->new(); |
| 956 |
$biblio->append_fields( |
980 |
if (C4::Context->preference('marcflavour') eq 'UNIMARC') { |
| 957 |
MARC::Field->new('100', ' ', ' ', a => 'Anonymous'), |
981 |
$biblio->append_fields( |
| 958 |
MARC::Field->new('245', ' ', ' ', a => 'A title'), |
982 |
MARC::Field->new('200', ' ', ' ', f => 'Anonymous'), |
| 959 |
); |
983 |
MARC::Field->new('200', ' ', ' ', a => 'A title'), |
|
|
984 |
); |
| 985 |
} else { |
| 986 |
$biblio->append_fields( |
| 987 |
MARC::Field->new('100', ' ', ' ', a => 'Anonymous'), |
| 988 |
MARC::Field->new('245', ' ', ' ', a => 'A title'), |
| 989 |
); |
| 990 |
} |
| 960 |
my ($biblionumber, $biblioitemnumber) = AddBiblio($biblio, ''); |
991 |
my ($biblionumber, $biblioitemnumber) = AddBiblio($biblio, ''); |
| 961 |
|
992 |
|
| 962 |
my (undef, undef, $itemnumber) = AddItem( |
993 |
my (undef, undef, $itemnumber) = AddItem( |
|
Lines 972-978
C4::Context->dbh->do("DELETE FROM accountlines");
Link Here
|
| 972 |
my $borrowernumber = AddMember( |
1003 |
my $borrowernumber = AddMember( |
| 973 |
firstname => 'fn', |
1004 |
firstname => 'fn', |
| 974 |
surname => 'dn', |
1005 |
surname => 'dn', |
| 975 |
categorycode => 'S', |
1006 |
categorycode => $categorycode, |
| 976 |
branchcode => $branch, |
1007 |
branchcode => $branch, |
| 977 |
); |
1008 |
); |
| 978 |
|
1009 |
|