mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Updates for searchcontroller
This commit is contained in:
parent
9f384af125
commit
caa5385e22
@ -349,14 +349,16 @@ class InvoiceItemSumInclusive
|
|||||||
{
|
{
|
||||||
$this->setGroupedTaxes(collect([]));
|
$this->setGroupedTaxes(collect([]));
|
||||||
|
|
||||||
$item_tax = 0;
|
|
||||||
|
|
||||||
foreach ($this->line_items as $this->item) {
|
foreach ($this->line_items as $this->item) {
|
||||||
if ($this->sub_total == 0) {
|
if ($this->sub_total == 0) {
|
||||||
$amount = $this->item->line_total;
|
$amount = $this->item->line_total;
|
||||||
} else {
|
} else {
|
||||||
$amount = $this->item->line_total - ($this->item->line_total * ($this->invoice->discount / $this->sub_total));
|
$amount = ($this->sub_total > 0) ? $this->item->line_total - ($this->invoice->discount * ($this->item->line_total / $this->sub_total)) : 0;
|
||||||
|
// $amount = $this->item->line_total - ($this->item->line_total * ($this->invoice->discount / $this->sub_total));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$item_tax = 0;
|
||||||
|
|
||||||
$item_tax_rate1_total = $this->calcInclusiveLineTax($this->item->tax_rate1, $amount);
|
$item_tax_rate1_total = $this->calcInclusiveLineTax($this->item->tax_rate1, $amount);
|
||||||
|
|
||||||
@ -381,9 +383,17 @@ class InvoiceItemSumInclusive
|
|||||||
if ($item_tax_rate3_total != 0) {
|
if ($item_tax_rate3_total != 0) {
|
||||||
$this->groupTax($this->item->tax_name3, $this->item->tax_rate3, $item_tax_rate3_total);
|
$this->groupTax($this->item->tax_name3, $this->item->tax_rate3, $item_tax_rate3_total);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->setTotalTaxes($this->getTotalTaxes() + $item_tax);
|
||||||
|
$this->item->gross_line_total = $this->getLineTotal() + $item_tax;
|
||||||
|
|
||||||
|
$this->item->tax_amount = $item_tax;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->setTotalTaxes($item_tax);
|
return $this;
|
||||||
|
|
||||||
|
// $this->setTotalTaxes($item_tax);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -315,8 +315,9 @@ class InvoiceSumInclusive
|
|||||||
|
|
||||||
public function setTaxMap()
|
public function setTaxMap()
|
||||||
{
|
{
|
||||||
if ($this->invoice->is_amount_discount == true) {
|
if ($this->invoice->is_amount_discount) {
|
||||||
$this->invoice_items->calcTaxesWithAmountDiscount();
|
$this->invoice_items->calcTaxesWithAmountDiscount();
|
||||||
|
$this->invoice->line_items = $this->invoice_items->getLineItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->tax_map = collect();
|
$this->tax_map = collect();
|
||||||
|
@ -86,7 +86,7 @@ class SearchController extends Controller
|
|||||||
'name' => $invoice->client->present()->name() . ' - ' . $invoice->number,
|
'name' => $invoice->client->present()->name() . ' - ' . $invoice->number,
|
||||||
'type' => '/invoice',
|
'type' => '/invoice',
|
||||||
'id' => $invoice->hashed_id,
|
'id' => $invoice->hashed_id,
|
||||||
'path' => "/clients/{$invoice->hashed_id}/edit",
|
'path' => "/invoices/{$invoice->hashed_id}/edit",
|
||||||
'heading' => ctrans('texts.invoices')
|
'heading' => ctrans('texts.invoices')
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
@ -104,7 +104,7 @@ class SearchController extends Controller
|
|||||||
'custom_fields' => '/settings/user_details/custom_fields',
|
'custom_fields' => '/settings/user_details/custom_fields',
|
||||||
'preferences' => '/settings/user_details/preferences',
|
'preferences' => '/settings/user_details/preferences',
|
||||||
'company_details' => '/settings/company_details',
|
'company_details' => '/settings/company_details',
|
||||||
'company_details,details' => '/settings/company_details/details',
|
'company_details,details' => '/settings/company_details/',
|
||||||
'company_details,address' => '/settings/company_details/address',
|
'company_details,address' => '/settings/company_details/address',
|
||||||
'company_details,logo' => '/settings/company_details/logo',
|
'company_details,logo' => '/settings/company_details/logo',
|
||||||
'company_details,defaults' => '/settings/company_details/defaults',
|
'company_details,defaults' => '/settings/company_details/defaults',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user