Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Hardgrove tocohara

View GitHub Profile
@tocohara
tocohara / gist:e74897a1c42ff9c630946f4eb9efb0e4
Created May 17, 2022
Exploring the Sales Order Processing Functions - 4
View gist:e74897a1c42ff9c630946f4eb9efb0e4
protected virtual void _SetProcessTargetInternal(string graphType, string stepID, string action, string menu, IEnumerable parameters)
{
if (TryWithExternal(delegate(PXProcessingBase<Table> e)
{
e._SetProcessTargetInternal(graphType, stepID, action, menu, parameters);
}))
{
return;
}
if (menu != null && menu.Contains("$"))
@tocohara
tocohara / gist:3e92bb85c5cf5a62438b2bfaa19be5a5
Created May 17, 2022
Exploring the Sales Order Processing Functions - 3
View gist:3e92bb85c5cf5a62438b2bfaa19be5a5
public virtual void SetProcessWorkflowAction(string action, Dictionary<string, object> parameters)
{
_SetProcessTargetInternal(null, null, action, null, parameters);
}
@tocohara
tocohara / gist:9c879a1e6670adeb921c6296c7fd1bc6
Created May 17, 2022
Exploring the Sales Order Processing Functions - 2
View gist:9c879a1e6670adeb921c6296c7fd1bc6
protected virtual void ARRetainageFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
{
ARRetainageFilter filter = e.Row as ARRetainageFilter;
if (filter == null) return;
bool isAutoRelease = ARSetup.Current.RetainageInvoicesAutoRelease == true;
DocumentList.SetProcessDelegate(delegate (List<ARInvoiceExt> list)
{
ARInvoiceEntry graph = CreateInstance<ARInvoiceEntry>();
@tocohara
tocohara / gist:681c603dbe5f3aa059534373a5e66f14
Created May 17, 2022
Exploring the Sales Order Processing Functions - 1
View gist:681c603dbe5f3aa059534373a5e66f14
if (!String.IsNullOrEmpty(filter.Action))
{
Orders.SetProcessWorkflowAction(
filter.Action,
isCreateShipment ? filter.ShipmentDate
: isCreateChildOrders ? filter.SchedOrderDate
: filter.EndDate,
filter.SiteID);
}
@tocohara
tocohara / gist:e0eed64468a00f5a8019b4b966332b51
Created Dec 24, 2020
Cancel Appointment Log Delete Method
View gist:e0eed64468a00f5a8019b4b966332b51
private void CancelLogDeletion(PXCache sender, PXRowDeletingEventArgs e)
{
e.Cancel = true;
}
@tocohara
tocohara / gist:ac8a37ddc3cea4037716672b8abdfc8e
Created Dec 21, 2020
Override the Re-Open Appointment Method
View gist:ac8a37ddc3cea4037716672b8abdfc8e
public delegate IEnumerable ReopenAppointmentDelegate(PXAdapter adapter);
[PXOverride]
public IEnumerable ReopenAppointment(PXAdapter adapter, ReopenAppointmentDelegate baseMethod)
{
try
{
Base.FieldVerifying.AddHandler<FSAppointmentDet.qty>(CancelActualQtyUpdate);
Base.RowDeleting.AddHandler<FSAppointmentLog>(CancelLogDeletion);
var ret = baseMethod(adapter);
return ret;
@tocohara
tocohara / gist:71e398397fb17b170d5e8ed5b3f363ac
Created Dec 21, 2020
Update Appointment Detail Actual Fields Method
View gist:71e398397fb17b170d5e8ed5b3f363ac
public virtual void UpdateAppointmentDetActualFields(AppointmentCore.AppointmentDetails_View appointmentDetails,
AppointmentCore.AppointmentServiceEmployees_View appointmentEmployees,
bool isReOpen = false)
{
foreach (FSAppointmentDet fsAppointmentDetRow in appointmentDetails.Select().RowCast<FSAppointmentDet>())
{
if (fsAppointmentDetRow.IsService || fsAppointmentDetRow.IsInventoryItem)
{
if (fsAppointmentDetRow.IsService && fsAppointmentDetRow.StaffRelated == true)
{
View gist:b5b2aee029be56348da52bc4a10f9a16
public virtual void ClearAppointmentLog()
{
foreach (FSAppointmentLog fsAppointmentLogRow in LogRecords.Select().RowCast<FSAppointmentLog>().Where(_ => _.Type != ID.Type_Log.TRAVEL))
{
LogRecords.Delete(fsAppointmentLogRow);
}
}
View gist:58502c8c149f71079b99f6a67bff8018
public virtual int ProcessReOpenItemLine(FSAppointmentDet apptDet)
{
if (apptDet.Status == ID.Status_AppointmentDet.NOT_STARTED)
return 0;
FSAppointmentDet copy = (FSAppointmentDet)AppointmentDetails.Cache.CreateCopy(apptDet);
copy.Status = ID.Status_AppointmentDet.NOT_STARTED;
AppointmentDetails.Update(copy);
View gist:19b3875a11d703438f25b6b30d7f057a
public virtual string GetNextRefNbr(string baseRefNbr, string lastRefNbr)
{
string newNumberSymbol = GetNewNumberSymbol();
if (string.IsNullOrWhiteSpace(lastRefNbr)
|| (newNumberSymbol != null && lastRefNbr.Trim() == newNumberSymbol.Trim())
)
{
return GetInitialRefNbr(baseRefNbr);
}
else