02a92c30399a65ed59e1ca82b4d7c63e3f252e80
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 automatische code-style-fixes

Bernd Wurst authored 5 years ago

src/rechnung/Invoice/__init__.py        5) 
Bernd Wurst Python-3-Migration

Bernd Wurst authored 5 years ago

src/rechnung/Invoice/__init__.py        6) class Text:
Bernd Wurst automatische code-style-fixes

Bernd Wurst authored 5 years ago

src/rechnung/Invoice/__init__.py        7)     def __init__(self, content, urgent=False, headline=None):
src/rechnung/Invoice/__init__.py        8)         self.paragraphs = [content]
src/rechnung/Invoice/__init__.py        9)         self.urgent = urgent
src/rechnung/Invoice/__init__.py       10)         self.headline = headline
Bernd Wurst Struktur verändern (broken!)

Bernd Wurst authored 16 years ago

src/rechnung/Invoice/InvoiceObjects.py 11) 
Bernd Wurst automatische code-style-fixes

Bernd Wurst authored 5 years ago

src/rechnung/Invoice/__init__.py       12)     def addParagraph(self, content):
src/rechnung/Invoice/__init__.py       13)         self.paragraphs.append(content)
Bernd Wurst Struktur verändern (broken!)

Bernd Wurst authored 16 years ago

src/rechnung/Invoice/InvoiceObjects.py 14) 
src/rechnung/Invoice/InvoiceObjects.py 15) 
Bernd Wurst Python-3-Migration

Bernd Wurst authored 5 years ago

src/rechnung/Invoice/__init__.py       16) class Table:
Bernd Wurst automatische code-style-fixes

Bernd Wurst authored 5 years ago

src/rechnung/Invoice/__init__.py       17)     def __init__(self, vatType='gross', tender=False, summary=True):
src/rechnung/Invoice/__init__.py       18)         self.entries = []
src/rechnung/Invoice/__init__.py       19)         self.vat = {}
src/rechnung/Invoice/__init__.py       20)         self.sum = 0.0
src/rechnung/Invoice/__init__.py       21)         self.tender = tender
src/rechnung/Invoice/__init__.py       22)         self.summary = summary
src/rechnung/Invoice/__init__.py       23)         if vatType not in ['gross', 'net']:
src/rechnung/Invoice/__init__.py       24)             raise ValueError('vatType must be »gross« or »net«')
src/rechnung/Invoice/__init__.py       25)         self.vatType = vatType
src/rechnung/Invoice/__init__.py       26) 
src/rechnung/Invoice/__init__.py       27)     def validEntry(self, entry):
src/rechnung/Invoice/__init__.py       28)         '''bekommt einen Eintrag und liefert einen Eintrag wenn ok, wirft ansonsten ValueError.
src/rechnung/Invoice/__init__.py       29)         wird benutzt um z.B. die Summe auszurechnen oder ähnliches
src/rechnung/Invoice/__init__.py       30)         '''
src/rechnung/Invoice/__init__.py       31)         e = entry
src/rechnung/Invoice/__init__.py       32)         if not ('count' in e and 'subject' in e and 'price' in e and 'vat' in e):
src/rechnung/Invoice/__init__.py       33)             raise ValueError('Some data is missing!')
src/rechnung/Invoice/__init__.py       34)         if 'unit' not in e:
src/rechnung/Invoice/__init__.py       35)             e['unit'] = None
src/rechnung/Invoice/__init__.py       36)         ret = {'count': e['count'],
src/rechnung/Invoice/__init__.py       37)                'unit': e['unit'],
src/rechnung/Invoice/__init__.py       38)                'subject': e['subject'],
src/rechnung/Invoice/__init__.py       39)                'price': e['price'],
src/rechnung/Invoice/__init__.py       40)                'total': (e['price'] * e['count']),
src/rechnung/Invoice/__init__.py       41)                'vat': e['vat'],
src/rechnung/Invoice/__init__.py       42)                'tender': False,
src/rechnung/Invoice/__init__.py       43)                }
src/rechnung/Invoice/__init__.py       44)         if 'tender' in e:
src/rechnung/Invoice/__init__.py       45)             ret['tender'] = e['tender']
src/rechnung/Invoice/__init__.py       46)         if 'desc' in e:
src/rechnung/Invoice/__init__.py       47)             ret['desc'] = e['desc']
src/rechnung/Invoice/__init__.py       48)         return ret
src/rechnung/Invoice/__init__.py       49) 
src/rechnung/Invoice/__init__.py       50)     def addItem(self, data):
src/rechnung/Invoice/__init__.py       51)         '''Fügt eine Zeile ein. data muss ein Dict mit passenden Keys und passenden
src/rechnung/Invoice/__init__.py       52)         Typen sein'''
src/rechnung/Invoice/__init__.py       53)         d = self.validEntry(data)
Bernd Wurst Trage Bankgebühren für Rück...

