Subversion Repositories SmartDukaan

Rev

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

Rev 19194 Rev 19211
Line 7... Line 7...
7
from datetime import datetime, timedelta
7
from datetime import datetime, timedelta
8
import time
8
import time
9
import optparse
9
import optparse
10
from dtr.storage.MemCache import MemCache
10
from dtr.storage.MemCache import MemCache
11
import traceback
11
import traceback
-
 
12
import math
12
 
13
 
13
parser = optparse.OptionParser()
14
parser = optparse.OptionParser()
14
parser.add_option("-H", "--host", dest="hostname",
15
parser.add_option("-H", "--host", dest="hostname",
15
                      default="localhost",
16
                      default="localhost",
16
                      type="string", help="The HOST where the DB server is running",
17
                      type="string", help="The HOST where the DB server is running",
Line 433... Line 434...
433
                cash_back = float(cashBack['cash_back'])
434
                cash_back = float(cashBack['cash_back'])
434
    except Exception as cashBackEx:
435
    except Exception as cashBackEx:
435
        pass
436
        pass
436
    
437
    
437
    if cash_back_type ==1:
438
    if cash_back_type ==1:
438
        return (price - float(cash_back)*price/100)
439
        return (price - math.floor(float(cash_back)*price/100))
439
    elif cash_back_type ==2:
440
    elif cash_back_type ==2:
440
        return (price - cash_back)
441
        return (price - cash_back)
441
    else:
442
    else:
442
        return price
443
        return price
443
 
444