From 4d6c465f4b32a49f8bce091f6cb5abb209123ec2 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 1 Aug 2012 14:04:50 -0700 Subject: [PATCH] invoice voiding, RT#18677 --- FS/FS/Mason.pm | 1 + FS/FS/Schema.pm | 13 +++++++++++++ FS/FS/cust_bill_pkg_discount.pm | 4 ++-- FS/FS/quotation.pm | 3 +-- FS/MANIFEST | 2 ++ httemplate/view/cust_bill.cgi | 2 -- httemplate/view/cust_bill_void.html | 20 +++++++++++++++++++- httemplate/view/quotation.html | 2 -- 8 files changed, 38 insertions(+), 9 deletions(-) diff --git a/FS/FS/Mason.pm b/FS/FS/Mason.pm index c45e783db..663a48e72 100644 --- a/FS/FS/Mason.pm +++ b/FS/FS/Mason.pm @@ -322,6 +322,7 @@ if ( -e $addl_handler_use_file ) { use FS::cust_bill_pkg_tax_location_void; use FS::cust_bill_pkg_tax_rate_location_void; use FS::cust_tax_exempt_pkg_void; + use FS::cust_bill_pkg_discount_void; # Sammath Naur if ( $FS::Mason::addl_handler_use ) { diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index e59268b2a..cff0afd6c 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -1784,6 +1784,19 @@ sub tables_hashref { 'index' => [ [ 'billpkgnum' ], [ 'pkgdiscountnum' ] ], }, + 'cust_bill_pkg_discount_void' => { + 'columns' => [ + 'billpkgdiscountnum', 'int', '', '', '', '', + 'billpkgnum', 'int', '', '', '', '', + 'pkgdiscountnum', 'int', '', '', '', '', + 'amount', @money_type, '', '', + 'months', 'decimal', 'NULL', '7,4', '', '', + ], + 'primary_key' => 'billpkgdiscountnum', + 'unique' => [], + 'index' => [ [ 'billpkgnum' ], [ 'pkgdiscountnum' ] ], + }, + 'discount' => { 'columns' => [ 'discountnum', 'serial', '', '', '', '', diff --git a/FS/FS/cust_bill_pkg_discount.pm b/FS/FS/cust_bill_pkg_discount.pm index e7dd5f22f..dfa83d393 100644 --- a/FS/FS/cust_bill_pkg_discount.pm +++ b/FS/FS/cust_bill_pkg_discount.pm @@ -28,8 +28,8 @@ FS::cust_bill_pkg_discount - Object methods for cust_bill_pkg_discount records =head1 DESCRIPTION An FS::cust_bill_pkg_discount object represents the slice of a customer -applied to a line item. FS::cust_bill_pkg_discount inherits from -FS::Record. The following fields are currently supported: +discount applied to a specific line item. FS::cust_bill_pkg_discount inherits +from FS::Record. The following fields are currently supported: =over 4 diff --git a/FS/FS/quotation.pm b/FS/FS/quotation.pm index ccaa1c34b..9e7723c77 100644 --- a/FS/FS/quotation.pm +++ b/FS/FS/quotation.pm @@ -142,9 +142,8 @@ sub cust_main { =cut -sub cust_bill_pkg { +sub cust_bill_pkg { #actually quotation_pkg objects my $self = shift; - #actually quotation_pkg objects qsearch('quotation_pkg', { quotationnum=>$self->quotationnum }); } diff --git a/FS/MANIFEST b/FS/MANIFEST index 01dab2092..2163a2324 100644 --- a/FS/MANIFEST +++ b/FS/MANIFEST @@ -663,3 +663,5 @@ FS/cust_bill_pkg_tax_rate_location_void.pm t/cust_bill_pkg_tax_rate_location_void.t FS/cust_tax_exempt_pkg_void.pm t/cust_tax_exempt_pkg_void.t +FS/cust_bill_pkg_discount_void.pm +t/cust_bill_pkg_discount_void.t diff --git a/httemplate/view/cust_bill.cgi b/httemplate/view/cust_bill.cgi index a8b4ac15c..95ce60b1d 100755 --- a/httemplate/view/cust_bill.cgi +++ b/httemplate/view/cust_bill.cgi @@ -166,8 +166,6 @@ die "Invoice #$invnum not found!" unless $cust_bill; my $custnum = $cust_bill->custnum; my $display_custnum = $cust_bill->cust_main->display_custnum; -#my $printed = $cust_bill->printed; - my $link = "invnum=$invnum"; $link .= ';template='. uri_escape($template) if $template; $link .= ';notice_name='. $notice_name if $notice_name; 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.''; +} + diff --git a/httemplate/view/quotation.html b/httemplate/view/quotation.html index 461b5dfb6..a88acf82b 100755 --- a/httemplate/view/quotation.html +++ b/httemplate/view/quotation.html @@ -44,8 +44,6 @@ XXX resending quotations % } % #plaintext quotations?
<% join('', $quotation->print_text() ) %>
- - <& /elements/footer.html &> <%init> -- 2.11.0