Subversion Repositories SmartDukaan

Rev

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

Rev 6158 Rev 6163
Line 31... Line 31...
31
            discount_value = discount
31
            discount_value = discount
32
        else:
32
        else:
33
            total_discounted_price += round(line.actualPrice * line.quantity, 4)
33
            total_discounted_price += round(line.actualPrice * line.quantity, 4)
34
        
34
        
35
        if discount_value > 0:
35
        if discount_value > 0:
36
            discount = Discount()
36
            discountObj = Discount()
37
            discount.discount = discount_value
37
            discountObj.discount = discount_value
38
            discount.quantity = line.quantity
38
            discountObj.quantity = line.quantity
39
            discount.cart_id = cart.id
39
            discountObj.cart_id = cart.id
40
            discount.item_id = line.itemId
40
            discountObj.item_id = line.itemId
41
            
41
            
42
            discounts.append(discount)
42
            discounts.append(discountObj)
43
    
43
    
44
    if cart_has_specified_item is False:
44
    if cart_has_specified_item is False:
45
        raise PromotionException(115, 'This coupon is applicable only for Samsung Note II N7100 16GB')
45
        raise PromotionException(115, 'This coupon is applicable only for Samsung Note II N7100 16GB')
46
    
46
    
47
    cart.totalPrice = round(total_selling_price, 4)
47
    cart.totalPrice = round(total_selling_price, 4)