This commit is contained in:
@@ -303,7 +303,8 @@ namespace AyaNova.Biz
|
||||
if (!PropertyHasErrors("Name"))
|
||||
{
|
||||
//Use Any command is efficient way to check existance, it doesn't return the record, just a true or false
|
||||
if (await ct.Report.AnyAsync(z => z.Name == proposedObj.Name && z.Id != proposedObj.Id))
|
||||
//NOTE: unlike other objects reports can have the same name as long as the type differs
|
||||
if (await ct.Report.AnyAsync(z => z.Name == proposedObj.Name && z.AType==proposedObj.AType && z.Id != proposedObj.Id))
|
||||
{
|
||||
AddError(ApiErrorCode.VALIDATION_NOT_UNIQUE, "Name");
|
||||
}
|
||||
|
||||
@@ -1175,10 +1175,10 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
||||
+ "large bytea, largetype TEXT, medium bytea, mediumtype TEXT, small bytea, smalltype TEXT)");
|
||||
|
||||
//REPORTS
|
||||
await ExecQueryAsync("CREATE TABLE areport (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name TEXT NOT NULL UNIQUE, active BOOL NOT NULL, "
|
||||
await ExecQueryAsync("CREATE TABLE areport (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name TEXT NOT NULL, active BOOL NOT NULL, "
|
||||
+ "notes TEXT, roles INTEGER NOT NULL, atype INTEGER NOT NULL, includewoitemdescendants BOOL, template TEXT, style TEXT, jsprerender TEXT, jshelpers TEXT, rendertype INTEGER NOT NULL, "
|
||||
+ "headertemplate TEXT, footertemplate TEXT, displayheaderfooter BOOL, paperformat INTEGER NOT NULL, landscape BOOL, marginoptionsbottom TEXT, "
|
||||
+ "marginoptionsleft TEXT, marginoptionsright TEXT, marginoptionstop TEXT, pageranges TEXT, prefercsspagesize BOOL, printbackground BOOL, scale DECIMAL(8,5) )");
|
||||
+ "marginoptionsleft TEXT, marginoptionsright TEXT, marginoptionstop TEXT, pageranges TEXT, prefercsspagesize BOOL, printbackground BOOL, scale DECIMAL(8,5), UNIQUE(name,atype))");
|
||||
|
||||
//Global customer default workorder report default
|
||||
await ExecQueryAsync("ALTER TABLE aglobalbizsettings ADD column customerdefaultworkorderreportid BIGINT REFERENCES areport(id) ");
|
||||
|
||||
Reference in New Issue
Block a user