Topic: More detail needed for dimensions

It seems that the dimensions reports are fairly limited which limits its usefulness.

Currently it seems that it is only the dimensions report that give you a nett total for each dimension, or Income and expense statement for a particular dimension.

We need to be ably to display a list of invoice for a particular dimension to determine the number of invoices issues for a specific project on a particular client that we work on. Some client we work on multiple projects at the same time, but have to report on each project separately.

Maybe a list of invoices for a particular dimension on the client statement only displaying that particular dimensions invoices relating to that dimension. Indicating which invoices on that particular project has not been paid.

Will make life a lot easier to reconcile.

Wynand

Re: More detail needed for dimensions

Try tags.

Re: More detail needed for dimensions

I will have to try and figure out these tags since there is not a lot of info.

It seems that all the posts regarding tags deals with income statements only, and will not provide me with a list of invoices that the dimension was attached to.

when for example I have a dimension A and dimension B on Level1 and I need to have a list of invoices for list be, it is not possible.

I do not see how using tags will provide me with that information if the only place where tags can be used is in the Income Statement report.

Wynand

Re: More detail needed for dimensions

Which specific report (repXXX.php) are you referring to - maybe we can alter it's sql to include a dimension filter to get what you want. The Wiki has a list of reports and their screenshots.

Re: More detail needed for dimensions

Hi

I think that the statement report where invoices and payments are listed could work if you can search for a specific dimension attached to that Customer.  The customer balances report can also work.

Wynand

6 (edited by apmuthu 09/09/2015 10:16:11 pm)

Re: More detail needed for dimensions

That would be rep108.php file along with form field entries coming from the reports_main.php file.

After backing up the files, overwrite the files in the reporting folder with the ones in the attachment and see if it is what you want.

rep108.php in it's function getTransactions() has an sql statement that refers to just 1 table where the fields can be written without the table name prefix.

Post's attachments

new.zip 5.6 kb, 1 downloads since 2015-09-09 

You don't have the permssions to download the attachments of this post.

Re: More detail needed for dimensions

Hi

Let me start by thanking you for your input.

Have replaced the files. The report does give the info required, but there are two issues that I can pick up:

1. The dimension Name is not displayed anywhere on the Statement
2. The dimension total is the same as the total outstanding for all the dimensions on that particular client and not just for the invoices outstanding for the specific dimension.

For example:

Dimension A and Dimension B is linked to the same customer. Drawing a reports then on the customer with no dimension selected gives you the answer for the total outstanding for A+B.

when selecting Dimension A, the Invoices and amounts listed in the detail matches the dimension, but the total for the Statement is still A+B instead of the total only for A

Hopes this makes sense, but it gives a great platform to work from.

Regards

Wynand

Re: More detail needed for dimensions

HI

It would also be great if we could save the statement as Excel.

Wynand

9 (edited by apmuthu 09/28/2015 04:00:42 pm)

Re: More detail needed for dimensions

Unfortunately, this report has not been coded for excel and hence the choice is not there in the menu.

The simulation of the sql in the function getTransactions() in reporting/rep108.php using the en_US-demo.sql Chart of Accounts is illustrated in the attachment herein - it contains the raw table data and the sql results which includes the CUSTCREDIT entries as well. The Simulation SQL is:

SET @date_due := '2014-09-23';
SET @date_now := '2014-07-25';
SET @debtor_no := 3;
SET @dimension_id := 2; -- Dimension 1
-- SET @dimension2_id := 2; -- Dimension 2

-- Taken from defines in includes/types.inc
-- ST_SALESINVOICE = 10
-- ST_CUSTCREDIT   = 11
-- ST_CUSTDELIVERY = 13


SELECT  dt.*,
        (ov_amount + ov_gst + ov_freight + ov_freight_tax + ov_discount) AS TotalAmount, alloc AS Allocated,
    ((TYPE = 10) AND due_date < @date_now) AS OverDue
FROM 1_debtor_trans dt
WHERE tran_date <= @date_due 
  AND debtor_no = @debtor_no
  AND TYPE <> 13
  AND ABS(ov_amount + ov_gst + ov_freight + ov_freight_tax + ov_discount) > 1e-6
-- if (!$show_also_allocated)
-- AND ABS(ABS(ov_amount + ov_gst + ov_freight + ov_freight_tax + ov_discount) - alloc) > 1e-6
-- Dimension 1
 AND dimension_id = @dimension_id
