mirror of https://github.com/itflow-org/itflow
Added Defaults for common tasks fex Default Calendar, default expense account
This commit is contained in:
parent
bf250cd1fe
commit
69337ad52f
|
|
@ -34,7 +34,7 @@
|
|||
$calendar_name = $row['calendar_name'];
|
||||
$calendar_color = $row['calendar_color'];
|
||||
?>
|
||||
<option data-content="<i class='fa fa-circle mr-2' style='color:<?php echo $calendar_color; ?>;'></i> <?php echo $calendar_name; ?>" value="<?php echo $calendar_id; ?>"><?php echo $calendar_name; ?></option>
|
||||
<option <?php if($config_default_calendar == $calendar_id){ echo "selected"; } ?> data-content="<i class='fa fa-circle mr-2' style='color:<?php echo $calendar_color; ?>;'></i> <?php echo $calendar_name; ?>" value="<?php echo $calendar_id; ?>"><?php echo $calendar_name; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@
|
|||
$balance = $opening_balance + $total_payments - $total_expenses;
|
||||
|
||||
?>
|
||||
<option value="<?php echo $account_id; ?>"><div class="float-left"><?php echo $account_name; ?></div><div class="float-right"> [$<?php echo number_format($balance,2); ?>]</div></option>
|
||||
<option <?php if($config_default_expense_account == $account_id){ echo "selected"; } ?> value="<?php echo $account_id; ?>"><div class="float-left"><?php echo $account_name; ?></div><div class="float-right"> [$<?php echo number_format($balance,2); ?>]</div></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@
|
|||
$balance = $opening_balance + $total_payments - $total_expenses;
|
||||
|
||||
?>
|
||||
<option value="<?php echo $account_id; ?>"><?php echo $account_name; ?> [$<?php echo number_format($balance,2); ?>]</option>
|
||||
<option <?php if($config_default_payment_account == $account_id){ echo "selected"; } ?> value="<?php echo $account_id; ?>"><?php echo $account_name; ?> [$<?php echo number_format($balance,2); ?>]</option>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
$balance = $opening_balance + $total_payments - $total_expenses;
|
||||
|
||||
?>
|
||||
<option value="<?php echo $account_id; ?>"><?php echo $account_name; ?> [$<?php echo number_format($balance,2); ?>]</option>
|
||||
<option <?php if($config_default_transfer_from_account == $account_id){ echo "selected"; } ?> value="<?php echo $account_id; ?>"><?php echo $account_name; ?> [$<?php echo number_format($balance,2); ?>]</option>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
|
@ -91,7 +91,7 @@
|
|||
$balance = $opening_balance + $total_payments - $total_expenses;
|
||||
|
||||
?>
|
||||
<option value="<?php echo $account_id; ?>"><?php echo $account_name; ?> [$<?php echo number_format($balance,2); ?>]</option>
|
||||
<option <?php if($config_default_transfer_to_account == $account_id){ echo "selected"; } ?> value="<?php echo $account_id; ?>"><?php echo $account_name; ?> [$<?php echo number_format($balance,2); ?>]</option>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,13 @@ $config_send_invoice_reminders = $row['config_send_invoice_reminders'];
|
|||
$config_invoice_overdue_reminders = $row['config_invoice_overdue_reminders'];
|
||||
$config_invoice_prefix = $row['config_invoice_prefix'];
|
||||
|
||||
//Defaults
|
||||
$config_default_expense_account = $row['config_default_expense_account'];
|
||||
$config_default_payment_account = $row['config_default_payment_account'];
|
||||
$config_default_transfer_from_account = $row['config_default_transfer_from_account'];
|
||||
$config_default_transfer_to_account = $row['config_default_transfer_to_account'];
|
||||
$config_default_calendar = $row['config_default_calendar'];
|
||||
|
||||
$config_quote_email_subject = $row['config_quote_email_subject'];
|
||||
|
||||
$config_recurring_email_auto_send = $row['config_recurring_email_auto_send'];
|
||||
|
|
|
|||
15
post.php
15
post.php
|
|
@ -115,6 +115,21 @@ if(isset($_POST['edit_invoice_settings'])){
|
|||
|
||||
}
|
||||
|
||||
if(isset($_POST['edit_default_settings'])){
|
||||
|
||||
$config_default_expense_account = intval($_POST['config_default_expense_account']);
|
||||
$config_default_payment_account = intval($_POST['config_default_payment_account']);
|
||||
$config_default_transfer_from_account = intval($_POST['config_default_transfer_from_account']);
|
||||
$config_default_transfer_to_account = intval($_POST['config_default_transfer_to_account']);
|
||||
$config_default_calendar = intval($_POST['config_default_calendar']);
|
||||
|
||||
mysqli_query($mysqli,"UPDATE settings SET config_default_expense_account = $config_default_expense_account, config_default_payment_account = $config_default_payment_account, config_default_transfer_from_account = $config_default_transfer_from_account, config_default_transfer_to_account = $config_default_transfer_to_account, config_default_calendar = $config_default_calendar");
|
||||
|
||||
$_SESSION['alert_message'] = "Default Settings updated";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
}
|
||||
|
||||
if(isset($_POST['enable_2fa'])){
|
||||
|
||||
$token = mysqli_real_escape_string($mysqli,$_POST['token']);
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
<span class="input-group-text"><i class="fa fa-exchange-alt"></i></span>
|
||||
</div>
|
||||
<select class="form-control selectpicker show-tick" name="config_default_transfer_from_account">
|
||||
<option value="">- Account -</option>
|
||||
<option value="0">- None -</option>
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM accounts");
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
$account_name = $row['account_name'];
|
||||
|
||||
?>
|
||||
<option value="<?php echo $account_id; ?>"><?php echo $account_name; ?></option>
|
||||
<option <?php if($config_default_transfer_from_account == $account_id){ echo "selected"; } ?> value="<?php echo $account_id; ?>"><?php echo $account_name; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
<span class="input-group-text"><i class="fa fa-exchange-alt"></i></span>
|
||||
</div>
|
||||
<select class="form-control selectpicker show-tick" name="config_default_transfer_to_account">
|
||||
<option value="">- Account -</option>
|
||||
<option value="0">- None -</option>
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM accounts");
|
||||
|
|
@ -49,7 +49,7 @@
|
|||
$account_name = $row['account_name'];
|
||||
|
||||
?>
|
||||
<option value="<?php echo $account_id; ?>"><?php echo $account_name; ?></option>
|
||||
<option <?php if($config_default_transfer_to_account == $account_id){ echo "selected"; } ?> value="<?php echo $account_id; ?>"><?php echo $account_name; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
|
@ -65,7 +65,7 @@
|
|||
<span class="input-group-text"><i class="fa fa-credit-card"></i></span>
|
||||
</div>
|
||||
<select class="form-control selectpicker show-tick" name="config_default_payment_account">
|
||||
<option value="">- Account -</option>
|
||||
<option value="0">- None -</option>
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM accounts");
|
||||
|
|
@ -74,7 +74,7 @@
|
|||
$account_name = $row['account_name'];
|
||||
|
||||
?>
|
||||
<option value="<?php echo $account_id; ?>"><?php echo $account_name; ?></option>
|
||||
<option <?php if($config_default_payment_account == $account_id){ echo "selected"; } ?> value="<?php echo $account_id; ?>"><?php echo $account_name; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
|
@ -90,7 +90,7 @@
|
|||
<span class="input-group-text"><i class="fa fa-shopping-cart"></i></span>
|
||||
</div>
|
||||
<select class="form-control selectpicker show-tick" name="config_default_expense_account">
|
||||
<option value="">- Account -</option>
|
||||
<option value="0">- None -</option>
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM accounts");
|
||||
|
|
@ -99,7 +99,7 @@
|
|||
$account_name = $row['account_name'];
|
||||
|
||||
?>
|
||||
<option value="<?php echo $account_id; ?>"><?php echo $account_name; ?></option>
|
||||
<option <?php if($config_default_expense_account == $account_id){ echo "selected"; } ?> value="<?php echo $account_id; ?>"><?php echo $account_name; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
|
@ -115,7 +115,7 @@
|
|||
<span class="input-group-text"><i class="fa fa-calendar"></i></span>
|
||||
</div>
|
||||
<select class="form-control selectpicker show-tick" name="config_default_calendar">
|
||||
<option value="">- Calendar -</option>
|
||||
<option value="0">- None -</option>
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM calendars");
|
||||
|
|
@ -124,7 +124,7 @@
|
|||
$calendar_name = $row['calendar_name'];
|
||||
|
||||
?>
|
||||
<option value="<?php echo $cakendar_id; ?>"><?php echo $calendar_name; ?></option>
|
||||
<option <?php if($config_default_calendar == $calendar_id){ echo "selected"; } ?> value="<?php echo $calendar_id; ?>"><?php echo $calendar_name; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
|
@ -134,7 +134,7 @@
|
|||
</div>
|
||||
|
||||
<hr>
|
||||
<button type="submit" name="add_client_contact" class="btn btn-primary">Save</button>
|
||||
<button type="submit" name="edit_default_settings" class="btn btn-primary">Save</button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -33,8 +33,8 @@
|
|||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link <?php if(basename($_SERVER["REQUEST_URI"]) == "settings-default.php") { echo "active"; } ?>"
|
||||
href="settings-default.php">
|
||||
<a class="nav-link <?php if(basename($_SERVER["REQUEST_URI"]) == "settings-defaults.php") { echo "active"; } ?>"
|
||||
href="settings-defaults.php">
|
||||
<i class="fa fa-fw fa-2x fa-cog"></i><br>
|
||||
Defaults
|
||||
</a>
|
||||
|
|
|
|||
Loading…
Reference in New Issue