Fix sum on PnL report

This commit is contained in:
Hillel Coren 2017-11-30 20:18:00 +02:00
parent 3ec92c8025
commit 92a7fc10d2
2 changed files with 3 additions and 3 deletions

View File

@ -59,7 +59,7 @@ class ProfitAndLossReport extends AbstractReport
$this->data[] = [
trans('texts.expense'),
$client ? ($this->isExport ? $client->getDisplayName() : $client->present()->link) : '',
$expense->present()->amount,
'-' . $expense->present()->amount,
$expense->present()->expense_date,
$expense->present()->category,
];

View File

@ -474,7 +474,7 @@
if (str.indexOf(':') >= 0) {
return roundToTwo(moment.duration(str).asHours());
} else {
var number = Number(str.replace(/[^0-9]+/g, ''));
var number = Number(str.replace(/[^0-9\-]+/g, ''));
return number / 100;
}
}
@ -528,7 +528,7 @@
var txt = $(this).find("td").eq(i).text();
subtotal += convertStringToNumber(txt);
});
$cell.find(".group-count").append(' - ' + label + ': ' + roundToTwo(subtotal));
$cell.find(".group-count").append(' - ' + label + ': ' + roundToTwo(subtotal, true));
}
},
}