money_s3 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +12 -0
  3. data/.rspec +3 -0
  4. data/.travis.yml +5 -0
  5. data/Gemfile +6 -0
  6. data/Gemfile.lock +47 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +56 -0
  9. data/Rakefile +6 -0
  10. data/bin/console +14 -0
  11. data/bin/setup +8 -0
  12. data/lib/money_s3/adresa_type.rb +27 -0
  13. data/lib/money_s3/bank_spojeni_type.rb +23 -0
  14. data/lib/money_s3/base_element.rb +33 -0
  15. data/lib/money_s3/castky.rb +63 -0
  16. data/lib/money_s3/dalsi_sazba.rb +27 -0
  17. data/lib/money_s3/def_sub_pol_type.rb +18 -0
  18. data/lib/money_s3/definice_ceny.rb +7 -0
  19. data/lib/money_s3/dodavka_type.rb +23 -0
  20. data/lib/money_s3/dokl_ref_type.rb +30 -0
  21. data/lib/money_s3/doklad.rb +39 -0
  22. data/lib/money_s3/doklad_firma_type.rb +131 -0
  23. data/lib/money_s3/dokumenty.rb +11 -0
  24. data/lib/money_s3/eet_type.rb +97 -0
  25. data/lib/money_s3/eshop.rb +35 -0
  26. data/lib/money_s3/faktura_type.rb +449 -0
  27. data/lib/money_s3/firma_type.rb +238 -0
  28. data/lib/money_s3/import.rb +7 -0
  29. data/lib/money_s3/isdoc.rb +7 -0
  30. data/lib/money_s3/km_karta_type.rb +182 -0
  31. data/lib/money_s3/komponenta_type.rb +32 -0
  32. data/lib/money_s3/konec_prij_firma_type.rb +102 -0
  33. data/lib/money_s3/konfigurace.rb +7 -0
  34. data/lib/money_s3/kurz_rozd.rb +30 -0
  35. data/lib/money_s3/mena_type.rb +19 -0
  36. data/lib/money_s3/moje_firma_type.rb +109 -0
  37. data/lib/money_s3/money_data.rb +19 -0
  38. data/lib/money_s3/nep_platba_type.rb +22 -0
  39. data/lib/money_s3/nep_platidlo_type.rb +19 -0
  40. data/lib/money_s3/neskl_polozka.rb +82 -0
  41. data/lib/money_s3/osoba_type.rb +99 -0
  42. data/lib/money_s3/parametr_karta_type.rb +22 -0
  43. data/lib/money_s3/parametr_type.rb +35 -0
  44. data/lib/money_s3/pol_faktury_type.rb +111 -0
  45. data/lib/money_s3/pol_objedn_type.rb +132 -0
  46. data/lib/money_s3/pol_skl_dokl_type.rb +134 -0
  47. data/lib/money_s3/prepr_dopln_udaj_type.rb +19 -0
  48. data/lib/money_s3/prepr_seznamsluzeb.rb +14 -0
  49. data/lib/money_s3/prepravce_type.rb +23 -0
  50. data/lib/money_s3/seznam_bank_spojeni.rb +14 -0
  51. data/lib/money_s3/seznam_dodavek.rb +14 -0
  52. data/lib/money_s3/seznam_nep_plateb.rb +14 -0
  53. data/lib/money_s3/seznam_parametru_karty.rb +14 -0
  54. data/lib/money_s3/seznam_vc.rb +14 -0
  55. data/lib/money_s3/seznam_zal_polozek.rb +14 -0
  56. data/lib/money_s3/sklad_type.rb +100 -0
  57. data/lib/money_s3/skupina_firem_type.rb +19 -0
  58. data/lib/money_s3/slozeni.rb +14 -0
  59. data/lib/money_s3/souhrn_dph_pol_type.rb +30 -0
  60. data/lib/money_s3/souhrn_dph_type.rb +39 -0
  61. data/lib/money_s3/stav_zasoby_type.rb +19 -0
  62. data/lib/money_s3/telefon_type.rb +19 -0
  63. data/lib/money_s3/typ_zasilky_type.rb +19 -0
  64. data/lib/money_s3/ucty_pohybu_type.rb +39 -0
  65. data/lib/money_s3/uhrada_pduhrada.rb +51 -0
  66. data/lib/money_s3/uhrada_type.rb +89 -0
  67. data/lib/money_s3/valuty.rb +25 -0
  68. data/lib/money_s3/valuty_hraz.rb +18 -0
  69. data/lib/money_s3/valuty_uhr.rb +18 -0
  70. data/lib/money_s3/vazba_type.rb +22 -0
  71. data/lib/money_s3/vlajka_type.rb +39 -0
  72. data/lib/money_s3/vlajky.rb +21 -0
  73. data/lib/money_s3/vyrobni_cislo_type.rb +19 -0
  74. data/lib/money_s3/vysledek_odesl.rb +7 -0
  75. data/lib/money_s3.rb +21 -0
  76. data/money_s3.gemspec +29 -0
  77. data/xsd/Dochazka/Dochazka.xsd +295 -0
  78. data/xsd/Dochazka/Zamestnanci.xsd +202 -0
  79. data/xsd/EPO/EPO_Error.xsd +61 -0
  80. data/xsd/EPO/EPO_Success.xsd +183 -0
  81. data/xsd/_Document.xsd +912 -0
  82. data/xsd/_Export.xsd +45 -0
  83. data/xsd/_Import.xsd +94 -0
  84. data/xsd/_Report.xsd +793 -0
  85. data/xsd/__Comtypes.xsd +706 -0
  86. data/xsd/__Faktura.xsd +1097 -0
  87. data/xsd/__Firma.xsd +1705 -0
  88. data/xsd/__IntDokl.xsd +397 -0
  89. data/xsd/__InvDokl.xsd +150 -0
  90. data/xsd/__Mzda.xsd +240 -0
  91. data/xsd/__Objedn.xsd +865 -0
  92. data/xsd/__Seznamy.xsd +1721 -0
  93. data/xsd/__SklDokl.xsd +674 -0
  94. data/xsd/__UcDokl.xsd +1869 -0
  95. data/xsd/__Uhrady.xsd +230 -0
  96. data/xsd/__Vyroba.xsd +193 -0
  97. data/xsd/__Zakazka.xsd +165 -0
  98. data/xsd/__Zamestnanec.xsd +145 -0
  99. data/xsd/__Zasoba.xsd +1317 -0
  100. metadata +226 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b68295908c9b61de82b626394641dccc5671b171
