Distribution_GL Initialization
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using General_Ledger_Service.DTOs.Reports;
|
||||
|
||||
namespace General_Ledger_Service.Services.CsvDocuments
|
||||
{
|
||||
public static class GeneralLedgerCsvDocument
|
||||
{
|
||||
public static byte[] Generate(List<GeneralLedgerLineDto> rows)
|
||||
{
|
||||
var csv = new CsvBuilder();
|
||||
csv.AddRow("Account Code", "Account Name", "Date", "Particulars", "J.R. (Journal No.)", "Debit", "Credit", "Balance");
|
||||
|
||||
foreach (var row in rows)
|
||||
{
|
||||
csv.AddRow(
|
||||
row.AccountCode, row.AccountName, row.EntryDate, row.Narration, row.JournalNo,
|
||||
row.DebitAmount == 0 ? null : row.DebitAmount,
|
||||
row.CreditAmount == 0 ? null : row.CreditAmount,
|
||||
row.RunningBalance);
|
||||
}
|
||||
|
||||
return csv.Build();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user