diff --git a/ajax/ajax_revenue_edit.php b/ajax/ajax_revenue_edit.php index a97b7faa..11998bdd 100644 --- a/ajax/ajax_revenue_edit.php +++ b/ajax/ajax_revenue_edit.php @@ -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(); -
- -
-
- -
- -
-
-
diff --git a/modals/revenue_add_modal.php b/modals/revenue_add_modal.php index cef82772..29a96a0a 100644 --- a/modals/revenue_add_modal.php +++ b/modals/revenue_add_modal.php @@ -22,21 +22,6 @@
-
- -
-
- -
- -
-
-
diff --git a/post/user/revenue.php b/post/user/revenue.php index 47fa91bf..bdc82adb 100644 --- a/post/user/revenue.php +++ b/post/user/revenue.php @@ -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);