Calculation errors for refunded amounts
This commit is contained in:
1 parent
5beb2b1d97
commit
c1c1a4f143
28 files changed
+1436
-26
No files matched your search
@@ -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