From: ivan Date: Tue, 6 May 2008 01:14:39 +0000 (+0000) Subject: agent-virtualize quick payment entry X-Git-Tag: root_of_webpay_support~667 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=1b19010429786e0a2987573dc9dbff351091911e agent-virtualize quick payment entry --- diff --git a/httemplate/elements/customer-table.html b/httemplate/elements/customer-table.html new file mode 100644 index 000000000..fc298b03e --- /dev/null +++ b/httemplate/elements/customer-table.html @@ -0,0 +1,387 @@ +% # options example... +% # +% # #listrefs... +% # 'header' => [ '#', 'Item' ], +% # 'fields' => [ +% # 'column', +% # sub { my ($row,$param) = @_; $param->{"column$row"}; }, +% # ], +% # 'sizes' => [], # sizes ignored for immutable +% # 'types' => ['immutable', ''], # immutable or ''/text +% # 'param' => { column0 => 1 }, # preset column of row 0 to 1 +% # + + + + + + + + +% foreach my $header ( @{$opt{header}} ) { + +% } + +% my $row = 0; +% for ( $row = 0; exists($param->{"custnum$row"}); $row++ ) { + + + + + + + +% my $col = 0; +% foreach my $field ( @{$opt{fields}} ) { +% my $value; +% if ( ref($field) eq 'CODE' ) { +% $value = &{$field}($row,$param); +% } else { +% $value = $param->{"$field$row"}; +% } +% my $name = (ref($field) eq 'CODE') ? "column${col}_$row" : "$field$row"; +% my $size = $sizes->[$col] || 10; + +% $col++; +% } + + +% } + + +
Cust #Customer<% $header %>
+ " rownum="<% $row %>"> + + + " rownum="<% $row %>"> + + + + +% if (! $types->[$col] || $types->[$col] eq 'text') { + +% } elsif ($types->[$col] eq 'immutable') { + <% $value %> + +% } else { + Cannot represent unknown type: <% $types->[$col] %> +% } +
+ +<% include('/elements/xmlhttp.html', + 'url' => $p. 'misc/xmlhttp-cust_main-search.cgi', + 'subs' => [qw( custnum_search smart_search )], + ) +%> + + + +<%init> + +my(%opt) = @_; + +$opt{prefix} = '' unless defined $opt{prefix}; +$opt{prefix} .= '_' if $opt{prefix}; + +my $types = $opt{'types'} ? [ @{$opt{'types'}} ] : []; +my $sizes = $opt{'sizes'} ? [ @{$opt{'sizes'}} ] : []; + +my $param = $opt{param}; +$param = $cgi->Vars if $cgi->param('error'); + + diff --git a/httemplate/misc/batch-cust_pay.html b/httemplate/misc/batch-cust_pay.html index 84889399d..c0b9068be 100644 --- a/httemplate/misc/batch-cust_pay.html +++ b/httemplate/misc/batch-cust_pay.html @@ -6,13 +6,14 @@ -<% include( "elements/customer-table.html", - header => [ '', 'Amount', 'Check #', '' ], - fields => [ sub {'$'}, 'paid', 'payinfo', 'error', ], - types => [ 'immutable', '', '', 'immutable', ], - sizes => [ 0, 8, 10, 0, ], - param => { () }, - ) %> +<% include( "/elements/customer-table.html", + header => [ '', 'Amount', 'Check #', '' ], + fields => [ sub {'$'}, 'paid', 'payinfo', 'error', ], + types => [ 'immutable', '', '', 'immutable', ], + sizes => [ 0, 8, 10, 0, ], + param => { () }, + ) +%> diff --git a/httemplate/misc/elements/customer-table.html b/httemplate/misc/elements/customer-table.html deleted file mode 100644 index fc298b03e..000000000 --- a/httemplate/misc/elements/customer-table.html +++ /dev/null @@ -1,387 +0,0 @@ -% # options example... -% # -% # #listrefs... -% # 'header' => [ '#', 'Item' ], -% # 'fields' => [ -% # 'column', -% # sub { my ($row,$param) = @_; $param->{"column$row"}; }, -% # ], -% # 'sizes' => [], # sizes ignored for immutable -% # 'types' => ['immutable', ''], # immutable or ''/text -% # 'param' => { column0 => 1 }, # preset column of row 0 to 1 -% # - - - - - - - - -% foreach my $header ( @{$opt{header}} ) { - -% } - -% my $row = 0; -% for ( $row = 0; exists($param->{"custnum$row"}); $row++ ) { - - - - - - - -% my $col = 0; -% foreach my $field ( @{$opt{fields}} ) { -% my $value; -% if ( ref($field) eq 'CODE' ) { -% $value = &{$field}($row,$param); -% } else { -% $value = $param->{"$field$row"}; -% } -% my $name = (ref($field) eq 'CODE') ? "column${col}_$row" : "$field$row"; -% my $size = $sizes->[$col] || 10; - -% $col++; -% } - - -% } - - -
Cust #Customer<% $header %>
- " rownum="<% $row %>"> - - - " rownum="<% $row %>"> - - - - -% if (! $types->[$col] || $types->[$col] eq 'text') { - -% } elsif ($types->[$col] eq 'immutable') { - <% $value %> - -% } else { - Cannot represent unknown type: <% $types->[$col] %> -% } -
- -<% include('/elements/xmlhttp.html', - 'url' => $p. 'misc/xmlhttp-cust_main-search.cgi', - 'subs' => [qw( custnum_search smart_search )], - ) -%> - - - -<%init> - -my(%opt) = @_; - -$opt{prefix} = '' unless defined $opt{prefix}; -$opt{prefix} .= '_' if $opt{prefix}; - -my $types = $opt{'types'} ? [ @{$opt{'types'}} ] : []; -my $sizes = $opt{'sizes'} ? [ @{$opt{'sizes'}} ] : []; - -my $param = $opt{param}; -$param = $cgi->Vars if $cgi->param('error'); - -