This commit is contained in:
2021-07-14 17:53:30 +00:00
parent ab0c648869
commit a6c234f4ab

View File

@@ -2627,7 +2627,7 @@ namespace AyaNova.Biz
if (isNew && UserIsTechRestricted)
{
//NEW record, they are not allowed to set several fields so make sure they are still at their defaults
/*
/* from client new expense record:
concurrency: 0,
description: null,
name: null,
@@ -2644,6 +2644,11 @@ namespace AyaNova.Biz
workOrderItemId: this.value.items[this.activeWoItemIndex].id,
uid: Date.now() //used for
*/
if (currentObj.ChargeAmount != 0) AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "ChargeAmount");
if (currentObj.TaxPaid != 0) AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "TaxPaid");
if (currentObj.ChargeTaxCodeId != null) AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "ChargeTaxCodeId");
if (currentObj.ReimburseUser != false) AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "ReimburseUser");
if (currentObj.ChargeToCustomer != false) AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "ChargeToCustomer");
}
@@ -5490,17 +5495,10 @@ namespace AyaNova.Biz
if (currentObj.Sequence != proposedObj.Sequence) AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "Sequence");
}
if (isNew && UserIsTechRestricted)
{
//NEW record, they are not allowed to set several fields so make sure they are still at their defaults
todo
}
if (string.IsNullOrWhiteSpace(proposedObj.Task))
AddError(ApiErrorCode.VALIDATION_REQUIRED, "Task");
//Any form customizations to validate?
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(z => z.FormKey == AyaType.WorkOrderItemTask.ToString());
if (FormCustomization != null)