This commit is contained in:
@@ -253,6 +253,18 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isNew && (proposedObj.Cost != currentObj.Cost || proposedObj.Charge != currentObj.Charge))
|
||||||
|
{
|
||||||
|
if (await ct.ContractServiceRate.AnyAsync(x => x.ServiceRateId == proposedObj.Id))
|
||||||
|
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("Contract"));
|
||||||
|
|
||||||
|
if (await ct.WorkOrderItemLabor.AnyAsync(x => x.ServiceRateId == proposedObj.Id))
|
||||||
|
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("WorkOrderItemLabor"));
|
||||||
|
|
||||||
|
if (await ct.WorkOrderItemScheduledUser.AnyAsync(x => x.ServiceRateId == proposedObj.Id))
|
||||||
|
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("WorkOrderItemScheduledUser"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//Any form customizations to validate?
|
//Any form customizations to validate?
|
||||||
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(x => x.FormKey == AyaType.ServiceRate.ToString());
|
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(x => x.FormKey == AyaType.ServiceRate.ToString());
|
||||||
|
|||||||
@@ -254,6 +254,19 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (!isNew && (proposedObj.Cost != currentObj.Cost || proposedObj.Charge != currentObj.Charge))
|
||||||
|
{
|
||||||
|
|
||||||
|
if (await ct.ContractTravelRate.AnyAsync(x => x.TravelRateId == proposedObj.Id))
|
||||||
|
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("Contract"));
|
||||||
|
|
||||||
|
if (await ct.WorkOrderItemTravel.AnyAsync(x => x.TravelRateId == proposedObj.Id))
|
||||||
|
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("WorkOrderItemTravel"));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Any form customizations to validate?
|
//Any form customizations to validate?
|
||||||
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(x => x.FormKey == AyaType.TravelRate.ToString());
|
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(x => x.FormKey == AyaType.TravelRate.ToString());
|
||||||
if (FormCustomization != null)
|
if (FormCustomization != null)
|
||||||
|
|||||||
@@ -581,12 +581,12 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
|||||||
|
|
||||||
//CONTRACTSERVICERATE
|
//CONTRACTSERVICERATE
|
||||||
await ExecQueryAsync("CREATE TABLE acontractservicerate (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, contractid BIGINT NOT NULL REFERENCES acontract ON DELETE CASCADE, "
|
await ExecQueryAsync("CREATE TABLE acontractservicerate (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, contractid BIGINT NOT NULL REFERENCES acontract ON DELETE CASCADE, "
|
||||||
+ "servicerateid BIGINT NOT NULL REFERENCES aservicerate ON DELETE CASCADE"
|
+ "servicerateid BIGINT NOT NULL REFERENCES aservicerate "
|
||||||
+ ")");
|
+ ")");
|
||||||
|
|
||||||
//CONTRACTTRAVELERATE
|
//CONTRACTTRAVELERATE
|
||||||
await ExecQueryAsync("CREATE TABLE acontracttravelrate (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, contractid BIGINT NOT NULL REFERENCES acontract ON DELETE CASCADE, "
|
await ExecQueryAsync("CREATE TABLE acontracttravelrate (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, contractid BIGINT NOT NULL REFERENCES acontract ON DELETE CASCADE, "
|
||||||
+ "travelrateid BIGINT NOT NULL REFERENCES atravelrate ON DELETE CASCADE"
|
+ "travelrateid BIGINT NOT NULL REFERENCES atravelrate "
|
||||||
+ ")");
|
+ ")");
|
||||||
|
|
||||||
//CONTRACTPARTOVERRIDE
|
//CONTRACTPARTOVERRIDE
|
||||||
|
|||||||
Reference in New Issue
Block a user