$account) { Capsule::table('mod_accounting') ->where('invoice', $invoiceId) ->where('item', $invoiceItemId) ->update(['account' => $account]); } } // Get the invoice items from the database. $invoiceItems = Capsule::table('mod_accounting') ->where('invoice', $invoiceId) ->get(); // Get the available accounts from the module configuration. $availableAccounts = explode("\n", $params['Available Accounts']); // Create the drop-down field for each invoice item. foreach ($invoiceItems as $invoiceItem) { $accountSelector = ''; // Add the drop-down field to the invoice item. echo ''; // Select the account that was previously selected for the invoice // item. echo ''; } } catch (Exception $e) { // Log the error logActivity('Accounting Error: ' . $e->getMessage()); } });