Subversion Repositories SmartDukaan

Rev

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

Rev 7669 Rev 7672
Line 1307... Line 1307...
1307
                    attr1 = Attribute()
1307
                    attr1 = Attribute()
1308
                    attr1.orderId = orderId
1308
                    attr1.orderId = orderId
1309
                    attr1.name = "freebie_vendor"
1309
                    attr1.name = "freebie_vendor"
1310
                    attr1.value = str(inventoryItem.supplierId)
1310
                    attr1.value = str(inventoryItem.supplierId)
1311
    
1311
    
1312
                    inventory_client = InventoryClient().get_client()
-
 
1313
                    item_pricing = inventory_client.getItemPricing(order.freebieItemId, warehouse.vendor.id)
-
 
1314
                    attr2 = Attribute()
1312
                    attr2 = Attribute()
1315
                    attr2.orderId = orderId
1313
                    attr2.orderId = orderId
1316
                    attr2.name = "freebie_nlc"
1314
                    attr2.name = "freebie_nlc"
1317
                    attr2.value = str(item_pricing.nlc)
1315
                    attr2.value = str(inventoryItem.nlc)
1318
                except Exception as e:
1316
                except Exception as e:
1319
                    print sys.exc_info()[0]
1317
                    print sys.exc_info()[0]
1320
                    print e.message
1318
                    print e.message
1321
                    raise TransactionServiceException(110,'Error in billing freebie for warehouseId ' + str(freebieWarehouseId))
1319
                    raise TransactionServiceException(110,'Error in billing freebie for warehouseId ' + str(freebieWarehouseId))
1322
            else:
1320
            else:
Line 1406... Line 1404...
1406
                        inventoryItem = warehouse_client.scanSerializedItemForOrder(serialNumber, ScanType.SALE, orderId, warehouse.id, 1, order.warehouse_id)
1404
                        inventoryItem = warehouse_client.scanSerializedItemForOrder(serialNumber, ScanType.SALE, orderId, warehouse.id, 1, order.warehouse_id)
1407
                    else:
1405
                    else:
1408
                        inventoryItem = warehouse_client.scanForOrder(inventoryItem, ScanType.SALE, 1, order.id, warehouse.id, order.warehouse_id)
1406
                        inventoryItem = warehouse_client.scanForOrder(inventoryItem, ScanType.SALE, 1, order.id, warehouse.id, order.warehouse_id)
1409
    
1407
    
1410
                    lineitem.transfer_price = inventoryItem.unitPrice
1408
                    lineitem.transfer_price = inventoryItem.unitPrice
-
 
1409
                    lineitem.nlc = inventoryItem.nlc
1411
                    order.vendorId = inventoryItem.supplierId
1410
                    order.vendorId = inventoryItem.supplierId
1412
                    catalog_client = CatalogClient().get_client()
1411
                    catalog_client = CatalogClient().get_client()
1413
                except WarehouseServiceException as e:
1412
                except WarehouseServiceException as e:
1414
                    print sys.exc_info()[0]
1413
                    print sys.exc_info()[0]
1415
                    print 'Could not scan out orders due to: ' + e.message
1414
                    print 'Could not scan out orders due to: ' + e.message
Line 1419... Line 1418...
1419
                if ItemType.SERIALIZED == item.type:
1418
                if ItemType.SERIALIZED == item.type:
1420
                    serialNumber = serialNumbers[0]
1419
                    serialNumber = serialNumbers[0]
1421
                else:
1420
                else:
1422
                    serialNumber = ""
1421
                    serialNumber = ""
1423
                warehouse_client = WarehouseClient().get_client()
1422
                warehouse_client = WarehouseClient().get_client()
1424
                inventoryItem = warehouse_client.scanForOursExternalSale(lineitem.item_id, serialNumber, lineitem.item_number, invoice_number, order.fulfilmentWarehouseId, lineitem.transfer_price, order.id)
1423
                inventoryItem = warehouse_client.scanForOursExternalSale(lineitem.item_id, serialNumber, lineitem.item_number, invoice_number, order.fulfilmentWarehouseId, lineitem.transfer_price, lineitem.nlc, order.id)
1425
                lineitem.transfer_price = inventoryItem.unitPrice
1424
                lineitem.transfer_price = inventoryItem.unitPrice
-
 
1425
                lineitem.nlc = inventoryItem.nlc
1426
                order.vendorId = inventoryItem.supplierId
1426
                order.vendorId = inventoryItem.supplierId
1427
            except WarehouseServiceException as e:
1427
            except WarehouseServiceException as e:
1428
                print sys.exc_info()[0]
1428
                print sys.exc_info()[0]
1429
                print 'Could not scan out orders due to: ' + e.message
1429
                print 'Could not scan out orders due to: ' + e.message
1430
                raise TransactionServiceException(110, e.message)
1430
                raise TransactionServiceException(110, e.message)