X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fcustomer-table.html;h=090623ff90d0844ca5b5dac29280d46cfd05ca46;hb=1115b9089e9d9ecf104bc61bb22e84f5233aa44b;hp=aa085c41aa3994482c4bda2cb03b77ce3337c003;hpb=ce639adb2033f14b0bb6ef27354e2574dfc55ab7;p=freeside.git
diff --git a/httemplate/elements/customer-table.html b/httemplate/elements/customer-table.html
index aa085c41a..090623ff9 100644
--- a/httemplate/elements/customer-table.html
+++ b/httemplate/elements/customer-table.html
@@ -41,6 +41,8 @@ Example:
+ function update_status_text(rownum, newval) {
+ document.getElementById('status'+rownum).value = newval;
+ document.getElementById('status'+rownum+'_text').innerHTML = newval;
+ }
-
+ var <% $opt{prefix} %>total_el, <% $opt{prefix} %>rownum, <% $opt{prefix} %>totalrows, <% $opt{prefix} %>allrows;
+
+ function <% $opt{prefix} %>addDeleteButton (searchrow) {
+ var td_delete = document.getElementById('delete'+searchrow);
+ var button_delete = document.createElement('INPUT');
+ button_delete.setAttribute('rownum', searchrow);
+ button_delete.setAttribute('type', 'button');
+ button_delete.setAttribute('value', 'X');
+ button_delete.onclick = <% $opt{prefix} %>deleteRow;
+ button_delete.style.color = '#ff0000';
+ button_delete.style.fontWeight = 'bold';
+ button_delete.style.paddingLeft = '2px';
+ button_delete.style.paddingRight = '2px';
+ td_delete.appendChild(button_delete);
+ }
-
-
-<% include('/elements/xmlhttp.html',
- 'url' => $p. 'misc/xmlhttp-cust_main-search.cgi',
- 'subs' => [qw( custnum_search smart_search invnum_search )],
- )
-%>
-
-
+
+
+
+
+ Inv # |
+ Cust # |
+ Status |
+ Customer |
+ Balance |
+% foreach my $header ( @{$opt{header}} ) {
+ <% $header %> |
+% }
+
+
+% my @rownums = sort { $a <=> $b } map /^custnum(\d+)$/, keys %$param;
+
+
+ Total <% @rownums || 0 %>
+ <% PL($opt{name_singular} || 'customer', ( @rownums || 0 ) ) %>
+ |
+% my $col = 0;
+% foreach my $footer ( @{$opt{footer}} ) {
+% my $align = $align{ $opt{'footer_align'}->[$col] || 'c' };
+% if ($footer eq '_TOTAL' ) {
+% my $id = $opt{'fields'}->[$col];
+% $id = ref($id) ? "column${col}_TOTAL" : "${id}_TOTAL";
+ <% sprintf('%.2f', $total[$col] ) %> |
+% } else {
+ <% $footer %> |
+% }
+% $col++;
+% }
+
+
+
+
+
+<% include('/elements/xmlhttp.html',
+ 'url' => $p. 'misc/xmlhttp-cust_main-search.cgi',
+ 'subs' => [qw( custnum_search smart_search invnum_search )],
+ )
+%>
+
<%init>
my(%opt) = @_;
my $conf = new FS::Conf;
+## caution when using prefix, it isn't consistently applied to tag id/name
$opt{prefix} = '' unless defined $opt{prefix};
$opt{prefix} .= '_' if $opt{prefix};
-my $types = $opt{'types'} ? [ @{$opt{'types'}} ] : [];
+my $types = $opt{'type'} ? [ @{$opt{'type'}} ] : [];
my $sizes = $opt{'size'} ? [ @{$opt{'size'}} ] : [];
my $param = $opt{param};
@@ -742,5 +796,4 @@ my %align = (
);
my $money_char = $conf->config('money_char') || '$';
-
%init>