From f24c4bebce257bfcc61ba07fd3d16c5c0d730071 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Tue, 31 Jul 2012 23:02:14 -0700 Subject: invoice voiding, RT#18677 --- httemplate/view/cust_bill_void.html | 56 +++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100755 httemplate/view/cust_bill_void.html (limited to 'httemplate/view/cust_bill_void.html') diff --git a/httemplate/view/cust_bill_void.html b/httemplate/view/cust_bill_void.html new file mode 100755 index 000000000..c7c5da146 --- /dev/null +++ b/httemplate/view/cust_bill_void.html @@ -0,0 +1,56 @@ +<& /elements/header.html, mt('Voided Invoice'), menubar( + emt("View this customer (#[_1])",$display_custnum) => "${p}view/cust_main.cgi?$custnum", +) &> + +%#XXX something very big and obvious showing its voided... + +% #voided PDFs? +% #if ( $conf->exists('invoice_latex') ) { +%# +%# <% mt('View typeset invoice PDF') |h %> +%#

+% #} + +% if ( $conf->exists('invoice_html') ) { + <% join('', $cust_bill_void->print_html(\%opt) ) %> +% } else { +
<% join('', $cust_bill_void->print_text(\%opt) ) %>
+% } + +<& /elements/footer.html &> +<%init> + +my $curuser = $FS::CurrentUser::CurrentUser; + +die "access denied" + unless $curuser->access_right('View invoices'); + +my $invnum; +my($query) = $cgi->keywords; +if ( $query =~ /^(\d+)$/ ) { + $invnum = $1; +} else { + $invnum = $cgi->param('invnum'); +} + +my $conf = new FS::Conf; + +my %opt = ( + 'unsquelch_cdr' => $conf->exists('voip-cdr_email'), +); + +my $cust_bill_void = qsearchs({ + 'select' => 'cust_bill_void.*', + 'table' => 'cust_bill_void', + #'addl_from' => 'LEFT JOIN cust_main USING ( custnum )', + 'hashref' => { 'quotationnum' => $quotationnum }, + #'extra_sql' => ' AND '. $curuser->agentnums_sql, +}); +die "Quotation #$quotationnum not found!" unless $quotation; + +my $custnum = $cust_bill->custnum; +my $display_custnum = $cust_bill->cust_main->display_custnum; + +#my $link = "invnum=$invnum"; + + -- cgit v1.2.1 From 55675d6cdd93f00b7c0ac93403e8c4d66567a729 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 1 Aug 2012 13:16:42 -0700 Subject: invoice voiding, RT#18677 --- httemplate/view/cust_bill_void.html | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'httemplate/view/cust_bill_void.html') diff --git a/httemplate/view/cust_bill_void.html b/httemplate/view/cust_bill_void.html index c7c5da146..148c0ed7e 100755 --- a/httemplate/view/cust_bill_void.html +++ b/httemplate/view/cust_bill_void.html @@ -11,6 +11,11 @@ %#

% #} +
VOID
+ % if ( $conf->exists('invoice_html') ) { <% join('', $cust_bill_void->print_html(\%opt) ) %> % } else { @@ -43,13 +48,13 @@ my $cust_bill_void = qsearchs({ 'select' => 'cust_bill_void.*', 'table' => 'cust_bill_void', #'addl_from' => 'LEFT JOIN cust_main USING ( custnum )', - 'hashref' => { 'quotationnum' => $quotationnum }, + 'hashref' => { 'invnum' => $invnum }, #'extra_sql' => ' AND '. $curuser->agentnums_sql, }); -die "Quotation #$quotationnum not found!" unless $quotation; +die "Voided invoice #$invnum not found!" unless $cust_bill_void; -my $custnum = $cust_bill->custnum; -my $display_custnum = $cust_bill->cust_main->display_custnum; +my $custnum = $cust_bill_void->custnum; +my $display_custnum = $cust_bill_void->cust_main->display_custnum; #my $link = "invnum=$invnum"; -- cgit v1.2.1 From 4d6c465f4b32a49f8bce091f6cb5abb209123ec2 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 1 Aug 2012 14:04:50 -0700 Subject: invoice voiding, RT#18677 --- httemplate/view/cust_bill_void.html | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'httemplate/view/cust_bill_void.html') diff --git a/httemplate/view/cust_bill_void.html b/httemplate/view/cust_bill_void.html index 148c0ed7e..2c526747b 100755 --- a/httemplate/view/cust_bill_void.html +++ b/httemplate/view/cust_bill_void.html @@ -2,7 +2,19 @@ emt("View this customer (#[_1])",$display_custnum) => "${p}view/cust_main.cgi?$custnum", ) &> -%#XXX something very big and obvious showing its voided... + +<% areyousure_link("${p}misc/unvoid-cust_bill_void.html?invnum=". $cust_bill_void->invnum, + emt('Are you sure you want to unvoid this invoice?'), + emt('Unvoid this invoice'), #tooltip + emt('Unvoid this invoice') #link + ) +%> +

% #voided PDFs? % #if ( $conf->exists('invoice_latex') ) { @@ -11,6 +23,7 @@ %#

% #} +%#something very big and obvious showing its voided...
'.$label.''; +} + -- cgit v1.2.1