Displaying estimates
This commit is contained in:
@@ -178,6 +178,18 @@ class CostUnitRepository {
|
||||
return $amount;
|
||||
}
|
||||
|
||||
public function sumupEstimatedByInvoiceType(CostUnit $costUnit, InvoiceType $invoiceType) : Amount {
|
||||
$amount = new Amount(0, 'Euro');
|
||||
foreach ($costUnit->estimates()->get() as $estimate) {
|
||||
if ($estimate->type !== $invoiceType->slug) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$amount->addAmount($estimate->calculateAmount());
|
||||
}
|
||||
return $amount;
|
||||
}
|
||||
|
||||
public function sumupUnhandledAmounts(CostUnit $costUnit, bool $donatedAmount = false) : Amount {
|
||||
$amount = new Amount(0, '');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user