-- Dimension 2
-- AND dimension2_id = @dimension2_id
ORDER BY tran_date;

FLOAT_COMP_DELTA defined as a FA constant in PHP is used instead of 1e-6 in some places.

You may use the above in any MySQL client and execute them all on your database and check the results.

I see no reason why your output does not conform to what is expected. Please clear your report and js cache and try it again and use appropriate values for the constants defined in the code above on your database and verify the results to see if it matches your output.

The dimension name comes from another table and you will have to alter the sql to join it to that table like:

SELECT ....., d1.name AS D1Name
-- Dimension 2 if used
-- , d2. name A D2Name 
FROM 1_debtor_trans dt 
LEFT JOIN 1_dimensions d1 ON (dt.dimension_id=d1.id)
-- Dimension 2 if used
-- LEFT JOIN 1_dimensions d2 ON (dt.dimension2_id=d2.id)
WHERE ......
ORDER BY tran_date;

Then use the D1Name (and D2Name if appropriate) as desired in the report. Experiment with INNER JOIN instead of LEFT JOIN for the first or both instances as desired.

Post's attachments

rep108_simulation.png 135.1 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Re: More detail needed for dimensions

Apmuthu

The reports is providing the data require as per your zip file above.

When a dimension is selected for the report for that customer, it lists the correct entries in each line.

The Total at the bottom of the Statement report is the Total for all the dimensions for that customer, not just the total for specific Dimension selected.

I do not know if the above would fix the issue? It seems to the same as the info in the attached zip folder above.

regards

Wynand

Wynand

Re: More detail needed for dimensions

Is there a way that I can send you copy of the report with the data?

At the bottom of the reports where it reads: "Total Balance" it is the total balance for all the dimensions relating to that on customer, instead of the Total for that one selected dimension only.

Wynand

12 (edited by apmuthu 09/28/2015 03:50:09 pm)

Re: More detail needed for dimensions

A Customer's due is on the whole and not just for a specific dimension. That is why the function get_customer_details() (defined in sales/includes/db/customers_db.inc) is used to get the balances and it does not bother about the dimensions. If you want it to filter by dimension, copy over the function to another name in the rep108.php and put in your dimension filter and call this new function in the rep108.php  instead of the old one.

The attachment is from the demo CoA and it does not illustrate your case and is here only for there report format.

This is probably why the dimensions were not included in this report!

Post's attachments

56095e745ea5f.pdf 2.9 kb, 5 downloads since 2015-09-28 

You don't have the permssions to download the attachments of this post.

Re: More detail needed for dimensions

Thanks, I assumed that it is the case, but would not have an idea where to begin to call this new function. in Rep108.pdf.

Your new.zip change works great accept for the Total Balance.

Is there a way that one could have a sub balance for the dimension and then the total balance below?

Would that be the same if one would use dimensions to filter in Customer Balances report Report101.pdf

Wynand

14 (edited by apmuthu 09/28/2015 04:06:36 pm)

Re: More detail needed for dimensions

The balances come from a different function. You could however, iterate within the loop using a variable to hold the sum (and the logic of date differences) to achieve what you want.

You have literally opened a can of worms here. Hope FA 2.4 addresses it better. Thanks for stirring up the proverbial hornet's nest and lets see what good comes of it.

You could test out the rep101.php with dimensions and report your findings. I do not see the use of any Dimensions in it.

15 (edited by seahawk 09/29/2015 12:39:07 pm)

Re: More detail needed for dimensions

Some clients work on projects and their clients whom they do the project for wants the outstanding amounts on the invoices per project.

I thought that if you setup the project as a branch of the client that it might work, but you can not draw reports for the branch, only for the main company.

I also thought that you could setup each project with that client as a separate client, but then it becomes a nightmare to keep track of the cost items for that project.

Seems to be a hornet's nest like you say.

I am thinking of using an open source project management software for the tracking and costing of the project and then monthly bring in the total cost before invoicing from FA.

Regards

Wynand

Re: More detail needed for dimensions

You might want to use SimpleInvoices to manage each project as a client and then get the summary each month into your FA. You might want to try out my fork of it as well.

Re: More detail needed for dimensions

Thanks.

Was also thinking in the line of dotproject or openproject.

Will have a look at your suggestion.

Regards

Wynand