diff options
| author | Ivan Kohler <ivan@freeside.biz> | 2013-03-02 23:36:31 -0800 |
|---|---|---|
| committer | Ivan Kohler <ivan@freeside.biz> | 2013-03-02 23:36:31 -0800 |
| commit | c6782ab85ea83e0c78d85b8975985aac9d467f9d (patch) | |
| tree | 1787389347daff9e32be8325ddf1c5e423f73163 /httemplate/view | |
| parent | 854299338fd5d9f231f47202ef1b37c46f1d1d6c (diff) | |
| parent | 6c063e24b90cd374623e2841045fe4c61bed8143 (diff) | |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'httemplate/view')
| -rwxr-xr-x | httemplate/view/cust_main/packages.html | 9 | ||||
| -rw-r--r-- | httemplate/view/cust_main/packages/package.html | 33 |
2 files changed, 42 insertions, 0 deletions
diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html index da4d587f2..24a12cc46 100755 --- a/httemplate/view/cust_main/packages.html +++ b/httemplate/view/cust_main/packages.html @@ -11,6 +11,15 @@ table.package { border-spacing: 0; width: 100%; } +table.usage { + border: 1px solid black; + margin: auto; + width: 60%; + border-spacing: 0px; +} +.shared > * { + background-color: #ffffaa; +} .row0 { background-color: #eeeeee; } .row1 { background-color: #ffffff; } 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 @@ % } % } </TABLE> +% if ( @cust_pkg_usage ) { + <TABLE CLASS="usage inv"> + <TR><TH COLSPAN=4><% mt('Included usage') %></TH></TR> +% 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; + <TR<%$trstyle%>> + <TD ALIGN="right"><% $part->description %>: </TD> + <TD <%$color%> ALIGN="right"><% $usage->minutes %></TD> + <TD <%$color%>> / </TD> + <TD <%$color%>><% $part->minutes %></TD> +% if ( $part->shared ) { + <TD><I>(shared)</I></TD> +% } + </TR> +% } + </TABLE> +% } </TD> @@ -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 |
