fix: Improve bank/cash register display and exports
- Truncate explicatia field to 100 characters in table, Excel, and PDF exports - Fix summary stats to separate opening balance from transactions: - Show Sold Precedent (from rows with null date) - Show Încasări and Plăți (only from actual transactions) - Show Sold Final (calculated correctly) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -477,6 +477,13 @@ export const exportBankCashRegisterPDF = (data, header, filename) => {
|
||||
.replace(/[ț]/gi, (m) => (m === m.toLowerCase() ? "t" : "T"));
|
||||
};
|
||||
|
||||
// Truncate text helper (limit explicatia to 100 chars)
|
||||
const truncateText = (text, maxLength = 100) => {
|
||||
if (!text) return "";
|
||||
if (text.length <= maxLength) return text;
|
||||
return text.substring(0, maxLength) + "...";
|
||||
};
|
||||
|
||||
// Group data by bank account (bancasa)
|
||||
const groupedByBank = {};
|
||||
const initialBalances = {};
|
||||
@@ -696,7 +703,7 @@ export const exportBankCashRegisterPDF = (data, header, filename) => {
|
||||
tableRows.push([
|
||||
dateFormatted,
|
||||
row.nract || "",
|
||||
removeDiacritics(row.explicatia || row.nume || ""),
|
||||
truncateText(removeDiacritics(row.explicatia || row.nume || ""), 100),
|
||||
formatNumberForPDF(incasari),
|
||||
formatNumberForPDF(plati),
|
||||
formatNumberForPDF(row.sold),
|
||||
|
||||
Reference in New Issue
Block a user