Skip to content

Instantly share code, notes, and snippets.

@axilaris
Last active August 29, 2015 14:01
Show Gist options
  • Select an option

  • Save axilaris/32966f36353510210708 to your computer and use it in GitHub Desktop.

Select an option

Save axilaris/32966f36353510210708 to your computer and use it in GitHub Desktop.
[["Code", "Name", "Description", "Quantity", "Price", "Discount", "["ABD", "XYZ"]", "Amount"]]
@invoice["data"]["items"].map do |key, value|
[value["product_code"],
value["product_name"],
value["product_description"],
value["product_quantity"],
value["product_price"],
(value["product_tax_data"].map {|taxkey,taxvalue|
taxvalue["abbreviation"]}.each do |taxabbreviation|
taxabbreviation
end).to_s,
value["product_display_amount"]]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment