I am currently creating a report. The following is a screenshot of a part of that report
When I run the server and print the report, it gives the data like this
I do not want extra blanks rows to appear but I want to keep the table format as it is(I do not want to place deductions below pay and allowances). I tried defining two lists as the follows:
@property
def pay_and_allowances(self):
allowances_lines = []
if self.lines:
for line in self.lines:
if line.category.code in ['BASIC', 'ALW']:
allowances_lines.append(line)
return allowances_lines
and
@property
def deductions(self):
deductions_lines = []
if self.lines:
for line in self.lines:
if line.category.code in ['DED']:
deductions_lines.append(line)
return deductions_lines
and applying them side by side in two separate for loops. But on trying to print the report, it gives me error about matching tags.
Please tell me whether there is a way to make this possible.