|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Fousky\Component\iDoklad\Model\CashVoucher; |
|
4
|
|
|
|
|
5
|
|
|
use Fousky\Component\iDoklad\LOV\ExportedStateEnum; |
|
6
|
|
|
use Fousky\Component\iDoklad\LOV\MovementTypeEnum; |
|
7
|
|
|
use Fousky\Component\iDoklad\Model\iDokladAbstractModel; |
|
8
|
|
|
use Fousky\Component\iDoklad\Model\RegisteredSale\ElectronicRecordsOfSalesApiModel; |
|
9
|
|
|
use Symfony\Component\Validator\Constraints as Assert; |
|
10
|
|
|
|
|
11
|
|
|
/** |
|
12
|
|
|
* @method null|int getCashRegisterId() |
|
13
|
|
|
* @method null|\DateTime getDateOfTransaction() |
|
14
|
|
|
* @method null|int getDocumentSerialNumber() |
|
15
|
|
|
* @method null|ElectronicRecordsOfSalesApiModel getElectronicRecordsOfSales() |
|
16
|
|
|
* @method null|float getExchangeRate() |
|
17
|
|
|
* @method null|float getExchangeRateAmount() |
|
18
|
|
|
* @method null|ExportedStateEnum getExported() |
|
19
|
|
|
* @method null|CashVoucherItemApiModelInsert getItem() |
|
20
|
|
|
* @method null|MovementTypeEnum getMovementType() |
|
21
|
|
|
* @method null|int getMyCompanyDocumentAddressId() |
|
22
|
|
|
* @method null|int getPartnerContactId() |
|
23
|
|
|
* @method null|int getPartnerDocumentAddressId() |
|
24
|
|
|
* @method null|string getPerson() |
|
25
|
|
|
* |
|
26
|
|
|
* @author Lukáš Brzák <[email protected]> |
|
27
|
|
|
*/ |
|
28
|
|
|
class CashVoucherApiModelInsert extends iDokladAbstractModel |
|
29
|
|
|
{ |
|
30
|
|
|
/** |
|
31
|
|
|
* @Assert\NotBlank() |
|
32
|
|
|
* @Assert\GreaterThan(value="0") |
|
33
|
|
|
*/ |
|
34
|
|
|
public $CashRegisterId; |
|
35
|
|
|
|
|
36
|
|
|
/** |
|
37
|
|
|
* @Assert\NotBlank() |
|
38
|
|
|
*/ |
|
39
|
|
|
public $DateOfTransaction; |
|
40
|
|
|
|
|
41
|
|
|
public $DocumentSerialNumber; |
|
42
|
|
|
|
|
43
|
|
|
public $ElectronicRecordsOfSales; |
|
44
|
|
|
|
|
45
|
|
|
public $ExchangeRate; |
|
46
|
|
|
|
|
47
|
|
|
public $ExchangeRateAmount; |
|
48
|
|
|
|
|
49
|
|
|
public $Exported; |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* @var CashVoucherItemApiModelInsert |
|
53
|
|
|
* |
|
54
|
|
|
* @Assert\NotBlank() |
|
55
|
|
|
* @Assert\Valid() |
|
56
|
|
|
*/ |
|
57
|
|
|
public $Item; |
|
58
|
|
|
|
|
59
|
|
|
public $MovementType; |
|
60
|
|
|
|
|
61
|
|
|
public $MyCompanyDocumentAddressId; |
|
62
|
|
|
|
|
63
|
|
|
public $PartnerContactId; |
|
64
|
|
|
|
|
65
|
|
|
public $PartnerDocumentAddressId; |
|
66
|
|
|
|
|
67
|
|
|
public $Person; |
|
68
|
|
|
|
|
69
|
|
|
/** |
|
70
|
|
|
* @param CashVoucherItemApiModelInsert $Item |
|
71
|
|
|
* @param array $properties |
|
72
|
|
|
* |
|
73
|
|
|
* @throws \InvalidArgumentException |
|
74
|
|
|
*/ |
|
75
|
|
|
public function __construct(CashVoucherItemApiModelInsert $Item, array $properties = []) |
|
76
|
|
|
{ |
|
77
|
|
|
$this->Item = $Item; |
|
78
|
|
|
|
|
79
|
|
|
$this->processProperties($properties); |
|
80
|
|
|
} |
|
81
|
|
|
|
|
82
|
|
|
/** |
|
83
|
|
|
* @return array |
|
84
|
|
|
*/ |
|
85
|
|
|
public static function getDateMap(): array |
|
86
|
|
|
{ |
|
87
|
|
|
return [ |
|
88
|
|
|
'DateOfTransaction', |
|
89
|
|
|
]; |
|
90
|
|
|
} |
|
91
|
|
|
|
|
92
|
|
|
/** |
|
93
|
|
|
* @return array |
|
94
|
|
|
*/ |
|
95
|
|
|
public static function getModelMap(): array |
|
96
|
|
|
{ |
|
97
|
|
|
return [ |
|
98
|
|
|
'ElectronicRecordsOfSales' => ElectronicRecordsOfSalesApiModel::class, |
|
99
|
|
|
'Item' => CashVoucherItemApiModelInsert::class, |
|
100
|
|
|
]; |
|
101
|
|
|
} |
|
102
|
|
|
|
|
103
|
|
|
/** |
|
104
|
|
|
* @return array |
|
105
|
|
|
*/ |
|
106
|
|
|
public static function getEnumMap(): array |
|
107
|
|
|
{ |
|
108
|
|
|
return [ |
|
109
|
|
|
'Exported' => ExportedStateEnum::class, |
|
110
|
|
|
'MovementType' => MovementTypeEnum::class, |
|
111
|
|
|
]; |
|
112
|
|
|
} |
|
113
|
|
|
} |
|
114
|
|
|
|