Completed report pdf for Client.
This commit is contained in:
parent
7aeb202e56
commit
a0e644d9d1
@ -41,6 +41,7 @@ namespace BankYouBankruptBusinessLogic.BusinessLogics
|
||||
DateTo = model.DateTo,
|
||||
}).Select(x => new ReportClientViewModel
|
||||
{
|
||||
OperationId = x.Id,
|
||||
CardNumber = x.CardNumber,
|
||||
SumOperation = x.Sum,
|
||||
DateComplite = x.DateOpen
|
||||
@ -55,6 +56,7 @@ namespace BankYouBankruptBusinessLogic.BusinessLogics
|
||||
DateFrom = model.DateTo,
|
||||
}).Select(x => new ReportClientViewModel
|
||||
{
|
||||
OperationId = x.Id,
|
||||
CardNumber = x.CardNumber,
|
||||
SumOperation = x.Sum,
|
||||
DateComplite = x.DateClose
|
||||
@ -87,7 +89,7 @@ namespace BankYouBankruptBusinessLogic.BusinessLogics
|
||||
_saveToPdf.CreateDoc(new PdfInfo
|
||||
{
|
||||
FileName = model.FileName,
|
||||
Title = "Отчёт по операциям с картой",
|
||||
Title = "Отчёт по операциям с картами",
|
||||
DateFrom = model.DateFrom!.Value,
|
||||
DateTo = model.DateTo!.Value,
|
||||
ReportCrediting = GetCrediting(model),
|
||||
|
@ -17,52 +17,68 @@ namespace BankYouBankruptBusinessLogic.OfficePackage
|
||||
|
||||
CreateParagraph(new PdfParagraph
|
||||
{
|
||||
Text = info.Title,
|
||||
Text = info.Title + $"\nот { DateTime.Now.ToShortDateString() }",
|
||||
|
||||
Style = "NormalTitle",
|
||||
ParagraphAlignment = PdfParagraphAlignmentType.Center
|
||||
});
|
||||
|
||||
CreateParagraph(new PdfParagraph
|
||||
{
|
||||
Text = $"с {info.DateFrom.ToShortDateString()} по {info.DateTo.ToShortDateString()}",
|
||||
Text = $"Расчётный период: с {info.DateFrom.ToShortDateString()} по {info.DateTo.ToShortDateString()}",
|
||||
Style = "Normal",
|
||||
ParagraphAlignment = PdfParagraphAlignmentType.Center
|
||||
});
|
||||
|
||||
CreateTable(new List<string> { "5cm", "5cm", "5cm"});
|
||||
//параграф с отчётом на пополнения
|
||||
CreateParagraph(new PdfParagraph { Text = "Отчёт по пополнениям", Style = "Normal", ParagraphAlignment = PdfParagraphAlignmentType.Center });
|
||||
|
||||
CreateTable(new List<string> { "3cm", "3cm", "5cm", "5cm"});
|
||||
|
||||
CreateRow(new PdfRowParameters
|
||||
{
|
||||
Texts = new List<string> { "Номер карты", "Сумма", "Дата операции" },
|
||||
Texts = new List<string> { "Номер операции", "Номер карты", "Сумма", "Дата операции" },
|
||||
Style = "NormalTitle",
|
||||
ParagraphAlignment = PdfParagraphAlignmentType.Center
|
||||
});
|
||||
|
||||
CreateParagraph(new PdfParagraph { Text = "Отчёт по пополнениям", Style = "Normal", ParagraphAlignment = PdfParagraphAlignmentType.Center });
|
||||
|
||||
foreach (var report in info.ReportCrediting)
|
||||
{
|
||||
CreateRow(new PdfRowParameters
|
||||
{
|
||||
Texts = new List<string> { report.CardNumber, report.SumOperation.ToString(), report.DateComplite.ToString() },
|
||||
Texts = new List<string> { report.OperationId.ToString(), report.CardNumber, report.SumOperation.ToString(), report.DateComplite.ToString() },
|
||||
Style = "Normal",
|
||||
ParagraphAlignment = PdfParagraphAlignmentType.Left
|
||||
});
|
||||
}
|
||||
|
||||
//подсчёт суммы операций на пополнение
|
||||
CreateParagraph(new PdfParagraph { Text = $"Итоговая сумма поступлений за период: {info.ReportCrediting.Sum(x => x.SumOperation)}\t", Style = "Normal", ParagraphAlignment = PdfParagraphAlignmentType.Right });
|
||||
|
||||
//отчёт с отчётом на снятие
|
||||
CreateParagraph(new PdfParagraph { Text = "Отчёт по снятиям", Style = "Normal", ParagraphAlignment = PdfParagraphAlignmentType.Center });
|
||||
|
||||
CreateTable(new List<string> { "3cm", "3cm", "5cm", "5cm" });
|
||||
|
||||
CreateRow(new PdfRowParameters
|
||||
{
|
||||
Texts = new List<string> { "Номер операции", "Номер карты", "Сумма", "Дата операции" },
|
||||
Style = "NormalTitle",
|
||||
ParagraphAlignment = PdfParagraphAlignmentType.Center
|
||||
});
|
||||
|
||||
foreach (var report in info.ReportDebiting)
|
||||
{
|
||||
CreateRow(new PdfRowParameters
|
||||
{
|
||||
Texts = new List<string> { report.CardNumber, report.SumOperation.ToString(), report.DateComplite.ToString() },
|
||||
Texts = new List<string> { report.OperationId.ToString(), report.CardNumber, report.SumOperation.ToString(), report.DateComplite.ToString() },
|
||||
Style = "Normal",
|
||||
ParagraphAlignment = PdfParagraphAlignmentType.Left
|
||||
});
|
||||
}
|
||||
|
||||
//CreateParagraph(new PdfParagraph { Text = $"Итого: {info.Orders.Sum(x => x.Sum)}\t", Style = "Normal", ParagraphAlignment = PdfParagraphAlignmentType.Right });
|
||||
//подсчёт суммы операций на пополнение
|
||||
CreateParagraph(new PdfParagraph { Text = $"Итоговая сумма снятий за период: {info.ReportDebiting.Sum(x => x.SumOperation)}\t", Style = "Normal", ParagraphAlignment = PdfParagraphAlignmentType.Right });
|
||||
|
||||
SavePdf(info);
|
||||
}
|
||||
|
@ -8,6 +8,8 @@ namespace BankYouBankruptContracts.ViewModels
|
||||
{
|
||||
public class ReportClientViewModel
|
||||
{
|
||||
public int OperationId { get; set; }
|
||||
|
||||
public string CardNumber { get; set; }
|
||||
|
||||
public double SumOperation { get; set; }
|
||||
|
@ -49,7 +49,7 @@ namespace BankYouBankruptDatabaseImplement.Implements
|
||||
{
|
||||
return context.Debitings
|
||||
.Include(x => x.Card)
|
||||
.Where(x => x.DateOpen >= model.DateFrom && x.DateClose <= model.DateTo)
|
||||
.Where(x => x.DateOpen <= model.DateFrom && x.DateClose >= model.DateTo)
|
||||
.Select(x => x.GetViewModel)
|
||||
.ToList();
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ namespace BankYouBankruptRestAPI.Controllers
|
||||
{
|
||||
_reportClientLogic.SaveClientReportToPdfFile(new ReportBindingModel
|
||||
{
|
||||
FileName = "Отчёт по картам",
|
||||
FileName = "Отчёт по картам за " + DateTime.Now.ToShortDateString() + ".pdf",
|
||||
DateFrom = model.DateFrom,
|
||||
DateTo = model.DateTo
|
||||
});
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user