return { 'error' => '',
'invoices' => [ map { { 'invnum' => $_->invnum,
'_date' => $_->_date,
+ 'date' => time2str("%b %o, %Y", $_->_date),
}
} @cust_bill
]
--- /dev/null
+<%= $url = "$selfurl?session=$session_id;action="; ''; %>
+<%= include('header', 'All Invoices') %>
+
+<%=
+ if ( @invoices ) {
+ $OUT .= '<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=2 BGCOLOR="#eeeeee">'.
+ '<TR><TH BGCOLOR="#ff6666" COLSPAN=4>All Invoices</TH></TR>';
+ my $col1 = "ffffff";
+ my $col2 = "dddddd";
+ my $col = $col1;
+
+ foreach my $invoice ( @invoices ) {
+ my $td = qq!<TD BGCOLOR="#$col">!;
+ my $a=qq!<A HREF="${url}view_invoice;invnum=!. $invoice->{'invnum'}. '">';
+ $OUT .=
+ "<TR>$td${a}Invoice #". $invoice->{'invnum'}. "</A></TD>$td</TD>".
+ "$td$a". $invoice->{'date'}. "</A></TD>$td</TD>".
+ '</TR>';
+ $col = $col eq $col1 ? $col2 : $col1;
+ }
+ $OUT .= '</TABLE><BR>';
+ } else {
+ $OUT .= 'You have no invoices.<BR><BR>';
+ }
+%>
+
+<%= include('footer') %>
'';
%>
+<%=
+ $OUT .= qq! <B><A HREF="${url}invoices">View All Invoices</A></B> !;
+%>
+
<%= if ( $balance > 0 ) {
if (scalar(grep $_, @hide_payment_fields)) {
$OUT .= qq! <B><A HREF="${url}make_thirdparty_payment&payby_method=CC">Make a payment</A></B><BR><BR>!;
push @menu,
{ title=>' ' },
{ title=>'View my usage', url=>'view_usage', size=>'+1', },
+ { title=>'Create a ticket', url=>'tktcreate', size=>'+1', },
;
unless ( $access_pkgnum ) {
part_svc_info provision_acct provision_external
unprovision_svc change_pkg suspend_pkg domainselector
list_svcs list_svc_usage list_cdr_usage list_support_usage
- myaccount_passwd
+ myaccount_passwd list_invoices create_ticket
mason_comp
);
#order|pw_list XXX ???
$cgi->param('action') =~
- /^(myaccount|view_invoice|make_payment|make_ach_payment|make_term_payment|make_thirdparty_payment|payment_results|ach_payment_results|recharge_prepay|recharge_results|logout|change_bill|change_ship|change_pay|process_change_bill|process_change_ship|process_change_pay|customer_order_pkg|process_order_pkg|customer_change_pkg|process_change_pkg|process_order_recharge|provision|provision_svc|process_svc_acct|process_svc_external|delete_svc|view_usage|view_usage_details|view_cdr_details|view_support_details|change_password|process_change_password|customer_suspend_pkg|process_suspend_pkg)$/
+ /^(myaccount|tktcreate|invoices|view_invoice|make_payment|make_ach_payment|make_term_payment|make_thirdparty_payment|payment_results|ach_payment_results|recharge_prepay|recharge_results|logout|change_bill|change_ship|change_pay|process_change_bill|process_change_ship|process_change_pay|customer_order_pkg|process_order_pkg|customer_change_pkg|process_change_pkg|process_order_recharge|provision|provision_svc|process_svc_acct|process_svc_external|delete_svc|view_usage|view_usage_details|view_cdr_details|view_support_details|change_password|process_change_password|customer_suspend_pkg|process_suspend_pkg)$/
or die "unknown action ". $cgi->param('action');
my $action = $1;
}
+sub invoices {
+ list_invoices( 'session_id' => $session_id, );
+}
+
+sub tktcreate {
+ my $customer_info = customer_info( 'session_id' => $session_id );
+ return $customer_info if ( $customer_info->{'error'} );
+
+ my $requestor = "";
+ if ( $customer_info->{'invoicing_list'} ) {
+ my @requestor = split( /\s*\,\s*/, $customer_info->{'invoicing_list'} );
+ $requestor = $requestor[0] if scalar(@requestor);
+ }
+
+ return { 'requestor' => $requestor }
+ unless ($cgi->param('subject') && $cgi->param('message') &&
+ length($cgi->param('subject')) && length($cgi->param('message')));
+
+ create_ticket( 'session_id' => $session_id,
+ 'subject' => $cgi->param('subject'),
+ 'message' => $cgi->param('message'),
+ 'requestor' => $requestor,
+ );
+}
+
sub customer_order_pkg {
my $init_data = signup_info( 'customer_session_id' => $session_id );
return $init_data if ( $init_data->{'error'} );
--- /dev/null
+<%= $url = "$selfurl?session=$session_id;action="; ''; %>
+<%= include('header', 'Create a ticket') %>
+
+<%=
+if ( $ticket_id ) {
+ $OUT .= "<B>Created ticket #$ticket_id</B>";
+} else {
+ $OUT .= qq!
+ <div style='font-weight: bold; color: red; margin-bottom: 6px;'> $error </div>
+ Please fill in both the subject and message
+ <br><br>
+ <FORM ACTION="$selfurl" METHOD=POST>
+ <input type="hidden" name="session" value="$session_id">
+ <input type="hidden" name="action" value="tktcreate">
+ <table>
+ <tr>
+ <td>Your e-mail address</td>
+ <td>$requestor</td>
+ </tr>
+ <tr>
+ <td>Subject</td>
+ <td><input type="text" name="subject" size="53"></td>
+ </tr>
+ <tr>
+ <td valign="top">Message</td>
+ <td><textarea name="message" rows="10" cols="60"></textarea></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td><input type="submit" value="Create"></td>
+ </tr>
+ </table>
+ </form>
+ !;
+}
+%>
+
+<%= include('footer') %>