summaryrefslogtreecommitdiff
path: root/httemplate/view/cust_main
diff options
context:
space:
mode:
authorivan <ivan>2004-12-09 09:21:43 +0000
committerivan <ivan>2004-12-09 09:21:43 +0000
commit8d4abaa99403699aa5b5f02e899d2ea33980f913 (patch)
tree08cb2a528d281f9f5861fc94b8f3657abf57b8a7 /httemplate/view/cust_main
parent8127468dc459a8257ab7c15cca10801b9b2a3551 (diff)
more RT integration
Diffstat (limited to 'httemplate/view/cust_main')
-rw-r--r--httemplate/view/cust_main/billing.html119
-rw-r--r--httemplate/view/cust_main/contacts.html131
-rw-r--r--httemplate/view/cust_main/misc.html75
-rw-r--r--httemplate/view/cust_main/tickets.html54
4 files changed, 379 insertions, 0 deletions
diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html
new file mode 100644
index 000000000..18a203bd6
--- /dev/null
+++ b/httemplate/view/cust_main/billing.html
@@ -0,0 +1,119 @@
+<%
+ my( $cust_main ) = @_;
+ my @invoicing_list = $cust_main->invoicing_list;
+%>
+
+Billing information
+(<A HREF="<%= $p %>misc/bill.cgi?<%= $cust_main->custnum %>">Bill now</A>)
+<%= ntable("#cccccc") %><TR><TD><%= ntable("#cccccc",2) %>
+<TR>
+ <TD ALIGN="right">Tax&nbsp;exempt</TD>
+ <TD BGCOLOR="#ffffff"><%= $cust_main->tax ? 'yes' : 'no' %></TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Postal&nbsp;invoices</TD>
+ <TD BGCOLOR="#ffffff">
+ <%= ( grep { $_ eq 'POST' } @invoicing_list ) ? 'yes' : 'no' %>
+ </TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Email&nbsp;invoices</TD>
+ <TD BGCOLOR="#ffffff">
+ <%= join(', ', grep { $_ ne 'POST' } @invoicing_list ) || 'no' %>
+ </TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Billing&nbsp;type</TD>
+ <TD BGCOLOR="#ffffff">
+
+<% if ( $cust_main->payby eq 'CARD' || $cust_main->payby eq 'DCRD' ) { %>
+
+ Credit&nbsp;card&nbsp;<%= $cust_main->payby eq 'CARD' ? '(automatic)' : '(on-demand)' %>
+ </TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Card number</TD>
+ <TD BGCOLOR="#ffffff"><%= $cust_main->payinfo_masked %></TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Expiration</TD>
+ <TD BGCOLOR="#ffffff"><%= $cust_main->paydate %></TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Name on card</TD>
+ <TD BGCOLOR="#ffffff"><%= $cust_main->payname %></TD>
+</TR>
+
+<% } elsif ( $cust_main->payby eq 'CHEK' || $cust_main->payby eq 'DCHK') {
+ my( $account, $aba ) = split('@', $cust_main->payinfo );
+%>
+
+ Electronic&nbsp;check&nbsp;<%= $cust_main->payby eq 'CHEK' ? '(automatic)' : '(on-demand)' %>
+ </TD>
+</TR>
+<TR>
+ <TD ALIGN="right">ABA/Routing code</TD>
+ <TD BGCOLOR="#ffffff"><%= $aba %></TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Account number</TD>
+ <TD BGCOLOR="#ffffff"><%= $account %></TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Bank name</TD>
+ <TD BGCOLOR="#ffffff"><%= $cust_main->payname %></TD>
+</TR>
+
+<% } elsif ( $cust_main->payby eq 'LECB' ) {
+ $cust_main->payinfo =~ /^(\d{3})(\d{3})(\d{4})$/;
+ my $payinfo = "$1-$2-$3";
+%>
+
+ Phone&nbsp;bill&nbsp;billing
+ </TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Phone number</TD>
+ <TD BGCOLOR="#ffffff"><%= $payinfo %></TD>
+</TR>
+
+<% } elsif ( $cust_main->payby eq 'BILL' ) { %>
+
+ Billing
+ </TD>
+</TR>
+
+ <% if ( $cust_main->payinfo ) { %>
+<TR>
+ <TD ALIGN="right">P.O. </TD>
+ <TD BGCOLOR="#ffffff"><%= $cust_main->payinfo %></TD>
+</TR>
+ <% } %>
+
+<TR>
+ <TD ALIGN="right">Expiration</TD>
+ <TD BGCOLOR="#ffffff"><%= $cust_main->paydate %></TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Attention</TD>
+ <TD BGCOLOR="#ffffff"><%= $cust_main->payname %></TD>
+</TR>
+
+<% } elsif ( $cust_main->payby eq 'COMP' ) { %>
+
+ Complimentary
+ </TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Authorized&nbsp;by</TD>
+ <TD BGCOLOR="#ffffff"><%= $cust_main->payinfo %></TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Expiration</TD>
+ <TD BGCOLOR="#ffffff"><%= $cust_main->paydate %></TD>
+</TR>
+
+<% } %>
+
+</TABLE></TD></TR></TABLE>
+
diff --git a/httemplate/view/cust_main/contacts.html b/httemplate/view/cust_main/contacts.html
new file mode 100644
index 000000000..456d117a6
--- /dev/null
+++ b/httemplate/view/cust_main/contacts.html
@@ -0,0 +1,131 @@
+<%
+ my( $cust_main ) = @_;
+ my $conf = new FS::Conf;
+%>
+
+Billing address
+<%= ntable("#cccccc") %><TR><TD><%= ntable("#cccccc",2) %>
+<TR>
+ <TD ALIGN="right">Contact&nbsp;name</TD>
+ <TD COLSPAN=3 BGCOLOR="#ffffff">
+ <%= $cust_main->last. ', '. $cust_main->first %>
+ </TD>
+<% if ( $conf->exists('show_ss') ) { %>
+ <TD ALIGN="right">SS#</TD>
+ <TD BGCOLOR="#ffffff"><%= $cust_main->ss || '&nbsp' %></TD>
+<% } %>
+</TR>
+<TR>
+ <TD ALIGN="right">Company</TD>
+ <TD COLSPAN=5 BGCOLOR="#ffffff"><%= $cust_main->company %></TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Address</TD>
+ <TD COLSPAN=5 BGCOLOR="#ffffff"><%= $cust_main->address1 %></TD>
+</TR>
+<% if ( $cust_main->address2 ) { %>
+<TR>
+ <TD ALIGN="right">&nbsp;</TD>
+ <TD COLSPAN=5 BGCOLOR="#ffffff"><%= $cust_main->address2 %></TD>
+</TR>
+<% } %>
+<TR>
+ <TD ALIGN="right">City</TD>
+ <TD BGCOLOR="#ffffff"><%= $cust_main->city %></TD>
+ <TD ALIGN="right">State</TD>
+ <TD BGCOLOR="#ffffff"><%= $cust_main->state %></TD>
+ <TD ALIGN="right">Zip</TD>
+ <TD BGCOLOR="#ffffff"><%= $cust_main->zip %></TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Country</TD>
+ <TD BGCOLOR="#ffffff"><%= $cust_main->country %></TD>
+</TR>
+<%
+ my $daytime_label = FS::Msgcat::_gettext('daytime') =~ /^(daytime)?$/
+ ? 'Day&nbsp;Phone'
+ : FS::Msgcat::_gettext('daytime');
+ my $night_label = FS::Msgcat::_gettext('night') =~ /^(night)?$/
+ ? 'Night&nbsp;Phone'
+ : FS::Msgcat::_gettext('night');
+%>
+<TR>
+ <TD ALIGN="right"><%= $daytime_label %></TD>
+ <TD COLSPAN=5 BGCOLOR="#ffffff">
+ <%= $cust_main->daytime || '&nbsp' %>
+ </TD>
+</TR>
+<TR>
+ <TD ALIGN="right"><%= $night_label %></TD>
+ <TD COLSPAN=5 BGCOLOR="#ffffff">
+ <%= $cust_main->night || '&nbsp' %>
+ </TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Fax</TD>
+ <TD COLSPAN=5 BGCOLOR="#ffffff">
+ <%= $cust_main->fax || '&nbsp' %>
+ </TD>
+</TR>
+</TABLE></TD></TR></TABLE>
+
+<% if ( defined $cust_main->dbdef_table->column('ship_last') ) {
+ my $pre = $cust_main->ship_last ? 'ship_' : '';
+%>
+
+<BR>
+Service address
+<%= ntable("#cccccc") %><TR><TD><%= ntable("#cccccc",2) %>
+<TR>
+ <TD ALIGN="right">Contact name</TD>
+ <TD COLSPAN=5 BGCOLOR="#ffffff">
+ <%= $cust_main->get("${pre}last"). ', '. $cust_main->get("${pre}first") %>
+ </TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Company</TD>
+ <TD COLSPAN=5 BGCOLOR="#ffffff"><%= $cust_main->get("${pre}company") %></TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Address</TD>
+ <TD COLSPAN=5 BGCOLOR="#ffffff"><%= $cust_main->get("${pre}address1") %></TD>
+</TR>
+<% if ( $cust_main->get("${pre}address2") ) { %>
+<TR>
+ <TD ALIGN="right">&nbsp;</TD>
+ <TD COLSPAN=5 BGCOLOR="#ffffff"><%= $cust_main->get("${pre}address2") %></TD>
+</TR>
+<% } %>
+<TR>
+ <TD ALIGN="right">City</TD>
+ <TD BGCOLOR="#ffffff"><%= $cust_main->get("${pre}city") %></TD>
+ <TD ALIGN="right">State</TD>
+ <TD BGCOLOR="#ffffff"><%= $cust_main->get("${pre}state") %></TD>
+ <TD ALIGN="right">Zip</TD>
+ <TD BGCOLOR="#ffffff"><%= $cust_main->get("${pre}zip") %></TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Country</TD>
+ <TD BGCOLOR="#ffffff"><%= $cust_main->get("${pre}country") %></TD>
+</TR>
+<TR>
+ <TD ALIGN="right"><%= $daytime_label %></TD>
+ <TD COLSPAN=5 BGCOLOR="#ffffff">
+ <%= $cust_main->get("${pre}daytime") || '&nbsp' %>
+ </TD>
+</TR>
+<TR>
+ <TD ALIGN="right"><%= $night_label %></TD>
+ <TD COLSPAN=5 BGCOLOR="#ffffff">
+ <%= $cust_main->get("${pre}night") || '&nbsp' %>
+ </TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Fax</TD>
+ <TD COLSPAN=5 BGCOLOR="#ffffff">
+ <%= $cust_main->get("${pre}fax") || '&nbsp' %>
+ </TD>
+</TR>
+</TABLE></TD></TR></TABLE>
+
+<% } %>
diff --git a/httemplate/view/cust_main/misc.html b/httemplate/view/cust_main/misc.html
new file mode 100644
index 000000000..69e120573
--- /dev/null
+++ b/httemplate/view/cust_main/misc.html
@@ -0,0 +1,75 @@
+<%
+ my( $cust_main ) = @_;
+%>
+
+<%= ntable("#cccccc") %><TR><TD><%= &ntable("#cccccc",2) %>
+<TR>
+ <TD ALIGN="right">Customer&nbsp;number</TD>
+ <TD BGCOLOR="#ffffff"><%= $cust_main->custnum %></TD>
+</TR>
+
+<%
+ my @agents = qsearch( 'agent', {} );
+ my $agent;
+ unless ( scalar(@agents) == 1 ) {
+ $agent = qsearchs('agent',{ 'agentnum' => $cust_main->agentnum } );
+%>
+
+<TR>
+ <TD ALIGN="right">Agent</TD>
+ <TD BGCOLOR="#ffffff"><%= $agent->agentnum %>: <%= $agent->agent %></TD>
+</TR>
+
+<%
+ } else {
+ $agent = $agents[0];
+ }
+
+ my @referrals = qsearch( 'part_referral', {} );
+ unless ( scalar(@referrals) == 1 ) {
+ my $referral = qsearchs('part_referral', {
+ 'refnum' => $cust_main->refnum
+ } );
+%>
+
+<TR>
+ <TD ALIGN="right">Advertising&nbsp;source</TD>
+ <TD BGCOLOR="#ffffff"><%= $referral->refnum %>: <%= $referral->referral%></TD>
+</TR>
+
+<% } %>
+
+<TR>
+ <TD ALIGN="right">Order taker</TD>
+ <TD BGCOLOR="#ffffff"><%= $cust_main->otaker %></TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Referring&nbsp;Customer</TD>
+ <TD BGCOLOR="#ffffff">
+
+<%
+ my $referring_cust_main = '';
+ if ( $cust_main->referral_custnum
+ && ( $referring_cust_main =
+ qsearchs('cust_main', { custnum => $cust_main->referral_custnum } )
+ )
+ ) {
+%>
+
+<A HREF="<%= popurl(1) %>cust_main.cgi?<%= $cust_main->referral_custnum %>"><%=$cust_main->referral_custnum %>:
+<%=
+ ( $referring_cust_main->company
+ ? $referring_cust_main->company. ' ('.
+ $referring_cust_main->last. ', '. $referring_cust_main->first.
+ ')'
+ : $referring_cust_main->last. ', '. $referring_cust_main->first
+ )
+%></A>
+
+<% } %>
+
+ </TD>
+</TR>
+
+</TABLE></TD></TR></TABLE>
+
diff --git a/httemplate/view/cust_main/tickets.html b/httemplate/view/cust_main/tickets.html
new file mode 100644
index 000000000..61c94d61f
--- /dev/null
+++ b/httemplate/view/cust_main/tickets.html
@@ -0,0 +1,54 @@
+<%
+ my( $cust_main ) = @_;
+
+ my $conf = new FS::Conf;
+ my $num = 10;
+
+ my @tickets = ();
+ unless ( $conf->config('ticket_system-custom_priority_field') ) {
+
+ @tickets =
+ @{ FS::TicketSystem->customer_tickets($cust_main->custnum, $num) };
+
+ } else {
+
+ foreach my $priority (
+ $conf->config('ticket_system-custom_priority_field-values'), ''
+ ) {
+ last if scalar(@tickets) >= $num;
+ push @tickets,
+ @{ FS::TicketSystem->customer_tickets( $cust_main->custnum,
+ $num - scalar(@tickets),
+ $priority,
+ )
+ };
+ }
+
+ }
+
+%>
+
+Highest priority tickets
+(<A HREF="<%= FS::TicketSystem->href_customer_tickets($cust_main->custnum) %>">View all tickets for this customer</A>)
+(<A HREF="<%= FS::TicketSystem->href_new_ticket($cust_main->custnum) %>">New ticket for this customer</A>)
+<%= table() %>
+<TR>
+ <TH>#</TH>
+ <TH>Subject</TH>
+ <TH>Priority</TH>
+ <TH>Queue</TH>
+ <TH>Status</TH>
+</TR>
+<% foreach my $ticket ( @tickets ) {
+ my $href = FS::TicketSystem->href_ticket($ticket->{id});
+%>
+<TR>
+ <TD><A HREF=<%=$href%>><%= $ticket->{id} %></A></TD>
+ <TD><A HREF=<%=$href%>><%= $ticket->{subject} %></A></TD>
+ <TD ALIGN="right"><%= $ticket->{content} || $ticket->{priority} %></TD>
+ <TD><%= $ticket->{name} %></TD>
+ <TD><%= $ticket->{status} %></TD>
+</TR>
+<% } %>
+</TABLE>
+