Benjamin Berg Update budget and script to sync it.  over 8 years ago

Commit id: d2400df8fec0c78bb7a83f1e57507f123af05a6a

deletions | additions      

       

\begin{tabularx}{\linewidth}{XSSS}  & {Best Case} & {Expected} & {Worst Case} \\  \hline\hline  Income \hspace*{1em} & {}  & {}  & \\ {}\\  \hspace*{1em} Donations at Registration & 9000,00 9000.00  & 6125,00 6125.00  & 3750,00 \\ 3750.00\\  \hspace*{1em} Other Donations Sponsorship  & 35000.00  & 35000.00  & \\ 35000.00\\  \hspace*{1em} Sponsorship Local Sponsors  & 45000,00 10000.00  & 35000,00 5000.00  & 30000,00 \\ 2000.00\\  \hspace*{1em} Merchandise & 2000,00 1600.00  & 1500,00 1300.00  & 1000,00 \\ 1000.00\\  \hspace*{1em} Services (e.g. Canteen) & {}  & {}  & \\  \hspace*{1em} Google Travel Sponsorship & 4500,00 & 0,00 & 0,00 \\[1ex] {}\\[0.5ex]  Expenses \hspace*{1em} & {}  & {}  & \\ {}\\  \hspace*{1em} Stationary liability Insurance  & -200.00  & -200.00  & \\ -200.00\\  \hspace*{1em} liability Insurance Lanyards  & -150,00 0.00  & -200,00 0.00  & -300,00 \\ 0.00\\  \hspace*{1em} Lanyards Merchandise  & 0,00 -800.00  & 0,00 -800.00  & 0,00 \\ -800.00\\  \hspace*{1em} Video and Live Streaming & {}  & {}  & \\ {}\\  \hspace*{1em} \hspace*{1em} Travel and Accomodation & -175,00 -175.00  & -300,00 -300.00  & -450,00 \\ -450.00\\  \hspace*{1em} \hspace*{1em} Shipping & -15,00 -15.00  & -30,00 -30.00  & -50,00 \\ -50.00\\  \hspace*{1em} Travel SponsorshipFlights & -25000,00 & -30000,00  & -35000,00 \\  \hspace*{1em} \hspace*{1em} Accomodation -35000.00  & -2750,00 -32000.00  & -4500,00 & -7800,00 \\ -30000.00\\  \hspace*{1em} Venue for core days Keynote Speaker Travel  & 0,00 -3500.00  & -4500,00 -3000.00  & -12000,00 \\ -2500.00\\  \hspace*{1em} Venuefor BoF  & 0,00 -2000.00  & 0,00 -4500.00  & 0,00 \\ -8000.00\\  \hspace*{1em} Social Events & {}  & {}  & \\ {}\\  \hspace*{1em} \hspace*{1em} Z10 Bar AKK/Z10  Evening with free beer drinks  & -900,00 -1500.00  & -1050,00 -500.00  & -1200,00 \\ {–}\\  \hspace*{1em} \hspace*{1em} Picknick & -250,00 -500.00 & -300.00 & {donations}\\  \hspace*{1em} \hspace*{1em} Barbecue & -1000.00  & -350,00 -50.00  & -500,00 \\ -50.00\\  \hspace*{1em} \hspace*{1em} Soccer Football  Pit Rental & 0,00 0.00  & -75,00 0.00  & -150,00 \\ 0.00\\  \hspace*{1em} Misc & {}  & {}  & \\ {}\\  \hspace*{1em} \hspace*{1em} Speaker Gifts & -100,00 -500.00  & -300,00 -300.00  & -500,00 \\ -200.00\\  \hspace*{1em} \hspace*{1em} KVV tickets for everyone & -500,00 -800.00  & -650,00 -800.00  & -900,00 \\ {–}\\  \hspace*{1em} \hspace*{1em} Car Rentals & -300,00 -800.00 & -800.00 & -300.00\\  \hspace*{1em} \hspace*{1em} Coffee Breaks & -300.00 & -300.00 & {–}\\  \hspace*{1em} \hspace*{1em} Admin and Bank & -750.00 & -750.00 & -750.00\\  \hspace*{1em} \hspace*{1em} Speaker/Volunteer Water & -50.00  & -800,00 -50.00  & -800,00 \\\hline -50.00\\[0.5ex]\hline  \bf  Sum \hspace*{1em} & 30360,00 7710.00  & -130,00 2745.00  & -24900,00 \\ -1600.00\\  \end{tabularx}         

#! /bin/sh #!/usr/bin/env python  # coding: utf-8  import sys  import re  import itertools  budget = sys.stdin.read()  for line in budget.split('\n'):  cells = list(c.strip() for c in line.split('\t'))  # Ignore lines with only empty cells  if not reduce(lambda t, c: t or bool(c), cells):  continue  if cells[0] == '':  cells[0] = r'\hspace*{1em}'  if cells[1] == '':  cells[1] = r'\hspace*{1em}'  if cells[0] in ('Sum', 'Expenses'):  budget += r'[0.5ex]'  if cells[0] == 'Sum':  budget += r'\hline'  cells[0] = r'\bf Sum'  def format_euro(e):  e = re.sub(r'([0-9,.]*)[.,]([0-9]{2})\s*€', r'\1:\2', e)  e = e.replace('.', '')  e = e.replace(',', '')  e = e.replace(':', '.')  try:  e = '%0.2f' % float(e)  except:  e = '{%s}' % e  return e  cells[3:] = [format_euro(c) for c in cells[3:]]  budget += '\n' + ' '.join(cells[0:3]) + ' & ' + ' & '.join(cells[3:]) + r'\\'  print budget  cat | sed 's/\([0-9,.]*\)\s*€/\1/g' | sed 's/\([0-9]\)\.\([0-9]\)/\1\2/g' | \  awk -F '\t' '{ if ($1) {a=$1} else {a="\\hspace*{1em}"}; if ($2) {b=$2} else {b="\\hspace*{1em}"}; if ($1 || $2 || $3 || $4 || $5 || $6) { print a " " b " " $3 " & " $4 " & " $5 " & " $6 " \\\\"; } }'