X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main.cgi;h=8e76619ae963957a2f199cf543e3c4f31e0d4075;hp=8ae7ce2953e59b92157fc3a2a273ae0d809aef54;hb=ecb895ccbbf52ed2babc0885c9925022175e33a0;hpb=436df4de2b0cd4442eaf37f880f0ae017debeaf5
diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi
index 8ae7ce295..8e76619ae 100755
--- a/httemplate/view/cust_main.cgi
+++ b/httemplate/view/cust_main.cgi
@@ -3,6 +3,14 @@
my $conf = new FS::Conf;
+#false laziness with view/cust_pkg.cgi, but i'm trying to make that go away so
+my %uiview = ();
+my %uiadd = ();
+foreach my $part_svc ( qsearch('part_svc',{}) ) {
+ $uiview{$part_svc->svcpart} = popurl(2). "view/". $part_svc->svcdb . ".cgi";
+ $uiadd{$part_svc->svcpart}= popurl(2). "edit/". $part_svc->svcdb . ".cgi";
+}
+
print header("Customer View", menubar(
'Main Menu' => popurl(2)
));
@@ -150,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 | ',
@@ -260,6 +268,22 @@ foreach my $type_pkgs ( qsearch('type_pkgs',{'typenum'=> $agent->typenum }) ) {
print ' ';
+print ' '.
+ qq! | ';
+
for ( qw( setup bill susp expire cancel ) ) {
print "", ( $package->getfield($_)
- ? time2str("%D", $package->getfield($_) )
+ ? time2str("%D %l:%M:%S%P %z",
+ $package->getfield($_) )
: ' '
), ' | ',
;
}
my $n2 = '';
- foreach my $cust_svc ( @cust_svc ) {
- my($label, $value, $svcdb) = $cust_svc->label;
- my($svcnum) = $cust_svc->svcnum;
- my($sview) = popurl(2). "view";
- print $n2,qq!$label | !,
- qq!$value | !;
- $n2="
";
+ #false laziness with view/cust_pkg.cgi, but i'm trying to make that go away so
+ #foreach my $cust_svc ( @cust_svc ) {
+ foreach my $svcpart ( sort { $a<=>$b } keys %pkg_svc ) {
+ my $svc = qsearchs('part_svc',{'svcpart'=>$svcpart})->getfield('svc');
+ my(@cust_svc)=qsearch('cust_svc',{'pkgnum'=>$pkgnum,
+ 'svcpart'=>$svcpart,
+ });
+ for my $enum ( 1 .. $pkg_svc{$svcpart} ) {
+ my $cust_svc;
+ if ( $cust_svc = shift @cust_svc ) {
+ my($label, $value, $svcdb) = $cust_svc->label;
+ my($svcnum) = $cust_svc->svcnum;
+ my($sview) = popurl(2). "view";
+ print $n2,qq!$label | !,
+ qq!$value | !;
+ } else {
+ print $n2, qq!!.
+ qq!Provision $svc!;
+
+ print qq! !.
+ qq!Link to legacy $svc!
+ if $conf->exists('legacy_link');
+
+ print ' | ';
+ }
+ $n2="
";
+ }
}
+
$n1="
";
}
print "
";
@@ -333,7 +417,7 @@ print "";
print <
-function areyousure(href) {
+function cust_pay_areyousure(href) {
if (confirm("Are you sure you want to delete this payment?")
== true)
window.location.href = href;
@@ -389,7 +473,7 @@ foreach my $bill (@bills) {
$payby =~ s/^BILL$/Check #/ if $payinfo;
$payby =~ s/^(CARD|COMP)$/$1 /;
my $delete = $payment->closed !~ /^Y/i && $conf->exists('deletepayments')
- ? qq! (delete)!
+ ? qq! (delete)!
: '';
push @history,
"$date\tPayment, Invoice #$invnum ($payby$payinfo)$delete\t\t$paid\t\t\t$target";
@@ -413,7 +497,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;
@@ -451,7 +556,7 @@ foreach my $payment (@unapplied_payments) {
$payby =~ s/^BILL$/Check #/ if $payinfo;
$payby =~ s/^(CARD|COMP)$/$1 /;
my $delete = $payment->closed !~ /^Y/i && $conf->exists('deletepayments')
- ? qq! (delete)!
+ ? qq! (delete)!
: '';
push @history,
$payment->_date. "\t".