4
+ data.tar.gz: ad03bd517b90fba7c2fe3eb71ff11f09b4cc8223
5
+ SHA512:
6
+ metadata.gz: a9c9c0feddc5a4fcfffae0b48c5035442857e9ac4aee5e6ba3f47870a94e4c8c423f6123cfd7410902773ed12e165328bc25f1f6f9e13686adb1ff1cdf8630df
7
+ data.tar.gz: 9901e2e7093939ddd76ca72397e4e34ff05ca1cc2cee96a516a90d31c6013a84f64400d34034297c3f688d4c9f622d37b17c80ea4d494ca762087d0a8203a3a8
data/.gitignore ADDED
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+ *.gem
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.4.3
5
+ before_install: gem install bundler -v 1.16.0
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in moneys3.gemspec
6
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,47 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ money_s3 (0.0.1)
5
+ ox
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ coderay (1.1.2)
11
+ diff-lcs (1.3)
12
+ method_source (0.9.0)
13
+ ox (2.8.2)
14
+ pry (0.11.3)
15
+ coderay (~> 1.1.0)
16
+ method_source (~> 0.9.0)
17
+ rake (10.5.0)
18
+ rspec (3.7.0)
19
+ rspec-core (~> 3.7.0)
20
+ rspec-expectations (~> 3.7.0)
21
+ rspec-mocks (~> 3.7.0)
22
+ rspec-core (3.7.0)
23
+ rspec-support (~> 3.7.0)
24
+ rspec-expectations (3.7.0)
25
+ diff-lcs (>= 1.2.0, < 2.0)
26
+ rspec-support (~> 3.7.0)
27
+ rspec-its (1.2.0)
28
+ rspec-core (>= 3.0.0)
29
+ rspec-expectations (>= 3.0.0)
30
+ rspec-mocks (3.7.0)
31
+ diff-lcs (>= 1.2.0, < 2.0)
32
+ rspec-support (~> 3.7.0)
33
+ rspec-support (3.7.0)
34
+
35
+ PLATFORMS
36
+ ruby
37
+
38
+ DEPENDENCIES
39
+ bundler
40
+ money_s3!
41
+ pry
42
+ rake
43
+ rspec
44
+ rspec-its
45
+
46
+ BUNDLED WITH
47
+ 1.16.1
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 Premysl Donat
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,56 @@
1
+ # MoneyS3
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
53
+
54
+ ## License
55
+
56
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "money_s3"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,27 @@
1
+ require 'money_s3/base_element'
2
+
3
+ module MoneyS3
4
+ class AdresaType
5
+ include BaseElement
6
+
7
+ def ulice
8
+ at :Ulice
9
+ end
10
+
11
+ def misto
12
+ at :Misto
13
+ end
14
+
15
+ def psc
16
+ at :PSC
17
+ end
18
+
19
+ def stat
20
+ at :Stat
21
+ end
22
+
23
+ def kod_statu
24
+ at :KodStatu
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,23 @@
1
+ require 'money_s3/base_element'
2
+
3
+ module MoneyS3
4
+ class BankSpojeniType
5
+ include BaseElement
6
+
7
+ def ucet
8
+ at :Ucet
9
+ end
10
+
11
+ def kod_banky
12
+ at :KodBanky
13
+ end
14
+
15
+ def mena
16
+ at :Mena
17
+ end
18
+
19
+ def ucel
20
+ at :Ucel
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,33 @@
1
+ module MoneyS3
2
+ module BaseElement
3
+ EMPTY_ARRAY = []
4
+
5
+ attr_accessor :raw
6
+
7
+ def initialize(raw)
8
+ @raw = raw
9
+ end
10
+
11
+ private
12
+
13
+ def at(locator)
14
+ return nil if raw.nil?
15
+
16
+ raw[locator]
17
+ end
18
+
19
+ def all(locator)
20
+ return [] if raw.nil?
21
+
22
+ result = raw[locator]
23
+
24
+ if result.is_a? Hash
25
+ [result]
26
+ elsif result.is_a? Array
27
+ result
28
+ else
29
+ EMPTY_ARRAY
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,63 @@
1
+ require 'money_s3/base_element'
2
+
3
+ module MoneyS3
4
+ class Castky
5
+ include BaseElement
6
+
7
+ def celkem
8
+ at :Celkem
9
+ end
10
+
11
+ def zaklad_0
12
+ at :Zaklad_0
13
+ end
14
+
15
+ def zaklad_1
16
+ at :Zaklad_1
17
+ end
18
+
19
+ def zaklad_2
20
+ at :Zaklad_2
21
+ end
22
+
23
+ def zaklad_3
24
+ at :Zaklad_3
25
+ end
26
+
27
+ def dph_1
28
+ at :DPH_1
29
+ end
30
+
31
+ def dph_2
32
+ at :DPH_2
33
+ end
34
+
35
+ def dph_3
36
+ at :DPH_3
37
+ end
38
+
39
+ def cest_sluzba
40
+ at :CestSluzba
41
+ end
42
+
43
+ def pouz_zb_1
44
+ at :PouzZb_1
45
+ end
46
+
47
+ def pouz_zb_2
48
+ at :PouzZb_2
49
+ end
50
+
51
+ def pouz_zb_3
52
+ at :PouzZb_3
53
+ end
54
+
55
+ def urc_cerp_zct
56
+ at :UrcCerpZct
57
+ end
58
+
59
+ def cerp_zuct
60
+ at :CerpZuct
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,27 @@
1
+ require 'money_s3/base_element'
2
+
3
+ module MoneyS3
4
+ class DalsiSazba
5
+ include BaseElement
6
+
7
+ def popis
8
+ at :Popis
9
+ end
10
+
11
+ def hladina_dph
12
+ at :HladinaDPH
13
+ end
14
+
15
+ def sazba
16
+ at :Sazba
17
+ end
18
+
19
+ def zaklad
20
+ at :Zaklad
21
+ end
22
+
23
+ def dph
24
+ at :DPH
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,18 @@
1
+ require 'money_s3/base_element'
2
+ require 'money_s3/pol_skl_dokl_type'
3
+
4
+ module MoneyS3
5
+ class DefSubPolType
6
+ include BaseElement
7
+
8
+ def mj_na_sadu
9
+ at :MJNaSadu
10
+ end
11
+
12
+ def polozka
13
+ element_xml = at :Polozka
14
+
15
+ PolSklDoklType.new(element_xml) if element_xml
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,7 @@
1
+ require 'money_s3/base_element'
2
+
3
+ module MoneyS3
4
+ class DefiniceCeny
5
+ include BaseElement
6
+ end
7
+ end
@@ -0,0 +1,23 @@
1
+ require 'money_s3/base_element'
2
+
3
+ module MoneyS3
4
+ class DodavkaType
5
+ include BaseElement
6
+
7
+ def oznaceni
8
+ at :Oznaceni
9
+ end
10
+
11
+ def dat_exp
12
+ at :DatExp
13
+ end
14
+
15
+ def pocet_mj
16
+ at :PocetMJ
17
+ end
18
+
19
+ def cena
20
+ at :Cena
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,30 @@
1
+ require 'money_s3/base_element'
2
+ require 'money_s3/eet_type'
3
+
4
+ module MoneyS3
5
+ class DoklRefType
6
+ include BaseElement
7
+
8
+ def id_dokladu
9
+ at :IDDokladu
10
+ end
11
+
12
+ def cislo_dokladu
13
+ at :CisloDokladu
14
+ end
15
+
16
+ def druh_dokladu
17
+ at :DruhDokladu
18
+ end
19
+
20
+ def rok
21
+ at :Rok
22
+ end
23
+
24
+ def eet
25
+ element_xml = at :EET
26
+
27
+ EETType.new(element_xml) if element_xml
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,39 @@
1
+ require 'money_s3/base_element'
2
+
3
+ module MoneyS3
4
+ class Doklad
5
+ include BaseElement
6
+
7
+ def druh
8
+ at :Druh
9
+ end
10
+
11
+ def cislo
12
+ at :Cislo
13
+ end
14
+
15
+ def guid
16
+ at :GUID
17
+ end
18
+
19
+ def prijat_dokl
20
+ at :PrijatDokl
21
+ end
22
+
23
+ def var_symbol
24
+ at :VarSymbol
25
+ end
26
+
27
+ def vystaveno
28
+ at :Vystaveno
29
+ end
30
+
31
+ def dat_uc_pr
32
+ at :DatUcPr
33
+ end
34
+
35
+ def plneno_dph
36
+ at :PlnenoDPH
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,131 @@
1
+ require 'money_s3/base_element'
2
+ require 'money_s3/adresa_type'
3
+ require 'money_s3/adresa_type'
4
+ require 'money_s3/adresa_type'
5
+ require 'money_s3/telefon_type'
6
+ require 'money_s3/telefon_type'
7
+ require 'money_s3/telefon_type'
8
+ require 'money_s3/isdoc'
9
+ require 'money_s3/eshop'
10
+
11
+ module MoneyS3
12
+ class DokladFirmaType
13
+ include BaseElement
14
+
15
+ def obch_nazev
16
+ at :ObchNazev
17
+ end
18
+
19
+ def fakt_nazev
20
+ at :FaktNazev
21
+ end
22
+
23
+ def ico
24
+ at :ICO
25
+ end
26
+
27
+ def dic
28
+ at :DIC
29
+ end
30
+
31
+ def dicsk
32
+ at :DICSK
33
+ end
34
+
35
+ def guid
36
+ at :GUID
37
+ end
38
+
39
+ def nazev
40
+ at :Nazev
41
+ end
42
+
43
+ def e_mail
44
+ at :EMail
45
+ end
46
+
47
+ def www
48
+ at :WWW
49
+ end
50
+
51
+ def platce_dph
52
+ at :PlatceDPH
53
+ end
54
+
55
+ def fyz_osoba
56
+ at :FyzOsoba
57
+ end
58
+
59
+ def banka
60
+ at :Banka
61
+ end
62
+
63
+ def ucet
64
+ at :Ucet
65
+ end
66
+
67
+ def kod_banky
68
+ at :KodBanky
69
+ end
70
+
71
+ def v_symb
72
+ at :VSymb
73
+ end
74
+
75
+ def spec_sym
76
+ at :SpecSym
77
+ end
78
+
79
+ def kod_partn
80
+ at :KodPartn
81
+ end
82
+
83
+ def obch_adresa
84
+ element_xml = at :ObchAdresa
85
+
86
+ AdresaType.new(element_xml) if element_xml
87
+ end
88
+
89
+ def fakt_adresa
90
+ element_xml = at :FaktAdresa
91
+
92
+ AdresaType.new(element_xml) if element_xml
93
+ end
94
+
95
+ def adresa
96
+ element_xml = at :Adresa
97
+
98
+ AdresaType.new(element_xml) if element_xml
99
+ end
100
+
101
+ def tel
102
+ element_xml = at :Tel
103
+
104
+ TelefonType.new(element_xml) if element_xml
105
+ end
106
+
107
+ def fax
108
+ element_xml = at :Fax
109
+
110
+ TelefonType.new(element_xml) if element_xml
111
+ end
112
+
113
+ def mobil
114
+ element_xml = at :Mobil
115
+
116
+ TelefonType.new(element_xml) if element_xml
117
+ end
118
+
119
+ def isdoc
120
+ element_xml = at :ISDOC
121
+
122
+ ISDOC.new(element_xml) if element_xml
123
+ end
124
+
125
+ def eshop
126
+ element_xml = at :eshop
127
+
128
+ Eshop.new(element_xml) if element_xml
129
+ end
130
+ end
131
+ end
@@ -0,0 +1,11 @@
1
+ require 'money_s3/base_element'
2
+
3
+ module MoneyS3
4
+ class Dokumenty
5
+ include BaseElement
6
+
7
+ def dokument
8
+ at :Dokument
9
+ end
10
+ end
11
+ end