7aad9daed561ee23f3dab6a8015d3d432ad93585
Bernd Wurst Struktur verändern (broken!)

Bernd Wurst authored 16 years ago

src/rechnung/Invoice/InvoiceObjects.py  1) # -* coding: utf8 *-
src/rechnung/Invoice/InvoiceObjects.py  2) 
src/rechnung/Invoice/InvoiceObjects.py  3) import datetime
src/rechnung/Invoice/InvoiceObjects.py  4) 
Bernd Wurst Umbenannt aber wieder in ko...

Bernd Wurst authored 16 years ago

src/rechnung/Invoice/__init__.py        5) class Text(object):
Bernd Wurst Struktur verändern (broken!)

Bernd Wurst authored 16 years ago

src/rechnung/Invoice/InvoiceObjects.py  6)   def __init__(self, content, urgent=False, headline=None):
src/rechnung/Invoice/InvoiceObjects.py  7)     self.paragraphs = [content]
src/rechnung/Invoice/InvoiceObjects.py  8)     self.urgent = urgent
src/rechnung/Invoice/InvoiceObjects.py  9)     self.headline = headline
src/rechnung/Invoice/InvoiceObjects.py 10) 
src/rechnung/Invoice/InvoiceObjects.py 11)   def addParagraph(self, content):
src/rechnung/Invoice/InvoiceObjects.py 12)     self.paragraphs.append(content)
src/rechnung/Invoice/InvoiceObjects.py 13) 
src/rechnung/Invoice/InvoiceObjects.py 14) 
Bernd Wurst Umbenannt aber wieder in ko...

Bernd Wurst authored 16 years ago

src/rechnung/Invoice/__init__.py       15) class Table(object):
Bernd Wurst Struktur verändern (broken!)

Bernd Wurst authored 16 years ago

src/rechnung/Invoice/InvoiceObjects.py 16)   def __init__(self, vatType = 'gross', tender = False, summary = True):
src/rechnung/Invoice/InvoiceObjects.py 17)     self.entries = []
src/rechnung/Invoice/InvoiceObjects.py 18)     self.vat = {}
src/rechnung/Invoice/InvoiceObjects.py 19)     self.sum = 0.0
src/rechnung/Invoice/InvoiceObjects.py 20)     self.tender = tender
src/rechnung/Invoice/InvoiceObjects.py 21)     self.summary = summary
src/rechnung/Invoice/InvoiceObjects.py 22)     if vatType not in ['gross', 'net']:
src/rechnung/Invoice/InvoiceObjects.py 23)       raise ValueError('vatType must be »gross« or »net«')
src/rechnung/Invoice/InvoiceObjects.py 24)     self.vatType = vatType
src/rechnung/Invoice/InvoiceObjects.py 25) 
src/rechnung/Invoice/InvoiceObjects.py 26)   def validEntry(self, entry):
src/rechnung/Invoice/InvoiceObjects.py 27)     '''bekommt einen Eintrag und liefert einen Eintrag wenn ok, wirft ansonsten ValueError.
src/rechnung/Invoice/InvoiceObjects.py 28)     wird benutzt um z.B. die Summe auszurechnen oder ähnliches
src/rechnung/Invoice/InvoiceObjects.py 29)     '''
src/rechnung/Invoice/InvoiceObjects.py 30)     k = entry.keys()
src/rechnung/Invoice/InvoiceObjects.py 31)     e = entry
src/rechnung/Invoice/InvoiceObjects.py 32)     if not ('count' in k and 'subject' in k and 'price' in k and 'vat' in k):
src/rechnung/Invoice/InvoiceObjects.py 33)       raise ValueError('Some data is missing!')
Bernd Wurst Einheit

Bernd Wurst authored 11 years ago

src/rechnung/Invoice/__init__.py       34)     if not 'unit' in e.keys():
src/rechnung/Invoice/__init__.py       35)       e['unit'] = None
Bernd Wurst Struktur verändern (broken!)

Bernd Wurst authored 16 years ago

src/rechnung/Invoice/InvoiceObjects.py 36)     ret = {'count': e['count'],
Bernd Wurst Einheit

Bernd Wurst authored 11 years ago

src/rechnung/Invoice/__init__.py       37)            'unit': e['unit'],
Bernd Wurst Struktur verändern (broken!)

Bernd Wurst authored 16 years ago

