Calculation errors for refunded amounts
This commit is contained in:
@@ -32,7 +32,10 @@ class CostUnitResource {
|
||||
$amounts = [];
|
||||
$overAllAmount = new Amount(0, 'Euro');
|
||||
$overAllEstimatedAmount = new Amount(0, 'Euro');
|
||||
foreach (InvoiceType::orderBy('sort_order')->get() as $invoiceType) {
|
||||
// Nur echte Aufwandsarten: Eine Beitragserstattung ist die Rücknahme einer Einnahme und wird auf
|
||||
// der Einnahmenseite bereits berücksichtigt -- hier gezählt, stünde sie ein zweites Mal in der
|
||||
// Bilanz. `totalAmount` weiter oben bleibt davon unberührt, das ist die Kassensicht.
|
||||
foreach (InvoiceType::countingAsExpense() as $invoiceType) {
|
||||
$overAllAmount->addAmount($costUnitRepository->sumupByInvoiceType($this->costUnit, $invoiceType));
|
||||
$overAllEstimatedAmount->addAmount($costUnitRepository->sumupEstimatedByInvoiceType($this->costUnit, $invoiceType));
|
||||
$amounts[$invoiceType->slug]['string'] = $costUnitRepository->sumupByInvoiceType($this->costUnit, $invoiceType)->toString();
|
||||
|
||||
Reference in New Issue
Block a user