CourseWork_Bank/Bank/BankClientApp/Views/Home/ReportFromPurchases.cshtml
2024-05-01 00:31:46 +03:00

58 lines
1.9 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@model List<BankContracts.ViewModels.PurchaseViewModel>?
@{
ViewData["Title"] = "Список сделок с затратами";
}
<h1>@ViewData["Title"]</h1>
<form method="post">
<div class="align-content-center row mb-3">
<div class="col-sm-auto">
<label for="startDate">С:</label>
</div>
<div class="col-3">
<input name="startDate" id="startDate" class="form-control" type="date"/>
</div>
<div class="col-sm-auto">
<label for="endDate">По:</label>
</div>
<div class="col-3">
<input name="endDate" id="endDate" class="form-control" type="date" value="@DateTime.Today.ToString("yyyy-MM-dd")" />
</div>
<div class="col-2">
<input type="submit" name="getReport" class="btn btn-primary" value="Сформировать отчет"/>
</div>
<div class="col-3">
<input type="submit" name="sendToMail" class="btn btn-primary" value="Отправить на почту" />
</div>
</div>
</form>
<div class="text-center">
<table class="table">
<thead>
<tr>
<th>Дата сделки</th>
<th>Сделка</th>
<th>Затрата</th>
<th>Сумма затраты</th>
</tr>
</thead>
<tbody id="fillReportPurchase">
@if (Model != null) {
foreach (var purchase in Model)
{
foreach (var cost in purchase.CostViewModels)
{
<tr>
<td>@purchase.DatePurchase</td>
<td>@purchase.Id</td>
<td>@cost.NameOfCost</td>
<td>@(cost.Price * cost.PurchaseModels[purchase.Id].Count)</td>
</tr>
}
}
}
</tbody>
</table>
</div>