RT#37064: Add action link to manually refund a payment
[freeside.git] / httemplate / misc / unapply-cust_pay.cgi
index 8cdac18..b0343d0 100755 (executable)
@@ -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>