chris 21 years ago
parent
commit
225a759d4c
  1. 6
      C4/Accounts2.pm
  2. 4
      pay.pl

6
C4/Accounts2.pm

@ -107,7 +107,7 @@ sub recordpayment{
sub makepayment{
#here we update both the accountoffsets and the account lines
my ($bornumber,$accountno,$amount)=@_;
my ($bornumber,$accountno,$amount,$user)=@_;
my $env;
my $dbh=C4Connect;
# begin transaction
@ -129,11 +129,11 @@ sub makepayment{
my $payment=0-$amount;
$updquery = "insert into accountlines
(borrowernumber, accountno,date,amount,description,accounttype,amountoutstanding)
values ($bornumber,$nextaccntno,now(),$payment,'Payment,thanks', 'Pay',0)";
values ($bornumber,$nextaccntno,now(),$payment,'Payment,thanks - $user', 'Pay',0)";
my $usth = $dbh->prepare($updquery);
$usth->execute;
$usth->finish;
UpdateStats($env,'branch','payment',$amount);
UpdateStats($env,$user,'payment',$amount);
$sth->finish;
$dbh->disconnect;
}

4
pay.pl

@ -14,7 +14,7 @@ my $input=new CGI;
my $bornum=$input->param('bornum');
#get borrower details
my $data=borrdata('',$bornum);
my $user=$input->remote_user;
#get account details
my %bor;
@ -34,7 +34,7 @@ for (my $i=0;$i<@names;$i++){
my $amount=$input->param($names[$i+4]);
my $bornum=$input->param($names[$i+5]);
my $accountno=$input->param($names[$i+6]);
makepayment($bornum,$accountno,$amount);
makepayment($bornum,$accountno,$amount,$user);
$check=2;
}
}

Loading…
Cancel
Save