money_s3 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (177) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -50
  3. data/lib/money_s3/hash_with_attributes.rb +40 -0
  4. data/lib/money_s3/parsers/adresa_type.rb +2 -3
  5. data/lib/money_s3/parsers/alternativa_prislusenstvi_type.rb +4 -5
  6. data/lib/money_s3/parsers/bank_dokl.rb +9 -10
  7. data/lib/money_s3/parsers/bank_spojeni_type.rb +2 -3
  8. data/lib/money_s3/parsers/bank_ucet_pokladna_type.rb +2 -3
  9. data/lib/money_s3/parsers/base_parser.rb +1 -3
  10. data/lib/money_s3/parsers/castky.rb +2 -3
  11. data/lib/money_s3/parsers/cena_type.rb +2 -3
  12. data/lib/money_s3/parsers/cenova_hladina.rb +3 -4
  13. data/lib/money_s3/parsers/cenova_hladina_type.rb +3 -4
  14. data/lib/money_s3/parsers/child_kusovnik_type.rb +3 -4
  15. data/lib/money_s3/parsers/cinnost.rb +2 -3
  16. data/lib/money_s3/parsers/clen_dph.rb +2 -3
  17. data/lib/money_s3/parsers/dalsi_sazba.rb +2 -3
  18. data/lib/money_s3/parsers/data.rb +4 -5
  19. data/lib/money_s3/parsers/def_sub_pol_type.rb +3 -4
  20. data/lib/money_s3/parsers/dl_prij.rb +13 -14
  21. data/lib/money_s3/parsers/dl_vyd.rb +13 -14
  22. data/lib/money_s3/parsers/dodavka_type.rb +2 -3
  23. data/lib/money_s3/parsers/dokl_ref_type.rb +3 -4
  24. data/lib/money_s3/parsers/doklad.rb +2 -3
  25. data/lib/money_s3/parsers/doklad_firma_type.rb +10 -11
  26. data/lib/money_s3/parsers/doklad_hraz.rb +3 -4
  27. data/lib/money_s3/parsers/e_shop_info.rb +2 -3
  28. data/lib/money_s3/parsers/eet_type.rb +4 -5
  29. data/lib/money_s3/parsers/ekategorie_type.rb +4 -5
  30. data/lib/money_s3/parsers/ekategorie_zasoba_type.rb +3 -4
  31. data/lib/money_s3/parsers/error_info_type.rb +2 -3
  32. data/lib/money_s3/parsers/eshop.rb +2 -3
  33. data/lib/money_s3/parsers/eshop_zasoba_type.rb +3 -4
  34. data/lib/money_s3/parsers/fakt_prij.rb +21 -22
  35. data/lib/money_s3/parsers/fakt_vyd.rb +21 -22
  36. data/lib/money_s3/parsers/faktura_type.rb +21 -22
  37. data/lib/money_s3/parsers/firma.rb +14 -15
  38. data/lib/money_s3/parsers/firma_type.rb +14 -15
  39. data/lib/money_s3/parsers/header_kusovnik_type.rb +3 -4
  40. data/lib/money_s3/parsers/import.rb +9 -10
  41. data/lib/money_s3/parsers/int_dokl.rb +9 -10
  42. data/lib/money_s3/parsers/inv_dokl_type.rb +3 -4
  43. data/lib/money_s3/parsers/km_karta.rb +6 -7
  44. data/lib/money_s3/parsers/km_karta_type.rb +6 -7
  45. data/lib/money_s3/parsers/komponenta_kusovnik_type.rb +4 -5
  46. data/lib/money_s3/parsers/komponenta_type.rb +5 -6
  47. data/lib/money_s3/parsers/konec_prij_firma_type.rb +7 -8
  48. data/lib/money_s3/parsers/kurz_listek.rb +3 -4
  49. data/lib/money_s3/parsers/kurz_rozd.rb +3 -4
  50. data/lib/money_s3/parsers/kurz_type.rb +2 -3
  51. data/lib/money_s3/parsers/kusovnik_type.rb +5 -6
  52. data/lib/money_s3/parsers/mena_type.rb +2 -3
  53. data/lib/money_s3/parsers/message_type.rb +4 -5
  54. data/lib/money_s3/parsers/moje_firma_type.rb +8 -9
  55. data/lib/money_s3/parsers/money_data.rb +50 -51
  56. data/lib/money_s3/parsers/msg_fakt_poloz_type.rb +3 -4
  57. data/lib/money_s3/parsers/msg_firma_type.rb +4 -5
  58. data/lib/money_s3/parsers/msg_poloz_type.rb +4 -5
  59. data/lib/money_s3/parsers/mz_priplatek.rb +3 -4
  60. data/lib/money_s3/parsers/mzda_type.rb +5 -6
  61. data/lib/money_s3/parsers/mzdove_obdobi_type.rb +3 -4
  62. data/lib/money_s3/parsers/nab_prij.rb +16 -17
  63. data/lib/money_s3/parsers/nab_vyd.rb +16 -17
  64. data/lib/money_s3/parsers/nep_platba_type.rb +3 -4
  65. data/lib/money_s3/parsers/nep_platidlo_type.rb +2 -3
  66. data/lib/money_s3/parsers/nepritomnost_type.rb +2 -3
  67. data/lib/money_s3/parsers/neskl_polozka.rb +3 -4
  68. data/lib/money_s3/parsers/norm_poloz_id_type.rb +2 -3
  69. data/lib/money_s3/parsers/norm_poloz_ud_type.rb +2 -3
  70. data/lib/money_s3/parsers/obdobi_dph.rb +2 -3
  71. data/lib/money_s3/parsers/obj_prij.rb +16 -17
  72. data/lib/money_s3/parsers/obj_vyd.rb +16 -17
  73. data/lib/money_s3/parsers/osoba_type.rb +6 -7
  74. data/lib/money_s3/parsers/parametr_karta_type.rb +3 -4
  75. data/lib/money_s3/parsers/parametr_type.rb +2 -3
  76. data/lib/money_s3/parsers/pc.rb +9 -10
  77. data/lib/money_s3/parsers/pohledavka_type.rb +10 -11
  78. data/lib/money_s3/parsers/pok_dokl.rb +10 -11
  79. data/lib/money_s3/parsers/pol_faktury_type.rb +6 -7
  80. data/lib/money_s3/parsers/pol_inv_dokl_type.rb +6 -7
  81. data/lib/money_s3/parsers/pol_objedn_type.rb +8 -9
  82. data/lib/money_s3/parsers/pol_skl_dokl_type.rb +7 -8
  83. data/lib/money_s3/parsers/popt_prij.rb +16 -17
  84. data/lib/money_s3/parsers/popt_vyd.rb +16 -17
  85. data/lib/money_s3/parsers/prac_pomer.rb +2 -3
  86. data/lib/money_s3/parsers/predkontace.rb +2 -3
  87. data/lib/money_s3/parsers/predkontace_de_type.rb +2 -3
  88. data/lib/money_s3/parsers/prepr_dopln_udaj_type.rb +2 -3
  89. data/lib/money_s3/parsers/prepravce_type.rb +2 -3
  90. data/lib/money_s3/parsers/prevodka.rb +13 -14
  91. data/lib/money_s3/parsers/prijemka.rb +13 -14
  92. data/lib/money_s3/parsers/prodejka.rb +13 -14
  93. data/lib/money_s3/parsers/reference.rb +4 -5
  94. data/lib/money_s3/parsers/reference_type.rb +2 -3
  95. data/lib/money_s3/parsers/rozuct_poloz_id_type.rb +2 -3
  96. data/lib/money_s3/parsers/rozuct_poloz_ud_type.rb +3 -4
  97. data/lib/money_s3/parsers/seznam_bank_dokl.rb +3 -4
  98. data/lib/money_s3/parsers/seznam_cen_hladin.rb +3 -4
  99. data/lib/money_s3/parsers/seznam_cinnosti.rb +3 -4
  100. data/lib/money_s3/parsers/seznam_clen_dph.rb +3 -4
  101. data/lib/money_s3/parsers/seznam_dl_prij.rb +3 -4
  102. data/lib/money_s3/parsers/seznam_dl_vyd.rb +3 -4
  103. data/lib/money_s3/parsers/seznam_fakt_prij.rb +3 -4
  104. data/lib/money_s3/parsers/seznam_fakt_vyd.rb +3 -4
  105. data/lib/money_s3/parsers/seznam_firem.rb +3 -4
  106. data/lib/money_s3/parsers/seznam_int_dokl.rb +3 -4
  107. data/lib/money_s3/parsers/seznam_inv_dokl.rb +3 -4
  108. data/lib/money_s3/parsers/seznam_km_karta.rb +3 -4
  109. data/lib/money_s3/parsers/seznam_kurz_listku.rb +3 -4
  110. data/lib/money_s3/parsers/seznam_mezd.rb +3 -4
  111. data/lib/money_s3/parsers/seznam_nab_prij.rb +3 -4
  112. data/lib/money_s3/parsers/seznam_nab_vyd.rb +3 -4
  113. data/lib/money_s3/parsers/seznam_obj_prij.rb +3 -4
  114. data/lib/money_s3/parsers/seznam_obj_vyd.rb +3 -4
  115. data/lib/money_s3/parsers/seznam_pok_dokl.rb +3 -4
  116. data/lib/money_s3/parsers/seznam_popt_prij.rb +3 -4
  117. data/lib/money_s3/parsers/seznam_popt_vyd.rb +3 -4
  118. data/lib/money_s3/parsers/seznam_predkontaci.rb +3 -4
  119. data/lib/money_s3/parsers/seznam_predkontaci_de.rb +3 -4
  120. data/lib/money_s3/parsers/seznam_prevodka.rb +3 -4
  121. data/lib/money_s3/parsers/seznam_prijemka.rb +3 -4
  122. data/lib/money_s3/parsers/seznam_prodejka.rb +3 -4
  123. data/lib/money_s3/parsers/seznam_skladu.rb +3 -4
  124. data/lib/money_s3/parsers/seznam_stredisek.rb +3 -4
  125. data/lib/money_s3/parsers/seznam_typ_kusovnik.rb +3 -4
  126. data/lib/money_s3/parsers/seznam_uc_osnov.rb +3 -4
  127. data/lib/money_s3/parsers/seznam_vazeb.rb +3 -4
  128. data/lib/money_s3/parsers/seznam_vydejka.rb +3 -4
  129. data/lib/money_s3/parsers/seznam_vyrobka.rb +3 -4
  130. data/lib/money_s3/parsers/seznam_zak_kusovnik.rb +3 -4
  131. data/lib/money_s3/parsers/seznam_zakazka.rb +3 -4
  132. data/lib/money_s3/parsers/seznam_zamestnancu.rb +3 -4
  133. data/lib/money_s3/parsers/seznam_zasoba.rb +3 -4
  134. data/lib/money_s3/parsers/sk_doklad_firma_type.rb +9 -10
  135. data/lib/money_s3/parsers/sklad.rb +5 -6
  136. data/lib/money_s3/parsers/sklad_type.rb +5 -6
  137. data/lib/money_s3/parsers/skupina_firem_type.rb +2 -3
  138. data/lib/money_s3/parsers/skupina_kusovnik_type.rb +2 -3
  139. data/lib/money_s3/parsers/skupina_zasob_type.rb +7 -8
  140. data/lib/money_s3/parsers/souhrn_dph_pol_type.rb +3 -4
  141. data/lib/money_s3/parsers/souhrn_dph_type.rb +3 -4
  142. data/lib/money_s3/parsers/stav_zasoby_type.rb +2 -3
  143. data/lib/money_s3/parsers/stredisko.rb +2 -3
  144. data/lib/money_s3/parsers/sub_pol_obj_type.rb +3 -4
  145. data/lib/money_s3/parsers/subpol_inv_d_type.rb +3 -4
  146. data/lib/money_s3/parsers/telefon_type.rb +2 -3
  147. data/lib/money_s3/parsers/typ_priplatku_type.rb +2 -3
  148. data/lib/money_s3/parsers/typ_zasilky_type.rb +2 -3
  149. data/lib/money_s3/parsers/uc_osnova_type.rb +2 -3
  150. data/lib/money_s3/parsers/uc_pohyb_type.rb +2 -3
  151. data/lib/money_s3/parsers/ucet.rb +2 -3
  152. data/lib/money_s3/parsers/ucty_pohybu_type.rb +2 -3
  153. data/lib/money_s3/parsers/uhrada_pduhrada.rb +2 -3
  154. data/lib/money_s3/parsers/uhrada_type.rb +8 -9
  155. data/lib/money_s3/parsers/valuty.rb +4 -5
  156. data/lib/money_s3/parsers/valuty_hraz.rb +3 -4
  157. data/lib/money_s3/parsers/valuty_uhr.rb +3 -4
  158. data/lib/money_s3/parsers/vazba_type.rb +3 -4
  159. data/lib/money_s3/parsers/vlajka_type.rb +2 -3
  160. data/lib/money_s3/parsers/vlajky.rb +4 -5
  161. data/lib/money_s3/parsers/vydejka.rb +13 -14
  162. data/lib/money_s3/parsers/vyrobka.rb +13 -14
  163. data/lib/money_s3/parsers/vyrobni_cislo.rb +2 -3
  164. data/lib/money_s3/parsers/vyrobni_cislo_type.rb +2 -3
  165. data/lib/money_s3/parsers/vysledek_odesl.rb +2 -3
  166. data/lib/money_s3/parsers/vzor_komponenta_type.rb +5 -6
  167. data/lib/money_s3/parsers/zakazka.rb +5 -6
  168. data/lib/money_s3/parsers/zamestnanec_type.rb +3 -4
  169. data/lib/money_s3/parsers/zasoba.rb +14 -15
  170. data/lib/money_s3/parsers/zauctovani_dph_detype.rb +3 -4
  171. data/lib/money_s3/parsers/zauctovani_dph_type.rb +3 -4
  172. data/lib/money_s3/parsers/zavazek_type.rb +9 -10
  173. data/lib/money_s3/string_with_attributes.rb +28 -0
  174. data/lib/money_s3.rb +2 -1
  175. data/money_s3.gemspec +1 -1
  176. metadata +4 -3
  177. data/lib/money_s3/with_attributes.rb +0 -13
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 192257dd24cbd569edaa2343186ee7d82dd37c13
4
- data.tar.gz: 10ea5f27e6fdebe746e085366a952faf0a49b1e0
3
+ metadata.gz: ca2b59d440f8a43c7432c0001b67b5d5d844997b
4
+ data.tar.gz: 2009e7a6620744674e145c219179f76a8ac3e32d
5
5
  SHA512:
