vesr 0.3.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,14 +6,10 @@ class EsrFile < ActiveRecord::Base
6
6
 
7
7
  def to_s(format = :default)
8
8
  case format
9
- when :short
10
- "#{updated_at.strftime('%d.%m.%Y')}: #{esr_records.count} Buchungen"
9
+ when :long
10
+ esr_records.map{|record| record.to_s}.join("\n")
11
11
  else
12
- s = ''
13
- esr_records.each {|record|
14
- s += record.to_s + "\n"
15
- }
16
- s
12
+ "#{updated_at.strftime('%d.%m.%Y')}: #{esr_records.count} Buchungen"
17
13
  end
18
14
  end
19
15
 
@@ -47,7 +47,7 @@ class EsrRecord < ActiveRecord::Base
47
47
  reference[19..-1].to_i
48
48
  end
49
49
 
50
- def patient_id
50
+ def customer_id
51
51
  reference[6..18].to_i
52
52
  end
53
53
 
@@ -98,7 +98,7 @@ class EsrRecord < ActiveRecord::Base
98
98
  if Invoice.exists?(invoice_id)
99
99
  self.invoice_id = invoice_id
100
100
  self.remarks += "Referenz #{reference}"
101
- if invoice.due_amount.currency_round != self.amount.currency_round
101
+ if invoice.balance.currency_round != self.amount.currency_round
102
102
  evaluate_bad
103
103
  self.state = "bad"
104
104
  else
@@ -107,7 +107,7 @@ class EsrRecord < ActiveRecord::Base
107
107
  elsif Invoice.column_names.include?(:imported_esr_reference) && imported_invoice = Invoice.find(:first, :conditions => ["imported_esr_reference LIKE concat(?, '%')", reference])
108
108
  self.invoice = imported_invoice
109
109
  self.remarks += "Referenz #{reference}"
110
- if invoice.due_amount.currency_round != self.amount.currency_round
110
+ if invoice.balance.currency_round != self.amount.currency_round
111
111
  self.remarks += ", falscher Betrag"
112
112
  self.state = "bad"
113
113
  else
@@ -9,9 +9,9 @@
9
9
 
10
10
  - for esr_record in list_records
11
11
  %tr
12
- %td= h esr_record.value_date
13
- %td= link_to esr_record.invoice.patient.to_s, esr_record.invoice if esr_record.invoice
12
+ %td= esr_record.value_date
13
+ %td= link_to esr_record.invoice.customer.to_s, esr_record.invoice.customer if esr_record.invoice
14
14
  %td= esr_record.invoice ? link_to(esr_record.remarks, esr_record.invoice) : esr_record.remarks
15
15
  %td.currency= currency_fmt(esr_record.invoice.amount.currency_round) if esr_record.invoice
16
16
  %td.currency= currency_fmt(esr_record.amount.currency_round)
17
- %td.currency= currency_fmt(esr_record.invoice.due_amount.currency_round) if esr_record.invoice
17
+ %td.currency= currency_fmt(esr_record.invoice.balance.currency_round) if esr_record.invoice
@@ -24,8 +24,8 @@ module Prawn
24
24
  vcard = sender.vcard
25
25
  text vcard.full_name
26
26
  text vcard.extended_address if vcard.extended_address.present?
27
- text vcard.street_address
28
- text vcard.postal_code + " " + vcard.locality
27
+ text vcard.street_address if vcard.street_address
28
+ text vcard.postal_code + " " + vcard.locality if vcard.postal_code and vcard.locality
29
29
 
30
30
  move_down cm2pt(0.8)
31
31
  indent cm2pt(2.3) do
@@ -54,9 +54,9 @@ module Prawn
54
54
 
55
55
  vcard = invoice.customer.vcard
56
56
  text vcard.full_name
57
- text vcard.extended_address if vcard.extended_address.present?
58
- text vcard.street_address
59
- text vcard.postal_code + " " + vcard.locality
57
+ text vcard.extended_address if vcard.extended_address
58
+ text vcard.street_address if vcard.street_address
59
+ text vcard.postal_code + " " + vcard.locality if vcard.postal_code and vcard.locality
60
60
  end
61
61
 
62
62
  bounding_box [cm2pt(6), cm2pt(8.8)], :width => cm2pt(5) do
@@ -70,8 +70,8 @@ module Prawn
70
70
  vcard = sender.vcard
71
71
  text vcard.full_name
72
72
  text vcard.extended_address if vcard.extended_address.present?
73
- text vcard.street_address
74
- text vcard.postal_code + " " + vcard.locality
73
+ text vcard.street_address if vcard.street_address
74
+ text vcard.postal_code + " " + vcard.locality if vcard.postal_code and vcard.locality
75
75
 
76
76
  move_down cm2pt(0.8)
77
77
  indent cm2pt(2.6) do
@@ -102,8 +102,8 @@ module Prawn
102
102
  text vcard.honorific_prefix if vcard.honorific_prefix
103
103
  text vcard.full_name
104
104
  text vcard.extended_address if vcard.extended_address.present?
105
- text vcard.street_address
106
- text vcard.postal_code + " " + vcard.locality
105
+ text vcard.street_address if vcard.street_address
106
+ text vcard.postal_code + " " + vcard.locality if vcard.postal_code and vcard.locality
107
107
  end
108
108
 
109
109
  # ESR-Reference
@@ -1,3 +1,3 @@
1
1
  module Vesr
2
- VERSION = "0.3.1"
2
+ VERSION = "0.4.0"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vesr
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 3
9
- - 1
10
- version: 0.3.1
8
+ - 4
9
+ - 0
10
+ version: 0.4.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Roman Simecek