moy_sklad 1.0.0.beta1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +13 -0
  6. data/Rakefile +1 -0
  7. data/bin/gencountry +18 -0
  8. data/doc/xml/Company.xml +165 -0
  9. data/doc/xml/CustomEntity.xml +53 -0
  10. data/doc/xml/CustomerOrder.xml +168 -0
  11. data/doc/xml/Good.xml +127 -0
  12. data/doc/xml/GoodFolder.xml +53 -0
  13. data/doc/xml/MOYsklad.xsd +2450 -0
  14. data/doc/xml/PaymentIn.xml +81 -0
  15. data/doc/xml/README.md +1 -0
  16. data/lib/moy_sklad/client/attribute.rb +119 -0
  17. data/lib/moy_sklad/client/base.rb +112 -0
  18. data/lib/moy_sklad/client/collection.rb +52 -0
  19. data/lib/moy_sklad/client/formatter.rb +37 -0
  20. data/lib/moy_sklad/client/resource.rb +56 -0
  21. data/lib/moy_sklad/client.rb +5 -0
  22. data/lib/moy_sklad/configuration.rb +74 -0
  23. data/lib/moy_sklad/model/company.rb +23 -0
  24. data/lib/moy_sklad/model/country.rb +12 -0
  25. data/lib/moy_sklad/model/custom_entity.rb +4 -0
  26. data/lib/moy_sklad/model/customer_order.rb +21 -0
  27. data/lib/moy_sklad/model/data/country_codes.yml +249 -0
  28. data/lib/moy_sklad/model/demand.rb +20 -0
  29. data/lib/moy_sklad/model/good.rb +32 -0
  30. data/lib/moy_sklad/model/good_folder.rb +4 -0
  31. data/lib/moy_sklad/model/payment_in.rb +9 -0
  32. data/lib/moy_sklad/model/supply.rb +20 -0
  33. data/lib/moy_sklad/model/templates/company.builder +132 -0
  34. data/lib/moy_sklad/model/templates/custom_entity.builder +42 -0
  35. data/lib/moy_sklad/model/templates/customer_order.builder +151 -0
  36. data/lib/moy_sklad/model/templates/demand.builder +147 -0
  37. data/lib/moy_sklad/model/templates/good.builder +83 -0
  38. data/lib/moy_sklad/model/templates/good_folder.builder +41 -0
  39. data/lib/moy_sklad/model/templates/payment_in.builder +72 -0
  40. data/lib/moy_sklad/model/templates/supply.builder +144 -0
  41. data/lib/moy_sklad/model.rb +13 -0
  42. data/lib/moy_sklad/nokogiri/document.rb +28 -0
  43. data/lib/moy_sklad/version.rb +3 -0
  44. data/lib/moy_sklad.rb +4 -0
  45. data/moy_sklad.gemspec +28 -0
  46. data/spec/ms_config.rb +44 -0
  47. data/spec/spec_helper.rb +9 -0
  48. data/spec/unit/company_spec.rb +60 -0
  49. data/spec/unit/country_spec.rb +18 -0
  50. data/spec/unit/custom_entity_spec.rb +64 -0
  51. data/spec/unit/customer_order_spec.rb +131 -0
  52. data/spec/unit/demand_spec.rb +53 -0
  53. data/spec/unit/fail_spec.rb +12 -0
  54. data/spec/unit/good_folder_spec.rb +51 -0
  55. data/spec/unit/good_spec.rb +149 -0
  56. data/spec/unit/payment_in_spec.rb +120 -0
  57. data/spec/unit/supply_spec.rb +51 -0
  58. metadata +211 -0
