rs.ge 0.0.17 → 0.1.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.
@@ -1,18 +0,0 @@
1
- # -*- encoding : utf-8 -*-
2
-
3
- module RS
4
-
5
- # ქმნის ფაქტურას მოცემული ზედნადებისთვის.
6
- #
7
- # ზედნადებზე ფაქტურის გამოწერა ხდება მხოლოდ დახურულ მდგომარეობაში.
8
- def self.save_waybill_invoice(waybill, params = {})
9
- RS.validate_presence_of(params, 'su', 'sp')
10
- client = RS.waybill_service
11
- params2 = params.merge( 'waybill_id' => waybill.id, 'in_inv_id' => 0 )
12
- response = client.request 'save_invoice' do |soap|
13
- soap.body = params2
14
- end
15
- waybill.invoice_id = response[:save_invoice_response][:out_inv_id].to_i
16
- end
17
-
18
- end
@@ -1,331 +0,0 @@
1
- # -*- encoding : utf-8 -*-
2
-
3
- require 'c12-commons'
4
-
5
- module RS
6
-
7
- def self.print_waybill(waybill, file, opts = {})
8
- C12::PDF::Document.generate file, :page_size => 'A4', :margin => [15, 15] do |pdf|
9
- build_pdf waybill, pdf, opts
10
- end
11
- end
12
-
13
- def self.render_waybill(waybill, opts = {})
14
- pdf = C12::PDF::Document.new :page_size => 'A4', :margin => [15, 15]
15
- build_pdf waybill, pdf, opts
16
- pdf.render
17
- end
18
-
19
- private
20
-
21
- HIGHLIGHT = 'eeeeee'
22
- NUM_CELL_WIDTH = 18
23
- DEF_FONT_SIZE = 7
24
- SMALLER_FONT_SIZE = 6
25
- SMALL_FONT_SIZE = 5
26
- FOOTER_HEIGHT = 250
27
-
28
- def self.build_pdf(waybill, pdf, opts = {})
29
- pdf.change_font :default, DEF_FONT_SIZE
30
- render_cell_01(waybill, pdf)
31
- pdf.move_down 10
32
- render_cell_02_and_03(waybill, pdf)
33
- pdf.move_down 10
34
- render_cells_04_and_05(waybill, pdf)
35
- pdf.move_down 10
36
- render_cells_06_07_and_08(waybill, pdf)
37
- pdf.move_down 10
38
- render_cells_09_and_10(waybill, pdf)
39
- pdf.move_down 10
40
- render_cells_11_and_12(waybill, pdf)
41
- pdf.move_down 20
42
- # items and footer
43
- pdf.change_font :serif, DEF_FONT_SIZE + 2
44
- pdf.text 'სასაქონლო ზედნადების ცხრილი', :align => :center
45
- pdf.move_down 10
46
- pdf.change_font :default, DEF_FONT_SIZE
47
- last_index = render_items waybill, 0, pdf
48
- pdf.move_down 5
49
- render_footer(waybill, pdf, 0, last_index)
50
- render_remaining_items(waybill, last_index + 1, pdf)
51
- # numerate pages
52
- pages = pdf.page_count
53
- (1..pages).each do |i|
54
- pdf.go_to_page i
55
- pdf.bounding_box [0,0], :width => 300, :height => 15 do
56
- pdf.text opts[:bottom_text], :inline_format => true
57
- end if opts[:bottom_text]
58
- txt = "გვერდი #{i} / #{pages}-დან"
59
- txt_w = pdf.width_of txt
60
- pdf.bounding_box [pdf.bounds.right - pdf.bounds.left - txt_w, 0], :width => txt_w, :height => 15 do
61
- pdf.text txt
62
- end
63
- end
64
- end
65
-
66
- def self.render_remaining_items(waybill, from_index, pdf)
67
- return if waybill.items.size < from_index
68
- pdf.start_new_page
69
- pdf.change_font :serif, 10
70
- pdf.text "სასაქონლო ზედნადები №#{waybill.number}", :align => :center
71
- pdf.change_font :default, DEF_FONT_SIZE
72
- pdf.move_down 20
73
- last_index = render_items waybill, from_index, pdf
74
- pdf.move_down 5
75
- render_footer(waybill, pdf, from_index, last_index)
76
- render_remaining_items(waybill, last_index + 1, pdf)
77
- end
78
-
79
- def self.render_cell_01(waybill, pdf)
80
- items = [['', 'სასაქონლო ზედნადები №', '1', '', waybill.number]]
81
- cols = place_table_into_center [0, 150, NUM_CELL_WIDTH, 5, 100], pdf
82
- tbl = pdf.make_table items, :cell_style => {:padding => 4, :align => :center}, :column_widths => cols do
83
- column(0..1).style(:borders => [], :align => :left, :size => DEF_FONT_SIZE + 2)
84
- column(2).style(:background_color => HIGHLIGHT)
85
- column(3).style(:borders => [])
86
- end
87
- tbl.draw
88
- end
89
-
90
- def self.render_cell_02_and_03(waybill, pdf)
91
- d = C12::KA.format_date(waybill.activate_date)
92
- t = waybill.activate_date ? waybill.activate_date.strftime('%H:%M') : ''
93
- items1 = [['', '2', '', d, '', '3', '', t]]
94
- items2 = [['', '', 'თარიღი (რიცხვი, თვე, წელი)', '', '', 'დრო (საათი, წუთი)']]
95
- cols1 = place_table_into_center [0, NUM_CELL_WIDTH, 5, 80, 32, NUM_CELL_WIDTH, 5, 80], pdf
96
- cols2 = place_table_into_center [0, NUM_CELL_WIDTH + 5, 80, 32, NUM_CELL_WIDTH + 5, 80], pdf
97
- tbl1 = pdf.make_table items1, :cell_style => {:padding => 4, :align => :center}, :column_widths => cols1 do
98
- column(0).style({:borders => []})
99
- column(1).style({:background_color => HIGHLIGHT})
100
- column(2).style({:borders => []})
101
- column(4).style({:borders => []})
102
- column(5).style({:background_color => HIGHLIGHT})
103
- column(6).style({:borders => []})
104
- end
105
- tbl2 = pdf.make_table items2, :cell_style => {:padding => 1, :align => :center, :borders => [], :size => SMALL_FONT_SIZE}, :column_widths => cols2
106
- tbl1.draw
107
- tbl2.draw
108
- end
109
-
110
- def self.render_cells_04_and_05(waybill, pdf)
111
- tbl1 = tax_code_box(pdf, 'გამყიდველი (გამგზავნი)', '4', waybill.seller_tin)
112
- tbl2 = tax_code_box(pdf, 'მყიდველი (მიმღები)', '5', waybill.buyer_tin)
113
- items = [[tbl1, '', tbl2]]
114
- widths = [tbl1.width, pdf.bounds.width/2 - tbl1.width, tbl2.width]
115
- pdf.table items, :cell_style => {:padding => 0, :borders => []}, :column_widths => widths
116
- pdf.move_down 5
117
- items = [[C12.nvl(waybill.seller_name, ''), '', C12.nvl(waybill.buyer_name, '')], ['დასახელება, ან სახელი და გვარი', '', 'დასახელება, ან სახელი და გვარი']]
118
- pdf.table items, :cell_style => {:padding => 0, :borders => [], :align => :center}, :column_widths => [pdf.bounds.width/2 - 5, 10, pdf.bounds.width/2 - 5] do
119
- row(0).style(:borders => [:bottom], :padding => 5, :size => DEF_FONT_SIZE + 1)
120
- column(1).style(:borders => [])
121
- row(1).style(:size => SMALL_FONT_SIZE)
122
- end
123
- end
124
-
125
- def self.render_cells_06_07_and_08(waybill, pdf)
126
- items1 = [['6', 'ოპერაციის შინაარსი', RS::WaybillType::NAMES[waybill.type]]]
127
- tbl1 = pdf.make_table items1, :cell_style => {:align => :center}, :column_widths => [NUM_CELL_WIDTH, 70, 100] do
128
- column(0).style(:background_color => HIGHLIGHT)
129
- column(1).style(:borders => [], :size => DEF_FONT_SIZE - 1)
130
- end
131
- items2 = [['7', '', waybill.start_address], ['', '', 'ტრანსპორტირების დაწყების ადგილი (მისამართი)'],
132
- ['8', '', waybill.end_address ], ['', '', 'ტრანსპორტირების დასრულების ადგილი (მისამართი)']]
133
- tbl2 = pdf.make_table items2, :column_widths => [NUM_CELL_WIDTH, 5, pdf.bounds.width - NUM_CELL_WIDTH - 5 - 10 - tbl1.width] do
134
- column(0).style(:align => :center)
135
- column(1).style(:borders => [])
136
- column(0).row(0).style(:background_color => HIGHLIGHT)
137
- column(0).row(2).style(:background_color => HIGHLIGHT)
138
- row(1).style(:align => :center, :size => SMALL_FONT_SIZE, :padding => [0, 0, 5, 0], :borders => [])
139
- row(3).style(:align => :center, :size => SMALL_FONT_SIZE, :padding => 0, :borders => [])
140
- end
141
- pdf.table [[tbl1, '', tbl2]], :column_widths => [nil, 10, nil], :cell_style => {:borders => []}
142
- end
143
-
144
- def self.render_cells_09_and_10(waybill, pdf)
145
- items = [['', '9', '', RS::TransportType::NAMES[waybill.transport_type_id], '', '10', '', waybill.car_number],
146
- ['', '', '', 'ტრანსპორტირების სახე', '', '', '', 'სატრანსპორტო საშუალების სახელმწიფო ნომერი']]
147
- column_widths = place_table_into_center [0, NUM_CELL_WIDTH, 5, 120, 10, NUM_CELL_WIDTH, 5, 120], pdf
148
- pdf.table items, :column_widths => column_widths, :cell_style => {:align => :center, :padding => 4} do
149
- column(0).style(:borders => [])
150
- column(2).style(:borders => [])
151
- column(4).style(:borders => [])
152
- column(6).style(:borders => [])
153
- row(0).column(1).style(:background_color => HIGHLIGHT)
154
- row(0).column(5).style(:background_color => HIGHLIGHT)
155
- row(1).style(:size => SMALL_FONT_SIZE, :borders => [], :padding => 0)
156
- end
157
- end
158
-
159
- def self.render_cells_11_and_12(waybill, pdf)
160
- t11 = tax_code_box(pdf, 'სატრანსპორტო საშუალების მძღოლის პირადი ნომერი', '11', waybill.driver_tin, :caption_size => DEF_FONT_SIZE - 1)
161
- t12A = pdf.make_table [['12', '', C12.number_format(waybill.transportation_cost)], ['', '', 'თანხა ლარებში']], :column_widths => [NUM_CELL_WIDTH, 5, 100], :cell_style => {:padding => 4, :align => :center} do
162
- column(1).style(:borders => [])
163
- column(0).row(0).style(:background_color => HIGHLIGHT)
164
- row(1).style(:borders => [], :size => SMALL_FONT_SIZE, :padding => 0)
165
- end
166
- t12 = pdf.make_table [['გამყიდველის (გამგზავნის) / მყიდველის (მიმღების) მიერ გაწეული ტრანსპორტირების ხარჯი', t12A]], :cell_style => {:borders => [], :padding => 0}, :column_widths => [150] do
167
- column(0).style(:size => DEF_FONT_SIZE - 1)
168
- end
169
- pdf.table [[t11, '', t12]], :cell_style => {:borders => []}
170
- end
171
-
172
- def self.render_items(waybill, from, pdf)
173
- col_widths = [20, pdf.bounds.width - 20 - 55*5, 55, 55, 55, 55, 55]
174
- items = [['№', 'საქონლის დასახელება', 'საქონლის კოდი', 'საქონლის ზომის ერთეული', 'საქონლის რაოდენობა', 'საქონლის ერთეულის ფასი*', 'საქონლის ფასი*'], ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII']]
175
- pdf.table items, :column_widths => col_widths, :cell_style => {:align => :center, :valign => :center, :size => SMALLER_FONT_SIZE} do
176
- row(1).style(:padding => 2)
177
- end
178
- index = from
179
- nil_from = nil_to = nil
180
- while true do
181
- item = waybill.items[index]
182
- item_table = render_item(index - from, item, col_widths, pdf)
183
- y = pdf.y - item_table.height
184
- if y > FOOTER_HEIGHT
185
- item_table.draw
186
- else
187
- index -= 1 unless item.nil?
188
- break
189
- end
190
- if item.nil?
191
- nil_from = pdf.y - 5 if nil_from.nil?
192
- nil_to = pdf.y - 5
193
- else
194
- index += 1
195
- end
196
- end
197
- if nil_from and nil_from > nil_to
198
- pdf.stroke_color('ff0000')
199
- [[10, nil_from, pdf.bounds.width - 10, nil_from],
200
- [10, nil_from, pdf.bounds.width - 10, nil_to],
201
- [10, nil_to, pdf.bounds.width - 10, nil_to],
202
- [10, nil_to, pdf.bounds.width - 10, nil_from],].each { |p| pdf.stroke_line(*p) }
203
- pdf.stroke_color('000000')
204
- end
205
- index
206
- end
207
-
208
- def self.render_item(num, item, widths, pdf)
209
- if item
210
- items = [[num + 1, item.prod_name, item.bar_code, item.unit_name, C12.number_format(item.quantity, 5), C12.number_format(item.price), C12.number_format(item.quantity * item.price)]]
211
- else
212
- items = [[' ']*7]
213
- end
214
- pdf.make_table items, :column_widths => widths, :cell_style => {:size => SMALLER_FONT_SIZE} do
215
- column(0).style(:align => :right)
216
- column(2).style(:align => :center)
217
- column(3).style(:align => :center)
218
- column(4).style(:align => :right)
219
- column(5).style(:align => :right)
220
- column(6).style(:align => :right)
221
- end
222
- end
223
-
224
- def self.render_footer(waybill, pdf, from, to)
225
- render_cell_13(waybill, pdf, from, to)
226
- pdf.move_down 20
227
- render_cells_14_and_15(waybill, pdf)
228
- pdf.move_down 5
229
- render_cells_16_and_17(waybill, pdf)
230
- pdf.move_down 20
231
- render_cell_18(waybill, pdf)
232
- pdf.move_down 5
233
- render_cell_19(waybill, pdf)
234
- pdf.move_down 10
235
- pdf.text '* დღგ-ს გადამხდელთათვის დღგ-ს ჩათვლით, აქციზის გადამხდელთათვის აქციზურ საქონელზე დღგ-ს და აქციზის ჩათვლით', :size => SMALLER_FONT_SIZE
236
- end
237
-
238
- def self.render_cell_13(waybill, pdf, from, to)
239
- total = 0
240
- waybill.items[from..to].each {|item| total += item.price * item.quantity }
241
- items = [['13', '', "#{C12.number_format total} ლარი", '', C12::KA::tokenize(total*1.0, :currency => 'ლარი', :currency_minor => 'თეთრი')]]
242
- pdf.table items, :column_widths => [NUM_CELL_WIDTH, 5, 120, 5, pdf.bounds.width - NUM_CELL_WIDTH - 130] do
243
- column(0).style(:background_color => HIGHLIGHT)
244
- column(1).style(:borders => [])
245
- column(2).style(:align => :center)
246
- column(3).style(:borders => [])
247
- column(4).style(:align => :center)
248
- end
249
- pdf.move_down 2
250
- pdf.text 'მიწოდებული საქონლის მთლიანი თანხა (ციფრებით და სიტყვიერად)', :align => :center, :size => SMALL_FONT_SIZE
251
- end
252
-
253
- def self.render_cells_14_and_15(waybill, pdf)
254
- items = [['14', '', waybill.seller_info, '', '15', '', waybill.buyer_info], ['','', 'გამყიდველი (გამგზავნი) / საქონლის ჩაბარებაზე უფლებამოსილი პირი (თანამდებობა, სახელი და გვარი)', '', '', '', 'მყიდველი (მიმღები), საქონლის ჩაბარებაზე უფლებამოსილი პირი (თანამდებობა, სახელი და გვარი)']]
255
- w = (pdf.bounds.width - 2 * NUM_CELL_WIDTH - 20) / 2
256
- pdf.table items, :column_widths => [NUM_CELL_WIDTH, 5, w, 10, NUM_CELL_WIDTH, 5, w], :cell_style => {:align => :center} do
257
- row(1).style(:borders => [], :size => SMALL_FONT_SIZE, :padding => 2)
258
- row(0).column(1).style(:borders => [])
259
- row(0).column(3).style(:borders => [])
260
- row(0).column(5).style(:borders => [])
261
- row(0).column(0).style(:background_color => HIGHLIGHT)
262
- row(0).column(4).style(:background_color => HIGHLIGHT)
263
- end
264
- end
265
-
266
- def self.render_cells_16_and_17(waybill, pdf)
267
- items = [['', '16', '', '', '', '17', '', ''], ['', '', '', 'ხელმოწერა', '', '', '', 'ხელმოწერა']]
268
- widths = place_table_into_center [0, NUM_CELL_WIDTH, 5, 150, 10, NUM_CELL_WIDTH, 5, 150], pdf
269
- pdf.table items, :column_widths => widths do
270
- column(0).style(:borders => [])
271
- row(0).column(1).style(:background_color => HIGHLIGHT)
272
- row(0).column(5).style(:background_color => HIGHLIGHT)
273
- column(2).style(:borders => [])
274
- column(4).style(:borders => [])
275
- column(6).style(:borders => [])
276
- row(1).style(:borders => [], :size => SMALL_FONT_SIZE, :padding => 2, :align => :center)
277
- end
278
- end
279
-
280
- def self.render_cell_18(waybill, pdf)
281
- d = waybill.delivery_date ? C12::KA.format_date(waybill.delivery_date) : ' '
282
- t = waybill.delivery_date ? waybill.delivery_date.strftime('%H:%M') : ' '
283
- items = [['', '18', 'მიწოდებული საქონლის ჩაბარების', d, '', t], ['', '', '', 'თარიღი (რიცხვი, თვე, წელი)', '', 'დრო (საათი, წუთი)']]
284
- widths = place_table_into_center [0, NUM_CELL_WIDTH, 150, 130, 5, 50], pdf
285
- pdf.table items, :column_widths => widths do
286
- column(0).style(:borders => [])
287
- row(0).column(1).style(:background_color => HIGHLIGHT)
288
- column(2).style(:borders => [])
289
- column(4).style(:borders => [])
290
- row(0).style(:align => :center)
291
- row(1).style(:borders => [], :align => :center, :size => SMALL_FONT_SIZE, :padding => 2)
292
- end
293
- end
294
-
295
- def self.render_cell_19(waybill, pdf)
296
- items = [['19', '', waybill.comment], ['', '', 'შენიშვნა']]
297
- pdf.table items, :column_widths => [NUM_CELL_WIDTH, 5, pdf.bounds.width - NUM_CELL_WIDTH - 5] do
298
- column(0).row(0).style(:background_color => HIGHLIGHT)
299
- column(1).row(0).style(:borders => [])
300
- row(1).style(:borders => [], :size => SMALL_FONT_SIZE, :align => :center, :padding => 2)
301
- end
302
- end
303
-
304
- # Resize the first column so that the rest of the table to be placed in the center of the area.
305
- def self.place_table_into_center(column_widths, pdf)
306
- tbl_width = column_widths.inject {|sum, n| sum + n }
307
- column_widths[0] = (pdf.bounds.width - tbl_width) / 2
308
- column_widths
309
- end
310
-
311
- # Prepare table with tax code.
312
- def self.tax_code_box(pdf, title, number, tax_code, opts = {})
313
- # tax code table
314
- tax_chars = C12.empty?(tax_code) ? [' '] * 11 : tax_code.split(//)
315
- tax_chars = tax_chars[0..11] if tax_chars.size > 11
316
- items = [[number, ''] + tax_chars]
317
- widths = [NUM_CELL_WIDTH, 5] + ([12] * tax_chars.size)
318
- t1 = pdf.make_table items, :cell_style => {:padding => 4, :align => :center}, :column_widths => widths do
319
- column(0).style({:background_color => HIGHLIGHT})
320
- column(1).style(:borders => [])
321
- end
322
- # combine with caption
323
- caption_width = opts[:caption_width] || 90
324
- table = pdf.make_table [[title, t1]], :cell_style => {:padding => 0, :borders => []}, :column_widths => [caption_width] do
325
- column(0).style(:valign => :center)
326
- column(0).style(:size => opts[:caption_size]) if opts[:caption_size]
327
- end
328
- table
329
- end
330
-
331
- end
@@ -1,128 +0,0 @@
1
- # -*- encoding : utf-8 -*-
2
-
3
- module RS
4
-
5
- # სერვისის მომხმარებლის კლასი.
6
- class User
7
- attr_accessor :id, :user_name, :payer_id, :ip, :name
8
- end
9
-
10
- # აბრუნებს თქვენი კომპიუტერის გარე IP მისამართს.
11
- def self.what_is_my_ip
12
- client = RS.waybill_service
13
- response = client.request 'what_is_my_ip'
14
- response.to_hash[:what_is_my_ip_response][:what_is_my_ip_result]
15
- end
16
-
17
- # ქმნის ახალ მომხმარებელს.
18
- #
19
- # გადაეცემა შემდეგი პარამეტრები:
20
- #
21
- # user_name -- მომხმარებლის სახელი
22
- # user_password -- მომხმარებლის პაროლი
23
- # ip -- მანქანის IP მისამართი, რომლიდანაც უნდა მოხდეს ამ მომხმარებლის შემოსვლა
24
- # name -- მაღაზიის სახელი
25
- # su -- სერვისის მომხმარებლის სახელი
26
- # sp -- სერვისის მომხმარებლის პაროლი
27
- def self.create_service_user(params)
28
- RS.validate_presence_of(params, 'user_name', 'user_password', 'ip', 'name', 'su', 'sp')
29
- client = RS.waybill_service
30
- response = client.request 'create_service_user' do
31
- soap.body = params
32
- end
33
- response.to_hash[:create_service_user_response][:create_service_user_result]
34
- end
35
-
36
- # აბრუნებს სერვისის მომხმარებლელბის სიას.
37
- #
38
- # გადაეცემა შემდეგი პარამეტრები:
39
- #
40
- # user_name -- მომხმარებლის სახელი
41
- # user_password -- მომხმარებლი პაროლი
42
- #
43
- # ბრუნდება #{User}-ების მასივი.
44
- def self.get_service_users(params)
45
- RS.validate_presence_of(params, 'user_name', 'user_password')
46
- client = RS.waybill_service
47
- response = client.request 'get_service_users' do
48
- soap.body = params
49
- end
50
- users_hash_array = response.to_hash[:get_service_users_response][:get_service_users_result][:service_users][:service_user]
51
- #puts users_hash_array
52
- users = []
53
- users_hash_array.each do |user_hash|
54
- user = User.new
55
- user.id = user_hash[:id]
56
- user.user_name = user_hash[:user_name]
57
- user.payer_id = user_hash[:un_id]
58
- user.ip = user_hash[:ip]
59
- user.name = user_hash[:name]
60
- users << user
61
- end
62
- users
63
- end
64
-
65
- # სერვისის მომხმარებლის პაროლის შემოწმება.
66
- #
67
- # გადაეცემა შემდეგი პარამეტრები:
68
- #
69
- # su -- სერვისის მომხმარებელი
70
- # sp -- სერვისის მომხმარებლის პაროლი
71
- #
72
- # აბრუნებს #{User} ობიექტს, ცარიელი ip-თი ან <code>nil</code>-ს თუ არასწორი მომხმარებელია.
73
- def self.check_service_user(params)
74
- RS.validate_presence_of(params, 'su', 'sp')
75
- client = RS.waybill_service
76
- response = client.request 'chek_service_user' do
77
- soap.body = params
78
- end
79
- if response[:chek_service_user_response][:chek_service_user_result]
80
- payer_id = response[:chek_service_user_response][:un_id]
81
- user_id = response[:chek_service_user_response][:s_user_id]
82
- user = User.new
83
- user.id = user_id
84
- user.user_name = params['su']
85
- user.payer_id = payer_id
86
- user
87
- end
88
- end
89
-
90
- # სერვისის მომხმარებლის მონაცემების შეცვლა.
91
- #
92
- # გადაეცემა შემდეგი პარამეტრები:
93
- #
94
- # user_name -- მომხმარებლის სახელი
95
- # user_password -- პაროლი
96
- # ip -- მანქანის მისამართი,
97
- # name -- მაღაზიის დასახელება
98
- # su -- მომხამრებლის სახელი
99
- # sp -- პაროლი
100
- def self.update_service_user(params)
101
- RS.validate_presence_of(params, 'user_name', 'user_password', 'ip', 'name', 'su', 'sp')
102
- client = RS.waybill_service
103
- response = client.request 'update_service_user' do
104
- soap.body = params
105
- end
106
- #puts params
107
- #puts response.to_hash
108
- response.to_hash[:update_service_user_response][:update_service_user_result]
109
- end
110
-
111
- # აბრუნებს ორგანიზაციის/პიროვნების სახელს მისი საიდენტიფიკაციო ნომრიდან.
112
- #
113
- # გადაეცემა შემდეგი პარამეტრები:
114
- #
115
- # su -- მომხამრებლის სახელი
116
- # sp -- პაროლი
117
- # tin -- საიდენტიფიკაციო ნომერი
118
- def self.get_name_from_tin(params)
119
- RS.ensure_open_user(params)
120
- RS.validate_presence_of(params, 'su', 'sp', 'tin')
121
- client = RS.waybill_service
122
- response = client.request 'get_name_from_tin' do
123
- soap.body = params
124
- end
125
- response.to_hash[:get_name_from_tin_response][:get_name_from_tin_result]
126
- end
127
-
128
- end