This commit is contained in:
2
.vscode/launch.json
vendored
2
.vscode/launch.json
vendored
@@ -54,7 +54,7 @@
|
|||||||
"AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles",
|
"AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles",
|
||||||
"AYANOVA_FOLDER_TEMPORARY_SERVER_FILES": "c:\\temp\\RavenTestData\\tempfiles",
|
"AYANOVA_FOLDER_TEMPORARY_SERVER_FILES": "c:\\temp\\RavenTestData\\tempfiles",
|
||||||
"AYANOVA_SERVER_TEST_MODE": "false",
|
"AYANOVA_SERVER_TEST_MODE": "false",
|
||||||
"AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "large",
|
"AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small",
|
||||||
"AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-7",
|
"AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-7",
|
||||||
"AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_13\\bin\\"
|
"AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_13\\bin\\"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ namespace AyaNova.Biz
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
//the "for sure can not view labor cost" user types
|
//the "for sure can not view labor/travel cost" user types
|
||||||
switch (CurrentUserType)
|
switch (CurrentUserType)
|
||||||
{
|
{
|
||||||
case UserType.Customer:
|
case UserType.Customer:
|
||||||
@@ -101,6 +101,26 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal bool UserCanViewLoanerCosts
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
//the "for sure can not view loaner cost" user types
|
||||||
|
switch (CurrentUserType)
|
||||||
|
{
|
||||||
|
case UserType.Customer:
|
||||||
|
case UserType.HeadOffice:
|
||||||
|
case UserType.ServiceContractor:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
//Now check roles (same as rates as accessed via svc area)
|
||||||
|
return (CurrentUserRoles.HasFlag(AuthorizationRoles.Service)
|
||||||
|
|| CurrentUserRoles.HasFlag(AuthorizationRoles.ServiceRestricted)
|
||||||
|
|| CurrentUserRoles.HasFlag(AuthorizationRoles.BizAdmin)
|
||||||
|
|| CurrentUserRoles.HasFlag(AuthorizationRoles.Accounting));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// internal bool IsTechRestricted
|
// internal bool IsTechRestricted
|
||||||
// {
|
// {
|
||||||
// get
|
// get
|
||||||
@@ -280,17 +300,17 @@ namespace AyaNova.Biz
|
|||||||
.ThenInclude(wi => wi.OutsideServices)
|
.ThenInclude(wi => wi.OutsideServices)
|
||||||
.SingleOrDefaultAsync(z => z.Id == id);
|
.SingleOrDefaultAsync(z => z.Id == id);
|
||||||
|
|
||||||
|
if (ret != null)
|
||||||
|
{
|
||||||
|
var stat = await GetCurrentWorkOrderStatusFromRelatedAsync(BizType, ret.Id);
|
||||||
|
ret.IsLockedAtServer = stat.Locked;
|
||||||
|
|
||||||
//todo: set isLocked from state
|
if (populateDisplayFields)
|
||||||
var stat = await GetCurrentWorkOrderStatusFromRelatedAsync(BizType, ret.Id);
|
await WorkOrderPopulateVizFields(ret, false);
|
||||||
ret.IsLockedAtServer = stat.Locked;
|
|
||||||
|
|
||||||
|
if (logTheGetEvent && ret != null)
|
||||||
if (populateDisplayFields)
|
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, id, BizType, AyaEvent.Retrieved), ct);
|
||||||
await WorkOrderPopulateVizFields(ret, false);
|
}
|
||||||
|
|
||||||
if (logTheGetEvent && ret != null)
|
|
||||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, id, BizType, AyaEvent.Retrieved), ct);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3385,6 +3405,11 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
o.LineTotalViz = o.NetViz + o.TaxAViz + o.TaxBViz;
|
o.LineTotalViz = o.NetViz + o.TaxAViz + o.TaxBViz;
|
||||||
|
|
||||||
|
//RESTRICTED COST FIELD??
|
||||||
|
if (!UserCanViewLoanerCosts)
|
||||||
|
o.Cost = 0;//cost already used in calcs and will not be updated on any update operation so this ensures the cost isn't sent over the wire
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
@@ -3407,7 +3432,12 @@ namespace AyaNova.Biz
|
|||||||
{
|
{
|
||||||
//If it wasn't a complete part change there is no need to set pricing
|
//If it wasn't a complete part change there is no need to set pricing
|
||||||
if (newObj.LoanUnitId == oldObj.LoanUnitId && newObj.Rate == oldObj.Rate)
|
if (newObj.LoanUnitId == oldObj.LoanUnitId && newObj.Rate == oldObj.Rate)
|
||||||
|
{
|
||||||
SnapshotPricing = false;
|
SnapshotPricing = false;
|
||||||
|
//maintain old cost as it can come from the client as zero when it shouldn't be or someone using the api and setting it directly
|
||||||
|
//but we will only allow the price *we* set at the server initially
|
||||||
|
newObj.Cost = oldObj.Cost;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Pricing
|
//Pricing
|
||||||
|
|||||||
@@ -2141,11 +2141,17 @@ namespace AyaNova.Util
|
|||||||
o.Tags = RandomTags();
|
o.Tags = RandomTags();
|
||||||
|
|
||||||
o.RateHour = Fake.Random.Decimal(1, 25);
|
o.RateHour = Fake.Random.Decimal(1, 25);
|
||||||
|
o.RateHourCost=o.RateHour/2;
|
||||||
o.RateHalfDay = o.RateHour * 4;
|
o.RateHalfDay = o.RateHour * 4;
|
||||||
|
o.RateHalfDayCost=o.RateHalfDay/2;
|
||||||
o.RateDay = o.RateHour * 8;
|
o.RateDay = o.RateHour * 8;
|
||||||
|
o.RateDayCost=o.RateDay/2;
|
||||||
o.RateWeek = o.RateHour * 36.8m;
|
o.RateWeek = o.RateHour * 36.8m;
|
||||||
|
o.RateWeekCost=o.RateWeek/2;
|
||||||
o.RateMonth = o.RateHour * 21 * 8;
|
o.RateMonth = o.RateHour * 21 * 8;
|
||||||
|
o.RateMonthCost=o.RateMonth/2;
|
||||||
o.RateYear = o.RateHour * 36.8m * 52;
|
o.RateYear = o.RateHour * 36.8m * 52;
|
||||||
|
o.RateYearCost=o.RateYear/2;
|
||||||
o.DefaultRate = Fake.Random.Enum<LoanUnitRateUnit>();
|
o.DefaultRate = Fake.Random.Enum<LoanUnitRateUnit>();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user