X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fcustomer-table.html;h=aa085c41aa3994482c4bda2cb03b77ce3337c003;hb=b431ece7b4a71aa5771f44393da582692f668817;hp=f00419f9c5e9563c9acb2928c2e6c35045437af5;hpb=624b2d44625f69d71175c3348cae635d580c890b;p=freeside.git diff --git a/httemplate/elements/customer-table.html b/httemplate/elements/customer-table.html index f00419f9c..aa085c41a 100644 --- a/httemplate/elements/customer-table.html +++ b/httemplate/elements/customer-table.html @@ -22,6 +22,7 @@ Example: ### 'name_singular' => 'customer', #label + 'custnum_update_callback' => 'name_of_js_callback' #passed a rownum #listrefs 'types' => ['immutable', ''], # immutable or ''/text @@ -40,6 +41,15 @@ Example: + .onchange = <% $opt{prefix} %>search_custnum; + + + + + " rownum="<% $row %>"> @@ -314,19 +487,27 @@ Example: > % } elsif ($types->[$col] eq 'immutable') { <% $font %><% $value %><% $font ? '' : '' %> - + % } else { Cannot represent unknown type: <% $types->[$col] %> % } % $col++; % } - + + + +   + % } - + Total <% $row ? $row-1 : 0 %> <% PL($opt{name_singular} || 'customer', ( $row ? $row-1 : 0 ) ) %> @@ -383,7 +564,7 @@ Example: <% include('/elements/xmlhttp.html', 'url' => $p. 'misc/xmlhttp-cust_main-search.cgi', - 'subs' => [qw( custnum_search smart_search )], + 'subs' => [qw( custnum_search smart_search invnum_search )], ) %> @@ -400,6 +581,21 @@ Example: var tablebody = table.getElementsByTagName('tbody').item(0); var row = table.insertRow(rownum+1); + + var invnum_cell = document.createElement('TD'); + + var invnum_input = document.createElement('INPUT'); + invnum_input.setAttribute('name', 'invnum'+<% $opt{prefix} %>rownum); + invnum_input.setAttribute('id', 'invnum'+<% $opt{prefix} %>rownum); + invnum_input.style.textAlign = 'right'; + invnum_input.setAttribute('size', 8); + invnum_input.setAttribute('maxlength', 12); + invnum_input.setAttribute('rownum', <% $opt{prefix} %>rownum); + invnum_input.onfocus = clearhint_invnum; + invnum_input.onchange = <% $opt{prefix} %>search_invnum; + invnum_cell.appendChild(invnum_input); + + row.appendChild(invnum_cell); var custnum_cell = document.createElement('TD'); @@ -415,6 +611,18 @@ Example: custnum_cell.appendChild(custnum_input); row.appendChild(custnum_cell); + + var status_cell = document.createElement('TD'); + + var status_span = document.createElement('SPAN'); + status_span.setAttribute('name', 'status'+<% $opt{prefix} %>rownum); + status_span.setAttribute('id', 'status'+<% $opt{prefix} %>rownum); + status_span.style.textAlign = 'center'; + status_span.style.fontWeight = 'bold'; + status_span.setAttribute('rownum', <% $opt{prefix} %>rownum); + status_cell.appendChild(status_span); + + row.appendChild(status_cell); var customer_cell = document.createElement('TD'); @@ -439,6 +647,17 @@ Example: customer_cell.appendChild(customer_select); row.appendChild(customer_cell); + + var balance_cell = document.createElement('TD'); + balance_cell.style.textAlign = 'right'; + + var balance_span = document.createElement('SPAN'); + balance_span.setAttribute('name', 'balance'+<% $opt{prefix} %>rownum); + balance_span.setAttribute('id', 'balance'+<% $opt{prefix} %>rownum); + balance_span.setAttribute('rownum', <% $opt{prefix} %>rownum); + balance_cell.appendChild(balance_span); + + row.appendChild(balance_cell); % my $col = 0; % foreach my $field ( @{$opt{fields}} ) { @@ -501,6 +720,7 @@ Example: <%init> my(%opt) = @_; +my $conf = new FS::Conf; $opt{prefix} = '' unless defined $opt{prefix}; $opt{prefix} .= '_' if $opt{prefix}; @@ -521,4 +741,6 @@ my %align = ( 'c' => 'center', ); +my $money_char = $conf->config('money_char') || '$'; +