Bernd Wurst authored 5 years ago

src/rechnung/Invoice/__init__.py       54)         if not d['vat'] in self.vat:
src/rechnung/Invoice/__init__.py       55)             self.vat[d['vat']] = [0, chr(65 + len(self.vat))]
Bernd Wurst automatische code-style-fixes

Bernd Wurst authored 5 years ago

src/rechnung/Invoice/__init__.py       56)         if 'tender' not in data or not data['tender']:
Bernd Wurst Trage Bankgebühren für Rück...

Bernd Wurst authored 5 years ago

src/rechnung/Invoice/__init__.py       57)             self.vat[d['vat']][0] += d['total']
Bernd Wurst automatische code-style-fixes

Bernd Wurst authored 5 years ago

src/rechnung/Invoice/__init__.py       58)             self.sum += d['total']
src/rechnung/Invoice/__init__.py       59)         self.entries.append(d)
Bernd Wurst Struktur verändern (broken!)

Bernd Wurst authored 16 years ago

src/rechnung/Invoice/InvoiceObjects.py 60) 
src/rechnung/Invoice/InvoiceObjects.py 61) 
Bernd Wurst Python-3-Migration

Bernd Wurst authored 5 years ago

src/rechnung/Invoice/__init__.py       62) class Invoice:
Bernd Wurst automatische code-style-fixes

Bernd Wurst authored 5 years ago

src/rechnung/Invoice/__init__.py       63)     tender = False
src/rechnung/Invoice/__init__.py       64)     caption = 'Rechnung'
Bernd Wurst Umbenannt aber wieder in ko...

Bernd Wurst authored 16 years ago

src/rechnung/Invoice/__init__.py       65) 
Bernd Wurst automatische code-style-fixes

Bernd Wurst authored 5 years ago

src/rechnung/Invoice/__init__.py       66)     def __init__(self):
src/rechnung/Invoice/__init__.py       67)         self.customerno = None
src/rechnung/Invoice/__init__.py       68)         self.addresslines = ['', ]
src/rechnung/Invoice/__init__.py       69)         self.salutation = 'Sehr geehrte Damen und Herren,'
src/rechnung/Invoice/__init__.py       70)         self.id = None
src/rechnung/Invoice/__init__.py       71)         self.parts = []
src/rechnung/Invoice/__init__.py       72)         self.pagecount = 0
src/rechnung/Invoice/__init__.py       73)         self.date = datetime.date.today()
Bernd Wurst Struktur verändern (broken!)

Bernd Wurst authored 16 years ago

src/rechnung/Invoice/InvoiceObjects.py 74) 
Bernd Wurst automatische code-style-fixes

Bernd Wurst authored 5 years ago

src/rechnung/Invoice/__init__.py       75)     def setDate(self, date):
src/rechnung/Invoice/__init__.py       76)         if type(date) != datetime.date:
src/rechnung/Invoice/__init__.py       77)             raise ValueError('date must be of type »datetime.date«')
src/rechnung/Invoice/__init__.py       78)         self.date = date
Bernd Wurst Umbenannt aber wieder in ko...

Bernd Wurst authored 16 years ago

src/rechnung/Invoice/__init__.py       79) 
src/rechnung/Invoice/__init__.py       80) 
src/rechnung/Invoice/__init__.py       81) class Tender(Invoice):
Bernd Wurst automatische code-style-fixes

Bernd Wurst authored 5 years ago

src/rechnung/Invoice/__init__.py       82)     tender = True
src/rechnung/Invoice/__init__.py       83)     caption = 'Angebot'
Bernd Wurst Umbenannt aber wieder in ko...

Bernd Wurst authored 16 years ago

src/rechnung/Invoice/__init__.py       84) 
src/rechnung/Invoice/__init__.py       85) 
src/rechnung/Invoice/__init__.py       86) class Generic(Invoice):