Subversion Repositories SmartDukaan

Rev

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

Rev 5165 Rev 5177
Line 1556... Line 1556...
1556
    catalogClient = CatalogClient().get_client()
1556
    catalogClient = CatalogClient().get_client()
1557
    warehouse = catalogClient.getWarehouse(order.warehouse_id)
1557
    warehouse = catalogClient.getWarehouse(order.warehouse_id)
1558
    if warehouse.billingType == BillingType.OURS:
1558
    if warehouse.billingType == BillingType.OURS:
1559
        if order.status in [OrderStatus.BILLED, OrderStatus.SHIPPED_TO_LOGST, OrderStatus.SHIPPED_FROM_WH] or (order.status == OrderStatus.CANCEL_REQUEST_CONFIRMED and order.previousStatus in [OrderStatus.BILLED, OrderStatus.SHIPPED_TO_LOGST, OrderStatus.SHIPPED_FROM_WH]):
1559
        if order.status in [OrderStatus.BILLED, OrderStatus.SHIPPED_TO_LOGST, OrderStatus.SHIPPED_FROM_WH] or (order.status == OrderStatus.CANCEL_REQUEST_CONFIRMED and order.previousStatus in [OrderStatus.BILLED, OrderStatus.SHIPPED_TO_LOGST, OrderStatus.SHIPPED_FROM_WH]):
1560
            lineitem = order.lineitems[0]
1560
            lineitem = order.lineitems[0]
-
 
1561
            item = catalogClient.getItem(lineitem.item_id)
-
 
1562
            if ItemType.SERIALIZED == item.type:
1561
            warehouseClient = WarehouseClient().get_client()
1563
                warehouseClient = WarehouseClient().get_client()
1562
            warehouseClient.scanSerializedItemForOrder(lineitem.serial_number, ScanType.SALE_RET, order.id, order.fulfilmentWarehouseId, lineitem.quantity, order.warehouse_id)
1564
                warehouseClient.scanSerializedItemForOrder(lineitem.serial_number, ScanType.SALE_RET, order.id, order.fulfilmentWarehouseId, lineitem.quantity, order.warehouse_id)
1563
 
1565
 
1564
    order.status = status_transition[order.status]
1566
    order.status = status_transition[order.status]
1565
    order.refund_timestamp = datetime.datetime.now()
1567
    order.refund_timestamp = datetime.datetime.now()
1566
    order.refunded_by = refunded_by
1568
    order.refunded_by = refunded_by
1567
    order.refund_reason = reason
1569
    order.refund_reason = reason