Subversion Repositories SmartDukaan

Rev

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

Rev 4186 Rev 4187
Line 34... Line 34...
34
    discounts = []
34
    discounts = []
35
    
35
    
36
    if cart.lines:
36
    if cart.lines:
37
        total_selling_price = 0
37
        total_selling_price = 0
38
        total_discounted_price = 0
38
        total_discounted_price = 0
39
        available_discount = 250
39
        has_used_coupon = False
40
        
40
        
41
        for line in cart.lines:
41
        for line in cart.lines:
42
            line.discountedPrice = line.actualPrice
42
            line.discountedPrice = line.actualPrice
43
            discount_value = 0
43
            discount_value = 0
44
            
44
            
45
            if available_discount > 0:
45
            if has_used_coupon:
46
                if line.actualPrice < available_discount:
46
                break
-
 
47
            
47
                    line.discountedPrice = 0
48
            if line.actualPrice < 5000:
48
                    discount_value = line.actualPrice
49
                line.discountedPrice = line.actualPrice - 200
49
                    available_discount -= line.actualPrice
50
                discount_value = 200
50
                else:
51
            else:
51
                    line.discountedPrice = line.actualPrice - available_discount
52
                line.discountedPrice = line.actualPrice - 500
52
                    discount_value = available_discount
53
                discount_value = 500
-
 
54
            
53
                    available_discount = 0
55
            has_used_coupon = True
54
            
56
            
55
            total_selling_price += line.actualPrice * line.quantity
57
            total_selling_price += line.actualPrice * line.quantity
56
            total_discounted_price += line.discountedPrice * line.quantity
58
            total_discounted_price += line.discountedPrice * line.quantity
57
            
59
            
58
            if discount_value > 0:
60
            if discount_value > 0: