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
+7 -9
View File
@@ -98,16 +98,14 @@ require_once("inc_all_settings.php"); ?>
<option value="0">- None -</option> <option value="0">- None -</option>
<?php <?php
$sql = mysqli_query($mysqli, "SELECT * FROM accounts WHERE account_archived_at IS NULL ORDER BY account_name ASC"); $sql = 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)) { while ($row = mysqli_fetch_array($sql)) {
$account_type = nullable_htmlentities($row['account_type']); $account_id = intval($row['account_id']);
if ($account_type < 19 && $account_type > 10) { $account_name = nullable_htmlentities($row['account_name']); ?>
$account_id = intval($row['account_id']); <option <?php if ($config_default_payment_account == $account_id) {
$account_name = nullable_htmlentities($row['account_name']); ?> echo "selected";
<option <?php if ($config_default_payment_account == $account_id) { } ?> value="<?php echo $account_id; ?>"><?php echo $account_name; ?></option>
echo "selected"; <?php
} ?> value="<?php echo $account_id; ?>"><?php echo $account_name; ?></option>
<?php }
} }
?> ?>
+5 -7
View File
@@ -49,16 +49,14 @@ require_once("inc_all_settings.php");
<select class="form-control select2" name="config_stripe_account" required> <select class="form-control select2" name="config_stripe_account" required>
<option value="">- Account -</option> <option value="">- Account -</option>
<?php <?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)) { while ($row = mysqli_fetch_array($sql_accounts)) {
$account_type = nullable_htmlentities($row['account_type']); $account_id = intval($row['account_id']);
if ($account_type < 19 && $account_type > 10) { $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> <option value="<?php echo $account_id ?>" <?php if ($account_id == $config_stripe_account) { echo "selected"; } ?>><?php echo $account_name ?></option>
<?php } <?php
} }
?> ?>
</select> </select>