Asaf, I'm not certain exactly how this report is supposed to be structured, but I copied your code into a module and worked out all the kinks I could identify. Below is the revised code I came up with.
In a few cases, you had an undeclared variable (cursale was declared, but in some places it...