magelex 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/magelex +2 -1
- data/lib/magelex/magento_mysql.rb +7 -7
- data/lib/magelex/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9375788e021f187ddbad0f169654145ff6d28f7c
|
|
4
|
+
data.tar.gz: 1a04c859ed76349806144ab41bb2541af91ee187
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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(:
|
|
7
|
-
:
|
|
8
|
-
:
|
|
9
|
-
:
|
|
10
|
-
:
|
|
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.
|
|
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.
|
|
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|
|
data/lib/magelex/version.rb
CHANGED
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.
|
|
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-
|
|
11
|
+
date: 2016-02-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: mysql2
|