121 lines
5.0 KiB
Plaintext

@using Microsoft.AspNetCore.Mvc.Localization
@using gehGassi.Core.Services
@using gehGassi.Web.Models
@using System.Globalization
@using gehGassi.Domain.Shop
@using gehGassi.Web.Helper
@using Microsoft.Extensions.Localization
@using Microsoft.OpenApi.Extensions
@model gehGassi.Web.Models.OrderVm
@inject IViewLocalizer Localizer
@inject ICountryService countryService
@{
IStringLocalizer annotationsLocalizer = ViewBag.AnnotationsLocalizer;
Invoice invoice = ViewBag.Invoice;
OrderAddressVm deliveryAddress = Model.BillingAddress;
if (Model.DeliveryAddressIsBilling)
{
deliveryAddress = Model.DeliveryAddress;
}
}
<!DOCTYPE html>
<html lang="@(CultureInfo.CurrentCulture.TwoLetterISOLanguageName)">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>gehgassi @Localizer["Mail_Order"]</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}
.card {
border: 1px solid #666666;
padding: 10px;
margin-bottom: 10px;
}
.card-customer {
background-color: #efefef;
}
.label {
font-weight: bold;
}
.nowrap {
white-space: nowrap;
}
</style>
</head>
<body>
<h3>@Localizer["Mail_Invoice"]: @invoice.Number | @invoice.Created.ToString()</h3>
@if (Model.OrderSource == OrderSourceVm.Customer)
{
<div id="customerInfo" class="card card-customer nowrap">
<div><span class="label">@Localizer["Mail_Name"]:</span> <span>@Model.CustomerName</span></div>
</div>
}
else
{
<div id="customerInfo" class="card card-customer nowrap">
<div><span class="label">@Localizer["Mail_Name"]:</span> <span>@Model.AppUserName</span></div>
</div>
}
<div id="address" style="margin-bottom: 10px;">
<table style="min-width: 50%">
<tr>
<td style="width: 50%"><h4>@Localizer["Mail_DeliveryAddress"]</h4></td>
<td style="width: 50%"><h4>@Localizer["Mail_BillingAddress"]</h4></td>
</tr>
<tr>
<td style="width: 50%; vertical-align: top;">
@if (!string.IsNullOrWhiteSpace(deliveryAddress.Company))
{
<div class="nowrap">@deliveryAddress.Company</div>
<div class="nowrap">@deliveryAddress.FirstName @deliveryAddress.LastName</div>
}
else
{
<div class="nowrap">@deliveryAddress.FirstName @deliveryAddress.LastName</div>
}
<div class="nowrap">@deliveryAddress.AddressLine1</div>
@if (!string.IsNullOrWhiteSpace(deliveryAddress.AddressLine2))
{
<div class="nowrap">@deliveryAddress.AddressLine2</div>
}
<div class="nowrap">@deliveryAddress.Zip @deliveryAddress.City</div>
<div class="nowrap">@countryService.GetCountry(deliveryAddress.CountryCode).Name</div>
</td>
<td style="width: 50%; vertical-align: top;">
@if (!string.IsNullOrWhiteSpace(Model.BillingAddress.Company))
{
<div class="nowrap">@Model.BillingAddress.Company</div>
<div class="nowrap">@Model.BillingAddress.FirstName @Model.BillingAddress.LastName</div>
}
else
{
<div class="nowrap">@Model.BillingAddress.FirstName @Model.BillingAddress.LastName</div>
}
<div class="nowrap">@Model.BillingAddress.AddressLine1</div>
@if (!string.IsNullOrWhiteSpace(Model.BillingAddress.AddressLine2))
{
<div class="nowrap">@Model.BillingAddress.AddressLine2</div>
}
<div class="nowrap">@Model.BillingAddress.Zip @Model.BillingAddress.City</div>
<div class="nowrap">@countryService.GetCountry(Model.BillingAddress.CountryCode).Name</div>
</td>
</tr>
</table>
</div>
<div id="paymentInfo" class="card card-customer nowrap">
<div>
<span class="label">@annotationsLocalizer["Order_PaymentType"]:</span> <span>@Model.PaymentType.GetDisplayName(annotationsLocalizer)</span>
<span class="label">@annotationsLocalizer["Order_PaymentStatus"]:</span> <span>@Model.PaymentStatus.GetDisplayName(annotationsLocalizer)</span>
<span class="label">@annotationsLocalizer["Order_PaymentDate"]:</span> <span>@Model.PaymentDate.Value.Date.ToShortDateString()</span>
</div>
</div>
</body>
</html>