unipump 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,18 @@
1
+ # Ordrenummer: 24007051 (01-7051)
2
+ {"meid"=>"B077E6B8-C9B2-4E40-9B34-1682D87AF639", "said"=>"D75F9C2B-E5C2-478D-8A8A-22E0DD138E5E", "acid"=>2, "dato"=>2024-01-31 00:00:00 +0100}
3
+ {"meid"=>"B077E6B8-C9B2-4E40-9B34-1682D87AF639", "said"=>"D75F9C2B-E5C2-478D-8A8A-22E0DD138E5E", "acid"=>2, "dato"=>2024-01-31 00:00:00 +0100}
4
+ {"meid"=>"B077E6B8-C9B2-4E40-9B34-1682D87AF639", "said"=>"D75F9C2B-E5C2-478D-8A8A-22E0DD138E5E", "acid"=>12, "dato"=>2024-01-31 00:00:00 +0100}
5
+ {"meid"=>"B077E6B8-C9B2-4E40-9B34-1682D87AF639", "said"=>"D75F9C2B-E5C2-478D-8A8A-22E0DD138E5E", "acid"=>12, "dato"=>2024-01-31 00:00:00 +0100}
6
+ {"meid"=>"BBA0B5BA-5C15-498B-AE94-2307166091FC", "said"=>"D75F9C2B-E5C2-478D-8A8A-22E0DD138E5E", "acid"=>2, "dato"=>2024-01-31 00:00:00 +0100}
7
+ {"meid"=>"BBA0B5BA-5C15-498B-AE94-2307166091FC", "said"=>"D75F9C2B-E5C2-478D-8A8A-22E0DD138E5E", "acid"=>3, "dato"=>2024-02-02 00:00:00 +0100}
8
+ {"meid"=>"BBA0B5BA-5C15-498B-AE94-2307166091FC", "said"=>"D75F9C2B-E5C2-478D-8A8A-22E0DD138E5E", "acid"=>3, "dato"=>2024-02-07 00:00:00 +0100}
9
+ {"meid"=>"B077E6B8-C9B2-4E40-9B34-1682D87AF639", "said"=>"D75F9C2B-E5C2-478D-8A8A-22E0DD138E5E", "acid"=>3, "dato"=>2024-02-04 00:00:00 +0100}
10
+ {"meid"=>"B077E6B8-C9B2-4E40-9B34-1682D87AF639", "said"=>"D75F9C2B-E5C2-478D-8A8A-22E0DD138E5E", "acid"=>13, "dato"=>2024-02-04 00:00:00 +0100}
11
+ {"meid"=>"BBA0B5BA-5C15-498B-AE94-2307166091FC", "said"=>"D75F9C2B-E5C2-478D-8A8A-22E0DD138E5E", "acid"=>2, "dato"=>2024-01-31 00:00:00 +0100}
12
+ {"meid"=>"BBA0B5BA-5C15-498B-AE94-2307166091FC", "said"=>"D75F9C2B-E5C2-478D-8A8A-22E0DD138E5E", "acid"=>3, "dato"=>2024-02-13 00:00:00 +0100}
13
+ {"meid"=>"BBA0B5BA-5C15-498B-AE94-2307166091FC", "said"=>"D75F9C2B-E5C2-478D-8A8A-22E0DD138E5E", "acid"=>19, "dato"=>2024-01-31 00:00:00 +0100}
14
+ {"meid"=>"B077E6B8-C9B2-4E40-9B34-1682D87AF639", "said"=>"D75F9C2B-E5C2-478D-8A8A-22E0DD138E5E", "acid"=>1, "dato"=>2024-01-30 00:00:00 +0100}
15
+ {"meid"=>"BBA0B5BA-5C15-498B-AE94-2307166091FC", "said"=>"D75F9C2B-E5C2-478D-8A8A-22E0DD138E5E", "acid"=>1, "dato"=>2024-01-30 00:00:00 +0100}
16
+ {"meid"=>"BBA0B5BA-5C15-498B-AE94-2307166091FC", "said"=>"D75F9C2B-E5C2-478D-8A8A-22E0DD138E5E", "acid"=>1, "dato"=>2024-01-31 00:00:00 +0100}
17
+ {"meid"=>"BBA0B5BA-5C15-498B-AE94-2307166091FC", "said"=>"D75F9C2B-E5C2-478D-8A8A-22E0DD138E5E", "acid"=>13, "dato"=>2024-02-02 00:00:00 +0100}
18
+ {"meid"=>"BBA0B5BA-5C15-498B-AE94-2307166091FC", "said"=>"D75F9C2B-E5C2-478D-8A8A-22E0DD138E5E", "acid"=>13, "dato"=>2024-02-13 00:00:00 +0100}
data/sig/timepump.rbs ADDED
@@ -0,0 +1,4 @@
1
+ module Timepump
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
@@ -0,0 +1,155 @@
1
+ drop view v_fakturalinie;
2
+ go
3
+
4
+ create view v_fakturalinie as
5
+ select
6
+ q.said,
7
+ q.meid,
8
+ q.acid,
9
+ q.dato, year(dato) "aar", month(dato) "maaned",
10
+ SUBSTRING('Jan Feb Mar Apr Maj Jun Jul Aug Sep Okt Nov Dec ', (month(dato) * 4) - 3, 3) as "md",
11
+ q.fakturadato,
12
+ kontonummer,
13
+ cast(((year(dato)-2000)*1000000 + serial) as nvarchar) "ordrenummer",
14
+ sagsnummer,
15
+ ansvarlig,
16
+ initialer,
17
+ ydelse,
18
+ (select pris from uni_lager l where l.varenummer=ydelse and q.dato between l.fra_dato and l.til_dato) as pris,
19
+ rolle + ' ' + medarbejder as medarbejderogrolle,
20
+ tekst,
21
+ timer
22
+ from (
23
+ select
24
+ t.meid,
25
+ t.said,
26
+ t.acid,
27
+ t.dato,
28
+ t.fakturadato,
29
+ s.uni_kontonummer as "kontonummer",
30
+ s.uni_serial as "serial",
31
+ s.prefix as "sagsnummer",
32
+ (select initialer from medarbejder where id=s.sagsansvarlig) "ansvarlig",
33
+ m.initialer,
34
+ m.fornavn + ' ' + m.efternavn as "medarbejder",
35
+ case
36
+ when sagstype = 7 then -- GLP
37
+ case a.acid
38
+ when 8 then 'RejseTime' -- betaling for rejsetid
39
+ when 38 then 'RejseTime'
40
+ else -- timer, særlig sats for GLP
41
+ coalesce(
42
+ (
43
+ select 'InternTimeGLP'
44
+ from
45
+ medarbejdermedarbejderprofil mmp,
46
+ medarbejderprofil mp
47
+ where
48
+ mmp.meid = m.id
49
+ and mmp.mpid = mp.id
50
+ and mp.kode = 'IM'
51
+ ),
52
+ 'EksternTimeGLP'
53
+ )
54
+ end
55
+ else
56
+ case a.acid
57
+ when 38 then 'RejseTimeUdland' -- udlandsrejsetid faktureres til halv timesats
58
+ else -- timer, der skelnes kun mellem interne og eksterne medarbejdere
59
+ coalesce(
60
+ (
61
+ select 'InternTime'
62
+ from
63
+ medarbejdermedarbejderprofil mmp,
64
+ medarbejderprofil mp
65
+ where
66
+ mmp.meid = m.id
67
+ and mmp.mpid = mp.id
68
+ and mp.kode = 'IM'
69
+ ),
70
+ 'EksternTime'
71
+ )
72
+ end
73
+ end as "ydelse",
74
+ a.tekst,
75
+ (
76
+ select
77
+ beskrivelse
78
+ from
79
+ medarbejderrolle
80
+ where rolleid = (
81
+ select roid from sagsmedarbejder where meid = m.id and said = s.id
82
+ )
83
+ ) as "rolle",
84
+ t.timer
85
+ from
86
+ tidsreg t
87
+ inner join sag s on t.said = s.id
88
+ inner join medarbejder m on t.meid = m.id
89
+ inner join aktivitet a on t.acid = a.acid
90
+ where
91
+ (
92
+ -- sagstyper der har standard timebaseret afregning - type 13 håndteres pt manuelt
93
+ s.sagstype in (1, 2, 4, 5, 6, 7, 9)
94
+ -- de specifikke sagsaktiviteter der skal TIMEAFREGNES
95
+ and a.acid in (1, 2, 3, 4, 5, 6, 7, 9, 11, 12, 13, 15, 19, 38)
96
+ ) or ( -- specialtillfældet GLP - Rejsetid
97
+ s.sagstype = 7
98
+ and a.acid = 8
99
+ )
100
+ ) q
101
+ union
102
+ select
103
+ qq.said,
104
+ qq.meid,
105
+ qq.acid,
106
+ qq.dato, year(dato) "aar", month(dato) "maaned",
107
+ SUBSTRING('Jan Feb Mar Apr Maj Jun Jul Aug Sep Okt Nov Dec ', (month(dato) * 4) - 3, 3) as "md",
108
+ qq.fakturadato,
109
+ kontonummer,
110
+ cast(((year(dato)-2000)*1000000 + serial) as nvarchar) "ordrenummer",
111
+ sagsnummer,
112
+ ansvarlig,
113
+ initialer,
114
+ ydelse,
115
+ (select pris from uni_lager l where l.varenummer=ydelse and qq.dato between l.fra_dato and l.til_dato) as pris,
116
+ rolle + ' ' + medarbejder as medarbejderogrolle,
117
+ tekst as "tekst",
118
+ dag as "timer"
119
+ from (
120
+ select
121
+ t.meid,
122
+ t.said,
123
+ t.acid,
124
+ t.dato,
125
+ t.fakturadato,
126
+ s.uni_kontonummer as "kontonummer",
127
+ s.uni_serial as "serial",
128
+ s.prefix as "sagsnummer",
129
+ (select initialer from medarbejder where id=s.sagsansvarlig) "ansvarlig",
130
+ m.initialer,
131
+ m.fornavn + ' ' + m.efternavn as "medarbejder",
132
+ case
133
+ when sagstype = 7
134
+ then 'RejseOpholdGLP'
135
+ else 'Rejseophold'
136
+ end as "ydelse",
137
+ 'Rejse- og opholdshonorar' as "tekst",
138
+ (
139
+ select
140
+ beskrivelse
141
+ from medarbejderrolle
142
+ where rolleid = ( select roid from sagsmedarbejder where meid = m.id and said = s.id)
143
+ ) as "rolle",
144
+ 1 as "dag"
145
+ from
146
+ tidsreg t
147
+ inner join sag s on t.said = s.id
148
+ inner join medarbejder m on t.meid = m.id
149
+ inner join aktivitet a on t.acid = a.acid
150
+ where
151
+ s.sagstype in (1, 2, 4, 5, 6, 7, 9) -- se ovenfor
152
+ and a.acid in (2, 12, 22) -- aktiviteter der giver anledning til "ophold"
153
+ ) qq
154
+ ;
155
+ go
metadata ADDED
@@ -0,0 +1,101 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: unipump
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Claus Rasmussen
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2024-03-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: tiny_tds
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: shellopts
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: indented_io
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description:
56
+ email:
57
+ - ras@danak.dk
58
+ executables:
59
+ - unipump
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - ".rspec"
64
+ - ".ruby-version"
65
+ - README.md
66
+ - Rakefile
67
+ - TODO
68
+ - exe/unipump
69
+ - lib/unipump.rb
70
+ - lib/unipump/credentials.rb
71
+ - lib/unipump/mssql.rb
72
+ - lib/unipump/version.rb
73
+ - note.txt
74
+ - produktions-overførsel-20240220/uniconta.json
75
+ - produktions-overførsel-20240220/unipump.log
76
+ - produktions-overførsel-20240220/unipump.transaction.error-20240320
77
+ - sig/timepump.rbs
78
+ - v_fakturalinie.sql
79
+ homepage:
80
+ licenses: []
81
+ metadata: {}
82
+ post_install_message:
83
+ rdoc_options: []
84
+ require_paths:
85
+ - lib
86
+ required_ruby_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ required_rubygems_version: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ requirements: []
97
+ rubygems_version: 3.3.7
98
+ signing_key:
99
+ specification_version: 4
100
+ summary: Pumps time registrations from DANAK to Uniconta
101
+ test_files: []