haap Posted September 6, 2016 Report Posted September 6, 2016 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. Quote
Tyson Posted September 10, 2016 Report Posted September 10, 2016 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. Blesta Addons 1 Quote
haap Posted September 14, 2016 Author Report Posted September 14, 2016 Thanks for the reply Tyson. What would be the query to create a custom report with the same fields as the transactions received report plus the services purchased by each client and two custom fields I have created (Client Additional Email and Client DOB)? Quote
Tyson Posted September 15, 2016 Report Posted September 15, 2016 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.