Fix demo reset: wipe bills/expenses, fix apostrophe display bug
- Add Bills and Expenses flags to RemoveSeedDataOptions - RemoveSeedDataAsync: delete BillPayments + BillLineItems + Bills, then Expenses for the company when those flags are set - ResetDemoCompany action: enable Bills=true and Expenses=true so all seeded AP data is cleared before re-seeding (was skipping on second reset) - Fix apostrophe in success message (was ' in C# string, double-encoded by Razor to literal ' on screen) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -134,6 +134,8 @@ public class SeedDataController : Controller
|
||||
Catalog = true,
|
||||
PricingTiers = true,
|
||||
OperatingCosts = true,
|
||||
Bills = true,
|
||||
Expenses = true,
|
||||
};
|
||||
|
||||
var removeResult = await _seedDataService.RemoveSeedDataAsync(demo.Id, removeOptions);
|
||||
@@ -148,7 +150,7 @@ public class SeedDataController : Controller
|
||||
|
||||
if (seedResult.Success)
|
||||
{
|
||||
TempData["SuccessMessage"] = $"Demo company reset complete. {seedResult.ItemsSeeded} records re-seeded with today's dates.";
|
||||
TempData["SuccessMessage"] = $"Demo company reset complete. {seedResult.ItemsSeeded} records re-seeded with today's dates.";
|
||||
TempData["SeedDetails"] = string.Join("|", seedResult.Details);
|
||||
TempData["ItemsSeeded"] = seedResult.ItemsSeeded;
|
||||
|
||||
@@ -157,7 +159,7 @@ public class SeedDataController : Controller
|
||||
TempData["WarningMessage"] = $"{seedResult.ItemsSkipped} item(s) were skipped";
|
||||
var displayWarnings = seedResult.Warnings.Take(30).ToList();
|
||||
if (seedResult.Warnings.Count > 30)
|
||||
displayWarnings.Add($"… and {seedResult.Warnings.Count - 30} more (see logs)");
|
||||
displayWarnings.Add($"... and {seedResult.Warnings.Count - 30} more (see logs)");
|
||||
TempData["SeedWarnings"] = string.Join("|", displayWarnings);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user