We will be off from 27/1 (Monday) to 31/1 (Friday) (GMT +7) for our Tet Holiday (Lunar New Year) in our country

Commit e07ffe3d authored by attilak's avatar attilak

format the tax amount in openinvoice line items

parent 68cde1e1
...@@ -213,9 +213,11 @@ class CheckoutDataBuilder implements BuilderInterface ...@@ -213,9 +213,11 @@ class CheckoutDataBuilder implements BuilderInterface
$priceExcludingTax = $item->getPriceInclTax() - $item->getTaxAmount(); $priceExcludingTax = $item->getPriceInclTax() - $item->getTaxAmount();
$formattedPriceExcludingTax = $this->adyenHelper->formatAmount($priceExcludingTax, $currency); $formattedPriceExcludingTax = $this->adyenHelper->formatAmount($priceExcludingTax, $currency);
$formattedTaxAmount = $this->adyenHelper->formatAmount($item->getTaxAmount(), $currency);
$formFields['lineItems'][] = [ $formFields['lineItems'][] = [
'amountExcludingTax' => $formattedPriceExcludingTax, 'amountExcludingTax' => $formattedPriceExcludingTax,
'taxAmount' => $item->getTaxAmount(), 'taxAmount' => $formattedTaxAmount,
'description' => $item->getName(), 'description' => $item->getName(),
'id' => $item->getId(), 'id' => $item->getId(),
'quantity' => $item->getQty(), 'quantity' => $item->getQty(),
...@@ -247,13 +249,16 @@ class CheckoutDataBuilder implements BuilderInterface ...@@ -247,13 +249,16 @@ class CheckoutDataBuilder implements BuilderInterface
if ($this->quote->getShippingAddress()->getShippingAmount() > 0 || $this->quote->getShippingAddress()->getShippingTaxAmount() > 0) { if ($this->quote->getShippingAddress()->getShippingAmount() > 0 || $this->quote->getShippingAddress()->getShippingTaxAmount() > 0) {
$priceExcludingTax = $this->quote->getShippingAddress()->getShippingAmount() - $this->quote->getShippingAddress()->getShippingTaxAmount(); $priceExcludingTax = $this->quote->getShippingAddress()->getShippingAmount() - $this->quote->getShippingAddress()->getShippingTaxAmount();
$formattedTaxAmount = $this->adyenHelper->formatAmount($this->quote->getShippingAddress()->getShippingTaxAmount(), $currency);
$formattedPriceExcludingTax = $this->adyenHelper->formatAmount($priceExcludingTax, $currency); $formattedPriceExcludingTax = $this->adyenHelper->formatAmount($priceExcludingTax, $currency);
$taxClassId = $this->taxConfig->getShippingTaxClass($this->storeManager->getStore()->getId()); $taxClassId = $this->taxConfig->getShippingTaxClass($this->storeManager->getStore()->getId());
$formFields['lineItems'][] = [ $formFields['lineItems'][] = [
'amountExcludingTax' => $formattedPriceExcludingTax, 'amountExcludingTax' => $formattedPriceExcludingTax,
'taxAmount' => $this->quote->getShippingAddress()->getShippingTaxAmount(), 'taxAmount' => $formattedTaxAmount,
'description' => $order->getShippingDescription(), 'description' => $order->getShippingDescription(),
'quantity' => 1, 'quantity' => 1,
'taxPercentage' => $this->quote->getShippingAddress()->getShippingTaxAmount() 'taxPercentage' => $this->quote->getShippingAddress()->getShippingTaxAmount()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment