ig3tool 0.4.6 → 0.5.0

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,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
2
  <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
3
- <!--Generated with glade3 3.4.5 on Tue Oct 21 15:06:07 2008 -->
3
+ <!--Generated with glade3 3.4.3 on Wed Apr 30 00:49:09 2008 -->
4
4
  <glade-interface>
5
5
  <widget class="GtkWindow" id="window">
6
6
  <property name="visible">True</property>
@@ -152,7 +152,7 @@
152
152
  <property name="visible">True</property>
153
153
  <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
154
154
  <child>
155
- <widget class="GtkAlignment" id="alignment1">
155
+ <widget class="GtkAlignment" id="alignment3">
156
156
  <property name="visible">True</property>
157
157
  <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
158
158
  <child>
@@ -217,17 +217,6 @@
217
217
  <property name="position">3</property>
218
218
  </packing>
219
219
  </child>
220
- <child>
221
- <widget class="GtkLabel" id="label27">
222
- <property name="visible">True</property>
223
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
224
- <property name="xalign">1</property>
225
- <property name="xpad">5</property>
226
- </widget>
227
- <packing>
228
- <property name="position">4</property>
229
- </packing>
230
- </child>
231
220
  </widget>
232
221
  </child>
233
222
  </widget>
@@ -290,19 +279,6 @@
290
279
  <property name="position">3</property>
291
280
  </packing>
292
281
  </child>
293
- <child>
294
- <widget class="GtkCheckButton" id="continuous_stock_check">
295
- <property name="visible">True</property>
296
- <property name="can_focus">True</property>
297
- <property name="tooltip" translatable="yes">check this box if this product doesn't have a real stock</property>
298
- <property name="label" translatable="yes">continuous stock?</property>
299
- <property name="response_id">0</property>
300
- <property name="draw_indicator">True</property>
301
- </widget>
302
- <packing>
303
- <property name="position">4</property>
304
- </packing>
305
- </child>
306
282
  </widget>
307
283
  </child>
308
284
  </widget>
@@ -545,11 +521,11 @@
545
521
  <property name="visible">True</property>
546
522
  <property name="top_padding">10</property>
547
523
  <child>
548
- <widget class="GtkHButtonBox" id="hbuttonbox3">
524
+ <widget class="GtkHButtonBox" id="hbuttonbox1">
549
525
  <property name="visible">True</property>
550
526
  <property name="layout_style">GTK_BUTTONBOX_END</property>
551
527
  <child>
552
- <widget class="GtkButton" id="button1">
528
+ <widget class="GtkButton" id="button3">
553
529
  <property name="visible">True</property>
554
530
  <property name="can_focus">True</property>
555
531
  <property name="receives_default">True</property>
@@ -1031,7 +1007,7 @@
1031
1007
  </widget>
1032
1008
  </child>
1033
1009
  <child>
1034
- <widget class="GtkAlignment" id="alignment2">
1010
+ <widget class="GtkAlignment" id="alignment44">
1035
1011
  <property name="visible">True</property>
1036
1012
  <child>
1037
1013
  <widget class="GtkAlignment" id="alignment55">
@@ -1569,7 +1545,7 @@
1569
1545
  </widget>
1570
1546
  </child>
1571
1547
  <child>
1572
- <widget class="GtkAlignment" id="alignment8">
1548
+ <widget class="GtkAlignment" id="alignment39">
1573
1549
  <property name="visible">True</property>
1574
1550
  <child>
1575
1551
  <widget class="GtkLabel" id="purchase_notification">
@@ -2089,7 +2065,7 @@
2089
2065
  </widget>
2090
2066
  </child>
2091
2067
  <child>
2092
- <widget class="GtkAlignment" id="alignment17">
2068
+ <widget class="GtkAlignment" id="alignment8">
2093
2069
  <property name="visible">True</property>
2094
2070
  <child>
2095
2071
  <widget class="GtkLabel" id="stock_notification">
@@ -2392,11 +2368,11 @@
2392
2368
  <widget class="GtkAlignment" id="alignment37">
2393
2369
  <property name="visible">True</property>
2394
2370
  <child>
2395
- <widget class="GtkHButtonBox" id="hbuttonbox4">
2371
+ <widget class="GtkHButtonBox" id="hbuttonbox3">
2396
2372
  <property name="visible">True</property>
