From 44d4d7c6f924eb79a6c3793e6fe3a9bc100d5a07 Mon Sep 17 00:00:00 2001 From: shibao Date: Sat, 12 Nov 2022 14:37:55 -0500 Subject: [PATCH] add CPR and original count to json export --- CHANGELOG.md | 1 + .../components/ammo_group_table_component.ex | 8 +------ .../controllers/export_controller.ex | 6 ++++- priv/gettext/de/LC_MESSAGES/default.po | 22 +++++++++---------- priv/gettext/default.pot | 22 +++++++++---------- priv/gettext/en/LC_MESSAGES/default.po | 22 +++++++++---------- priv/gettext/es/LC_MESSAGES/default.po | 22 +++++++++---------- priv/gettext/fr/LC_MESSAGES/default.po | 22 +++++++++---------- priv/gettext/ga/LC_MESSAGES/default.po | 22 +++++++++---------- .../controllers/export_controller_test.exs | 2 ++ 10 files changed, 75 insertions(+), 74 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05fcf699..ee5932c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Make container show page also display ammo groups as table - Display CPR for ammo packs - Add original count for ammo packs +- Add ammo pack CPR and original count to json export # v0.6.0 - Update translations diff --git a/lib/cannery_web/components/ammo_group_table_component.ex b/lib/cannery_web/components/ammo_group_table_component.ex index f02d0e9f..256f7ce8 100644 --- a/lib/cannery_web/components/ammo_group_table_component.ex +++ b/lib/cannery_web/components/ammo_group_table_component.ex @@ -81,6 +81,7 @@ defmodule CanneryWeb.Components.AmmoGroupTableComponent do columns = [ %{label: gettext("Count"), key: :count}, + %{label: gettext("Original Count"), key: :original_count}, %{label: gettext("Price paid"), key: :price_paid}, %{label: gettext("CPR"), key: :cpr}, %{label: gettext("% left"), key: :remaining}, @@ -88,13 +89,6 @@ defmodule CanneryWeb.Components.AmmoGroupTableComponent do | columns ] - columns = - if show_used do - [%{label: gettext("Original Count"), key: :original_count} | columns] - else - columns - end - columns = if ammo_type == [] do columns diff --git a/lib/cannery_web/controllers/export_controller.ex b/lib/cannery_web/controllers/export_controller.ex index d7697ab5..a55218f0 100644 --- a/lib/cannery_web/controllers/export_controller.ex +++ b/lib/cannery_web/controllers/export_controller.ex @@ -25,7 +25,9 @@ defmodule CanneryWeb.ExportController do ammo_groups = Ammo.list_ammo_groups(current_user, true) |> Enum.map(fn ammo_group -> + cpr = ammo_group |> Ammo.get_cpr() used_count = ammo_group |> Ammo.get_used_count() + original_count = ammo_group |> Ammo.get_original_count() percentage_remaining = ammo_group |> Ammo.get_percentage_remaining() ammo_group @@ -33,7 +35,9 @@ defmodule CanneryWeb.ExportController do |> Jason.decode!() |> Map.merge(%{ "used_count" => used_count, - "percentage_remaining" => percentage_remaining + "percentage_remaining" => percentage_remaining, + "original_count" => original_count, + "cpr" => cpr }) end) diff --git a/priv/gettext/de/LC_MESSAGES/default.po b/priv/gettext/de/LC_MESSAGES/default.po index b3c07ca7..73ba03b9 100644 --- a/priv/gettext/de/LC_MESSAGES/default.po +++ b/priv/gettext/de/LC_MESSAGES/default.po @@ -52,7 +52,7 @@ msgstr "Admins:" msgid "Ammo" msgstr "Munition" -#: lib/cannery_web/components/ammo_group_table_component.ex:102 +#: lib/cannery_web/components/ammo_group_table_component.ex:96 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:21 #, elixir-autogen, elixir-format msgid "Ammo type" @@ -322,7 +322,7 @@ msgid "No tags" msgstr "Keine Tags" #: lib/cannery_web/components/add_shot_group_component.html.heex:37 -#: lib/cannery_web/components/ammo_group_table_component.ex:87 +#: lib/cannery_web/components/ammo_group_table_component.ex:88 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:41 #: lib/cannery_web/live/ammo_group_live/show.ex:88 #: lib/cannery_web/live/range_live/form_component.html.heex:29 @@ -348,7 +348,7 @@ msgstr "Auf dem Bücherregal" msgid "Pressure" msgstr "Druck" -#: lib/cannery_web/components/ammo_group_table_component.ex:84 +#: lib/cannery_web/components/ammo_group_table_component.ex:85 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:34 #, elixir-autogen, elixir-format msgid "Price paid" @@ -575,8 +575,8 @@ msgstr "Schießkladde" #: lib/cannery_web/components/ammo_group_card.ex:71 #: lib/cannery_web/components/ammo_group_card.ex:78 -#: lib/cannery_web/components/ammo_group_table_component.ex:165 -#: lib/cannery_web/components/ammo_group_table_component.ex:233 +#: lib/cannery_web/components/ammo_group_table_component.ex:159 +#: lib/cannery_web/components/ammo_group_table_component.ex:227 #: lib/cannery_web/live/ammo_group_live/show.html.heex:37 #: lib/cannery_web/live/ammo_group_live/show.html.heex:44 #: lib/cannery_web/live/ammo_type_live/index.ex:179 @@ -681,14 +681,14 @@ msgstr "Editiere %{name} Tags" msgid "Rounds:" msgstr "Patronen:" -#: lib/cannery_web/components/ammo_group_table_component.ex:230 +#: lib/cannery_web/components/ammo_group_table_component.ex:224 #: lib/cannery_web/live/ammo_type_live/index.ex:178 #: lib/cannery_web/live/ammo_type_live/show.html.heex:142 #, elixir-autogen, elixir-format msgid "No cost information" msgstr "Keine Preisinformationen" -#: lib/cannery_web/components/ammo_group_table_component.ex:86 +#: lib/cannery_web/components/ammo_group_table_component.ex:87 #, elixir-autogen, elixir-format msgid "% left" msgstr "% verbleibend" @@ -896,7 +896,7 @@ msgstr "" msgid "Used up on:" msgstr "" -#: lib/cannery_web/components/ammo_group_table_component.ex:201 +#: lib/cannery_web/components/ammo_group_table_component.ex:195 #: lib/cannery_web/live/ammo_group_live/show.html.heex:19 #, elixir-autogen, elixir-format msgid "%{percentage}%" @@ -1083,12 +1083,12 @@ msgid "Edit %{ammo_type_name}" msgstr "%{name} bearbeiten" #: lib/cannery_web/components/ammo_group_card.ex:39 -#: lib/cannery_web/components/ammo_group_table_component.ex:239 +#: lib/cannery_web/components/ammo_group_table_component.ex:233 #, elixir-autogen, elixir-format msgid "Empty" msgstr "" -#: lib/cannery_web/components/ammo_group_table_component.ex:85 +#: lib/cannery_web/components/ammo_group_table_component.ex:86 #, elixir-autogen, elixir-format msgid "CPR" msgstr "" @@ -1098,7 +1098,7 @@ msgstr "" msgid "CPR:" msgstr "" -#: lib/cannery_web/components/ammo_group_table_component.ex:93 +#: lib/cannery_web/components/ammo_group_table_component.ex:84 #, elixir-autogen, elixir-format, fuzzy msgid "Original Count" msgstr "Ursprüngliche Anzahl:" diff --git a/priv/gettext/default.pot b/priv/gettext/default.pot index 8e648c93..89d2fff2 100644 --- a/priv/gettext/default.pot +++ b/priv/gettext/default.pot @@ -37,7 +37,7 @@ msgstr "" msgid "Ammo" msgstr "" -#: lib/cannery_web/components/ammo_group_table_component.ex:102 +#: lib/cannery_web/components/ammo_group_table_component.ex:96 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:21 #, elixir-autogen, elixir-format msgid "Ammo type" @@ -307,7 +307,7 @@ msgid "No tags" msgstr "" #: lib/cannery_web/components/add_shot_group_component.html.heex:37 -#: lib/cannery_web/components/ammo_group_table_component.ex:87 +#: lib/cannery_web/components/ammo_group_table_component.ex:88 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:41 #: lib/cannery_web/live/ammo_group_live/show.ex:88 #: lib/cannery_web/live/range_live/form_component.html.heex:29 @@ -333,7 +333,7 @@ msgstr "" msgid "Pressure" msgstr "" -#: lib/cannery_web/components/ammo_group_table_component.ex:84 +#: lib/cannery_web/components/ammo_group_table_component.ex:85 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:34 #, elixir-autogen, elixir-format msgid "Price paid" @@ -558,8 +558,8 @@ msgstr "" #: lib/cannery_web/components/ammo_group_card.ex:71 #: lib/cannery_web/components/ammo_group_card.ex:78 -#: lib/cannery_web/components/ammo_group_table_component.ex:165 -#: lib/cannery_web/components/ammo_group_table_component.ex:233 +#: lib/cannery_web/components/ammo_group_table_component.ex:159 +#: lib/cannery_web/components/ammo_group_table_component.ex:227 #: lib/cannery_web/live/ammo_group_live/show.html.heex:37 #: lib/cannery_web/live/ammo_group_live/show.html.heex:44 #: lib/cannery_web/live/ammo_type_live/index.ex:179 @@ -664,14 +664,14 @@ msgstr "" msgid "Rounds:" msgstr "" -#: lib/cannery_web/components/ammo_group_table_component.ex:230 +#: lib/cannery_web/components/ammo_group_table_component.ex:224 #: lib/cannery_web/live/ammo_type_live/index.ex:178 #: lib/cannery_web/live/ammo_type_live/show.html.heex:142 #, elixir-autogen, elixir-format msgid "No cost information" msgstr "" -#: lib/cannery_web/components/ammo_group_table_component.ex:86 +#: lib/cannery_web/components/ammo_group_table_component.ex:87 #, elixir-autogen, elixir-format msgid "% left" msgstr "" @@ -879,7 +879,7 @@ msgstr "" msgid "Used up on:" msgstr "" -#: lib/cannery_web/components/ammo_group_table_component.ex:201 +#: lib/cannery_web/components/ammo_group_table_component.ex:195 #: lib/cannery_web/live/ammo_group_live/show.html.heex:19 #, elixir-autogen, elixir-format msgid "%{percentage}%" @@ -1066,12 +1066,12 @@ msgid "Edit %{ammo_type_name}" msgstr "" #: lib/cannery_web/components/ammo_group_card.ex:39 -#: lib/cannery_web/components/ammo_group_table_component.ex:239 +#: lib/cannery_web/components/ammo_group_table_component.ex:233 #, elixir-autogen, elixir-format msgid "Empty" msgstr "" -#: lib/cannery_web/components/ammo_group_table_component.ex:85 +#: lib/cannery_web/components/ammo_group_table_component.ex:86 #, elixir-autogen, elixir-format msgid "CPR" msgstr "" @@ -1081,7 +1081,7 @@ msgstr "" msgid "CPR:" msgstr "" -#: lib/cannery_web/components/ammo_group_table_component.ex:93 +#: lib/cannery_web/components/ammo_group_table_component.ex:84 #, elixir-autogen, elixir-format msgid "Original Count" msgstr "" diff --git a/priv/gettext/en/LC_MESSAGES/default.po b/priv/gettext/en/LC_MESSAGES/default.po index 162e63bb..63d2a301 100644 --- a/priv/gettext/en/LC_MESSAGES/default.po +++ b/priv/gettext/en/LC_MESSAGES/default.po @@ -38,7 +38,7 @@ msgstr "" msgid "Ammo" msgstr "" -#: lib/cannery_web/components/ammo_group_table_component.ex:102 +#: lib/cannery_web/components/ammo_group_table_component.ex:96 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:21 #, elixir-autogen, elixir-format msgid "Ammo type" @@ -308,7 +308,7 @@ msgid "No tags" msgstr "" #: lib/cannery_web/components/add_shot_group_component.html.heex:37 -#: lib/cannery_web/components/ammo_group_table_component.ex:87 +#: lib/cannery_web/components/ammo_group_table_component.ex:88 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:41 #: lib/cannery_web/live/ammo_group_live/show.ex:88 #: lib/cannery_web/live/range_live/form_component.html.heex:29 @@ -334,7 +334,7 @@ msgstr "" msgid "Pressure" msgstr "" -#: lib/cannery_web/components/ammo_group_table_component.ex:84 +#: lib/cannery_web/components/ammo_group_table_component.ex:85 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:34 #, elixir-autogen, elixir-format msgid "Price paid" @@ -559,8 +559,8 @@ msgstr "" #: lib/cannery_web/components/ammo_group_card.ex:71 #: lib/cannery_web/components/ammo_group_card.ex:78 -#: lib/cannery_web/components/ammo_group_table_component.ex:165 -#: lib/cannery_web/components/ammo_group_table_component.ex:233 +#: lib/cannery_web/components/ammo_group_table_component.ex:159 +#: lib/cannery_web/components/ammo_group_table_component.ex:227 #: lib/cannery_web/live/ammo_group_live/show.html.heex:37 #: lib/cannery_web/live/ammo_group_live/show.html.heex:44 #: lib/cannery_web/live/ammo_type_live/index.ex:179 @@ -665,14 +665,14 @@ msgstr "" msgid "Rounds:" msgstr "" -#: lib/cannery_web/components/ammo_group_table_component.ex:230 +#: lib/cannery_web/components/ammo_group_table_component.ex:224 #: lib/cannery_web/live/ammo_type_live/index.ex:178 #: lib/cannery_web/live/ammo_type_live/show.html.heex:142 #, elixir-autogen, elixir-format msgid "No cost information" msgstr "" -#: lib/cannery_web/components/ammo_group_table_component.ex:86 +#: lib/cannery_web/components/ammo_group_table_component.ex:87 #, elixir-autogen, elixir-format msgid "% left" msgstr "" @@ -880,7 +880,7 @@ msgstr "" msgid "Used up on:" msgstr "" -#: lib/cannery_web/components/ammo_group_table_component.ex:201 +#: lib/cannery_web/components/ammo_group_table_component.ex:195 #: lib/cannery_web/live/ammo_group_live/show.html.heex:19 #, elixir-autogen, elixir-format msgid "%{percentage}%" @@ -1067,12 +1067,12 @@ msgid "Edit %{ammo_type_name}" msgstr "" #: lib/cannery_web/components/ammo_group_card.ex:39 -#: lib/cannery_web/components/ammo_group_table_component.ex:239 +#: lib/cannery_web/components/ammo_group_table_component.ex:233 #, elixir-autogen, elixir-format msgid "Empty" msgstr "" -#: lib/cannery_web/components/ammo_group_table_component.ex:85 +#: lib/cannery_web/components/ammo_group_table_component.ex:86 #, elixir-autogen, elixir-format msgid "CPR" msgstr "" @@ -1082,7 +1082,7 @@ msgstr "" msgid "CPR:" msgstr "" -#: lib/cannery_web/components/ammo_group_table_component.ex:93 +#: lib/cannery_web/components/ammo_group_table_component.ex:84 #, elixir-autogen, elixir-format, fuzzy msgid "Original Count" msgstr "" diff --git a/priv/gettext/es/LC_MESSAGES/default.po b/priv/gettext/es/LC_MESSAGES/default.po index 0d9a4b1d..fe949965 100644 --- a/priv/gettext/es/LC_MESSAGES/default.po +++ b/priv/gettext/es/LC_MESSAGES/default.po @@ -52,7 +52,7 @@ msgstr "" msgid "Ammo" msgstr "" -#: lib/cannery_web/components/ammo_group_table_component.ex:102 +#: lib/cannery_web/components/ammo_group_table_component.ex:96 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:21 #, elixir-autogen, elixir-format msgid "Ammo type" @@ -322,7 +322,7 @@ msgid "No tags" msgstr "" #: lib/cannery_web/components/add_shot_group_component.html.heex:37 -#: lib/cannery_web/components/ammo_group_table_component.ex:87 +#: lib/cannery_web/components/ammo_group_table_component.ex:88 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:41 #: lib/cannery_web/live/ammo_group_live/show.ex:88 #: lib/cannery_web/live/range_live/form_component.html.heex:29 @@ -348,7 +348,7 @@ msgstr "" msgid "Pressure" msgstr "" -#: lib/cannery_web/components/ammo_group_table_component.ex:84 +#: lib/cannery_web/components/ammo_group_table_component.ex:85 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:34 #, elixir-autogen, elixir-format msgid "Price paid" @@ -573,8 +573,8 @@ msgstr "" #: lib/cannery_web/components/ammo_group_card.ex:71 #: lib/cannery_web/components/ammo_group_card.ex:78 -#: lib/cannery_web/components/ammo_group_table_component.ex:165 -#: lib/cannery_web/components/ammo_group_table_component.ex:233 +#: lib/cannery_web/components/ammo_group_table_component.ex:159 +#: lib/cannery_web/components/ammo_group_table_component.ex:227 #: lib/cannery_web/live/ammo_group_live/show.html.heex:37 #: lib/cannery_web/live/ammo_group_live/show.html.heex:44 #: lib/cannery_web/live/ammo_type_live/index.ex:179 @@ -679,14 +679,14 @@ msgstr "" msgid "Rounds:" msgstr "" -#: lib/cannery_web/components/ammo_group_table_component.ex:230 +#: lib/cannery_web/components/ammo_group_table_component.ex:224 #: lib/cannery_web/live/ammo_type_live/index.ex:178 #: lib/cannery_web/live/ammo_type_live/show.html.heex:142 #, elixir-autogen, elixir-format msgid "No cost information" msgstr "" -#: lib/cannery_web/components/ammo_group_table_component.ex:86 +#: lib/cannery_web/components/ammo_group_table_component.ex:87 #, elixir-autogen, elixir-format msgid "% left" msgstr "" @@ -894,7 +894,7 @@ msgstr "" msgid "Used up on:" msgstr "" -#: lib/cannery_web/components/ammo_group_table_component.ex:201 +#: lib/cannery_web/components/ammo_group_table_component.ex:195 #: lib/cannery_web/live/ammo_group_live/show.html.heex:19 #, elixir-autogen, elixir-format msgid "%{percentage}%" @@ -1081,12 +1081,12 @@ msgid "Edit %{ammo_type_name}" msgstr "" #: lib/cannery_web/components/ammo_group_card.ex:39 -#: lib/cannery_web/components/ammo_group_table_component.ex:239 +#: lib/cannery_web/components/ammo_group_table_component.ex:233 #, elixir-autogen, elixir-format msgid "Empty" msgstr "" -#: lib/cannery_web/components/ammo_group_table_component.ex:85 +#: lib/cannery_web/components/ammo_group_table_component.ex:86 #, elixir-autogen, elixir-format msgid "CPR" msgstr "" @@ -1096,7 +1096,7 @@ msgstr "" msgid "CPR:" msgstr "" -#: lib/cannery_web/components/ammo_group_table_component.ex:93 +#: lib/cannery_web/components/ammo_group_table_component.ex:84 #, elixir-autogen, elixir-format, fuzzy msgid "Original Count" msgstr "" diff --git a/priv/gettext/fr/LC_MESSAGES/default.po b/priv/gettext/fr/LC_MESSAGES/default.po index 98f1b395..24c99fcf 100644 --- a/priv/gettext/fr/LC_MESSAGES/default.po +++ b/priv/gettext/fr/LC_MESSAGES/default.po @@ -52,7 +52,7 @@ msgstr "Administrateur·ices :" msgid "Ammo" msgstr "Munition" -#: lib/cannery_web/components/ammo_group_table_component.ex:102 +#: lib/cannery_web/components/ammo_group_table_component.ex:96 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:21 #, elixir-autogen, elixir-format msgid "Ammo type" @@ -322,7 +322,7 @@ msgid "No tags" msgstr "Aucun tag" #: lib/cannery_web/components/add_shot_group_component.html.heex:37 -#: lib/cannery_web/components/ammo_group_table_component.ex:87 +#: lib/cannery_web/components/ammo_group_table_component.ex:88 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:41 #: lib/cannery_web/live/ammo_group_live/show.ex:88 #: lib/cannery_web/live/range_live/form_component.html.heex:29 @@ -348,7 +348,7 @@ msgstr "Sur l’étagère" msgid "Pressure" msgstr "Pression" -#: lib/cannery_web/components/ammo_group_table_component.ex:84 +#: lib/cannery_web/components/ammo_group_table_component.ex:85 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:34 #, elixir-autogen, elixir-format msgid "Price paid" @@ -577,8 +577,8 @@ msgstr "Évènements de tir" #: lib/cannery_web/components/ammo_group_card.ex:71 #: lib/cannery_web/components/ammo_group_card.ex:78 -#: lib/cannery_web/components/ammo_group_table_component.ex:165 -#: lib/cannery_web/components/ammo_group_table_component.ex:233 +#: lib/cannery_web/components/ammo_group_table_component.ex:159 +#: lib/cannery_web/components/ammo_group_table_component.ex:227 #: lib/cannery_web/live/ammo_group_live/show.html.heex:37 #: lib/cannery_web/live/ammo_group_live/show.html.heex:44 #: lib/cannery_web/live/ammo_type_live/index.ex:179 @@ -683,14 +683,14 @@ msgstr "Éditer les tags de %{name}" msgid "Rounds:" msgstr "Cartouches :" -#: lib/cannery_web/components/ammo_group_table_component.ex:230 +#: lib/cannery_web/components/ammo_group_table_component.ex:224 #: lib/cannery_web/live/ammo_type_live/index.ex:178 #: lib/cannery_web/live/ammo_type_live/show.html.heex:142 #, elixir-autogen, elixir-format msgid "No cost information" msgstr "Aucune information de prix" -#: lib/cannery_web/components/ammo_group_table_component.ex:86 +#: lib/cannery_web/components/ammo_group_table_component.ex:87 #, elixir-autogen, elixir-format msgid "% left" msgstr "% restante" @@ -899,7 +899,7 @@ msgstr "" msgid "Used up on:" msgstr "" -#: lib/cannery_web/components/ammo_group_table_component.ex:201 +#: lib/cannery_web/components/ammo_group_table_component.ex:195 #: lib/cannery_web/live/ammo_group_live/show.html.heex:19 #, elixir-autogen, elixir-format msgid "%{percentage}%" @@ -1086,12 +1086,12 @@ msgid "Edit %{ammo_type_name}" msgstr "Éditer %{name}" #: lib/cannery_web/components/ammo_group_card.ex:39 -#: lib/cannery_web/components/ammo_group_table_component.ex:239 +#: lib/cannery_web/components/ammo_group_table_component.ex:233 #, elixir-autogen, elixir-format msgid "Empty" msgstr "" -#: lib/cannery_web/components/ammo_group_table_component.ex:85 +#: lib/cannery_web/components/ammo_group_table_component.ex:86 #, elixir-autogen, elixir-format msgid "CPR" msgstr "" @@ -1101,7 +1101,7 @@ msgstr "" msgid "CPR:" msgstr "" -#: lib/cannery_web/components/ammo_group_table_component.ex:93 +#: lib/cannery_web/components/ammo_group_table_component.ex:84 #, elixir-autogen, elixir-format, fuzzy msgid "Original Count" msgstr "Nombre original :" diff --git a/priv/gettext/ga/LC_MESSAGES/default.po b/priv/gettext/ga/LC_MESSAGES/default.po index c8550c15..ae6da1b1 100644 --- a/priv/gettext/ga/LC_MESSAGES/default.po +++ b/priv/gettext/ga/LC_MESSAGES/default.po @@ -48,7 +48,7 @@ msgstr "" msgid "Ammo" msgstr "" -#: lib/cannery_web/components/ammo_group_table_component.ex:102 +#: lib/cannery_web/components/ammo_group_table_component.ex:96 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:21 #, elixir-autogen, elixir-format msgid "Ammo type" @@ -318,7 +318,7 @@ msgid "No tags" msgstr "" #: lib/cannery_web/components/add_shot_group_component.html.heex:37 -#: lib/cannery_web/components/ammo_group_table_component.ex:87 +#: lib/cannery_web/components/ammo_group_table_component.ex:88 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:41 #: lib/cannery_web/live/ammo_group_live/show.ex:88 #: lib/cannery_web/live/range_live/form_component.html.heex:29 @@ -344,7 +344,7 @@ msgstr "" msgid "Pressure" msgstr "" -#: lib/cannery_web/components/ammo_group_table_component.ex:84 +#: lib/cannery_web/components/ammo_group_table_component.ex:85 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:34 #, elixir-autogen, elixir-format msgid "Price paid" @@ -569,8 +569,8 @@ msgstr "" #: lib/cannery_web/components/ammo_group_card.ex:71 #: lib/cannery_web/components/ammo_group_card.ex:78 -#: lib/cannery_web/components/ammo_group_table_component.ex:165 -#: lib/cannery_web/components/ammo_group_table_component.ex:233 +#: lib/cannery_web/components/ammo_group_table_component.ex:159 +#: lib/cannery_web/components/ammo_group_table_component.ex:227 #: lib/cannery_web/live/ammo_group_live/show.html.heex:37 #: lib/cannery_web/live/ammo_group_live/show.html.heex:44 #: lib/cannery_web/live/ammo_type_live/index.ex:179 @@ -675,14 +675,14 @@ msgstr "" msgid "Rounds:" msgstr "" -#: lib/cannery_web/components/ammo_group_table_component.ex:230 +#: lib/cannery_web/components/ammo_group_table_component.ex:224 #: lib/cannery_web/live/ammo_type_live/index.ex:178 #: lib/cannery_web/live/ammo_type_live/show.html.heex:142 #, elixir-autogen, elixir-format msgid "No cost information" msgstr "" -#: lib/cannery_web/components/ammo_group_table_component.ex:86 +#: lib/cannery_web/components/ammo_group_table_component.ex:87 #, elixir-autogen, elixir-format msgid "% left" msgstr "" @@ -890,7 +890,7 @@ msgstr "" msgid "Used up on:" msgstr "" -#: lib/cannery_web/components/ammo_group_table_component.ex:201 +#: lib/cannery_web/components/ammo_group_table_component.ex:195 #: lib/cannery_web/live/ammo_group_live/show.html.heex:19 #, elixir-autogen, elixir-format msgid "%{percentage}%" @@ -1077,12 +1077,12 @@ msgid "Edit %{ammo_type_name}" msgstr "" #: lib/cannery_web/components/ammo_group_card.ex:39 -#: lib/cannery_web/components/ammo_group_table_component.ex:239 +#: lib/cannery_web/components/ammo_group_table_component.ex:233 #, elixir-autogen, elixir-format msgid "Empty" msgstr "" -#: lib/cannery_web/components/ammo_group_table_component.ex:85 +#: lib/cannery_web/components/ammo_group_table_component.ex:86 #, elixir-autogen, elixir-format msgid "CPR" msgstr "" @@ -1092,7 +1092,7 @@ msgstr "" msgid "CPR:" msgstr "" -#: lib/cannery_web/components/ammo_group_table_component.ex:93 +#: lib/cannery_web/components/ammo_group_table_component.ex:84 #, elixir-autogen, elixir-format, fuzzy msgid "Original Count" msgstr "" diff --git a/test/cannery_web/controllers/export_controller_test.exs b/test/cannery_web/controllers/export_controller_test.exs index 3baad053..01479e30 100644 --- a/test/cannery_web/controllers/export_controller_test.exs +++ b/test/cannery_web/controllers/export_controller_test.exs @@ -58,6 +58,8 @@ defmodule CanneryWeb.ExportControllerTest do "price_paid" => ammo_group.price_paid, "staged" => ammo_group.staged, "used_count" => ammo_group |> Ammo.get_used_count(), + "original_count" => ammo_group |> Ammo.get_original_count(), + "cpr" => ammo_group |> Ammo.get_cpr(), "percentage_remaining" => ammo_group |> Ammo.get_percentage_remaining() }