From 914c22d89fae776f76bf49e36c5571574d2870fc Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 27 May 2021 19:26:07 +0000 Subject: [PATCH] --- .vscode/launch.json | 2 +- server/AyaNova/biz/FormFieldReference.cs | 2 +- server/AyaNova/util/AySchema.cs | 6 +-- server/AyaNova/util/Seeder.cs | 53 +++++++++++++++++++++--- 4 files changed, 53 insertions(+), 10 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 8fd97968..0e2049e9 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -53,7 +53,7 @@ "AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles", "AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles", "AYANOVA_FOLDER_TEMPORARY_SERVER_FILES": "c:\\temp\\RavenTestData\\tempfiles", - "AYANOVA_SERVER_TEST_MODE": "true", + "AYANOVA_SERVER_TEST_MODE": "false", "AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small", "AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-7", "AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_13\\bin\\" diff --git a/server/AyaNova/biz/FormFieldReference.cs b/server/AyaNova/biz/FormFieldReference.cs index 3fc0319f..a714b86c 100644 --- a/server/AyaNova/biz/FormFieldReference.cs +++ b/server/AyaNova/biz/FormFieldReference.cs @@ -1070,7 +1070,7 @@ namespace AyaNova.Biz l.Add(new FormField { TKey = "WorkOrderItemOutsideServiceDateETA", FieldKey = "WorkOrderItemOutsideServiceDateETA", TKeySection = "WorkOrderItemOutsideServices" }); l.Add(new FormField { TKey = "WorkOrderItemOutsideServiceDateReturned", FieldKey = "WorkOrderItemOutsideServiceDateReturned", TKeySection = "WorkOrderItemOutsideServices" }); l.Add(new FormField { TKey = "TaxCode", FieldKey = "WorkOrderItemOutsideServiceTaxCode", TKeySection = "WorkOrderItemOutsideServices" }); - l.Add(new FormField { TKey = "Cost", FieldKey = "OutsideServiceCost", TKeySection = "WorkOrderItemOutsideServices" }); + l.Add(new FormField { TKey = "Cost", FieldKey = "OutsideServiceCostViz", TKeySection = "WorkOrderItemOutsideServices" }); l.Add(new FormField { TKey = "Price", FieldKey = "OutsideServicePriceViz", TKeySection = "WorkOrderItemOutsideServices" }); l.Add(new FormField { TKey = "NetPrice", FieldKey = "OutsideServiceNetViz", TKeySection = "WorkOrderItemOutsideServices" }); l.Add(new FormField { TKey = "TaxAAmt", FieldKey = "OutsideServiceTaxAViz", TKeySection = "WorkOrderItemOutsideServices" }); diff --git a/server/AyaNova/util/AySchema.cs b/server/AyaNova/util/AySchema.cs index c6658087..c9e7b13b 100644 --- a/server/AyaNova/util/AySchema.cs +++ b/server/AyaNova/util/AySchema.cs @@ -24,14 +24,14 @@ namespace AyaNova.Util internal const long EXPECTED_COLUMN_COUNT = 945; internal const long EXPECTED_INDEX_COUNT = 141; - internal const long EXPECTED_CHECK_CONSTRAINTS = 430; - internal const long EXPECTED_FOREIGN_KEY_CONSTRAINTS = 118; + internal const long EXPECTED_CHECK_CONSTRAINTS = 431; + internal const long EXPECTED_FOREIGN_KEY_CONSTRAINTS = 119; internal const long EXPECTED_VIEWS = 6; internal const long EXPECTED_ROUTINES = 2; //!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!! - ///////////////////////////////////////////////////////////////// C943:I141:CC430:FC118:V6:R2 + ///////////////////////////////////////////////////////////////// C945:I141:CC431:FC119:V6:R2 /* diff --git a/server/AyaNova/util/Seeder.cs b/server/AyaNova/util/Seeder.cs index d0f85afc..d2755f36 100644 --- a/server/AyaNova/util/Seeder.cs +++ b/server/AyaNova/util/Seeder.cs @@ -1355,8 +1355,8 @@ namespace AyaNova.Util tc.Notes = "Example sales only tax"; tc.Active = true; tc.Tags = RandomTags(); - tc.TaxAPct = 0; - tc.TaxBPct = 7m; + tc.TaxAPct = 5m; + tc.TaxBPct = 0m; tc.TaxOnTax = false; using (AyContext ct = ServiceProviderProvider.DBContext) { @@ -1378,8 +1378,9 @@ namespace AyaNova.Util tc.Active = true; tc.Notes = "Example goods only tax"; tc.Tags = RandomTags(); - tc.TaxBPct = 0; tc.TaxAPct = 7m; + tc.TaxBPct = 0; + tc.TaxOnTax = false; using (AyContext ct = ServiceProviderProvider.DBContext) { @@ -1401,7 +1402,7 @@ namespace AyaNova.Util tc.Active = true; tc.Notes = "Example sales and goods tax"; tc.Tags = RandomTags(); - tc.TaxAPct = 7m; + tc.TaxAPct = 5m; tc.TaxBPct = 7m; tc.TaxOnTax = false; using (AyContext ct = ServiceProviderProvider.DBContext) @@ -2577,7 +2578,7 @@ namespace AyaNova.Util }; woItem.Units.Add(woItemUnit); - woItemUnit = new WorkOrderItemUnit() + woItemUnit = new WorkOrderItemUnit() { UnitId = Fake.Random.Long(1, TotalSeededUnits), Notes = Fake.Lorem.Sentence() @@ -2799,6 +2800,48 @@ namespace AyaNova.Util woItem.Expenses.Add(woItemExpense); + //OUTSIDE SERVICES + var ShippingCost = Fake.Random.Decimal(5, 20); + var RepairCost = Fake.Random.Decimal(50, 1000); + var woItemOutsideService = new WorkOrderItemOutsideService() + { + UnitId = Fake.Random.Long(1, TotalSeededUnits), + Notes = Fake.Lorem.Sentence(), + VendorSentToId = Fake.Random.Long(1, TotalSeededVendors), + VendorSentViaId = Fake.Random.Long(1, TotalSeededVendors), + RMANumber = "RMA" + Fake.Finance.Account(6), + TrackingNumber = "TR" + Fake.Finance.Account(8), + RepairCost = RepairCost, + RepairPrice = RepairCost * 1.5m, + ShippingCost = ShippingCost, + ShippingPrice = ShippingCost * 1.5m, + SentDate = woDate, + ETADate = woDate.AddDays(7), + ReturnDate = woDate.AddDays(8), + TaxCodeId = 1 + }; + woItem.OutsideServices.Add(woItemOutsideService); + + ShippingCost = Fake.Random.Decimal(5, 20); + RepairCost = Fake.Random.Decimal(50, 1000); + woItemOutsideService = new WorkOrderItemOutsideService() + { + UnitId = Fake.Random.Long(1, TotalSeededUnits), + Notes = Fake.Lorem.Sentence(), + VendorSentToId = Fake.Random.Long(1, TotalSeededVendors), + VendorSentViaId = Fake.Random.Long(1, TotalSeededVendors), + RMANumber = "RMA" + Fake.Finance.Account(6), + TrackingNumber = "TR" + Fake.Finance.Account(8), + RepairCost = RepairCost, + RepairPrice = RepairCost * 1.5m, + ShippingCost = ShippingCost, + ShippingPrice = ShippingCost * 1.5m, + SentDate = woDate, + ETADate = woDate.AddDays(7), + ReturnDate = woDate.AddDays(8), + TaxCodeId = 1 + }; + woItem.OutsideServices.Add(woItemOutsideService); o.Items.Add(woItem); }