diff --git a/app/Http/Requests/Payment/StorePaymentRequest.php b/app/Http/Requests/Payment/StorePaymentRequest.php index 81f8380fb55b..e3c845d8176f 100644 --- a/app/Http/Requests/Payment/StorePaymentRequest.php +++ b/app/Http/Requests/Payment/StorePaymentRequest.php @@ -39,8 +39,6 @@ class StorePaymentRequest extends Request { $input = $this->all(); - // nlog(print_r($input,1)); - $invoices_total = 0; $credits_total = 0; diff --git a/app/Repositories/PaymentRepository.php b/app/Repositories/PaymentRepository.php index ebcb5add517b..c2fc9501288a 100644 --- a/app/Repositories/PaymentRepository.php +++ b/app/Repositories/PaymentRepository.php @@ -89,11 +89,11 @@ class PaymentRepository extends BaseRepository { if (array_key_exists('credits', $data) && is_array($data['credits']) && count($data['credits']) > 0) { $_credit_totals = array_sum(array_column($data['credits'], 'amount')); - if ($data['amount'] == $_credit_totals) { - $data['amount'] = 0; - } else { + // if ($data['amount'] == $_credit_totals) { + // $data['amount'] = 0; + // } else { $client->service()->updatePaidToDate($_credit_totals)->save(); - } + // } } } @@ -170,11 +170,6 @@ class PaymentRepository extends BaseRepository { event( new PaymentWasCreated( $payment, $payment->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null) ) ); } - // nlog("payment amount = {$payment->amount}"); - // nlog("payment applied = {$payment->applied}"); - // nlog("invoice totals = {$invoice_totals}"); - // nlog("credit totals = {$credit_totals}"); - $payment->applied += ($invoice_totals - $credit_totals); //wont work because - check tests // $payment->applied += $invoice_totals; //wont work because - check tests diff --git a/tests/Feature/RecurringExpenseApiTest.php b/tests/Feature/RecurringExpenseApiTest.php index 586db2373426..e983248dcc25 100644 --- a/tests/Feature/RecurringExpenseApiTest.php +++ b/tests/Feature/RecurringExpenseApiTest.php @@ -185,7 +185,7 @@ class RecurringExpenseApiTest extends TestCase ])->post('/api/v1/recurring_expenses/bulk?action=start', $data); $arr = $response->json(); -nlog($arr); + $this->assertEquals(RecurringInvoice::STATUS_ACTIVE, $arr['data'][0]['status_id']); } @@ -207,7 +207,7 @@ nlog($arr); ])->post('/api/v1/recurring_expenses/bulk?action=stop', $data); $arr = $response->json(); -nlog($arr); + $this->assertEquals(RecurringInvoice::STATUS_PAUSED, $arr['data'][0]['status_id']); } diff --git a/tests/Integration/PaymentDrivers/AuthorizeTest.php b/tests/Integration/PaymentDrivers/AuthorizeTest.php index 33934756a289..ed1415196206 100644 --- a/tests/Integration/PaymentDrivers/AuthorizeTest.php +++ b/tests/Integration/PaymentDrivers/AuthorizeTest.php @@ -311,9 +311,9 @@ class AuthorizeTest extends TestCase $response = $controller->executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::SANDBOX); // nlog($response); - nlog($response->getTransactionResponse()->getMessages() !== null); - nlog($response->getTransactionResponse()->getMessages()); - nlog($response->getTransactionResponse()->getMessages()[0]); + // nlog($response->getTransactionResponse()->getMessages() !== null); + // nlog($response->getTransactionResponse()->getMessages()); + // nlog($response->getTransactionResponse()->getMessages()[0]); //nlog($response->getTransactionResponse()->getMessages()[0]->getCode()); $code = ''; diff --git a/tests/Unit/InvoiceInclusiveTest.php b/tests/Unit/InvoiceInclusiveTest.php index 08f5a24e0c04..01048d069b72 100644 --- a/tests/Unit/InvoiceInclusiveTest.php +++ b/tests/Unit/InvoiceInclusiveTest.php @@ -275,7 +275,9 @@ class InvoiceInclusiveTest extends TestCase $this->assertEquals($this->invoice_calc->getSubTotal(), 19); $this->assertEquals($this->invoice_calc->getTotalDiscount(), 0.95); $this->assertEquals($this->invoice_calc->getTotalTaxes(), 4.92); - nlog($this->invoice_calc->getTaxMap()); + + // nlog($this->invoice_calc->getTaxMap()); + $this->assertEquals(count($this->invoice_calc->getTaxMap()), 1); $this->assertEquals($this->invoice_calc->getTotal(), 18.05); $this->assertEquals($this->invoice_calc->getBalance(), 18.05);