cd /home/def/otb_billing || exit 1 set -e STAMP="$(date +%Y%m%d-%H%M%S)" cp templates/portal_dashboard.html "templates/portal_dashboard.html.bak.${STAMP}" cp templates/portal/services_here.html "templates/portal/services_here.html.bak.${STAMP}" cat > templates/portal_base.html <<'EOF' {% block title %}Portal - OutsideTheBox{% endblock %} {% block head_extra %}{% endblock %} {% include "includes/site_nav.html" %}
{% block portal_content %}{% endblock %}
{% block scripts %}{% endblock %} {% include "includes/otb_footer.html" %} EOF cat > templates/portal_dashboard.html <<'EOF' {% extends "portal_base.html" %} {% block title %}Client Dashboard - OutsideTheBox{% endblock %} {% block portal_content %}

Client Dashboard

{{ client.company_name or client.contact_name or client.email }}

Invoices, balances, and account activity in one place.

Services Here Download All Invoices Customer Support Logout
Logged in as: {{ client.contact_name or client.company_name or client.email }}
{% if client_credit_balance and client_credit_balance != "0.00" %}
🏦 Credit: ${{ client_credit_balance }}
{% endif %}

Total Invoices

{{ invoice_count }}
Invoices currently visible in your portal

Total Outstanding

{{ total_outstanding }}
Current unpaid balance

Total Paid

{{ total_paid }}
Payments already applied

Invoices

{% for row in invoices %} {% else %} {% endfor %}
Invoice Status Created Total Paid Outstanding
{{ row.invoice_number or ("INV-" ~ row.id) }} {% set s = (row.status or "")|lower %} {% if s == "paid" %} {{ row.status }} {% if row.payment_method_label %}
{{ row.payment_method_label }}
{% endif %} {% elif s == "pending" %} {{ row.status }} {% elif s == "overdue" %} {{ row.status }} {% else %} {{ row.status }} {% endif %}
{{ row.created_at }} {{ row.total_amount }} {{ row.amount_paid }} {{ row.outstanding }}
No invoices available.
{% endblock %} {% block scripts %} {% endblock %} EOF cat > templates/portal/services_here.html <<'EOF' {% extends "portal_base.html" %} {% block title %}Services - OutsideTheBox{% endblock %} {% block portal_content %}

Services

{{ client_name }}

Launch available OTB services from one place.

Back to Dashboard Logout
Logged in as: {{ client_name }}
{% for service in services %}

{{ service.name }}

{{ service.summary }}

{% if service.status == 'beta' %} Beta {% elif service.status == 'coming_soon' %} Coming Soon {% else %} Available {% endif %}
{% if service.enabled %} {{ service.button_text }} {% else %} {% endif %}
{% endfor %}
{% endblock %} EOF sudo systemctl restart otb_billing.service sudo systemctl status otb_billing.service --no-pager -l | sed -n '1,30p'