2397
2373
  <property name="layout_style">GTK_BUTTONBOX_END</property>
2398
2374
  <child>
2399
- <widget class="GtkButton" id="button4">
2375
+ <widget class="GtkButton" id="button1">
2400
2376
  <property name="visible">True</property>
2401
2377
  <property name="can_focus">True</property>
2402
2378
  <property name="receives_default">True</property>
@@ -2407,7 +2383,7 @@
2407
2383
  </widget>
2408
2384
  </child>
2409
2385
  <child>
2410
- <widget class="GtkButton" id="button5">
2386
+ <widget class="GtkButton" id="button4">
2411
2387
  <property name="visible">True</property>
2412
2388
  <property name="can_focus">True</property>
2413
2389
  <property name="receives_default">True</property>
@@ -2479,7 +2455,7 @@
2479
2455
  </widget>
2480
2456
  </child>
2481
2457
  <child>
2482
- <widget class="GtkAlignment" id="alignment18">
2458
+ <widget class="GtkAlignment" id="alignment19">
2483
2459
  <property name="visible">True</property>
2484
2460
  <property name="right_padding">25</property>
2485
2461
  <child>
@@ -24,40 +24,86 @@
24
24
  <placeholder/>
25
25
  </child>
26
26
  <child>
27
- <widget class="GtkLabel" id="label6">
27
+ <widget class="GtkAlignment" id="alignment2">
28
28
  <property name="visible">True</property>
29
- <property name="xalign">0</property>
30
- <property name="label" translatable="yes">Debugger:</property>
29
+ <child>
30
+ <widget class="GtkLabel" id="saldo_label">
31
+ <property name="visible">True</property>
32
+ <property name="xalign">0</property>
33
+ </widget>
34
+ </child>
31
35
  </widget>
32
36
  <packing>
37
+ <property name="left_attach">2</property>
38
+ <property name="right_attach">3</property>
33
39
  <property name="top_attach">1</property>
34
40
  <property name="bottom_attach">2</property>
35
- <property name="x_options">GTK_FILL</property>
36
- <property name="y_options"></property>
37
41
  </packing>
38
42
  </child>
39
43
  <child>
40
- <widget class="GtkEntry" id="count">
44
+ <widget class="GtkAlignment" id="alignment1">
45
+ <property name="visible">True</property>
46
+ <child>
47
+ <widget class="GtkLabel" id="saldo">
48
+ <property name="visible">True</property>
49
+ <property name="xalign">0</property>
50
+ <property name="use_markup">True</property>
51
+ </widget>
52
+ </child>
53
+ </widget>
54
+ <packing>
55
+ <property name="left_attach">3</property>
56
+ <property name="right_attach">4</property>
57
+ <property name="top_attach">1</property>
58
+ <property name="bottom_attach">2</property>
59
+ </packing>
60
+ </child>
61
+ <child>
62
+ <widget class="GtkComboBox" id="debugger">
63
+ <property name="visible">True</property>
64
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
65
+ <property name="active">0</property>
66
+ <signal name="changed" handler="debugger_changed"/>
67
+ </widget>
68
+ <packing>
69
+ <property name="left_attach">1</property>
70
+ <property name="right_attach">2</property>
71
+ <property name="top_attach">1</property>
72
+ <property name="bottom_attach">2</property>
73
+ </packing>
74
+ </child>
75
+ <child>
76
+ <widget class="GtkEntry" id="smartzap">
41
77
  <property name="visible">True</property>
42
78
  <property name="can_focus">True</property>
43
- <property name="text" translatable="yes">1</property>
44
- <signal name="activate" handler="count_activate"/>
79
+ <signal name="activate" handler="smartzap_activate"/>
45
80
  </widget>
46
81
  <packing>
47
82
  <property name="left_attach">1</property>
48
83
  <property name="right_attach">2</property>
49
- <property name="top_attach">2</property>
50
- <property name="bottom_attach">3</property>
51
84
  <property name="y_options"></property>
52
85
  </packing>
53
86
  </child>
54
87
  <child>
55
- <widget class="GtkLabel" id="label5">
88
+ <widget class="GtkLabel" id="label1">
56
89
  <property name="visible">True</property>
57
90
  <property name="xalign">0</property>