6
- metadata.gz: e59780f213265bc94f96716bcf471bf172f3f7a0067cb5a6ab5ca46dd2f9a302d580fd06e161fce645ef119dda916dc31101e7c15f71172704b3ea07b177858b
7
- data.tar.gz: eed69da9c5d1f407673c62ac57a080cdfcec7a915814afb10ff83a8313d8b632487cbe8299927b357cf57c59424f4575c94825414fac79ad1f1b07aeadb894b3
6
+ metadata.gz: 45beebb8cc5b5a3cdcf002140b90f0e6206d3f8341f6973949737d5c6f357f195615ca0aab0390b5ef9d4ceb75389406cc358d298d007d0afce98ddab5057855
7
+ data.tar.gz: 1709cd55aa484803f57ff1bfb50ba87339aa35899fbb24f3b2f10af540ded49d19de2df368e1dbf61cdb3b2dff6d0dae7ca1284b99bb07e977fe70dfed18e5b4
data/README.md CHANGED
@@ -1,55 +1,6 @@
1
1
  # MoneyS3
2
2
 
3
- Simple parser and builder for MoneyS3 XML data
4
-
5
- Content:
6
- 1. [About](#about)
7
- 1. [Naming](#naming)
8
- 2. [What's missing](#whats-missing)
9
- 2. [Api](#api)
10
- 1. [Parsers](#parsers)
11
- 2. [Builder](#builder)
12
- 3. [Performance](#performance)
13
- 4. [External links](#external-links)
14
- 5. [License](#license)
15
-
16
- ## About
17
-
18
- WIP
19
-
20
- ### Naming
21
-
22
- WIP
23
-
24
- #### Method names
25
-
26
- WIP
27
-
28
- #### Class names
29
-
30
- WIP
31
-
32
- ### Missing parts
33
-
34
- WIP
35
-
36
- ## Api
37
-
38
- ### Parsing a document
39
-
40
- WIP
41
-
42
- ### Creating a document
43
-
44
- WIP
45
-
46
- ## Performance
47
-
48
- WIP
49
-
50
- ## External links
51
-
52
- WIP
3
+ Unstable until 1.0.0
53
4
 
54
5
  ## License
55
6
 
@@ -0,0 +1,40 @@
1
+ module MoneyS3
2
+ class HashWithAttributes
3
+ def initialize(hash, attributes = nil)
4
+ @hash = hash
5
+ @attributes = attributes if attributes
6
+ end
7
+
8
+ def value
9
+ @hash
10
+ end
11
+
12
+ def attributes
13
+ @attributes ||= {}
14
+ end
15
+
16
+ def attributes=(attributes)
17
+ @attributes = attributes
18
+ end
19
+
20
+ def ==(other)
21
+ if other.respond_to? :attributes
22
+ value == other && other.attributes == attributes
23
+ else
24
+ value == other
25
+ end
26
+ end
27
+
28
+ def key?(key)
29
+ value.key? key
30
+ end
31
+
32
+ def [](key)
33
+ value[key]
34
+ end
35
+
36
+ def []=(key, key_value)
37
+ value[key] = key_value
38
+ end
39
+ end
40
+ end
@@ -25,9 +25,8 @@ module MoneyS3
25
25
  at 'KodStatu'
26
26
  end
27
27
 
28
- def to_h
29
- hash = WithAttributes.new({})
30
- hash.attributes = attributes
28
+ def to_h_with_attrs
29
+ hash = HashWithAttributes.new({}, attributes)
31
30
 
32
31
  hash[:ulice] = ulice if has? 'Ulice'
33
32
  hash[:misto] = misto if has? 'Misto'
@@ -35,17 +35,16 @@ module MoneyS3
35
35
  submodel_at(SkladType, 'Sklad')
36
36
  end
37
37
 
38
- def to_h
39
- hash = WithAttributes.new({})
40
- hash.attributes = attributes
38
+ def to_h_with_attrs
39
+ hash = HashWithAttributes.new({}, attributes)
41
40
 
42
41
  hash[:popis] = popis if has? 'Popis'
43
42
  hash[:poc_mj] = poc_mj if has? 'PocMJ'
44
43
  hash[:poradi] = poradi if has? 'Poradi'
45
44
  hash[:druh_komp] = druh_komp if has? 'DruhKomp'
46
45
  hash[:symetric] = symetric if has? 'Symetric'
47
- hash[:km_karta] = km_karta.to_h if has? 'KmKarta'
48
- hash[:sklad] = sklad.to_h if has? 'Sklad'
46
+ hash[:km_karta] = km_karta.to_h_with_attrs if has? 'KmKarta'
47
+ hash[:sklad] = sklad.to_h_with_attrs if has? 'Sklad'
49
48
 
50
49
  hash
51
50
  end
@@ -176,9 +176,8 @@ module MoneyS3
176
176
  array_of_at(String, ['Dokumenty', 'Dokument'])
177
177
  end
178
178
 
179
- def to_h
180
- hash = WithAttributes.new({})
181
- hash.attributes = attributes
179
+ def to_h_with_attrs
180
+ hash = HashWithAttributes.new({}, attributes)
182
181
 
183
182
  hash[:vydej] = vydej if has? 'Vydej'
184
183
  hash[:doklad] = doklad if has? 'Doklad'
@@ -213,13 +212,13 @@ module MoneyS3
213
212
  hash[:vyst] = vyst if has? 'Vyst'
214
213
  hash[:typ_dokl] = typ_dokl if has? 'TypDokl'
215
214
  hash[:celkem] = celkem if has? 'Celkem'
216
- hash[:adresa] = adresa.to_h if has? 'Adresa'
217
- hash[:valuty] = valuty.to_h if has? 'Valuty'
218
- hash[:ucet] = ucet.to_h if has? 'Ucet'
219
- hash[:vlajky] = vlajky.to_h if has? 'Vlajky'
220
- hash[:souhrn_dph] = souhrn_dph.to_h if has? 'SouhrnDPH'
221
- hash[:seznam_norm_polozek] = seznam_norm_polozek.map(&:to_h) if has? 'SeznamNormPolozek'
222
- hash[:seznam_rozuct_polozek] = seznam_rozuct_polozek.map(&:to_h) if has? 'SeznamRozuctPolozek'
215
+ hash[:adresa] = adresa.to_h_with_attrs if has? 'Adresa'
216
+ hash[:valuty] = valuty.to_h_with_attrs if has? 'Valuty'
217
+ hash[:ucet] = ucet.to_h_with_attrs if has? 'Ucet'
218
+ hash[:vlajky] = vlajky.to_h_with_attrs if has? 'Vlajky'
219
+ hash[:souhrn_dph] = souhrn_dph.to_h_with_attrs if has? 'SouhrnDPH'
220
+ hash[:seznam_norm_polozek] = seznam_norm_polozek.map(&:to_h_with_attrs) if has? 'SeznamNormPolozek'
221
+ hash[:seznam_rozuct_polozek] = seznam_rozuct_polozek.map(&:to_h_with_attrs) if has? 'SeznamRozuctPolozek'
223
222
  hash[:dokumenty] = dokumenty if has? 'Dokumenty'
224
223
 
225
224
  hash
@@ -21,9 +21,8 @@ module MoneyS3
21
21
  at 'Ucel'
22
22
  end
23
23
 
24
- def to_h
25
- hash = WithAttributes.new({})
26
- hash.attributes = attributes
24
+ def to_h_with_attrs
25
+ hash = HashWithAttributes.new({}, attributes)
27
26
 
28
27
  hash[:ucet] = ucet if has? 'Ucet'
29
28
  hash[:kod_banky] = kod_banky if has? 'KodBanky'
@@ -97,9 +97,8 @@ module MoneyS3
97
97
  at 'Pozn'
98
98
  end
99
99
 
100
- def to_h
101
- hash = WithAttributes.new({})
102
- hash.attributes = attributes
100
+ def to_h_with_attrs
101
+ hash = HashWithAttributes.new({}, attributes)
103
102
 
104
103
  hash[:zkrat] = zkrat if has? 'Zkrat'
105
104
  hash[:popis] = popis if has? 'Popis'
@@ -21,9 +21,7 @@ module MoneyS3
21
21
  element = raw.locate(locator.to_s).first
22
22
 
23
23
  if element
24
- text = WithAttributes.new(element.text)
25
- text.attributes = element.attributes
26
- text
24
+ StringWithAttributes.new(element.text, element.attributes)
27
25
  end
28
26
  end
29
27
 
@@ -61,9 +61,8 @@ module MoneyS3
61
61
  at 'CerpZuct'
62
62
  end
63
63
 
64
- def to_h
65
- hash = WithAttributes.new({})
66
- hash.attributes = attributes
64
+ def to_h_with_attrs
65
+ hash = HashWithAttributes.new({}, attributes)
67
66
 
68
67
  hash[:celkem] = celkem if has? 'Celkem'
69
68
  hash[:zaklad_0] = zaklad_0 if has? 'Zaklad_0'
@@ -17,9 +17,8 @@ module MoneyS3
17
17
  at 'Sleva'
18
18
  end
19
19
 
20
- def to_h
21
- hash = WithAttributes.new({})
22
- hash.attributes = attributes
20
+ def to_h_with_attrs
21
+ hash = HashWithAttributes.new({}, attributes)
23
22
 
24
23
  hash[:limit] = limit if has? 'Limit'
25
24
  hash[:cena] = cena if has? 'Cena'
@@ -30,16 +30,15 @@ module MoneyS3
30
30
  submodel_at(MenaType, 'Mena')
31
31
  end
32
32
 
33
- def to_h
34
- hash = WithAttributes.new({})
35
- hash.attributes = attributes
33
+ def to_h_with_attrs
34
+ hash = HashWithAttributes.new({}, attributes)
36
35
 
37
36
  hash[:zkrat] = zkrat if has? 'Zkrat'
38
37
  hash[:nazev] = nazev if has? 'Nazev'
39
38
  hash[:pozn] = pozn if has? 'Pozn'
40
39
  hash[:skup] = skup if has? 'Skup'
41
40
  hash[:ceny] = ceny if has? 'Ceny'
42
- hash[:mena] = mena.to_h if has? 'Mena'
41
+ hash[:mena] = mena.to_h_with_attrs if has? 'Mena'
43
42
 
44
43
  hash
45
44
  end
@@ -30,16 +30,15 @@ module MoneyS3
30
30
  submodel_at(MenaType, 'Mena')
31
31
  end
32
32
 
33
- def to_h
34
- hash = WithAttributes.new({})
35
- hash.attributes = attributes
33
+ def to_h_with_attrs
34
+ hash = HashWithAttributes.new({}, attributes)
36
35
 
37
36
  hash[:zkrat] = zkrat if has? 'Zkrat'
38
37
  hash[:nazev] = nazev if has? 'Nazev'
39
38
  hash[:pozn] = pozn if has? 'Pozn'
40
39
  hash[:skup] = skup if has? 'Skup'
41
40
  hash[:ceny] = ceny if has? 'Ceny'
42
- hash[:mena] = mena.to_h if has? 'Mena'
41
+ hash[:mena] = mena.to_h_with_attrs if has? 'Mena'
43
42
 
44
43
  hash
45
44
  end
@@ -102,9 +102,8 @@ module MoneyS3
102
102
  submodel_at(SkladType, 'Sklad')
103
103
  end
104
104
 
105
- def to_h
106
- hash = WithAttributes.new({})
107
- hash.attributes = attributes
105
+ def to_h_with_attrs
106
+ hash = HashWithAttributes.new({}, attributes)
108
107
 
109
108
  hash[:cislo] = cislo if has? 'Cislo'
110
109
  hash[:typ] = typ if has? 'Typ'
@@ -129,7 +128,7 @@ module MoneyS3
129
128
  hash[:zakazka] = zakazka if has? 'Zakazka'
130
129
  hash[:stav] = stav if has? 'Stav'
131
130
  hash[:poznamka] = poznamka if has? 'Poznamka'
132
- hash[:sklad] = sklad.to_h if has? 'Sklad'
131
+ hash[:sklad] = sklad.to_h_with_attrs if has? 'Sklad'
133
132
 
134
133
  hash
135
134
  end
@@ -17,9 +17,8 @@ module MoneyS3
17
17
  at 'Pozn'
18
18
  end
19
19
 
20
- def to_h
21
- hash = WithAttributes.new({})
22
- hash.attributes = attributes
20
+ def to_h_with_attrs
21
+ hash = HashWithAttributes.new({}, attributes)
23
22
 
24
23
  hash[:zkrat] = zkrat if has? 'Zkrat'
25
24
  hash[:nazev] = nazev if has? 'Nazev'
@@ -45,9 +45,8 @@ module MoneyS3
45
45
  at 'Pozn'
46
46
  end
47
47
 
48
- def to_h
49
- hash = WithAttributes.new({})
50
- hash.attributes = attributes
48
+ def to_h_with_attrs
49
+ hash = HashWithAttributes.new({}, attributes)
51
50
 
52
51
  hash[:zkrat] = zkrat if has? 'Zkrat'
53
52
  hash[:datum_od] = datum_od if has? 'DatumOd'
@@ -25,9 +25,8 @@ module MoneyS3
25
25
  at 'DPH'
26
26
  end
27
27
 
28
- def to_h
29
- hash = WithAttributes.new({})
30
- hash.attributes = attributes
28
+ def to_h_with_attrs
29
+ hash = HashWithAttributes.new({}, attributes)
31
30
 
32
31
  hash[:popis] = popis if has? 'Popis'
33
32
  hash[:hladina_dph] = hladina_dph if has? 'HladinaDPH'
@@ -14,12 +14,11 @@ module MoneyS3
14
14
  submodel_at(FakturaType, 'FaktPrij')
15
15
  end
16
16
 
17
- def to_h
18
- hash = WithAttributes.new({})
19
- hash.attributes = attributes
17
+ def to_h_with_attrs
18
+ hash = HashWithAttributes.new({}, attributes)
20
19
 
21
- hash[:fakt_vyd] = fakt_vyd.to_h if has? 'FaktVyd'
22
- hash[:fakt_prij] = fakt_prij.to_h if has? 'FaktPrij'
20
+ hash[:fakt_vyd] = fakt_vyd.to_h_with_attrs if has? 'FaktVyd'
21
+ hash[:fakt_prij] = fakt_prij.to_h_with_attrs if has? 'FaktPrij'
23
22
 
24
23
  hash
25
24
  end
@@ -14,12 +14,11 @@ module MoneyS3
14
14
  submodel_at(PolSklDoklType, 'Polozka')
15
15
  end
16
16
 
17
- def to_h
18
- hash = WithAttributes.new({})
19
- hash.attributes = attributes
17
+ def to_h_with_attrs
18
+ hash = HashWithAttributes.new({}, attributes)
20
19
 
21
20
  hash[:mj_na_sadu] = mj_na_sadu if has? 'MJNaSadu'
22
- hash[:polozka] = polozka.to_h if has? 'Polozka'
21
+ hash[:polozka] = polozka.to_h_with_attrs if has? 'Polozka'
23
22
 
24
23
  hash
25
24
  end
@@ -220,9 +220,8 @@ module MoneyS3
220
220
  array_of_at(String, ['Dokumenty', 'Dokument'])
221
221
  end
222
222
 
223
- def to_h
224
- hash = WithAttributes.new({})
225
- hash.attributes = attributes
223
+ def to_h_with_attrs
224
+ hash = HashWithAttributes.new({}, attributes)
226
225
 
227
226
  hash[:cislo_dokla] = cislo_dokla if has? 'CisloDokla'
228
227
  hash[:zpusob_uctovani] = zpusob_uctovani if has? 'ZpusobUctovani'
@@ -263,17 +262,17 @@ module MoneyS3
263
262
  hash[:i_doklad_id] = i_doklad_id if has? 'iDokladID'
264
263
  hash[:i_dokl_agend] = i_dokl_agend if has? 'iDoklAgend'
265
264
  hash[:celkem] = celkem if has? 'Celkem'
266
- hash[:eet] = eet.to_h if has? 'EET'
267
- hash[:valuty] = valuty.to_h if has? 'Valuty'
268
- hash[:dod_odb] = dod_odb.to_h if has? 'DodOdb'
269
- hash[:konec_prij] = konec_prij.to_h if has? 'KonecPrij'
270
- hash[:import] = import.to_h if has? 'Import'
271
- hash[:sklad_pro_pr] = sklad_pro_pr.to_h if has? 'SkladProPr'
272
- hash[:moje_firma] = moje_firma.to_h if has? 'MojeFirma'
273
- hash[:vlajky] = vlajky.to_h if has? 'Vlajky'
274
- hash[:souhrn_dph] = souhrn_dph.to_h if has? 'SouhrnDPH'
275
- hash[:polozka] = polozka.map(&:to_h) if has? 'Polozka'
276
- hash[:seznam_nep_plateb] = seznam_nep_plateb.map(&:to_h) if has? 'SeznamNepPlateb'
265
+ hash[:eet] = eet.to_h_with_attrs if has? 'EET'
266
+ hash[:valuty] = valuty.to_h_with_attrs if has? 'Valuty'
267
+ hash[:dod_odb] = dod_odb.to_h_with_attrs if has? 'DodOdb'
268
+ hash[:konec_prij] = konec_prij.to_h_with_attrs if has? 'KonecPrij'
269
+ hash[:import] = import.to_h_with_attrs if has? 'Import'
270
+ hash[:sklad_pro_pr] = sklad_pro_pr.to_h_with_attrs if has? 'SkladProPr'
271
+ hash[:moje_firma] = moje_firma.to_h_with_attrs if has? 'MojeFirma'
272
+ hash[:vlajky] = vlajky.to_h_with_attrs if has? 'Vlajky'
273
+ hash[:souhrn_dph] = souhrn_dph.to_h_with_attrs if has? 'SouhrnDPH'
274
+ hash[:polozka] = polozka.map(&:to_h_with_attrs) if has? 'Polozka'
275
+ hash[:seznam_nep_plateb] = seznam_nep_plateb.map(&:to_h_with_attrs) if has? 'SeznamNepPlateb'
277
276
  hash[:dokumenty] = dokumenty if has? 'Dokumenty'
278
277
 
279
278
  hash
@@ -220,9 +220,8 @@ module MoneyS3
220
220
  array_of_at(String, ['Dokumenty', 'Dokument'])
221
221
  end
222
222
 
223
- def to_h
224
- hash = WithAttributes.new({})
225
- hash.attributes = attributes
223
+ def to_h_with_attrs
224
+ hash = HashWithAttributes.new({}, attributes)
226
225
 
227
226
  hash[:cislo_dokla] = cislo_dokla if has? 'CisloDokla'
228
227
  hash[:zpusob_uctovani] = zpusob_uctovani if has? 'ZpusobUctovani'
@@ -263,17 +262,17 @@ module MoneyS3
263
262
  hash[:i_doklad_id] = i_doklad_id if has? 'iDokladID'
264
263
  hash[:i_dokl_agend] = i_dokl_agend if has? 'iDoklAgend'
265
264
  hash[:celkem] = celkem if has? 'Celkem'
266
- hash[:eet] = eet.to_h if has? 'EET'
267
- hash[:valuty] = valuty.to_h if has? 'Valuty'
268
- hash[:dod_odb] = dod_odb.to_h if has? 'DodOdb'
269
- hash[:konec_prij] = konec_prij.to_h if has? 'KonecPrij'
270
- hash[:import] = import.to_h if has? 'Import'
271
- hash[:sklad_pro_pr] = sklad_pro_pr.to_h if has? 'SkladProPr'
272
- hash[:moje_firma] = moje_firma.to_h if has? 'MojeFirma'
273
- hash[:vlajky] = vlajky.to_h if has? 'Vlajky'
274
- hash[:souhrn_dph] = souhrn_dph.to_h if has? 'SouhrnDPH'
275
- hash[:polozka] = polozka.map(&:to_h) if has? 'Polozka'
276
- hash[:seznam_nep_plateb] = seznam_nep_plateb.map(&:to_h) if has? 'SeznamNepPlateb'
265
+ hash[:eet] = eet.to_h_with_attrs if has? 'EET'
266
+ hash[:valuty] = valuty.to_h_with_attrs if has? 'Valuty'
267
+ hash[:dod_odb] = dod_odb.to_h_with_attrs if has? 'DodOdb'
268
+ hash[:konec_prij] = konec_prij.to_h_with_attrs if has? 'KonecPrij'
269
+ hash[:import] = import.to_h_with_attrs if has? 'Import'
270
+ hash[:sklad_pro_pr] = sklad_pro_pr.to_h_with_attrs if has? 'SkladProPr'
271
+ hash[:moje_firma] = moje_firma.to_h_with_attrs if has? 'MojeFirma'
272
+ hash[:vlajky] = vlajky.to_h_with_attrs if has? 'Vlajky'
273
+ hash[:souhrn_dph] = souhrn_dph.to_h_with_attrs if has? 'SouhrnDPH'
274
+ hash[:polozka] = polozka.map(&:to_h_with_attrs) if has? 'Polozka'
275
+ hash[:seznam_nep_plateb] = seznam_nep_plateb.map(&:to_h_with_attrs) if has? 'SeznamNepPlateb'
277
276
  hash[:dokumenty] = dokumenty if has? 'Dokumenty'
278
277
 
279
278
  hash
@@ -21,9 +21,8 @@ module MoneyS3
21
21
  at 'Cena'
22
22
  end
23
23
 
24
- def to_h
25
- hash = WithAttributes.new({})
26
- hash.attributes = attributes
24
+ def to_h_with_attrs
25
+ hash = HashWithAttributes.new({}, attributes)
27
26
 
28
27
  hash[:oznaceni] = oznaceni if has? 'Oznaceni'
29
28
  hash[:dat_exp] = dat_exp if has? 'DatExp'
@@ -26,15 +26,14 @@ module MoneyS3
26
26
  submodel_at(EETType, 'EET')
27
27
  end
28
28
 
29
- def to_h
30
- hash = WithAttributes.new({})
31
- hash.attributes = attributes
29
+ def to_h_with_attrs
30
+ hash = HashWithAttributes.new({}, attributes)
32
31
 
33
32
  hash[:id_dokladu] = id_dokladu if has? 'IDDokladu'
34
33
  hash[:cislo_dokladu] = cislo_dokladu if has? 'CisloDokladu'
35
34
  hash[:druh_dokladu] = druh_dokladu if has? 'DruhDokladu'
36
35
  hash[:rok] = rok if has? 'Rok'
37
- hash[:eet] = eet.to_h if has? 'EET'
36
+ hash[:eet] = eet.to_h_with_attrs if has? 'EET'
38
37
 
39
38
  hash
40
39
  end
@@ -37,9 +37,8 @@ module MoneyS3
37
37
  at 'PlnenoDPH'
38
38
  end
39
39
 
40
- def to_h
41
- hash = WithAttributes.new({})
42
- hash.attributes = attributes
40
+ def to_h_with_attrs
41
+ hash = HashWithAttributes.new({}, attributes)
43
42
 
44
43
  hash[:druh] = druh if has? 'Druh'
45
44
  hash[:cislo] = cislo if has? 'Cislo'
@@ -109,9 +109,8 @@ module MoneyS3
109
109
  submodel_at(Eshop, 'eshop')
110
110
  end
111
111
 
112
- def to_h
113
- hash = WithAttributes.new({})
114
- hash.attributes = attributes
112
+ def to_h_with_attrs
113
+ hash = HashWithAttributes.new({}, attributes)
115
114
 
116
115
  hash[:obch_nazev] = obch_nazev if has? 'ObchNazev'
117
116
  hash[:fakt_nazev] = fakt_nazev if has? 'FaktNazev'
@@ -130,14 +129,14 @@ module MoneyS3
130
129
  hash[:v_symb] = v_symb if has? 'VSymb'
131
130
  hash[:spec_sym] = spec_sym if has? 'SpecSym'
132
131
  hash[:kod_partn] = kod_partn if has? 'KodPartn'
133
- hash[:obch_adresa] = obch_adresa.to_h if has? 'ObchAdresa'
134
- hash[:fakt_adresa] = fakt_adresa.to_h if has? 'FaktAdresa'
135
- hash[:adresa] = adresa.to_h if has? 'Adresa'
136
- hash[:tel] = tel.to_h if has? 'Tel'
137
- hash[:fax] = fax.to_h if has? 'Fax'
138
- hash[:mobil] = mobil.to_h if has? 'Mobil'
139
- hash[:isdoc] = isdoc.to_h if has? 'ISDOC'
140
- hash[:eshop] = eshop.to_h if has? 'eshop'
132
+ hash[:obch_adresa] = obch_adresa.to_h_with_attrs if has? 'ObchAdresa'
133
+ hash[:fakt_adresa] = fakt_adresa.to_h_with_attrs if has? 'FaktAdresa'
134
+ hash[:adresa] = adresa.to_h_with_attrs if has? 'Adresa'
135
+ hash[:tel] = tel.to_h_with_attrs if has? 'Tel'
136
+ hash[:fax] = fax.to_h_with_attrs if has? 'Fax'
137
+ hash[:mobil] = mobil.to_h_with_attrs if has? 'Mobil'
138
+ hash[:isdoc] = isdoc.to_h_with_attrs if has? 'ISDOC'
139
+ hash[:eshop] = eshop.to_h_with_attrs if has? 'eshop'
141
140
 
142
141
  hash
143
142
  end
@@ -26,15 +26,14 @@ module MoneyS3
26
26
  submodel_at(EETType, 'EET')
27
27
  end
28
28
 
29
- def to_h
30
- hash = WithAttributes.new({})
31
- hash.attributes = attributes
29
+ def to_h_with_attrs
30
+ hash = HashWithAttributes.new({}, attributes)
32
31
 
33
32
  hash[:id_dokladu] = id_dokladu if has? 'IDDokladu'
34
33
  hash[:cislo_dokladu] = cislo_dokladu if has? 'CisloDokladu'
35
34
  hash[:druh_dokladu] = druh_dokladu if has? 'DruhDokladu'
36
35
  hash[:rok] = rok if has? 'Rok'
37
- hash[:eet] = eet.to_h if has? 'EET'
36
+ hash[:eet] = eet.to_h_with_attrs if has? 'EET'
38
37
 
39
38
  hash
40
39
  end
@@ -17,9 +17,8 @@ module MoneyS3
17
17
  at 'eSaleID'
18
18
  end
19
19
 
20
- def to_h
21
- hash = WithAttributes.new({})
22
- hash.attributes = attributes
20
+ def to_h_with_attrs
21
+ hash = HashWithAttributes.new({}, attributes)
23
22
 
24
23
  hash[:e_shop_id] = e_shop_id if has? 'eShopID'
25
24
  hash[:e_shop_name] = e_shop_name if has? 'eShopName'
@@ -91,9 +91,8 @@ module MoneyS3
91
91
  submodel_at(VysledekOdesl, 'VysledekOdesl')
92
92
  end
93
93
 
94
- def to_h
95
- hash = WithAttributes.new({})
96
- hash.attributes = attributes
94
+ def to_h_with_attrs
95
+ hash = HashWithAttributes.new({}, attributes)
97
96
 
98
97
  hash[:eet_odesl] = eet_odesl if has? 'EETOdesl'
99
98
  hash[:prod_misto] = prod_misto if has? 'ProdMisto'
@@ -114,8 +113,8 @@ module MoneyS3
114
113
  hash[:fik] = fik if has? 'FIK'
115
114
  hash[:cert_pkp] = cert_pkp if has? 'CertPKP'
116
115
  hash[:cert_eet] = cert_eet if has? 'CertEET'
117
- hash[:castky] = castky.to_h if has? 'Castky'
118
- hash[:vysledek_odesl] = vysledek_odesl.to_h if has? 'VysledekOdesl'
116
+ hash[:castky] = castky.to_h_with_attrs if has? 'Castky'
117
+ hash[:vysledek_odesl] = vysledek_odesl.to_h_with_attrs if has? 'VysledekOdesl'
119
118
 
120
119
  hash
121
120
  end
@@ -35,17 +35,16 @@ module MoneyS3
35
35
  array_of_at(EkategorieType, ['SeznamPodrKategorii', 'eKategorie'])
36
36
  end
37
37
 
38
- def to_h
39
- hash = WithAttributes.new({})
40
- hash.attributes = attributes
38
+ def to_h_with_attrs
39
+ hash = HashWithAttributes.new({}, attributes)
41
40
 
42
41
  hash[:id] = id if has? 'ID'
43
42
  hash[:name] = name if has? 'Name'
44
43
  hash[:descript] = descript if has? 'Descript'
45
44
  hash[:in_changed] = in_changed if has? 'IN_Changed'
46
45
  hash[:no_public] = no_public if has? 'NoPublic'
47
- hash[:e_shop_info] = e_shop_info.to_h if has? 'eShopInfo'
48
- hash[:seznam_podr_kategorii] = seznam_podr_kategorii.map(&:to_h) if has? 'SeznamPodrKategorii'
46
+ hash[:e_shop_info] = e_shop_info.to_h_with_attrs if has? 'eShopInfo'
47
+ hash[:seznam_podr_kategorii] = seznam_podr_kategorii.map(&:to_h_with_attrs) if has? 'SeznamPodrKategorii'
49
48
 
50
49
  hash
51
50
  end
@@ -34,9 +34,8 @@ module MoneyS3
34
34
  submodel_at(EkategorieZasobaType, 'Parent')
35
35
  end
36
36
 
37
- def to_h
38
- hash = WithAttributes.new({})
39
- hash.attributes = attributes
37
+ def to_h_with_attrs
38
+ hash = HashWithAttributes.new({}, attributes)
40
39
 
41
40
  hash[:id] = id if has? 'ID'
42
41
  hash[:name] = name if has? 'Name'
@@ -44,7 +43,7 @@ module MoneyS3
44
43
  hash[:poznamka] = poznamka if has? 'Poznamka'
45
44
  hash[:changed] = changed if has? 'Changed'
46
45
  hash[:public] = public if has? 'Public'
47
- hash[:parent] = parent.to_h if has? 'Parent'
46
+ hash[:parent] = parent.to_h_with_attrs if has? 'Parent'
48
47
 
49
48
  hash
50
49
  end