This commit is contained in:
@@ -234,26 +234,25 @@ namespace AyaNova.Biz
|
||||
|| ServerGlobalBizSettings.TaxPartSaleId == proposedObj.Id
|
||||
|| ServerGlobalBizSettings.TaxRateSaleId == proposedObj.Id);
|
||||
|
||||
if (!isNew)
|
||||
if (proposedObj.Name != currentObj.Name
|
||||
|| proposedObj.TaxA != currentObj.TaxA
|
||||
|| proposedObj.TaxB != currentObj.TaxB
|
||||
|| proposedObj.TaxOnTax != currentObj.TaxOnTax)
|
||||
{
|
||||
//MIGRATE_OUTSTANDING - check workorder records once wo is coded here for this tax code in use
|
||||
|
||||
if (!isNew
|
||||
&& proposedObj.Name != currentObj.Name
|
||||
|| proposedObj.TaxA != currentObj.TaxA
|
||||
|| proposedObj.TaxB != currentObj.TaxB
|
||||
|| proposedObj.TaxOnTax != currentObj.TaxOnTax)
|
||||
{
|
||||
//MIGRATE_OUTSTANDING - check workorder records once wo is coded here for this tax code in use
|
||||
|
||||
if (await ct.PurchaseOrderItem.AnyAsync(x => x.PurchaseTaxCodeId == proposedObj.Id))
|
||||
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("PurchaseOrder"));
|
||||
if (await ct.PurchaseOrderItem.AnyAsync(x => x.PurchaseTaxCodeId == proposedObj.Id))
|
||||
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("PurchaseOrder"));
|
||||
|
||||
if (isGlobalDefault)
|
||||
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("AdministrationGlobalSettings"));
|
||||
}
|
||||
if (isGlobalDefault)
|
||||
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("AdministrationGlobalSettings"));
|
||||
}
|
||||
|
||||
//Active not changeable for global default
|
||||
if (isGlobalDefault && proposedObj.Active == false)
|
||||
if (isGlobalDefault && proposedObj.Active == false)
|
||||
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Active", await Translate("TaxCodeDefault"));
|
||||
|
||||
|
||||
//Name required
|
||||
if (string.IsNullOrWhiteSpace(proposedObj.Name))
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name");
|
||||
|
||||
Reference in New Issue
Block a user