summaryrefslogtreecommitdiff
path: root/app/modules/orders
diff options
context:
space:
mode:
authorMarius Peter <marius.peter@tutanota.com>2022-05-15 13:17:35 +0200
committerMarius Peter <marius.peter@tutanota.com>2022-05-15 13:17:35 +0200
commite084f90c19e779592f6e3f14eb8f70a7287f0dad (patch)
tree1215177356105452c39a916fd050f79c9721f523 /app/modules/orders
parent1dad22d3e45d6506c8624e3a7111240fcc4ab786 (diff)
Modularization.
Diffstat (limited to 'app/modules/orders')
-rw-r--r--app/modules/orders/forms.py35
-rw-r--r--app/modules/orders/routes.py30
2 files changed, 65 insertions, 0 deletions
diff --git a/app/modules/orders/forms.py b/app/modules/orders/forms.py
new file mode 100644
index 0000000..66ab47b
--- /dev/null
+++ b/app/modules/orders/forms.py
@@ -0,0 +1,35 @@
+from flask_wtf import FlaskForm
+from wtforms import (
+ SubmitField,
+ SelectField,
+ HiddenField,
+ StringField,
+ PasswordField,
+ IntegerField,
+ FloatField,
+ BooleanField,
+ DateTimeField,
+)
+from wtforms.validators import InputRequired, Length, NumberRange
+
+
+class AddOrder(FlaskForm): # TODO
+ name = StringField("Product name", validators=[InputRequired()])
+ code_accounting = StringField("Accounting code", default=0)
+ unit_weight = FloatField("Unit weight", default=0)
+ price_net = FloatField("Price (net)", default=0)
+ price_gross = FloatField("Price (gross)", default=0)
+ tax_rate = FloatField("Tax rate", default=0)
+ submit = SubmitField("Add/Update Product")
+
+
+class AddInvoice(FlaskForm):
+ invoice_id_alt = StringField("Alternative invoice ID")
+ customer_id = StringField("Customer ID")
+ customer_reference = StringField("Customer reference")
+ date_billed = StringField("Date billed")
+ date_due = StringField("Date due")
+ amount_net = FloatField("Amount without tax", default=0)
+ amount_gross = FloatField("Amount with tax", default=0)
+ amount_tax = FloatField("Amount of tax", default=0)
+ submit = SubmitField("Add new Invoice")
diff --git a/app/modules/orders/routes.py b/app/modules/orders/routes.py
new file mode 100644
index 0000000..4027a44
--- /dev/null
+++ b/app/modules/orders/routes.py
@@ -0,0 +1,30 @@
+# -*- mode: python; -*-
+
+
+from flask import (
+ Blueprint,
+ render_template,
+ send_file,
+ request,
+ redirect,
+ flash,
+ url_for,
+ jsonify,
+ abort,
+)
+from flask_login import login_required, current_user
+
+
+# from datetime import datetime
+import inspect
+
+
+
+from ... import db
+from ...models import *
+from .forms import *
+
+
+orders = Blueprint("orders", __name__)
+
+
Copyright 2019--2024 Marius PETER