Updateed some formatting and bug fixes

Fixed inconsistencies in queries that would result in errors because
the parameters were missing. Updating a guest is an example that had
this issue. After checking parameters should all be supplied where
needed.
This commit is contained in:
雲華
2022-04-17 18:55:38 -04:00
parent 0ce34d9d23
commit 0a5fa3e402
6 changed files with 36 additions and 16 deletions

View File

@@ -27,7 +27,7 @@ namespace Ophelias.Reporting
string report = $"EXPECTED 30 DAY OCCUPANCY REPORT - GENERATED ON {DateTime.Now.Date.ToString("yyyy-MM-dd")}\n" +
$"Date\tRooms Filled\tConventional\tPrepaid\t60-Day\tIncentive\n" +
$"{string.Join("\n", entries)}\n" + // Combine entries at this location in the string
$"Average Occupancy Rate: {average}\n\n";
$"Average Occupancy Rate: {Math.Round(average, 2)}\n\n";
File.AppendAllText(Path.GetFullPath("ExpectedOccupancy.txt"), report); // Write to file
}
@@ -40,13 +40,13 @@ namespace Ophelias.Reporting
List<string> entries = new();
foreach (var x in items) // Build a list of entries
{
entries.Add($"{x.Item1.Date.ToString("yyyy-MM-dd")}\t{x.Item2}");
entries.Add($"{x.Item1.Date.ToString("yyyy-MM-dd")}\t{Math.Round(x.Item2, 2)}");
}
string report = $"EXPECTED 30 DAY INCOME REPORT - GENERATED ON {DateTime.Now.Date.ToString("yyyy-MM-dd")}\n" +
$"Date\tIncome\n" +
$"{string.Join("\n", entries)}\n" + // Combine entries at this location in the string
$"Average Income: {average}\n" +
$"Total Income: {totalIncome}\n\n";
$"Average Income: {Math.Round(average, 2)}\n" +
$"Total Income: {Math.Round(totalIncome, 2)}\n\n";
File.AppendAllText(Path.GetFullPath("ExpectedIncome.txt"), report); // Write to file
}
@@ -59,13 +59,13 @@ namespace Ophelias.Reporting
List<string> entries = new();
foreach (var x in items) // Build a list of entries
{
entries.Add($"{x.Item1.Date.ToString("yyyy-MM-dd")}\t{x.Item2}");
entries.Add($"{x.Item1.Date.ToString("yyyy-MM-dd")}\t{Math.Round(x.Item2, 2)}");
}
string report = $"EXPECTED 30 DAY LOSSES (TO INCENTIVE) REPORT - GENERATED ON {DateTime.Now.Date.ToString("yyyy-MM-dd")}\n" +
$"Date\tLosses\n" +
$"{string.Join("\n", entries)}\n" + // Combine entries at this location in the string
$"Average Losses (Due to incentive): {average}\n" +
$"Total Losses (Due to incentive): {totalLosses}\n\n";
$"Average Losses (Due to incentive): {Math.Round(average, 2)}\n" +
$"Total Losses (Due to incentive): {Math.Round(totalLosses, 2)}\n\n";
File.AppendAllText(Path.GetFullPath("IncentiveLosses.txt"), report); // Write to file
}