mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Fixes for showing fees in both the product and tax tables
This commit is contained in:
parent
14f8541e4d
commit
e716bb5a02
@ -47,15 +47,4 @@ class LoginRequest extends Request
|
||||
];
|
||||
}
|
||||
|
||||
// public function prepareForValidation()
|
||||
// {
|
||||
// $input = $this->all();
|
||||
|
||||
// // if(base64_decode(base64_encode($input['password'])) === $input['password'])
|
||||
// // $input['password'] = base64_decode($input['password']);
|
||||
|
||||
// // nlog($input['password']);
|
||||
|
||||
// $this->replace($input);
|
||||
// }
|
||||
}
|
||||
|
@ -24,7 +24,8 @@ class BlackListRule implements Rule
|
||||
'vusra.com',
|
||||
'fourthgenet.com',
|
||||
'arxxwalls.com',
|
||||
'superhostforumla.com'
|
||||
'superhostforumla.com',
|
||||
'wnpop.com',
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -394,7 +394,7 @@ class Design extends BaseDesign
|
||||
public function productTable(): array
|
||||
{
|
||||
$product_items = collect($this->entity->line_items)->filter(function ($item) {
|
||||
return $item->type_id == 1 || $item->type_id == 6;
|
||||
return $item->type_id == 1 || $item->type_id == 6 || $item->type_id == 5;
|
||||
});
|
||||
|
||||
if (count($product_items) == 0) {
|
||||
|
@ -282,9 +282,9 @@ trait MakesInvoiceValues
|
||||
}
|
||||
|
||||
if ($table_type == '$task' && $item->type_id != 2) {
|
||||
if ($item->type_id != 4 && $item->type_id != 5) {
|
||||
// if ($item->type_id != 4 && $item->type_id != 5) {
|
||||
continue;
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
$helpers = new Helpers();
|
||||
|
@ -13,6 +13,7 @@ namespace Tests\Unit;
|
||||
|
||||
use App\Factory\InvoiceItemFactory;
|
||||
use App\Helpers\Invoice\InvoiceSum;
|
||||
use App\Helpers\Invoice\InvoiceSumInclusive;
|
||||
use App\Models\Invoice;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
use Tests\MockAccountData;
|
||||
@ -41,11 +42,47 @@ class InvoiceTest extends TestCase
|
||||
|
||||
$this->invoice->line_items = $this->buildLineItems();
|
||||
|
||||
$this->invoice->usesinclusive_taxes = true;
|
||||
$this->invoice->uses_inclusive_taxes = true;
|
||||
|
||||
$this->invoice_calc = new InvoiceSum($this->invoice);
|
||||
}
|
||||
|
||||
public function testInclusiveRounding()
|
||||
{
|
||||
$this->invoice->line_items = [];
|
||||
$this->invoice->discount = 0;
|
||||
$this->invoice->uses_inclusive_taxes = true;
|
||||
$this->invoice->save();
|
||||
|
||||
|
||||
$item = InvoiceItemFactory::create();
|
||||
$item->quantity = 1;
|
||||
$item->cost = 50;
|
||||
$item->tax_name1 = "taxy";
|
||||
$item->tax_rate1 = 19;
|
||||
|
||||
$line_items[] = $item;
|
||||
|
||||
$item = InvoiceItemFactory::create();
|
||||
$item->quantity = 1;
|
||||
$item->cost = 50;
|
||||
$item->tax_name1 = "taxy";
|
||||
$item->tax_rate1 = 19;
|
||||
|
||||
$line_items[] = $item;
|
||||
|
||||
$this->invoice->line_items = $line_items;
|
||||
$this->invoice->save();
|
||||
|
||||
$invoice_calc = new InvoiceSumInclusive($this->invoice);
|
||||
|
||||
$invoice_calc->build();
|
||||
// $this->invoice->save();
|
||||
|
||||
$this->assertEquals($invoice_calc->getTotalTaxes(), 15.96);
|
||||
|
||||
}
|
||||
|
||||
private function buildLineItems()
|
||||
{
|
||||
$line_items = [];
|
||||
|
Loading…
x
Reference in New Issue
Block a user