diff --git a/api/organisations/migrations/0026_auto_20210907_1232.py b/api/organisations/migrations/0026_auto_20210907_1232.py new file mode 100644 index 000000000000..846523ebac10 --- /dev/null +++ b/api/organisations/migrations/0026_auto_20210907_1232.py @@ -0,0 +1,27 @@ +# Generated by Django 2.2.24 on 2021-09-07 12:32 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("organisations", "0025_auto_20210223_1603"), + ] + + operations = [ + migrations.AddField( + model_name="subscription", + name="notes", + field=models.CharField(blank=True, max_length=500, null=True), + ), + migrations.AddField( + model_name="subscription", + name="payment_method", + field=models.CharField( + choices=[("CHARGEBEE", "Chargebee"), ("XERO", "Xero")], + default="CHARGEBEE", + max_length=20, + ), + ), + ] diff --git a/api/organisations/models.py b/api/organisations/models.py index 9093f3a1c84e..1b78fc890c2a 100644 --- a/api/organisations/models.py +++ b/api/organisations/models.py @@ -99,6 +99,19 @@ class Subscription(models.Model): cancellation_date = models.DateTimeField(blank=True, null=True) customer_id = models.CharField(max_length=100, blank=True, null=True) + CHARGEBEE = "CHARGEBEE" + XERO = "XERO" + PAYMENT_METHODS = [ + (CHARGEBEE, "Chargebee"), + (XERO, "Xero"), + ] + payment_method = models.CharField( + max_length=20, + choices=PAYMENT_METHODS, + default=CHARGEBEE, + ) + notes = models.CharField(max_length=500, blank=True, null=True) + def update_plan(self, plan_id): self.cancellation_date = None self.plan = plan_id diff --git a/api/sales_dashboard/templates/sales_dashboard/home.html b/api/sales_dashboard/templates/sales_dashboard/home.html index 96f84f3e5022..788617ce82c8 100644 --- a/api/sales_dashboard/templates/sales_dashboard/home.html +++ b/api/sales_dashboard/templates/sales_dashboard/home.html @@ -59,7 +59,13 @@