Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Add some custom order.
James Cole8dd315d7d69e
diff --git a/app/Api/V1/Controllers/Autocomplete/AccountController.php b/app/Api/V1/Controllers/Autocomplete/AccountController.phpindex 73b2136f4e..f0ff700644 100644--- a/app/Api/V1/Controllers/Autocomplete/AccountController.php+++ b/app/Api/V1/Controllers/Autocomplete/AccountController.php@@ -61,7 +61,7 @@ class AccountController extends Controllerreturn $next($request);});- $this->balanceTypes = [AccountType::ASSET, AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE, ];+ $this->balanceTypes = [AccountType::ASSET, AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE,];}/**@@ -104,6 +104,16 @@ class AccountController extends Controller];}+ // custom order.+ $order = [AccountType::ASSET, AccountType::REVENUE, AccountType::EXPENSE];+++ usort($return, function ($a, $b) use ($order) {+ $pos_a = array_search($a['type'], $order);+ $pos_b = array_search($b['type'], $order);+ return $pos_a - $pos_b;+ });+return response()->json($return);}}