Fixed an incorrect calulation
The calculations used in the reports were calulating based off the owed column which mathematically did not make sense since we are looking for the daily.
This commit is contained in:
@@ -182,8 +182,16 @@ internal class Program
|
||||
* has been split into other functions. See those functions for details on how
|
||||
* they work.
|
||||
*/
|
||||
activeReservation = null;
|
||||
activeGuest = null;
|
||||
(string FirstName, string LastName) = GetGuestName();
|
||||
string Email = GetGuestEmail();
|
||||
activeGuest = Hotel.GetGuestByEmail(Email);
|
||||
if (activeGuest != null)
|
||||
{
|
||||
Console.WriteLine($"\nThere is already a guest with the email {Email}.");
|
||||
return;
|
||||
}
|
||||
Console.Write("Would you like to enter your credit card details? (Y/n): ");
|
||||
string? CreditCard = null;
|
||||
string? CardExpiration = null;
|
||||
@@ -347,6 +355,7 @@ internal class Program
|
||||
if ((int)(Date - DateTime.Now).TotalDays < 90)
|
||||
{
|
||||
Console.WriteLine("Prepaid reservations must be made 90 days in advance.");
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -358,13 +367,14 @@ internal class Program
|
||||
if ((int)(Date - DateTime.Now).TotalDays < 60)
|
||||
{
|
||||
Console.WriteLine("Sixty-days-in-advance reservations must be made 60 days in advance.");
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
(DateTime?, DateTime?) SelectDate(ReservationType Type)
|
||||
{
|
||||
@@ -497,7 +507,7 @@ internal class Program
|
||||
Console.WriteLine("Aborting reservation creation.");
|
||||
return;
|
||||
}
|
||||
|
||||
string? cc, exp, ccv;
|
||||
while ((Type != ReservationType.SixtyDayAdvance &&
|
||||
(activeGuest.CreditCard == null || activeGuest.Expiration == null || activeGuest.CCV == null)))
|
||||
{
|
||||
@@ -509,8 +519,9 @@ internal class Program
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
GetCreditCardInformation();
|
||||
(cc,exp,ccv) = GetCreditCardInformation();
|
||||
if (cc != null && exp != null && ccv != null)
|
||||
activeGuest.UpdateGuest(activeGuest.Id, CreditCard: cc, Expiration: exp, CCV: ccv);
|
||||
}
|
||||
|
||||
Console.Write($"Thank you for filling out your reservation details. Currently you have made a {Type} " +
|
||||
|
||||
Reference in New Issue
Block a user