X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main.cgi;h=47964818352d3392e442305d22a9c2ff3d8fa97e;hp=1a04ff61c384fd2ddc0cb29a805ed17a558e2d76;hb=a9f62de2c99fea32f8a1b86e4da3766fc0ad2b53;hpb=4dbbbee37e78a035022974d19b3b80aeaead6049
diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi
index 1a04ff61c..479648183 100755
--- a/httemplate/view/cust_main.cgi
+++ b/httemplate/view/cust_main.cgi
@@ -158,7 +158,7 @@ print '
';
my $referral = qsearchs('part_referral', {
'refnum' => $cust_main->refnum
} );
- print ' | Referral | ',
+ print ' |
Advertising source | ',
$referral->refnum, ": ", $referral->referral, ' |
';
}
print 'Order taker | ',
@@ -206,8 +206,7 @@ print ' ';
if ( $cust_main->payby eq 'CARD' ) {
my $payinfo = $cust_main->payinfo;
- $payinfo = substr($payinfo,0,4). 'x'x(length($payinfo)-4);
-
+ $payinfo = 'x'x(length($payinfo)-4). substr($payinfo,(length($payinfo)-4));
print 'Credit card |
',
'Card number | ',
$payinfo, ' |
',
@@ -266,7 +265,14 @@ foreach my $type_pkgs ( qsearch('type_pkgs',{'typenum'=> $agent->typenum }) ) {
$part_pkg->comment;
}
-print '
';
+print '
';
+
+print '
'.
+ qq!
!;
print <
@@ -364,7 +370,8 @@ foreach my $package (@packages) {
for ( qw( setup bill susp expire cancel ) ) {
print "", ( $package->getfield($_)
- ? time2str("%D", $package->getfield($_) )
+ ? time2str("%D %l:%M:%S%P %z",
+ $package->getfield($_) )
: ' '
), ' | ',
;
@@ -459,7 +466,7 @@ foreach my $bill (@bills) {
$payment->payinfo,
$cust_bill_pay->amount,
);
- $payinfo = substr($payinfo,0,4). 'x'x(length($payinfo)-4)
+ $payinfo = 'x'x(length($payinfo)-4). substr($payinfo,(length($payinfo)-4))
if $payby eq 'CARD';
my $target = "$payby$payinfo";
$payby =~ s/^BILL$/Check #/ if $payinfo;
@@ -489,7 +496,28 @@ foreach my $bill (@bills) {
}
}
-my @credits = grep { $_->credited > 0 }
+my @credits = grep { scalar(my @array = $_->cust_credit_refund) }
+ qsearch('cust_credit',{'custnum'=>$custnum});
+foreach my $credit (@credits) {
+ my($cref)=$credit->hashref;
+ my(@cust_credit_refund)=
+ qsearch('cust_credit_refund', { 'crednum'=> $cref->{crednum} } );
+ foreach my $cust_credit_refund (@cust_credit_refund) {
+ my $cust_refund = $cust_credit_refund->cust_credit;
+ my($date, $crednum, $amount, $reason, $app_date ) = (
+ $credit->_date,
+ $credit->crednum,
+ $cust_credit_refund->amount,
+ $credit->reason,
+ time2str("%D", $cust_credit_refund->_date),
+ );
+ push @history,
+ "$date\tCredit #$crednum: $reason
".
+ "(applied to refund on $app_date)\t\t\t$amount\t";
+ }
+}
+
+@credits = grep { $_->credited > 0 }
qsearch('cust_credit',{'custnum'=>$custnum});
foreach my $credit (@credits) {
my($cref)=$credit->hashref;
@@ -521,7 +549,7 @@ foreach my $payment (@unapplied_payments) {
my $payby = $payment->payby;
my $payinfo = $payment->payinfo;
#false laziness w/above
- $payinfo = substr($payinfo,0,4). 'x'x(length($payinfo)-4)
+ $payinfo = 'x'x(length($payinfo)-4). substr($payinfo,(length($payinfo)-4))
if $payby eq 'CARD';
my $target = "$payby$payinfo";
$payby =~ s/^BILL$/Check #/ if $payinfo;