diff --git a/app/Http/Controllers/PiggyBank/IndexController.php b/app/Http/Controllers/PiggyBank/IndexController.php
index b57564206e..bcd80eafd4 100644
--- a/app/Http/Controllers/PiggyBank/IndexController.php
+++ b/app/Http/Controllers/PiggyBank/IndexController.php
@@ -117,6 +117,8 @@ class IndexController extends Controller
$piggyBanks[$groupOrder]['piggy_banks'][] = $array;
}
+ ksort($piggyBanks);
+
return view('piggy-banks.index', compact('piggyBanks', 'accounts'));
}
diff --git a/resources/views/v1/list/piggy-banks.twig b/resources/views/v1/list/piggy-banks.twig
index 9b9e608d82..e6b8fe640f 100644
--- a/resources/views/v1/list/piggy-banks.twig
+++ b/resources/views/v1/list/piggy-banks.twig
@@ -12,89 +12,91 @@
{% for objectGroupOrder, objectGroup in piggyBanks %}
-
-
- {{ objectGroup.object_group_title }} |
-
- {% for piggy in objectGroup.piggy_banks %}
-
-
-
- |
-
-
- |
-
-
-
- |
-
-
- |
-
- {{ piggy.name }}
- {% if piggy.attachments.count > 0 %}
-
- {% endif %}
+ {% if objectGroup.piggy_banks|length > 0 %}
+ |
+
+ {{ objectGroup.object_group_title }} |
+
+ {% for piggy in objectGroup.piggy_banks %}
+
+
+
+ |
+
+
+ |
+
+
+
+ |
+
+
+ |
+
+ {{ piggy.name }}
+ {% if piggy.attachments.count > 0 %}
+
+ {% endif %}
- |
-
+ |
+
{{ formatAmountBySymbol(piggy.current_amount,piggy.currency_symbol,piggy.currency_decimal_places) }}
- |
-
- {% if piggy.current_amount > 0 %}
-
-
- {% endif %}
- |
+
+
+ {% if piggy.current_amount > 0 %}
+
+
+ {% endif %}
+ |
-
-
-
- {{ piggy.percentage }}%
+
+
+
+ {{ piggy.percentage }}%
+
-
- |
+ |
-
- {% if piggy.left_to_save > 0 %}
-
-
- {% endif %}
- |
-
- {{ formatAmountBySymbol(piggy.target_amount,piggy.currency_symbol,piggy.currency_decimal_places) }}
- |
-
- {% if piggy.left_to_save > 0 %}
- {{ formatAmountBySymbol(piggy.left_to_save,piggy.currency_symbol,piggy.currency_decimal_places) }}
- {% endif %}
- |
-
- {% if piggy.target_date %}
- {{ formatAmountBySymbol(piggy.save_per_month, piggy.currency_symbol, piggy.currency_decimal_places) }}
- {% endif %}
- |
-
- {% endfor %}
-
+
+ {% if piggy.left_to_save > 0 %}
+
+
+ {% endif %}
+ |
+
+ {{ formatAmountBySymbol(piggy.target_amount,piggy.currency_symbol,piggy.currency_decimal_places) }}
+ |
+
+ {% if piggy.left_to_save > 0 %}
+ {{ formatAmountBySymbol(piggy.left_to_save,piggy.currency_symbol,piggy.currency_decimal_places) }}
+ {% endif %}
+ |
+
+ {% if piggy.target_date %}
+ {{ formatAmountBySymbol(piggy.save_per_month, piggy.currency_symbol, piggy.currency_decimal_places) }}
+ {% endif %}
+ |
+
+ {% endfor %}
+
+ {% endif %}
{% endfor %}