Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List<Time_Entry_Type__c> timeEntryTypes = new List<Time_Entry_Type__c>();
- Time_Entry_Type__c billShift1Hours = new Time_Entry_Type__c();
- billShift1Hours.Name = 'Bill Shift 1 Hours';
- billShift1Hours.Extra_Shift__c = true;
- billShift1Hours.Counted_For_Rules__c = true;
- billShift1Hours.Is_Count_As_Shift__c = false;
- billShift1Hours.Has_Break_Section__c = true;
- billShift1Hours.Is_Callback_Type__c = false;
- billShift1Hours.Regular_Weekly_Rule__c = false;
- billShift1Hours.Regular_Field_Pay_Type__c = 'Bill Shift 1 Pay';
- billShift1Hours.Regular_Hours_Pay_Rate_Field__c = 'Bill_Shift1_Pay_Rate__c';
- billShift1Hours.Regular_Field_Bill_Type__c = 'Bill Shift 1 Bill';
- billShift1Hours.Regular_Hours_Bill_Rate_Field__c = 'Bill_Shift1_Bill_Rate__c';
- billShift1Hours.OT_Pay__c = true;
- billShift1Hours.OT_Field_Pay_Type__c = 'Bill Shift 1 OT Pay';
- billShift1Hours.OT_Hours_Pay_Rate_Field__c = 'Bill_Shift1_OT_Pay_Rate__c';
- billShift1Hours.OT_Bill__c = true;
- billShift1Hours.OT_Field_Bill_Type__c = 'Bill Shift 1 OT Bill';
- billShift1Hours.OT_Hours_Bill_Rate_Field__c = 'Bill_Shift1_OT_Bill_Rate__c';
- billShift1Hours.Double_OT_Pay__c = true;
- billShift1Hours.Double_OT_Field_Pay_Type__c = 'Bill Shift 1 Double OT Pay';
- billShift1Hours.Double_Hours_Pay_Rate_Field__c = 'Bill_Shift1_Double_OT_Pay_Rate__c';
- billShift1Hours.Double_OT_Bill__c = true;
- billShift1Hours.Double_OT_Field_Bill_Type__c = 'Bill Shift 1 Double OT Bill';
- billShift1Hours.Double_Hours_Bill_Rate_Field__c = 'Bill_Shift1_Double_OT_Bill_Rate__c';
- timeEntryTypes.add(billShift1Hours);
- Time_Entry_Type__c regularHours = new Time_Entry_Type__c();
- regularHours.Name = 'Regular Hours';
- regularHours.Extra_Shift__c = true;
- regularHours.Counted_For_Rules__c = true;
- regularHours.Is_Count_As_Shift__c = true;
- regularHours.Has_Break_Section__c = true;
- regularHours.Is_Callback_Type__c = false;
- regularHours.Regular_Weekly_Rule__c = true;
- regularHours.Regular_Field_Pay_Type__c = 'Regular Pay';
- regularHours.Regular_Hours_Pay_Rate_Field__c = 'Reg_Pay_Rate__c';
- regularHours.Regular_Field_Bill_Type__c = 'Regular Bill';
- regularHours.Regular_Hours_Bill_Rate_Field__c = 'Reg_Bill_Rate__c';
- regularHours.OT_Pay__c = true;
- regularHours.OT_Field_Pay_Type__c = 'OT Pay';
- regularHours.OT_Hours_Pay_Rate_Field__c = 'OT_Pay_Rate__c';
- regularHours.OT_Bill__c = true;
- regularHours.OT_Field_Bill_Type__c = 'OT Bill';
- regularHours.OT_Hours_Bill_Rate_Field__c = 'OT_Bill_Rate__c';
- regularHours.Double_OT_Pay__c = true;
- regularHours.Double_OT_Field_Pay_Type__c = 'Double OT Pay';
- regularHours.Double_Hours_Pay_Rate_Field__c = 'Double_OT_Pay_Rate__c';
- regularHours.Double_OT_Bill__c = true;
- regularHours.Double_OT_Field_Bill_Type__c = 'Double OT Bill';
- regularHours.Double_Hours_Bill_Rate_Field__c = 'Double_OT_Bill_Rate__c';
- timeEntryTypes.add(regularHours);
- insert timeEntryTypes;
- Time_Entry_Type__c regular = [SELECT Id FROM Time_Entry_Type__c WHERE Name = 'Regular Hours'];
- Billing_Card__c bc = new Billing_Card__c();
- bc.Billing_Card_Name_text__c = 'Supplemental - Boston Medical CenterUndo';
- bc.Reverse_Invoicing__c = 'Yes';
- bc.VMS_Discount_Fee__c = 'Fee';
- bc.Billing_Frequency__c = 'Bi-Weekly Standard';
- bc.Invoice_Split_Type__c = 'By Caregiver';
- bc.Reverse_Invoice_Approval_Required__c = 'Yes';
- bc.Work_Week__c = 'Sunday-Saturday';
- bc.Orientation_Rate__c = 'Full Rate';
- bc.VMS_Percentage__c = 4.23;
- bc.Early_Prompt_Pay_Discount__c = 0.00;
- bc.Orientation_Burden__c = 8;
- bc.Callback_Minimum_Hours__c = 2;
- bc.Effective_Date__c = Date.newInstance(2018, 06, 11);
- bc.Special_Billing_Instructions__c = 'test';
- bc.Time_Entries_Rounding_Rules__c = '15 minutes';
- bc.VMS_Discount_Fee__c = 'Discount';
- insert bc;
- Clinician_Rate_Sheet__c rateSheet1 = new Clinician_Rate_Sheet__c(
- Rate_Sheet_Start_Date__c = Date.today().addMonths(-2),
- Rate_Sheet_End_Date__c = Date.today().addMonths(2),
- Submission_Status__c = 'Pending',
- Travel_Order__c = [SELECT Id FROM order__c LIMIT 1].Id,
- Clinician__c = [SELECT Id FROM Temp__c ORDER BY Name DESC LIMIT 1].Id,
- VMS_Fee__c = 4.23
- );
- rateSheet1.Rate_Sheet_Start_Date__c = Date.newInstance(2018, 11, 11);
- rateSheet1.Rate_Sheet_End_Date__c = Date.newInstance(2018, 11, 24);
- rateSheet1.Billing_Card__c = bc.Id;
- rateSheet1.Submission_Status__c = 'Filled';
- insert rateSheet1;
- List<TimeCard__c> timeCards = TimeCardService.generateTimeCards(new List<Id>{rateSheet1.Id});
- List<TimeCard_Record__c> timeCardRecords = [SELECT Id FROM TimeCard_Record__c WHERE TimeCard__c In : timeCards];
- for (TimeCard_Record__c record : timeCardRecords) {
- record.Filled__c = true;
- }
- update timeCardRecords;
- List<Time_Entry__c> entries = new List<Time_Entry__c>();
- for (TimeCard_Record__c record : timeCardRecords) {
- Time_Entry__c entry = new Time_Entry__c();
- entry.Time_Entry_Type__c = regular.Id;
- entry.Time_Card_Record__c = record.Id;
- entry.Check_In__c = Time.newInstance(12, 30, 0, 0);
- entry.Check_Out__c = Time.newInstance(22, 30, 0, 0);
- entry.Break__c = 0.50;
- entries.add(entry);
- }
- insert entries;
- List<Time_Entry_Part__c> entryParts = new List<Time_Entry_Part__c>();
- for (Time_Entry__c entry : entries) {
- Time_Entry_Part__c part = new Time_Entry_Part__c();
- part.Time_Entry__c = entry.Id;
- part.Hours_Amount__c = 9.50;
- part.Time_Entry_Part_Type__c = 'Regular Bill';
- part.Rate__c = 18.00;
- part.Bill__c = true;
- part.Exported__c = true;
- entryParts.add(part);
- }
- insert entryParts;
- for (TimeCard__c timeCard : timeCards) {
- timeCard.Paylocity_Exported__c = true;
- }
- TriggerHandler.disabled = true;
- update timeCards;
- TriggerHandler.disabled = false;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement