Subversion Repositories SmartDukaan

Rev

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

Rev 908 Rev 921
Line 188... Line 188...
188
    order.status = status
188
    order.status = status
189
    order.statusDescription = description
189
    order.statusDescription = description
190
    session.commit()
190
    session.commit()
191
    return True
191
    return True
192
    
192
    
-
 
193
def accept_order(self, orderId):
-
 
194
    order = get_order(orderId)
-
 
195
    order.status = OrderStatus.ACCEPTED
-
 
196
    order.statusDescription = "Order Accepted"
-
 
197
    order.accepted_timestamp = datetime.datetime.now()
-
 
198
    session.commit()
193
    
199
    return True
-
 
200
 
-
 
201
def bill_order(self, orderId):
-
 
202
    order = get_order(orderId)
-
 
203
    order.status = OrderStatus.BILLED
-
 
204
    order.statusDescription = "Order Billed"
-
 
205
    order.billing_timestamp = datetime.datetime.now()
-
 
206
    session.commit()
-
 
207
    return True    
-
 
208
 
194
def get_orders_for_transaction(transaction_id):
209
def get_orders_for_transaction(transaction_id):
195
    orders = Order.query.filter_by(transaction_id=transaction_id).all()
210
    orders = Order.query.filter_by(transaction_id=transaction_id).all()
196
    if not orders:
211
    if not orders:
197
        raise TransactionServiceException(101, "No order for the transaction")
212
        raise TransactionServiceException(101, "No order for the transaction")
198
    return orders
213
    return orders