This commit is contained in:
2021-02-19 18:43:42 +00:00
parent 7a76b2e361
commit f7dbea1bad
3 changed files with 20 additions and 20 deletions

View File

@@ -87,6 +87,8 @@ namespace AyaNova.Biz
item.ReceivedCost = 0; item.ReceivedCost = 0;
item.ReceivedDate = null; item.ReceivedDate = null;
item.PurchaseOrderId = 0; item.PurchaseOrderId = 0;
item.WorkorderItemPartRequestId=null;
item.PartRequestedById=null;
} }
newObject.Id = 0; newObject.Id = 0;
newObject.Concurrency = 0; newObject.Concurrency = 0;
@@ -96,6 +98,7 @@ namespace AyaNova.Biz
await SearchIndexAsync(newObject, true); await SearchIndexAsync(newObject, true);
await TagBiz.ProcessUpdateTagsInRepositoryAsync(ct, newObject.Tags, null); await TagBiz.ProcessUpdateTagsInRepositoryAsync(ct, newObject.Tags, null);
await HandlePotentialNotificationEvent(AyaEvent.Created, newObject); await HandlePotentialNotificationEvent(AyaEvent.Created, newObject);
await SetDisplayFields(newObject);
return newObject; return newObject;
} }
@@ -108,7 +111,6 @@ namespace AyaNova.Biz
await SetDisplayFields(ret); await SetDisplayFields(ret);
if (logTheGetEvent && ret != null) if (logTheGetEvent && ret != null)
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, id, BizType, AyaEvent.Retrieved), ct); await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, id, BizType, AyaEvent.Retrieved), ct);
return ret; return ret;
@@ -124,7 +126,7 @@ namespace AyaNova.Biz
//populate server fields for client ui //populate server fields for client ui
//Show Warehouses //Show Warehouses
po.DisplayWarehouses = await ct.PartWarehouse.CountAsync() > 1; po.DisplayWarehouses = await ct.PartWarehouse.CountAsync() > 1;
//Show PartRequest fields? //Show PartRequest fields?
po.DisplayPartRequest = false; po.DisplayPartRequest = false;
@@ -170,7 +172,6 @@ namespace AyaNova.Biz
item.DisplayLineTotal = dNet + dTaxA + dTaxB; item.DisplayLineTotal = dNet + dTaxA + dTaxB;
} }
} }
} }
@@ -215,6 +216,7 @@ namespace AyaNova.Biz
await SearchIndexAsync(putObject, false); await SearchIndexAsync(putObject, false);
await TagBiz.ProcessUpdateTagsInRepositoryAsync(ct, putObject.Tags, dbObject.Tags); await TagBiz.ProcessUpdateTagsInRepositoryAsync(ct, putObject.Tags, dbObject.Tags);
await HandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject); await HandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
await SetDisplayFields(putObject);
return putObject; return putObject;
} }
} }

View File

@@ -234,26 +234,25 @@ namespace AyaNova.Biz
|| ServerGlobalBizSettings.TaxPartSaleId == proposedObj.Id || ServerGlobalBizSettings.TaxPartSaleId == proposedObj.Id
|| ServerGlobalBizSettings.TaxRateSaleId == 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 if (await ct.PurchaseOrderItem.AnyAsync(x => x.PurchaseTaxCodeId == proposedObj.Id))
&& proposedObj.Name != currentObj.Name AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("PurchaseOrder"));
|| 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 (isGlobalDefault) if (isGlobalDefault)
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("AdministrationGlobalSettings")); AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("AdministrationGlobalSettings"));
} }
//Active not changeable for global default //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")); AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Active", await Translate("TaxCodeDefault"));
//Name required //Name required
if (string.IsNullOrWhiteSpace(proposedObj.Name)) if (string.IsNullOrWhiteSpace(proposedObj.Name))
AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name"); AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name");

View File

@@ -22,8 +22,7 @@ namespace AyaNova.Util
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!! //!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!
private const int DESIRED_SCHEMA_LEVEL = 15; private const int DESIRED_SCHEMA_LEVEL = 15;
internal const long EXPECTED_COLUMN_COUNT = 735;
internal const long EXPECTED_COLUMN_COUNT = 732;
internal const long EXPECTED_INDEX_COUNT = 125; internal const long EXPECTED_INDEX_COUNT = 125;
internal const long EXPECTED_CHECK_CONSTRAINTS = 327; internal const long EXPECTED_CHECK_CONSTRAINTS = 327;
internal const long EXPECTED_FOREIGN_KEY_CONSTRAINTS = 70; internal const long EXPECTED_FOREIGN_KEY_CONSTRAINTS = 70;