[freeside-commits] freeside/FS/FS/part_event/Action pkg_employee_credit.pm, NONE, 1.1
Ivan,,,
ivan at wavetail.420.am
Mon Mar 29 19:52:48 PDT 2010
- Previous message: [freeside-commits] freeside/FS/FS/part_event/Condition balance_age.pm, 1.3, 1.4 balance.pm, 1.2, 1.3 balance_under.pm, 1.2, 1.3 cust_bill_has_service.pm, 1.5, 1.6 cust_bill_owed.pm, 1.3, 1.4 cust_bill_owed_under.pm, 1.2, 1.3
- Next message: [freeside-commits] freeside/FS/FS/part_event/Action pkg_employee_credit.pm, NONE, 1.1.2.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/cvsroot/freeside/FS/FS/part_event/Action
In directory wavetail.420.am:/tmp/cvs-serv27532
Added Files:
pkg_employee_credit.pm
Log Message:
employee commissions, RT#6991
--- NEW FILE: pkg_employee_credit.pm ---
package FS::part_event::Action::pkg_employee_credit;
use strict;
use base qw( FS::part_event::Action::pkg_referral_credit );
sub description { 'Credit the ordering employee a specific amount'; }
#a little false laziness w/pkg_referral_credit
sub do_action {
my( $self, $cust_pkg ) = @_;
my $cust_main = $self->cust_main($cust_pkg);
my $employee = $cust_pkg->access_user;
return "No customer record for employee ". $employee->username
unless $employee->user_custnum;
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 $reasonnum = $self->option('reasonnum');
my $error = $employee_cust_main->credit(
$amount,
\$reasonnum,
'addlinfo' =>
'for customer #'. $cust_main->display_custnum. ': '.$cust_main->name,
);
die "Error crediting customer ". $employee_cust_main->custnum.
" for employee commission: $error"
if $error;
}
1;
- Previous message: [freeside-commits] freeside/FS/FS/part_event/Condition balance_age.pm, 1.3, 1.4 balance.pm, 1.2, 1.3 balance_under.pm, 1.2, 1.3 cust_bill_has_service.pm, 1.5, 1.6 cust_bill_owed.pm, 1.3, 1.4 cust_bill_owed_under.pm, 1.2, 1.3
- Next message: [freeside-commits] freeside/FS/FS/part_event/Action pkg_employee_credit.pm, NONE, 1.1.2.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the freeside-commits
mailing list