Working on tax reports, delta changes and adjustments

This commit is contained in:
David Bomba 2025-11-19 12:53:27 +11:00
parent f3263b9ce5
commit a0745200d8
2 changed files with 6 additions and 21 deletions

View File

@ -89,7 +89,7 @@ class PaymentTransactionEventEntry implements ShouldQueue
}) })
->each(function($invoice){ ->each(function($invoice){
nlog(" I am inserting!!! "); // nlog(" I am inserting!!! ");
$this->setPaidRatio($invoice); $this->setPaidRatio($invoice);
//delete any other payment mutations here if this is a delete event, the refunds are redundant in this time period //delete any other payment mutations here if this is a delete event, the refunds are redundant in this time period

View File

@ -768,8 +768,7 @@ class TaxPeriodReportTest extends TestCase
$invoice = $invoice->fresh(); $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 //cash should have NONE
$payload = [ $payload = [
@ -786,25 +785,11 @@ class TaxPeriodReportTest extends TestCase
$this->assertCount(2, $data['invoices']); $this->assertCount(2, $data['invoices']);
// $invoice = $invoice->fresh(); $invoice_report = $data['invoices'][1];
// $payment = $invoice->payments()->first();
// $te = $invoice->transaction_events()->where('event_id', '!=', TransactionEvent::INVOICE_UPDATED)->get(); $this->assertEquals(-110, $invoice_report[5]);
$this->assertEquals(-10, $invoice_report[4]);
// // nlog($te->toArray()); $this->assertEquals('adjustment', $invoice_report[6]);
// $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);
} }