X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fpackages%2Fpackage.html;h=c65263df35edaa3ec97c8ff9ca3bc658e4e20bd4;hb=24389dff37b486ed4f0281bd50a3ff1ee77ae74d;hp=078402b7aae492814d91147846f842dbdf76aaca;hpb=43b1f73646063b4614ce8701f7e4755920c7eff2;p=freeside.git

diff --git a/httemplate/view/cust_main/packages/package.html b/httemplate/view/cust_main/packages/package.html
index 078402b7a..c65263df3 100644
--- a/httemplate/view/cust_main/packages/package.html
+++ b/httemplate/view/cust_main/packages/package.html
@@ -51,8 +51,15 @@
 %           # One-time charge.  Nothing you can do with this, unless:
 %           if ( $curuser->access_right('Modify one-time charge') ) {
                 (&nbsp;<%onetime_change_link($cust_pkg)%>&nbsp;)
-                <BR>
 %           }
+%           # also, you can discount it
+%           if ( $curuser->access_right('Discount customer package')
+%                && ! scalar($cust_pkg->cust_pkg_discount_active)
+%                && ! scalar($cust_pkg->part_pkg->part_pkg_discount)
+%              ) {
+              (&nbsp;<%pkg_discount_link($cust_pkg)%>&nbsp;)
+%           }
+          <BR>
 %
 %         } elsif ( !$cust_pkg->get('cancel') and !$opt{no_links} ) {
 %           
@@ -65,6 +72,7 @@
 %             if ( $curuser->access_right('Edit customer package dates') ) {
                 (&nbsp;<%pkg_dates_link($cust_pkg)%>&nbsp;)
 %             }
+%
 %           } else {
 %             # the usual case: links to change package definition,
 %             # discount, and customization
@@ -74,7 +82,7 @@
                 (&nbsp;<%pkg_change_link($cust_pkg)%>&nbsp;)
 %             } 
 %
-%             if ( $curuser->access_right('Edit customer package dates') ) {
+%             if ( $curuser->access_right('Edit customer package dates') or $curuser->access_right('Change package contract end date') ) {
 %               $br=1;
                 (&nbsp;<%pkg_dates_link($cust_pkg)%>&nbsp;)
 %             } 
@@ -82,7 +90,9 @@
 %             if ( $curuser->access_right('Discount customer package')
 %                  && $part_pkg->can_discount
 %                  && ! scalar( @{ $cust_pkg->{_cust_pkg_discount_active} } )
-%                  && ! scalar($cust_pkg->part_pkg->part_pkg_discount)
+%                  && (    ! $opt{'term_discounts'}
+%                       || ! scalar($cust_pkg->part_pkg->part_pkg_discount)
+%                     )
 %                )
 %             {
 %               $br=1;
@@ -100,7 +110,7 @@
 %           if (    (    $curuser->access_right('Billing event reports')
 %                     || $curuser->access_right('View customer billing events')
 %                   )
-%                && $cust_pkg->num_cust_event
+%                && $cust_pkg->exists_cust_event
 %              ) {
               (&nbsp;<%pkg_event_link($cust_pkg)%>&nbsp;)
 %           }
@@ -273,7 +283,7 @@
 
 % if ( @cust_pkg_usage ) {
   <TABLE CLASS="usage inv">
-    <TR><TH COLSPAN=4><% mt('Included usage') %></TH></TR>
+    <TR><TH COLSPAN=4><% emt('Included usage') %></TH></TR>
 %   foreach my $usage (@cust_pkg_usage) {
 %     my $part = $usage->part_pkg_usage;
 %     my $ratio = 255 * ($usage->minutes / $part->minutes);
@@ -283,7 +293,7 @@
 %     $trstyle = ' CLASS="shared"' if $part->shared;
     <TR<%$trstyle%>>
       <TD ALIGN="right"><% $part->description %>: </TD>
-      <TD <%$color%> ALIGN="right"><% $usage->minutes %></TD>
+      <TD <%$color%> ALIGN="right"><% sprintf('%.1f', $usage->minutes) %></TD>
       <TD <%$color%>> / </TD>
       <TD <%$color%>><% $part->minutes %></TD>
 %     if ( $part->shared ) {
@@ -367,7 +377,7 @@ sub onetime_change_link {
     'actionlabel' => emt('Modify'),
     'cust_pkg'    => $cust_pkg,
     'width'       => 690,
-    'height'      => 380,
+    'height'      => 440,
   );
 }