Skip to content

Instantly share code, notes, and snippets.

@smarenich
Created October 4, 2016 04:13
Show Gist options
  • Save smarenich/132a180a5e8dbd763c049de9504cb42f to your computer and use it in GitHub Desktop.
Save smarenich/132a180a5e8dbd763c049de9504cb42f to your computer and use it in GitHub Desktop.
namespace PX.Objects.IN
{
public class INReleaseProcess_Extension : PXGraphExtension<INReleaseProcess>
{
public delegate void ReleaseDocProcDelegate(JournalEntry je, INRegister doc);
[PXOverride]
public void ReleaseDocProc(JournalEntry je, INRegister doc, ReleaseDocProcDelegate baseMethod)
{
if (doc.DocType == INDocType.Receipt)
{
je.RowInserting.AddHandler<GLTran>(GLTranRowInserting);
}
baseMethod(je, doc);
}
public void GLTranRowInserting(PXCache sender, PXRowInsertingEventArgs e)
{
GLTran row = e.Row as GLTran;
row.SubID = ((Sub)PXSelect<Sub, Where<Sub.subCD, Equal<Required<Sub.subCD>>>>.Select(Base, "000000")).SubID;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment