Skip to Content
0
Former Member
Jan 12, 2007 at 01:08 PM

creating goods receipt programmatically

44 Views

I've been busy trying since a while now to create a goods receipt out of c#

I've come up. with the following code i.e. works but doesn't really fill in a valid record to db.

What do also I have to fill ? and how?

/// <summary>

/// Creates the new assembly supply.

/// </summary>

/// <param name="_iProdSupply_Lines">returns the docentry</param>

/// <returns></returns>

private int CreateNewAssemblySupply(IProdSupply _iProdSupply,int _nProductionOrder)

{

this.m_oInventoryGenExit.Reference2 = "PPS";

this.m_oInventoryGenExit.CardCode = "C1000";

this.m_oInventoryGenExit.Address = null;

this.m_oInventoryGenExit.Comments = null;

this.m_oInventoryGenExit.SalesPersonCode = -1;

this.m_oInventoryGenExit.TransportationCode = -1;

//this.m_oInventoryGenExit.DataSource = null;

//this.m_oInventoryGenExit.VatFirst = null;

for (int i = 0; i < _iProdSupply.Lines.Count; i++)

{

_iProdSupply.Lines.SetCurrentLine(i);

if (i != 0)

this.m_oInventoryGenExit.Lines.Add();

this.m_oInventoryGenExit.Lines.BaseLine = i;

this.m_oInventoryGenExit.Lines.ItemCode = _iProdSupply.Lines.ItemCode;

this.m_oInventoryGenExit.Lines.WarehouseCode = _iProdSupply.Lines.WarehouseTo;

this.m_oInventoryGenExit.Lines.Quantity = _iProdSupply.Lines.Quantity;

this.m_oInventoryGenExit.Lines.BaseType = 0;

this.m_oInventoryGenExit.Trans

//this.m_oInventoryGenExit.Lines.BaseEntry = _nProductionOrder;

}

int nResult = this.m_oInventoryGenExit.Add();

if (nResult != 0)

{

string sTest = this.Singleton.SBO.Company.GetLastErrorDescription();

}

else

return this.m_oInventoryGenExit.DocEntry;

return -1;