Created
December 17, 2008 19:38
-
-
Save russellkt/37183 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def self.policies_with_balance start_date, end_date | |
cond = [] | |
cond << "(policies.delete_code is null OR policies.delete_code = '')" | |
cond << "expires_on BETWEEN ? AND ?" | |
cond << "total_premium - payment_amount > 0.00" | |
find( :all, | |
:conditions => [ cond.join(" AND "), start_date, end_date ], | |
:order => 'policies.policy_number ASC' ) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment