[freeside-commits] freeside/httemplate/elements tr-select-cust_pkg-balances.html, NONE, 1.1 select-cust_pkg-balances.html, NONE, 1.1
Ivan,,,
ivan at wavetail.420.am
Wed Jul 29 23:42:34 PDT 2009
Update of /home/cvs/cvsroot/freeside/httemplate/elements
In directory wavetail.420.am:/tmp/cvs-serv30734/httemplate/elements
Added Files:
tr-select-cust_pkg-balances.html select-cust_pkg-balances.html
Log Message:
experimental package balances, RT#4339
--- NEW FILE: select-cust_pkg-balances.html ---
<SELECT NAME="pkgnum">
<OPTION VALUE="">(any)
% foreach my $cust_pkg (@cust_pkg) {
% my $sel = ( $cgi->param('pkgnum') == $cust_pkg->pkgnum ) ? 'SELECTED' : '';
<OPTION <% $sel %> VALUE="<% $cust_pkg->pkgnum %>"><% $cust_pkg->pkg_label_long |h %>
% }
</SELECT>
<%init>
my %opt = @_;
my @cust_pkg;
if ( $opt{'cust_pkg'} ) {
@cust_pkg = @{ $opt{'cust_pkg'} };
} else {
my $custnum = $opt{'custnum'};
my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } )
or die "unknown custnum $custnum\n";
@cust_pkg =
grep { ! $_->get('cancel') || $cust_main->balance_pkgnum($_->pkgnum) }
$cust_main->all_pkgs;
}
</%init>
--- NEW FILE: tr-select-cust_pkg-balances.html ---
% if ( scalar(@cust_pkg) == 0 ) {
<INPUT TYPE="hidden" NAME="pkgnum" VALUE="">
% } elsif ( scalar(@cust_pkg) == 1 ) {
<INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $cust_pkg[0]->pkgnum %>">
% } else {
<TR>
<TD ALIGN="right">For package</TD>
<TD COLSPAN=2>
<% include('select-cust_pkg-balances.html',
'cust_pkg' => \@cust_pkg,
'cgi' => $opt{'cgi'},
)
%>
</TD>
</TR>
% }
<%init>
my %opt = @_;
my $custnum = $opt{'custnum'};
my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } )
or die "unknown custnum $custnum\n";
my @cust_pkg =
grep { ! $_->get('cancel') || $cust_main->balance_pkgnum($_->pkgnum) }
$cust_main->all_pkgs;
</%init>
More information about the freeside-commits
mailing list