1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-05 18:52:44 +01:00

fixes for refunds

This commit is contained in:
David Bomba 2020-06-27 10:20:27 +10:00
parent fe995ca878
commit 1ce5b7ad8e
3 changed files with 4 additions and 4 deletions

View File

@ -120,6 +120,7 @@ class AuthorizeCreditCard
$payment->client_id = $this->authorize->client->id;
$payment->company_gateway_id = $this->authorize->company_gateway->id;
$payment->status_id = Payment::STATUS_COMPLETED;
$payment->gateway_type_id = $this->authorize->payment_method;
$payment->type_id = PaymentType::CREDIT_CARD_OTHER;
$payment->currency_id = $this->authorize->client->getSetting('currency_id');
$payment->date = Carbon::now();
@ -129,7 +130,6 @@ class AuthorizeCreditCard
$payment->client->getNextPaymentNumber($this->authorize->client);
$payment->save();
$this->authorize->attachInvoices($payment, $request->hashed_ids);
$payment->service()->updateInvoicePayment();

View File

@ -243,9 +243,9 @@ class RefundPayment
//todo adjust ledger balance here? or after and reference the credit and its total
}
$ledger_string = "Refund for Invoice {$invoice->number} for amount " . $refunded_invoice['amount']; //todo
// $ledger_string = "Refund for Invoice {$invoice->number} for amount " . $refunded_invoice['amount']; //todo
$this->credit_note->ledger()->updateCreditBalance($adjustment_amount, $ledger_string);
// $this->credit_note->ledger()->updateCreditBalance($adjustment_amount, $ledger_string);
$client = $this->payment->client->fresh();
$client->paid_to_date -= $this->total_refund;

View File

@ -65,7 +65,7 @@ class UserTest extends TestCase
$data = [
'first_name' => 'hey',
'last_name' => 'you',
'email' => 'bob@good.ole.boys.com',
'email' => 'bob1@good.ole.boys.com',
'company_user' => [
'is_admin' => false,
'is_owner' => false,