mirror of https://github.com/itflow-org/itflow
Fixed Revenue Edit category and account fields also removed currency selection there as its automatically determined by the company default
This commit is contained in:
parent
0e3959ce00
commit
915161d812
|
|
@ -14,8 +14,8 @@ $revenue_payment_method = nullable_htmlentities($row['revenue_payment_method']);
|
|||
$revenue_amount = floatval($row['revenue_amount']);
|
||||
$revenue_currency_code = nullable_htmlentities($row['revenue_currency_code']);
|
||||
$revenue_created_at = nullable_htmlentities($row['revenue_created_at']);
|
||||
$account_id = intval($row['account_id']);
|
||||
$category_id = intval($row['category_id']);
|
||||
$account_id = intval($row['revenue_account_id']);
|
||||
$category_id = intval($row['revenue_category_id']);
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
ob_start();
|
||||
|
|
@ -43,21 +43,6 @@ ob_start();
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md">
|
||||
<label>Currency <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-money-bill"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="currency_code" required>
|
||||
<option value="">- Select Currency -</option>
|
||||
<?php foreach($currencies_array as $currency_code => $currency_name) { ?>
|
||||
<option <?php if ($revenue_currency_code == $currency_code) { echo "selected"; } ?> value="<?php echo $currency_code; ?>"><?php echo "$currency_code - $currency_name"; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md">
|
||||
<label>Amount <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
|
|
|
|||
|
|
@ -22,21 +22,6 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md">
|
||||
<label>Currency <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-money-bill"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="currency_code" required>
|
||||
<option value="">- Currency -</option>
|
||||
<?php foreach($currencies_array as $currency_code => $currency_name) { ?>
|
||||
<option <?php if ($session_company_currency == $currency_code) { echo "selected"; } ?> value="<?php echo $currency_code; ?>"><?php echo "$currency_code - $currency_name"; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md">
|
||||
<label>Amount <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
|
|
|
|||
|
|
@ -12,14 +12,13 @@ if (isset($_POST['add_revenue'])) {
|
|||
|
||||
$date = sanitizeInput($_POST['date']);
|
||||
$amount = floatval($_POST['amount']);
|
||||
$currency_code = sanitizeInput($_POST['currency_code']);
|
||||
$account = intval($_POST['account']);
|
||||
$category = intval($_POST['category']);
|
||||
$payment_method = sanitizeInput($_POST['payment_method']);
|
||||
$description = sanitizeInput($_POST['description']);
|
||||
$reference = sanitizeInput($_POST['reference']);
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO revenues SET revenue_date = '$date', revenue_amount = $amount, revenue_currency_code = '$currency_code', revenue_payment_method = '$payment_method', revenue_reference = '$reference', revenue_description = '$description', revenue_category_id = $category, revenue_account_id = $account");
|
||||
mysqli_query($mysqli,"INSERT INTO revenues SET revenue_date = '$date', revenue_amount = $amount, revenue_currency_code = '$session_company_currency', revenue_payment_method = '$payment_method', revenue_reference = '$reference', revenue_description = '$description', revenue_category_id = $category, revenue_account_id = $account");
|
||||
|
||||
$revenue_id = mysqli_insert_id($mysqli);
|
||||
|
||||
|
|
@ -39,14 +38,13 @@ if (isset($_POST['edit_revenue'])) {
|
|||
$revenue_id = intval($_POST['revenue_id']);
|
||||
$date = sanitizeInput($_POST['date']);
|
||||
$amount = floatval($_POST['amount']);
|
||||
$currency_code = sanitizeInput($_POST['currency_code']);
|
||||
$account = intval($_POST['account']);
|
||||
$category = intval($_POST['category']);
|
||||
$payment_method = sanitizeInput($_POST['payment_method']);
|
||||
$description = sanitizeInput($_POST['description']);
|
||||
$reference = sanitizeInput($_POST['reference']);
|
||||
|
||||
mysqli_query($mysqli,"UPDATE revenues SET revenue_date = '$date', revenue_amount = $amount, revenue_currency_code = '$currency_code', revenue_payment_method = '$payment_method', revenue_reference = '$reference', revenue_description = '$description', revenue_category_id = $category, revenue_account_id = $account WHERE revenue_id = $revenue_id");
|
||||
mysqli_query($mysqli,"UPDATE revenues SET revenue_date = '$date', revenue_amount = $amount, revenue_payment_method = '$payment_method', revenue_reference = '$reference', revenue_description = '$description', revenue_category_id = $category, revenue_account_id = $account WHERE revenue_id = $revenue_id");
|
||||
|
||||
// Logging
|
||||
logAction("Revenue", "Edit", "$session_name edited revenue $description", 0, $revenue_id);
|
||||
|
|
|
|||
Loading…
Reference in New Issue