PO Invoice through code for a specified InventTrans date

Is there any way I can Invoice a PO for a specific inventory trans physical date (inventory Trans.date physical)

For example I have to invoice a PO having 10 items received out of that 3 are in this month. I have to invoice the 7 those are received in last month . I toed passing different ways like choosing lines etc. Please let me know

I am using the below code

purchFormLetter = purchFormLetter::construct(DocumentStatus::Invoice);
purchFormLetter.update(purchtable, // Purchase record Buffer
Invoice Number //Invoice Number
systemdateget(), // Transaction date
Purchupdate::PackingSlip //Qty

Find the product receipts done in that period and do the invoice for them.

Hi Kranthi,

I am able to find the right transaction from InventTrans but we are passing only purchTable in form letter class .

Could you please explain in detail or can you share sample code snippet .



look at this method, \Data Dictionary\Tables\CustInvoiceJour\Methods\interCompanyUpdate