diff options
| author | Mark Wells <mark@freeside.biz> | 2013-10-12 18:50:20 -0700 |
|---|---|---|
| committer | Mark Wells <mark@freeside.biz> | 2013-10-12 18:50:20 -0700 |
| commit | ddb0ff57880eeb2183b227592545f2619079d221 (patch) | |
| tree | 63bf92c229dab41e91c690d079dbeffcaa4e17ee /httemplate/view | |
| parent | f9c93506a5f42b4c6dd33e402b9248c66af5b60a (diff) | |
allow changing package class of one-time charges post-billing, #25342
Diffstat (limited to 'httemplate/view')
| -rw-r--r-- | httemplate/view/cust_main/packages/package.html | 29 | ||||
| -rw-r--r-- | httemplate/view/cust_main/payment_history.html | 14 | ||||
| -rw-r--r-- | httemplate/view/cust_main/payment_history/voided_credit.html | 25 |
3 files changed, 62 insertions, 6 deletions
diff --git a/httemplate/view/cust_main/packages/package.html b/httemplate/view/cust_main/packages/package.html index df804b829..dec13cabc 100644 --- a/httemplate/view/cust_main/packages/package.html +++ b/httemplate/view/cust_main/packages/package.html @@ -21,17 +21,21 @@ <TD COLSPAN=2> <FONT SIZE=-1> -% unless ( $cust_pkg->get('cancel') || $opt{no_links} ) { +% if ( $part_pkg->freq eq '0' and !$opt{no_links} ) { +% # One-time charge. Nothing you can do with this, unless: +% if ( $curuser->access_right('Modify one-time charge') ) { + ( <%onetime_change_link($cust_pkg)%> ) + <BR> +% } % +% } elsif ( !$cust_pkg->get('cancel') and !$opt{no_links} ) { +% % if ( $change_from ) { % # This is the target package for a future change. % # Nothing you can do with it besides modify/cancel the % # future change, and that's on the current package. -% } elsif ( $supplemental or $part_pkg->freq eq '0' ) { -% # Supplemental packages can't be changed independently. -% # One-time charges don't need to be changed. -% # For both of those, we only show "Edit dates", "Add comments", -% # and "Add invoice details". +% } elsif ( $supplemental ) { +% # Show only "Add comments" and "Add invoice details". % if ( $curuser->access_right('Edit customer package dates') ) { ( <%pkg_dates_link($cust_pkg)%> ) % } @@ -328,6 +332,19 @@ sub pkg_change_link { ); } +sub onetime_change_link { + my $cust_pkg = shift; + my $pkgnum = $cust_pkg->pkgnum; + include( '/elements/popup_link-cust_pkg.html', + 'action' => $p. "edit/quick-charge.html?change_pkgnum=$pkgnum", + 'label' => emt('Modify one-time charge'), + 'actionlabel' => emt('Modify'), + 'cust_pkg' => $cust_pkg, + 'width' => 690, + 'height' => 380, + ); +} + sub pkg_change_location_link { my $cust_pkg = shift; my $pkgpart = $cust_pkg->pkgpart; diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html index c7bf3748c..73082ce96 100644 --- a/httemplate/view/cust_main/payment_history.html +++ b/httemplate/view/cust_main/payment_history.html @@ -270,6 +270,11 @@ % ? sprintf("- $money_char\%.2f", $item->{'credit'}) % : ''; % +% $credit ||= sprintf( "<DEL>- $money_char\%.2f</DEL>", +% $item->{'void_credit'} +% ) +% if exists($item->{'void_credit'}); +% % my $refund = exists($item->{'refund'}) % ? sprintf("$money_char\%.2f", $item->{'refund'}) % : ''; @@ -469,6 +474,15 @@ foreach my $cust_pay_void ($cust_main->cust_pay_void) { } +#voided credits +foreach my $cust_credit_void ($cust_main->cust_credit_void) { + push @history, { + 'date' => $cust_credit_void->_date, + 'desc' => include('payment_history/voided_credit.html', $cust_credit_void, %opt ), + 'void_credit' => $cust_credit_void->amount, + }; +} + #declined payments foreach my $cust_pay_pending ($cust_main->cust_pay_pending_attempt) { push @history, { diff --git a/httemplate/view/cust_main/payment_history/voided_credit.html b/httemplate/view/cust_main/payment_history/voided_credit.html new file mode 100644 index 000000000..0723a7282 --- /dev/null +++ b/httemplate/view/cust_main/payment_history/voided_credit.html @@ -0,0 +1,25 @@ +<DEL><% emt("Credit by [_1]", $cust_credit_void->otaker, $reason ) %>\ +<% $reason |h %></DEL> +<I> +<% emt("voided [_1]", time2str($date_format, $cust_credit_void->void_date) )%> +% my $void_user = $cust_credit_void->void_access_user; +% if ($void_user) { +<% emt('by [_1]', $void_user->username) %> +% } +<% $void_reason |h %> +</I> +<%init> + +my( $cust_credit_void, %opt ) = @_; + +my $date_format = $opt{'date_format'} || '%m/%d/%Y'; + +my $curuser = $FS::CurrentUser::CurrentUser; + +#my $unvoid = ''; # not yet available +my $reason = $cust_credit_void->reason; +$reason = " ($reason)" if $reason; + +my $void_reason = $cust_credit_void->void_reason; +$void_reason = " ($void_reason)" if $void_reason; +</%init> |
