You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
3.2 KiB

  1. {% extends "base.html" %}
  2. {% block title %}Billing History - healthchecks.io{% endblock %}
  3. {% block content %}
  4. <h1>Billing History</h1>
  5. <div class="row">
  6. <div class="col-sm-9">
  7. <table class="table">
  8. <tr>
  9. <th>Date</th>
  10. <th>Payment Method</th>
  11. <th>Amount</th>
  12. <th>Status</th>
  13. <th></th>
  14. </tr>
  15. {% for tx in transactions %}
  16. <tr>
  17. <td>{{ tx.created_at }}</td>
  18. <td>
  19. {% if tx.payment_instrument_type == "paypal_account" %}
  20. Paypal from {{ tx.paypal.payer_email }}
  21. {% endif %}
  22. {% if tx.payment_instrument_type == "credit_card" %}
  23. {{ tx.credit_card.card_type }} ending in {{ tx.credit_card.last_4 }}
  24. {% endif %}
  25. </td>
  26. <td>
  27. {% if tx.currency_iso_code == "USD" %}
  28. ${{ tx.amount }}
  29. {% elif tx.currency_iso_code == "EUR" %}
  30. €{{ tx.amount }}
  31. {% else %}
  32. {{ tx.currency_iso_code }} {{ tx.amount }}
  33. {% endif %}
  34. </td>
  35. <td><code>{{ tx.status }}</code></td>
  36. <td>
  37. <a href="{% url 'hc-invoice' tx.id %}">View Invoice</a>
  38. </td>
  39. </tr>
  40. {% empty %}
  41. <tr>
  42. <td colspan="5">
  43. No past transactions to display here
  44. </td>
  45. </tr>
  46. {% endfor%}
  47. </table>
  48. </div>
  49. <div class="col-sm-3">
  50. <p><strong>Bill to:</strong></p>
  51. <p>
  52. {% if request.user.profile.bill_to %}
  53. {{ request.user.profile.bill_to|linebreaksbr }}
  54. {% else %}
  55. {{ request.user.email }}
  56. {% endif %}
  57. </p>
  58. <button
  59. data-toggle="modal"
  60. data-target="#bill-to-modal"
  61. class="btn btn-default">
  62. Edit Company Details…
  63. </button>
  64. </div>
  65. </div>
  66. <div id="bill-to-modal" class="modal">
  67. <div class="modal-dialog">
  68. <form id="bill-to-form" method="post">
  69. {% csrf_token %}
  70. <div class="modal-content">
  71. <div class="modal-header">
  72. <button type="button" class="close" data-dismiss="modal">&times;</button>
  73. <h4>Company Details for Invoice</h4>
  74. </div>
  75. <div class="modal-body">
  76. <textarea
  77. name="bill_to"
  78. class="form-control"
  79. rows="5">{{ request.user.profile.bill_to|default:request.user.email }}</textarea>
  80. </div>
  81. <div class="modal-footer">
  82. <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  83. <button type="submit" class="btn btn-primary">Save Changes</button>
  84. </div>
  85. </div>
  86. </form>
  87. </div>
  88. </div>
  89. {% endblock %}