src/rechnung/Invoice/InvoiceObjects.py 38)           'subject': e['subject'],
src/rechnung/Invoice/InvoiceObjects.py 39)           'price': e['price'],
src/rechnung/Invoice/InvoiceObjects.py 40)           'total': (e['price'] * e['count']),
src/rechnung/Invoice/InvoiceObjects.py 41)           'vat': e['vat'],
src/rechnung/Invoice/InvoiceObjects.py 42)           'tender': False,
src/rechnung/Invoice/InvoiceObjects.py 43)           }
src/rechnung/Invoice/InvoiceObjects.py 44)     if 'tender' in e.keys():
src/rechnung/Invoice/InvoiceObjects.py 45)       ret['tender'] = e['tender']
src/rechnung/Invoice/InvoiceObjects.py 46)     if 'desc' in k:
src/rechnung/Invoice/InvoiceObjects.py 47)       ret['desc'] = e['desc']
src/rechnung/Invoice/InvoiceObjects.py 48)     return ret
src/rechnung/Invoice/InvoiceObjects.py 49) 
src/rechnung/Invoice/InvoiceObjects.py 50)   def addItem(self, data):
src/rechnung/Invoice/InvoiceObjects.py 51)     '''Fügt eine Zeile ein. data muss ein Dict mit passenden Keys und passenden
src/rechnung/Invoice/InvoiceObjects.py 52)     Typen sein'''
src/rechnung/Invoice/InvoiceObjects.py 53)     d = self.validEntry(data)
Bernd Wurst Innergemeinschaftliche Leis...

Bernd Wurst authored 12 years ago

src/rechnung/Invoice/__init__.py       54)     if d['vat'] != 0:
src/rechnung/Invoice/__init__.py       55)       if not d['vat'] in self.vat.keys():
src/rechnung/Invoice/__init__.py       56)         self.vat[d['vat']] = [0, chr(65+len(self.vat))]
src/rechnung/Invoice/__init__.py       57)       if 'tender' not in data or not data['tender']:
src/rechnung/Invoice/__init__.py       58)         self.vat[d['vat']][0] += d['total']
Bernd Wurst Struktur verändern (broken!)

Bernd Wurst authored 16 years ago

src/rechnung/Invoice/InvoiceObjects.py 59)     if 'tender' not in data or not data['tender']:
src/rechnung/Invoice/InvoiceObjects.py 60)       self.sum += d['total']
src/rechnung/Invoice/InvoiceObjects.py 61)     self.entries.append(d)
src/rechnung/Invoice/InvoiceObjects.py 62) 
src/rechnung/Invoice/InvoiceObjects.py 63) 
src/rechnung/Invoice/InvoiceObjects.py 64) 
src/rechnung/Invoice/InvoiceObjects.py 65) class Invoice(object):
Bernd Wurst Umbenannt aber wieder in ko...

Bernd Wurst authored 16 years ago

src/rechnung/Invoice/__init__.py       66)   tender = False
src/rechnung/Invoice/__init__.py       67)   caption = 'Rechnung'
src/rechnung/Invoice/__init__.py       68) 
src/rechnung/Invoice/__init__.py       69)   def __init__(self):
Bernd Wurst Struktur verändern (broken!)

Bernd Wurst authored 16 years ago

src/rechnung/Invoice/InvoiceObjects.py 70)     self.customerno = None
src/rechnung/Invoice/InvoiceObjects.py 71)     self.addresslines = ['', ]
Bernd Wurst Typo

Bernd Wurst authored 13 years ago

src/rechnung/Invoice/__init__.py       72)     self.salutation = 'Sehr geehrte Damen und Herren,'
Bernd Wurst Struktur verändern (broken!)

Bernd Wurst authored 16 years ago

src/rechnung/Invoice/InvoiceObjects.py 73)     self.id = None
src/rechnung/Invoice/InvoiceObjects.py 74)     self.parts = []
src/rechnung/Invoice/InvoiceObjects.py 75)     self.pagecount = 0
src/rechnung/Invoice/InvoiceObjects.py 76)     self.date = datetime.date.today()
src/rechnung/Invoice/InvoiceObjects.py 77) 
src/rechnung/Invoice/InvoiceObjects.py 78)   def setDate(self, date):
src/rechnung/Invoice/InvoiceObjects.py 79)     if type(date) != datetime.date:
src/rechnung/Invoice/InvoiceObjects.py 80)       raise ValueError('date must be of type »datetime.date«')
src/rechnung/Invoice/InvoiceObjects.py 81)     self.date = date