CourseWork_Bank/Bank/BankClientApp/Views/Home/ReportFromPurchases.cshtml

58 lines
1.9 KiB
Plaintext
Raw Normal View History

2024-05-01 01:31:46 +04:00
@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>