Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
17 / 17 |
|
100.00% |
9 / 9 |
CRAP | |
100.00% |
1 / 1 |
| AuftragspositionXml | |
100.00% |
17 / 17 |
|
100.00% |
9 / 9 |
9 | |
100.00% |
1 / 1 |
| setValue | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getData | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setMenge | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| setArt | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| setArtikelnummer | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| setBezeichnung | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| setText | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| setSteuerProzent | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| setEinzelpreis | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php declare(strict_types=1); |
| 2 | |
| 3 | namespace Satag\AmicronEntityBundle\Struct\Xml\Import; |
| 4 | |
| 5 | use Satag\AmicronEntityBundle\Entity\Auftragsposition; |
| 6 | use Satag\AmicronEntityBundle\Traits\DecimalEntity; |
| 7 | |
| 8 | class AuftragspositionXml |
| 9 | { |
| 10 | use DecimalEntity; |
| 11 | |
| 12 | /** |
| 13 | * @var array<string, int|string> |
| 14 | */ |
| 15 | private array $data = [ |
| 16 | 'ART' => Auftragsposition::ART_POSITION, |
| 17 | ]; |
| 18 | |
| 19 | public function setValue(string $key, mixed $value): self |
| 20 | { |
| 21 | $this->data[$key] = $value; |
| 22 | |
| 23 | return $this; |
| 24 | } |
| 25 | |
| 26 | /** |
| 27 | * @return array{Fields: array<string, int|string>} |
| 28 | */ |
| 29 | public function getData(): array |
| 30 | { |
| 31 | return ['Fields' => $this->data]; |
| 32 | } |
| 33 | |
| 34 | public function setMenge(float $menge): self |
| 35 | { |
| 36 | $this->data['MENGE'] = $this->toComma($menge); |
| 37 | |
| 38 | return $this; |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * @param Auftragsposition::ART_* $art |
| 43 | */ |
| 44 | public function setArt(string $art): self |
| 45 | { |
| 46 | $this->data['ART'] = $art; |
| 47 | |
| 48 | return $this; |
| 49 | } |
| 50 | |
| 51 | public function setArtikelnummer(string $string): self |
| 52 | { |
| 53 | $this->data['ARTIKELNR'] = $string; |
| 54 | |
| 55 | return $this; |
| 56 | } |
| 57 | |
| 58 | public function setBezeichnung(string $string): self |
| 59 | { |
| 60 | $this->data['BEZEICHNUNG'] = $string; |
| 61 | |
| 62 | return $this; |
| 63 | } |
| 64 | |
| 65 | public function setText(string $string): self |
| 66 | { |
| 67 | $this->data['TEXT'] = $string; |
| 68 | |
| 69 | return $this; |
| 70 | } |
| 71 | |
| 72 | public function setSteuerProzent(float $prozent): self |
| 73 | { |
| 74 | $this->data['STEUER'] = $this->toComma($prozent); |
| 75 | |
| 76 | return $this; |
| 77 | } |
| 78 | |
| 79 | public function setEinzelpreis(float $preis): self |
| 80 | { |
| 81 | $this->data['EPREIS'] = $this->toComma($preis); |
| 82 | |
| 83 | return $this; |
| 84 | } |
| 85 | } |