Steuerberater Modul tax
This commit is contained in:
parent
0f82fea88a
commit
245c281541
22 changed files with 1489 additions and 139 deletions
|
|
@ -458,6 +458,64 @@ class DatevExportServiceTest extends TestCase
|
|||
$this->assertEquals(15.50, $result);
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function it_parses_homeparty_ek_tax_split_format_with_preferred_key()
|
||||
{
|
||||
$method = new \ReflectionMethod(DatevExportService::class, 'parseNumber');
|
||||
$method->setAccessible(true);
|
||||
|
||||
$result = $method->invoke($this->service, ['vk_tax' => '15.50', 'ek_tax' => '7.50'], 'ek_tax');
|
||||
|
||||
$this->assertEquals(7.50, $result);
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function it_parses_homeparty_ek_net_split_format_with_preferred_key()
|
||||
{
|
||||
$method = new \ReflectionMethod(DatevExportService::class, 'parseNumber');
|
||||
$method->setAccessible(true);
|
||||
|
||||
$result = $method->invoke($this->service, ['vk_net' => '123.45', 'ek_net' => '67.89'], 'ek_net');
|
||||
|
||||
$this->assertEquals(67.89, $result);
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function it_resolves_net_split_from_collective_order_when_order_has_none()
|
||||
{
|
||||
$method = new \ReflectionMethod(DatevExportService::class, 'resolveNetSplit');
|
||||
$method->setAccessible(true);
|
||||
|
||||
$collectOrder = new \stdClass;
|
||||
$collectOrder->net_split = ['19' => '533.61'];
|
||||
|
||||
$order = new \stdClass;
|
||||
$order->net_split = null;
|
||||
$order->shopping_collect_order = $collectOrder;
|
||||
|
||||
$result = $method->invoke($this->service, $order);
|
||||
|
||||
$this->assertEquals(['19' => '533.61'], $result);
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function it_prefers_order_net_split_over_collective_order_net_split()
|
||||
{
|
||||
$method = new \ReflectionMethod(DatevExportService::class, 'resolveNetSplit');
|
||||
$method->setAccessible(true);
|
||||
|
||||
$collectOrder = new \stdClass;
|
||||
$collectOrder->net_split = ['19' => '533.61'];
|
||||
|
||||
$order = new \stdClass;
|
||||
$order->net_split = ['19' => '677.51'];
|
||||
$order->shopping_collect_order = $collectOrder;
|
||||
|
||||
$result = $method->invoke($this->service, $order);
|
||||
|
||||
$this->assertEquals(['19' => '677.51'], $result);
|
||||
}
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Model Tests
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue