<< Masa.20101229-update-ydim | 2010 | Masa.20101227-setup-ydim >>
Setup script Attach:setup.ydim.sh.txt
$ sh setup.ydim.sh
Run ydimd, ydim-htmld
masa@masa ~/ywesee/ydim $ ruby -I lib bin/ydimd config="ydimd.yml" NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "object_pkey" for table "object" NOTICE: CREATE TABLE / UNIQUE will create implicit index "object_name_key" for table "object" NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "object_connection_pkey" for table "object_connection" NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "collection_pkey" for table "collection" I, [2010-12-28T08:36:40.715319 #3472] INFO -- start: starting ydim-server on druby://localhost:12375
masa@masa ~/ywesee/ydim $ ruby -I lib bin/ydim-htmld config="ydim-htmld.yml" ./lib/ydim/html/view/htmlgrid.rb:17: warning: already initialized constant HTTP_HEADERS ./lib/ydim/html/view/htmlgrid.rb:80: warning: already initialized constant STRIPED_BG ./lib/ydim/html.rb:3: warning: already initialized constant VERSION
Access http://masa.ydim.com/
Result
Bug
[Login] -> [Neuer Kunde]
[speichern] -> [Neue Rechnung]
[speichern] -> [Neue Position]
D, [2010-12-28T08:48:55.290821 #3585] DEBUG -- druby://localhost:12376: attempting login I, [2010-12-28T08:48:55.291785 #3585] INFO -- root: login D, [2010-12-28T08:48:55.292231 #3585] DEBUG -- root: add_items(10003, Array[1], invoice) D, [2010-12-28T08:48:55.292273 #3585] DEBUG -- root: invoice 10003 E, [2010-12-28T08:48:55.292784 #3585] ERROR -- root: invalid invoice_id: 10003 I, [2010-12-28T08:48:55.293214 #3585] INFO -- root: logout
[Rechnungen] -> [ID]
error in SBSM::Session#process: /de/invoice/unique_id/10003 IndexError invalid invoice_id: 10003 (druby://localhost:12375) ./lib/ydim/root_session.rb:114:in `invoice' ./lib/ydim/client.rb:26:in `send' ./lib/ydim/client.rb:26:in `method_missing' ./lib/ydim/html/util/server.rb:28:in `send' ./lib/ydim/html/util/server.rb:28:in `method_missing'
grep
masa@masa ~/ywesee/ydim $ grep -r "invalid invoice_id" * lib/ydim/root_session.rb: msg = "invalid invoice_id: #{invoice_id}" lib/ydim/root_session.rb: msg = "invalid invoice_id: #{invoice_id}"
lib/ydim/root_session.rb#invoice
def invoice(invoice_id) @serv.logger.debug(whoami) { "invoice #{invoice_id}" } Invoice.find_by_unique_id(invoice_id.to_s) \ #<= HERE or begin msg = "invalid invoice_id: #{invoice_id}" @serv.logger.error(whoami) { msg } raise IndexError, msg end end
Note
Check raw data in the database (ydim)
ydim=# \d Liste der Relationen Schema | Name | Typ | Eigentümer --------+----------------------------+-------+------------ public | collection | table | ydim public | object | table | ydim public | object_connection | table | ydim public | ydim_autoinvoice_unique_id | table | ydim public | ydim_debitor_email | table | ydim public | ydim_debitor_name | table | ydim public | ydim_debitor_unique_id | table | ydim public | ydim_invoice_status | table | ydim public | ydim_invoice_unique_id | table | ydim (9 Zeilen) ydim=# select * from ydim_invoice_unique_id; origin_id | unique_id | target_id -----------+-----------+----------- 17 | 10000 | 17 (1 Zeile)
Note
Work
diff dumps
masa@masa ~/work $ diff ydim_dump.1 ydim_dump.2 152a153 > 15 04086900 > 15 \N f Array 163a166 > 16 \N f Array 164a168 > 14 \N f YDIM::Debitor 171a176,178 > 12 currency_converter f YDIM::CurrencyConverter > 13 id_server f ODBA::IdServer > 17 \N f YDIM::Invoice 189a197,200 > 14 15 > 14 16 > 15 17 > 17 14 205a217 > 14 mhatakeyama@ywesee.com 14 213a226 > 14 masapotheke 14 221a235 > 14 1 14 229a244 > 17 is_open 17 237a253 > 17 10000 17
diff dumps
masa@masa ~/work $ diff ydim_dump.3 ydim_dump.4 2119a2120 > 2688 04086900 < 4 id_server fODBA::IdServer 3198a3199 > 4 id_server fODBA::IdServer 4522a4524,4527 > 2689 \N f Array > 2687 \N f YDIM::Debitor > 2688 \N f Array > 2690 \N f YDIM::Invoice 8593a8599,8602 > 2687 2688 > 2687 2689 > 2688 2690 > 2690 2687 8926a8936 > 2687 mhatakeyama@ywesee.com 2687 9113a9124 > 2687 masapotheke 2687 9399a9411 > 2687 283 2687 10916a10929 > 2690 is_open 2690 12433a12447 > 2690 11562 2690
Note
Question
BraSt
Next
~/ywesee/ydim $ sudo -u postgres dropdb ydim ~/ywesee/ydim $ sudo -u postgres createdb -E UTF8 -T template0 ydim ~/ywesee/ydim $ ruby -I lib bin/ydimd config="ydimd.yml" ~/ywesee/ydim $ pg_dump ydim > failure_case.sql
Notes
How to initialize the database (ydim)
Note
MwSt.(vat_rate) is 8.0%
but the description is 7.6% (This should be updated)
Change vat_rate
module YDIM class Server ydim_default_dir = File.join(ENV['HOME'], '.ydim') default_config_files = [ File.join(ydim_default_dir, 'ydimd.yml'), '/etc/ydim/ydimd.yml', ] defaults = { ... #'vat_rate' => 8.0, 'vat_rate' => 10.0, }
Reboot
masa@masa ~/ywesee/ydim $ ruby -I lib bin/ydimd config="ydimd.yml" masa@masa ~/ywesee/ydim $ ruby -I lib bin/ydim-htmld config="ydim-htmld.yml"
Access http://masa.ydim.com
Neue Rechnung
Check MwSt (neue Rechnung)
MwSt (alt Rechnung)
Notes
Exeriment (before 'offen' what happens?)
Change vat_rate again
module YDIM class Server ydim_default_dir = File.join(ENV['HOME'], '.ydim') default_config_files = [ File.join(ydim_default_dir, 'ydimd.yml'), '/etc/ydim/ydimd.yml', ] defaults = { ... #'vat_rate' => 8.0, 'vat_rate' => 20.0, }
Access http://masa.ydim.com
Result
Conclusion
lib/ydim/html/util/lookandfeel.rb
#:vat => 'MwSt. (7.6%)', :vat => 'MwSt. (8.0%)',
Check the result
Note
Question