@*using statement required for access to Constituencies object type when making REST call to CRM/Constituencies*@ @using Tessitura.Service.Client.CRM; @{ var hasConstituent = Model.OrderProductView.Constituent != null; var hasAddress = Model.Address != null; var hasElectronicAddress = Model.ElectronicAddress != null; var hasBooking = Model.Booking != null; var isInSpecialConstituency = false; var constituencyMessage = Model.GetPropertyValue("ConstituencyMessage") ?? "Thank you for being a part of Friend's Circle!"; var constituency = Model.GetPropertyValue("Constituency") ?? "FRC"; var hasState = hasAddress && Model.Address.State != null; var hasProducts = Model.OrderProductView.Products != null && Model.OrderProductView.Products.Count > 0; } @if (hasConstituent) { var url = "CRM/Constituencies?constituentId=" + Model.OrderProductView.Constituent.Id + "&includeAffiliations=true"; var constituencies = Model.RestClient.AtUrl(url).Get().ResponseObject; isInSpecialConstituency = constituencies != null && constituencies.Count(x => x.ConstituencyType.ShortDescription == constituency) > 0; } @if (hasProducts) { /* PERFORMANCES */ var perfs = Model.OrderProductView.Products.Where(x => x.ProductClass.Description == "Performance"); // If the order has performances, loop through them and display them in a table if (perfs != null && perfs.Count() > 0) { } /* PACKAGES */ var packages = Model.OrderProductView.Products.Where(x => x.ProductClass.Description == "Package"); // If the order has packages, loop through them and display them in a table if (packages != null && packages.Count() > 0) { } /* CONTRIBUTIONS */ var contributions = Model.OrderProductView.Products.Where(x => x.ProductClass.Description == "Contribution"); var contributionTotal = contributions.Sum(x => x.Contribution.Amount); // If the order has contributions, loop through them and display them in a table if (contributions != null && contributions.Count() > 0) { } var memberships = Model.OrderProductView.Products.Where(x => x.ProductClass.Description == "Membership"); var membershipTotal = memberships.Sum(x => x.Membership.Amount); if (memberships != null && memberships.Count() > 0) { } var giftCertificates = Model.OrderProductView.Products.Where(x => x.ProductClass.Description == "Gift Certificate"); var giftCertificateTotal = giftCertificates.Sum(x => -x.GiftCertificate.Amount); if (giftCertificates != null && giftCertificates.Count() > 0) { } var subTotal = string.Format("{0:C}", Model.OrderProductView.TotalPurchaseAmount + Model.OrderProductView.TotalContributionAmount); } @if (hasBooking) { }
@{ var state = hasState ? ", " + Model.Address.State.StateCode : ""; var electronicAddress = hasElectronicAddress ? Model.ElectronicAddress.Address : ""; }

Thank You for Your Order with the Tessitura Network!

Order Date: @Model.OrderProductView.OrderDateTime
Order Number: @Model.OrderProductView.Id
@if (hasConstituent) { Customer Number: @Model.OrderProductView.Constituent.Id

}

Please retain this receipt for your reference.

Your Account Information:
@if (isInSpecialConstituency) { @constituencyMessage
} @if (hasConstituent) { @Model.OrderProductView.Constituent.DisplayName
} @if (hasAddress) { @Model.Address.Street1
@Model.Address.City@state @Model.Address.PostalCode
} @electronicAddress
Order Shipping Information
@if (Model.OrderProductView.DeliveryMethod.Id == -1) { Hold order at Box Office
Please pick up your tickets no later than 30 minutes before curtain } else if (hasAddress) { @Model.Address.Street1
@Model.Address.City@state @Model.Address.PostalCode
}
Performances
@{ var performanceTotal = @perfs.Sum(x => x.Performance.LineItem.TotalDue); } @foreach (var product in perfs) { var performance = product.Performance.LineItem.Performance; }
Description Location Seat(s) Price Total
@performance.Description
@performance.Facility.Description
@performance.PerformanceDateTime
@product.Performance.LineItem.SubLineItems[0].Zone.Description @foreach (var subLineItem in product.Performance.LineItem.SubLineItems) { var seatRow = string.IsNullOrEmpty(subLineItem.Seat.Number) ? "TBD" : subLineItem.Seat.Row + " " + subLineItem.Seat.Number; @seatRow
}
@foreach (var subLineItem in product.Performance.LineItem.SubLineItems) { var amount = string.Format("{0:C}", subLineItem.DueAmount); @amount
}
@string.Format("{0:C}", product.Performance.LineItem.TotalDue)
Total Single Tickets Cost: @string.Format("{0:C}", performanceTotal)
Packages
@{ var packageTotal = packages.Sum(x => x.Package.LineItems.Sum(y => y.TotalDue)); } @foreach (var product in packages) { foreach (var lineItem in product.Package.LineItems) { if (lineItem.Performance == null) { } else { var performance = lineItem.Performance; } } }
Description Location Seat(s) Price Total
@lineItem.Package.Description
@performance.Description
@performance.Facility.Description
@performance.PerformanceDateTime
@lineItem.SubLineItems[0].Zone.Description @foreach (var subLineItem in lineItem.SubLineItems) { var seatRow = string.IsNullOrEmpty(subLineItem.Seat.Number) ? "TBD" : subLineItem.Seat.Row + " " + subLineItem.Seat.Number; @seatRow
}
@foreach (var subLineItem in lineItem.SubLineItems) { var amount = string.Format("{0:C}", subLineItem.DueAmount); @amount
}
@string.Format("{0:C}", lineItem.TotalDue)
Total Packages Cost: @string.Format("{0:C}", packageTotal)
Contributions
@foreach (var contribution in contributions) { }
Description Total
@contribution.Contribution.Fund.Description @string.Format("{0:C}", contribution.Contribution.Amount)
Total Contribution Cost: @string.Format("{0:C}", contributionTotal)
Memberships
@foreach (var membership in memberships) { }
Description Total
@membership.Membership.MembershipLevel.Description @string.Format("{0:C}", membership.Membership.Amount)
Total Membership Cost: @string.Format("{0:C}", membershipTotal)
Gift Certificates
@foreach (var giftCertificate in giftCertificates) { var amount = -giftCertificate.GiftCertificate.Amount;
Gift Certificate
Redemption Code:

@giftCertificate.GiftCertificate.GiftCertificateNumber

@string.Format("{0:C}", amount)
To

From

Note
}
Description Total
Redemption Code: @giftCertificate.GiftCertificate.GiftCertificateNumber @string.Format("{0:C}", amount)
Total Gift Certificate Cost: @string.Format("{0:C}", giftCertificateTotal)
Order Subtotal: @subTotal
Fees: @string.Format("{0:C}", Model.OrderProductView.TotalFeeAmount)
Total: @string.Format("{0:C}", Model.OrderProductView.TotalDueAmount)
@if (Model.Booking.Assignments != null && Model.Booking.Assignments.Count > 0) { }
Booking

@Model.Booking.Description

Confirmation: @Model.Booking.ConfirmationText

Resources
@foreach (var assignment in @Model.Booking.Assignments) { var description = @assignment.Resource != null ? @assignment.Resource.Description : "TBD"; if (assignment.ConfirmationText != null) { } }
Type Description Count Start End
@assignment.ResourceType.Description @description @assignment.Schedule.Count @assignment.Schedule.StartDateTime @assignment.Schedule.EndDateTime
@assignment.ConfirmationText