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)
|
automatische code-style-fixes
Bernd Wurst authored 5 years ago
|
src/rechnung/Invoice/__init__.py 5)
|
GiroCode auf den Rechnungen
Bernd Wurst authored 7 months ago
|
src/rechnung/Invoice/__init__.py 6) class Image:
src/rechnung/Invoice/__init__.py 7) def __init__(self, pilimage, caption=None, dpi=80, alignment="left"):
src/rechnung/Invoice/__init__.py 8) self.imagedata = pilimage
src/rechnung/Invoice/__init__.py 9) self.alignment = alignment
src/rechnung/Invoice/__init__.py 10) self.dpi = dpi
src/rechnung/Invoice/__init__.py 11) self.caption = caption
src/rechnung/Invoice/__init__.py 12)
src/rechnung/Invoice/__init__.py 13)
|
Python-3-Migration
Bernd Wurst authored 5 years ago
|
src/rechnung/Invoice/__init__.py 14) class Text:
|
automatische code-style-fixes
Bernd Wurst authored 5 years ago
|
src/rechnung/Invoice/__init__.py 15) def __init__(self, content, urgent=False, headline=None):
src/rechnung/Invoice/__init__.py 16) self.paragraphs = [content]
src/rechnung/Invoice/__init__.py 17) self.urgent = urgent
src/rechnung/Invoice/__init__.py 18) self.headline = headline
|
Struktur verändern (broken!)
Bernd Wurst authored 16 years ago
|
src/rechnung/Invoice/InvoiceObjects.py 19)
|
automatische code-style-fixes
Bernd Wurst authored 5 years ago
|
src/rechnung/Invoice/__init__.py 20) def addParagraph(self, content):
src/rechnung/Invoice/__init__.py 21) self.paragraphs.append(content)
|
Struktur verändern (broken!)
Bernd Wurst authored 16 years ago
|
src/rechnung/Invoice/InvoiceObjects.py 22)
src/rechnung/Invoice/InvoiceObjects.py 23)
|
Python-3-Migration
Bernd Wurst authored 5 years ago
|
src/rechnung/Invoice/__init__.py 24) class Table:
|
automatische code-style-fixes
Bernd Wurst authored 5 years ago
|
src/rechnung/Invoice/__init__.py 25) def __init__(self, vatType='gross', tender=False, summary=True):
src/rechnung/Invoice/__init__.py 26) self.entries = []
src/rechnung/Invoice/__init__.py 27) self.vat = {}
src/rechnung/Invoice/__init__.py 28) self.sum = 0.0
src/rechnung/Invoice/__init__.py 29) self.tender = tender
src/rechnung/Invoice/__init__.py 30) self.summary = summary
src/rechnung/Invoice/__init__.py 31) if vatType not in ['gross', 'net']:
src/rechnung/Invoice/__init__.py 32) raise ValueError('vatType must be »gross« or »net«')
src/rechnung/Invoice/__init__.py 33) self.vatType = vatType
src/rechnung/Invoice/__init__.py 34)
src/rechnung/Invoice/__init__.py 35) def validEntry(self, entry):
src/rechnung/Invoice/__init__.py 36) '''bekommt einen Eintrag und liefert einen Eintrag wenn ok, wirft ansonsten ValueError.
src/rechnung/Invoice/__init__.py 37) wird benutzt um z.B. die Summe auszurechnen oder ähnliches
src/rechnung/Invoice/__init__.py 38) '''
src/rechnung/Invoice/__init__.py 39) e = entry
src/rechnung/Invoice/__init__.py 40) if not ('count' in e and 'subject' in e and 'price' in e and 'vat' in e):
src/rechnung/Invoice/__init__.py 41) raise ValueError('Some data is missing!')
src/rechnung/Invoice/__init__.py 42) if 'unit' not in e:
src/rechnung/Invoice/__init__.py 43) e['unit'] = None
src/rechnung/Invoice/__init__.py 44) ret = {'count': e['count'],
src/rechnung/Invoice/__init__.py 45) 'unit': e['unit'],
src/rechnung/Invoice/__init__.py 46) 'subject': e['subject'],
src/rechnung/Invoice/__init__.py 47) 'price': e['price'],
src/rechnung/Invoice/__init__.py 48) 'total': (e['price'] * e['count']),
src/rechnung/Invoice/__init__.py 49) 'vat': e['vat'],
src/rechnung/Invoice/__init__.py 50) 'tender': False,
src/rechnung/Invoice/__init__.py 51) }
src/rechnung/Invoice/__init__.py 52) if 'tender' in e:
src/rechnung/Invoice/__init__.py 53) ret['tender'] = e['tender']
src/rechnung/Invoice/__init__.py 54) if 'desc' in e:
src/rechnung/Invoice/__init__.py 55) ret['desc'] = e['desc']
src/rechnung/Invoice/__init__.py 56) return ret
src/rechnung/Invoice/__init__.py 57)
src/rechnung/Invoice/__init__.py 58) def addItem(self, data):
src/rechnung/Invoice/__init__.py 59) '''Fügt eine Zeile ein. data muss ein Dict mit passenden Keys und passenden
src/rechnung/Invoice/__init__.py 60) Typen sein'''
src/rechnung/Invoice/__init__.py 61) d = self.validEntry(data)
|
Trage Bankgebühren für Rück...
Bernd Wurst authored 5 years ago
|
src/rechnung/Invoice/__init__.py 62) if not d['vat'] in self.vat:
src/rechnung/Invoice/__init__.py 63) self.vat[d['vat']] = [0, chr(65 + len(self.vat))]
|
automatische code-style-fixes
Bernd Wurst authored 5 years ago
|
src/rechnung/Invoice/__init__.py 64) if 'tender' not in data or not data['tender']:
|
Trage Bankgebühren für Rück...
Bernd Wurst authored 5 years ago
|
src/rechnung/Invoice/__init__.py 65) self.vat[d['vat']][0] += d['total']
|
automatische code-style-fixes
Bernd Wurst authored 5 years ago
|
src/rechnung/Invoice/__init__.py 66) self.sum += d['total']
src/rechnung/Invoice/__init__.py 67) self.entries.append(d)
|
Struktur verändern (broken!)
Bernd Wurst authored 16 years ago
|
src/rechnung/Invoice/InvoiceObjects.py 68)
src/rechnung/Invoice/InvoiceObjects.py 69)
|
Python-3-Migration
Bernd Wurst authored 5 years ago
|
src/rechnung/Invoice/__init__.py 70) class Invoice:
|
automatische code-style-fixes
Bernd Wurst authored 5 years ago
|
src/rechnung/Invoice/__init__.py 71) tender = False
src/rechnung/Invoice/__init__.py 72) caption = 'Rechnung'
|
Umbenannt aber wieder in ko...
Bernd Wurst authored 16 years ago
|
src/rechnung/Invoice/__init__.py 73)
|
automatische code-style-fixes
Bernd Wurst authored 5 years ago
|
src/rechnung/Invoice/__init__.py 74) def __init__(self):
src/rechnung/Invoice/__init__.py 75) self.customerno = None
src/rechnung/Invoice/__init__.py 76) self.addresslines = ['', ]
src/rechnung/Invoice/__init__.py 77) self.salutation = 'Sehr geehrte Damen und Herren,'
src/rechnung/Invoice/__init__.py 78) self.id = None
src/rechnung/Invoice/__init__.py 79) self.parts = []
src/rechnung/Invoice/__init__.py 80) self.pagecount = 0
src/rechnung/Invoice/__init__.py 81) self.date = datetime.date.today()
|
Struktur verändern (broken!)
Bernd Wurst authored 16 years ago
|
src/rechnung/Invoice/InvoiceObjects.py 82)
|
automatische code-style-fixes
Bernd Wurst authored 5 years ago
|
src/rechnung/Invoice/__init__.py 83) def setDate(self, date):
src/rechnung/Invoice/__init__.py 84) if type(date) != datetime.date:
src/rechnung/Invoice/__init__.py 85) raise ValueError('date must be of type »datetime.date«')
src/rechnung/Invoice/__init__.py 86) self.date = date
|
Umbenannt aber wieder in ko...
Bernd Wurst authored 16 years ago
|
src/rechnung/Invoice/__init__.py 87)
src/rechnung/Invoice/__init__.py 88)
src/rechnung/Invoice/__init__.py 89) class Tender(Invoice):
|
automatische code-style-fixes
Bernd Wurst authored 5 years ago
|
src/rechnung/Invoice/__init__.py 90) tender = True
src/rechnung/Invoice/__init__.py 91) caption = 'Angebot'
|
Umbenannt aber wieder in ko...
Bernd Wurst authored 16 years ago
|
src/rechnung/Invoice/__init__.py 92)
src/rechnung/Invoice/__init__.py 93)
src/rechnung/Invoice/__init__.py 94) class Generic(Invoice):
|