58
- <property name="label" translatable="yes">Aantal:</property>
91
+ <property name="label" translatable="yes">Smartzap:</property>
92
+ </widget>
93
+ <packing>
94
+ <property name="x_options">GTK_FILL</property>
95
+ <property name="y_options"></property>
96
+ </packing>
97
+ </child>
98
+ <child>
99
+ <widget class="GtkLabel" id="label7">
100
+ <property name="visible">True</property>
101
+ <property name="xalign">0</property>
102
+ <property name="label" translatable="yes">Lid:</property>
59
103
  </widget>
60
104
  <packing>
105
+ <property name="left_attach">2</property>
106
+ <property name="right_attach">3</property>
61
107
  <property name="top_attach">2</property>
62
108
  <property name="bottom_attach">3</property>
63
109
  <property name="x_options">GTK_FILL</property>
@@ -69,8 +115,7 @@
69
115
  <property name="visible">True</property>
70
116
  <property name="active">0</property>
71
117
  <property name="items" translatable="yes">non member
72
- debugger
73
- member</property>
118
+ debugger</property>
74
119
  <signal name="changed" handler="member_changed"/>
75
120
  <child internal-child="entry">
76
121
  <widget class="GtkEntry" id="comboboxentry-entry1">
@@ -88,14 +133,12 @@ member</property>
88
133
  </packing>
89
134
  </child>
90
135
  <child>
91
- <widget class="GtkLabel" id="label7">
136
+ <widget class="GtkLabel" id="label5">
92
137
  <property name="visible">True</property>
93
138
  <property name="xalign">0</property>
94
- <property name="label" translatable="yes">Lid:</property>
139
+ <property name="label" translatable="yes">Aantal:</property>
95
140
  </widget>
96
141
  <packing>
97
- <property name="left_attach">2</property>
98
- <property name="right_attach">3</property>
99
142
  <property name="top_attach">2</property>
100
143
  <property name="bottom_attach">3</property>
101
144
  <property name="x_options">GTK_FILL</property>
@@ -103,75 +146,31 @@ member</property>
103
146
  </packing>
104
147
  </child>
105
148
  <child>
106
- <widget class="GtkLabel" id="label1">
107
- <property name="visible">True</property>
108
- <property name="xalign">0</property>
109
- <property name="label" translatable="yes">Smartzap:</property>
110
- </widget>
111
- <packing>
112
- <property name="x_options">GTK_FILL</property>
113
- <property name="y_options"></property>
114
- </packing>
115
- </child>
116
- <child>
117
- <widget class="GtkEntry" id="smartzap">
149
+ <widget class="GtkEntry" id="count">
118
150
  <property name="visible">True</property>
119
151
  <property name="can_focus">True</property>
120
- <signal name="activate" handler="smartzap_activate"/>
152
+ <property name="text" translatable="yes">1</property>
153
+ <signal name="activate" handler="count_activate"/>
121
154
  </widget>
122
155
  <packing>
123
156
  <property name="left_attach">1</property>
124
157
  <property name="right_attach">2</property>
158
+ <property name="top_attach">2</property>
159
+ <property name="bottom_attach">3</property>
125
160
  <property name="y_options"></property>
126
161
  </packing>
127
162
  </child>
128
163
  <child>
129
- <widget class="GtkComboBox" id="debugger">
130
- <property name="visible">True</property>
131
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
132
- <property name="active">0</property>
133
- <signal name="changed" handler="debugger_changed"/>
134
- </widget>
135
- <packing>
136
- <property name="left_attach">1</property>
137
- <property name="right_attach">2</property>
138
- <property name="top_attach">1</property>
139
- <property name="bottom_attach">2</property>
140
- </packing>
141
- </child>
142
- <child>
143
- <widget class="GtkAlignment" id="alignment1">
144
- <property name="visible">True</property>
145
- <child>
146
- <widget class="GtkLabel" id="saldo">
147
- <property name="visible">True</property>
148
- <property name="xalign">0</property>
149
- <property name="use_markup">True</property>
150
- </widget>
151
- </child>
152
- </widget>
153
- <packing>
154
- <property name="left_attach">3</property>
155
- <property name="right_attach">4</property>
156
- <property name="top_attach">1</property>
157
- <property name="bottom_attach">2</property>
158
- </packing>
159
- </child>
160
- <child>
161
- <widget class="GtkAlignment" id="alignment2">
164
+ <widget class="GtkLabel" id="label6">
162
165
  <property name="visible">True</property>
