Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
TaxCombination
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 3
12
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 toArray
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
 jsonSerialize
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2/**
3 * Jingga
4 *
5 * PHP Version 8.1
6 *
7 * @package   Modules\Billing\Models\Tax
8 * @copyright Dennis Eichhorn
9 * @license   OMS License 2.0
10 * @version   1.0.0
11 * @link      https://jingga.app
12 */
13declare(strict_types=1);
14
15namespace Modules\Billing\Models\Tax;
16
17use Modules\Attribute\Models\AttributeValue;
18use Modules\Attribute\Models\NullAttributeValue;
19
20/**
21 * Billing class.
22 *
23 * @package Modules\Billing\Models\Tax
24 * @license OMS License 2.0
25 * @link    https://jingga.app
26 * @since   1.0.0
27 */
28class TaxCombination implements \JsonSerializable
29{
30    /**
31     * Article ID.
32     *
33     * @var int
34     * @since 1.0.0
35     */
36    public int $id = 0;
37
38    public ?AttributeValue $clientCode = null;
39
40    public ?AttributeValue $supplierCode = null;
41
42    public AttributeValue $itemCode;
43
44    public string $taxCode = '';
45
46    // @todo: consider to add the tax code object directly, it is annoying to make a manuall mapper call which is often required afterwards.
47
48    public int $taxType = BillTaxType::SALES;
49
50    public string $account = '';
51
52    public string $refundAccount = '';
53
54    public string $discountAccount = '';
55
56    public ?int $minPrice = null;
57
58    public ?int $maxPrice = null;
59
60    public ?\DateTime $start = null;
61
62    public ?\DateTime $end = null;
63
64    /**
65     * Constructor
66     *
67     * @since 1.0.0
68     */
69    public function __construct()
70    {
71        $this->itemCode = new NullAttributeValue();
72    }
73
74    /**
75     * {@inheritdoc}
76     */
77    public function toArray() : array
78    {
79        return [
80            'id'    => $this->id,
81        ];
82    }
83
84    /**
85     * {@inheritdoc}
86     */
87    public function jsonSerialize() : mixed
88    {
89        return $this->toArray();
90    }
91}