Jump to content

Cutom Fields - Add to Report


haap

Recommended Posts

Hello! I am new to Blesta and I am having some trouble adding information to the existing "Transactions Received" report. I have created 4 "Custom Client Fields" and would like to include them into this report. What must I add to the "$this->Record->select($fields, false)" and "$fields = array("transactions.*", section of the transactions_received.php file in order to pull the information from the custom fields in the database?

Aside from adding the "custom client fields" to my report I would also like to include a colum with the services the client has purchased. Any help with this would be very much appreciated. Please let me know if I need to provide more information about the custom fields created.

Link to comment
Share on other sites

First, I would recommend not updating existing reports by editing source code.

You can fetch any data you want from the system by creating your own custom report derived from your own query.

You should think about the data that you want to retrieve and how you want it to be represented in the report. The additions of every custom client field and every purchased service for every client transaction is problematic. The relationship between these data are many-to-many. This does not bode well for a CSV report. You will either end up with numerous redundant rows of data, or you'll have to combine the services and the custom fields into a list in their own column row, per client. The latter limits much of the redundancy, but may make it difficult to interpret. I think breaking the data up into multiple CSV reports would be simpler.

Link to comment
Share on other sites

Are you familiar with SQL at all?

The transaction received report lists a record for each transaction. Including client services would include ALL client services. You may or may not be able to limit the client services listed to those specific to that transaction. In any case, they could be listed in their own column, each on a new line.

For the custom fields, I would need to know the exact custom field names you want to include, or whether you want to include all custom fields. If all custom fields, there would be another column in the CSV, similar to the services, that lists each custom field on a new line. If you only want 2 specific custom fields, then those can be in their own individual columns, or can be combined into a single column, each on a new line.

I just want to make sure you understand the way the information will be displayed in the CSV, as it may be difficult to work with, for instance, if you are importing it into another application.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...