@@ -0,0 +1,249 @@
1
+ ---
2
+ "504": 000d77a9-3000-4f81-a995-6b9cffdee1d2
3
+ "392": 00999522-23d6-40e6-870e-ec7f7bd8d354
4
+ "191": 0238a888-c602-4e78-a199-d8f49c4d6c18
5
+ "608": 02dc7934-0a88-49ea-a733-2da517a000c2
6
+ "218": 04cc9c56-96b1-4ccf-aa7f-78735710381c
7
+ "694": 04e388cb-67c1-474e-af14-a13eef642b05
8
+ "548": 05ef18e7-6e3a-4d1a-be70-a6394611c6e7
9
+ "634": 064e6038-6815-4cef-83fd-aeada3c94685
10
+ "862": 07765503-4d73-4abd-bdab-25eca4a4af76
11
+ "833": 0832377b-31b2-4fbd-8634-a2f0281b768c
12
+ "834": 0a753986-4e50-4b9b-9376-0658ea6f3c1b
13
+ "158": 0ca39fa6-c7da-4f2d-b766-ba7876fa7fa5
14
+ "414": 0cde380e-e266-4cb8-812c-7d2b4140daf7
15
+ "581": 0d2699a7-cac1-4a85-a261-56a1b6dc5364
16
+ "586": 0dfbe470-d306-47aa-a9d2-120e79194a10
17
+ "144": 105d9c98-5a3b-4ca1-9417-44cebf62ca1b
18
+ "740": 106b8f75-03cc-49cb-b833-ddba1b903e6f
19
+ "136": 118328de-9c20-4714-b4c7-86778d41908a
20
+ "222": 11a34bad-080a-45ff-84d3-57d71caa4768
21
+ "484": 11e74a09-3f30-4a38-806f-c31c34af5ac5
22
+ "772": 120a64d3-d126-4d10-b77c-b8425d0b7891
23
+ "260": 12e056bf-fdb3-42b1-b451-ec3788806fa2
24
+ "124": 13cf9ef2-6a93-4b00-96f3-812a67e64544
25
+ "360": 1468935c-3e28-4cbd-b6ae-78e84be8fd7c
26
+ "520": 14763c7b-368e-43a1-8509-ff4fb0ea73c4
27
+ "376": 14a66b93-8edc-44fb-915a-61a63db190ed
28
+ "175": 167b046c-7f42-4f7d-adff-03745669aed3
29
+ "512": 19817b50-2895-4413-9a90-9e410b537df0
30
+ "340": 1a7c9904-170d-4a34-8d79-2e8c972aafb5
31
+ "703": 1eb1be38-9190-418a-9914-33e75a44feac
32
+ "706": 20063d16-443b-44f5-9062-61aa6f68048c
33
+ "174": 20733479-c597-4bd2-9774-28d7a636f575
34
+ "516": 20e1bcdc-9fb8-4192-a400-5a8ada805878
35
+ "166": 2312affd-216c-48c1-9257-4a3ec5a9b56b
36
+ "798": 232c4cf5-4529-44f6-82e9-63f77fc1b0b2
37
+ "184": 239d4dae-d34b-4510-8bd1-2399cd4aec40
38
+ "840": 24c4303b-9f2c-434a-9a7d-17bd24d7d52d
39
+ "620": 24f037c5-108d-4052-a698-43b99e2b20be
40
+ "178": 2903e84a-7c9f-4231-a988-b8a2937cce73
41
+ "226": 2a13f3f9-3180-4f0c-afc6-792c0a89901c
42
+ "562": 2b925f3d-9153-4e02-aa4f-160e9dd9d1ba
43
+ "704": 2bb0f1c0-3da0-44ef-9a0a-e9fa0b2fdb32
44
+ "591": 2c443bd3-28fa-4107-9f6d-b874919f9dbd
45
+ "008": 2c87a13a-f1eb-4175-8f83-48c2862029ae
46
+ "170": 2e8cf286-612d-40da-9999-bcf07a402fbf
47
+ "466": 30603be9-952f-45a5-b722-18733df9829d
48
+ "818": 30746d14-5900-4540-8ced-30afa907fcc1
49
+ "192": 30812a35-2883-4db5-b4a0-37530059485a
50
+ "090": 30976930-3416-40fa-83a6-cb984a4672e1
51
+ "716": 31bd334b-912e-4fa0-97aa-39f33f6f022b
52
+ "356": 31e4ccf0-3336-40b4-8c33-18cc01604944
53
+ "736": 333d921c-7f29-406f-8e11-6faa3852bb12
54
+ "364": 33946cb4-ba56-4cd7-9b19-e5bc92b16a91
55
+ "530": 33c2371b-3b36-4151-9889-84a7a50a4dc4
56
+ "663": 33ef4c17-2ed3-41a3-b2f9-23bd01496db9
57
+ "646": 341cf747-609d-4870-b517-51736ed5cd48
58
+ "674": 34ad68f6-a8c6-4143-a7d9-7a9078f0e1e4
59
+ "132": 352a0678-1847-41e9-8e11-fbb91e91d0bb
60
+ "624": 36f3d5a6-aabf-4003-8829-d9f880b07464
61
+ "788": 390c8feb-4c34-4d7b-84e9-07530db67c8f
62
+ "458": 39f3a54a-f04b-4f4f-bcae-0a317b171af4
63
+ "470": 3a4f1c6d-ec3f-4268-835a-9b07cbee7f1f
64
+ "268": 3b89351a-9848-491a-b1c5-618a3301ea11
65
+ "446": 3bb8445d-4d00-4582-bbb0-511ec6f670e1
66
+ "239": 3c61bce6-7065-42ac-9d4a-ff61e7edc9fa
67
+ "428": 3d04639e-60e5-4f47-bc84-52464e3ee722
68
+ "417": 3f4c6d5a-140f-4ea3-821d-8e0561d9034c
69
+ "784": 3f61f555-cec9-4cdd-8567-4048cad055c7
70
+ "492": 3f987d7f-3636-4bb0-85ac-bf8d9697716f
71
+ "678": 3fffc744-6c4b-42ac-9e31-3ca755d785b0
72
+ "480": 4005ce0d-c7bd-48eb-8025-338063dea47a
73
+ "203": 401be0fd-540f-4774-b1f7-af035ba24420
74
+ "380": 40e6f69a-991c-4fbc-8be9-d0d906cad180
75
+ "764": 431fd982-6f46-4d57-a283-6fef07b65282
76
+ "858": 43905480-ade1-48f3-bc56-fb02c75e9a55
77
+ "004": 439fac4b-b7f2-486e-82ca-96564f9383eb
78
+ "780": 44147a78-fb7c-4e68-9ef1-0f4e54b4b518
79
+ "540": 458d3e4a-97a5-4f3e-962b-14ed829d1297
80
+ "450": 469dff8b-7af5-41e0-8f00-1c491f8588fe
81
+ "162": 46bbf199-654d-4aa7-a591-348fb402ac7e
82
+ "074": 471b722b-5289-4066-9c06-937a803a1c4d
83
+ "051": 4741e09c-4044-487d-ad4b-d75bebe3709c
84
+ "404": 4858eeda-459c-421e-9970-b619c4a0a7d5
85
+ "554": 4a118e01-db33-46f8-af4f-a2d6be678b5c
86
+ "116": 4cb1cd6a-689f-49fd-8c4a-55fbb3f485fa
87
+ "682": 4d59d897-9d1c-455a-a744-f8a44996d737
88
+ "238": 4eda87f8-2262-4640-befe-033b1dd862ac
89
+ "332": 4ee7fcf4-e609-4070-a462-ba66b15c51bf
90
+ "275": 4f3a4933-9a0e-417b-95b7-fe6418cfc60d
91
+ "246": 4fa56a85-d162-4a65-8856-6be631d5ac15
92
+ "688": 5164d5de-3ca5-4739-9607-7bf3ef79f47f
93
+ "438": 52b4a05f-baad-4531-b5bc-39d6445c4a67
94
+ "214": 52d48006-9e8d-4a59-8d9c-cb4d33f1757d
95
+ "804": 53777ed4-83d7-4130-b7b1-aa43650171b5
96
+ "308": 5393c401-e8e2-4301-a50f-3d85dec42dc3
97
+ "826": 54e6b709-5cb1-4282-9cd4-80530bd08f6e
98
+ "860": 556fa75a-fee6-4d03-80e7-b671628bd1c4
99
+ "092": 55d121f1-21e7-4736-8a77-bf65d79c10d2
100
+ "496": 578b4d1a-d6db-4973-ab3d-0abcc156a0b6
101
+ "662": 592d4732-e186-4c9a-a550-fc11fed0129e
102
+ "320": 59bbffd9-5da3-4dca-abbf-bb376dd49704
103
+ "616": 59fcf432-65d3-4180-8420-fe61c7816581
104
+ "528": 5b8a7dae-22a1-438c-a83c-4e23d9f46b81
105
+ "140": 5d733966-6e8a-427d-8e71-e12c5f97c793
106
+ "024": 5d8437f8-5701-452b-a633-7511a6b07dbc
107
+ "028": 5d8ce4f7-3602-43cf-a733-8f6d233d2a06
108
+ "882": 5e690d02-d724-4a1f-9238-8fb154a26156
109
+ "072": 601e6eb0-ba48-422e-8817-c1fb7cf2549f
110
+ "040": 61de9b29-4a59-41fa-953c-02135a6efb8c
111
+ "208": 63082801-a0b7-4b58-9dd7-dc6485cd52b4
112
+ "670": 645caf3d-b364-454a-8a39-a48c6e5d5c8f
113
+ "060": 661d1132-3b83-4485-a1b0-e19ea2a73093
114
+ "020": 6ca9915b-edcb-415c-9e2a-fd139dc3a531
115
+ "440": 6f4d8b3f-c38a-476c-be69-44783cf8b0b2
116
+ "276": 70c2bcc4-e7ef-4361-b673-68e1bea0edd0
117
+ "262": 754c5f9a-fd91-4f00-9814-e93ac22d6c16
118
+ "348": 758e111c-64c9-42ad-a79b-186390ba0fab
119
+ "654": 75a939c2-8c6b-4acd-bc28-8cca431452ef
120
+ "398": 76732d5d-da84-4f9d-967d-5a9f0ab453b2
121
+ "212": 76bbbcdd-927e-4c4e-b840-d6615183c9fb
122
+ "578": 78c359af-d02a-4c80-b283-f473ec7a99c8
123
+ "500": 78dbea7d-c923-40ac-94cb-8fb589e96f97
124
+ "776": 79275d5d-16f7-4088-8c78-7a8ba41dfdc2
125
+ "296": 799ca3f3-2242-44e7-996f-b41c284766cc
126
+ "031": 7a00c3b9-f28d-436b-a770-86c854a8b194
127
+ "558": 7bae8dc7-36db-4ea0-949a-6f37596e11e7
128
+ "422": 7d7ba5ea-f7d7-40d4-8171-5fccb76d303f
129
+ "690": 7e56fbe9-a99f-4363-ab01-3d0860e9b64b
130
+ "108": 7f222a85-39e3-4f76-8b6d-a7593a106ce4
131
+ "762": 7f2fdc60-827f-4e72-a271-6b1cad8b751f
132
+ "292": 8146c2cd-b9fb-4ec7-8631-2eab5017ba62
133
+ "152": 821c23cb-10e7-463a-84bb-ea30b1fdc282
134
+ "705": 828a369c-f0fd-4ad5-9184-d763d56632cd
135
+ "652": 82b09e64-b34f-4830-88e4-65e5640fb559
136
+ "659": 84ba3408-9520-4cd4-ab1b-783b43ccd131
137
+ "408": 851806bf-6440-42c3-b6cd-b8fc8abab3f2
138
+ "850": 85de1b91-b58f-4534-b5f9-3fa586c89d31
139
+ "388": 886b465f-5bb0-4c6a-9b63-9abaf5157a26
140
+ "498": 88711a90-86c2-4a73-94b4-ac0989800a36
141
+ "248": 88750e3a-1ef4-4de0-a70c-5d413bb3362d
142
+ "760": 89a4d1b8-95a9-436f-ae81-b2fd0f70c6ae
143
+ "384": 8a6ae9c4-f7c3-4e98-a0c5-4d48e43fa36b
144
+ "352": 8adc0e8e-7e11-49aa-a0d6-0219f3d6043d
145
+ "574": 8b26481b-d292-4893-b8ab-02d9c66e60ee
146
+ "752": 8ba7e821-16f7-42d2-a31b-42950e5cb24a
147
+ "426": 8c0fc39c-d681-4626-96c5-3228690ec2bb
148
+ "732": 8cd6e2b0-f18d-4722-9154-1cfbb4de5c01
149
+ "052": 8d65e0ce-6537-4484-a288-31a2e90550a3
150
+ "120": 8f2bb882-71d3-43d4-a23c-40b2d6f64385
151
+ "324": 93518e51-a2a6-4217-8b1e-f23ebed8c222
152
+ "300": 948bc687-9a73-46d0-a6fd-193674e33fc7
153
+ "894": 950da8ec-2302-4838-8c94-d72584f53f8f
154
+ "686": 95525951-6d70-4e18-b3b1-c3b85632ea8c
155
+ "234": 95a49923-55f8-4d32-b8f0-00ecf2b401e6
156
+ "180": 95e969d9-f7d9-47fa-b4a6-a595fd6a24c8
157
+ "048": 96e8f3c0-ea94-4648-94f5-8d62fa43543d
158
+ "895": 9756f8c8-84d3-46d1-9439-b4e950cff419
159
+ "086": 984e61af-3f91-4b4c-b654-ebc1be759837
160
+ "068": 99285ce4-2d44-4bce-b656-0b365e4e4e94
161
+ "630": 9996babb-fc68-494d-a7f8-bfefb85e456c
162
+ "499": 99affe93-f880-44ef-b776-ede68319860a
163
+ "580": 9bb545bc-b467-43ee-bf25-32c20ce1d4aa
164
+ "638": 9c44c966-fa0b-4f7f-96d0-8d03531b35bb
165
+ "756": 9c941932-6f70-4a32-9b77-9e38d3082a02
166
+ "660": 9cf53b6c-eab9-46a4-909d-6f5d9ecec394
167
+ "724": 9d08a1df-60a3-4787-a026-152a0680e366
168
+ "643": 9df7c2c3-7782-4c5c-a8ed-1102af611608
169
+ "854": a09505c1-b512-42ce-8831-46b9c4de8e8c
170
+ "012": a53033ed-ed00-4e13-9073-a1049201b0f6
171
+ "887": a556689d-928b-41f8-9b30-0fbe96db8cdd
172
+ "584": a6201a3e-196c-40c0-9a64-2bbe45ac6236
173
+ "800": a8b2ccbb-ca99-4dcd-be3f-a5a145a13d25
174
+ "642": aa463dd4-2759-453b-a20e-94e758ece177
175
+ "096": ab02850e-0ba0-44db-983f-c24344e4e2e5
176
+ "796": ac1d7df0-3912-417a-841c-3f4dc0732377
177
+ "570": accc2917-e65c-45bc-8b70-efbae544b65b
178
+ "831": ad723f89-06b0-4f63-ad7a-771f81fc3296
179
+ "266": ada2bd92-beb2-457d-a0f3-e737d718038e
180
+ "231": ae279b90-275b-4daf-a1df-858b44655d83
181
+ "270": ae957983-eb69-4879-b6bc-c1303af8679e
182
+ "710": b1376449-7d8d-4653-8cb7-c4d4d591ce4f
183
+ "304": b1563ccf-cf5a-466c-bed0-616f7058776b
184
+ "328": b3a15d6d-a6ea-4d68-9034-36d0476aa141
185
+ "250": b4360c20-b1b1-48b4-ac4b-f2d67ab27152
186
+ "876": b47bf238-ad2d-4531-ba75-585defb233e4
187
+ "188": b5734b1b-7b40-4727-84eb-36c2d9c4df79
188
+ "583": b5ad2cad-8165-4799-8a80-4b8ae85fc385
189
+ "598": b764017c-a2db-496e-a76a-b3a09be877bf
190
+ "442": b7fd234f-36ad-4219-ae60-1d8986090d57
191
+ "104": b81b137e-f9cb-48f1-bdc6-943ccc7ad68d
192
+ "372": b824ac96-6db6-4b64-be28-645cf5e5f0f5
193
+ "084": baf237ce-2a82-4dd3-9434-f3f7321eab65
194
+ "242": bc72bb29-ad1b-4748-b1d1-8049119e29e3
195
+ "474": bd31aba3-17a8-4bd4-a7ed-c9462f45f045
196
+ "148": bf30aa13-bdcb-49db-8e91-243b40ef1bc6
197
+ "196": bf544638-3076-4831-a406-3c0c57174c9e
198
+ "100": c0ad8a24-74ee-4596-858e-6610528e5aea
199
+ "204": c1c6a26d-1a30-47b4-bbea-9d1b62ba76d5
200
+ "430": c23f2c9d-f752-4706-809f-c2a305ad0efe
201
+ "400": c2c01367-ad1b-461b-8088-c597f149a27e
202
+ "044": c77ee906-eea7-4b51-a273-a6fa3c7a8548
203
+ "368": c78e3ef4-96dc-4268-9660-407cc02b4321
204
+ "050": c7a20922-467b-466f-a753-010e7d0b8f90
205
+ "612": c8d8b5a6-23c8-46e0-8288-0db43d8342cb
206
+ "312": c8e45450-b017-4311-ab89-974eb355e57c
207
+ "418": ca7f9078-4426-4a38-bf87-993a7aa6a5be
208
+ "462": cc126014-e641-4396-b39e-5ef218f9a197
209
+ "807": cc57deb6-689a-462f-808e-6ce8a7d10093
210
+ "232": cca9d7e1-e1fe-42da-8b4c-ffd2c231c5e4
211
+ "032": cd073ac0-68f6-4dd9-883d-a26dbeb49ac6
212
+ "233": cfd7e1f8-1f9d-458e-bd5a-03706cf74d9c
213
+ "896": d2e9ee02-a9d3-4b2c-b223-ccea2991b8d8
214
+ "316": d32276c3-4d0a-432d-a885-75f2daf65c4f
215
+ "832": d337b612-7e67-4984-b66e-3db65d1defc9
216
+ "744": d34c7ab5-2be6-4310-bdd3-6a149e5a71fa
217
+ "604": d5937e9d-a725-4da7-975a-4254ac24b540
218
+ "254": d68e64ee-8a36-4f04-b36a-9310128d4b3c
219
+ "478": d7e20e02-3b19-4194-9a09-8cb47edabc4b
220
+ "410": d867f4c7-f3af-4fb9-8ea6-ea4d5546f6fd
221
+ "524": da5ac58c-b199-409b-adea-b0f0457314d5
222
+ "076": dbc077b4-8290-4e36-93eb-4b43c6929f07
223
+ "702": dd25926b-b8c0-4211-a66b-aa464705e65e
224
+ "336": dd33db11-4996-4593-a91f-0f2b8d796af8
225
+ "508": dd3d41d9-f9c9-4e16-82a3-c2a8653cd487
226
+ "010": dd4d5419-ded1-4ef2-9d35-4d85ef3a01a4
227
+ "016": dd89c2a4-94d2-4bf1-9b50-4349e33e352d
228
+ "585": dec1786d-e0df-43ee-b6b8-7887231b551c
229
+ "344": e0fd90eb-4c06-42f9-b1ef-b0bcbc4bba81
230
+ "334": e1126aba-27de-4699-80fa-321c0673b3c2
231
+ "434": e2372f65-c662-414b-a5ed-78a0df687144
232
+ "112": e4cd57fb-0ce2-4587-9810-890839be87f7
233
+ "626": e6eb8319-2d78-4df3-b9a6-f9d3423365e4
234
+ "036": e8098539-d624-4d2f-b0a6-9f73544806fa
235
+ "064": e8b68b2a-a86a-43d2-9c12-3960b8c74aec
236
+ "070": ea0c8f2f-73a6-4f75-9d8f-917dd29baac9
237
+ "288": ea33cbd4-5e5c-42d9-a4de-339a219e40e3
238
+ "454": ec70a552-4e93-4919-93a1-9e45aaf2d6ca
239
+ "748": edd1dba3-cb6a-40af-9f4a-b1b5a7eaf6ae
240
+ "566": ee4569c0-ab92-4e89-950d-8b4bb880e2ce
241
+ "600": ef74a319-6f05-45a7-8664-fbb2a0bbdc05
242
+ "056": f31b745b-c2ac-4d78-9594-b6bf4b6822a4
243
+ "666": f5c5485f-a2c2-4452-b3e4-c84e004d7d47
244
+ "795": f5c8d88e-a5b8-4995-b0b9-889dfbcdd040
245
+ "258": f8516aea-a496-4184-b1fb-76688edf1b51
246
+ "533": fb4b7043-c9c1-4b75-8bfb-7ef024c76085
247
+ "156": fd44cd2e-b398-4222-9c43-f75688bdf327
248
+ "792": fe0d1cba-71ae-40f2-bf11-decacb87bfbf
249
+ "768": fe7e3071-94b8-473d-a0a0-63b97d7d37fa
@@ -0,0 +1,20 @@
1
+ module MoySklad::Model
2
+ class Demand < MoySklad::Client::Base
3
+ def initialize(*args)
4
+ super(*args)
5
+ create_nested_collection(:attribute)
6
+ create_nested_resource(:sum)
7
+ create_nested_collection(:shipmentOut)
8
+ end
9
+
10
+ def add_item(id, options)
11
+ item = create_and_load_resource("shipmentOut",
12
+ { goodUuid: id }.merge!(options))
13
+ if to_a(:shipmentOut).empty?
14
+ self.shipmentOut = [item]
15
+ else
16
+ self.shipmentOut << item
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,32 @@
1
+ module MoySklad::Model
2
+ class Good < MoySklad::Client::Base
3
+ def set_sale_price(type, value)
4
+ create_nested_resource(:salePrices)
5
+
6
+ v = self.salePrices.find_object(:price, :priceTypeUuid, type)
7
+ if v.nil?
8
+ create_price(type, value)
9
+ else
10
+ v.value = value.to_f * 100
11
+ end
12
+ end
13
+
14
+ def get_sale_price(uuid)
15
+ create_nested_resource(:salePrices)
16
+ self.salePrices.find_object(:price, :priceTypeUuid, uuid)
17
+ end
18
+
19
+ private
20
+
21
+ def create_price(type, value)
22
+ options = { currencyUuid: MoySklad.configuration.currency,
23
+ priceTypeUuid: type, value: value.to_f * 100 }
24
+ p = create_and_load_resource('Price', options)
25
+ if self.salePrices.price.is_a?(MoySklad::Client::Attribute::MissingAttr)
26
+ self.salePrices.price = [p]
27
+ else
28
+ self.salePrices.price << p
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,4 @@
1
+ module MoySklad::Model
2
+ class GoodFolder < MoySklad::Client::Base
3
+ end
4
+ end
@@ -0,0 +1,9 @@
1
+ module MoySklad::Model
2
+ class PaymentIn < MoySklad::Client::Base
3
+ def initialize(*args)
4
+ super(*args)
5
+ create_nested_collection(:attribute)
6
+ create_nested_resource(:sum)
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,20 @@
1
+ module MoySklad::Model
2
+ class Supply < MoySklad::Client::Base
3
+ def initialize(*args)
4
+ super(*args)
5
+ create_nested_collection(:attribute)
6
+ create_nested_resource(:sum)
7
+ create_nested_collection(:shipmentIn)
8
+ end
9
+
10
+ def add_item(id, options)
11
+ item = create_and_load_resource("shipmentIn",
12
+ { goodUuid: id }.merge!(options))
13
+ if to_a(:shipmentIn).empty?
14
+ self.shipmentIn = [item]
15
+ else
16
+ self.shipmentIn << item
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,132 @@
1
+ xml.company(name: name, discount: discount, autoDiscount: autoDiscount, discountCardNumber: discountCardNumber,
2
+ discountCorrection: discountCorrection, stateUuid: stateUuid, employeeUuid: employeeUuid,
3
+ priceTypeUuid: priceTypeUuid, archived: archived, created: created, director: director,
4
+ chiefAccountant: chiefAccountant, payerVat: payerVat, companyType: companyType) {
5
+
6
+ xml.accountUuid_ accountUuid
7
+ xml.accountId_ accountId
8
+ xml.uuid_ uuid
9
+ xml.groupUuid_ groupUuid
10
+ xml.deleted_ deleted
11
+ xml.code_ code
12
+ xml.externalcode_ externalcode
13
+ xml.description_ description
14
+
15
+ to_a(:attribute).each do |a|
16
+ xml.attribute(metadataUuid: a.metadataUuid, valueText: a.valueText, valueString: a.valueString,
17
+ doubleValue: a.doubleValue, longValue: a.longValue, booleanValue: a.booleanValue,
18
+ timeValue: a.timeValue, entityValueUuid: a.entityValueUuid, agentValueUuid: a.agentValueUuid,
19
+ goodValueUuid: a.goodValueUuid, placeValueUuid: a.placeValueUuid, consignmentValueUuid: a.consignmentValueUuid,
20
+ contractValueUuid: a.contractValueUuid, projectValueUuid: a.projectValueUuid, employeeValueUuid: a.employeeValueUuid,
21
+ goodUuid: a.goodUuid) {
22
+
23
+ xml.accountUuid_ a.accountUuid
24
+ xml.accountId_ a.accountId
25
+ xml.uuid_ a.uuid
26
+ xml.groupUuid_ a.groupUuid
27
+ xml.deleted_ a.deleted
28
+
29
+ a.to_a(:file).each do |f|
30
+ xml.file(name: f.name,
31
+ filename: f.filename, miniatureUuid: f.miniatureUuid) {
32
+
33
+ xml.accountUuid_ f.accountUuid
34
+ xml.accountId_ f.accountId
35
+ xml.uuid_ f.uuid
36
+ xml.groupUuid_ f.groupUuid
37
+ xml.deleted_ f.deleted
38
+ xml.code_ f.code
39
+ xml.externalcode_ f.externalcode
40
+ xml.description_ f.description
41
+ xml.contents_ f.contents
42
+ }
43
+ end
44
+ }
45
+ end
46
+
47
+ xml.requisite(legalTitle: requisite.legalTitle, legalAddress: requisite.legalAddress, actualAddress: requisite.actualAddress,
48
+ inn: requisite.inn, kpp: requisite.kpp, okpo: requisite.okpo, ogrn: requisite.ogrn, ogrnip: requisite.ogrnip,
49
+ nomerSvidetelstva: requisite.nomerSvidetelstva, dataSvidetelstva: requisite.dataSvidetelstva) {
50
+
51
+ xml.bankAccount(accountNumber: requisite.bankAccont.accountNumber, bankLocation: requisite.bankAccont.bankLocation,
52
+ bankName: requisite.bankAccont.bankName, bic: requisite.bankAccont.bic,
53
+ correspondentAccount: requisite.correspondentAccount, isDefault: requisite.bankAccont.isDefault) {
54
+ xml.accountUuid_ requisite.bankAccount.accountUuid
55
+ xml.accountId_ requisite.bankAccount.accountId
56
+ xml.uuid_ requisite.bankAccount.uuid
57
+ xml.groupUuid_ requisite.bankAccount.groupUuid
58
+ xml.deleted_ requisite.bankAccount.deleted
59
+ } unless requisite.bankAccount.empty?
60
+ } unless requisite.empty?
61
+
62
+ to_a(:bankAccount).each do |b|
63
+ xml.bankAccount(accountNumber: b.accountNumber, bankLocation: b.bankLocation, bankName: b.bankName, bic: b.bic,
64
+ correspondentAccount: b.correspondentAccount, isDefault: b.isDefault) {
65
+ xml.accountUuid_ b.accountUuid
66
+ xml.accountId_ b.accountId
67
+ xml.uuid_ b.uuid
68
+ xml.groupUuid_ b.groupUuid
69
+ xml.deleted_ b.deleted
70
+ }
71
+ end
72
+
73
+ xml.contact(address: contact.address, phones: contact.phones, faxes: contact.faxes, mobiles: contact.mobiles, email: contact.email)
74
+
75
+ to_a(:contactPerson).each do |c|
76
+ xml.contactPerson(name: c.name, email: c.email, phone: c.phone, position: c.position) {
77
+ xml.accountUuid_ c.accountUuid
78
+ xml.accountId_ c.accountId
79
+ xml.uuid_ c.uuid
80
+ xml.groupUuid_ c.groupUuid
81
+ xml.deleted_ c.deleted
82
+ xml.code_ c.code
83
+ xml.externalcode_ c.externalcode
84
+ xml.description_ c.description
85
+ }
86
+ end
87
+
88
+ to_a(:agentNewsItem).each do |n|
89
+ xml.agentNewsItem(moment: n.moment) {
90
+ xml.accountUuid_ n.accountUuid
91
+ xml.accountId_ n.accountId
92
+ xml.uuid_ n.uuid
93
+ xml.groupUuid_ n.groupUuid
94
+ xml.deleted_ n.deleted
95
+ xml.text_ n.text
96
+ }
97
+ end
98
+
99
+ xml.tags {
100
+ tags.to_a(:tag).each do |t|
101
+ xml.tag_ t
102
+ end
103
+ }
104
+
105
+ to_a(:sign).each do |s|
106
+ xml.sign(name: s.name, filename: s.filename, miniatureUuid: s.miniatureUuid) {
107
+ xml.accountUuid_ s.accountUuid
108
+ xml.accountId_ s.accountId
109
+ xml.uuid_ s.uuid
110
+ xml.groupUuid_ s.groupUuid
111
+ xml.deleted_ s.deleted
112
+ xml.code_ s.code
113
+ xml.externalcode_ s.externalcode
114
+ xml.description_ s.description
115
+ xml.contents_ s.contents
116
+ }
117
+ end
118
+
119
+ to_a(:stamp).each do |s|
120
+ xml.stamp(name: s.name, filename: s.filename, miniatureUuid: s.miniatureUuid) {
121
+ xml.accountUuid_ s.accountUuid
122
+ xml.accountId_ s.accountId
123
+ xml.uuid_ s.uuid
124
+ xml.groupUuid_ s.groupUuid
125
+ xml.deleted_ s.deleted
126
+ xml.code_ s.code
127
+ xml.externalcode_ s.externalcode
128
+ xml.description_ s.description
129
+ xml.contents_ s.contents
130
+ }
131
+ end
132
+ }
@@ -0,0 +1,42 @@
1
+ xml.customEntity(name: name, entityMetadataUuid: entityMetadataUuid) {
2
+
3
+ xml.accountUuid_ accountUuid
4
+ xml.accountId_ accountId
5
+ xml.uuid_ uuid
6
+ xml.groupUuid_ groupUuid
7
+ xml.deleted_ deleted
8
+ xml.code_ code
9
+ xml.externalcode_ externalcode
10
+ xml.description_ description
11
+
12
+ to_a(:attribute).each do |a|
13
+ xml.attribute(metadataUuid: a.metadataUuid, valueText: a.valueText, valueString: a.valueString,
14
+ doubleValue: a.doubleValue, longValue: a.longValue, booleanValue: a.booleanValue,
15
+ timeValue: a.timeValue, entityValueUuid: a.entityValueUuid, agentValueUuid: a.agentValueUuid,
16
+ goodValueUuid: a.goodValueUuid, placeValueUuid: a.placeValueUuid, consignmentValueUuid: a.consignmentValueUuid,
17
+ contractValueUuid: a.contractValueUuid, projectValueUuid: a.projectValueUuid, employeeValueUuid: a.employeeValueUuid,
18
+ goodUuid: a.goodUuid) {
19
+
20
+ xml.accountUuid_ a.accountUuid
21
+ xml.accountId_ a.accountId
22
+ xml.uuid_ a.uuid
23
+ xml.groupUuid_ a.groupUuid
24
+ xml.deleted_ a.deleted
25
+
26
+ a.to_a(:file).each do |f|
27
+ xml.file(name: f.name, created: f.created, filename: f.filename, miniatureUuid: f.miniatureUuid) {
28
+
29
+ xml.accountUuid_ f.accountUuid
30
+ xml.accountId_ f.accountId
31
+ xml.uuid_ f.uuid
32
+ xml.groupUuid_ f.groupUuid
33
+ xml.deleted_ f.deleted
34
+ xml.code_ f.code
35
+ xml.externalcode_ f.externalcode
36
+ xml.description_ f.description
37
+ xml.contents_ f.contents
38
+ }
39
+ end
40
+ }
41
+ end
42
+ }
@@ -0,0 +1,151 @@
1
+ xml.customerOrder(name: name, stateUuid: stateUuid, targetAgentUuid: targetAgentUuid, sourceAgentUuid: sourceAgentUuid,
2
+ targetStoreUuid: targetStoreUuid, sourceStoreUuid: sourceStoreUuid, applicable: applicable,
3
+ projectUuid: projectUuid, contractUuid: contractUuid, moment: moment, targetAccountUuid: targetAccountUuid,
4
+ sourceAccountUuid: sourceAccountUuid, payerVat: payerVat, retailStoreUuid: retailStoreUuid,
5
+ currencyUuid: currencyUuid, rate: rate, vatIncluded: vatIncluded, created: created, createdBy: createdBy,
6
+ employeeUuid: employeeUuid, deliveryPlannedMoment: deliveryPlannedMoment,
7
+ reservedSum: reservedSum) {
8
+ xml.accountUuid_ accountUuid
9
+ xml.accountId_ accountId
10
+ xml.uuid_ uuid
11
+ xml.groupUuid_ groupUuid
12
+ xml.deleted_ deleted
13
+ xml.code_ code
14
+ xml.externalcode_ externalcode
15
+ xml.description_ description
16
+
17
+ to_a(:attribute).each do |a|
18
+ xml.attribute(metadataUuid: a.metadataUuid, valueText: a.valueText, valueString: a.valueString,
19
+ doubleValue: a.doubleValue, longValue: a.longValue, booleanValue: a.booleanValue,
20
+ timeValue: a.timeValue, entityValueUuid: a.entityValueUuid, agentValueUuid: a.agentValueUuid,
21
+ goodValueUuid: a.goodValueUuid, placeValueUuid: a.placeValueUuid, consignmentValueUuid: a.consignmentValueUuid,
22
+ contractValueUuid: a.contractValueUuid, projectValueUuid: a.projectValueUuid, employeeValueUuid: a.employeeValueUuid,
23
+ goodUuid: a.goodUuid) {
24
+
25
+ xml.accountUuid_ a.accountUuid
26
+ xml.accountId_ a.accountId
27
+ xml.uuid_ a.uuid
28
+ xml.groupUuid_ a.groupUuid
29
+ xml.deleted_ a.deleted
30
+
31
+ a.to_a(:file).each do |f|
32
+ xml.file(name: f.name, created: f.created, filename: f.filename, miniatureUuid: f.miniatureUuid) {
33
+
34
+ xml.accountUuid_ f.accountUuid
35
+ xml.accountId_ f.accountId
36
+ xml.uuid_ f.uuid
37
+ xml.groupUuid_ f.groupUuid
38
+ xml.deleted_ f.deleted
39
+ xml.code_ f.code
40
+ xml.externalcode_ f.externalcode
41
+ xml.description_ f.description
42
+ xml.contents_ f.contents
43
+ }
44
+ end
45
+ }
46
+ end
47
+
48
+ to_a(:document).each do |d|
49
+ xml.document(name: d.name, created: d.created, filename: d.filename, miniatureUuid: d.miniatureUuid,
50
+ emailedDate: d.emailedDate, publicId: d.publicId, operationUuid: d.operationUuid) {
51
+ xml.accountUuid_ d.accountUuid
52
+ xml.accountId_ d.accountId
53
+ xml.uuid_ d.uuid
54
+ xml.groupUuid_ d.groupUuid
55
+ xml.deleted_ d.deleted
56
+ xml.code_ d.code
57
+ xml.externalcode_ d.externalcode
58
+ xml.description_ d.description
59
+ xml.contents_ d.contents
60
+ }
61
+ end
62
+
63
+ xml.sum(sum: sum.sum, sumInCurrency: sum.sumInCurrency)
64
+
65
+ xml.demandsUuid {
66
+ to_a(:demandsUuid).each do |r|
67
+ xml.demandRef_ r
68
+ end
69
+ }
70
+
71
+ xml.invoicesOutUuid {
72
+ to_a(:invoicesOutUuid).each do |r|
73
+ xml.invoiceOutRef_ r
74
+ end
75
+ }
76
+
77
+ xml.paymentsUuid {
78
+ to_a(:paymentsUuid).each do |r|
79
+ xml.financeInRef r
80
+ end
81
+ }
82
+
83
+ xml.purchaseOrdersUuid {
84
+ to_a(:purchaseOrdersUuid).each do |r|
85
+ xml.purchaseOrderRef r
86
+ end
87
+ }
88
+
89
+
90
+ to_a(:customerOrderPosition).each do |o|
91
+ xml.customerOrderPosition(discount: o.discount, quantity: o.quantity,
92
+ goodPackUuid: o.goodPackUuid, consignmentUuid: o.consignmentUuid, goodUuid: o.goodUuid,
93
+ slotUuid: o.slotUuid, vat: o.var) {
94
+ xml.accountUuid_ o.accountUuid
95
+ xml.accountId_ o.accountId
96
+ xml.uuid_ o.uuid
97
+ xml.groupUuid_ o.groupUuid
98
+ xml.reserve_ o.reserve
99
+
100
+ xml.basePrice(sum: o.basePrice.sum, sumInCurrency: o.basePrice.sumInCurrency)
101
+ xml.price(sum: o.price.sum, sumInCurrency: o.price.sumInCurrency)
102
+
103
+ xml.thins {
104
+ o.to_a(:thingRef).each do |t|
105
+ xml.thingRef(name: t.name, goodUuid: t.goodUuid) {
106
+
107
+ xml.accountUuid_ t.accountUuid
108
+ xml.accountId_ t.accountId
109
+ xml.uuid_ t.uuid
110
+ xml.groupUuid_ t.groupUuid
111
+ xml.deleted_ t.deleted
112
+ xml.code_ t.code
113
+ xml.externalcode_ t.externalcode
114
+ xml.description_ t.description
115
+
116
+ t.to_a(:attribute).each do |a|
117
+ xml.attribute(metadataUuid: a.metadataUuid, valueText: a.valueText, valueString: a.valueString,
118
+ doubleValue: a.doubleValue, longValue: a.longValue, booleanValue: a.booleanValue,
119
+ timeValue: a.timeValue, entityValueUuid: a.entityValueUuid, agentValueUuid: a.agentValueUuid,
120
+ goodValueUuid: a.goodValueUuid, placeValueUuid: a.placeValueUuid, consignmentValueUuid: a.consignmentValueUuid,
121
+ contractValueUuid: a.contractValueUuid, projectValueUuid: a.projectValueUuid, employeeValueUuid: a.employeeValueUuid,
122
+ goodUuid: a.goodUuid) {
123
+
124
+ xml.accountUuid_ a.accountUuid
125
+ xml.accountId_ a.accountId
126
+ xml.uuid_ a.uuid
127
+ xml.groupUuid_ a.groupUuid
128
+ xml.deleted_ a.deleted
129
+
130
+ a.to_a(:file) do |f|
131
+ xml.file(name: f.name, created: f.created, filename: f.filename, miniatureUuid: f.miniatureUuid) {
132
+
133
+ xml.accountUuid_ f.accountUuid
134
+ xml.accountId_ f.accountId
135
+ xml.uuid_ f.uuid
136
+ xml.groupUuid_ f.groupUuid
137
+ xml.deleted_ f.deleted
138
+ xml.code_ f.code
139
+ xml.externalcode_ f.externalcode
140
+ xml.description_ f.description
141
+ xml.contents_ f.contents
142
+ }
143
+ end
144
+ }
145
+ end
146
+ }
147
+ end
148
+ }
149
+ }
150
+ end
151
+ }