Subversion Repositories SmartDukaan

Rev

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

Rev 14314 Rev 14319
Line 136... Line 136...
136
                        grandAmount += int(float(labelTd.next_sibling.next_sibling.find('span').contents[-1].replace(',','')))
136
                        grandAmount += int(float(labelTd.next_sibling.next_sibling.find('span').contents[-1].replace(',','')))
137
                if grandAmount < totalAmount:
137
                if grandAmount < totalAmount:
138
                    diff = totalAmount - grandAmount
138
                    diff = totalAmount - grandAmount
139
                    for subOrder in merchantOrder.subOrders:
139
                    for subOrder in merchantOrder.subOrders:
140
                        subOrder.amountPaid -= int(diff*(1-subOrder.amountPaid/totalAmount))
140
                        subOrder.amountPaid -= int(diff*(1-subOrder.amountPaid/totalAmount))
141
                else:
-
 
142
                    self._updateToOrder(todict(merchantOrder))
141
                self._updateToOrder(todict(merchantOrder))
143
                    resp['result'] = 'ORDER_CREATED'
142
                resp['result'] = 'ORDER_CREATED'
144
                    return resp    
143
                return resp    
145
            except:
144
            except:
146
                print "Error occurred"
145
                print "Error occurred"
147
                traceback.print_exc()
146
                traceback.print_exc()
148
                resp['result'] = 'ORDER_NOT_CREATED'
147
                resp['result'] = 'ORDER_NOT_CREATED'
149
                return resp    
148
                return resp