projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RT#37632: Credit card validation [saving from payment.cgi]
[freeside.git]
/
FS
/
FS
/
part_event
/
Action
/
Mixin
/
credit_agent_pkg_class.pm
diff --git
a/FS/FS/part_event/Action/Mixin/credit_agent_pkg_class.pm
b/FS/FS/part_event/Action/Mixin/credit_agent_pkg_class.pm
index
33aeadd
..
488132a
100644
(file)
--- a/
FS/FS/part_event/Action/Mixin/credit_agent_pkg_class.pm
+++ b/
FS/FS/part_event/Action/Mixin/credit_agent_pkg_class.pm
@@
-1,22
+1,17
@@
package FS::part_event::Action::Mixin::credit_agent_pkg_class;
package FS::part_event::Action::Mixin::credit_agent_pkg_class;
-use base qw( FS::part_event::Action::Mixin::credit_pkg );
+
+# calculates a credit percentage on a specific package for use with
+# credit_pkg or credit_bill, based on an agent's commission table
use strict;
use FS::Record qw(qsearchs);
use strict;
use FS::Record qw(qsearchs);
-sub option_fields {
- my $class = shift;
- my %option_fields = $class->SUPER::option_fields;
- delete $option_fields{'percent'};
- %option_fields;
-}
-
sub _calc_credit_percent {
sub _calc_credit_percent {
- my( $self, $cust_pkg ) = @_;
+ my( $self, $cust_pkg
, $agent
) = @_;
my $agent_pkg_class = qsearchs( 'agent_pkg_class', {
my $agent_pkg_class = qsearchs( 'agent_pkg_class', {
- 'agentnum' => $
self->cust_main($cust_pkg)
->agentnum,
- 'classnum' => $cust_pkg->classnum,
+ 'agentnum' => $
agent
->agentnum,
+ 'classnum' => $cust_pkg->
part_pkg->
classnum,
});
$agent_pkg_class ? $agent_pkg_class->commission_percent : 0;
});
$agent_pkg_class ? $agent_pkg_class->commission_percent : 0;