summaryrefslogtreecommitdiff
path: root/FS/FS/part_event/Condition/pkg_notchange.pm
blob: 4c103c22dce8838d1b767542f06e86c3f3c825ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package FS::part_event::Condition::pkg_notchange;

use strict;

use base qw( FS::part_event::Condition );
use FS::Record qw( qsearch );

sub description {
  'Package is a new order, not a change';
}

sub eventtable_hashref {
    { 'cust_main' => 0,
      'cust_bill' => 0,
      'cust_pkg'  => 1,
    };
}

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

  ! $cust_pkg->change_date;

}

sub condition_sql {
  '( cust_pkg.change_date IS NULL OR cust_pkg.change_date = 0 )';
}

1;