<< | Index | >>
Goal
Some users can see products but some users cannot see products
Experiment
Note
suspend
Example
Patch file
Result
Note
'ISO-8859-1'
Problem
Confirm
masa@masa ~/ywesee/bbmb.ch/log/mnemonic $ rm *.* masa@masa ~/ywesee/bbmb.ch/log/mnemonic $ cp ~/work/mnemonic_local_update_all_kund_bak/*.* .
masa@masa ~/ywesee/bbmb.ch $ bin/admin ch.bbmb.globopharm> replace_customer_ids_gag_to_alloga '/home/masa/work/new_data/actual_gag_ean_allo_user_ids.csv' -> 169
masa@masa ~/ywesee/bbmb.ch $ bin/admin ch.bbmb.globopharm> update
Resolved
Note
Problem
Solution
Scripts
Note
Experiment
users.filter('email@ywesee.com').values[0].value(:customer_id)
Experiment (src/util/bbmbapp.rb)
def overwrite_customer_ids_by_email(email_file = nil) return 'set the path to the new customer email file' unless email_file count = 0 File.readlines(email_file).each do |line| ids = line.chomp.split(/;/) alloga_id = ids[0] ean_code = ids[1] email = ids[2] if user = users.filter(email).values[0] updates = {:customer_id => alloga_id, :customer_ean13 => ean_code} save_user(user, updates, user.modifier) count += 1 end end count end
def replace_customer_ids_gag_to_alloga(map_file = nil) return 'set the path to the mapping file' unless map_file count = 0 File.readlines(map_file).each do |line| ids = line.chomp.split(/;/) gag_id = ids[0] ean_code = ids[1] alloga_id = ids[2]if users.filter(alloga_id).values.select{|u| !u.email.to_s.empty?}.empty? \
and (user = users.filter(gag_id).values[0] and user.value(:customer_id) == gag_id)
updates = {:customer_id => alloga_id, :customer_ean13 => ean_code} save_user(user, updates, user.modifier) count += 1 end end count end
Note (Key points)
Run
masa@masa ~/ywesee/bbmb.ch $ bin/admin ch.bbmb.globopharm> overwrite_customer_ids_by_email '/home/masa/work/new_data/new_customer_id_ean_email.dat' -> 27 ch.bbmb.globopharm> replace_customer_ids_gag_to_alloga '/home/masa/work/new_data/actual_gag_ean_allo_user_ids.csv' -> 123 ch.bbmb.globopharm> update ->
Result (Console Log)
BbmbApp::update - updating admin@ywesee.com update: update_stock update_stock done update: update_users update_users done
Problem
Run
masa@masa ~/ywesee/bbmb.ch/log/mnemonic $ rm *.* masa@masa ~/ywesee/bbmb.ch/log/mnemonic $ cp ~/work/mnemonic_local_update_all_kund_bak/*.* . masa@masa ~/ywesee/bbmb.ch/log/mnemonic $ cd ../.. masa@masa ~/ywesee/bbmb.ch $ bin/admin ch.bbmb.globopharm> overwrite_customer_ids_by_email '/home/masa/work/new_data/new_customer_id_ean_email.dat' -> 27 ch.bbmb.globopharm> replace_customer_ids_gag_to_alloga '/home/masa/work/new_data/actual_gag_ean_allo_user_ids.csv' -> 123 ch.bbmb.globopharm> replace_article_ids_gag_to_alloga '/home/masa/work/new_data/actual_gag_ean_allo_stock_ids.csv' -> 284 ch.bbmb.globopharm> update ->
Result
Note
Experiment (ywsbezber, ywskunbez)
masa@masa ~/ywesee/bbmb.ch $ bin/admin ch.bbmb.globopharm> overwrite_customer_ids_by_email '/home/masa/work/new_data/new_customer_id_ean_email.dat' -> 27 ch.bbmb.globopharm> replace_customer_ids_gag_to_alloga '/home/masa/work/new_data/actual_gag_ean_allo_user_ids.csv' -> 123 ch.bbmb.globopharm> replace_article_ids_gag_to_alloga '/home/masa/work/new_data/actual_gag_ean_allo_stock_ids.csv' -> 284 ch.bbmb.globopharm> update ->
Result (Console log)
BbmbApp::update - updating admin@ywesee.com update: update_stock update_stock done update: update_users update_users done update: update_group_access update_group_access done
Result
Note (Key point)
"Apo";"INDIV";"";yes