Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 17 |
|
0.00% |
0 / 4 |
CRAP | |
0.00% |
0 / 1 |
Price | |
0.00% |
0 / 17 |
|
0.00% |
0 / 4 |
20 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 12 |
|
0.00% |
0 / 1 |
2 | |||
getId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
toArray | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
jsonSerialize | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | /** |
3 | * Jingga |
4 | * |
5 | * PHP Version 8.1 |
6 | * |
7 | * @package Modules\Billing\Models\Price |
8 | * @copyright Dennis Eichhorn |
9 | * @license OMS License 2.0 |
10 | * @version 1.0.0 |
11 | * @link https://jingga.app |
12 | */ |
13 | declare(strict_types=1); |
14 | |
15 | namespace Modules\Billing\Models\Price; |
16 | |
17 | use Modules\Attribute\Models\AttributeValue; |
18 | use Modules\Attribute\Models\NullAttributeValue; |
19 | use Modules\ClientManagement\Models\Client; |
20 | use Modules\ClientManagement\Models\NullClient; |
21 | use Modules\ItemManagement\Models\Item; |
22 | use Modules\ItemManagement\Models\NullItem; |
23 | use Modules\SupplierManagement\Models\NullSupplier; |
24 | use Modules\SupplierManagement\Models\Supplier; |
25 | use phpOMS\Localization\ISO4217CharEnum; |
26 | use phpOMS\Stdlib\Base\FloatInt; |
27 | |
28 | /** |
29 | * Bill class. |
30 | * |
31 | * @package Modules\Billing\Models\Price |
32 | * @license OMS License 2.0 |
33 | * @link https://jingga.app |
34 | * @since 1.0.0 |
35 | */ |
36 | class Price implements \JsonSerializable |
37 | { |
38 | /** |
39 | * ID. |
40 | * |
41 | * @var int |
42 | * @since 1.0.0 |
43 | */ |
44 | public int $id = 0; |
45 | |
46 | public string $name = ''; |
47 | |
48 | public string $promocode = ''; |
49 | |
50 | public Item $item; |
51 | |
52 | public AttributeValue $itemgroup; |
53 | |
54 | public AttributeValue $itemsegment; |
55 | |
56 | public AttributeValue $itemsection; |
57 | |
58 | public AttributeValue $itemtype; |
59 | |
60 | public Client $client; |
61 | |
62 | public AttributeValue $clientgroup; |
63 | |
64 | public AttributeValue $clientsegment; |
65 | |
66 | public AttributeValue $clientsection; |
67 | |
68 | public AttributeValue $clienttype; |
69 | |
70 | public ?string $clientcountry = null; |
71 | |
72 | public Supplier $supplier; |
73 | |
74 | public int $unit = 0; |
75 | |
76 | public int $type = PriceType::SALES; |
77 | |
78 | public int $quantity = 0; |
79 | |
80 | public FloatInt $price; |
81 | |
82 | public int $priceNew = 0; |
83 | |
84 | public int $discount = 0; |
85 | |
86 | public int $discountPercentage = 0; |
87 | |
88 | public int $bonus = 0; |
89 | |
90 | public bool $multiply = false; |
91 | |
92 | public string $currency = ISO4217CharEnum::_EUR; |
93 | |
94 | public ?\DateTime $start = null; |
95 | |
96 | public ?\DateTime $end = null; |
97 | |
98 | /** |
99 | * Constructor. |
100 | * |
101 | * @since 1.0.0 |
102 | */ |
103 | public function __construct() |
104 | { |
105 | $this->item = new NullItem(); |
106 | $this->itemgroup = new NullAttributeValue(); |
107 | $this->itemsegment = new NullAttributeValue(); |
108 | $this->itemsection = new NullAttributeValue(); |
109 | $this->itemtype = new NullAttributeValue(); |
110 | |
111 | $this->client = new NullClient(); |
112 | $this->clientgroup = new NullAttributeValue(); |
113 | $this->clientsegment = new NullAttributeValue(); |
114 | $this->clientsection = new NullAttributeValue(); |
115 | $this->clienttype = new NullAttributeValue(); |
116 | |
117 | $this->supplier = new NullSupplier(); |
118 | |
119 | $this->price = new FloatInt(); |
120 | } |
121 | |
122 | /** |
123 | * Get id. |
124 | * |
125 | * @return int Model id |
126 | * |
127 | * @since 1.0.0 |
128 | */ |
129 | public function getId() : int |
130 | { |
131 | return $this->id; |
132 | } |
133 | |
134 | /** |
135 | * {@inheritdoc} |
136 | */ |
137 | public function toArray() : array |
138 | { |
139 | return [ |
140 | 'id' => $this->id, |
141 | ]; |
142 | } |
143 | |
144 | /** |
145 | * {@inheritdoc} |
146 | */ |
147 | public function jsonSerialize() : mixed |
148 | { |
149 | return $this->toArray(); |
150 | } |
151 | } |