Frontend #190
@ -53,7 +53,7 @@ export class DashboardComponent implements OnInit {
|
|||||||
var data = JSON.parse(response);
|
var data = JSON.parse(response);
|
||||||
this.depotCost = 0;
|
this.depotCost = 0;
|
||||||
for (let i = 0; i < data.data.length; i++) {
|
for (let i = 0; i < data.data.length; i++) {
|
||||||
this.depotCost += data.data[i].price;
|
this.depotCost += data.data[i].price * data.data[i].count;
|
||||||
TRANSACTION_DATA.push({
|
TRANSACTION_DATA.push({
|
||||||
comment: data.data[i].comment,
|
comment: data.data[i].comment,
|
||||||
isin: data.data[i].isin,
|
isin: data.data[i].isin,
|
||||||
@ -98,7 +98,7 @@ export class DashboardComponent implements OnInit {
|
|||||||
var data = JSON.parse(response);
|
var data = JSON.parse(response);
|
||||||
this.depotCost = 0;
|
this.depotCost = 0;
|
||||||
for (let i = 0; i < data.data.length; i++) {
|
for (let i = 0; i < data.data.length; i++) {
|
||||||
this.depotCost += data.data[i].price;
|
this.depotCost += data.data[i].price * data.data[i].count;
|
||||||
TRANSACTION_DATA.push({
|
TRANSACTION_DATA.push({
|
||||||
comment: data.data[i].comment,
|
comment: data.data[i].comment,
|
||||||
isin: data.data[i].isin,
|
isin: data.data[i].isin,
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="count">Count</label>
|
<label for="count">Count (negative for sale/positiv for buy)</label>
|
||||||
<input
|
<input
|
||||||
type="number"
|
type="number"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
@ -61,7 +61,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="price">Price in €</label>
|
<label for="price">Price in € per share</label>
|
||||||
<input
|
<input
|
||||||
class="form-control"
|
class="form-control"
|
||||||
name="price"
|
name="price"
|
||||||
|
@ -26,10 +26,10 @@ export class UserDialogComponent {
|
|||||||
priceValid = true;
|
priceValid = true;
|
||||||
|
|
||||||
onSubmit() {
|
onSubmit() {
|
||||||
console.log(!isNaN(this.data.count));
|
|
||||||
if (!isNaN(this.data.count) && !isNaN(this.data.price)) {
|
if (!isNaN(this.data.count) && !isNaN(this.data.price)) {
|
||||||
this.priceValid = true;
|
this.priceValid = true;
|
||||||
this.countValid = true;
|
this.countValid = true;
|
||||||
|
console.log(this.data.price);
|
||||||
console.log(
|
console.log(
|
||||||
this.dataService
|
this.dataService
|
||||||
.createTransaction(
|
.createTransaction(
|
||||||
@ -37,7 +37,7 @@ export class UserDialogComponent {
|
|||||||
this.data.isin,
|
this.data.isin,
|
||||||
this.data.time,
|
this.data.time,
|
||||||
+this.data.count,
|
+this.data.count,
|
||||||
+this.data.price.toFixed(2)
|
+this.data.price.toFixed(2) * -1
|
||||||
)
|
)
|
||||||
.subscribe((data) => {
|
.subscribe((data) => {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
|
Loading…
Reference in New Issue
Block a user