Skip to content

Commit a1108c8

Browse files
authored
Merge pull request #33 from DavidAmunga/fix/charges-sheet-export
2 parents b5b9d52 + df51aea commit a1108c8

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

.changeset/beige-spiders-ask.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"mpesa2csv": patch
3+
---
4+
5+
fix: reorder columns and update total charges display in xlsx charges sheet export

src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/services/xlsxService.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,8 @@ export class XlsxService {
108108
chargesWorksheet.columns = [
109109
{ header: "Receipt No", key: "receiptNo", width: 12 },
110110
{ header: "Date", key: "date", width: 12 },
111-
{ header: "Time", key: "time", width: 10 },
112-
{ header: "Amount", key: "amount", width: 12 },
113111
{ header: "Full Details", key: "fullDetails", width: 40 },
112+
{ header: "Amount", key: "amount", width: 12 },
114113
];
115114

116115
// Style the header row
@@ -130,8 +129,8 @@ export class XlsxService {
130129
chargesWorksheet.addRow({
131130
receiptNo: transaction.receiptNo,
132131
date: transaction.completionTime,
133-
amount: amount,
134132
fullDetails: transaction.details,
133+
amount: amount,
135134
});
136135
});
137136

@@ -160,9 +159,9 @@ export class XlsxService {
160159

161160
chargesWorksheet.getCell(`A${summaryStartRow}`).value = "Total Charges:";
162161
chargesWorksheet.getCell(`A${summaryStartRow}`).font = { bold: true };
163-
chargesWorksheet.getCell(`E${summaryStartRow}`).value = totalCharges;
164-
chargesWorksheet.getCell(`E${summaryStartRow}`).font = { bold: true };
165-
chargesWorksheet.getCell(`E${summaryStartRow}`).fill = {
162+
chargesWorksheet.getCell(`D${summaryStartRow}`).value = totalCharges;
163+
chargesWorksheet.getCell(`D${summaryStartRow}`).font = { bold: true };
164+
chargesWorksheet.getCell(`D${summaryStartRow}`).fill = {
166165
type: "pattern",
167166
pattern: "solid",
168167
fgColor: { argb: "FFFFE4B5" },
@@ -171,9 +170,9 @@ export class XlsxService {
171170
chargesWorksheet.getCell(`A${summaryStartRow + 1}`).value =
172171
"Number of Charge Transactions:";
173172
chargesWorksheet.getCell(`A${summaryStartRow + 1}`).font = { bold: true };
174-
chargesWorksheet.getCell(`E${summaryStartRow + 1}`).value =
173+
chargesWorksheet.getCell(`D${summaryStartRow + 1}`).value =
175174
chargeTransactions.length;
176-
chargesWorksheet.getCell(`E${summaryStartRow + 1}`).font = { bold: true };
175+
chargesWorksheet.getCell(`D${summaryStartRow + 1}`).font = { bold: true };
177176
}
178177

179178
static getFileName(statement: MPesaStatement, timestamp?: string): string {

0 commit comments

Comments
 (0)