Subversion Repositories SmartDukaan

Rev

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

Rev 5832 Rev 5833
Line 699... Line 699...
699
    except Exception as e:
699
    except Exception as e:
700
        print e
700
        print e
701
        return False
701
        return False
702
 
702
 
703
def __get_secret_code(order_id):
703
def __get_secret_code(order_id):
704
    __get_order_attribute_value(order_id, 'SECRET_CODE')
704
    get_order_attribute_value(order_id, 'SECRET_CODE')
705
 
705
 
706
def __get_order_attribute_value(order_id, attribute_name):
706
def get_order_attribute_value(order_id, attribute_name):
707
    existingAttribute = Attribute.query.filter(Attribute.orderId == order_id).filter(Attribute.name == attribute_name).first()
707
    existingAttribute = Attribute.query.filter(Attribute.orderId == order_id).filter(Attribute.name == attribute_name).first()
708
    if existingAttribute:
708
    if existingAttribute:
709
        return existingAttribute.value
709
        return existingAttribute.value
710
    return ""
710
    return ""
711
 
711
 
Line 2348... Line 2348...
2348
        logistics_client = LogisticsClient().get_client()
2348
        logistics_client = LogisticsClient().get_client()
2349
        store = logistics_client.getPickupStore(order.pickupStoreId)
2349
        store = logistics_client.getPickupStore(order.pickupStoreId)
2350
        store_string = "<store>" + store.hotspotId + "</store>"
2350
        store_string = "<store>" + store.hotspotId + "</store>"
2351
        order_string = "<orderno>" + str(order.id) + "</orderno>"
2351
        order_string = "<orderno>" + str(order.id) + "</orderno>"
2352
        collection_type = "<Type>" + type + "</Type>"
2352
        collection_type = "<Type>" + type + "</Type>"
2353
        payment_mode = __get_order_attribute_value(order.id, "PAYMENT_MODE")
2353
        payment_mode = get_order_attribute_value(order.id, "PAYMENT_MODE")
2354
        if type == "SALE":
2354
        if type == "SALE":
2355
            amount = int(order.total_amount)
2355
            amount = int(order.total_amount)
2356
            ts = order.delivery_timestamp
2356
            ts = order.delivery_timestamp
2357
        if type == "SALE RETURN":
2357
        if type == "SALE RETURN":
2358
            amount = -int(order.total_amount)
2358
            amount = -int(order.total_amount)