oddb2tdat 1.0.1 → 1.0.2

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 (3) hide show
  1. data/History.txt +6 -2
  2. data/lib/oddb2tdat.rb +27 -5
  3. metadata +4 -4
data/History.txt CHANGED
@@ -1,7 +1,11 @@
1
- === 1.0.1 / 09.01.2011
1
+ === 1.0.2 / 11.01.2012
2
+
3
+ * Updated Publikumspreis and Kassenzulässigkeit format
4
+
5
+ === 1.0.1 / 09.01.2012
2
6
 
3
7
  * Added Packungsgrösse after Artikelbezeichnung.
4
8
 
5
- === 1.0.0 / 05.01.2011
9
+ === 1.0.0 / 05.01.2012
6
10
 
7
11
  * oddb2tdat Version 1.0.0 released
data/lib/oddb2tdat.rb CHANGED
@@ -9,7 +9,10 @@
9
9
  04 ABEZ Artikelbezeichnung 011 – 060 50 alpha: Präparate (H,K)
10
10
  05 PRMO Arztpreis (=Galexis-Basis-Preis) 061 – 066 6 num: NIL
11
11
  06 PRPU Publikumspreis (inkl. MWSt) 067 – 072 6 num: PP (N)
12
- 07 CKZL Kassenzulässigkeit 073 – 073 1 num: (Q)
12
+ 07 CKZL Kassenzulässigkeit 073 – 073 1 num: (Q,V)
13
+ 1 = SL (Q)
14
+ 2 = LPPV (V)
15
+ 3 = hors list (No SL, should be 3 not 0)
13
16
  08 CLAG Lagerart 074 – 074 1 num: NIL
14
17
  09 CBGG Betäubung - Gift 075 – 075 1 num: (AI)
15
18
  10 CIKS Swissmedic-Listencode 076 – 076 1 alpha: (P)
@@ -18,13 +21,14 @@
18
21
  =end
19
22
 
20
23
  class Oddb2tdat
21
- VERSION = '1.0.1'
24
+ VERSION = '1.0.2'
22
25
  COL = {
23
26
  :CMUT => 30, # AE
24
27
  :PHAR => 6, # G
25
28
  :ABEZ => 7, # H
26
29
  :PRPU => 13, # N
27
- :CKZL => 16, # Q
30
+ :CKZL1 => 16, # Q
31
+ :CKZL2 => 21, # V
28
32
  :CBGG => 34, # AI
29
33
  :CIKS => 15, # P
30
34
  :ITHE => 33, # AH
@@ -66,8 +70,26 @@ class Oddb2tdat
66
70
  row << "%0#{LEN[:PHAR]}d" % cols[COL[:PHAR]].to_i
67
71
  row << "%-#{LEN[:ABEZ]}s" % (cols[COL[:ABEZ]].to_s + " " + cols[COL[:PACK]]).to_s[0,LEN[:ABEZ]]
68
72
  row << "%0#{LEN[:PRMO]}d" % 0
69
- row << "%#{LEN[:PRPU]}s" % cols[COL[:PRPU]].to_s[0,LEN[:PRPU]]
70
- row << "%#{LEN[:CKZL]}s" % (cols[COL[:CKZL]] =~ /Ja/ ? 1:0)
73
+ prpu = cols[COL[:PRPU]].to_s.split('.')
74
+ pre = "%04d" % prpu[0] if prpu[0]
75
+ las = if prpu[1]
76
+ if prpu[1].size < 2
77
+ prpu[1] + "0"*(2-prpu.last.size)
78
+ else
79
+ prpu[1][0,2]
80
+ end
81
+ else
82
+ '00'
83
+ end
84
+ prpu = pre.to_s + las.to_s
85
+ row << "%#{LEN[:PRPU]}s" % prpu
86
+ row << "%#{LEN[:CKZL]}s" % if cols[COL[:CKZL1]] =~ /Ja/
87
+ 1
88
+ elsif cols[COL[:CKZL2]] =~ /Ja/
89
+ 2
90
+ else
91
+ 3
92
+ end
71
93
  row << "%#{LEN[:CLAG]}s" % 0
72
94
  row << "%#{LEN[:CBGG]}s" % (cols[COL[:CBGG]] =~ /Ja/ ? 1:0)
73
95
  row << "%#{LEN[:CIKS]}s" % cols[COL[:CIKS]]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oddb2tdat
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 1
10
- version: 1.0.1
9
+ - 2
10
+ version: 1.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Masaomi Hatakeyama, Zeno R.R. Davatz
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-01-09 00:00:00 +01:00
18
+ date: 2012-01-11 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency