diff --git a/.gitignore b/.gitignore index 0eac599..0f25de9 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ venv/ db.sqlite3 localsettings.py uwsgi.local.sh +config.ini \ No newline at end of file diff --git a/auction/views.py b/auction/views.py index e926a11..a04fa53 100644 --- a/auction/views.py +++ b/auction/views.py @@ -15,6 +15,8 @@ from partners.models import Establishment from payment.models import BillingAddress, Invoice, InvoiceItem, InvoicePayment from clients.models import ClientProfile +from payment.demo.models import DemoInvoicePayment # TODO: Remove when no longer needed + from .models import Inquiry, Offer from .forms import InquiryProcessForm, OfferSelectionForm @@ -94,7 +96,8 @@ class InquiryPaymentView(View): invoice = inquiry.invoice except Invoice.DoesNotExist: invoice = Invoice.from_inquiry(inquiry) - payment_url = InvoicePayment.from_invoice(invoice, inquiry.gateway) + # payment_url = InvoicePayment.from_invoice(invoice, inquiry.gateway) # TODO: Make this work again + payment_url = DemoInvoicePayment.initiate(invoice) if not payment_url: messages.error(request, "Die Zahlung ist leider fehlgeschlagen. Versuche es bitte nochmals!") diff --git a/frontend/templatetags/mapimage.py b/frontend/templatetags/mapimage.py index 3955e90..976959b 100644 --- a/frontend/templatetags/mapimage.py +++ b/frontend/templatetags/mapimage.py @@ -11,7 +11,7 @@ register = template.Library() @register.simple_tag def mapimage(location, zoom=7, width=348, height=250): - smap = StaticMap(width, height, url_template="http://a.tile.osm.org/{z}/{x}/{y}.png") + smap = StaticMap(width, height, url_template="https://tile.openstreetmap.de/{z}/{x}/{y}.png") marker = CircleMarker((location.x, location.y), color="orange", width=20) smap.add_marker(marker) image = smap.render(zoom) diff --git a/partners/models.py b/partners/models.py index f6b107f..21be9c2 100644 --- a/partners/models.py +++ b/partners/models.py @@ -49,15 +49,20 @@ class RoomCategory(GalleryMixin): rooms = models.IntegerField(default=0) active = models.BooleanField(default=True) - def average_price(self, date=None): - dobj = timezone.datetime.strptime(date, "%Y-%m-%d") if date else timezone.now() + # TODO: Pricing via Pricing objects - return RoomCategoryPricing.for_date(self, dobj).average_price - - def minimum_price(self, date=None): - dobj = timezone.datetime.strptime(date, "%Y-%m-%d") if date else timezone.now() - - return RoomCategoryPricing.for_date(self, dobj).minimum_price + average_price = models.DecimalField(max_digits=12, decimal_places=2) + minimum_price = models.DecimalField(max_digits=12, decimal_places=2, default=0) + +# def average_price(self, date=None): +# dobj = timezone.datetime.strptime(date, "%Y-%m-%d") if date else timezone.now() +# +# return RoomCategoryPricing.for_date(self, dobj).average_price +# +# def minimum_price(self, date=None): +# dobj = timezone.datetime.strptime(date, "%Y-%m-%d") if date else timezone.now() +# +# return RoomCategoryPricing.for_date(self, dobj).minimum_price class RoomCategoryPricing(models.Model): roomcategory = models.ForeignKey(RoomCategory, models.CASCADE) diff --git a/payment/models/invoice.py b/payment/models/invoice.py index 02fc37b..0abe469 100644 --- a/payment/models/invoice.py +++ b/payment/models/invoice.py @@ -88,7 +88,8 @@ class Invoice(models.Model): bottom_tip += "Dokument erstellt: %s" % str(timezone.now()) args = { - "type": InvoiceTypeChoices._value2label_map_[self.type], + # "type": InvoiceTypeChoices._value2label_map_[self.type], # TODO: Make this work again + "type": "Rechnung", "object": self, "bottom_tip": bottom_tip } diff --git a/templates/auction/bidding_list.html b/templates/auction/bidding_list.html index 53599ac..1630b4a 100644 --- a/templates/auction/bidding_list.html +++ b/templates/auction/bidding_list.html @@ -2,6 +2,7 @@ {% load i18n %} {% load bootstrap4 %} {% load static %} +{% load distance %} {% block "styles" %} @@ -30,10 +31,10 @@