Update Payments to only show account_type_parent 1 which is assets

This commit is contained in:
johnnyq
2023-10-20 16:27:43 -04:00
parent 4080774602
commit 7a834b0f5f
2 changed files with 12 additions and 16 deletions

View File

@@ -49,16 +49,14 @@ require_once("inc_all_settings.php");
<select class="form-control select2" name="config_stripe_account" required>
<option value="">- Account -</option>
<?php
$sql_accounts = mysqli_query($mysqli, "SELECT * FROM accounts WHERE account_archived_at IS NULL ORDER BY account_name ASC");
$sql_accounts = mysqli_query($mysqli, "SELECT * FROM accounts LEFT JOIN account_types ON account_types.account_type_id = accounts.account_type WHERE account_type_parent = 1 AND account_archived_at IS NULL ORDER BY account_name ASC");
while ($row = mysqli_fetch_array($sql_accounts)) {
$account_type = nullable_htmlentities($row['account_type']);
if ($account_type < 19 && $account_type > 10) {
$account_id = intval($row['account_id']);
$account_name = nullable_htmlentities($row['account_name']);
$account_id = intval($row['account_id']);
$account_name = nullable_htmlentities($row['account_name']);
?>
<option value="<?php echo $account_id ?>" <?php if ($account_id == $config_stripe_account) { echo "selected"; } ?>><?php echo $account_name ?></option>
<?php }
<option value="<?php echo $account_id ?>" <?php if ($account_id == $config_stripe_account) { echo "selected"; } ?>><?php echo $account_name ?></option>
<?php
}
?>
</select>