This commit is contained in:
2021-03-05 19:29:29 +00:00
parent f1dbe5c752
commit 0ab5c61f02
4 changed files with 8 additions and 3 deletions

View File

@@ -408,6 +408,8 @@ namespace AyaNova.Biz
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("Customer"));
if (await ct.HeadOffice.AnyAsync(m => m.ContractId == inObj.Id))
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("HeadOffice"));
if (await ct.Unit.AnyAsync(m => m.ContractId == inObj.Id))
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("Unit"));
}

View File

@@ -682,6 +682,8 @@ namespace AyaNova.Biz
l.Add(new FormField { TKey = "UnitModel", FieldKey = "UnitModelId" });
l.Add(new FormField { TKey = "UnitReplacedByUnitID", FieldKey = "ReplacedByUnitId" });
l.Add(new FormField { TKey = "UnitParentUnitID", FieldKey = "ParentUnitId" });
l.Add(new FormField { TKey = "Contract", FieldKey = "ContractId" });
l.Add(new FormField { TKey = "ContractExpires", FieldKey = "ContractExpires" });
l.Add(new FormField { TKey = "UsesBanking", FieldKey = "UsesBanking" });
l.Add(new FormField { TKey = "UnitMetered", FieldKey = "Metered" });
l.Add(new FormField { TKey = "UnitBoughtHere", FieldKey = "BoughtHere" });

View File

@@ -48,6 +48,7 @@ namespace AyaNova.Models
public int? WarrantyLength { get; set; }
public string WarrantyTerms { get; set; }
public bool UsesBanking { get; set; }
public long? ContractId { get; set; }
public bool Metered { get; set; }
public bool LifeTimeWarranty { get; set; }
public string Text1 { get; set; }

View File

@@ -22,9 +22,9 @@ namespace AyaNova.Util
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!
private const int DESIRED_SCHEMA_LEVEL = 15;
internal const long EXPECTED_COLUMN_COUNT = 785;
internal const long EXPECTED_COLUMN_COUNT = 786;
internal const long EXPECTED_INDEX_COUNT = 130;
internal const long EXPECTED_CHECK_CONSTRAINTS = 356;
internal const long EXPECTED_CHECK_CONSTRAINTS = 357;
internal const long EXPECTED_FOREIGN_KEY_CONSTRAINTS = 77;
internal const long EXPECTED_VIEWS = 3;
internal const long EXPECTED_ROUTINES = 2;
@@ -798,7 +798,7 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
+ "serial TEXT NOT NULL, customerid BIGINT NOT NULL REFERENCES acustomer(id), parentunitid BIGINT NULL REFERENCES aunit(id), "
+ "unitmodelid BIGINT NULL REFERENCES aunitmodel(id), unithasownaddress BOOL, boughthere BOOL, purchasedfromvendorid BIGINT NULL REFERENCES avendor(id), "
+ "receipt TEXT NULL, purchaseddate TIMESTAMP NULL, description TEXT NULL, replacedbyunitid BIGINT NULL REFERENCES aunit(id), "
+ "overridemodelwarranty BOOL, warrantylength INTEGER NULL, warrantyterms TEXT NULL, usesbanking BOOL, metered BOOL, lifetimewarranty BOOL, "
+ "overridemodelwarranty BOOL, warrantylength INTEGER NULL, warrantyterms TEXT NULL, contractid BIGINT NULL REFERENCES acontract, usesbanking BOOL, metered BOOL, lifetimewarranty BOOL, "
+ "text1 TEXT NULL, text2 TEXT NULL, text3 TEXT NULL, text4 TEXT NULL, address TEXT NULL, city TEXT NULL, region TEXT NULL, country TEXT NULL, latitude DECIMAL(8,6) NULL, longitude DECIMAL(9,6) NULL, "
+ "CONSTRAINT unq_unitserialmodelid UNIQUE (serial, unitmodelid) "
+ " )");