New: - Removed the connection between tables 'receipt_item' and 'item'. Instead the position on the receipt will be stored as a primary key with the receipt.id. - Uploading a receipt and checking items for invoice is now working. - Uploading a receipt now redirects directly to the form where the items on the receipt can be marked for invoice. - Added pagination for candidates-page. Refactoring: - Added _rencer_field_errors.html for centralized error display. - Added edeka_parser.py for better management of different parsers. Known Bugs: - Uploading a receipt without any fields results in an error. Todo: - Generate a general form if no fields are recognized on the uploaded receipt. - Create form where Admin can confirm receipt invoices. - Display Notification for admin when users upload receipt. - Display Notification for admin on new candidate.
13 lines
471 B
Python
13 lines
471 B
Python
from src import db
|
|
|
|
|
|
class ReceiptItem(db.Model):
|
|
receipt = db.Column(db.ForeignKey("receipt.id"),
|
|
primary_key=True, server_onupdate=db.FetchedValue())
|
|
item = db.Column(db.SmallInteger, primary_key=True, nullable=False)
|
|
amount = db.Column(db.SmallInteger, nullable=False, default=str(1))
|
|
price = db.Column(db.SmallInteger, nullable=False)
|
|
|
|
def __repr__(self) -> str:
|
|
return f"<ReceiptItem {self.receipt}: {self.item}>"
|