diff --git a/uncloud/urls.py b/uncloud/urls.py index 05b1f0f..b20f136 100644 --- a/uncloud/urls.py +++ b/uncloud/urls.py @@ -81,7 +81,6 @@ urlpatterns = [ path('', include(router.urls)), # web/ = stuff to view in the browser - path('web/pdf/', payviews.MyPDFView.as_view(), name='pdf'), path('api-auth/', include('rest_framework.urls', namespace='rest_framework')), # for login to REST API path('openapi', get_schema_view( title="uncloud", diff --git a/uncloud_pay/migrations/0011_billingaddress_organization.py b/uncloud_pay/migrations/0011_billingaddress_organization.py new file mode 100644 index 0000000..ac36eee --- /dev/null +++ b/uncloud_pay/migrations/0011_billingaddress_organization.py @@ -0,0 +1,19 @@ +# Generated by Django 3.0.6 on 2020-05-07 13:07 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('uncloud_pay', '0010_order_description'), + ] + + operations = [ + migrations.AddField( + model_name='billingaddress', + name='organization', + field=models.CharField(default='', max_length=100), + preserve_default=False, + ), + ] diff --git a/uncloud_pay/models.py b/uncloud_pay/models.py index 68016a9..92c58ab 100644 --- a/uncloud_pay/models.py +++ b/uncloud_pay/models.py @@ -444,6 +444,7 @@ class BillingAddress(models.Model): uuid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) owner = models.ForeignKey(get_user_model(), on_delete=models.CASCADE) + organization = models.CharField(max_length=100) name = models.CharField(max_length=100) street = models.CharField(max_length=100) city = models.CharField(max_length=50) diff --git a/uncloud_pay/serializers.py b/uncloud_pay/serializers.py index ad50c68..1d7dcdd 100644 --- a/uncloud_pay/serializers.py +++ b/uncloud_pay/serializers.py @@ -95,7 +95,7 @@ class BillRecordSerializer(serializers.Serializer): class BillingAddressSerializer(serializers.ModelSerializer): class Meta: model = BillingAddress - fields = ['uuid', 'name', 'street', 'city', 'postal_code', 'country', 'vat_number'] + fields = ['uuid', 'organization', 'name', 'street', 'city', 'postal_code', 'country', 'vat_number'] class BillSerializer(serializers.ModelSerializer): billing_address = BillingAddressSerializer(read_only=True) @@ -103,7 +103,7 @@ class BillSerializer(serializers.ModelSerializer): class Meta: model = Bill - fields = ['reference', 'owner', 'amount', 'vat_amount', 'total', + fields = ['uuid', 'reference', 'owner', 'amount', 'vat_amount', 'total', 'due_date', 'creation_date', 'starting_date', 'ending_date', 'records', 'final', 'billing_address'] diff --git a/uncloud_pay/templates/bill.html b/uncloud_pay/templates/bill.html.j2 similarity index 96% rename from uncloud_pay/templates/bill.html rename to uncloud_pay/templates/bill.html.j2 index 8f6c217..0ea7089 100644 --- a/uncloud_pay/templates/bill.html +++ b/uncloud_pay/templates/bill.html.j2 @@ -26,7 +26,7 @@
-