163
- <child>
164
- <widget class="GtkLabel" id="saldo_label">
165
- <property name="visible">True</property>
166
- <property name="xalign">0</property>
167
- </widget>
168
- </child>
166
+ <property name="xalign">0</property>
167
+ <property name="label" translatable="yes">Debugger:</property>
169
168
  </widget>
170
169
  <packing>
171
- <property name="left_attach">2</property>
172
- <property name="right_attach">3</property>
173
170
  <property name="top_attach">1</property>
174
171
  <property name="bottom_attach">2</property>
172
+ <property name="x_options">GTK_FILL</property>
173
+ <property name="y_options"></property>
175
174
  </packing>
176
175
  </child>
177
176
  </widget>
@@ -252,33 +251,27 @@ member</property>
252
251
  <property name="column_spacing">6</property>
253
252
  <property name="row_spacing">3</property>
254
253
  <child>
255
- <widget class="GtkEntry" id="change">
254
+ <widget class="GtkLabel" id="label9">
256
255
  <property name="visible">True</property>
257
- <property name="can_focus">True</property>
258
- <property name="editable">False</property>
259
- <property name="has_frame">False</property>
260
- <property name="width_chars">9</property>
256
+ <property name="xalign">0</property>
257
+ <property name="label" translatable="yes">€</property>
261
258
  </widget>
262
259
  <packing>
263
- <property name="left_attach">1</property>
264
- <property name="right_attach">2</property>
265
- <property name="top_attach">2</property>
266
- <property name="bottom_attach">3</property>
260
+ <property name="left_attach">2</property>
261
+ <property name="right_attach">3</property>
267
262
  <property name="x_options">GTK_FILL</property>
268
263
  <property name="y_options"></property>
269
264
  </packing>
270
265
  </child>
271
266
  <child>
272
- <widget class="GtkEntry" id="paid">
267
+ <widget class="GtkLabel" id="label10">
273
268
  <property name="visible">True</property>
274
- <property name="can_focus">True</property>
275
- <property name="has_frame">False</property>
276
- <property name="width_chars">9</property>
277
- <signal name="changed" handler="price_entries_changed"/>
269
+ <property name="xalign">0</property>
270
+ <property name="label" translatable="yes">€</property>
278
271
  </widget>
279
272
  <packing>
280
- <property name="left_attach">1</property>
281
- <property name="right_attach">2</property>
273
+ <property name="left_attach">2</property>
274
+ <property name="right_attach">3</property>
282
275
  <property name="top_attach">1</property>
283
276
  <property name="bottom_attach">2</property>
284
277
  <property name="x_options">GTK_FILL</property>
@@ -286,31 +279,27 @@ member</property>
286
279
  </packing>
287
280
  </child>
288
281
  <child>
289
- <widget class="GtkEntry" id="total">
282
+ <widget class="GtkLabel" id="label11">
290
283
  <property name="visible">True</property>
291
- <property name="can_focus">True</property>
292
- <property name="editable">False</property>
293
- <property name="has_frame">False</property>
294
- <property name="width_chars">9</property>
295
- <property name="text" translatable="yes">0.00</property>
296
- <signal name="changed" handler="price_entries_changed"/>
284
+ <property name="xalign">0</property>
285
+ <property name="label" translatable="yes">€</property>
297
286
  </widget>
298
287
  <packing>
299
- <property name="left_attach">1</property>
300
- <property name="right_attach">2</property>
288
+ <property name="left_attach">2</property>
289
+ <property name="right_attach">3</property>
290
+ <property name="top_attach">2</property>
291
+ <property name="bottom_attach">3</property>
301
292
  <property name="x_options">GTK_FILL</property>
302
293
  <property name="y_options"></property>
303
294
  </packing>
304
295
  </child>
305
296
  <child>
306
- <widget class="GtkLabel" id="label14">
297
+ <widget class="GtkLabel" id="label12">
307
298
  <property name="visible">True</property>
308
299
  <property name="xalign">0</property>
309
- <property name="label" translatable="yes">Terug:</property>
300
+ <property name="label" translatable="yes">Totaal:</property>
310
301
  </widget>
311
302
  <packing>
312
- <property name="top_attach">2</property>
313
- <property name="bottom_attach">3</property>
314
303
  <property name="x_options">GTK_FILL</property>
315
304
  <property name="y_options"></property>
316
305
  </packing>
