You've already forked openaccounting-web
mirror of
https://github.com/openaccounting/oa-web.git
synced 2025-12-09 09:01:24 +13:00
Compare commits
29 Commits
bug/api-ne
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
28045c3a12 | ||
|
|
ef36779afc | ||
|
|
1dc3a849ba | ||
|
|
dce3701171 | ||
|
|
9a3a2e06c1 | ||
|
|
ead6777089 | ||
|
|
8133927c4b | ||
|
|
8559b96c02 | ||
|
|
f61f59c801 | ||
|
|
8a1d62dd44 | ||
|
|
486feef2c4 | ||
|
|
2340c2f208 | ||
|
|
e4e63e1b5f | ||
|
|
ca125f2e13 | ||
|
|
3e104bfa6c | ||
|
|
9d2e7f3131 | ||
|
|
cf46c3f0fd | ||
|
|
5875dfcb65 | ||
|
|
7245741c8b | ||
|
|
1aeed8ef97 | ||
|
|
0a370adf6c | ||
|
|
37634fe970 | ||
|
|
851a43e6fc | ||
|
|
d3f8e6c3ab | ||
|
|
ab62ff7d17 | ||
|
|
096147855e | ||
|
|
cd5ddf5e63 | ||
|
|
ce1afb221d | ||
|
|
f31572737b |
4670
package-lock.json
generated
4670
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -29,7 +29,7 @@
|
|||||||
"@angular/router": "^6.1.0",
|
"@angular/router": "^6.1.0",
|
||||||
"@ng-bootstrap/ng-bootstrap": "^3.3.1",
|
"@ng-bootstrap/ng-bootstrap": "^3.3.1",
|
||||||
"@types/moment-timezone": "^0.5.12",
|
"@types/moment-timezone": "^0.5.12",
|
||||||
"bootstrap": "^4.1.3",
|
"bootstrap": "^4.3.1",
|
||||||
"core-js": "^2.5.4",
|
"core-js": "^2.5.4",
|
||||||
"moment-timezone": "^0.5.25",
|
"moment-timezone": "^0.5.25",
|
||||||
"rxjs": "~6.2.0",
|
"rxjs": "~6.2.0",
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
"zone.js": "~0.8.26"
|
"zone.js": "~0.8.26"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular-devkit/build-angular": "~0.8.0",
|
"@angular-devkit/build-angular": "^0.13.10",
|
||||||
"@angular/cli": "~6.2.5",
|
"@angular/cli": "~6.2.5",
|
||||||
"@angular/compiler-cli": "^6.1.0",
|
"@angular/compiler-cli": "^6.1.0",
|
||||||
"@angular/language-service": "^6.1.0",
|
"@angular/language-service": "^6.1.0",
|
||||||
|
|||||||
@@ -71,7 +71,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
<p>Copyright © 2019 Open Accounting, LLC<br>
|
<p>Copyright © 2020 Open Accounting, LLC<br>
|
||||||
<a href="/tou">Terms of Use</a> | <a href="/privacy-policy">Privacy Policy</a></p>
|
<a href="/tou">Terms of Use</a> | <a href="/privacy-policy">Privacy Policy</a></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import 'rxjs/add/operator/filter';
|
|||||||
import 'rxjs/add/operator/debounceTime';
|
import 'rxjs/add/operator/debounceTime';
|
||||||
import 'rxjs/add/operator/take';
|
import 'rxjs/add/operator/take';
|
||||||
import { Util } from '../shared/util';
|
import { Util } from '../shared/util';
|
||||||
|
import { businessAccounts } from '../fixtures/businessAccounts';
|
||||||
import { personalAccounts } from '../fixtures/personalAccounts';
|
import { personalAccounts } from '../fixtures/personalAccounts';
|
||||||
import { ErrorObservable } from 'rxjs/observable/ErrorObservable';
|
import { ErrorObservable } from 'rxjs/observable/ErrorObservable';
|
||||||
|
|
||||||
@@ -62,7 +63,7 @@ export class AccountService {
|
|||||||
|
|
||||||
if(options.createDefaultAccounts) {
|
if(options.createDefaultAccounts) {
|
||||||
this.getAccountTree().take(1).switchMap(tree => {
|
this.getAccountTree().take(1).switchMap(tree => {
|
||||||
return this.createDefaultAccounts(tree);
|
return this.createDefaultAccounts(tree, options.createDefaultAccounts);
|
||||||
}).subscribe(accounts => {
|
}).subscribe(accounts => {
|
||||||
log.debug('Created default accounts');
|
log.debug('Created default accounts');
|
||||||
log.debug(accounts);
|
log.debug(accounts);
|
||||||
@@ -590,7 +591,7 @@ export class AccountService {
|
|||||||
return this.apiService.deleteAccount(id);
|
return this.apiService.deleteAccount(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
createDefaultAccounts(tree: AccountTree): Observable<any> {
|
createDefaultAccounts(tree: AccountTree, type: string): Observable<any> {
|
||||||
let assetAccount = tree.getAccountByName('Assets', 1);
|
let assetAccount = tree.getAccountByName('Assets', 1);
|
||||||
let equityAccount = tree.getAccountByName('Equity', 1);
|
let equityAccount = tree.getAccountByName('Equity', 1);
|
||||||
let liabilityAccount = tree.getAccountByName('Liabilities', 1);
|
let liabilityAccount = tree.getAccountByName('Liabilities', 1);
|
||||||
@@ -608,10 +609,10 @@ export class AccountService {
|
|||||||
'Expenses': [expenseAccount.id, true]
|
'Expenses': [expenseAccount.id, true]
|
||||||
};
|
};
|
||||||
|
|
||||||
let newAccounts;
|
let newAccounts = type === 'business' ? businessAccounts : personalAccounts;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
newAccounts = personalAccounts.map(data => {
|
newAccounts = newAccounts.map(data => {
|
||||||
let id = Util.newGuid();
|
let id = Util.newGuid();
|
||||||
let [parentId, debitBalance] = accountNameMap[data.parent];
|
let [parentId, debitBalance] = accountNameMap[data.parent];
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export class OrgService {
|
|||||||
return this.apiService.getOrgs();
|
return this.apiService.getOrgs();
|
||||||
}
|
}
|
||||||
|
|
||||||
newOrg(org: Org, createDefaultAccounts: boolean): Observable<Org> {
|
newOrg(org: Org, createDefaultAccounts: string): Observable<Org> {
|
||||||
let sessionOptions = new SessionOptions({
|
let sessionOptions = new SessionOptions({
|
||||||
createDefaultAccounts: createDefaultAccounts
|
createDefaultAccounts: createDefaultAccounts
|
||||||
});
|
});
|
||||||
|
|||||||
123
src/app/fixtures/businessAccounts.ts
Normal file
123
src/app/fixtures/businessAccounts.ts
Normal file
@@ -0,0 +1,123 @@
|
|||||||
|
export const businessAccounts: any =
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "Checking",
|
||||||
|
"parent": "Assets"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Petty Cash",
|
||||||
|
"parent": "Assets"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Accounting",
|
||||||
|
"parent": "Expenses"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Accounts Receivable",
|
||||||
|
"parent": "Assets"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Capital",
|
||||||
|
"parent": "Equity"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Drawing",
|
||||||
|
"parent": "Equity"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Accounts Payable",
|
||||||
|
"parent": "Liabilities"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Credit Card",
|
||||||
|
"parent": "Liabilities"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Auto",
|
||||||
|
"parent": "Expenses"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Bank Fees",
|
||||||
|
"parent": "Expenses"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Computer Equipment",
|
||||||
|
"parent": "Expenses"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Cost of Goods Sold",
|
||||||
|
"parent": "Expenses"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Dining / Entertainment",
|
||||||
|
"parent": "Expenses"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Internet",
|
||||||
|
"parent": "Expenses"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Legal",
|
||||||
|
"parent": "Expenses"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Licenses / Fees",
|
||||||
|
"parent": "Expenses"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Marketing",
|
||||||
|
"parent": "Expenses"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Miscellaneous",
|
||||||
|
"parent": "Expenses"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Office Furniture",
|
||||||
|
"parent": "Expenses"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Office Rent",
|
||||||
|
"parent": "Expenses"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Office Supplies",
|
||||||
|
"parent": "Expenses"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Payment Processing",
|
||||||
|
"parent": "Expenses"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Payroll",
|
||||||
|
"parent": "Expenses"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Phone",
|
||||||
|
"parent": "Expenses"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Shipping",
|
||||||
|
"parent": "Expenses"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Software",
|
||||||
|
"parent": "Expenses"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Tax Preparation",
|
||||||
|
"parent": "Expenses"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Travel",
|
||||||
|
"parent": "Expenses"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Web Domains / Hosting",
|
||||||
|
"parent": "Expenses"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Sales",
|
||||||
|
"parent": "Income"
|
||||||
|
}
|
||||||
|
];
|
||||||
@@ -41,9 +41,20 @@
|
|||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
<p>Create default accounts (can be customized later)</p>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="createDefaultAccounts">Create default accounts<br>(can be customized later)</label>
|
<div class="form-check">
|
||||||
<input formControlName="createDefaultAccounts" id="createDefaultAccounts" type="checkbox" class="form-control" />
|
<input formControlName="createDefaultAccounts" id="createDefaultAccounts1" type="radio" class="form-check-input" value="" />
|
||||||
|
<label for="createDefaultAccounts1" class="form-check-label">None</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<input formControlName="createDefaultAccounts" id="createDefaultAccounts2" type="radio" class="form-check-input" value="business" />
|
||||||
|
<label for="createDefaultAccounts2" class="form-check-label">Business accounts</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<input formControlName="createDefaultAccounts" id="createDefaultAccounts3" type="radio" class="form-check-input" value="personal" />
|
||||||
|
<label for="createDefaultAccounts2" class="form-check-label">Personal accounts</label>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p *ngIf="error" class="error">
|
<p *ngIf="error" class="error">
|
||||||
{{error.message}}
|
{{error.message}}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ export class NewOrgPage {
|
|||||||
'currency': ['USD', Validators.required],
|
'currency': ['USD', Validators.required],
|
||||||
'precision': [2, Validators.required],
|
'precision': [2, Validators.required],
|
||||||
'timezone': [this.defaultTz, Validators.required],
|
'timezone': [this.defaultTz, Validators.required],
|
||||||
'createDefaultAccounts': [true, Validators.required]
|
'createDefaultAccounts': ['business']
|
||||||
});
|
});
|
||||||
|
|
||||||
this.joinOrgForm = fb.group({
|
this.joinOrgForm = fb.group({
|
||||||
|
|||||||
@@ -148,10 +148,19 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<p>Create default accounts (can be customized later)</p>
|
||||||
<label for="createDefaultAccounts" class="col-sm-3 col-form-label">Create default accounts<br>(can be customized later)</label>
|
<div class="form-group">
|
||||||
<div class="col-sm-9">
|
<div class="form-check">
|
||||||
<input formControlName="createDefaultAccounts" id="createDefaultAccounts" type="checkbox" class="form-control" />
|
<input formControlName="createDefaultAccounts" id="createDefaultAccounts1" type="radio" class="form-check-input" value="" />
|
||||||
|
<label for="createDefaultAccounts1" class="form-check-label">None</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<input formControlName="createDefaultAccounts" id="createDefaultAccounts2" type="radio" class="form-check-input" value="business" />
|
||||||
|
<label for="createDefaultAccounts2" class="form-check-label">Business accounts</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<input formControlName="createDefaultAccounts" id="createDefaultAccounts3" type="radio" class="form-check-input" value="personal" />
|
||||||
|
<label for="createDefaultAccounts2" class="form-check-label">Personal accounts</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p *ngIf="newOrgError" class="error">{{newOrgError.message}}</p>
|
<p *ngIf="newOrgError" class="error">{{newOrgError.message}}</p>
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ export class OrgPage {
|
|||||||
'currency': ['', Validators.required],
|
'currency': ['', Validators.required],
|
||||||
'precision': [null, Validators.required],
|
'precision': [null, Validators.required],
|
||||||
'timezone': [this.defaultTz, Validators.required],
|
'timezone': [this.defaultTz, Validators.required],
|
||||||
'createDefaultAccounts': [true, Validators.required]
|
'createDefaultAccounts': ['']
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,7 +95,7 @@ export class OrgPage {
|
|||||||
currency: this.currentOrg.currency,
|
currency: this.currentOrg.currency,
|
||||||
precision: this.currentOrg.precision,
|
precision: this.currentOrg.precision,
|
||||||
timezone: this.defaultTz,
|
timezone: this.defaultTz,
|
||||||
createDefaultAccounts: true
|
createDefaultAccounts: ''
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
40
src/app/shared/debit-credit.pipe.ts
Normal file
40
src/app/shared/debit-credit.pipe.ts
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
import { Pipe, PipeTransform } from '@angular/core';
|
||||||
|
import { Account } from './account';
|
||||||
|
|
||||||
|
@Pipe({name: 'debitCredit'})
|
||||||
|
export class DebitCreditPipe implements PipeTransform {
|
||||||
|
debitNames: any;
|
||||||
|
creditNames: any;
|
||||||
|
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
this.debitNames = {
|
||||||
|
'Assets': 'Deposit',
|
||||||
|
'Liabilities': 'Payment',
|
||||||
|
'Equity': 'Decrease',
|
||||||
|
'Income': 'Deduction',
|
||||||
|
'Expenses': 'Expense'
|
||||||
|
};
|
||||||
|
|
||||||
|
this.creditNames = {
|
||||||
|
'Assets': 'Withdrawal',
|
||||||
|
'Liabilities': 'Charge',
|
||||||
|
'Equity': 'Increase',
|
||||||
|
'Income': 'Income',
|
||||||
|
'Expenses': 'Refund'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
transform(account: Account, type: string): string {
|
||||||
|
if(!account) {
|
||||||
|
return type === 'credit' ? 'Credit' : 'Debit';
|
||||||
|
}
|
||||||
|
|
||||||
|
let parent = account.fullName.split(':')[0];
|
||||||
|
if(type === 'credit') {
|
||||||
|
return this.creditNames[parent];
|
||||||
|
} else {
|
||||||
|
return this.debitNames[parent];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
export class SessionOptions {
|
export class SessionOptions {
|
||||||
createDefaultAccounts: boolean;
|
createDefaultAccounts: string;
|
||||||
constructor(options: any = {}) {
|
constructor(options: any = {}) {
|
||||||
this.createDefaultAccounts = options.createDefaultAccounts;
|
this.createDefaultAccounts = options.createDefaultAccounts;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,11 +4,12 @@ import { CurrencyFormatPipe } from './currency-format.pipe';
|
|||||||
import { AccountNamePipe } from './account-name.pipe';
|
import { AccountNamePipe } from './account-name.pipe';
|
||||||
import { AccountBalancePipe } from './account-balance.pipe';
|
import { AccountBalancePipe } from './account-balance.pipe';
|
||||||
import { DateTzPipe } from './datetz.pipe';
|
import { DateTzPipe } from './datetz.pipe';
|
||||||
|
import { DebitCreditPipe } from './debit-credit.pipe';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [],
|
imports: [],
|
||||||
declarations: [CurrencyFormatPipe, AccountNamePipe, AccountBalancePipe, DateTzPipe],
|
declarations: [CurrencyFormatPipe, AccountNamePipe, AccountBalancePipe, DateTzPipe, DebitCreditPipe],
|
||||||
exports: [CurrencyFormatPipe, AccountNamePipe, AccountBalancePipe, DateTzPipe],
|
exports: [CurrencyFormatPipe, AccountNamePipe, AccountBalancePipe, DateTzPipe, DebitCreditPipe],
|
||||||
providers: [DecimalPipe, CurrencyFormatPipe]
|
providers: [DecimalPipe, CurrencyFormatPipe]
|
||||||
})
|
})
|
||||||
export class SharedModule { }
|
export class SharedModule { }
|
||||||
@@ -11,8 +11,8 @@ export class Transaction {
|
|||||||
splits: Split[];
|
splits: Split[];
|
||||||
constructor(options: any = {}) {
|
constructor(options: any = {}) {
|
||||||
this.id = options.id;
|
this.id = options.id;
|
||||||
this.orgId = options.id;
|
this.orgId = options.orgId;
|
||||||
this.userId = options.id;
|
this.userId = options.userId;
|
||||||
this.date = options.date ? new Date(options.date) : null;
|
this.date = options.date ? new Date(options.date) : null;
|
||||||
this.inserted = options.inserted ? new Date(options.inserted) : null;
|
this.inserted = options.inserted ? new Date(options.inserted) : null;
|
||||||
this.updated = options.updated ? new Date(options.updated) : null;
|
this.updated = options.updated ? new Date(options.updated) : null;
|
||||||
|
|||||||
@@ -19,10 +19,10 @@
|
|||||||
<span>Transfer</span>
|
<span>Transfer</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="col custom-3">
|
<div class="col custom-3">
|
||||||
<span>Debit</span>
|
<span>{{account | debitCredit:'debit'}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="col custom-3">
|
<div class="col custom-3">
|
||||||
<span>Credit</span>
|
<span>{{account | debitCredit:'credit'}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="col custom-3">
|
<div class="col custom-3">
|
||||||
<span>Balance</span>
|
<span>Balance</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user