X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Funapply-cust_pay.cgi;h=b0343d03449454dbfc42f3dcd901057adc35f563;hb=f3738a9fcd588d32eea9b0af6a3e884293c0c6e5;hp=8cdac180be1d87fe4b5945deeb8dfb129418ea76;hpb=624b2d44625f69d71175c3348cae635d580c890b;p=freeside.git

diff --git a/httemplate/misc/unapply-cust_pay.cgi b/httemplate/misc/unapply-cust_pay.cgi
index 8cdac180b..b0343d034 100755
--- a/httemplate/misc/unapply-cust_pay.cgi
+++ b/httemplate/misc/unapply-cust_pay.cgi
@@ -12,9 +12,7 @@ my $paynum = $1;
 my $cust_pay = qsearchs('cust_pay', { 'paynum' => $paynum } );
 my $custnum = $cust_pay->custnum;
 
-foreach my $cust_bill_pay ( $cust_pay->cust_bill_pay ) {
-  my $error = $cust_bill_pay->delete;
-  errorpage($error) if $error;
-}
+my $error = $cust_pay->delete_cust_bill_pay;
+errorpage($error) if $error;
 
 </%init>