chris 21 anni fa
parent
commit
225a759d4c
2 ha cambiato i file con 5 aggiunte e 5 eliminazioni
  1. +3
    -3
      C4/Accounts2.pm
  2. +2
    -2
      pay.pl

+ 3
- 3
C4/Accounts2.pm Vedi File

@@ -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;
}


+ 2
- 2
pay.pl Vedi File

@@ -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;
}
}


Caricamento…
Annulla
Salva