support: Add support to configure fixed_price plan.

This commit is contained in:
Prakhar Pratyush
2024-01-17 18:25:25 +05:30
committed by Tim Abbott
parent 15ba9cf8ec
commit edec29e0b6
148 changed files with 17828 additions and 86 deletions

View File

@@ -21,7 +21,7 @@
{% if plan_data.current_plan.price_per_license %}
<b>Price per license</b>: ${{ dollar_amount(plan_data.current_plan.price_per_license) }}<br />
{% elif plan_data.current_plan.fixed_price %}
<b>Plan has a fixed price.</b>
<b>Plan has a fixed price.</b><br />
{% endif %}
<b>Annual recurring revenue</b>: ${{ dollar_amount(plan_data.annual_recurring_revenue) }}<br />
<b>Start of next billing cycle</b>: {{ plan_data.next_billing_cycle_start.strftime('%d %B %Y') }}<br />

View File

@@ -1,15 +1,15 @@
<h4>⏱️ Next plan information:</h4>
<b>Plan name</b>: {{ plan_data.next_plan.name }}<br />
<b>Status</b>: {{ plan_data.next_plan.get_plan_status_as_text() }}<br />
<b>Start date</b>: {{ plan_data.next_plan.billing_cycle_anchor.strftime('%d %B %Y') }}<br />
<b>Billing schedule</b>: {% if plan_data.next_plan.billing_schedule == plan_data.next_plan.BILLING_SCHEDULE_ANNUAL %}Annual{% else %}Monthly{% endif %}<br />
{% if plan_data.next_plan.discount %}
<b>Discount</b>: {{ format_discount(plan_data.next_plan.discount) }}%<br />
{% endif %}
{% if plan_data.next_plan.price_per_license %}
<b>Start date</b>: {{ plan_data.next_plan.billing_cycle_anchor.strftime('%d %B %Y') }}<br />
<b>Billing schedule</b>: {% if plan_data.next_plan.billing_schedule == plan_data.next_plan.BILLING_SCHEDULE_ANNUAL %}Annual{% else %}Monthly{% endif %}<br />
{% if plan_data.next_plan.discount %}
<b>Discount</b>: {{ format_discount(plan_data.next_plan.discount) }}%<br />
{% endif %}
<b>Price per license</b>: ${{ dollar_amount(plan_data.next_plan.price_per_license) }}<br />
<b>Estimated billed licenses</b>: {{ plan_data.current_plan.licenses_at_next_renewal() }}<br />
{% elif plan_data.next_plan.fixed_price %}
<b>Plan has a fixed price.</b>
<b>Plan has a fixed price.</b><br />
{% endif %}
<b>Estimated annual revenue</b>: ${{ dollar_amount(plan_data.estimated_next_plan_revenue) }}<br />

View File

@@ -0,0 +1,8 @@
<h4>⏱️ Schedule fixed price plan:</h4>
<form method="POST" class="remote-form">
<b>Fixed price</b><br />
{{ csrf_input }}
<input type="hidden" name="{{ remote_type }}" value="{{ remote_id }}" />
<input type="number" name="fixed_price" placeholder="{{_('Annual amount in dollars')}}" required />
<button type="submit" class="btn btn-default support-submit-button">Schedule</button>
</form>

View File

@@ -65,4 +65,10 @@
{% include 'analytics/next_plan_details.html' %}
{% endwith %}
</div>
{% else %}
{% with %}
{% set remote_id = remote_realm.id %}
{% set remote_type = "remote_realm_id" %}
{% include 'analytics/next_plan_forms_support.html' %}
{% endwith %}
{% endif %}

View File

@@ -100,6 +100,12 @@
{% include 'analytics/next_plan_details.html' %}
{% endwith %}
</div>
{% else %}
{% with %}
{% set remote_id = remote_server.id %}
{% set remote_type = "remote_server_id" %}
{% include 'analytics/next_plan_forms_support.html' %}
{% endwith %}
{% endif %}
{% for remote_realm in remote_realms[remote_server.id] %}