This commit is contained in:
@@ -408,6 +408,8 @@ namespace AyaNova.Biz
|
|||||||
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("Customer"));
|
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("Customer"));
|
||||||
if (await ct.HeadOffice.AnyAsync(m => m.ContractId == inObj.Id))
|
if (await ct.HeadOffice.AnyAsync(m => m.ContractId == inObj.Id))
|
||||||
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("HeadOffice"));
|
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"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -682,6 +682,8 @@ namespace AyaNova.Biz
|
|||||||
l.Add(new FormField { TKey = "UnitModel", FieldKey = "UnitModelId" });
|
l.Add(new FormField { TKey = "UnitModel", FieldKey = "UnitModelId" });
|
||||||
l.Add(new FormField { TKey = "UnitReplacedByUnitID", FieldKey = "ReplacedByUnitId" });
|
l.Add(new FormField { TKey = "UnitReplacedByUnitID", FieldKey = "ReplacedByUnitId" });
|
||||||
l.Add(new FormField { TKey = "UnitParentUnitID", FieldKey = "ParentUnitId" });
|
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 = "UsesBanking", FieldKey = "UsesBanking" });
|
||||||
l.Add(new FormField { TKey = "UnitMetered", FieldKey = "Metered" });
|
l.Add(new FormField { TKey = "UnitMetered", FieldKey = "Metered" });
|
||||||
l.Add(new FormField { TKey = "UnitBoughtHere", FieldKey = "BoughtHere" });
|
l.Add(new FormField { TKey = "UnitBoughtHere", FieldKey = "BoughtHere" });
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ namespace AyaNova.Models
|
|||||||
public int? WarrantyLength { get; set; }
|
public int? WarrantyLength { get; set; }
|
||||||
public string WarrantyTerms { get; set; }
|
public string WarrantyTerms { get; set; }
|
||||||
public bool UsesBanking { get; set; }
|
public bool UsesBanking { get; set; }
|
||||||
|
public long? ContractId { get; set; }
|
||||||
public bool Metered { get; set; }
|
public bool Metered { get; set; }
|
||||||
public bool LifeTimeWarranty { get; set; }
|
public bool LifeTimeWarranty { get; set; }
|
||||||
public string Text1 { get; set; }
|
public string Text1 { get; set; }
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ 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 = 785;
|
internal const long EXPECTED_COLUMN_COUNT = 786;
|
||||||
internal const long EXPECTED_INDEX_COUNT = 130;
|
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_FOREIGN_KEY_CONSTRAINTS = 77;
|
||||||
internal const long EXPECTED_VIEWS = 3;
|
internal const long EXPECTED_VIEWS = 3;
|
||||||
internal const long EXPECTED_ROUTINES = 2;
|
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), "
|
+ "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), "
|
+ "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), "
|
+ "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, "
|
+ "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) "
|
+ "CONSTRAINT unq_unitserialmodelid UNIQUE (serial, unitmodelid) "
|
||||||
+ " )");
|
+ " )");
|
||||||
|
|||||||
Reference in New Issue
Block a user