projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c16ef01
)
always pass the "time" parameter to join_conditions_sql, related to #28978
author
Mark Wells
<mark@freeside.biz>
Wed, 11 Jun 2014 22:18:59 +0000
(15:18 -0700)
committer
Mark Wells
<mark@freeside.biz>
Wed, 11 Jun 2014 22:18:59 +0000
(15:18 -0700)
FS/FS/Cron/bill.pm
patch
|
blob
|
history
FS/FS/cust_main/Billing.pm
patch
|
blob
|
history
FS/FS/part_event.pm
patch
|
blob
|
history
FS/FS/part_event_condition.pm
patch
|
blob
|
history
httemplate/browse/part_event.html
patch
|
blob
|
history
diff --git
a/FS/FS/Cron/bill.pm
b/FS/FS/Cron/bill.pm
index
d3f1eb4
..
98f1c2e
100644
(file)
--- a/
FS/FS/Cron/bill.pm
+++ b/
FS/FS/Cron/bill.pm
@@
-236,7
+236,8
@@
END
my $eventtable = $_;
# joins and where clauses to test event conditions
my $eventtable = $_;
# joins and where clauses to test event conditions
- my $join = FS::part_event_condition->join_conditions_sql( $eventtable );
+ my $join = FS::part_event_condition->join_conditions_sql( $eventtable,
+ 'time'=>$time );
my $where = FS::part_event_condition->where_conditions_sql( $eventtable,
'time'=>$time,
);
my $where = FS::part_event_condition->where_conditions_sql( $eventtable,
'time'=>$time,
);
diff --git
a/FS/FS/cust_main/Billing.pm
b/FS/FS/cust_main/Billing.pm
index
2878276
..
545243c
100644
(file)
--- a/
FS/FS/cust_main/Billing.pm
+++ b/
FS/FS/cust_main/Billing.pm
@@
-1784,7
+1784,8
@@
sub retry_realtime {
#a little false laziness w/due_cust_event (not too bad, really)
#a little false laziness w/due_cust_event (not too bad, really)
- my $join = FS::part_event_condition->join_conditions_sql;
+ # I guess this is always as of now?
+ my $join = FS::part_event_condition->join_conditions_sql('', 'time' => time);
my $order = FS::part_event_condition->order_conditions_sql;
my $mine =
'( '
my $order = FS::part_event_condition->order_conditions_sql;
my $mine =
'( '
@@
-2097,7
+2098,8
@@
sub due_cust_event {
#some false laziness w/Cron::bill bill_where
#some false laziness w/Cron::bill bill_where
- my $join = FS::part_event_condition->join_conditions_sql( $eventtable);
+ my $join = FS::part_event_condition->join_conditions_sql( $eventtable,
+ 'time' => $opt{'time'});
my $where = FS::part_event_condition->where_conditions_sql($eventtable,
'time'=>$opt{'time'},
);
my $where = FS::part_event_condition->where_conditions_sql($eventtable,
'time'=>$opt{'time'},
);
@@
-2136,7
+2138,8
@@
sub due_cust_event {
my $pkey = $object->primary_key;
$cross_where = "$eventtable.$pkey = ". $object->$pkey();
my $pkey = $object->primary_key;
$cross_where = "$eventtable.$pkey = ". $object->$pkey();
- my $join = FS::part_event_condition->join_conditions_sql( $eventtable );
+ my $join = FS::part_event_condition->join_conditions_sql( $eventtable,
+ 'time' => $opt{'time'});
my $extra_sql =
FS::part_event_condition->where_conditions_sql( $eventtable,
'time'=>$opt{'time'}
my $extra_sql =
FS::part_event_condition->where_conditions_sql( $eventtable,
'time'=>$opt{'time'}
diff --git
a/FS/FS/part_event.pm
b/FS/FS/part_event.pm
index
9354f4d
..
e7acf5a
100644
(file)
--- a/
FS/FS/part_event.pm
+++ b/
FS/FS/part_event.pm
@@
-270,7
+270,9
@@
sub targets {
}
# this is the 'event' side
}
# this is the 'event' side
- my $join = FS::part_event_condition->join_conditions_sql( $eventtable );
+ my $join = FS::part_event_condition->join_conditions_sql( $eventtable,
+ 'time' => $time
+ );
my $where = FS::part_event_condition->where_conditions_sql( $eventtable,
'time' => $time
);
my $where = FS::part_event_condition->where_conditions_sql( $eventtable,
'time' => $time
);
diff --git
a/FS/FS/part_event_condition.pm
b/FS/FS/part_event_condition.pm
index
b51c6b9
..
ac2ee82
100644
(file)
--- a/
FS/FS/part_event_condition.pm
+++ b/
FS/FS/part_event_condition.pm
@@
-243,16
+243,17
@@
sub all_conditionnames {
keys %conditions
}
keys %conditions
}
-=item join_conditions_sql [ EVENTTABLE ]
+=item join_conditions_sql [ EVENTTABLE
[, OPTIONS ]
]
Returns an SQL fragment selecting joining all condition options for an event as
tables titled "cond_I<conditionname>". Typically used in conjunction with
Returns an SQL fragment selecting joining all condition options for an event as
tables titled "cond_I<conditionname>". Typically used in conjunction with
-B<where_conditions_sql>.
+B<where_conditions_sql>. OPTIONS should include 'time', the time to use
+in testing event conditions.
=cut
sub join_conditions_sql {
=cut
sub join_conditions_sql {
- my ( $class, $eventtable ) = @_;
+ my ( $class, $eventtable
, %options
) = @_;
join(' ',
map {
join(' ',
map {
@@
-261,7
+262,7
@@
sub join_conditions_sql {
" AND cond_$_.conditionname = ". dbh->quote($_).
" )";
}
" AND cond_$_.conditionname = ". dbh->quote($_).
" )";
}
- map $_->[0], $class->_where_conditions( $eventtable
) #
, %options )
+ map $_->[0], $class->_where_conditions( $eventtable, %options )
);
);
diff --git
a/httemplate/browse/part_event.html
b/httemplate/browse/part_event.html
index
63dd53b
..
575294e
100644
(file)
--- a/
httemplate/browse/part_event.html
+++ b/
httemplate/browse/part_event.html
@@
-188,7
+188,7
@@
my $count_query = 'SELECT COUNT(*) FROM part_event WHERE '.
'viewall_right' => 'None',
);
'viewall_right' => 'None',
);
-my $join_conditions = FS::part_event_condition->join_conditions_sql;
+my $join_conditions = FS::part_event_condition->join_conditions_sql
('', 'time' => time)
;
my $order_conditions = FS::part_event_condition->order_conditions_sql;
</%init>
my $order_conditions = FS::part_event_condition->order_conditions_sql;
</%init>