X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fsearch-cust_main.html;h=ef0d22ced9f37a750f434cf91347aed3847f74da;hb=7a7bcda9d75c951df9c911ce60d5b0551765daf2;hp=f2b17eacb5e500e1ad4fdea298347f7e52a1626c;hpb=c648976f0b7975f2328ebd7ba8c711fad0ca4195;p=freeside.git
diff --git a/httemplate/elements/search-cust_main.html b/httemplate/elements/search-cust_main.html
index f2b17eacb..ef0d22ced 100644
--- a/httemplate/elements/search-cust_main.html
+++ b/httemplate/elements/search-cust_main.html
@@ -1,23 +1,36 @@
-%
-% my( %opt ) = @_;
-% $opt{'field_name'} ||= 'custnum';
-%
-% my $cust_main = '';
-% if ( $opt{'value'} ) {
-% $cust_main = qsearchs(
-% 'table' => 'cust_main',
-% 'hashref' => { 'custnum' => $opt{'value'} },
-% 'extra_sql' => " AND ". $FS::CurrentUser::CurrentUser->agentnums_sql,
-% );
-% }
-%
-
-
-
+<%doc>
+
+Example:
+
+ include( '/elements/search-cust_main.html,
+ 'field_name' => 'custnum',
+ 'find_button' => 1, #add a "find" button to the field
+ 'curr_value' => 54, #current value
+ 'value => 32, #deprecated synonym for curr_value
+ );
+
+%doc>
+
-
+
+
+% if ( $opt{'find_button'} ) {
+
+% }
@@ -161,4 +174,20 @@
}
+<%init>
+
+my( %opt ) = @_;
+$opt{'field_name'} ||= 'custnum';
+
+my $value = $opt{'curr_value'} || $opt{'value'};
+
+my $cust_main = '';
+if ( $value ) {
+ $cust_main = qsearchs({
+ 'table' => 'cust_main',
+ 'hashref' => { 'custnum' => $value },
+ 'extra_sql' => " AND ". $FS::CurrentUser::CurrentUser->agentnums_sql,
+ });
+}
+%init>