agent-virtualize credit card surcharge percentage, RT#72961
[freeside.git] / FS / FS / part_event / Action / pkg_employee_credit.pm
index 64dd8b2..838d175 100644 (file)
@@ -1,7 +1,8 @@
 package FS::part_event::Action::pkg_employee_credit;
 
 use strict;
-use base qw( FS::part_event::Action::pkg_referral_credit );
+use base qw( FS::part_event::Action::Mixin::credit_flat
+             FS::part_event::Action );
 
 sub description { 'Credit the ordering employee a specific amount'; }
 
@@ -18,8 +19,9 @@ sub do_action {
   my $employee_cust_main = $employee->user_cust_main;
     #? or return "No customer record for employee ". $employee->username;
 
-  my $amount    = $self->_calc_credit($cust_pkg);
-  return '' unless $amount > 0;
+  my $warning = '';
+  my $amount    = $self->_calc_credit($cust_pkg, $employee, \$warning);
+  return $warning unless $amount > 0;
 
   my $reasonnum = $self->option('reasonnum');