Skip to Content
avatar image
Former Member

Compras-Proveedores>Entradas de Mercancías [DI API]

Buenos dias; ¿Estimados, como puedo realizar las entradas de mercancias de proveedores basado en Orden de Compra mediante DI API? Si se como mandar a grabar, pero no se como simular el boton: (copiar de pedidos) y manejar esos saldos de cantidades que se generan, ya que guardan el documento base. En espera de su ayuda. Saludos, DR

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Oct 26, 2015 at 05:13 PM

    Hi Douglas,

    You can achieve this with something like this:

                int orderNumber = 0; //key of your order
                Documents oPurchaseDelivery = (SAPbobsCOM.Documents)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseDeliveryNotes);
    
    
                oPurchaseDelivery.CardCode = "C20000";
                oPurchaseDelivery.DocDueDate = DateTime.Now;
    
    
                oPurchaseDelivery.Lines.BaseType = (int)SAPbobsCOM.BoObjectTypes.oPurchaseOrders;
                oPurchaseDelivery.Lines.BaseEntry = orderNumber; //the number of base order
                oPurchaseDelivery.Lines.BaseLine = 0; //the index of line in base order, that you need copy
    
    
                if (oPurchaseDelivery.Add() != 0)
                {
                    MessageBox.Show(oCompany.GetLastErrorDescription());
                    return;
                }
                else
                {
                    MessageBox.Show("PurchaseDelivery [" + oCompany.GetNewObjectKey() + "] created!");
                }
    
    
    
    
    
    
    

    Regards,

    Diego

    Add comment
    10|10000 characters needed characters exceeded