This commit is contained in:
Programmist73 2023-05-19 20:32:27 +04:00
parent 477f751d75
commit 686a76fb69
9 changed files with 86 additions and 5 deletions

View File

@ -164,7 +164,7 @@ namespace BankYouBankruptBusinessLogic.BusinessLogics
{
FileName = model.FileName,
Title = "Отчёт по снятиям денежных средств",
Crediting = GetExcelCrediting(model)
Debiting = GetExcelDebiting(model)
}, operationEnum);
}
}

View File

@ -360,7 +360,7 @@ namespace BankYouBankruptBusinessLogic.OfficePackage
{
ColumnName = "C",
RowIndex = rowIndex,
Text = info.Crediting.Sum(x => x.Sum).ToString(),
Text = info.Debiting.Sum(x => x.Sum).ToString(),
StyleInfo = ExcelStyleInfoType.Text
});

View File

@ -3,6 +3,7 @@ using BankYouBankruptContracts.BindingModels;
using BankYouBankruptContracts.ViewModels;
using BankYouBankruptContracts.ViewModels.Client.Default;
using BankYouBankruptContracts.ViewModels.Client.Diagram;
using BankYouBankruptContracts.ViewModels.Client.Reports;
using BankYouBankruptDataModels.Enums;
using Microsoft.AspNetCore.Mvc;
using System.Diagnostics;
@ -464,7 +465,24 @@ namespace BankYouBankruptCashierApp.Controllers
return View(new List<ReportCashierAccountsViewModel>());
}
[HttpPost]
//создание excel отчёта у касира
[HttpPost]
public IActionResult CreateCashierExcelReport(string accountId)
{
if (APICashier.Cashier == null)
{
throw new Exception("Не авторизованы");
}
APICashier.PostRequest("api/Report/CreateExcelCashier", new ReportSupportBindingModel()
{
AccountId = int.Parse(accountId)
});
return Redirect("~/Home/Enter");
}
[HttpPost]
public IActionResult ReportWithAccounts(string accountId)
{
if (APICashier.Cashier == null)

View File

@ -22,6 +22,9 @@
<div>
<input class="btn btn-primary mt-3" type="submit" value="Submit" />
</div>
<div class="mb-2">
<button class="btn btn-lg btn-warning btn-block" type="submit" asp-controller="Home" asp-action="CreateCashierExcelReport">Создать отчёт по заявкам снятия</button>
</div>
</form>
</div>
</div>

View File

@ -311,6 +311,22 @@ namespace BankYouBankruptClientApp.Controllers
return Redirect("~/Home/Enter");
}
[HttpPost]
public IActionResult CreateDebitingExcelReport(List<CheckboxViewModel> cards)
{
if (APIClient.Client == null)
{
throw new Exception("Не авторизованы");
}
APIClient.PostRequest("api/Report/CreateExcelDebiting", new ReportSupportBindingModel()
{
CardList = cards.Where(x => x.IsChecked).Select(x => x.Id).ToList()
});
return Redirect("~/Home/Enter");
}
#endregion
#region Получение отчета по картам

View File

@ -28,12 +28,15 @@
<div class="mb-2">
<button class="btn btn-lg btn-warning btn-block" type="submit" asp-controller="Home" asp-action="ReportWithCards">Создать отчёт</button>
</div>
<div>
<div class="mb-2">
<button class="btn btn-lg btn-warning btn-block" type="submit" asp-controller="Home" asp-action="CreateExcelReport">Создать отчёт по переводам</button>
</div>
<div>
<div class="mb-2">
<button class="btn btn-lg btn-warning btn-block" type="submit" asp-controller="Home" asp-action="CreateCreditingExcelReport">Создать отчёт по пополнениям</button>
</div>
<div class="mb-2">
<button class="btn btn-lg btn-warning btn-block" type="submit" asp-controller="Home" asp-action="CreateDebitingExcelReport">Создать отчёт по снятиям</button>
</div>
</form>
</div>
</div>

View File

@ -12,6 +12,8 @@ namespace BankYouBankruptContracts.BindingModels
{
public int ClientId { get; set; }
public int AccountId { get; set; }
public DateTime DateFrom { get; set; }
public DateTime DateTo { get; set; }

View File

@ -132,5 +132,44 @@ namespace BankYouBankruptRestAPI.Controllers
throw;
}
}
//отчёт клиента Excel по выдаче денег
[HttpPost]
public void CreateExcelDebiting(ReportSupportBindingModel model)
{
try
{
_reportClientLogic.SaveToExcelFile(new ReportBindingModel
{
FileName = "Отчёт по снятиям.xls",
CardList = model.CardList
}, ExcelOperationEnum.Cнятие_сарты);
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка входа в систему");
throw;
}
}
//отчёт клиента Excel по переводу денег
[HttpPost]
public void CreateExcelCashier(ReportSupportBindingModel model)
{
try
{
_reportCashierLogic.SaveToExcelFile(new ReportBindingModel
{
FileName = "Отчёт по переводам.xls",
CardList = model.CardList
}, ExcelOperationEnum.Между_cчетами);
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка входа в систему");
throw;
}
}
}
}