Subversion Repositories SmartDukaan

Rev

Rev 6423 | Rev 6426 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6423 Rev 6424
Line 3... Line 3...
3
 
3
 
4
@author: Chandranshu
4
@author: Chandranshu
5
'''
5
'''
6
 
6
 
7
from datetime import date, timedelta
7
from datetime import date, timedelta
-
 
8
from math import ceil
8
from elixir import *
9
from elixir import *
9
from random import randrange
10
from random import randrange
10
from reportlab.lib.units import inch
11
from reportlab.lib.units import inch
11
from reportlab.pdfgen.canvas import Canvas
12
from reportlab.pdfgen.canvas import Canvas
12
from reportlab.rl_config import defaultPageSize
13
from reportlab.rl_config import defaultPageSize
Line 216... Line 217...
216
    if totalAmount < emiScheme.minAmount:
217
    if totalAmount < emiScheme.minAmount:
217
        return
218
        return
218
    
219
    
219
    emiCharge = 0
220
    emiCharge = 0
220
    if emiScheme.chargeType == EmiChargeType.FIXED:
221
    if emiScheme.chargeType == EmiChargeType.FIXED:
221
        emiCharge = round(emiScheme.chargeValue)
222
        emiCharge = ceil(emiScheme.chargeValue)
222
    if emiScheme.chargeType == EmiChargeType.PERCENTAGE:
223
    if emiScheme.chargeType == EmiChargeType.PERCENTAGE:
223
        emiCharge = round(totalAmount*(emiScheme.chargeValue)/100)
224
        emiCharge = ceil(totalAmount*(emiScheme.chargeValue)/100)
224
        
225
        
225
    miscCharge = MiscCharges()
226
    miscCharge = MiscCharges()
226
    miscCharge.transaction = transaction
227
    miscCharge.transaction = transaction
227
    miscCharge.chargeType = 1 ##EMI charges
228
    miscCharge.chargeType = 1 ##EMI charges
228
    miscCharge.chargeAmount = emiCharge
229
    miscCharge.chargeAmount = emiCharge