gehgassi_backend/gehGassi.Web/Views/Print/InvoiceProforma.cshtml

213 lines
7.0 KiB
Plaintext

@using gehGassi.Domain.Shop
@using Microsoft.AspNetCore.Mvc.Localization
@using gehGassi.Core.Services
@using gehGassi.Web.Models
@using System.Globalization
@using gehGassi.Web.Helper
@using Microsoft.Extensions.Localization
@model gehGassi.Web.Models.OrderVm
@inject IViewLocalizer Localizer
@inject ICountryService countryService
@{
IStringLocalizer annotationsLocalizer = ViewBag.AnnotationsLocalizer;
Layout = "";
OrderAddressVm deliveryAddress = Model.BillingAddress;
if (Model.DeliveryAddressIsBilling)
{
deliveryAddress = Model.DeliveryAddress;
}
ViewData["Title"] = Localizer["Common_Invoice"].Value;
int itemCounter = 0;
string itemSpecialInfo = string.Empty;
string customerNumber = ViewBag.CustomerNumber ?? "";
}
<!DOCTYPE html>
<html lang="@(CultureInfo.CurrentCulture.TwoLetterISOLanguageName)">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>gehgassi @Localizer["Common_Invoice"]</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;
}
td {
vertical-align: top;
}
</style>
</head>
<body style="padding-top: 1em;">
<div style="font-size: 14px">gehgassi GmbH, c/o frebels, Judengasse 12/2, 5020 Salzburg</div>
<br />
@if (!string.IsNullOrWhiteSpace(Model.BillingAddress.Company))
{
<div><strong>@Model.BillingAddress.Company</strong></div>
<div>@Model.BillingAddress.FirstName @Model.BillingAddress.LastName</div>
}
else
{
<div><strong>@Model.BillingAddress.FirstName @Model.BillingAddress.LastName</strong></div>
}
<div>@Model.BillingAddress.AddressLine1</div>
<div>@Model.BillingAddress.AddressLine2</div>
<div>@Model.BillingAddress.Zip @Model.BillingAddress.City</div>
<div>@countryService.GetCountry(Model.BillingAddress.CountryCode).Name</div>
@if (!string.IsNullOrWhiteSpace(Model.BillingAddress.Vat))
{
<div>@Model.BillingAddress.Vat</div>
}
<table style="float: right;">
<tr>
<td>@Localizer["Custormer_Number"]:</td>
<td style="padding-left: 1em;" align="right">@customerNumber</td>
</tr>
<tr>
<td>@Localizer["Invoice_OrderNumber"]:</td>
<td style="padding-left: 1em;" align="right">@Model.Number</td>
</tr>
<tr>
<td>@Localizer["Invoice_OrderDate"]:</td>
<td style="padding-left: 1em;" align="right">@Model.Created.Date.ToShortDateString()</td>
</tr>
<tr>
<td>@Localizer["Invoice_PaymentType"]:</td>
<td style="padding-left: 1em;" align="right">@Model.PaymentType.GetDisplayName(annotationsLocalizer)</td>
</tr>
<tr>
<td>@Localizer["Invoice_PaymentStatus"]:</td>
<td style="padding-left: 1em;" align="right">@Model.PaymentStatus.GetDisplayName(annotationsLocalizer)</td>
</tr>
</table>
<table style="width: 100%; margin-top: 10em;">
<tr>
<td align="center">
<h2>@Localizer["Invoice_Invoice_Proforma"]</h2>
</td>
</tr>
</table>
<div id="orderDetails" style="margin-top: 2em;">
<table style="width: 100%; padding: 10px;">
<tr style="font-weight: bold;">
<td>@Localizer["Invoice_Pos"]</td>
<td>@Localizer["Invoice_ItemNr"]</td>
<td>@Localizer["Invoice_Item"]</td>
<td style="text-align: center; white-space: nowrap;">@Localizer["Invoice_ItemCount"]</td>
<td style="text-align: right; white-space: nowrap;">@Localizer["Invoice_SinglePrice"]</td>
<td style="text-align: right; white-space: nowrap;">@Localizer["Invoice_TotalPrice"]</td>
</tr>
@foreach (var item in Model.Items)
{
itemCounter += 1;
if (!string.IsNullOrWhiteSpace(item.ProductSpecialInfo))
{
itemSpecialInfo = $" ({item.ProductSpecialInfo})";
}
else
{
itemSpecialInfo = string.Empty;
}
<tr>
<td>@itemCounter</td>
<td>@item.Sku</td>
<td>@item.Name @itemSpecialInfo</td>
<td style="text-align: center;">@item.Quantity</td>
<td style="text-align: right;">@item.PriceGross.ToString("n2")</td>
<td style="text-align: right;">@item.TotalGross.ToString("n2")</td>
</tr>
}
<tr>
<td colspan="6"><hr /></td>
</tr>
<tr>
<td colspan="5" class="" style="text-align: right;">@Localizer["Invoice_Subtotal"]</td>
<td style="text-align: right;">€ @Model.SubtotalGross.ToString("n2")</td>
</tr>
<tr>
<td colspan="5" class="" style="text-align: right;">@Localizer["Invoice_ShipmentCost"]</td>
<td style="text-align: right;">€ @Model.ShipmentGross.ToString("n2")</td>
</tr>
<tr>
<td colspan="6"><hr /></td>
</tr>
<tr>
<td colspan="5" class="label" style="text-align: right;">@Localizer["Invoice_Total"]</td>
<td class="label" style="text-align: right;">€ @((Model.TotalGross).ToString("n2"))</td>
</tr>
@foreach (var tax in Model.TaxRates)
{
<tr>
<td colspan="5" class="" style="text-align: right;">@Localizer["Invoice_Tax"] @tax.Key%</td>
<td style="text-align: right;">€ @tax.Value.ToString("n2")</td>
</tr>
}
</table>
</div>
@if (Model.PaymentStatus != PaymentStatusVm.Paid)
{
<table style="width: 100%; margin-top: 5em;">
<tr>
<td align="center">@Localizer["Invoice_PaymentInfo"]</td>
</tr>
</table>
}
<table style="margin-top: 2em; padding: 10px;">
<tr>
<td>@Localizer["Invoice_Bank"]:</td>
<td style="padding-left: 1em;">Sparkasse Kufstein</td>
</tr>
<tr>
<td>@Localizer["Invoice_Receiver"]:</td>
<td style="padding-left: 1em;">gehgassi GmbH</td>
</tr>
<tr>
<td>@Localizer["Invoice_Purpose"]:</td>
<td style="padding-left: 1em; font-weight: bold;">@Model.Number</td>
</tr>
<tr>
<td>IBAN:</td>
<td style="padding-left: 1em;">AT39 2050 6077 0015 5083</td>
</tr>
<tr>
<td>BIC:</td>
<td style="padding-left: 1em;">SPKUAT22XXX</td>
</tr>
</table>
</body>
</html>