Fix bug.
This commit is contained in:
parent
320d0f91b8
commit
b717ce7a14
|
@ -73,10 +73,18 @@ class VenueManagementBill
|
|||
i = find_insert_index(days,delay_in_days)
|
||||
ref = JSON.parse(\"{\\\"annual_interest\\\": #{1/365.0},\\\"double_dividend\\\": #{1/2.0},\\\"daily_interest\\\": #{1/1.0}}\")
|
||||
if(days[i-1] < delay_in_days && interest_types[i-1] != undefined ){
|
||||
result = _interests[i - 1] * (delay_in_days * ref[interest_types[i-1]]).ceil()
|
||||
if(interest_types[i-1] == 'double_dividend'){
|
||||
result = _interests[i - 1] * (delay_in_days * ref[interest_types[i-1]]).ceil()
|
||||
}else{
|
||||
result = _interests[i - 1] * (delay_in_days * ref[interest_types[i-1]])
|
||||
}
|
||||
}else{
|
||||
if(i != 1 && days[i-2] < delay_in_days && interest_types[i-2] != undefined ){
|
||||
result = _interests[i - 2] * (delay_in_days * ref[interest_types[i-2]]).ceil()
|
||||
if(interest_types[i-2] == 'double_dividend'){
|
||||
result = _interests[i - 2] * (delay_in_days * ref[interest_types[i-2]]).ceil()
|
||||
}else{
|
||||
result = _interests[i - 2] * (delay_in_days * ref[interest_types[i-2]])
|
||||
}
|
||||
}else{
|
||||
result = 0
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue