diff options
author | ivan <ivan> | 2005-06-09 05:34:07 +0000 |
---|---|---|
committer | ivan <ivan> | 2005-06-09 05:34:07 +0000 |
commit | 6cd950830fa622fa6cbe87895dc58fb1c9868eef (patch) | |
tree | 96b3a6bdc655222efc80dd2ff77226cf943195cd /httemplate/edit/part_bill_event.cgi | |
parent | c6c8e2d15723eb0aed516664025b9bd9d57a2528 (diff) |
add multiple agent selection to agent-specific invoicing
Diffstat (limited to 'httemplate/edit/part_bill_event.cgi')
-rwxr-xr-x | httemplate/edit/part_bill_event.cgi | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/httemplate/edit/part_bill_event.cgi b/httemplate/edit/part_bill_event.cgi index 99bc2609f..06bdaf647 100755 --- a/httemplate/edit/part_bill_event.cgi +++ b/httemplate/edit/part_bill_event.cgi @@ -83,11 +83,12 @@ sub select_pkgpart { sub select_agentnum { my $plandata = shift; - my $agentnum = $plandata->{'agentnum'}; - '<SELECT NAME="agentnum">'. + #my $agentnum = $plandata->{'agentnum'}; + my %agentnums = map { $_=>1 } split(/,\s*/, $plandata->{'agentnum'}); + '<SELECT NAME="agentnum" MULTIPLE>'. join("\n", map { '<OPTION VALUE="'. $_->agentnum. '"'. - ( $_->agentnum == $agentnum ? ' SELECTED' : '' ). + ( $agentnums{$_->agentnum} ? ' SELECTED' : '' ). '>'. $_->agent } qsearch('agent', { 'disabled' => '' } ) ). '</SELECT>'; @@ -187,11 +188,11 @@ tie my %events, 'Tie::IxHash', 'send_agent' => { 'name' => 'Send invoice (email/print) ', - 'code' => '$cust_bill->send(\'%%%agent_templatename%%%\', %%%agentnum%%%, \'%%%agent_invoice_from%%%\');', + 'code' => '$cust_bill->send(\'%%%agent_templatename%%%\', [ %%%agentnum%%% ], \'%%%agent_invoice_from%%%\');', 'html' => sub { '<TABLE BORDER=0> <TR> - <TD ALIGN="right">only for agent </TD> + <TD ALIGN="right">only for agent(s) </TD> <TD>'. &select_agentnum(@_). '</TD> </TR> <TR> |