@@ -329,40 +318,46 @@ member</property>
329
318
  </packing>
330
319
  </child>
331
320
  <child>
332
- <widget class="GtkLabel" id="label12">
321
+ <widget class="GtkLabel" id="label14">
333
322
  <property name="visible">True</property>
334
323
  <property name="xalign">0</property>
335
- <property name="label" translatable="yes">Totaal:</property>
324
+ <property name="label" translatable="yes">Terug:</property>
336
325
  </widget>
337
326
  <packing>
327
+ <property name="top_attach">2</property>
328
+ <property name="bottom_attach">3</property>
338
329
  <property name="x_options">GTK_FILL</property>
339
330
  <property name="y_options"></property>
340
331
  </packing>
341
332
  </child>
342
333
  <child>
343
- <widget class="GtkLabel" id="label11">
334
+ <widget class="GtkEntry" id="total">
344
335
  <property name="visible">True</property>
345
- <property name="xalign">0</property>
346
- <property name="label" translatable="yes">€</property>
336
+ <property name="can_focus">True</property>
337
+ <property name="editable">False</property>
338
+ <property name="has_frame">False</property>
339
+ <property name="width_chars">9</property>
340
+ <property name="text" translatable="yes">0.00</property>
341
+ <signal name="changed" handler="price_entries_changed"/>
347
342
  </widget>
348
343
  <packing>
349
- <property name="left_attach">2</property>
350
- <property name="right_attach">3</property>
351
- <property name="top_attach">2</property>
352
- <property name="bottom_attach">3</property>
344
+ <property name="left_attach">1</property>
345
+ <property name="right_attach">2</property>
353
346
  <property name="x_options">GTK_FILL</property>
354
347
  <property name="y_options"></property>
355
348
  </packing>
356
349
  </child>
357
350
  <child>
358
- <widget class="GtkLabel" id="label10">
351
+ <widget class="GtkEntry" id="paid">
359
352
  <property name="visible">True</property>
360
- <property name="xalign">0</property>
361
- <property name="label" translatable="yes">€</property>
353
+ <property name="can_focus">True</property>
354
+ <property name="has_frame">False</property>
355
+ <property name="width_chars">9</property>
356
+ <signal name="changed" handler="price_entries_changed"/>
362
357
  </widget>
363
358
  <packing>
364
- <property name="left_attach">2</property>
365
- <property name="right_attach">3</property>
359
+ <property name="left_attach">1</property>
360
+ <property name="right_attach">2</property>
366
361
  <property name="top_attach">1</property>
367
362
  <property name="bottom_attach">2</property>
368
363
  <property name="x_options">GTK_FILL</property>
@@ -370,14 +365,18 @@ member</property>
370
365
  </packing>
371
366
  </child>
372
367
  <child>
373
- <widget class="GtkLabel" id="label9">
368
+ <widget class="GtkEntry" id="change">
374
369
  <property name="visible">True</property>
375
- <property name="xalign">0</property>
376
- <property name="label" translatable="yes">€</property>
370
+ <property name="can_focus">True</property>
371
+ <property name="editable">False</property>
372
+ <property name="has_frame">False</property>
373
+ <property name="width_chars">9</property>
377
374
  </widget>
378
375
  <packing>
379
- <property name="left_attach">2</property>
380
- <property name="right_attach">3</property>
376
+ <property name="left_attach">1</property>
377
+ <property name="right_attach">2</property>
378
+ <property name="top_attach">2</property>
379
+ <property name="bottom_attach">3</property>
381
380
  <property name="x_options">GTK_FILL</property>
382
381
  <property name="y_options"></property>
383
382
  </packing>
data/lib/lib/util.rb CHANGED
@@ -35,12 +35,6 @@ class String
35
35
  self
36
36
  end
37
37
  end
38
-
39
- def to_boolean
40
- return true if (self == "t" or self.to_i != 0)
41
- false
42
- end
43
-
44
38
  end
45
39
 
46
40
  class Numeric
@@ -59,10 +59,10 @@ module Ig3tool
59
59
  @loan_list.model = @loan_list_store = Gtk::ListStore.new(Object, String, String, String, String, String, String)
60
60
  ll = Gtk::CellRendererText.new
61
61
  @loan_list.insert_column(-1, "loan date", ll) do |tvc, cell, m ,iter|
