protected virtual void _(Events.RowSelected <TimeCardMaint.EPTimecardDetail> e) { if (e.Row == null || !TimeCardHelper.IsTheTimeCardIntegrationEnabled(Base)) { return; } TimeCardMaint.EPTimecardDetail epTimeCardDetailRow = (TimeCardMaint.EPTimecardDetail)e.Row; TimeCardHelper.PMTimeActivity_RowSelected_Handler(e.Cache, epTimeCardDetailRow); }
protected virtual void EPActivityApprove_RowSelected(PXCache cache, PXRowSelectedEventArgs e) { if (e.Row == null || !TimeCardHelper.IsTheTimeCardIntegrationEnabled(Base)) { return; } EPActivityApprove epActivityApproveRow = (EPActivityApprove)e.Row; TimeCardHelper.PMTimeActivity_RowSelected_Handler(cache, epActivityApproveRow); }
protected virtual void _(Events.RowSelected <EPActivityApprove> e) { if (e.Row == null || !TimeCardHelper.IsTheTimeCardIntegrationEnabled(Base)) { return; } EPActivityApprove epActivityApproveRow = (EPActivityApprove)e.Row; TimeCardHelper.PMTimeActivity_RowSelected_Handler(e.Cache, epActivityApproveRow); }
protected virtual void _(Events.RowSelected <EPTimeCard> e) { if (e.Row == null) { return; } EPTimeCard epTimeCardRow = (EPTimeCard)e.Row; bool enableEmpTimeCardIntegration = (bool)TimeCardHelper.IsTheTimeCardIntegrationEnabled(Base); PXUIFieldAttribute.SetVisible <FSxPMTimeActivity.appointmentID>(Base.Activities.Cache, Base.Activities.Current, enableEmpTimeCardIntegration); PXUIFieldAttribute.SetVisible <FSxPMTimeActivity.appointmentCustomerID>(Base.Activities.Cache, Base.Activities.Current, enableEmpTimeCardIntegration); PXUIFieldAttribute.SetVisible <FSxPMTimeActivity.sOID>(Base.Activities.Cache, Base.Activities.Current, enableEmpTimeCardIntegration); PXUIFieldAttribute.SetVisible <FSxPMTimeActivity.logLineNbr>(Base.Activities.Cache, Base.Activities.Current, enableEmpTimeCardIntegration); PXUIFieldAttribute.SetVisible <FSxPMTimeActivity.serviceID>(Base.Activities.Cache, Base.Activities.Current, enableEmpTimeCardIntegration); }
protected virtual void EPTimeCard_RowPersisted(PXCache cache, PXRowPersistedEventArgs e) { if (e.Row == null || !TimeCardHelper.IsTheTimeCardIntegrationEnabled(Base)) { return; } EPTimeCard epTimeCardRow = (EPTimeCard)e.Row; if (epTimeCardRow.IsApproved == true && (bool)cache.GetValueOriginal <EPTimeCard.isApproved>(epTimeCardRow) == false && e.TranStatus == PXTranStatus.Open) { UpdateAppointmentFromApprovedTimeCard(cache); } }
public static void InsertUpdateDeleteTimeActivities( AppointmentEntry graphAppointmentEntry, PXCache appointmentCache, FSAppointment fsAppointmentRow, FSServiceOrder fsServiceOrderRow, AppointmentCore.AppointmentEmployees_View appointmentEmployees, List <FSAppointmentEmployee> deleteReleatedTimeActivity, List <FSAppointmentEmployee> createReleatedTimeActivity) { if (!TimeCardHelper.IsTheTimeCardIntegrationEnabled(graphAppointmentEntry) || (fsAppointmentRow.Status != ID.Status_Appointment.COMPLETED && fsAppointmentRow.Status != ID.Status_Appointment.MANUAL_SCHEDULED)) { return; } if (PXAccess.FeatureInstalled <FeaturesSet.timeReportingModule>() == false) { return; } EmployeeActivitiesEntry graphEmployeeActivitiesEntry = PXGraph.CreateInstance <EmployeeActivitiesEntry>(); if (IsNecessaryToUpdateTimeCards(appointmentCache, appointmentEmployees, fsAppointmentRow)) { foreach (FSAppointmentEmployee fsAppointmentEmployee in appointmentEmployees.Select().Where(y => ((FSAppointmentEmployee)y).Type == BAccountType.EmployeeType)) { EPActivityApprove epActivityApproveRow = null; EPActivityApprove oldEPActivityApproveRow = null; TMEPEmployee epEmployeeRow = null; int?oldEmployeeIDValue; FindTMEmployee(graphAppointmentEntry, fsAppointmentEmployee.EmployeeID, ref epEmployeeRow); FindEPActivityApprove(graphAppointmentEntry, fsAppointmentEmployee, epEmployeeRow, ref epActivityApproveRow); if (fsAppointmentEmployee.TrackTime == true) { oldEmployeeIDValue = (int?)graphAppointmentEntry.AppointmentEmployees.Cache.GetValueOriginal <FSAppointmentEmployee.employeeID>(fsAppointmentEmployee); if (oldEmployeeIDValue != fsAppointmentEmployee.EmployeeID) { TMEPEmployee oldEPEmployeeRow = null; FindTMEmployee(graphAppointmentEntry, oldEmployeeIDValue, ref oldEPEmployeeRow); FindEPActivityApprove(graphAppointmentEntry, fsAppointmentEmployee, oldEPEmployeeRow, ref oldEPActivityApproveRow); DeleteEPActivityApprove(graphEmployeeActivitiesEntry, oldEPActivityApproveRow); } InsertUpdateEPActivityApprove(graphAppointmentEntry, graphEmployeeActivitiesEntry, fsAppointmentEmployee, fsAppointmentRow, fsServiceOrderRow, epActivityApproveRow, epEmployeeRow); } else { if (epActivityApproveRow != null) { DeleteEPActivityApprove(graphEmployeeActivitiesEntry, epActivityApproveRow); } } } foreach (FSAppointmentEmployee fsAppointmentEmployee in appointmentEmployees.Cache.Deleted) { if (fsAppointmentEmployee.Type == BAccountType.EmployeeType) { SearchAndDeleteEPActivity(graphAppointmentEntry, fsAppointmentEmployee, graphEmployeeActivitiesEntry); } } } else if ((string)appointmentCache.GetValueOriginal <FSAppointment.status>(fsAppointmentRow) == ID.Status_Appointment.COMPLETED && fsAppointmentRow.Status == ID.Status_Appointment.MANUAL_SCHEDULED) { foreach (FSAppointmentEmployee fsAppointmentEmployee in appointmentEmployees.Select().Where(y => ((FSAppointmentEmployee)y).Type == BAccountType.EmployeeType)) { SearchAndDeleteEPActivity(graphAppointmentEntry, fsAppointmentEmployee, graphEmployeeActivitiesEntry); } foreach (FSAppointmentEmployee fsAppointmentEmployee in appointmentEmployees.Cache.Deleted) { if (fsAppointmentEmployee.Type == BAccountType.EmployeeType) { SearchAndDeleteEPActivity(graphAppointmentEntry, fsAppointmentEmployee, graphEmployeeActivitiesEntry); } } } if (deleteReleatedTimeActivity != null) { //Deleting time activities related with cancelled service lines foreach (FSAppointmentEmployee fsAppointmentEmployee in deleteReleatedTimeActivity) { if (fsAppointmentEmployee.Type == BAccountType.EmployeeType) { SearchAndDeleteEPActivity(graphAppointmentEntry, fsAppointmentEmployee, graphEmployeeActivitiesEntry); } } } if (createReleatedTimeActivity != null) { //Creating time activities related with re-opened service lines foreach (FSAppointmentEmployee fsAppointmentEmployee in createReleatedTimeActivity) { TMEPEmployee epEmployeeRow = null; FindTMEmployee(graphAppointmentEntry, fsAppointmentEmployee.EmployeeID, ref epEmployeeRow); InsertUpdateEPActivityApprove(graphAppointmentEntry, graphEmployeeActivitiesEntry, fsAppointmentEmployee, fsAppointmentRow, fsServiceOrderRow, null, epEmployeeRow); } } }