Still have a typo in my last try.
Error: NameError Message: undefined local variable or method `iksrn' for #<ODDB::SwissmedicPlugin:0x00564d0b6eac68> Did you mean? iksnr Backtrace: /var/www/oddb.org/src/plugin/swissmedic.rb:277:in `block (2 levels) in check_all_packages' /var/www/oddb.org/src/plugin/swissmedic.rb:275:in `each' /var/www/oddb.org/src/plugin/swissmedic.rb:275:in `block in check_all_packages' /var/www/oddb.org/src/plugin/swissmedic.rb:272:in `each' /var/www/oddb.org/src/plugin/swissmedic.rb:272:in `check_all_packages' /var/www/oddb.org/src/plugin/swissmedic.rb:396:in `update' /var/www/oddb.org/src/util/updater.rb:437:in `block in update_swissmedic' /var/www/oddb.org/src/util/updater.rb:542:in `wrap_update' /var/www/oddb.org/src/util/updater.rb:435:in `update_swissmedic' jobs/import_swissmedic_only:30:in `block in <module:Util>' /var/www/oddb.org/src/util/job.rb:40:in `run' jobs/import_swissmedic_only:12:in `<module:Util>' jobs/import_swissmedic_only:11:in `<module:ODDB>' jobs/import_swissmedic_only:10:in `<main>'
Dropped and reloaded database. Running import_swissmedic_only with checkes for all registrations and all packages.
Created a separate jobs, which does not send emails and has a hard coded limit. See commit Fix expired packages. But it look like that it will need around 15 hours go fix all problems. Here part of my log
2017-09-27 16:05:16 +0200 We must deactivate 2051 registrations #<ODDB::Registration:0x00556f369a8148> #<ODDB::Registration:0x00556f3a426018> 2017-09-27 16:05:16 +0200 :!registration,46466!sequence,01!package,012. 2017-09-27 16:06:35 +0200 :!registration,46466!sequence,01!package,020. 2017-09-27 16:06:36 +0200 :!registration,23062!sequence,01!package,011. 2017-09-27 16:07:13 +0200 :!registration,23062!sequence,01!package,046. 2017-09-27 16:07:50 +0200 :!registration,55485!sequence,01!package,020. 2017-09-27 16:08:03 +0200 :!registration,45119!sequence,01!package,017. 2017-09-27 16:08:41 +0200 :!registration,41322!sequence,01!package,020. 2017-09-27 16:09:18 +0200 :!registration,41322!sequence,02!package,047. 2017-09-27 16:09:55 +0200 :!registration,52300!sequence,01!package,010. 2017-09-27 16:09:56 +0200 :!registration,52300!sequence,01!package,029. 2017-09-27 16:09:57 +0200 :!registration,00526!sequence,01!package,001. 2017-09-27 16:09:58 +0200 :!registration,00526!sequence,01!package,002. 2017-09-27 16:09:59 +0200 :!registration,00526!sequence,01!package,003. 2017-09-27 16:10:00 +0200 :!registration,00526!sequence,01!package,004. 2017-09-27 16:10:01 +0200 :!registration,44633!sequence,01!package,019. 2017-09-27 16:10:11 +0200 :!registration,44633!sequence,01!package,027. 2017-09-27 16:10:21 +0200 :!registration,46469!sequence,01!package,038.
The following bugs must still be fixed
Bug 4 looks like a nice to have feature. Looking at the problems with the ending balance. e,g. bug 6 of Aug-20.
Bug 8 is fixed with commit Emit totals for each day. Released rapflag gem 1.0.5.
Working on Bug 6 revealed that in the spec test the test for the balance was partly wrong. But my changes are not always correct as sometimes I have only rounding differences like USD,2016.10.08,"",2.797999989168701e-05
!= USD,2016.10.08,"",2.798e-05
(old), but sometimes the balance is completely different,
eg USD,2016.09.30,"",-1.3544096128925015e-13
!= USD,2016.09.30,"",0.0
(old)
I am getting now better results with my reworked calculation of the daily balance, e.g
USD,2017.08.02,-3.57210655,2.5923707624997405e-13 USD,2017.08.03,"",2.5923707624997405e-13 USD,2017.08.04,"",2.5923707624997405e-13 USD,2017.08.05,"",2.0002062228741124e-08 USD,2017.08.06,"",0.0 USD,2017.08.07,"",0.0
But why do I get these rounding errors? Or must I trust the balance of the last entry? Yes. Just take the balance of the last entry of the same day
Fixed with commit Fix calculation of daily income/balance. This should fix bugs 3,5,6.
Released rapflag gem version 1.0.6