freeside/httemplate/view cust_main.cgi,1.80,1.81
ivan
ivan at pouncequick.420.am
Mon Jun 28 21:02:49 PDT 2004
- Previous message: freeside/FS/FS cust_pay_refund.pm,NONE,1.1 cust_credit_bill.pm,1.11,1.12 cust_pay.pm,1.27,1.28 cust_refund.pm,1.22,1.23 cust_credit_refund.pm,1.10,1.11 cust_bill_pay.pm,1.14,1.15
- Next message: freeside/FS FS.pm,1.21,1.22 MANIFEST,1.76,1.77
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/cvsroot/freeside/httemplate/view
In directory pouncequick:/tmp/cvs-serv2036/httemplate/view
Modified Files:
cust_main.cgi
Log Message:
add cust_pay_refund table to refund payments
Index: cust_main.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_main.cgi,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -d -r1.80 -r1.81
--- cust_main.cgi 20 Apr 2004 00:58:04 -0000 1.80
+++ cust_main.cgi 29 Jun 2004 04:02:44 -0000 1.81
@@ -604,6 +604,7 @@
? $cust_pay->payinfo_masked
: $cust_pay->payinfo;
my @cust_bill_pay = $cust_pay->cust_bill_pay;
+ my @cust_pay_refund = $cust_pay->cust_pay_refund;
my $target = "$payby$payinfo";
$payby =~ s/^BILL$/Check #/ if $payinfo;
@@ -612,25 +613,42 @@
my $info = $payby ? " ($payby$payinfo)" : '';
my( $pre, $post, $desc, $apply, $ext ) = ( '', '', '', '', '' );
- if ( scalar(@cust_bill_pay) == 0 ) {
+ if ( scalar(@cust_bill_pay) == 0
+ && scalar(@cust_pay_refund) == 0 ) {
#completely unapplied
$pre = '<B><FONT COLOR="#FF0000">Unapplied ';
$post = '</FONT></B>';
$apply = qq! (<A HREF="${p}edit/cust_bill_pay.cgi?!.
$cust_pay->paynum. '">apply</A>)';
- } elsif ( scalar(@cust_bill_pay) == 1 && $cust_pay->unapplied == 0 ) {
- #applied to one invoice
+ } elsif ( scalar(@cust_bill_pay) == 1
+ && scalar(@cust_pay_refund) == 0
+ && $cust_pay->unapplied == 0 ) {
+ #applied to one invoice, the usual situation
$desc = ' applied to Invoice #'. $cust_bill_pay[0]->invnum;
+ } elsif ( scalar(@cust_bill_pay) == 0
+ && scalar(@cust_pay_refund) == 1
+ && $cust_pay->unapplied == 0 ) {
+ #applied to one refund
+ $desc = ' refunded on '. time2str("%D", $cust_pay_refund[0]->_date);
} else {
#complicated
$desc = '<BR>';
- foreach my $cust_bill_pay (@cust_bill_pay) {
- $desc .= ' '.
- '$'. $cust_bill_pay->amount.
- ' applied to Invoice #'. $cust_bill_pay->invnum.
- '<BR>';
- #' on '. time2str("%D", $cust_bill_pay->_date).
-
+ foreach my $app ( sort { $a->_date <=> $b->_date }
+ ( @cust_bill_pay, @cust_pay_refund ) ) {
+ if ( $app->isa('FS::cust_bill_pay') ) {
+ $desc .= ' '.
+ '$'. $app->amount.
+ ' applied to Invoice #'. $app->invnum.
+ '<BR>';
+ #' on '. time2str("%D", $cust_bill_pay->_date).
+ } elsif ( $app->isa('FS::cust_pay_refund') ) {
+ $desc .= ' '.
+ '$'. $app->amount.
+ ' refunded on'. time2str("%D", $app->_date).
+ '<BR>';
+ } else {
+ die "$app is not a FS::cust_bill_pay or FS::cust_pay_refund";
+ }
}
if ( $cust_pay->unapplied > 0 ) {
$desc .= ' '.
@@ -684,7 +702,7 @@
} elsif ( scalar(@cust_credit_bill) == 1
&& scalar(@cust_credit_refund) == 0
&& $cust_credit->credited == 0 ) {
- #applied to one invoice
+ #applied to one invoice, the usual situation
$desc = ' applied to Invoice #'. $cust_credit_bill[0]->invnum;
} elsif ( scalar(@cust_credit_bill) == 0
&& scalar(@cust_credit_refund) == 1
- Previous message: freeside/FS/FS cust_pay_refund.pm,NONE,1.1 cust_credit_bill.pm,1.11,1.12 cust_pay.pm,1.27,1.28 cust_refund.pm,1.22,1.23 cust_credit_refund.pm,1.10,1.11 cust_bill_pay.pm,1.14,1.15
- Next message: freeside/FS FS.pm,1.21,1.22 MANIFEST,1.76,1.77
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the freeside-commits
mailing list