Skip to content

Commit

Permalink
(#420) Nicer log entries for price changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ngiger committed Feb 9, 2024
1 parent 961851b commit 6e4739b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/plugin/bsv_xml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -354,14 +354,14 @@ def tag_end name
## don't take the Swissmedic-Category unless it's missing in the DB
@data.delete :ikscat if @pack.ikscat
if @pack.price_exfactory.nil? || !@price_exfactory.amount.to_s.eql?(@pack.price_exfactory.amount.to_s) || !@price_change_code.eql?(@pack.price_exfactory.mutation_code)
LogFile.debug "tag_end_set price_exfactory #{@price_exfactory} for @pack.price_exfactor '#{@pack.price_exfactory}' #{@pack.price_exfactory&.mutation_code} now #{@price_change_code}"
LogFile.debug "#{@iksnr} #{@ikscd} set price_exfactory #{@pack.price_exfactory} now #{@price_exfactory} #{@pack.price_exfactory&.mutation_code} now #{@price_change_code}"
@pack.price_exfactory = @price_exfactory
@pack.price_exfactory.mutation_code = @price_exfactory.mutation_code
@pack.price_exfactory.valid_from = @price_exfactory.valid_from
@data.store :price_exfactory, @price_exfactory
end if @price_exfactory
if @pack.price_public.nil? || !@price_public.amount.to_s.eql?(@pack.price_public.amount.to_s) || !@price_change_code.eql?(@pack.price_public.mutation_code)
LogFile.debug "tag_end price_public #{@price_public} for @pack.price_exfactor '#{@pack.price_public}' #{@pack.price_public&.mutation_code} now #{@price_change_code}"
LogFile.debug "#{@iksnr} #{@ikscd} set price_public #{@pack.price_public} now #{@price_public} now #{@pack.price_public&.mutation_code} now #{@price_change_code}"
@pack.price_public = @price_public
@pack.price_public.valid_from = @price_public.valid_from
@pack.price_public.mutation_code = @price_public.mutation_code
Expand Down
1 change: 1 addition & 0 deletions test/test_plugin/bsv_xml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1616,6 +1616,7 @@ def test_nasonex_exfactory_price
@myPackage.price_exfactory = Util::Money.new(10, @price_type, 'CH')
@myPackage.price_exfactory.valid_from = Time.new(2022,1,31)
@myPackage.price_exfactory.origin = originUrl22
@myPackage.price_exfactory.mutation_code = '1JAHRS'
@myPackage.price_exfactory.type = "exfactory"

@myPackage.price_exfactory = Util::Money.new(10, @price_type, 'CH')
Expand Down

0 comments on commit 6e4739b

Please sign in to comment.