Small payment bugfixes

This commit is contained in:
Wrongecho
2026-08-30 23:15:16 +01:00
parent 16b46c1f1a
commit d9cb0251b0
2 changed files with 4 additions and 12 deletions

View File

@@ -6,8 +6,8 @@ $invoice_id = intval($_GET['id']);
$sql = mysqli_query(
$mysqli,
"SELECT client_currency_code, client_id, client_name, contact_email, contact_name, invoice_amount,
invoice_id, invoice_number, invoice_prefix FROM invoices
"SELECT client_id, client_name, contact_email, contact_name, invoice_amount,
invoice_id, invoice_number, invoice_prefix, invoice_currency_code FROM invoices
LEFT JOIN clients ON invoice_client_id = client_id
LEFT JOIN contacts ON client_id = contact_client_id AND contact_primary = 1
WHERE invoice_id = $invoice_id
@@ -21,7 +21,7 @@ $invoice_number = intval($row['invoice_number']);
$invoice_amount = floatval($row['invoice_amount']);
$client_id = intval($row['client_id']);
$client_name = escapeHtml($row['client_name']);
$client_currency_code = escapeHtml($row['client_currency_code']);
$client_currency_code = escapeHtml($row['invoice_currency_code']);
$contact_name = escapeHtml($row['contact_name']);
$contact_email = escapeHtml($row['contact_email']);

View File

@@ -682,9 +682,6 @@ if (isset($_GET['delete_payment'])) {
logAudit("Invoice", "Edit", "$session_name deleted Payment on Invoice $invoice_prefix$invoice_number", $client_id, $invoice_id);
flashAlert("Payment deleted", 'error');
if ($config_stripe_enable) {
flashAlert("Payment deleted - Stripe payments must be manually refunded in Stripe", 'error');
}
redirect();
@@ -775,12 +772,7 @@ if (isset($_GET['refund_payment_stripe'])) {
$invoice_status = updateInvoiceStatusFromPayments($invoice_id);
mysqli_query($mysqli,"INSERT INTO history SET history_status = '$invoice_status', history_description = 'Payment $stripe_payment_intent_id deleted and refunded', history_invoice_id = $invoice_id");
// Log info
$extended_log_desc = '';
if (!$pi_livemode) {
$extended_log_desc = '(DEV MODE)';
}
logAudit("Invoice", "Edit", "$session_name refunded and deleted Payment $stripe_payment_intent_id on Invoice $invoice_prefix$invoice_number", $client_id, $invoice_id);
flashAlert("Payment deleted and refunded in Stripe", 'error');