|
Lines 35-57
BEGIN {
Link Here
|
| 35 |
$VERSION = 3.07.00.049; |
35 |
$VERSION = 3.07.00.049; |
| 36 |
require Exporter; |
36 |
require Exporter; |
| 37 |
@ISA = qw(Exporter); |
37 |
@ISA = qw(Exporter); |
| 38 |
@EXPORT = qw( |
38 |
@EXPORT = qw( |
| 39 |
&recordpayment |
39 |
&recordpayment |
| 40 |
&makepayment |
40 |
&makepayment |
| 41 |
&manualinvoice |
41 |
&manualinvoice |
| 42 |
&getnextacctno |
42 |
&getnextacctno |
| 43 |
&reconcileaccount |
43 |
&reconcileaccount |
| 44 |
&getcharges |
44 |
&GetCharges |
| 45 |
&ModNote |
45 |
&ModNote |
| 46 |
&getcredits |
46 |
&GetCredits |
| 47 |
&getrefunds |
47 |
&GetRefunds |
| 48 |
&chargelostitem |
48 |
&chargelostitem |
| 49 |
&ReversePayment |
49 |
&ReversePayment |
| 50 |
&makepartialpayment |
50 |
&makepartialpayment |
| 51 |
&recordpayment_selectaccts |
51 |
&recordpayment_selectaccts |
| 52 |
&WriteOffFee |
52 |
&WriteOffFee |
| 53 |
&GetTotalFines |
53 |
&GetTotalFines |
| 54 |
); |
54 |
); |
| 55 |
} |
55 |
} |
| 56 |
|
56 |
|
| 57 |
=head1 NAME |
57 |
=head1 NAME |
|
Lines 666-686
sub refund {
Link Here
|
| 666 |
return ($amountleft); |
666 |
return ($amountleft); |
| 667 |
} |
667 |
} |
| 668 |
|
668 |
|
| 669 |
sub getcharges { |
669 |
sub GetCharges { |
| 670 |
my ( $borrowerno, $timestamp, $accountno ) = @_; |
670 |
my ( $borrowerno, $timestamp, $accountno ) = @_; |
| 671 |
my $dbh = C4::Context->dbh; |
671 |
|
| 672 |
my $timestamp2 = $timestamp - 1; |
672 |
my $dbh = C4::Context->dbh; |
| 673 |
my $query = ""; |
673 |
|
| 674 |
my $sth = $dbh->prepare( |
674 |
my $timestamp2 = $timestamp - 1; |
| 675 |
"SELECT * FROM accountlines WHERE borrowernumber=? AND accountno = ?" |
675 |
|
| 676 |
); |
676 |
my $sth = $dbh->prepare(" |
| 677 |
$sth->execute( $borrowerno, $accountno ); |
677 |
SELECT * |
| 678 |
|
678 |
FROM accountlines |
| 679 |
my @results; |
679 |
WHERE borrowernumber = ? |
| 680 |
while ( my $data = $sth->fetchrow_hashref ) { |
680 |
AND accountno = ? |
| 681 |
push @results,$data; |
681 |
"); |
| 682 |
} |
682 |
$sth->execute( $borrowerno, $accountno ); |
| 683 |
return (@results); |
683 |
|
|
|
684 |
my $results = $sth->fetchall_arrayref({}); |
| 685 |
|
| 686 |
return @$results; |
| 684 |
} |
687 |
} |
| 685 |
|
688 |
|
| 686 |
sub ModNote { |
689 |
sub ModNote { |
|
Lines 690-734
sub ModNote {
Link Here
|
| 690 |
$sth->execute( $note, $accountlines_id ); |
693 |
$sth->execute( $note, $accountlines_id ); |
| 691 |
} |
694 |
} |
| 692 |
|
695 |
|
| 693 |
sub getcredits { |
696 |
sub GetCredits { |
| 694 |
my ( $date, $date2 ) = @_; |
697 |
my ( $date, $date2 ) = @_; |
| 695 |
my $dbh = C4::Context->dbh; |
698 |
my $dbh = C4::Context->dbh; |
| 696 |
my $sth = $dbh->prepare( |
699 |
my $sth = $dbh->prepare(" |
| 697 |
"SELECT * FROM accountlines,borrowers |
700 |
SELECT * |
| 698 |
WHERE amount < 0 AND accounttype <> 'Pay' AND accountlines.borrowernumber = borrowers.borrowernumber |
701 |
FROM accountlines, |
| 699 |
AND timestamp >=TIMESTAMP(?) AND timestamp < TIMESTAMP(?)" |
702 |
borrowers |
| 700 |
); |
703 |
WHERE amount < 0 |
| 701 |
|
704 |
AND accounttype <> 'Pay' |
| 702 |
$sth->execute( $date, $date2 ); |
705 |
AND accountlines.borrowernumber = borrowers.borrowernumber |
| 703 |
my @results; |
706 |
AND TIMESTAMP >= TIMESTAMP(?) |
| 704 |
while ( my $data = $sth->fetchrow_hashref ) { |
707 |
AND TIMESTAMP < TIMESTAMP(?) |
| 705 |
$data->{'date'} = $data->{'timestamp'}; |
708 |
"); |
| 706 |
push @results,$data; |
709 |
|
| 707 |
} |
710 |
$sth->execute( $date, $date2 ); |
| 708 |
return (@results); |
711 |
|
|
|
712 |
my $results = $sth->fetchall_arrayref({}); |
| 713 |
|
| 714 |
return @$results; |
| 709 |
} |
715 |
} |
| 710 |
|
716 |
|
| 711 |
|
717 |
|
| 712 |
sub getrefunds { |
718 |
sub GetRefunds { |
| 713 |
my ( $date, $date2 ) = @_; |
719 |
my ( $date, $date2 ) = @_; |
| 714 |
my $dbh = C4::Context->dbh; |
720 |
|
| 715 |
|
721 |
my $dbh = C4::Context->dbh; |
| 716 |
my $sth = $dbh->prepare( |
722 |
my $sth = $dbh->prepare(" |
| 717 |
"SELECT *,timestamp AS datetime |
723 |
SELECT *, |
| 718 |
FROM accountlines,borrowers |
724 |
TIMESTAMP AS datetime |
| 719 |
WHERE (accounttype = 'REF' |
725 |
FROM accountlines, |
| 720 |
AND accountlines.borrowernumber = borrowers.borrowernumber |
726 |
borrowers |
| 721 |
AND date >=? AND date <?)" |
727 |
WHERE accounttype = 'REF' |
| 722 |
); |
728 |
AND accountlines.borrowernumber = borrowers.borrowernumber |
|
|
729 |
AND date >= ? |
| 730 |
AND date < ? |
| 731 |
"); |
| 723 |
|
732 |
|
| 724 |
$sth->execute( $date, $date2 ); |
733 |
$sth->execute( $date, $date2 ); |
| 725 |
|
734 |
|
| 726 |
my @results; |
735 |
my $results = $sth->fetchall_arrayref({}); |
| 727 |
while ( my $data = $sth->fetchrow_hashref ) { |
736 |
|
| 728 |
push @results,$data; |
737 |
return @$results; |
| 729 |
|
|
|
| 730 |
} |
| 731 |
return (@results); |
| 732 |
} |
738 |
} |
| 733 |
|
739 |
|
| 734 |
sub ReversePayment { |
740 |
sub ReversePayment { |