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:
@@ -15,10 +15,10 @@ namespace Ophelias.Reporting
|
||||
{
|
||||
string report = $"ACCOMMODATION BILL - GENERATED ON {DateTime.Now.Date.ToString("yyyy-MM-dd")}\n" +
|
||||
$"Name: {r.Guest.LastName}, {r.Guest.FirstName}\n" +
|
||||
$"Arrival Date: {r.StartDate}\n" +
|
||||
$"Departure Date: {r.EndDate}\n" +
|
||||
$"Arrival Date: {r.StartDate.Date.ToString("yyyy-MM-dd")}\n" +
|
||||
$"Departure Date: {r.EndDate.Date.ToString("yyyy-MM-dd")}\n" +
|
||||
$"Length of Stay: {(int)(r.EndDate.Date - r.StartDate.Date).TotalDays} days\n" +
|
||||
$"Charged: ${r.Transaction.Owed}\n\n";
|
||||
$"Charged: ${Math.Round(r.Transaction.Owed, 2)}\n\n";
|
||||
File.AppendAllText(Path.GetFullPath("AccommodationBills.txt"), report);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Ophelias.Reporting
|
||||
roominfo = r.RoomNum.Value.ToString();
|
||||
}
|
||||
|
||||
entries.Add($"{r.Guest.LastName}, {r.Guest.FirstName}\t{r.Type}\t{roominfo}\t{r.EndDate}");
|
||||
entries.Add($"{r.Guest.LastName}, {r.Guest.FirstName}\t{r.Type}\t{roominfo}\t{r.EndDate.Date.ToString("yyyy-MM-dd")}");
|
||||
}
|
||||
string report = $"DAILY ARRIVAL REPORT - GENERATED ON {DateTime.Now.Date.ToString("yyyy-MM-dd")}\n" +
|
||||
$"Last, First\tType\tRoom\tDeparture\n" +
|
||||
|
||||
Reference in New Issue
Block a user