Create invoice with out a Sales order.

Hi,

I’m looking to create an Invoice directly with out doing any sales orders or journals.

I need to do this from x++

Anyone done this? in 2012?

Cheers

Public static void SalesOrderDemo(Args _s)
{
SalesTable salesTable;
NumberSeq NumberSeq;
SalesId salesid;
SalesLine salesline;
SalesFormLetter formletter;
;
NumberSeq =NumberSeq::newGetNum(SalesParameters::numRefSalesId() , true);
salesid=NumberSeq.num();
salesTable.SalesId = salesid;
salesTable.initValue();
salesTable.CustAccount = “customer account number”;
salesTable.initFromCustTable();
salesTable.insert();

//Create the Sales Line with the created Sales Order
salesline.SalesId=salesid;
salesline.ItemId=“item id number”;
salesline.CreateLine(NoYes::Yes,NoYes::Yes,NoYes::Yes,NoYes::Yes,NoYes::Yes,NoYes::Yes);

//Post the Sales Order Invoice

formletter=SalesFormLetter::construct(DocumentStatus::Invoice);
formletter.update(SalesTable::find(salesid));

}

What is the business requirement. Every sales posting should have source document like journal or SO.

In general voucher number is required for every financial transaction.

Pranav…