The report thus far shows the sales and cost of sales. We’ll extend it so that it prints the gross margin, i.e. total sales less cost of sales.
An accumulator is a way of adding up data in the Account Parts.
Every accumulator has to have a name—this is because you can use more than one accumulator in a report. There is nothing special about the name “TOTAL”—it’s just a bit more descriptive than, say, “FRED”.
Note that the accumulator options pop-up menu is set to On,Clear. This option activates the accumulator, and sets its values to zero. The data from every report line from here on will be added to the accumulator. This means that debit balances will increase the value of the accumulator (because they are positive), while credit balances (being negative) will decrease the value.
Note that the line in the body of the report that corresponds to the accumulator is in grey—this indicates that the Part will not be cause anything to actually print on the report.
This will cause the accumulator values to be printed.
We must specify the accumulator name to indicate which accumulator to print. If we specify one that doesn’t exist, MoneyWorks will create one with that name, set its values to zero, and make it start accumulating.
Note that the accumulator total is printed for the Actual column, but it has the wrong sign (it should be positive, as the income is greater than the expenses). This is because it is the sum of the sales accounts (which are negative), added to the sum of the cost of sales accounts (which are positive). We need to reverse the accumulator sign for it to print out correctly. We should also put some additional space between it and the previous line, and also a description saying what it is.
When the accumulator is shown in the report, it will be shown with reversed signs (the actual contents will not change).
This will default to a blank heading, which is fine for achieving some blank space in the report.