Last active
December 23, 2015 19:21
-
-
Save chinloongtan/9182ff23031bd6e0c2cc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
slips.map { |slip_num, details| | |
[slip_num.split('_')[1].to_i, { | |
number_transactions: details[:transactions].count, | |
total_amount: details[:transactions].map{ |t_num| transactions.find{ |t| t[:id] == t_num } }.map{ |t| t[:payout] ? (t[:amount] * (-1)) : t[:amount] }.reduce(:+), | |
shop: Hash[shops][details[:shop]] | |
}] | |
}.to_h |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment