From d7c82e4334f84398dd8a2153c78f21613d74f56d Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 23 Nov 2021 00:41:38 +0000 Subject: [PATCH] --- .vscode/launch.json | 2 +- server/AyaNova/util/Seeder.cs | 336 +++++++++++++++++----------------- 2 files changed, 169 insertions(+), 169 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 81598112..1871b4f7 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -55,7 +55,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": "false", + "AYANOVA_SERVER_TEST_MODE": "true", "AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small", "AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-8", "AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_14\\bin\\" diff --git a/server/AyaNova/util/Seeder.cs b/server/AyaNova/util/Seeder.cs index 99c26bf8..18e4c652 100644 --- a/server/AyaNova/util/Seeder.cs +++ b/server/AyaNova/util/Seeder.cs @@ -3545,26 +3545,26 @@ namespace AyaNova.Util - //LOANERS - var woItemLoan = new QuoteItemLoan() - { - OutDate = woDate.AddHours(1), - DueDate = woDate.AddHours(4), - Quantity = 4, - Rate = LoanUnitRateUnit.Hours, - LoanUnitId = Fake.Random.Long(1, TotalSeededLoanUnits) - }; - woItem.Loans.Add(woItemLoan); + // //LOANERS + // var woItemLoan = new QuoteItemLoan() + // { + // OutDate = woDate.AddHours(1), + // DueDate = woDate.AddHours(4), + // Quantity = 4, + // Rate = LoanUnitRateUnit.Hours, + // LoanUnitId = Fake.Random.Long(1, TotalSeededLoanUnits) + // }; + // woItem.Loans.Add(woItemLoan); - woItemLoan = new QuoteItemLoan() - { - OutDate = woDate.AddHours(2), - DueDate = woDate.AddHours(3), - Quantity = 1, - Rate = LoanUnitRateUnit.Hours, - LoanUnitId = Fake.Random.Long(1, TotalSeededLoanUnits) - }; - woItem.Loans.Add(woItemLoan); + // woItemLoan = new QuoteItemLoan() + // { + // OutDate = woDate.AddHours(2), + // DueDate = woDate.AddHours(3), + // Quantity = 1, + // Rate = LoanUnitRateUnit.Hours, + // LoanUnitId = Fake.Random.Long(1, TotalSeededLoanUnits) + // }; + // woItem.Loans.Add(woItemLoan); //LABOR @@ -3667,77 +3667,77 @@ namespace AyaNova.Util - //EXPENSES - var cost = Fake.Random.Decimal(1, 10); - var woItemExpense = new QuoteItemExpense() - { - UserId = RandomServiceTechUserId(), - //TotalCost = cost, - ChargeAmount = cost * 1.2m, - ChargeToCustomer = true, - ReimburseUser = true, - ChargeTaxCodeId = TCGoods, - Name = Fake.Commerce.ProductName() + // //EXPENSES + // var cost = Fake.Random.Decimal(1, 10); + // var woItemExpense = new QuoteItemExpense() + // { + // UserId = RandomServiceTechUserId(), + // //TotalCost = cost, + // ChargeAmount = cost * 1.2m, + // ChargeToCustomer = true, + // ReimburseUser = true, + // ChargeTaxCodeId = TCGoods, + // Name = Fake.Commerce.ProductName() - }; - woItem.Expenses.Add(woItemExpense); + // }; + // woItem.Expenses.Add(woItemExpense); - woItemExpense = new QuoteItemExpense() - { - UserId = RandomServiceTechUserId(), - // TotalCost = cost * 2m, - ChargeAmount = cost * 2.2m, - ChargeToCustomer = true, - ReimburseUser = true, - ChargeTaxCodeId = TCGoods, - Name = Fake.Commerce.ProductName() + // woItemExpense = new QuoteItemExpense() + // { + // UserId = RandomServiceTechUserId(), + // // TotalCost = cost * 2m, + // ChargeAmount = cost * 2.2m, + // ChargeToCustomer = true, + // ReimburseUser = true, + // ChargeTaxCodeId = TCGoods, + // Name = Fake.Commerce.ProductName() - }; - woItem.Expenses.Add(woItemExpense); + // }; + // woItem.Expenses.Add(woItemExpense); - //OUTSIDE SERVICES - var ShippingCost = Fake.Random.Decimal(5, 20); - var RepairCost = Fake.Random.Decimal(50, 1000); - var woItemOutsideService = new QuoteItemOutsideService() - { - UnitId = GetNextUnitForCustomer(o.CustomerId), - Notes = Fake.Lorem.Sentence(null, 3), - 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); + // //OUTSIDE SERVICES + // var ShippingCost = Fake.Random.Decimal(5, 20); + // var RepairCost = Fake.Random.Decimal(50, 1000); + // var woItemOutsideService = new QuoteItemOutsideService() + // { + // UnitId = GetNextUnitForCustomer(o.CustomerId), + // Notes = Fake.Lorem.Sentence(null, 3), + // 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 QuoteItemOutsideService() - { - UnitId = GetNextUnitForCustomer(o.CustomerId), - Notes = Fake.Lorem.Sentence(null, 3), - 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 QuoteItemOutsideService() + // { + // UnitId = GetNextUnitForCustomer(o.CustomerId), + // Notes = Fake.Lorem.Sentence(null, 3), + // 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); } @@ -3974,26 +3974,26 @@ namespace AyaNova.Util - //LOANERS - var woItemLoan = new PMItemLoan() - { - OutDate = woDate.AddHours(1), - DueDate = woDate.AddHours(4), - Quantity = 4, - Rate = LoanUnitRateUnit.Hours, - LoanUnitId = Fake.Random.Long(1, TotalSeededLoanUnits) - }; - woItem.Loans.Add(woItemLoan); + // //LOANERS + // var woItemLoan = new PMItemLoan() + // { + // OutDate = woDate.AddHours(1), + // DueDate = woDate.AddHours(4), + // Quantity = 4, + // Rate = LoanUnitRateUnit.Hours, + // LoanUnitId = Fake.Random.Long(1, TotalSeededLoanUnits) + // }; + // woItem.Loans.Add(woItemLoan); - woItemLoan = new PMItemLoan() - { - OutDate = woDate.AddHours(2), - DueDate = woDate.AddHours(3), - Quantity = 1, - Rate = LoanUnitRateUnit.Hours, - LoanUnitId = Fake.Random.Long(1, TotalSeededLoanUnits) - }; - woItem.Loans.Add(woItemLoan); + // woItemLoan = new PMItemLoan() + // { + // OutDate = woDate.AddHours(2), + // DueDate = woDate.AddHours(3), + // Quantity = 1, + // Rate = LoanUnitRateUnit.Hours, + // LoanUnitId = Fake.Random.Long(1, TotalSeededLoanUnits) + // }; + // woItem.Loans.Add(woItemLoan); //LABOR @@ -4096,77 +4096,77 @@ namespace AyaNova.Util - //EXPENSES - var cost = Fake.Random.Decimal(1, 10); - var woItemExpense = new PMItemExpense() - { - UserId = RandomServiceTechUserId(), - //TotalCost = cost, - ChargeAmount = cost * 1.2m, - ChargeToCustomer = true, - ReimburseUser = true, - ChargeTaxCodeId = TCGoods, - Name = Fake.Commerce.ProductName() + // //EXPENSES + // var cost = Fake.Random.Decimal(1, 10); + // var woItemExpense = new PMItemExpense() + // { + // UserId = RandomServiceTechUserId(), + // //TotalCost = cost, + // ChargeAmount = cost * 1.2m, + // ChargeToCustomer = true, + // ReimburseUser = true, + // ChargeTaxCodeId = TCGoods, + // Name = Fake.Commerce.ProductName() - }; - woItem.Expenses.Add(woItemExpense); + // }; + // woItem.Expenses.Add(woItemExpense); - woItemExpense = new PMItemExpense() - { - UserId = RandomServiceTechUserId(), - // TotalCost = cost * 2m, - ChargeAmount = cost * 2.2m, - ChargeToCustomer = true, - ReimburseUser = true, - ChargeTaxCodeId = TCGoods, - Name = Fake.Commerce.ProductName() + // woItemExpense = new PMItemExpense() + // { + // UserId = RandomServiceTechUserId(), + // // TotalCost = cost * 2m, + // ChargeAmount = cost * 2.2m, + // ChargeToCustomer = true, + // ReimburseUser = true, + // ChargeTaxCodeId = TCGoods, + // Name = Fake.Commerce.ProductName() - }; - woItem.Expenses.Add(woItemExpense); + // }; + // woItem.Expenses.Add(woItemExpense); - //OUTSIDE SERVICES - var ShippingCost = Fake.Random.Decimal(5, 20); - var RepairCost = Fake.Random.Decimal(50, 1000); - var woItemOutsideService = new PMItemOutsideService() - { - UnitId = GetNextUnitForCustomer(o.CustomerId), - Notes = Fake.Lorem.Sentence(null, 3), - 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); + // //OUTSIDE SERVICES + // var ShippingCost = Fake.Random.Decimal(5, 20); + // var RepairCost = Fake.Random.Decimal(50, 1000); + // var woItemOutsideService = new PMItemOutsideService() + // { + // UnitId = GetNextUnitForCustomer(o.CustomerId), + // Notes = Fake.Lorem.Sentence(null, 3), + // 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 PMItemOutsideService() - { - UnitId = GetNextUnitForCustomer(o.CustomerId), - Notes = Fake.Lorem.Sentence(null, 3), - 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 PMItemOutsideService() + // { + // UnitId = GetNextUnitForCustomer(o.CustomerId), + // Notes = Fake.Lorem.Sentence(null, 3), + // 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); }