From dbfb0ae501d5acba37f9348476d94b99a4c92450 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 2 Sep 2001 07:49:52 +0000 Subject: [PATCH] things are starting to work again, sorta. --- FS/FS/cust_bill_pay.pm | 5 ++- FS/FS/cust_credit_bill.pm | 4 +- FS/FS/cust_credit_refund.pm | 4 +- httemplate/edit/cust_credit_bill.cgi | 6 +-- httemplate/view/cust_main.cgi | 76 ++++++++++++++++++++++++------------ 5 files changed, 62 insertions(+), 33 deletions(-) diff --git a/FS/FS/cust_bill_pay.pm b/FS/FS/cust_bill_pay.pm index ac82c542d..921c0255c 100644 --- a/FS/FS/cust_bill_pay.pm +++ b/FS/FS/cust_bill_pay.pm @@ -162,8 +162,9 @@ sub check { ; return $error if $error; - $self->_date(time) unless $self->_date; + return "amount must be > 0" if $self->amount == 0; + $self->_date(time) unless $self->_date; ''; #no error } @@ -194,7 +195,7 @@ sub cust_bill { =head1 VERSION -$Id: cust_bill_pay.pm,v 1.6 2001-09-02 05:38:13 ivan Exp $ +$Id: cust_bill_pay.pm,v 1.7 2001-09-02 07:49:52 ivan Exp $ =head1 BUGS diff --git a/FS/FS/cust_credit_bill.pm b/FS/FS/cust_credit_bill.pm index 0892f7984..58cc78965 100644 --- a/FS/FS/cust_credit_bill.pm +++ b/FS/FS/cust_credit_bill.pm @@ -107,6 +107,8 @@ sub check { ; return $error if $error; + return "amount must be > 0" if $self->amount == 0; + return "Unknown credit" unless my $cust_credit = qsearchs( 'cust_credit', { 'crednum' => $self->crednum } ); @@ -141,7 +143,7 @@ sub cust_credit { =head1 VERSION -$Id: cust_credit_bill.pm,v 1.3 2001-09-02 01:27:11 ivan Exp $ +$Id: cust_credit_bill.pm,v 1.4 2001-09-02 07:49:52 ivan Exp $ =head1 BUGS diff --git a/FS/FS/cust_credit_refund.pm b/FS/FS/cust_credit_refund.pm index 4c5195717..fb09a42d8 100644 --- a/FS/FS/cust_credit_refund.pm +++ b/FS/FS/cust_credit_refund.pm @@ -147,6 +147,8 @@ sub check { ; return $error if $error; + return "amount must be > 0" if $self->amount == 0; + $self->_date(time) unless $self->_date; return "unknown cust_credit.crednum: ". $self->crednum @@ -170,7 +172,7 @@ sub cust_refund { =head1 VERSION -$Id: cust_credit_refund.pm,v 1.3 2001-09-02 05:38:13 ivan Exp $ +$Id: cust_credit_refund.pm,v 1.4 2001-09-02 07:49:52 ivan Exp $ =head1 BUGS diff --git a/httemplate/edit/cust_credit_bill.cgi b/httemplate/edit/cust_credit_bill.cgi index df495a668..c4cd34eab 100755 --- a/httemplate/edit/cust_credit_bill.cgi +++ b/httemplate/edit/cust_credit_bill.cgi @@ -1,5 +1,5 @@ <% -# +# use strict; use vars qw( $cgi $query $custnum $invnum $otaker $p1 $crednum $_date $amount $reason $cust_credit ); @@ -40,7 +40,7 @@ $p1 = popurl(1); print $cgi->header( '-expires' => 'now' ), header("Apply Credit", ''); print qq!Error: !, $cgi->param('error'), - "" + "

" if $cgi->param('error'); print < @@ -52,7 +52,7 @@ die unless $cust_credit = qsearchs('cust_credit', { 'crednum' => $crednum } ); print qq!Credit #!, $crednum, qq!!; print qq!\nInvoice #