Created
December 21, 2020 02:22
-
-
Save tocohara/71e398397fb17b170d5e8ed5b3f363ac to your computer and use it in GitHub Desktop.
Update Appointment Detail Actual Fields Method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
{ | |
appointmentDetails.Cache.SetDefaultExt<FSAppointmentDet.actualDuration>(fsAppointmentDetRow); | |
} | |
else if (fsAppointmentDetRow.IsService && fsAppointmentDetRow.StaffRelated == false) | |
{ | |
appointmentDetails.Cache.SetDefaultExt<FSAppointmentDet.actualDuration>(fsAppointmentDetRow); | |
} | |
if (fsAppointmentDetRow.BillingRule == ID.BillingRule.FLAT_RATE | |
|| fsAppointmentDetRow.BillingRule == ID.BillingRule.NONE | |
|| fsAppointmentDetRow.IsInventoryItem == true) | |
{ | |
fsAppointmentDetRow.Qty = isReOpen ? 0 : fsAppointmentDetRow.EstimatedQty; | |
} | |
appointmentDetails.Update(fsAppointmentDetRow); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment