ACL for hardware class config, RT#85057
[freeside.git] / FS / FS / Cron / disable_quotation.pm
1 package FS::Cron::disable_quotation;
2
3 use vars qw( @ISA @EXPORT_OK );
4 use Exporter;
5 use FS::UID qw(dbh);
6 use FS::Conf;
7
8 @ISA = qw( Exporter );
9 @EXPORT_OK = qw( disable_quotation );
10
11 sub disable_quotation {
12     if ( my $days = FS::Conf->new->config( 'quotation_disable_after_days' ) ) {
13         my $sth = dbh->prepare(
14             "UPDATE quotation SET disabled = 'Y' WHERE _date < ?"
15         ) or die dbh->errstr;
16         $sth->execute( time - ( $days * 86400 ) ) or die $sth->errstr;
17         dbh->commit or die dbh->errstr if $FS::UID::AutoCommit;
18     }
19 }
20
21 1;