This commit is contained in:
@@ -538,7 +538,7 @@ namespace AyaNova.Util
|
|||||||
//then it should figure out what 9am in a -7 time zone is in UTC
|
//then it should figure out what 9am in a -7 time zone is in UTC
|
||||||
//and return that value
|
//and return that value
|
||||||
public DateTime DesiredTimeInUtc(DateTime dt)
|
public DateTime DesiredTimeInUtc(DateTime dt)
|
||||||
{
|
{
|
||||||
return dt.AddHours(0 - (double)TimeZoneOffset);
|
return dt.AddHours(0 - (double)TimeZoneOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -646,7 +646,7 @@ namespace AyaNova.Util
|
|||||||
c.ServiceRatesOverrideType = ContractOverrideType.PriceDiscount;
|
c.ServiceRatesOverrideType = ContractOverrideType.PriceDiscount;
|
||||||
c.TravelRatesOverridePct = 10;
|
c.TravelRatesOverridePct = 10;
|
||||||
c.TravelRatesOverrideType = ContractOverrideType.PriceDiscount;
|
c.TravelRatesOverrideType = ContractOverrideType.PriceDiscount;
|
||||||
c.ResponseTime = new TimeSpan(48, 0, 0);//48 hour response time
|
c.ResponseTime = new TimeSpan(48, 0, 0);//48 hour response time
|
||||||
c.ContractServiceRatesOnly = true;
|
c.ContractServiceRatesOnly = true;
|
||||||
c.ServiceRateItems.Add(new ContractServiceRate() { ServiceRateId = 2 });
|
c.ServiceRateItems.Add(new ContractServiceRate() { ServiceRateId = 2 });
|
||||||
c.ContractTravelRatesOnly = true;
|
c.ContractTravelRatesOnly = true;
|
||||||
@@ -2444,7 +2444,7 @@ namespace AyaNova.Util
|
|||||||
o.Notes = Fake.Lorem.Sentence();
|
o.Notes = Fake.Lorem.Sentence();
|
||||||
o.Tags = RandomTags();
|
o.Tags = RandomTags();
|
||||||
var tempDate = Fake.Date.Between(seedStartWindow, seedEndWindow);
|
var tempDate = Fake.Date.Between(seedStartWindow, seedEndWindow);
|
||||||
var tempHour=Fake.Random.Int(9,17);//9am to 5 pm (except some times may be in different dst state so this will be out by an hour for example depending on time of year and time zone in question)
|
var tempHour = Fake.Random.Int(9, 17);//9am to 5 pm (except some times may be in different dst state so this will be out by an hour for example depending on time of year and time zone in question)
|
||||||
var woDate = DesiredTimeInUtc(new DateTime(tempDate.Year, tempDate.Month, tempDate.Day, tempHour, 0, 0));
|
var woDate = DesiredTimeInUtc(new DateTime(tempDate.Year, tempDate.Month, tempDate.Day, tempHour, 0, 0));
|
||||||
|
|
||||||
|
|
||||||
@@ -2497,8 +2497,8 @@ namespace AyaNova.Util
|
|||||||
Notes = $"itemnotes - {y} ",
|
Notes = $"itemnotes - {y} ",
|
||||||
TechNotes = $"technotes - {y}",
|
TechNotes = $"technotes - {y}",
|
||||||
RequestDate = woDate.AddMinutes(y),
|
RequestDate = woDate.AddMinutes(y),
|
||||||
WorkorderItemPriorityId=Fake.Random.Long(1, 5),//there are 5 different sample priorities
|
WorkorderItemPriorityId = Fake.Random.Long(1, 5),//there are 5 different sample priorities
|
||||||
WorkorderItemStatusId=Fake.Random.Long(1, 3)//there are 3 different sample woitem status
|
WorkorderItemStatusId = Fake.Random.Long(1, 3)//there are 3 different sample woitem status
|
||||||
};
|
};
|
||||||
|
|
||||||
//SCHEDULED USERS
|
//SCHEDULED USERS
|
||||||
@@ -2527,12 +2527,12 @@ namespace AyaNova.Util
|
|||||||
//LABOR
|
//LABOR
|
||||||
var woItemLabor = new WorkOrderItemLabor()
|
var woItemLabor = new WorkOrderItemLabor()
|
||||||
{
|
{
|
||||||
UserId = RandomServiceTechUserId(),
|
UserId = RandomServiceTechUserId(),
|
||||||
ServiceRateQuantity = 1,
|
ServiceRateQuantity = 1,
|
||||||
ServiceStartDate = woDate,
|
ServiceStartDate = woDate,
|
||||||
ServiceStopDate = woDate.AddHours(1),
|
ServiceStopDate = woDate.AddHours(1),
|
||||||
ServiceRateId=Fake.Random.Long(1, TotalSeededServiceRates),
|
ServiceRateId = Fake.Random.Long(1, TotalSeededServiceRates),
|
||||||
ServiceDetails=Fake.Lorem.Sentence()
|
ServiceDetails = Fake.Lorem.Sentence()
|
||||||
};
|
};
|
||||||
woItem.Labors.Add(woItemLabor);
|
woItem.Labors.Add(woItemLabor);
|
||||||
|
|
||||||
@@ -2542,13 +2542,26 @@ namespace AyaNova.Util
|
|||||||
ServiceRateQuantity = 2,
|
ServiceRateQuantity = 2,
|
||||||
ServiceStartDate = woDate,
|
ServiceStartDate = woDate,
|
||||||
ServiceStopDate = woDate.AddHours(1),
|
ServiceStopDate = woDate.AddHours(1),
|
||||||
ServiceRateId=Fake.Random.Long(1, TotalSeededServiceRates),
|
ServiceRateId = Fake.Random.Long(1, TotalSeededServiceRates),
|
||||||
ServiceDetails=Fake.Lorem.Sentence()
|
ServiceDetails = Fake.Lorem.Sentence()
|
||||||
};
|
};
|
||||||
woItem.Labors.Add(woItemLabor);
|
woItem.Labors.Add(woItemLabor);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//TRAVEL
|
||||||
|
var woItemTravel = new WorkOrderItemTravel()
|
||||||
|
{
|
||||||
|
UserId = RandomServiceTechUserId(),
|
||||||
|
TravelRateQuantity = 1,
|
||||||
|
TravelStartDate = woDate,
|
||||||
|
TravelStopDate = woDate.AddHours(1),
|
||||||
|
TravelRateId = Fake.Random.Long(1, TotalSeededTravelRates),
|
||||||
|
TravelDetails = Fake.Lorem.Sentence(),
|
||||||
|
Distance = Fake.Random.Decimal(1.0m, 20.0m)
|
||||||
|
};
|
||||||
|
woItem.Travels.Add(woItemTravel);
|
||||||
|
|
||||||
|
|
||||||
//EXPENSES
|
//EXPENSES
|
||||||
var cost = Fake.Random.Decimal(1, 10);
|
var cost = Fake.Random.Decimal(1, 10);
|
||||||
|
|||||||
Reference in New Issue
Block a user