[freeside-commits] freeside/FS/FS/part_event/Action cancel.pm, 1.2, 1.2.8.1 pkg_cancel.pm, NONE, 1.1.2.2

Mark Wells mark at wavetail.420.am
Sun Nov 21 17:30:18 PST 2010


Update of /home/cvs/cvsroot/freeside/FS/FS/part_event/Action
In directory wavetail.420.am:/tmp/cvs-serv9377/FS/FS/part_event/Action

Modified Files:
      Tag: FREESIDE_2_1_BRANCH
	cancel.pm 
Added Files:
      Tag: FREESIDE_2_1_BRANCH
	pkg_cancel.pm 
Log Message:
pkg_cancel event action, RT#10141

Index: cancel.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_event/Action/cancel.pm,v
retrieving revision 1.2
retrieving revision 1.2.8.1
diff -u -w -d -r1.2 -r1.2.8.1
--- cancel.pm	22 Nov 2008 22:17:27 -0000	1.2
+++ cancel.pm	22 Nov 2010 01:30:16 -0000	1.2.8.1
@@ -3,7 +3,7 @@
 use strict;
 use base qw( FS::part_event::Action );
 
-sub description { 'Cancel'; }
+sub description { 'Cancel all of this customer\'s packages'; }
 
 sub option_fields {
   ( 

--- NEW FILE: pkg_cancel.pm ---
package FS::part_event::Action::pkg_cancel;

use strict;
use base qw( FS::part_event::Action );

sub description { 'Cancel this package'; }

sub eventtable_hashref {
  { 'cust_pkg' => 1 };
}

sub option_fields {
  ( 
    'reasonnum' => { 'label'        => 'Reason',
                     'type'         => 'select-reason',
                     'reason_class' => 'C',
                   },
  );
}

sub default_weight { 20; }

sub do_action {
  my( $self, $cust_pkg, $cust_event ) = @_;

  my $error = $cust_pkg->cancel( 'reason' => $self->option('reasonnum') );
  die $error if $error;
  
  '';
}

1;



More information about the freeside-commits mailing list