62
- cell.text = iter[0].loan_date.strftime("%d/%m/%y")
62
+ cell.text = Time.parse(iter[0].loan_date).strftime("%d/%m/%y")
63
63
  end
64
64
  @loan_list.insert_column(-1, "return on", ll) do |tvc, cell, m ,iter|
65
- date = iter[0].return_date
65
+ date = Time.parse(iter[0].return_date)
66
66
  ll.foreground = "red" if date > Time.now
67
67
  cell.text = date.strftime("%d/%m/%y")
68
68
  ll.foreground = "black"
data/lib/ui/interne.rb CHANGED
@@ -27,7 +27,7 @@ module Ig3tool
27
27
  @transactions.model = @transactions_store = Gtk::ListStore.new(Object, String, String, String, String, String)
28
28
  l = Gtk::CellRendererText.new
29
29
  @transactions.insert_column(-1, "time", l) do |tvc, cell, m, iter|
30
- cell.text = iter[0].time.strftime("%d/%m/%y %H:%M")
30
+ cell.text = Time.parse(iter[0].time).strftime("%d/%m %H:%M")
31
31
  end
32
32
  @transactions.insert_column(-1, "amount", l) do |tvc, cell, m, iter|
33
33
  cell.text = iter[0].amount.from_c.to_s
@@ -133,17 +133,7 @@ module Ig3tool
133
133
  @log_menu = Gtk::Menu.new
134
134
  log_menu_refund_item = Gtk::MenuItem.new("refund")
135
135
  log_menu_show_item = Gtk::MenuItem.new("show")
136
- log_menu_reprint_item = Gtk::MenuItem.new("reprint")
137
136
  # Treeview heeft default Mode Gtk::SELECTION_SINGLE
138
- log_menu_reprint_item.signal_connect("activate") {
139
- @filteredlog.selection.selected_each do |model, path, iter|
140
- logentry = iter[0]
141
- # do reprint stuff
142
- $client.print_reprint!({ "logid" => logentry["id"]})
143
- @notification.text = "attempting reprint of job #{logentry["job"]} for #{logentry["username"]}"
144
- _update_log
145
- end
146
- }
147
137
  log_menu_show_item.signal_connect("activate") {
148
138
  @filteredlog.selection.selected_each do |model, path, iter|
149
139
  logentry = iter[0]
@@ -168,8 +158,7 @@ module Ig3tool
168
158
  }
169
159
 
170
160
  @log_menu.append(log_menu_show_item)
171
- @log_menu.append(log_menu_refund_item)
172
- @log_menu.append(log_menu_reprint_item)
161
+ @log_menu.append(log_menu_refund_item)
173
162
  @log_menu.show_all
174
163
 
175
164
  end
@@ -178,17 +167,7 @@ module Ig3tool
178
167
  @log_big_menu = Gtk::Menu.new
179
168
  log_menu_refund_item = Gtk::MenuItem.new("refund")
180
169
  log_menu_show_item = Gtk::MenuItem.new("show")
181
- log_menu_reprint_item = Gtk::MenuItem.new("reprint")
182
170
  # Treeview heeft default Mode Gtk::SELECTION_SINGLE
