Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Model/Dibs/Items.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ public function addItems($items)
->setName($itemName)
->setUnit("st")
->setQuantity(round($qty, 0))
->setTaxRate($this->addZeroes($vat)) // the tax rate i.e 25% (2500)
->setTaxAmount($this->addZeroes($this->getTotalTaxAmount($unitPrice * $qty, $vat, false))) // total tax amount
->setTaxRate($vat)
->setTaxAmount($this->getTotalTaxAmount($unitPrice * $qty, $vat, false)) // total tax amount
->setUnitPrice((int) $unitPriceExclTax) // excl. tax price per item
->setNetTotalAmount((int) ($unitPriceExclTax * $qty)) // excl. tax
->setGrossTotalAmount((int) ($unitPrice * $qty)); // incl. tax
Expand Down Expand Up @@ -329,7 +329,7 @@ public function addShipping($address)
->setName((string)__('Shipping Fee (%1)', $address->getShippingDescription()))
->setUnit("st") // TODO! We need to map these somehow!
->setQuantity(1)
->setTaxRate($this->addZeroes($vat)) // the tax rate i.e 25% (2500)
->setTaxRate($vat)
->setTaxAmount($this->addZeroes($taxAmount)) // total tax amount
->setUnitPrice($this->addZeroes($exclTax)) // excl. tax price per item
->setNetTotalAmount($this->addZeroes($exclTax)) // excl. tax
Expand Down Expand Up @@ -428,13 +428,13 @@ public function generateInvoiceFeeItem($invoiceLabel, $invoiceFee, $vatIncluded)
$feeItem
->setName($invoiceLabel)
->setReference(strtolower(str_replace(" ", "_", $invoiceLabel)))
->setTaxRate($this->addZeroes($taxRate))
->setTaxRate($taxRate)
->setGrossTotalAmount($this->addZeroes($invoiceFeeInclTax)) // incl tax
->setNetTotalAmount($this->addZeroes($invoiceFeeExclTax)) // // excl. tax
->setUnit("st")
->setQuantity(1)
->setUnitPrice($this->addZeroes($invoiceFeeExclTax)) // // excl. tax
->setTaxAmount($this->addZeroes($taxAmount)); // tax amount
->setTaxAmount($taxAmount); // tax amount

return $feeItem;
}
Expand Down Expand Up @@ -466,7 +466,7 @@ public function addDiscounts($couponCode)
->setName($couponCode ? (string)__('Discount (%1)', $couponCode) : (string)__('Discount'))
->setUnit("st")
->setQuantity(1)
->setTaxRate($this->addZeroes($vat)) // the tax rate i.e 25% (2500)
->setTaxRate($vat)
->setTaxAmount($taxAmount) // total tax amount
->setUnitPrice(0) // excl. tax price per item
->setNetTotalAmount(-$amountExclTax) // excl. tax
Expand Down