Subversion Repositories SmartDukaan

Rev

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

Rev 13170 Rev 13205
Line 131... Line 131...
131
                cart_has_specified_item = True
131
                cart_has_specified_item = True
132
            else :
132
            else :
133
                continue
133
                continue
134
        
134
        
135
            if isPercentageDiscount:
135
            if isPercentageDiscount:
136
                discount_value = round((line.actualPrice*discount_value)/100, 4)
136
                discount_value = round((line.actualPrice*discount_value)/100, 0)
137
                    
137
                    
138
            if appliedOnce:
138
            if appliedOnce:
139
                quantity = 1
139
                quantity = 1
140
            else:
140
            else:
141
                quantity = min(floor(discount_left/discount_value), line.quantity)
141
                quantity = min(floor(discount_left/discount_value), line.quantity)
Line 147... Line 147...
147
                discount.quantity = quantity
147
                discount.quantity = quantity
148
                discount.discount = discount_value
148
                discount.discount = discount_value
149
                discounts.append(discount)
149
                discounts.append(discount)
150
                
150
                
151
                discount_left = discount_left - quantity*discount_value
151
                discount_left = discount_left - quantity*discount_value
152
                total_discounts += round(discount_value * quantity, 4)
152
                total_discounts += discount_value * quantity
153
            
153
            
154
            if appliedOnce :
154
            if appliedOnce :
155
                break
155
                break
156
            
156
            
157
            if discount_left > 0 and line.quantity - quantity > 0:
157
            if discount_left > 0 and line.quantity - quantity > 0: