How to add username field in finance

Currently, the finance export offers student name but I want to replace it with the username or userID of the student to differentiate between students as there can be more than 1 student having the same name in the same roll group. If there is a hack available then please help me out :slight_smile:

Hi @Ibrahim ,

I already comprehensively reported this issue with details in the forum and I think it is on to do list for V 20 .

@ross can you confirm this?

Cheers

Ibrahim,

You need to hack the following file:
modules/Finance/invoices_manage_processBulkExportContents.php

Line 53
//$sql = "(SELECT gibbonFinanceInvoice.gibbonFinanceInvoiceID, surname, preferredName, gibbonPerson.gibbonPersonID, dob, gender,
$sql = "(SELECT username, gibbonFinanceInvoice.gibbonFinanceInvoiceID, surname, preferredName, gibbonPerson.gibbonPersonID, dob, gender,

Line 71
//$sql .= "(SELECT gibbonFinanceInvoice.gibbonFinanceInvoiceID, surname, […]
$sql .= "(SELECT username, gibbonFinanceInvoice.gibbonFinanceInvoiceID, surname,

Line 75
//$sql .= "(SELECT gibbonFinanceInvoice.gibbonFinanceInvoiceID, surname, […]
$sql .= "(SELECT username, gibbonFinanceInvoice.gibbonFinanceInvoiceID, surname, […]

Line 158
//$excel->getActiveSheet()->setCellValueByColumnAndRow(1, $r, Format::name(“”, htmlPrep($row[“preferredName”]), htmlPrep($row[“surname”]), “Student”, true));
$excel->getActiveSheet()->setCellValueByColumnAndRow(1, $r, $row[“username”]);

Good luck! :slight_smile:

Hey I just added these lines but the export file is not showing any data and its not showing the username either.

Hi @Ibrahim ,

I already comprehensively reported this issue with details in the forum and I think it is on to do list for V 20 .

@sandra can you confirm this?

Cheers

Will appreciate it if you could share the link :slight_smile:

Hi Ibrahim. If you like you can send me the file for me to have a closer look at your changes. :slight_smile:

That would be great

Hi Ibrahim! Seems like you sent the original file. Please do the changes. I’ll then have a closer look. :slight_smile:

I undid the changes but the export still didn’t work. I have now re-added the changes you had suggested :slight_smile:

Hi Ibrahim! Nicely done! There’s a missing comma at the end of line 53. Should work just fine after adding it. :slight_smile: