inclusive tax calculate fixed..
This commit is contained in:
parent
78016a1a94
commit
81940efdef
@ -77,6 +77,9 @@ class CreateDocumentItem extends Job
|
|||||||
case 'fixed':
|
case 'fixed':
|
||||||
$tax_amount = $tax->rate * (double) $this->request['quantity'];
|
$tax_amount = $tax->rate * (double) $this->request['quantity'];
|
||||||
|
|
||||||
|
// @todo tax calculate check here
|
||||||
|
//$tax_amount = round(abs($tax_amount), $precision);
|
||||||
|
|
||||||
$item_taxes[] = [
|
$item_taxes[] = [
|
||||||
'company_id' => $this->document->company_id,
|
'company_id' => $this->document->company_id,
|
||||||
'type' => $this->document->type,
|
'type' => $this->document->type,
|
||||||
@ -92,6 +95,9 @@ class CreateDocumentItem extends Job
|
|||||||
case 'withholding':
|
case 'withholding':
|
||||||
$tax_amount = 0 - $item_discounted_amount * ($tax->rate / 100);
|
$tax_amount = 0 - $item_discounted_amount * ($tax->rate / 100);
|
||||||
|
|
||||||
|
// @todo tax calculate check here
|
||||||
|
//$tax_amount = round(abs($tax_amount), $precision);
|
||||||
|
|
||||||
$item_taxes[] = [
|
$item_taxes[] = [
|
||||||
'company_id' => $this->document->company_id,
|
'company_id' => $this->document->company_id,
|
||||||
'type' => $this->document->type,
|
'type' => $this->document->type,
|
||||||
@ -107,6 +113,9 @@ class CreateDocumentItem extends Job
|
|||||||
default:
|
default:
|
||||||
$tax_amount = $item_discounted_amount * ($tax->rate / 100);
|
$tax_amount = $item_discounted_amount * ($tax->rate / 100);
|
||||||
|
|
||||||
|
// @todo tax calculate check here
|
||||||
|
//$tax_amount = round(abs($tax_amount), $precision);
|
||||||
|
|
||||||
$item_taxes[] = [
|
$item_taxes[] = [
|
||||||
'company_id' => $this->document->company_id,
|
'company_id' => $this->document->company_id,
|
||||||
'type' => $this->document->type,
|
'type' => $this->document->type,
|
||||||
@ -130,6 +139,8 @@ class CreateDocumentItem extends Job
|
|||||||
foreach ($inclusives as $inclusive) {
|
foreach ($inclusives as $inclusive) {
|
||||||
$tax_amount = $item_base_rate * ($inclusive->rate / 100);
|
$tax_amount = $item_base_rate * ($inclusive->rate / 100);
|
||||||
|
|
||||||
|
$tax_amount = round(abs($tax_amount), $precision);
|
||||||
|
|
||||||
$item_taxes[] = [
|
$item_taxes[] = [
|
||||||
'company_id' => $this->document->company_id,
|
'company_id' => $this->document->company_id,
|
||||||
'type' => $this->document->type,
|
'type' => $this->document->type,
|
||||||
@ -149,6 +160,8 @@ class CreateDocumentItem extends Job
|
|||||||
foreach ($compounds as $compound) {
|
foreach ($compounds as $compound) {
|
||||||
$tax_amount = (($item_discounted_amount + $item_tax_total) / 100) * $compound->rate;
|
$tax_amount = (($item_discounted_amount + $item_tax_total) / 100) * $compound->rate;
|
||||||
|
|
||||||
|
$tax_amount = round(abs($tax_amount), $precision);
|
||||||
|
|
||||||
$item_taxes[] = [
|
$item_taxes[] = [
|
||||||
'company_id' => $this->document->company_id,
|
'company_id' => $this->document->company_id,
|
||||||
'type' => $this->document->type,
|
'type' => $this->document->type,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user