Expand public tariffs with tax rules, reserve instruments and economic formulas; add complete PDF and audited direct publisher

This commit is contained in:
unimatrixgit 2026-11-18 23:41:21 +01:00
commit 8eca3945ba

View file

@ -27,7 +27,7 @@ def render(data,logo=None):
green=colors.HexColor('#173c30');gold=colors.HexColor('#af914c');ink=colors.HexColor('#243e34')
body=ParagraphStyle('RatesBody',fontName='Rates',fontSize=9,leading=13,textColor=ink,spaceAfter=8)
title=ParagraphStyle('RatesTitle',fontName='RatesBold',fontSize=25,leading=30,textColor=green,spaceAfter=15)
heading=ParagraphStyle('RatesHeading',fontName='RatesBold',fontSize=14,leading=19,textColor=green,spaceBefore=10,spaceAfter=7)
heading=ParagraphStyle('RatesHeading',fontName='RatesBold',fontSize=14,leading=19,textColor=green,spaceBefore=10,spaceAfter=7,keepWithNext=True)
small=ParagraphStyle('RatesSmall',parent=body,fontSize=7.5,leading=11)
p=lambda text,style=body:Paragraph(escape(str(text)),style)
cash=lambda n:f'{int(n)//100:,}.{int(n)%100:02d} DM'
@ -65,6 +65,11 @@ def render(data,logo=None):
story.append(p('Destinations & transparency',heading));story.append(p('Bank service charges go to the Website bank treasury. Game taxes and payroll deductions go to I.D. Taxes. Posted entries remain in the relevant account ledgers.'))
story.append(p('Sources for the selected payroll parameters',heading))
for source in tax.get('sources',[]):story.append(p(source,small))
for section in data.get('supplementSections',[]):
story.extend([PageBreak(),p(section['title'],title)])
for text in section.get('paragraphs',[]):story.append(p(text))
headers=section.get('headers',[])
if headers:story.append(grid(headers,section.get('rows',[]),[511/len(headers)]*len(headers)))
document.build(story,onFirstPage=frame,onLaterPages=frame);return output.getvalue()
if __name__=='__main__':sys.stdout.buffer.write(render(json.load(sys.stdin),sys.argv[1]if len(sys.argv)>1 else None))