diff --git a/app/Listeners/Payment/PaymentTransactionEventEntry.php b/app/Listeners/Payment/PaymentTransactionEventEntry.php index 0b9394208f..ba5bbc7e2a 100644 --- a/app/Listeners/Payment/PaymentTransactionEventEntry.php +++ b/app/Listeners/Payment/PaymentTransactionEventEntry.php @@ -89,7 +89,7 @@ class PaymentTransactionEventEntry implements ShouldQueue }) ->each(function($invoice){ - nlog(" I am inserting!!! "); + // nlog(" I am inserting!!! "); $this->setPaidRatio($invoice); //delete any other payment mutations here if this is a delete event, the refunds are redundant in this time period diff --git a/tests/Feature/Export/TaxPeriodReportTest.php b/tests/Feature/Export/TaxPeriodReportTest.php index edd7ca7df3..d739a1ba93 100644 --- a/tests/Feature/Export/TaxPeriodReportTest.php +++ b/tests/Feature/Export/TaxPeriodReportTest.php @@ -768,8 +768,7 @@ class TaxPeriodReportTest extends TestCase $invoice = $invoice->fresh(); - nlog($invoice->transaction_events()->where('event_id', 2)->first()->toArray()); - + // nlog($invoice->transaction_events()->where('event_id', 2)->first()->toArray()); //cash should have NONE $payload = [ @@ -786,25 +785,11 @@ class TaxPeriodReportTest extends TestCase $this->assertCount(2, $data['invoices']); - // $invoice = $invoice->fresh(); - // $payment = $invoice->payments()->first(); + $invoice_report = $data['invoices'][1]; - // $te = $invoice->transaction_events()->where('event_id', '!=', TransactionEvent::INVOICE_UPDATED)->get(); - - // // nlog($te->toArray()); - - // $this->assertEquals(110, $invoice->balance); - // $this->assertEquals(220, $invoice->paid_to_date); - // $this->assertEquals(3, $invoice->status_id); - // $this->assertEquals(110, $payment->refunded); - // $this->assertEquals(330, $payment->applied); - // $this->assertEquals(330, $payment->amount); - - // $this->assertEquals(110, $te->first()->payment_refunded); - // $this->assertEquals(330, $te->first()->payment_applied); - // $this->assertEquals(330, $te->first()->payment_amount); - // $this->assertEquals(220, $te->first()->invoice_paid_to_date); - // $this->assertEquals(110, $te->first()->invoice_balance); + $this->assertEquals(-110, $invoice_report[5]); + $this->assertEquals(-10, $invoice_report[4]); + $this->assertEquals('adjustment', $invoice_report[6]); }