<% include('elements/edit.html',
'name_singular' => 'prospect',
'table' => 'prospect_main',
<% include('elements/edit.html',
'name_singular' => 'prospect',
'table' => 'prospect_main',
'company' => 'Company',
'contactnum' => 'Contact',
'locationnum' => ' ',
'company' => 'Company',
'contactnum' => 'Contact',
'locationnum' => ' ',
},
'fields' => [
{ 'field' => 'agentnum',
'type' => 'select-agent',
'empty_label' => 'Select agent',
},
'fields' => [
{ 'field' => 'agentnum',
'type' => 'select-agent',
'empty_label' => 'Select agent',
- 'colspan' => 6,
- 'o2m_table' => 'contact',
- 'm2_label' => 'Contact',
+ 'colspan' => 7,
+ 'prospectnum' => $prospectnum,
+ 'm2m_method' => 'prospect_contact',
+ 'm2m_dstcol' => 'contactnum',
+ 'm2_label' => 'Contact',
},
{ 'field' => 'locationnum',
'type' => 'select-cust_location',
'empty_label' => 'No address',
'disable_empty' => $conf->exists('prospect_main-location_required'),
'alt_format' => $conf->exists('prospect_main-alt_address_format'),
},
{ 'field' => 'locationnum',
'type' => 'select-cust_location',
'empty_label' => 'No address',
'disable_empty' => $conf->exists('prospect_main-location_required'),
'alt_format' => $conf->exists('prospect_main-alt_address_format'),
+ 'include_opt_callback' => sub {
+ 'prospect_main' => shift
+ },
+ },
+ { 'field' => 'taxstatusnum',
+ 'type' => 'select-tax_status',
+ 'required' => 1,
+ 'empty_label' => ' ',
die "access denied"
unless $curuser->access_right(($prospectnum ? 'Edit' : 'New'). ' prospect');
} elsif ( $cgi->keywords ) { #editing
die "access denied"
unless $curuser->access_right(($prospectnum ? 'Edit' : 'New'). ' prospect');
} elsif ( $cgi->keywords ) { #editing