mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for tests
This commit is contained in:
parent
9cc31195f7
commit
6698609512
@ -194,7 +194,8 @@ class InvoiceCalc
|
||||
*/
|
||||
private function calcLineItems()
|
||||
{
|
||||
if(!$this->invoice->line_items || !property_exists($this->invoice, 'line_items') || count($this->invoice->line_items) == 0)
|
||||
//if(!$this->invoice->line_items || !property_exists($this->invoice, 'line_items') || count($this->invoice->line_items) == 0)
|
||||
if(!$this->invoice->line_items || count($this->invoice->line_items) == 0)
|
||||
return $this;
|
||||
|
||||
$new_line_items = [];
|
||||
|
@ -48,6 +48,7 @@ class StoreInvoiceRequest extends Request
|
||||
$input = $this->all();
|
||||
|
||||
$input['client_id'] = $this->decodePrimaryKey($input['client_id']);
|
||||
$input['line_items'] = isset($input['line_items']) ?: [];
|
||||
|
||||
$this->replace($input);
|
||||
|
||||
|
@ -42,15 +42,6 @@ class UpdateInvoiceRequest extends Request
|
||||
//'invoice_type_id' => 'integer',
|
||||
];
|
||||
}
|
||||
|
||||
public function sanitize()
|
||||
{
|
||||
$input = $this->all();
|
||||
|
||||
// $this->replace($input);
|
||||
|
||||
return $this->all();
|
||||
}
|
||||
|
||||
public function sanitize()
|
||||
{
|
||||
|
@ -283,8 +283,8 @@ trait MakesInvoiceValues
|
||||
|
||||
$columns = $this->transformColumnsForLineItems($columns);
|
||||
|
||||
if(!is_array($this->line_items));
|
||||
return $data;
|
||||
//if(!is_array($this->line_items));
|
||||
// return $data;
|
||||
|
||||
$items = $this->transformLineItems($this->line_items);
|
||||
|
||||
|
@ -46,7 +46,6 @@ class UpdateCompanyLedgerTest extends TestCase
|
||||
->first();
|
||||
|
||||
$payment = $ledger->adjustment * -1;
|
||||
|
||||
$this->assertEquals($invoice->amount, $payment);
|
||||
|
||||
}
|
||||
@ -57,10 +56,11 @@ class UpdateCompanyLedgerTest extends TestCase
|
||||
*/
|
||||
public function testInvoiceIsPresentInLedger()
|
||||
{
|
||||
$this->invoice->save();
|
||||
//$this->invoice->save();
|
||||
|
||||
$ledger = CompanyLedger::whereCompanyLedgerableId($this->invoice->id)
|
||||
->whereCompanyLedgerableType(Invoice::class)
|
||||
->whereCompanyId($this->invoice->company_id)
|
||||
->get();
|
||||
|
||||
$this->assertEquals(1, count($ledger));
|
||||
|
Loading…
x
Reference in New Issue
Block a user