Emailing statements of accounts, RT#4860
[freeside.git] / FS / FS / part_event / Action / cust_statement.pm
diff --git a/FS/FS/part_event/Action/cust_statement.pm b/FS/FS/part_event/Action/cust_statement.pm
new file mode 100644 (file)
index 0000000..8d8f127
--- /dev/null
@@ -0,0 +1,38 @@
+package FS::part_event::Action::cust_statement;
+
+use strict;
+
+use base qw( FS::part_event::Action );
+
+use FS::cust_statement;
+
+sub description {
+  'Group invoices into an informational statement.';
+}
+
+sub eventtable_hashref {
+    { 'cust_main' => 1, };
+    { 'cust_pkg'  => 1, };
+}
+
+sub default_weight {
+  90;
+}
+
+sub do_action {
+  my( $self, $cust_main ) = @_;
+
+  #my( $self, $object ) = @_;
+  #my $cust_main = $self->cust_main($object);
+
+  my $cust_statement = new FS::cust_statement {
+    'custnum' => $cust_main->custnum
+  };
+  my $error = $cust_statement->insert;
+  die $error if $error;
+
+  '';
+
+}
+
+1;