fix default respone generation

This commit is contained in:
Dennis Eichhorn 2023-07-26 09:18:04 +00:00
parent f5aaac3bc5
commit d3ef610883
3 changed files with 955 additions and 42 deletions

File diff suppressed because it is too large Load Diff

View File

@ -85,6 +85,20 @@ class Expense
$this->taxP = new FloatInt();
}
public function recalculate() : void
{
$net = 0;
$gross = 0;
foreach ($this->elements as $element) {
$net += $element->net->value;
$gross += $element->gross->value;
}
$this->net->value = $net;
$this->gross->value = $gross;
}
use \Modules\Media\Models\MediaListTrait;
use \Modules\Editor\Models\EditorDocListTrait;
}

View File

@ -28,7 +28,7 @@ use phpOMS\Localization\BaseStringL11n;
* @link https://jingga.app
* @since 1.0.0
*
* @template T of BaseStringL11n
* @template T of ExpenseElement
* @extends DataMapperFactory<T>
*/
final class ExpenseElementMapper extends DataMapperFactory
@ -130,5 +130,5 @@ final class ExpenseElementMapper extends DataMapperFactory
* @var class-string<T>
* @since 1.0.0
*/
public const MODEL = BaseStringL11n::class;
public const MODEL = ExpenseElement::class;
}