Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot]
feba4cbe0e Bump json5 and @angular-devkit/build-angular
Bumps [json5](https://github.com/json5/json5) to 2.2.3 and updates ancestor dependency [@angular-devkit/build-angular](https://github.com/angular/angular-cli). These dependencies need to be updated together.


Updates `json5` from 1.0.1 to 2.2.3
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v1.0.1...v2.2.3)

Updates `@angular-devkit/build-angular` from 0.13.10 to 15.0.4
- [Release notes](https://github.com/angular/angular-cli/releases)
- [Changelog](https://github.com/angular/angular-cli/blob/main/CHANGELOG.md)
- [Commits](https://github.com/angular/angular-cli/commits/15.0.4)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
- dependency-name: "@angular-devkit/build-angular"
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-01 03:59:45 +00:00
9 changed files with 5443 additions and 4025 deletions

9374
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -37,7 +37,7 @@
"zone.js": "~0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.13.10",
"@angular-devkit/build-angular": "^15.0.4",
"@angular/cli": "~6.2.5",
"@angular/compiler-cli": "^6.1.0",
"@angular/language-service": "^6.1.0",

View File

@@ -20,7 +20,7 @@
<h5>Current spending</h5>
</div>
<div class="col-4 amount">
<h5>{{expenseAmount | currencyFormat:org.precision:org.currency}}</h5>
<h5>{{expenseAmount | currencyFormat:org.precision}}</h5>
</div>
</div>
<div class="row" *ngFor="let expense of expenseAccounts" [routerLink]="'/accounts/'+expense.id+'/transactions'" [ngClass]="{hidden: hiddenExpenses[expense.id]}">
@@ -28,7 +28,7 @@
{{expense.fullName | accountName:2}}
</div>
<div class="col-4 amount">
{{expense.nativeBalanceCost | currencyFormat:org.precision:org.currency}}
{{expense.nativeBalanceCost | currencyFormat:org.precision}}
</div>
</div>
<div class="row">
@@ -59,11 +59,10 @@
{{recentTx.tx.date | datetz:"M/D":org.timezone}}
</div>
<div class="col-5 col-md-6 description">
<div class="primary">{{recentTx.tx.description}}</div>
<div class="additional">{{recentTx.account.fullName}}</div>
{{recentTx.tx.description}}
</div>
<div class="col-4 col-md-4 amount" [ngClass]="{'negative': recentTx.split.amount > 0}">
{{-recentTx.split.amount | currencyFormat:recentTx.account.precision:recentTx.account.currency}}
{{-recentTx.split.amount | currencyFormat:recentTx.account.precision}}
</div>
</div>
<div class="row">

View File

@@ -41,19 +41,6 @@
.expanded .hidden {
display: flex
}
.row {
padding-bottom: 1em;
.description {
.primary:empty::after {
content: ".";
visibility: hidden;
}
.additional {
font-size: small;
color: $black;
}
}
}
}
@media (max-width: 767px) {

View File

@@ -53,7 +53,7 @@
</div>
<div class="form-check">
<input formControlName="createDefaultAccounts" id="createDefaultAccounts3" type="radio" class="form-check-input" value="personal" />
<label for="createDefaultAccounts3" class="form-check-label">Personal accounts</label>
<label for="createDefaultAccounts2" class="form-check-label">Personal accounts</label>
</div>
</div>
<p *ngIf="error" class="error">
@@ -61,4 +61,4 @@
</p>
<button type="submit" class="btn btn-primary" [disabled]="!form.valid">Submit</button>
</form>
</div>
</div>

View File

@@ -160,7 +160,7 @@
</div>
<div class="form-check">
<input formControlName="createDefaultAccounts" id="createDefaultAccounts3" type="radio" class="form-check-input" value="personal" />
<label for="createDefaultAccounts3" class="form-check-label">Personal accounts</label>
<label for="createDefaultAccounts2" class="form-check-label">Personal accounts</label>
</div>
</div>
<p *ngIf="newOrgError" class="error">{{newOrgError.message}}</p>

View File

@@ -29,8 +29,8 @@
<h4>Assets</h4>
</div>
<div class="col-4 amount">
<h4 *ngIf="priceSource === 'price'">{{+assetAccount.totalNativeBalancePrice | currencyFormat:org.precision:org.currency}}</h4>
<h4 *ngIf="priceSource === 'cost'">{{+assetAccount.totalNativeBalanceCost | currencyFormat:org.precision:org.currency}}</h4>
<h4 *ngIf="priceSource === 'price'">{{+assetAccount.totalNativeBalancePrice | currencyFormat:org.precision}}</h4>
<h4 *ngIf="priceSource === 'cost'">{{+assetAccount.totalNativeBalanceCost | currencyFormat:org.precision}}</h4>
</div>
</div>
<div class="row" *ngFor="let account of assetAccounts" [attr.depth]="account.depth">
@@ -39,10 +39,10 @@
<span *ngIf="!account.children.length"><a [routerLink]="'/accounts/' + account.id + '/transactions'">{{account.name | slice:0:30}}</a></span>
</div>
<div class="col-4 amount" *ngIf="priceSource === 'price' && account.totalNativeBalancePrice">
{{+account.totalNativeBalancePrice | currencyFormat:org.precision:org.currency}}
{{+account.totalNativeBalancePrice | currencyFormat:org.precision}}
</div>
<div class="col-4 amount" *ngIf="priceSource === 'cost' && account.totalNativeBalanceCost">
{{+account.totalNativeBalanceCost | currencyFormat:org.precision:org.currency}}
{{+account.totalNativeBalanceCost | currencyFormat:org.precision}}
</div>
</div>
<div class="row">
@@ -55,8 +55,8 @@
<h4>Liabilities</h4>
</div>
<div class="col-4 amount">
<h4 *ngIf="priceSource === 'price'">{{-liabilityAccount.totalNativeBalancePrice | currencyFormat:org.precision:org.currency}}</h4>
<h4 *ngIf="priceSource === 'cost'">{{-liabilityAccount.totalNativeBalanceCost | currencyFormat:org.precision:org.currency}}</h4>
<h4 *ngIf="priceSource === 'price'">{{-liabilityAccount.totalNativeBalancePrice | currencyFormat:org.precision}}</h4>
<h4 *ngIf="priceSource === 'cost'">{{-liabilityAccount.totalNativeBalanceCost | currencyFormat:org.precision}}</h4>
</div>
</div>
<div class="row" *ngFor="let account of liabilityAccounts" [attr.depth]="account.depth">
@@ -65,10 +65,10 @@
<span *ngIf="!account.children.length"><a [routerLink]="'/accounts/' + account.id + '/transactions'">{{account.name | slice:0:30}}</a></span>
</div>
<div class="col-4 amount" *ngIf="priceSource === 'price' && account.totalNativeBalancePrice">
{{-account.totalNativeBalancePrice | currencyFormat:org.precision:org.currency}}
{{-account.totalNativeBalancePrice | currencyFormat:org.precision}}
</div>
<div class="col-4 amount" *ngIf="priceSource === 'cost' && account.totalNativeBalanceCost">
{{-account.totalNativeBalanceCost | currencyFormat:org.precision:org.currency}}
{{-account.totalNativeBalanceCost | currencyFormat:org.precision}}
</div>
</div>
<div class="row" depth="1">
@@ -76,8 +76,8 @@
<h4>Equity</h4>
</div>
<div class="col-4 amount">
<h4 *ngIf="priceSource === 'price'">{{-equityAccount.totalNativeBalancePrice | currencyFormat:org.precision:org.currency}}</h4>
<h4 *ngIf="priceSource === 'cost'">{{-equityAccount.totalNativeBalanceCost | currencyFormat:org.precision:org.currency}}</h4>
<h4 *ngIf="priceSource === 'price'">{{-equityAccount.totalNativeBalancePrice | currencyFormat:org.precision}}</h4>
<h4 *ngIf="priceSource === 'cost'">{{-equityAccount.totalNativeBalanceCost | currencyFormat:org.precision}}</h4>
</div>
</div>
<div class="row" *ngFor="let account of equityAccounts" [attr.depth]="account.depth">
@@ -86,10 +86,10 @@
<span *ngIf="!account.children.length"><a [routerLink]="'/accounts/' + account.id + '/transactions'">{{account.name | slice:0:30}}</a></span>
</div>
<div class="col-4 amount" *ngIf="priceSource === 'price' && account.totalNativeBalancePrice">
{{-account.totalNativeBalancePrice | currencyFormat:org.precision:org.currency}}
{{-account.totalNativeBalancePrice | currencyFormat:org.precision}}
</div>
<div class="col-4 amount" *ngIf="priceSource === 'cost' && account.totalNativeBalanceCost">
{{-account.totalNativeBalanceCost | currencyFormat:org.precision:org.currency}}
{{-account.totalNativeBalanceCost | currencyFormat:org.precision}}
</div>
</div>
</div>

View File

@@ -24,7 +24,7 @@
<h4>Income</h4>
</div>
<div class="col-4 amount">
<h4>{{-incomeAccount.totalNativeBalanceCost | currencyFormat:org.precision:org.currency}}</h4>
<h4>{{-incomeAccount.totalNativeBalanceCost | currencyFormat:org.precision}}</h4>
</div>
</div>
<div class="row" *ngFor="let account of incomeAccounts" [attr.depth]="account.depth">
@@ -33,7 +33,7 @@
<span *ngIf="!account.children.length"><a [routerLink]="'/accounts/' + account.id + '/transactions'">{{account.name | slice:0:30}}</a></span>
</div>
<div class="col-4 amount" *ngIf="account.totalNativeBalanceCost">
{{-account.totalNativeBalanceCost | currencyFormat:org.precision:org.currency}}
{{-account.totalNativeBalanceCost | currencyFormat:org.precision}}
</div>
</div>
<div class="row" depth="1">
@@ -41,7 +41,7 @@
<h4>Expenses</h4>
</div>
<div class="col-4 amount">
<h4>{{expenseAccount.totalNativeBalanceCost | currencyFormat:org.precision:org.currency}}</h4>
<h4>{{expenseAccount.totalNativeBalanceCost | currencyFormat:org.precision}}</h4>
</div>
</div>
<div class="row" *ngFor="let account of expenseAccounts" [attr.depth]="account.depth">
@@ -50,7 +50,7 @@
<span *ngIf="!account.children.length"><a [routerLink]="'/accounts/' + account.id + '/transactions'">{{account.name | slice:0:30}}</a></span>
</div>
<div class="col-4 amount" *ngIf="account.totalNativeBalanceCost">
{{account.totalNativeBalanceCost | currencyFormat:org.precision:org.currency}}
{{account.totalNativeBalanceCost | currencyFormat:org.precision}}
</div>
</div>
<div class="row" depth="1">
@@ -58,7 +58,7 @@
<h4>Net Income</h4>
</div>
<div class="col-4 amount">
<h4>{{-incomeAccount.totalNativeBalanceCost - expenseAccount.totalNativeBalanceCost | currencyFormat:org.precision:org.currency}}</h4>
<h4>{{-incomeAccount.totalNativeBalanceCost - expenseAccount.totalNativeBalanceCost | currencyFormat:org.precision}}</h4>
</div>
</div>
</div>

View File

@@ -1,16 +1,7 @@
import { Pipe, PipeTransform } from '@angular/core';
import { DecimalPipe } from '@angular/common';
// Format the currency according to the user's browser locale.
//
// Some currencies share the same symbol (e.g. $ is used for USD and CAN).
// Ideally, the user experience should not be confusing if different accounts
// have conflicting symbols. One solution might be to always show the ISO
// currency code for accounts with mixes currencies. Another solution would be
// to let the user configure how the currency is displayed on a per-currency
// or per-account basis.
@Pipe({ name: 'currencyFormat' })
@Pipe({name: 'currencyFormat'})
export class CurrencyFormatPipe implements PipeTransform {
constructor(private decimalPipe: DecimalPipe) {
}
@@ -20,12 +11,17 @@ export class CurrencyFormatPipe implements PipeTransform {
return '';
}
// note: we can drop the cast to any if we change the ts target from es5 to es2020 or newer.
return Intl.NumberFormat(navigator.language, {
style: "currency",
currency,
minimumFractionDigits: precision,
signDisplay: "negative",
} as any).format(amount / Math.pow(10, precision));
let prefix = amount < 0 ? '-' : '';
if(currency === 'USD') {
prefix += '$';
}
let minDigits = Math.min(2, precision);
return prefix +
this.decimalPipe.transform(
Math.abs(amount) / Math.pow(10, precision),
'1.' + minDigits + '-' + precision);
}
}