-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWindow1.xojo_window
204 lines (196 loc) · 5.61 KB
/
Window1.xojo_window
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
#tag DesktopWindow
Begin DesktopWindow Window1
Backdrop = 0
BackgroundColor = &cFFFFFF
Composite = False
DefaultLocation = 2
FullScreen = False
HasBackgroundColor= False
HasCloseButton = True
HasFullScreenButton= False
HasMaximizeButton= True
HasMinimizeButton= True
Height = 130
ImplicitInstance= True
MacProcID = 0
MaximumHeight = 32000
MaximumWidth = 32000
MenuBar = 2023049215
MenuBarVisible = False
MinimumHeight = 64
MinimumWidth = 64
Resizeable = True
Title = "Create French TVA number"
Type = 0
Visible = True
Width = 443
Begin DesktopLabel Label1
AllowAutoDeactivate= True
Bold = True
Enabled = True
FontName = "System"
FontSize = 0.0
FontUnit = 0
Height = 20
Index = -2147483648
Italic = False
Left = 20
LockBottom = False
LockedInPosition= False
LockLeft = True
LockRight = False
LockTop = True
Multiline = False
Scope = 0
Selectable = False
TabIndex = 0
TabPanelIndex = 0
TabStop = True
Text = "SIREN / SIRET :"
TextAlignment = 0
TextColor = &c000000
Tooltip = ""
Top = 35
Transparent = False
Underline = False
Visible = True
Width = 100
End
Begin DesktopTextField TextField1
AllowAutoDeactivate= True
AllowFocusRing = True
AllowSpellChecking= False
AllowTabs = False
BackgroundColor = &cFFFFFF
Bold = False
Enabled = True
FontName = "System"
FontSize = 0.0
FontUnit = 0
Format = ""
HasBorder = True
Height = 22
Hint = ""
Index = -2147483648
Italic = False
Left = 132
LockBottom = False
LockedInPosition= False
LockLeft = True
LockRight = False
LockTop = True
MaximumCharactersAllowed= 0
Password = False
ReadOnly = False
Scope = 0
TabIndex = 1
TabPanelIndex = 0
TabStop = True
Text = ""
TextAlignment = 0
TextColor = &c000000
Tooltip = ""
Top = 35
Transparent = False
Underline = False
ValidationMask = ""
Visible = True
Width = 192
End
Begin DesktopButton Button1
AllowAutoDeactivate= True
Bold = False
Cancel = False
Caption = "OK"
Default = True
Enabled = True
FontName = "System"
FontSize = 0.0
FontUnit = 0
Height = 20
Index = -2147483648
Italic = False
Left = 343
LockBottom = False
LockedInPosition= False
LockLeft = True
LockRight = False
LockTop = True
MacButtonStyle = 0
Scope = 0
TabIndex = 2
TabPanelIndex = 0
TabStop = True
Tooltip = ""
Top = 37
Transparent = False
Underline = False
Visible = True
Width = 80
End
Begin DesktopLabel Label2
AllowAutoDeactivate= True
Bold = False
Enabled = True
FontName = "System"
FontSize = 0.0
FontUnit = 0
Height = 20
Index = -2147483648
Italic = False
Left = 20
LockBottom = False
LockedInPosition= False
LockLeft = True
LockRight = False
LockTop = True
Multiline = False
Scope = 0
Selectable = False
TabIndex = 3
TabPanelIndex = 0
TabStop = True
Text = ""
TextAlignment = 0
TextColor = &c000000
Tooltip = ""
Top = 90
Transparent = False
Underline = False
Visible = True
Width = 403
End
End
#tag EndDesktopWindow
#tag WindowCode
#tag Method, Flags = &h0
Function CreateTva(societe as string) As string
var idsociete as string
societe= ReplaceAll(societe," ", "")
select case societe.Length
case 9
idsociete= societe.ToText
case 14
idsociete=societe.Left(9).ToText
end select
var ntva as integer = (( 12 + 3 * ( idsociete.ToInteger mod 97 ) ) mod 97 )
var frtva as string = ntva.ToString+idsociete
var formatedTVA as string = "TVA number : FR"+frtva
return formatedTVA
End Function
#tag EndMethod
#tag EndWindowCode
#tag Events TextField1
#tag Event
Sub TextChanged()
Label2.text=""
End Sub
#tag EndEvent
#tag EndEvents
#tag Events Button1
#tag Event
Sub Pressed()
label2.text=CreateTva(TextField1.text)
End Sub
#tag EndEvent
#tag EndEvents