bug 3464: Takes columns country and B_country of table borrowers into account in...
[srvgit] / members / pay.pl
index b782e45..f19f5b8 100755 (executable)
@@ -45,7 +45,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
         query           => $input,
         type            => "intranet",
         authnotrequired => 0,
-        flagsrequired   => { borrowers => 1 },
+        flagsrequired   => { borrowers => 1, updatecharges => 1 },
         debug           => 1,
     }
 );
@@ -155,6 +155,7 @@ $template->param( picture => 1 ) if $picture;
        address2 => $data->{'address2'},
        city => $data->{'city'},
        zipcode => $data->{'zipcode'},
+       country => $data->{'country'},
        phone => $data->{'phone'},
        email => $data->{'email'},
        branchcode => $data->{'branchcode'},
@@ -199,7 +200,7 @@ sub writeoff {
     undef $itemnum unless $itemnum; # if no item is attached to fine, make sure to store it as a NULL
     my $sth =
       $dbh->prepare(
-"Update accountlines set amountoutstanding=0 where (accounttype='Res' OR accounttype='FU' OR accounttype ='IP' OR accounttype='CH' OR accounttype='N' OR accounttype='F' OR accounttype='A' OR accounttype='M' OR accounttype='L' OR accounttype='RE' OR accounttype='RL') and accountno=? and borrowernumber=?"
+"Update accountlines set amountoutstanding=0 where accountno=? and borrowernumber=?"
       );
     $sth->execute( $accountnum, $borrowernumber );
     $sth->finish;