Subversion Repositories SmartDukaan

Rev

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

Rev 12739 Rev 12743
Line 57... Line 57...
57
                        if privateDeals[firstLine.itemId].dealFreebieOption==0:
57
                        if privateDeals[firstLine.itemId].dealFreebieOption==0:
58
                            firstLine.freebieId = 0
58
                            firstLine.freebieId = 0
59
                        if privateDeals[firstLine.itemId].dealFreebieOption==2:
59
                        if privateDeals[firstLine.itemId].dealFreebieOption==2:
60
                            firstLine.freebieId =  privateDeals[firstLine.itemId].dealFreebieItemId
60
                            firstLine.freebieId =  privateDeals[firstLine.itemId].dealFreebieItemId
61
                cart.discountedPrice = cart.totalPrice - round(total_discounts, 0)
61
                cart.discountedPrice = cart.totalPrice - round(total_discounts, 0)
62
                if cart.discountedPrice >= 2000:
62
                if cart.discountedPrice >= 1999:
63
                    counter = privateDealUser.counter
63
                    counter = privateDealUser.counter
64
                    if counter is not None:
64
                    if counter is not None:
65
                        if datetime.datetime.now() - counter.createdOn < datetime.timedelta(30) and counter.lastPurchasedOn is None:
65
                        if datetime.datetime.now() - counter.createdOn < datetime.timedelta(30) and counter.lastPurchasedOn is None:
66
                            firstLine = cart.lines[0]
66
                            firstLine = cart.lines[0]
67
                            if discountsMap.has_key(firstLine.itemId):
67
                            if discountsMap.has_key(firstLine.itemId):
Line 74... Line 74...
74
                                discount1.discount = 0 
74
                                discount1.discount = 0 
75
                                discounts.append(discount1)
75
                                discounts.append(discount1)
76
                            discount1.discount += round(200/discount1.quantity, 0)
76
                            discount1.discount += round(200/discount1.quantity, 0)
77
                            cart.discountedPrice -= round(200/discount1.quantity, 0)*discount1.quantity
77
                            cart.discountedPrice -= round(200/discount1.quantity, 0)*discount1.quantity
78
            else:
78
            else:
79
                if cart.totalPrice >= 2000:
79
                if cart.totalPrice >= 1999:
80
                    counter = privateDealUser.counter
80
                    counter = privateDealUser.counter
81
                    if counter is not None:
81
                    if counter is not None:
82
                        if datetime.datetime.now() - counter.createdOn < datetime.timedelta(30) and counter.lastPurchasedOn is None:
82
                        if datetime.datetime.now() - counter.createdOn < datetime.timedelta(30) and counter.lastPurchasedOn is None:
83
                            firstLine = cart.lines[0]
83
                            firstLine = cart.lines[0]
84
                            discount1 = Discount()
84
                            discount1 = Discount()