optimize declined payment event condition, RT#81305
[freeside.git] / FS / FS / part_event / Condition / cust_pay_batch_declined.pm
index b3a8d70..8efb278 100644 (file)
@@ -16,36 +16,16 @@ sub eventtable_hashref {
     };
 }
 
-#sub option_fields {
-#  (
-#    'field'         => 'description',
-#
-#    'another_field' => { 'label'=>'Amount', 'type'=>'money', },
-#
-#    'third_field'   => { 'label'         => 'Types',
-#                         'type'          => 'checkbox-multiple',
-#                         'options'       => [ 'h', 's' ],
-#                         'option_labels' => { 'h' => 'Happy',
-#                                              's' => 'Sad',
-#                                            },
-#  );
-#}
-
 sub condition {
   my($self, $cust_pay_batch, %opt) = @_;
 
-  #my $cust_main = $self->cust_main($object);
-  #my $value_of_field = $self->option('field');
-  #my $time = $opt{'time'}; #use this instead of time or $^T
-
   $cust_pay_batch->status =~ /Declined/i;
-
 }
 
-#sub condition_sql {
-#  my( $class, $table ) = @_;
-#  #...
-#  'true';
-#}
+sub condition_sql {
+  my( $class, $table ) = @_;
+
+  "(cust_pay_batch.status IS NOT NULL AND cust_pay_batch.status = 'Declined')";
+}
 
 1;