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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
so jobs, quotes, invoices, and AR aging always look current.
|
||||
</p>
|
||||
<ul class="mb-3 small">
|
||||
<li>Removes: customers, jobs, quotes, invoices, inventory, equipment, catalog, pricing tiers, operating costs</li>
|
||||
<li>Removes: customers, jobs, quotes, invoices, inventory, equipment, catalog, pricing tiers, operating costs, vendor bills, expenses</li>
|
||||
<li>Re-seeds: 100 customers, 50 jobs across all statuses, quotes, invoices, inventory transactions, vendor bills, appointments — all dated from today</li>
|
||||
<li>Preserves: user accounts, company settings, lookup tables (job statuses, priorities, etc.)</li>
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user