Enhance financial report accuracy by including closing journals in profit and loss calculations and trial balances; add idempotency check for journal entry creation.
This commit is contained in:
@@ -15,6 +15,11 @@ namespace General_Ledger_Service.Repositories
|
||||
.Include(j => j.Lines)
|
||||
.FirstOrDefaultAsync(j => j.JournalNo == journalNo);
|
||||
|
||||
public async Task<JournalEntry?> GetJournalEntryBySourceReferenceAsync(string sourceModule, string reference) =>
|
||||
await _context.JournalEntries
|
||||
.Include(j => j.Lines)
|
||||
.FirstOrDefaultAsync(j => j.SourceModule == sourceModule && j.Reference == reference);
|
||||
|
||||
public async Task<int> CountJournalEntriesForYearAsync(int year) =>
|
||||
await _context.JournalEntries.CountAsync(j => j.JournalNo.StartsWith($"JV-{year}-"));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user