Transferencia de stock con Ubicación DI API

Hola, finalmente logre hacerlo. Me pasaron un código de ejemplo y en resumen tenía los mismos campos, pero creo que la diferencia fue algo que había mencionado @alexnavarrova SerialAndBatchNumbersBaseLine. Es extraño porque ya lo había probado, pero entre tantas cosas que estuve probando posiblemente lo probé con alguna otra linea que no debería ir. Gracias a todos fueron de gran ayuda. Dejo aquí el código básico para hacer una transferencia de stock entre ubicaciones como a mi me funcionó.
Saludos.

            StockTransfer sttrans = oCompany.GetBusinessObject(BoObjectTypes.oStockTransfer);

            sttrans.DocDate = DateTime.Now;
            sttrans.FromWarehouse = "001";
            sttrans.ToWarehouse = "001";
            
            sttrans.Lines.ItemCode = "001-10002";
            sttrans.Lines.FromWarehouseCode = "001";
            sttrans.Lines.WarehouseCode = "001";
            sttrans.Lines.Quantity = 8;

            sttrans.Lines.BatchNumbers.BatchNumber = "0001";
            sttrans.Lines.BatchNumbers.Quantity = 8;
            sttrans.Lines.BatchNumbers.Add();

            sttrans.Lines.BinAllocations.BinActionType = BinActionTypeEnum.batFromWarehouse;
            sttrans.Lines.BinAllocations.SerialAndBatchNumbersBaseLine = 0;
            sttrans.Lines.BinAllocations.BinAbsEntry = 1;
            sttrans.Lines.BinAllocations.Quantity = 8;
            sttrans.Lines.BinAllocations.Add();

            sttrans.Lines.BinAllocations.BinActionType = BinActionTypeEnum.batToWarehouse;
            sttrans.Lines.BinAllocations.SerialAndBatchNumbersBaseLine = 0;
            sttrans.Lines.BinAllocations.BinAbsEntry = 6;
            sttrans.Lines.BinAllocations.Quantity = 8;
            sttrans.Lines.BinAllocations.Add();

            sttrans.Lines.Add();

            sttrans.Comments = "Transfer de prueba Sistemas";
            
            if (sttrans.Add() != 0)
            {
                throw new Exception(oCompany.GetLastErrorCode() + " >>" + oCompany.GetLastErrorDescription().ToString());
            }
2 Me gusta