183
- log_menu_reprint_item.signal_connect("activate") {
184
- @filteredlog.selection.selected_each do |model, path, iter|
185
- logentry = iter[0]
186
- # do reprint stuff
187
- $client.print_reprint!({ "logid" => logentry["id"]})
188
- @notification.text = "attempting reprint of job #{logentry["job"]} for #{logentry["username"]}"
189
- _update_log
190
- end
191
- }
192
171
  log_menu_show_item.signal_connect("activate") {
193
172
  @log.selection.selected_each do |model, path, iter|
194
173
  logentry = iter[0]
@@ -215,7 +194,6 @@ module Ig3tool
215
194
 
216
195
  @log_big_menu.append(log_menu_show_item)
217
196
  @log_big_menu.append(log_menu_refund_item)
218
- @log_big_menu.append(log_menu_reprint_item)
219
197
  @log_big_menu.show_all
220
198
 
221
199
  end
data/lib/ui/protjes.rb CHANGED
@@ -1,13 +1,5 @@
1
1
  require 'time'
2
2
 
3
- class String
4
-
5
- def to_boolean
6
- return true if (self == "t" or self.to_i != 0)
7
- return false
8
- end
9
-
10
- end
11
3
 
12
4
  module Ig3tool
13
5
 
@@ -33,7 +25,6 @@ def initialize
33
25
  @add_stock = @glade.get_widget("add_stock")
34
26
  @add_prodcat = @glade.get_widget("add_prodcat")
35
27
  @add_categories = @glade.get_widget("add_categories")
36
- @continuous_stock = @glade.get_widget("continuous_stock_check")
37
28
 
38
29
  @categories = $client.product_categories.collect {|x| x.name}.sort
39
30
 
@@ -105,7 +96,7 @@ def initialize
105
96
  @purchase_log.model = @purchase_log_store = Gtk::ListStore.new(Object, String, String, String, String, String)
106
97
  l = Gtk::CellRendererText.new
107
98
  @purchase_log.insert_column(-1, "time", l) do |tvc, cell, m, iter|
108
- cell.text = iter[0].time.strftime("%d/%m/%y")
99
+ cell.text = Time.parse(iter[0].time).strftime("%d/%m/%y")
109
100
  end
110
101
  @purchase_log.insert_column(-1, "barcode", l) do |tvc, cell, m, iter|
111
102
  cell.text = iter[0].product
@@ -136,7 +127,7 @@ def initialize
136
127
  @spurchase_log.model = @spurchase_log_store = Gtk::ListStore.new(Object, String, String, String, String, String, String)
137
128
  l = Gtk::CellRendererText.new
138
129
  @spurchase_log.insert_column(-1, "time", l) do |tvc, cell, m, iter|
139
- cell.text = iter[0].time.strftime("%d/%m/%y")
130
+ cell.text = Time.parse(iter[0].time).strftime("%d/%m/%y")
140
131
  end
141
132
  @spurchase_log.insert_column(-1, "barcode", l) do |tvc, cell, m, iter|
142
133
  cell.text = iter[0].product
@@ -198,8 +189,6 @@ def initialize
198
189
  @slog_categories.model = cat6_model
199
190
  @slog_categories.active = 0
200
191
 
201
- @continuous_stock.active = false
202
-
203
192
  toggle_purchase_fields(false)
204
193
  _add_clear
205
194
  _purchase_clear
@@ -214,6 +203,14 @@ def initialize
214
203
  @handler4 = @purchase_price.signal_connect("changed"){ price_amount_changed }
215
204
  @handler5 = @purchase_amount.signal_connect("changed"){ price_amount_changed }
216
205
 
206
+ %w(focus-out-event activate).each do |s|
207
+ @purchase_amount.signal_connect s do
208
+ if @purchase_price.text.strip.to_c == 0
209
+ @purchase_price.text = (@purchase_amount.text.strip.to_i * @purchase_debuggers_orig.text.to_f).to_s
210
+ end
211
+ false
212
+ end
213
+ end
217
214
  #@handler8 = @add_categories.signal_connect("changed"){ refresh }
218
215
  @handler9 = @purchase_categories.signal_connect("changed"){ refresh }
219
216
  @handler10 = @stock_categories.signal_connect("changed"){ refresh }
@@ -232,17 +229,6 @@ def initialize
232
229
  make_eval_widget w
233
230
  end
234
231
 
235
- # Update prices after amount change
236
- %w(focus-out-event activate).each do |s|
237
- @purchase_amount.signal_connect s do
238
- number_eval_widget(@purchase_amount, "0.0")
239
- if @purchase_price.text.strip.to_c == 0
240
- @purchase_price.text = (@purchase_amount.text.strip.to_i * @purchase_debuggers_orig.text.to_f).to_s
241
- end
242
- false
243
- end
244
- end
245
-
246
232
  @handler69 = @purchase_debugger.signal_connect("changed"){ purchase_debugger_changed }
247
233
  @debugger_stamp = nil
248
234
 
@@ -564,12 +550,7 @@ end
564
550
  raise Needed, "please scan a barcode" if @add_barcode.text.strip.empty?
565
551
  raise Needed, "please enter a descriptive name" if @add_name.text.strip.empty?
566
552
  raise Needed, "please select a category" if @add_prodcat.active == -1
567
- if @continuous_stock.active?
568
- cs = 1
569
- else
570
- cs = 0
571
- end
572
- $client.product_save!("barcode" => @add_barcode.text.strip, "name" => @add_name.text.strip, "continuous_stock" => cs, "dprice" => @manage_debuggers.text.strip.to_c, "mprice" => @manage_members.text.strip.to_c, "nmprice" => @manage_plebs.text.strip.to_c, "category" => @categories[@add_prodcat.active])
553
+ $client.product_save!("barcode" => @add_barcode.text.strip, "name" => @add_name.text.strip, "dprice" => @manage_debuggers.text.strip.to_c, "mprice" => @manage_members.text.strip.to_c, "nmprice" => @manage_plebs.text.strip.to_c, "category" => @categories[@add_prodcat.active])
573
554
  _update_add_products(false)
574
555
  @add_notification.text = "the imps saved the product!"
575
556
  _add_clear(false)
@@ -634,9 +615,6 @@ end
634
615
  @add_barcode.text = prod.barcode
635
616
  @add_stock.text = prod.stock
636
617
  @add_name.text = prod.name
637
- puts prod.continuous_stock.class
638
- puts prod.continuous_stock
639
- @continuous_stock.active = prod.continuous_stock.to_boolean
640
618
  @add_prodcat.active = @categories.index(prod.category)
641
619
  rescue Exception => e
642
620
  @add_notification.text = e.message
@@ -657,16 +635,11 @@ end
657
635
  @purchase_name.text = prod.name
658
636
  @purchase_category.text = prod.category
659
637
  price_amount_changed
660
- if prod.continuous_stock.to_boolean
661
- toggle_purchase_fields(false)
662
- @purchase_notification.text = "this product has a continuous stock"
663
- else
664
- toggle_purchase_fields(true)
665
- end
638
+ toggle_purchase_fields(true)
666
639
  Thread.new do
667
640
  ps = $client.product_purchases(barcode)
668
641
  last_purchase = ps.first
669
- date = last_purchase.time.strftime("%d/%m/%y")
642
+ date = Time.parse(last_purchase.time).strftime("%d/%m/%y")
670
643
  @purchase_last.text = date
671
644
  end
672
645
  rescue Exception => e
@@ -838,7 +811,6 @@ end
838
811
  @add_name.text = ""
839
812
  @add_prodcat.active = -1
840
813
  @add_notification.text = "" if all
841
- @continuous_stock.active = false
842
814
  end
843
815
 
844
816
  def _purchase_clear(all=true)
@@ -9,7 +9,7 @@ module Ig3tool
9
9
  @status = "non member"
10
10
  @target = nil
11
11
 
12
- @statushash = {0 => "non member", 1 => "debugger", 2 => "member"}
12
+ @statushash = {0 => "non member", 1 => "debugger"}
13
13
  @statushashi = @statushash.invert
14
14
 
15
15
  # init items
@@ -115,21 +115,20 @@ module Ig3tool
115
115
  jaar = Time.werkjaar % 100
116
116
  lidkaartx = sprintf("^00%02d%02d", jaar, jaar+1).to_re
117
117
  if value =~ lidkaartx # yay! fascets! (fascisme?)
118
- begin
119
- $client.person_member(value)
120
- # als deze lidkaart overeenkomt met een member =>
121
- # zet value op member
122
- @target = value
123
- @status = "member"
124
- @member_id.active = @statushashi[@status]
125
- puts "member found.."
126
- rescue Ig3tool::NotAMember => e
127
- # alst gene member is => verkoop een lidkaart :)
128
- value = "lidkaart"
129
- end
118
+ value = "lidkaart"
130
119
  end
131
120
  end
132
121
 
122
+ # is het een member?
123
+ begin
124
+ memb = $client.person_member(value)
125
+
126
+ @target = value
127
+ @status = "member"
128
+ @member_id.active = @statushashi[@status]
129
+ return
130
+ rescue Exception => e
131
+ end
133
132
 
134
133
  # is het een product?
135
134
  begin
@@ -156,7 +155,6 @@ module Ig3tool
156
155
  end
157
156
 
158
157
  def member_changed
159
- puts "member_changed"
160
158
  chosen = @member_id.active_text.strip
161
159
  @target = nil
162
160
 
@@ -178,7 +176,6 @@ module Ig3tool
178
176
 
179
177
  @target = chosen
180
178
  @status = "member"
181
- puts "member found.."
182
179
  rescue NotAMember => e
183
180
  end
184
181
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ig3tool
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Pinte
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-11-25 00:00:00 +01:00
12
+ date: 2008-10-02 00:00:00 +02:00
13
13
  default_executable: ig3tool
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency