mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 23:52:50 -05:00
billing info and tx management tools
This commit is contained in:
@ -77,7 +77,8 @@
|
||||
<h2>Organization Information</h2>
|
||||
@await Html.PartialAsync("_ViewInformation", Model)
|
||||
<h2>Billing Information</h2>
|
||||
@await Html.PartialAsync("_BillingInformation", Model.BillingInfo)
|
||||
@await Html.PartialAsync("_BillingInformation",
|
||||
new BillingInformationModel { BillingInfo = Model.BillingInfo, OrganizationId = Model.Organization.Id })
|
||||
<form method="post" id="edit-form">
|
||||
<h2>General</h2>
|
||||
<div class="row">
|
||||
|
@ -1,21 +1,26 @@
|
||||
@model Bit.Core.Models.Business.BillingInfo
|
||||
@model BillingInformationModel
|
||||
<dl class="row">
|
||||
<dt class="col-sm-4 col-lg-3">Account @(Model.Balance <= 0 ? "Credit" : "Balance")</dt>
|
||||
<dd class="col-sm-8 col-lg-9">@Math.Abs(Model.Balance).ToString("C")</dd>
|
||||
<dt class="col-sm-4 col-lg-3">Account @(Model.BillingInfo.Balance <= 0 ? "Credit" : "Balance")</dt>
|
||||
<dd class="col-sm-8 col-lg-9">@Math.Abs(Model.BillingInfo.Balance).ToString("C")</dd>
|
||||
|
||||
<dt class="col-sm-4 col-lg-3">Invoices</dt>
|
||||
<dd class="col-sm-8 col-lg-9">
|
||||
@if(Model.Invoices?.Any() ?? false)
|
||||
@if(Model.BillingInfo.Invoices?.Any() ?? false)
|
||||
{
|
||||
<table class="table">
|
||||
<tbody>
|
||||
@foreach(var invoice in Model.Invoices)
|
||||
@foreach(var invoice in Model.BillingInfo.Invoices)
|
||||
{
|
||||
<tr>
|
||||
<td>@invoice.Date</td>
|
||||
<td><a target="_blank" href="@invoice.Url" title="View Invoice">@invoice.Number</a></td>
|
||||
<td>@invoice.Amount.ToString("C")</td>
|
||||
<td>@(invoice.Paid ? "Paid" : "Unpaid")</td>
|
||||
<td>
|
||||
<a target="_blank" href="@invoice.PdfUrl" title="Download Invoice">
|
||||
<i class="fa fa-file-pdf-o"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
@ -29,11 +34,11 @@
|
||||
|
||||
<dt class="col-sm-4 col-lg-3">Transactions</dt>
|
||||
<dd class="col-sm-8 col-lg-9">
|
||||
@if(Model.Transactions?.Any() ?? false)
|
||||
@if(Model.BillingInfo.Transactions?.Any() ?? false)
|
||||
{
|
||||
<table class="table">
|
||||
<tbody>
|
||||
@foreach(var transaction in Model.Transactions)
|
||||
@foreach(var transaction in Model.BillingInfo.Transactions)
|
||||
{
|
||||
<tr>
|
||||
<td>@transaction.CreatedDate</td>
|
||||
@ -41,6 +46,10 @@
|
||||
<td>@transaction.PaymentMethodType.ToString()</td>
|
||||
<td>@transaction.Details</td>
|
||||
<td>@transaction.Amount.ToString("C")</td>
|
||||
<td>
|
||||
<a title="Edit Transaction" asp-controller="Tools" asp-action="EditTransaction"
|
||||
asp-route-id="@transaction.Id"><i class="fa fa-edit"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
@ -48,7 +57,11 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
@: No transactions.
|
||||
<p>No transactions.</p>
|
||||
}
|
||||
<a asp-action="CreateTransaction" asp-controller="Tools" asp-route-organizationId="@Model.OrganizationId"
|
||||
asp-route-userId="@Model.UserId" class="btn btn-sm btn-outline-primary">
|
||||
<i class="fa fa-plus"></i> New Transaction
|
||||
</a>
|
||||
</dd>
|
||||
</dl>
|
||||
|
@ -49,6 +49,9 @@
|
||||
<a class="dropdown-item" asp-controller="Tools" asp-action="ChargeBraintree">
|
||||
Charge Braintree Customer
|
||||
</a>
|
||||
<a class="dropdown-item" asp-controller="Tools" asp-action="CreateTransaction">
|
||||
Create Transaction
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
<li class="nav-item" active-controller="Logs">
|
||||
|
@ -39,6 +39,6 @@ else
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary mb-2" title="Search">Charge Customer</button>
|
||||
<button type="submit" class="btn btn-primary mb-2">Charge Customer</button>
|
||||
</form>
|
||||
}
|
||||
|
109
src/Admin/Views/Tools/CreateUpdateTransaction.cshtml
Normal file
109
src/Admin/Views/Tools/CreateUpdateTransaction.cshtml
Normal file
@ -0,0 +1,109 @@
|
||||
@model CreateUpdateTransactionModel
|
||||
@{
|
||||
var action = Model.Edit ? "Edit" : "Create";
|
||||
ViewData["Title"] = $"{action} Transaction";
|
||||
}
|
||||
|
||||
<h1>@action Transaction</h1>
|
||||
|
||||
<form method="post">
|
||||
<div asp-validation-summary="All" class="alert alert-danger"></div>
|
||||
<div class="row">
|
||||
<div class="col-md">
|
||||
<div class="form-group">
|
||||
<label asp-for="UserId"></label>
|
||||
<input type="text" class="form-control" asp-for="UserId">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md">
|
||||
<div class="form-group">
|
||||
<label asp-for="OrganizationId"></label>
|
||||
<input type="text" class="form-control" asp-for="OrganizationId">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md">
|
||||
<div class="form-group">
|
||||
<label asp-for="Date"></label>
|
||||
<input type="datetime-local" class="form-control" asp-for="Date" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md">
|
||||
<div class="form-group">
|
||||
<div class="form-group">
|
||||
<label asp-for="Type"></label>
|
||||
<select class="form-control" asp-for="Type" required
|
||||
asp-items="Html.GetEnumSelectList<Bit.Core.Enums.TransactionType>()"></select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md">
|
||||
<div class="form-group">
|
||||
<label asp-for="Amount"></label>
|
||||
<div class="input-group mb-3">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">$</span>
|
||||
</div>
|
||||
<input type="number" min="0.01" max="1000000.00" step="0.01" class="form-control"
|
||||
asp-for="Amount" required placeholder="ex. 10.00">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md">
|
||||
<div class="form-group">
|
||||
<label asp-for="RefundedAmount"></label>
|
||||
<div class="input-group mb-3">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">$</span>
|
||||
</div>
|
||||
<input type="number" min="0.01" max="1000000.00" step="0.01" class="form-control"
|
||||
asp-for="RefundedAmount" placeholder="ex. 10.00">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-check mb-3">
|
||||
<input type="checkbox" class="form-check-input" asp-for="Refunded">
|
||||
<label class="form-check-label" asp-for="Refunded"></label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Details"></label>
|
||||
<input type="text" class="form-control" asp-for="Details" required>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md">
|
||||
<div class="form-group">
|
||||
<div class="form-group">
|
||||
<label asp-for="Gateway"></label>
|
||||
<select class="form-control" asp-for="Gateway"
|
||||
asp-items="Html.GetEnumSelectList<Bit.Core.Enums.GatewayType>()">
|
||||
<option value="">--</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md">
|
||||
<div class="form-group">
|
||||
<label asp-for="GatewayId"></label>
|
||||
<input type="text" class="form-control" asp-for="GatewayId">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<div class="form-group">
|
||||
<label asp-for="PaymentMethod"></label>
|
||||
<select class="form-control" asp-for="PaymentMethod"
|
||||
asp-items="Html.GetEnumSelectList<Bit.Core.Enums.PaymentMethodType>()">
|
||||
<option value="">--</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary mb-2">@action Transaction</button>
|
||||
</form>
|
@ -59,7 +59,8 @@
|
||||
<h2>User Information</h2>
|
||||
@await Html.PartialAsync("_ViewInformation", Model)
|
||||
<h2>Billing Information</h2>
|
||||
@await Html.PartialAsync("_BillingInformation", Model.BillingInfo)
|
||||
@await Html.PartialAsync("_BillingInformation",
|
||||
new BillingInformationModel { BillingInfo = Model.BillingInfo, UserId = Model.User.Id })
|
||||
<form method="post" id="edit-form">
|
||||
<h2>General</h2>
|
||||
<div class="row">
|
||||
|
Reference in New Issue
Block a user