X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fpackages%2Fpackage.html;h=d0fc182cbc76dc6c54a6a4ea675c3dc2018ec0f7;hb=c6782ab85ea83e0c78d85b8975985aac9d467f9d;hp=3a362b6fa987aabf07ae92681526eeb9d509545f;hpb=b70b0d8c6f571a68ffb60c5ca728a230926abee4;p=freeside.git
diff --git a/httemplate/view/cust_main/packages/package.html b/httemplate/view/cust_main/packages/package.html
index 3a362b6fa..d0fc182cb 100644
--- a/httemplate/view/cust_main/packages/package.html
+++ b/httemplate/view/cust_main/packages/package.html
@@ -190,6 +190,28 @@
% }
% }
+% if ( @cust_pkg_usage ) {
+
+ <% mt('Included usage') %> |
+% foreach my $usage (@cust_pkg_usage) {
+% my $part = $usage->part_pkg_usage;
+% my $ratio = 255 * ($usage->minutes / $part->minutes);
+% $ratio = 255 if $ratio > 255; # because rollover
+% my $color = sprintf('STYLE="font-weight: bold; color: #%02x%02x00"', 255 - $ratio, $ratio);
+% my $trstyle = '';
+% $trstyle = ' CLASS="shared"' if $part->shared;
+ >
+ <% $part->description %>: |
+ ALIGN="right"><% $usage->minutes %> |
+ > / |
+ ><% $part->minutes %> |
+% if ( $part->shared ) {
+ (shared) |
+% }
+
+% }
+
+% }
@@ -208,6 +230,17 @@ my $statedefault = $opt{'statedefault'}
|| ($countrydefault eq 'US' ? 'CA' : '');
my $supplemental = $opt{'supplemental'} || 0;
+
+$cust_pkg->pkgnum =~ /^(\d+)$/;
+my $pkgnum = $1;
+my @cust_pkg_usage = qsearch({
+ 'select' => 'cust_pkg_usage.*',
+ 'table' => 'cust_pkg_usage',
+ 'addl_from' => ' JOIN part_pkg_usage USING (pkgusagepart)',
+ 'extra_sql' => " WHERE pkgnum = $1",
+ 'order_by' => ' ORDER BY priority ASC, description ASC',
+});
+
#subroutines
#false laziness w/status.html