X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fcustomer-table.html;h=9968ee9aa81ee3e142e1a000b265114a62378cbb;hb=c7bf005860b761a55ca075df987fb3b5ade8c242;hp=f00419f9c5e9563c9acb2928c2e6c35045437af5;hpb=b8d03e480cf0798c30d6d8e9ec6cf53d8f419043;p=freeside.git
diff --git a/httemplate/elements/customer-table.html b/httemplate/elements/customer-table.html
index f00419f9c..9968ee9aa 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,28 @@ Example:
>
% } elsif ($types->[$col] eq 'immutable') {
<% $font %><% $value %><% $font ? '' : '' %>
-
+
% } else {
Cannot represent unknown type: <% $types->[$col] %>
% }
|
% $col++;
% }
-
+
+ <% $money_char %>
+
+
+
+ |
% }
-
+ |
Total <% $row ? $row-1 : 0 %>
<% PL($opt{name_singular} || 'customer', ( $row ? $row-1 : 0 ) ) %>
|
@@ -383,7 +565,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 +582,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 +612,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 +648,18 @@ Example:
customer_cell.appendChild(customer_select);
row.appendChild(customer_cell);
+
+ var balance_cell = document.createElement('TD');
+ balance_cell.style.textAlign = 'right';
+ balance_cell.innerHTML = '<% $money_char %>';
+
+ 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 +722,7 @@ Example:
<%init>
my(%opt) = @_;
+my $conf = new FS::Conf;
$opt{prefix} = '' unless defined $opt{prefix};
$opt{prefix} .= '_' if $opt{prefix};
@@ -521,4 +743,6 @@ my %align = (
'c' => 'center',
);
+my $money_char = $conf->config('money_char') || '$';
+
%init>