From 7b6797e6bbfdb1fc9b345ee9bf7da1e77878ad85 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 17 Jun 2021 15:34:49 +0000 Subject: [PATCH] --- server/AyaNova/DataList/WorkOrderDataList.cs | 97 +++++++++++++++++++- server/AyaNova/util/AySchema.cs | 4 +- 2 files changed, 96 insertions(+), 5 deletions(-) diff --git a/server/AyaNova/DataList/WorkOrderDataList.cs b/server/AyaNova/DataList/WorkOrderDataList.cs index 28f8aed2..cfc5c211 100644 --- a/server/AyaNova/DataList/WorkOrderDataList.cs +++ b/server/AyaNova/DataList/WorkOrderDataList.cs @@ -13,7 +13,7 @@ namespace AyaNova.DataList + "left join acontract on (aworkorder.contractid=acontract.id)"; var RoleSet = BizRoles.GetRoleSet(DefaultListAType); AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change; - DefaultColumns = new List() { "WorkOrderSerialNumber", "Customer" }; + DefaultColumns = new List() { "WorkOrderSerialNumber", "Customer", "WorkOrderServiceDate", "WorkOrderCloseByDate", "workordercity" }; DefaultSortBy = new Dictionary() { { "WorkOrderSerialNumber", "-" } }; FieldDefinitions = new List(); @@ -114,7 +114,7 @@ namespace AyaNova.DataList SqlValueColumnName = "aworkorder.completebydate" }); - FieldDefinitions.Add(new DataListFieldDefinition + FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderInvoiceNumber", FieldKey = "WorkOrderInvoiceNumber", @@ -122,7 +122,7 @@ namespace AyaNova.DataList SqlValueColumnName = "aworkorder.invoicenumber" }); - FieldDefinitions.Add(new DataListFieldDefinition + FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderOnsite", FieldKey = "WorkOrderOnsite", @@ -130,6 +130,97 @@ namespace AyaNova.DataList SqlValueColumnName = "aworkorder.onsite" }); + + FieldDefinitions.Add(new DataListFieldDefinition + { + TKey = "AddressPostalDeliveryAddress", + FieldKey = "workorderpostaddress", + UiFieldDataType = (int)UiFieldDataType.Text, + SqlValueColumnName = "aworkorder.postaddress" + }); + + + FieldDefinitions.Add(new DataListFieldDefinition + { + TKey = "AddressPostalCity", + FieldKey = "workorderpostcity", + UiFieldDataType = (int)UiFieldDataType.Text, + SqlValueColumnName = "aworkorder.postcity" + }); + + FieldDefinitions.Add(new DataListFieldDefinition + { + TKey = "AddressPostalStateProv", + FieldKey = "workorderpostregion", + UiFieldDataType = (int)UiFieldDataType.Text, + SqlValueColumnName = "aworkorder.postregion" + }); + + FieldDefinitions.Add(new DataListFieldDefinition + { + TKey = "AddressPostalCountry", + FieldKey = "workorderpostcountry", + UiFieldDataType = (int)UiFieldDataType.Text, + SqlValueColumnName = "aworkorder.postcountry" + }); + + FieldDefinitions.Add(new DataListFieldDefinition + { + TKey = "AddressPostalPostal", + FieldKey = "workorderpostcode", + UiFieldDataType = (int)UiFieldDataType.Text, + SqlValueColumnName = "aworkorder.postcode" + }); + + FieldDefinitions.Add(new DataListFieldDefinition + { + TKey = "AddressDeliveryAddress", + FieldKey = "workorderaddress", + UiFieldDataType = (int)UiFieldDataType.Text, + SqlValueColumnName = "aworkorder.address" + }); + + FieldDefinitions.Add(new DataListFieldDefinition + { + TKey = "AddressCity", + FieldKey = "workordercity", + UiFieldDataType = (int)UiFieldDataType.Text, + SqlValueColumnName = "aworkorder.city" + }); + + FieldDefinitions.Add(new DataListFieldDefinition + { + TKey = "AddressStateProv", + FieldKey = "workorderregion", + UiFieldDataType = (int)UiFieldDataType.Text, + SqlValueColumnName = "aworkorder.region" + }); + + FieldDefinitions.Add(new DataListFieldDefinition + { + TKey = "AddressCountry", + FieldKey = "workordercountry", + UiFieldDataType = (int)UiFieldDataType.Text, + SqlValueColumnName = "aworkorder.country" + }); + + FieldDefinitions.Add(new DataListFieldDefinition + { + TKey = "AddressLatitude", + FieldKey = "workorderlatitude", + UiFieldDataType = (int)UiFieldDataType.Decimal, + SqlValueColumnName = "aworkorder.latitude" + }); + + FieldDefinitions.Add(new DataListFieldDefinition + { + TKey = "AddressLongitude", + FieldKey = "workorderlongitude", + UiFieldDataType = (int)UiFieldDataType.Decimal, + SqlValueColumnName = "aworkorder.longitude" + }); + + /* await ExecQueryAsync("CREATE TABLE aworkorder (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, serial BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, " diff --git a/server/AyaNova/util/AySchema.cs b/server/AyaNova/util/AySchema.cs index eb3f3798..ea1e6ee2 100644 --- a/server/AyaNova/util/AySchema.cs +++ b/server/AyaNova/util/AySchema.cs @@ -22,7 +22,7 @@ namespace AyaNova.Util //!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!! private const int DESIRED_SCHEMA_LEVEL = 1; - internal const long EXPECTED_COLUMN_COUNT = 957; + internal const long EXPECTED_COLUMN_COUNT = 956; internal const long EXPECTED_INDEX_COUNT = 137; internal const long EXPECTED_CHECK_CONSTRAINTS = 415; internal const long EXPECTED_FOREIGN_KEY_CONSTRAINTS = 117; @@ -774,7 +774,7 @@ $BODY$ LANGUAGE PLPGSQL STABLE"); + "notes TEXT, wiki TEXT, customfields TEXT, tags VARCHAR(255) ARRAY, customerid BIGINT NOT NULL REFERENCES acustomer (id), " + "projectid BIGINT REFERENCES aproject, contractid BIGINT NULL, internalreferencenumber text, customerreferencenumber text, customercontactname text, " + "servicedate TIMESTAMP, completebydate TIMESTAMP, invoicenumber TEXT, customersignature TEXT, customersignaturename TEXT, customersignaturecaptured TIMESTAMP, " - + "techsignature TEXT, techsignaturename TEXT, techsignaturecaptured TIMESTAMP, durationtocompleted INTERVAL NOT NULL, onsite BOOL NOT NULL, contract TEXT, " + + "techsignature TEXT, techsignaturename TEXT, techsignaturecaptured TIMESTAMP, durationtocompleted INTERVAL NOT NULL, onsite BOOL NOT NULL, " + "postaddress TEXT, postcity TEXT, postregion TEXT, postcountry TEXT, postcode TEXT, address TEXT, city TEXT, region TEXT, country TEXT, latitude DECIMAL(9,6), longitude DECIMAL(9,6) " + ")");//note deliberately not referencing contract here as it's not tied to it, just needs to keep track of it in case user selects alternate then triggers recalc