From 5c35f5323f1cdcf7eabe6632d0352ea417d3047e Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 20 Aug 2009 04:03:35 +0000 Subject: Emailing statements of accounts, RT#4860 --- httemplate/view/cust_statement.html | 75 +++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100755 httemplate/view/cust_statement.html (limited to 'httemplate/view/cust_statement.html') diff --git a/httemplate/view/cust_statement.html b/httemplate/view/cust_statement.html new file mode 100755 index 000000000..ec4ee9ebd --- /dev/null +++ b/httemplate/view/cust_statement.html @@ -0,0 +1,75 @@ +<% include("/elements/header.html",'Statement View', menubar( + "View this customer (#$display_custnum)" => "${p}view/cust_main.cgi?$custnum", +)) %> + +% if ( $FS::CurrentUser::CurrentUser->access_right('Resend invoices') ) { + + Re-print this statement + +% if ( grep { $_ ne 'POST' } $cust_statement->cust_main->invoicing_list ) { + | Re-email this statement +% } + +% if ( $conf->exists('hylafax') && length($cust_statement->cust_main->fax) ) { + | Re-fax this statement +% } + +

+ +% } + + +% if ( $conf->exists('invoice_latex') ) { + + View typeset statement +

+% } + +% #if ( $cust_statement->num_cust_event ) { +% if ( 0 ) { +( View statement events )

+% } + +% if ( $conf->exists('invoice_html') ) { + + <% join('', $cust_statement->print_html('', $templatename) ) %> +% } else { + +
<% join('', $cust_statement->print_text('', $templatename) ) %>
+% } + +<% include('/elements/footer.html') %> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('View invoices'); + +#untaint statement +my($query) = $cgi->keywords; +$query =~ /^((.+)-)?(\d+)$/; +my $templatename = $2; +my $statementnum = $3; + +my $conf = new FS::Conf; + +my @payby = grep /\w/, $conf->config('payby'); +#@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH WEST COMP )) +@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH COMP )) + unless @payby; +my %payby = map { $_=>1 } @payby; + +my $cust_statement = qsearchs({ + 'select' => 'cust_statement.*', + 'table' => 'cust_statement', + 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )', + 'hashref' => { 'statementnum' => $statementnum }, + 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql, +}); +die "Statement #$statementnum not found!" unless $cust_statement; + +my $custnum = $cust_statement->custnum; +my $display_custnum = $cust_statement->cust_main->display_custnum; + +my $link = $templatename ? "$templatename-$statementnum" : $statementnum; + + -- cgit v1.2.1 From 1e34f4a5d142bd58f5918219db0931e81ad0418e Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 20 Aug 2009 09:47:05 +0000 Subject: email statements, RT#4860 --- httemplate/view/cust_statement.html | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'httemplate/view/cust_statement.html') diff --git a/httemplate/view/cust_statement.html b/httemplate/view/cust_statement.html index ec4ee9ebd..b078c9d07 100755 --- a/httemplate/view/cust_statement.html +++ b/httemplate/view/cust_statement.html @@ -4,13 +4,15 @@ % if ( $FS::CurrentUser::CurrentUser->access_right('Resend invoices') ) { - Re-print this statement +%# Re-print this statement % if ( grep { $_ ne 'POST' } $cust_statement->cust_main->invoicing_list ) { - | Re-email this statement +%# | + Re-email this statement % } -% if ( $conf->exists('hylafax') && length($cust_statement->cust_main->fax) ) { +% if ( 0 ) { +% #if ( $conf->exists('hylafax') && length($cust_statement->cust_main->fax) ) { | Re-fax this statement % } @@ -19,7 +21,8 @@ % } -% if ( $conf->exists('invoice_latex') ) { +% #if ( $conf->exists('invoice_latex') ) { +% if ( 0 ) { #broken??? View typeset statement

@@ -47,7 +50,7 @@ die "access denied" #untaint statement my($query) = $cgi->keywords; $query =~ /^((.+)-)?(\d+)$/; -my $templatename = $2; +my $templatename = $2 || 'statement'; #XXX configure... via event?? eh.. my $statementnum = $3; my $conf = new FS::Conf; -- cgit v1.2.1 From 06187016fd78ba41fb82846b9e8d461405f316b6 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 7 Oct 2009 23:44:26 +0000 Subject: naming follow-up notices from the event rather than creting a slew of separate templates, RT#5217 --- httemplate/view/cust_statement.html | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'httemplate/view/cust_statement.html') diff --git a/httemplate/view/cust_statement.html b/httemplate/view/cust_statement.html index b078c9d07..74c80d3bc 100755 --- a/httemplate/view/cust_statement.html +++ b/httemplate/view/cust_statement.html @@ -4,16 +4,16 @@ % if ( $FS::CurrentUser::CurrentUser->access_right('Resend invoices') ) { -%# Re-print this statement +%# Re-print this statement % if ( grep { $_ ne 'POST' } $cust_statement->cust_main->invoicing_list ) { %# | - Re-email this statement + Re-email this statement % } % if ( 0 ) { % #if ( $conf->exists('hylafax') && length($cust_statement->cust_main->fax) ) { - | Re-fax this statement + | Re-fax this statement % }

@@ -73,6 +73,7 @@ die "Statement #$statementnum not found!" unless $cust_statement; my $custnum = $cust_statement->custnum; my $display_custnum = $cust_statement->cust_main->display_custnum; -my $link = $templatename ? "$templatename-$statementnum" : $statementnum; +my $link = "statementnum=$statementnum"; +$link .= ';template='. uri_escape($templatename) if $templatename; -- cgit v1.2.1 From eae101004801019c942e9dfccbea50a8165f5d6d Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 7 Oct 2009 23:51:33 +0000 Subject: naming follow-up notices from the event rather than creting a slew of separate templates, RT#5217 --- httemplate/view/cust_statement.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/view/cust_statement.html') diff --git a/httemplate/view/cust_statement.html b/httemplate/view/cust_statement.html index 74c80d3bc..3e1345ed5 100755 --- a/httemplate/view/cust_statement.html +++ b/httemplate/view/cust_statement.html @@ -24,7 +24,7 @@ % #if ( $conf->exists('invoice_latex') ) { % if ( 0 ) { #broken??? - View typeset statement + View typeset statement

% } -- cgit v1.2.1