mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-07 01:14:34 -04:00
Adjustments for restoring a deleted invoice with a deleted payment
This commit is contained in:
parent
8515b350be
commit
c858dcf40d
@ -281,6 +281,7 @@ public function testStorePaymentWithCreditsThenDeletingInvoicesAndThenPayments()
|
|||||||
$payment_id = $arr['data']['id'];
|
$payment_id = $arr['data']['id'];
|
||||||
|
|
||||||
$payment = Payment::find($this->decodePrimaryKey($payment_id));
|
$payment = Payment::find($this->decodePrimaryKey($payment_id));
|
||||||
|
$credit = $credit->fresh();
|
||||||
|
|
||||||
$this->assertNotNull($payment);
|
$this->assertNotNull($payment);
|
||||||
$this->assertNotNull($payment->invoices());
|
$this->assertNotNull($payment->invoices());
|
||||||
@ -288,6 +289,7 @@ public function testStorePaymentWithCreditsThenDeletingInvoicesAndThenPayments()
|
|||||||
$this->assertEquals(80, $payment->amount);
|
$this->assertEquals(80, $payment->amount);
|
||||||
$this->assertEquals(0, $client->fresh()->balance);
|
$this->assertEquals(0, $client->fresh()->balance);
|
||||||
$this->assertEquals(100, $client->fresh()->paid_to_date);
|
$this->assertEquals(100, $client->fresh()->paid_to_date);
|
||||||
|
$this->assertEquals(0, $credit->balance);
|
||||||
|
|
||||||
$invoice = $invoice->fresh();
|
$invoice = $invoice->fresh();
|
||||||
|
|
||||||
@ -346,29 +348,13 @@ public function testStorePaymentWithCreditsThenDeletingInvoicesAndThenPayments()
|
|||||||
$this->assertTrue($invoice->is_deleted);
|
$this->assertTrue($invoice->is_deleted);
|
||||||
$this->assertTrue($invoice->trashed());
|
$this->assertTrue($invoice->trashed());
|
||||||
|
|
||||||
// $this->assertEquals(0, $payment->amount);
|
$client = $client->fresh();
|
||||||
// $this->assertEquals(0, $client->fresh()->balance);
|
$credit = $credit->fresh();
|
||||||
// $this->assertEquals(0, $client->fresh()->paid_to_date);
|
|
||||||
|
|
||||||
// $data = [
|
$this->assertEquals(0, $client->balance);
|
||||||
// 'action' => 'restore',
|
$this->assertEquals(0, $client->paid_to_date);
|
||||||
// 'ids' => [
|
// $this->assertEquals(20, $client->credit_balance);
|
||||||
// $invoice->hashed_id,
|
$this->assertEquals(20, $credit->balance);
|
||||||
// ],
|
|
||||||
// ];
|
|
||||||
|
|
||||||
// $response = $this->withHeaders([
|
|
||||||
// 'X-API-SECRET' => config('ninja.api_secret'),
|
|
||||||
// 'X-API-TOKEN' => $this->token,
|
|
||||||
// ])->post('/api/v1/invoices/bulk', $data);
|
|
||||||
|
|
||||||
// $invoice = $invoice->fresh();
|
|
||||||
// $this->assertEquals(false, $invoice->is_deleted);
|
|
||||||
|
|
||||||
// $payment = $payment->fresh();
|
|
||||||
|
|
||||||
// $this->assertEquals(0, $payment->amount);
|
|
||||||
// $this->assertEquals(20, $client->fresh()->paid_to_date);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user