mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Fixed: [doc generation] fix summary budget
This commit is contained in:
parent
5830c3e177
commit
d8af7d455e
@ -150,7 +150,7 @@ final class SummaryBudget implements SummaryBudgetInterface
|
||||
switch ($kind) {
|
||||
case 'charge':
|
||||
foreach ($rows as $row) {
|
||||
$chargeKind = $this->chargeKindRepository->findOneByKind($row['kind_id']);
|
||||
$chargeKind = $this->chargeKindRepository->find($row['kind_id']);
|
||||
|
||||
if (null === $chargeKind) {
|
||||
throw new RuntimeException('charge kind not found: ' . $row['kind_id']);
|
||||
@ -166,7 +166,7 @@ final class SummaryBudget implements SummaryBudgetInterface
|
||||
|
||||
case 'resource':
|
||||
foreach ($rows as $row) {
|
||||
$resourceKind = $this->resourceKindRepository->findOneByKind($row['kind_id']);
|
||||
$resourceKind = $this->resourceKindRepository->find($row['kind_id']);
|
||||
|
||||
if (null === $resourceKind) {
|
||||
throw new RuntimeException('charge kind not found: ' . $row['kind_id']);
|
||||
|
@ -43,7 +43,7 @@ final class SummaryBudgetTest extends TestCase
|
||||
[
|
||||
'sum' => 250.0,
|
||||
'comment' => '',
|
||||
'kind_id' => 'rental',
|
||||
'kind_id' => 1, // kind: rental
|
||||
],
|
||||
]);
|
||||
$queryCharges->setParameters(Argument::type('array'))
|
||||
@ -57,7 +57,7 @@ final class SummaryBudgetTest extends TestCase
|
||||
[
|
||||
'sum' => 1500.0,
|
||||
'comment' => '',
|
||||
'kind_id' => 'salary',
|
||||
'kind_id' => 2, // kind: 'salary',
|
||||
],
|
||||
]);
|
||||
$queryResources->setParameters(Argument::type('array'))
|
||||
@ -84,6 +84,7 @@ final class SummaryBudgetTest extends TestCase
|
||||
$rental = (new ChargeKind())->setKind('rental')->setName(['fr' => 'Rental']),
|
||||
$other = (new ChargeKind())->setKind('other')->setName(['fr' => 'Other']),
|
||||
]);
|
||||
$chargeRepository->find(1)->willReturn($rental);
|
||||
$chargeRepository->findOneByKind('rental')->willReturn($rental);
|
||||
$chargeRepository->findOneByKind('other')->willReturn($other);
|
||||
|
||||
@ -92,6 +93,7 @@ final class SummaryBudgetTest extends TestCase
|
||||
$salary = (new ResourceKind())->setKind('salary')->setName(['fr' => 'Salary']),
|
||||
$misc = (new ResourceKind())->setKind('misc')->setName(['fr' => 'Misc']),
|
||||
]);
|
||||
$resourceRepository->find(2)->willReturn($salary);
|
||||
$resourceRepository->findOneByKind('salary')->willReturn($salary);
|
||||
$resourceRepository->findOneByKind('misc')->willReturn($misc);
|
||||
|
||||
@ -108,8 +110,9 @@ final class SummaryBudgetTest extends TestCase
|
||||
|
||||
$household = new Household();
|
||||
$householdReflection = new \ReflectionClass($household);
|
||||
$householdReflection->getProperty('id')->setAccessible(true);
|
||||
$householdReflection->getProperty('id')->setValue($household, 1);
|
||||
$householdId = $householdReflection->getProperty('id');
|
||||
$householdId->setAccessible(true);
|
||||
$householdId->setValue($household, 1);
|
||||
$householdMember = (new HouseholdMember())->setPerson($person)
|
||||
->setStartDate(new \DateTimeImmutable('1 month ago'))
|
||||
;
|
||||
|
Loading…
x
Reference in New Issue
Block a user