From: Ivan Kohler Date: Wed, 23 Apr 2014 07:14:10 +0000 (-0700) Subject: Merge branch 'master' of git.freeside.biz:/home/git/freeside X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=7ff73ebf72cb30c9e9b8135038c30832d8f9188b;hp=-c Merge branch 'master' of git.freeside.biz:/home/git/freeside --- 7ff73ebf72cb30c9e9b8135038c30832d8f9188b diff --combined FS/FS/Schema.pm index ab69410ef,49e8bd7e2..ae43b6061 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@@ -2232,7 -2232,7 +2232,7 @@@ sub tables_hashref 'pkgnum', 'int', 'NULL', '', '', '', #desired pkgnum for pkg-balances 'status', 'varchar', '', $char_d, '', '', - 'session_id', 'varchar', 'NULL', $char_d, '', '', #only need 32 + 'session_id', 'varchar', 'NULL', 1024, '', '', # SHA-512-hex 'statustext', 'text', 'NULL', '', '', '', 'gatewaynum', 'int', 'NULL', '', '', '', #'cust_balance', @money_type, '', '', @@@ -4500,7 -4500,6 +4500,7 @@@ 'rssi', 'int', 'NULL', '', '', '', 'suid', 'int', 'NULL', '', '', '', 'shared_svcnum', 'int', 'NULL', '', '', '', + 'serviceid', 'varchar', 'NULL', 64, '', '',#srvexport/reportfields ], 'primary_key' => 'svcnum', 'unique' => [ [ 'ip_addr' ], [ 'mac_addr' ] ], diff --combined FS/FS/agent.pm index fbfba9b4d,0bb7561da..721749956 --- a/FS/FS/agent.pm +++ b/FS/FS/agent.pm @@@ -44,49 -44,27 +44,49 @@@ from FS::Record. The following fields =over 4 -=item agentnum - primary key (assigned automatically for new agents) +=item agentnum -=item agent - Text name of this agent +primary key (assigned automatically for new agents) -=item typenum - Agent type (see L) +=item agent -=item ticketing_queueid - Ticketing Queue +Text name of this agent -=item invoice_template - Invoice template name +=item typenum -=item agent_custnum - Optional agent customer (see L) +Agent type (see L) -=item disabled - Disabled flag, empty or 'Y' +=item ticketing_queueid -=item prog - Deprecated (never used) +Ticketing Queue -=item freq - Deprecated (never used) +=item invoice_template -=item username - (Deprecated) Username for the Agent interface +Invoice template name -=item _password - (Deprecated) Password for the Agent interface +=item agent_custnum + +Optional agent customer (see L) + +=item disabled + +Disabled flag, empty or 'Y' + +=item prog + +Deprecated (never used) + +=item freq + +Deprecated (never used) + +=item username + +(Deprecated) Username for the Agent interface + +=item _password + +(Deprecated) Password for the Agent interface =back @@@ -147,7 -125,6 +147,7 @@@ sub check || $self->ut_textn('prog') || $self->ut_textn('invoice_template') || $self->ut_foreign_keyn('agent_custnum', 'cust_main', 'custnum' ) + || $self->ut_numbern('ticketing_queueid') ; return $error if $error; @@@ -232,7 -209,7 +232,7 @@@ field, or the empty string sub ticketing_queue { my $self = shift; FS::TicketSystem->queue($self->ticketing_queueid); -}; +} =item payment_gateway [ OPTION => VALUE, ... ] @@@ -271,8 -248,27 +271,27 @@@ sub payment_gateway # seeing the card number my $gatewaynum = $conf->config('selfservice-payment_gateway', $self->agentnum); - my $gateway = FS::payment_gateway->by_key($gatewaynum) - if $gatewaynum; + my $gateway; + $gateway = FS::payment_gateway->by_key($gatewaynum) if $gatewaynum; + return $gateway if $gateway; + + # a little less kludgey than the above, and allows PayPal to coexist + # with credit card gateways + my $is_paypal = { op => '!=', value => 'PayPal' }; + if ( uc($options{method}) eq 'PAYPAL' ) { + $is_paypal = 'PayPal'; + } + + $gateway = qsearchs({ + table => 'payment_gateway', + addl_from => ' JOIN agent_payment_gateway USING (gatewaynum) ', + hashref => { + gateway_namespace => 'Business::OnlineThirdPartyPayment', + gateway_module => $is_paypal, + disabled => '', + }, + extra_sql => ' AND agentnum = '.$self->agentnum, + }); if ( $gateway ) { return $gateway;