Add kickback fees

This commit is contained in:
2022-01-25 20:37:21 +01:00
parent 7518e6edec
commit 515badbf85
8 changed files with 201 additions and 155 deletions

View File

@@ -33,6 +33,7 @@ const load_transactions = async () => {
total_subscription_charge: 0,
total_storage_charge: 0,
total_bandwidth_charge: 0,
total_kickback_fee: 0,
total_deposited: 0,
total_deducted: 0,
}
@@ -47,6 +48,7 @@ const load_transactions = async () => {
month.total_subscription_charge += row.subscription_charge
month.total_storage_charge += row.storage_charge
month.total_bandwidth_charge += row.bandwidth_charge
month.total_kickback_fee += row.kickback_fee
month.total_deducted += row.subscription_charge + row.storage_charge + row.bandwidth_charge
})
months.push(month)
@@ -227,6 +229,7 @@ onMount(() => {
<li>Storage charge: <Euro amount={month.total_storage_charge}></Euro></li>
<li>Bandwidth charge: <Euro amount={month.total_bandwidth_charge}></Euro></li>
<li>Total charge: <Euro amount={month.total_deducted}></Euro></li>
<li>Earned: <Euro amount={month.total_kickback_fee}></Euro></li>
<li>Deposited: <Euro amount={month.total_deposited}></Euro></li>
</ul>
@@ -239,16 +242,19 @@ onMount(() => {
<td>Subscription</td>
<td colspan="2">Storage</td>
<td colspan="2">Bandwidth</td>
<td>Deposited</td>
<td colspan="2">Kickback</td>
<td>Deposit</td>
</tr>
<tr>
<td></td>
<td></td>
<td>Charged</td>
<td>Charged</td>
<td>Used</td>
<td>Charged</td>
<td>Used</td>
<td>Charge</td>
<td>Charge</td>
<td>Usage</td>
<td>Charge</td>
<td>Usage</td>
<td>Fee</td>
<td>Amount</td>
<td></td>
</tr>
</thead>
@@ -262,6 +268,8 @@ onMount(() => {
<td>{formatDataVolume(row.storage_used, 3)}</td>
<td><Euro amount={row.bandwidth_charge} precision="4"></Euro></td>
<td>{formatDataVolume(row.bandwidth_used, 3)}</td>
<td><Euro amount={row.kickback_fee} precision="4"></Euro></td>
<td>{formatDataVolume(row.kickback_amount, 3)}</td>
<td><Euro amount={row.deposit_amount}></Euro></td>
</tr>
{/each}