[freeside-commits] freeside/FS/FS/part_event/Condition cust_bill_past_promised.pm, NONE, 1.1.2.2
Mark Wells
mark at wavetail.420.am
Thu Dec 8 13:13:58 PST 2011
- Previous message: [freeside-commits] freeside/httemplate/view/cust_main/payment_history invoice.html, 1.5, 1.6
- Next message: [freeside-commits] freeside/FS/FS Conf.pm, 1.468.2.25, 1.468.2.26 Schema.pm, 1.317.2.19, 1.317.2.20 cust_bill.pm, 1.350.2.16, 1.350.2.17 cust_bill_ApplicationCommon.pm, 1.21, 1.21.6.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/cvsroot/freeside/FS/FS/part_event/Condition
In directory wavetail.420.am:/tmp/cvs-serv4030/FS/FS/part_event/Condition
Added Files:
Tag: FREESIDE_2_3_BRANCH
cust_bill_past_promised.pm
Log Message:
promised payment date for invoices, #13554
--- NEW FILE: cust_bill_past_promised.pm ---
package FS::part_event::Condition::cust_bill_past_promised;
use strict;
use FS::cust_bill;
use Time::Local 'timelocal';
use base qw( FS::part_event::Condition );
sub description {
'Promised payment date has passed',
}
sub eventtable_hashref {
{ 'cust_main' => 0,
'cust_bill' => 1,
'cust_pkg' => 0,
};
}
sub option_fields {
(
'delay' => { label => 'Delay additional days',
type => 'text',
value => '0',
},
);
}
sub condition {
# always return true if there is no promised_date
my($self, $cust_bill, %opt) = @_;
my $delay = $self->option('delay') || 0;
my ($sec,$min,$hour,$mday,$mon,$year) = (localtime($opt{'time'}))[0..5];
my $as_of = timelocal(0,0,0,$mday,$mon,$year) - $delay * 86400;
$as_of >= ($cust_bill->promised_date || 0);
}
sub condition_sql {
my( $class, $table, %opt ) = @_;
return 'true' if $opt{'driver_name'} ne 'Pg';
my $delay = $class->condition_sql_option_integer('delay', 'Pg');
my ($sec,$min,$hour,$mday,$mon,$year) = (localtime($opt{'time'}))[0..5];
my $as_of = timelocal(0,0,0,$mday,$mon,$year) . " - ($delay * 86400)";
"(cust_bill.promised_date IS NULL OR $as_of >= cust_bill.promised_date)";
}
1;
- Previous message: [freeside-commits] freeside/httemplate/view/cust_main/payment_history invoice.html, 1.5, 1.6
- Next message: [freeside-commits] freeside/FS/FS Conf.pm, 1.468.2.25, 1.468.2.26 Schema.pm, 1.317.2.19, 1.317.2.20 cust_bill.pm, 1.350.2.16, 1.350.2.17 cust_bill_ApplicationCommon.pm, 1.21, 1.21.6.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the freeside-commits
mailing list