magelex 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3d3dcd100c3a4c73c1e885c3e512704d4e21d1ba
4
- data.tar.gz: da8ac0c3a739e5a8c05c361a52bd9260f4619c32
3
+ metadata.gz: 9375788e021f187ddbad0f169654145ff6d28f7c
4
+ data.tar.gz: 1a04c859ed76349806144ab41bb2541af91ee187
5
5
  SHA512:
6
- metadata.gz: 19cf4f8f959f1ee4c13cdb19c0ea37f456314a75050d442a3ee148458fa78213912302c54aedb4c44170259af13e69a507d734b805db81d6e006e17b84d559bb
7
- data.tar.gz: e0113ad7243563e6dc4e55a67e7f8ebe682498a0f1339dcc466ae17a89410a8666e642b744f049ec12c5085e933c4230676fffcce1c5958050f4fad69ec65db2
6
+ metadata.gz: c166ff52c6a1cb1a17c3e4b24821e3250c26cd5da42a8fe9ac5f359d3aa81ee4e508ac1ea399c84709133b102604783945c86862f9ae84f4ca325fb45b30abb5
7
+ data.tar.gz: 687c4a026691875b1ce9d9506777b91884b49f7509bfa8ca990e6e6352e52c6d0f5195e35157643e01bedcc6a5b793d0b1800ce666a1f5c0aebbc9a3054fd15d
data/bin/magelex CHANGED
@@ -65,7 +65,8 @@ def main options
65
65
  Magelex.logger.info("Skip order #{bill.order_nr} "\
66
66
  "(totals do not match #{bill.total} != "\
67
67
  "(0: #{bill.total_0} + 7: #{bill.total_7} "\
68
- "+ 19: #{bill.total_19})")
68
+ "+ 19: #{bill.total_19} "\
69
+ "= #{bill.total_0 + bill.total_7 + bill.total_19})")
69
70
  else
70
71
  Magelex.logger.debug("Handle #{bill.order_nr}")
71
72
  bills_export << bill
@@ -3,20 +3,20 @@ require 'mysql2'
3
3
  module Magelex
4
4
  module MagentoMYSQL
5
5
  def self.update_dates mysqlconf, bills
6
- @client = Mysql2::Client.new(:host => mysqlconf[:host],
7
- :port => mysqlconf[:port],
8
- :database => mysqlconf[:database],
9
- :username => mysqlconf[:username],
10
- :password => mysqlconf[:password])
6
+ @client = Mysql2::Client.new(host: mysqlconf["host"],
7
+ port: mysqlconf["port"],
8
+ database: mysqlconf["database"],
9
+ username: mysqlconf["username"],
10
+ password: mysqlconf["password"])
11
11
 
12
- in_statement = bills.map{|b| "'#{b.order_id}'"}.join(',')
12
+ in_statement = bills.map{|b| "'#{b.order_nr}'"}.join(',')
13
13
  query = "SELECT increment_id, created_at, updated_at, "\
14
14
  "invoice_status_id FROM sales_flat_invoice "\
15
15
  "WHERE increment_id IN (#{in_statement});"
16
16
 
17
17
  # Build up index TODO rubyfy
18
18
  bill_idx = {}
19
- bills.each {|b| bill_idx[b.order_id] = b}
19
+ bills.each {|b| bill_idx[b.order_nr.to_s] = b}
20
20
  results = @client.query(query)
21
21
 
22
22
  results.each do |row|
@@ -1,3 +1,3 @@
1
1
  module Magelex
2
- VERSION = "0.1.0".freeze
2
+ VERSION = "0.1.1".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: magelex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Wolfsteller
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-07 00:00:00.000000000 Z
11
+ date: 2016-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mysql2