diff --git a/doc/resources/gag/logo.gif b/doc/resources/gag/logo.gif index acd462f..32060c9 100644 Binary files a/doc/resources/gag/logo.gif and b/doc/resources/gag/logo.gif differ diff --git a/src/custom/behavior.rb b/src/custom/behavior.rb index 7a3e7fb..c5fbb45 100644 --- a/src/custom/behavior.rb +++ b/src/custom/behavior.rb @@ -27,7 +27,8 @@ module BBMB DELIMITER = ';' EXPORTS = [] PRODUCT_KEY = :article_number - SEARCHABLE = [:article_descr, :supplier_name] + #SEARCHABLE = [:article_descr, :supplier_name] + SEARCHABLE = [:article_descr, :company_name] UPDATES = [] def initialize(reseller) @reseller = reseller @@ -121,23 +122,54 @@ module BBMB EPIN = '7601001000681' UPDATES = [ :update_stock, - :update_suppliers, + #:update_suppliers, :update_users, - :update_user_access, - :update_group_access, - :update_user_article_prices, - :update_user_article_discounts, - :update_user_group_discounts, - :update_user_volume_prices, - :update_stock_atc, - :update_sl, - :update_atc_classes, - :update_fachinfos, + #:update_user_access, + #:update_group_access, + #:update_user_article_prices, + #:update_user_article_discounts, + #:update_user_group_discounts, + #:update_user_volume_prices, + #:update_stock_atc, + #:update_sl, + #:update_atc_classes, + #:update_fachinfos, ] EXPORTS = [ :export_galdat, ] ARTICLE_MAP = { +# 0 => :article_status, + 1 => :article_number, + 2 => :article_ean13, + 3 => :article_descr, + + #4 => :article_bsize, + 7 => :company_name, + 8 => :article_price, + #14 => :article_mwst, + #18 => :article_main_group, + #19 => :article_group, + #25 => :access_list, + #26 => :supplier_id, + #27 => :article_pcode, + #28 => :article_l3_q1, # Preisliste 3, Stück 1 + #29 => :article_l3_p1, # Preisliste 3, Preis 1 + #30 => :article_l3_q2, # Preisliste 3, Stück 2 + #31 => :article_l3_p2, # Preisliste 3, Preis 2 + #32 => :article_l3_q3, # Preisliste 3, Stück 3 + #33 => :article_l3_p3, # Preisliste 3, Preis 3 + #34 => :article_l3_q4, # Preisliste 3, Stück 4 + #35 => :article_l3_p4, # Preisliste 3, Preis 4 + #36 => :article_l3_q5, # Preisliste 3, Stück 5 + #37 => :article_l3_p5, # Preisliste 3, Preis 5 + #38 => :article_l3_q6, # Preisliste 3, Stück 6 + #39 => :article_l3_p6, # Preisliste 3, Preis 6 + #40 => :article_index, # Partner-Index + #41 => :article_backorder, # Rückstand-Flag + } +=begin + ARTICLE_MAP = { 0 => :article_status, 1 => :article_number, 2 => :article_ean13, @@ -165,6 +197,7 @@ module BBMB 40 => :article_index, # Partner-Index 41 => :article_backorder, # Rückstand-Flag } +=end ARTICLE_NUMERIC = [ :article_number, :article_bsize, @@ -192,19 +225,23 @@ module BBMB #MAIL_PDF_RECIPIENTS_CC = ['zdavatz@gmail.com'] REMOTE_ACCESS = nil REMOTE_DIRS = { - :transmit_order => '/Spital/In', - :update => '/YWESEE/Out', + #:transmit_order => '/Spital/In', + :transmit_order => '/IN/CustomerOrder', + #:update => '/YWESEE/Out', + :update => '/OUT', } REMOTE_FILES = { - :group_access => 'ywsbezber', - :users => 'ywskund', - :user_access => 'ywskunbez', - :stock => 'ywsarti', - :suppliers => 'ywslieferant', - :user_article_prices => 'ywskdsop', - :user_article_discounts => 'ywskdsor', - :user_group_discounts => 'ywskdrab', - :user_volume_prices => 'ywskdabs', + #:group_access => 'ywsbezber', + #:users => 'ywskund', + :users => 'Customers.csv', + #:user_access => 'ywskunbez', + #:stock => 'ywsarti', + :stock => 'Items.csv', + #:suppliers => 'ywslieferant', + #:user_article_prices => 'ywskdsop', + #:user_article_discounts => 'ywskdsor', + #:user_group_discounts => 'ywskdrab', + #:user_volume_prices => 'ywskdabs', } SUPPLIER_MAP = { 0 => :supplier_id, @@ -243,6 +280,20 @@ module BBMB } USER_MAP = { 0 => :customer_id, + 1 => :customer_ean13, + 2 => :group_short, + 3 => :organisation, + 4 => :drtitle, + 5 => :address1, + 7 => :plz, + 8 => :location, + 9 => :phone_business, + 10 => :fax, + 11 => :email, + } +=begin + USER_MAP = { + 0 => :customer_id, 1 => :access_group, 3 => :group_short, 4 => :drtitle, @@ -259,6 +310,7 @@ module BBMB 16 => :email, 17 => :customer_ean13, } +=end USER_ACCESS_MAP = { 0 => :access_group, 1 => :access_list, @@ -574,6 +626,7 @@ Failed Products: access unless access.empty? end def update_stock +p "update_stock in behavior" stock = [] map = {} update_values(:stock, ARTICLE_MAP, 1) { |values| diff --git a/src/custom/lookandfeelbase.rb b/src/custom/lookandfeelbase.rb index 39b8e6f..3cc3f06 100644 --- a/src/custom/lookandfeelbase.rb +++ b/src/custom/lookandfeelbase.rb @@ -27,7 +27,7 @@ module BBMB :astrazeneca => "AstraZeneca-Kunde", :backorder_comment0 => "Rückstand/Lieferfrist für ", :backorder_comment1 => " - bitte geben Sie eine Lieferfrist und eventuelle weitere Informationen an.", - :backorders => "Rückstände", + :backorders => "R?ckst?nde", :barcode_button => "Barcode-Leser", :barcode_empty => "Es sind keine Barcodes im Leser.", :barcode_none => "Es konnte keine Verbindung zum Barcode-Leser hergestellt werden.", @@ -71,7 +71,7 @@ module BBMB :explain_fi => "Fi = Fachinformation", :explain_li => "! = Limitiatio", :explain_ddd => "DDD = WHO-Daily Drug Dose", - :export => "Rückstände als Excel-File", + :export => "R?ckst?nde als Excel-File", :e_duplicate_email0 => "Die Email-Adresse '", :e_duplicate_email1 => "' wird bereits für ein anderes Benutzerprofil verwendet", :e_empty_pass => "Das Passwort war leer.", @@ -79,7 +79,7 @@ module BBMB :e_user_unsaved => "Das Benutzerprofil wurde nicht gespeichert!", :e_invalid_date0 => "'", :e_invalid_date1 => "' ist kein gültiges Datum.", - :e_mutex_date_priority => "Datum und Priorität können nicht gleichzeitig angegeben werden.", + :e_mutex_date_priority => "Datum und Priorit?t k?nnen nicht gleichzeitig angegeben werden.", :fachinfo_name0 => 'Fachinformationen zu ', :fachinfo_name1 => ':', :fachinfo_short => "Fi", @@ -162,7 +162,7 @@ module BBMB :plz => "PLZ", :"plz-location" => "PLZ/Ort", :position_total => "Total", - :price_hiding => "Preisunterdrückung", + :price_hiding => "Preisunterdr?ckung", :price_range0 => "", :price_range1 => " bis ", :price_range2 => "", @@ -194,7 +194,8 @@ module BBMB :subadmin_key => "Bereichsklasse", :subadmins => "Administratoren", :subadmin_value => "Bereich", - :supplier_name => "Lieferant", + #:supplier_name => "Lieferant", + :company_name => "Lieferant", :suppliers => "Partnerfirmen", :text => "Text", :th_active => "Aktiviert", @@ -231,7 +232,8 @@ module BBMB :th_size_title => "Anzahl Packungen", :th_show_free => "Produkt anzeigen", :th_supplier_id => "i/2-ID", - :th_supplier_name => "Lieferant", + #:th_supplier_name => "Lieferant", + :th_company_name => "Lieferant", :th_text => "Text", :title => "Titel", :turnaround => "Umsatz", diff --git a/src/custom/lookandfeelgag.rb b/src/custom/lookandfeelgag.rb index 583df08..67aa491 100644 --- a/src/custom/lookandfeelgag.rb +++ b/src/custom/lookandfeelgag.rb @@ -7,10 +7,12 @@ module BBMB class LookandfeelGag < SBSM::LookandfeelWrapper DICTIONARIES = { "de" => { - :new_customer_mail => "mailto:stammdaten@alloga.ch?subject=Neukunde BBMB - bitte Passwort generieren&", - :partner => "Alloga", - :welcome => "Willkommen bei Alloga", - + #:new_customer_mail => "mailto:it@globopharm.com?subject=Neukunde BBMB - bitte Passwort generieren&", + #:partner => "Globopharm AG", + #:welcome => "Willkommen bei Globopharm", + :new_customer_mail => "mailto:mhatakeyama@ywesee.com?subject=Neukunde BBMB - bitte Passwort generieren&", + :partner => "Masapharm AG", + :welcome => "Willkommen bei Masapharm", } } ENABLED = [ diff --git a/src/model/reseller.rb b/src/model/reseller.rb index 8bd23c6..401562e 100644 --- a/src/model/reseller.rb +++ b/src/model/reseller.rb @@ -222,6 +222,11 @@ module BBMB stock.adjust(product_key, searchable) stock.update_products(values) end + def update_products2(values) + stock.adjust(product_key, searchable) + stock.update_products2(values) + end + def users hospitals end diff --git a/src/model/stock.rb b/src/model/stock.rb index eafa623..ecc010e 100644 --- a/src/model/stock.rb +++ b/src/model/stock.rb @@ -27,6 +27,9 @@ module BBMB def article_descr @attributes[:article_descr] end + def company_name + @attributes[:company_name] + end def article_efordocprice if(@attributes[:access_list] == 'VETOQU') list3_price(1) @@ -287,5 +290,21 @@ module BBMB end } if values end + def update_products2(values) + #p values + values.each { |value| + key = value[:old_uid] + product = @products[key] + #value.delete(:uid) + product.update(value) + begin + @products.store(product.uid, product) + @products.delete(key) + rescue MissingDataException + @errors << product + end + } if values + end + end end diff --git a/src/transactions/stock.rb b/src/transactions/stock.rb index 7a3225c..21fbd34 100644 --- a/src/transactions/stock.rb +++ b/src/transactions/stock.rb @@ -11,3 +11,13 @@ class UpdateStockCommand reseller.update_products(@values) end end +class UpdateStockCommand2 + def initialize(gid, values) + @values = values + @gid = gid + end + def execute(app) + reseller = app.resellers[@gid] + reseller.update_products2(@values) + end +end diff --git a/src/util/bbmbapp.rb b/src/util/bbmbapp.rb index 9098f02..097cfd6 100644 --- a/src/util/bbmbapp.rb +++ b/src/util/bbmbapp.rb @@ -653,6 +653,7 @@ class BbmbApp < SBSM::DRbServer #SimpleDelegator end def update_stock(gid, updates) @prevalence.executeTransaction(BBMB::Transaction.new(UpdateStockCommand.new(gid, updates))) + #@prevalence.executeTransaction(BBMB::Transaction.new(UpdateStockCommand2.new(gid, updates))) end def update_users(gid, updates) admin = resellers[gid].admin @@ -688,6 +689,43 @@ class BbmbApp < SBSM::DRbServer #SimpleDelegator end file_path end + def replace_customer_ids_gag_to_alloga(map_file = nil) + unless map_file + return 'set the path to the mapping file' + end + 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 user = users.filter(gag_id).values[0] and alloga_id + updates = {:customer_id => alloga_id, :customer_ean13 => ean_code} + save_user(user, updates, user.modifier) + count += 1 + end + end + count + end + def replace_article_ids_gag_to_alloga(map_file = nil, reseller_gid = '1') + unless map_file + return 'set the path to the mapping file' + end + 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 resellers[reseller_gid].product(gag_id) and alloga_id + updates = [{:old_uid => gag_id, :uid => alloga_id, :article_number => alloga_id, :article_ean13 => ean_code}] + update_stock(reseller_gid, updates) + count += 1 + end + end + count + end + =begin def [](key) @mutex.synchronize { diff --git a/src/util/filehandler.rb b/src/util/filehandler.rb index c8236d1..935fc48 100644 --- a/src/util/filehandler.rb +++ b/src/util/filehandler.rb @@ -89,7 +89,9 @@ module BBMB if WRITABLE_MODES.include?(mode) && fileHandler.size > 0 path = @access["path"] - transfer = path.sub('/In/', '/Temp/') +p path + transfer = path.sub('/IN/CustomerOrder/', '/IN/Temp/') +p transfer ftpTransaction(@access) do |ftp| puts "ftp.puttextfile(#{@tmp.path}, #{transfer})" ftp.puttextfile(@tmp.path, transfer) diff --git a/src/util/session.rb b/src/util/session.rb index 861fc25..57108b2 100644 --- a/src/util/session.rb +++ b/src/util/session.rb @@ -66,7 +66,8 @@ module BBMB end end def http_protocol - 'https' + #'https' + 'http' end def news @app.news(flavor) diff --git a/src/view/backorders.rb b/src/view/backorders.rb index ce5193c..27a3633 100644 --- a/src/view/backorders.rb +++ b/src/view/backorders.rb @@ -26,7 +26,8 @@ module BBMB [0,0] => :article_descr, [1,0] => :estimated_delivery, [2,0] => :text, - [3,0] => :supplier_name, + #[3,0] => :supplier_name, + [3,0] => :company_name, } CSS_MAP = { [0,0] => "list-big", @@ -37,7 +38,8 @@ module BBMB [0,0] => "list-big", } SYMBOL_MAP = { - :supplier_name => Value, + #:supplier_name => Value, + :company_name => Value, } def article_descr(model) str = model.value(:article_descr) diff --git a/src/view/producthistory.rb b/src/view/producthistory.rb index 79753ff..946ec11 100644 --- a/src/view/producthistory.rb +++ b/src/view/producthistory.rb @@ -10,7 +10,8 @@ module BBMB [0,0] => :order_count, [1,0] => :size, [2,0] => :article_descr, - [3,0] => :supplier_name, + #[3,0] => :supplier_name, + [3,0] => :company_name, [4,0] => :article_efordocprice, [5,0] => :position_total, } diff --git a/src/view/products.rb b/src/view/products.rb index 38f741d..7e3bbff 100644 --- a/src/view/products.rb +++ b/src/view/products.rb @@ -21,7 +21,8 @@ module BBMB [0,0] => :delete_item, #DeleteItem, [1,0] => :size, [2,0] => :article_descr, - [3,0] => :supplier_name, + #[3,0] => :supplier_name, + [3,0] => :company_name, [4,0] => :article_efordocprice, [5,0] => :position_total, [6,0] => :fachinfo, @@ -57,7 +58,8 @@ module BBMB SYMBOL_MAP = { :article_number => Value, :article_index => Value, - :supplier_name => Value, + #:supplier_name => Value, + :company_name => Value, } LIST_LENGTH = nil POSITION_MODIFIER = "search" @@ -128,7 +130,8 @@ module BBMB [3,0] => :article_index, [4,0] => :article_descr, [5,0] => :article_backorder, - [6,0] => :supplier_name, + #[6,0] => :supplier_name, + [6,0] => :company_name, [7,0] => :article_efordocprice, [8,0] => :position_total, [9,0] => :fachinfo, diff --git a/src/view/result.rb b/src/view/result.rb index e3c0671..29222ce 100644 --- a/src/view/result.rb +++ b/src/view/result.rb @@ -18,7 +18,8 @@ module BBMB COMPONENTS = { [0,0] => :size, [1,0] => :article_descr, - [2,0] => :supplier_name, + #[2,0] => :supplier_name, + [2,0] => :company_name, [3,0] => :article_efordocprice, [4,0] => :fachinfo, [5,0] => :limitation, @@ -42,7 +43,8 @@ module BBMB :article_number => Value, :article_descr => Value, :article_index => Value, - :supplier_name => Value, + #:supplier_name => Value, + :company_name => Value, } def article_efordocprice(model) currency_value(model, :article_efordocprice) @@ -80,7 +82,8 @@ module BBMB [2,0] => :article_index, [3,0] => :article_descr, [4,0] => :article_backorder, - [5,0] => :supplier_name, + #[5,0] => :supplier_name, + [5,0] => :company_name, [6,0] => :article_efordocprice, [7,0] => :fachinfo, [8,0] => :limitation, diff --git a/src/view/supplier.rb b/src/view/supplier.rb index 9682414..89c553f 100644 --- a/src/view/supplier.rb +++ b/src/view/supplier.rb @@ -41,14 +41,16 @@ module BBMB include CompositeCompat CSS_CLASS = 'composite' COMPONENTS = { - [0,0] => :supplier_name, + #[0,0] => :supplier_name, + [0,0] => :company_name, [0,1] => :supplier_form, } CSS_MAP = { [0,0] => 'th', } SYMBOL_MAP = { - :supplier_name => HtmlGrid::Value, + #:supplier_name => HtmlGrid::Value, + :company_name => HtmlGrid::Value, } def supplier_form(model) SupplierForm.new(model.user, @session, self)