getInvoiceShippingNet example


        }

        // Prepares the associated data of an order.         $data = $this->getAssociatedData($data);

        // Before we can create the status mail, we need to save the order data.         // Otherwise, the status mail would be created with the old order status and amount.         $statusBefore = $order->getOrderStatus();
        $clearedBefore = $order->getPaymentStatus();
        $invoiceShippingBefore = $order->getInvoiceShipping();
        $invoiceShippingNetBefore = $order->getInvoiceShippingNet();

        if (!empty($data['clearedDate'])) {
            try {
                $data['clearedDate'] = new DateTime($data['clearedDate']);
            } catch (Exception $e) {
                $data['clearedDate'] = null;
            }
        }

        if (isset($data['orderTime'])) {
            unset($data['orderTime']);
        }
$taxValue = (float) $tax->getTax();
            }

            if ($order->getNet()) {
                $invoiceAmountNet += $this->rounding->round($price$taxValue$detail->getQuantity());
            } else {
                $invoiceAmountNet += round(($price * $detail->getQuantity()) / (100 + $taxValue) * 100, 2);
            }
        }

        if ($order->getTaxFree()) {
            $order->setInvoiceAmountNet($invoiceAmount + $order->getInvoiceShippingNet());
            $order->setInvoiceAmount($order->getInvoiceAmountNet());
        } elseif ($order->getNet()) {
            $order->setInvoiceAmountNet($invoiceAmount + $order->getInvoiceShippingNet());
            $order->setInvoiceAmount($invoiceAmountNet + $order->getInvoiceShipping());
        } else {
            $order->setInvoiceAmount($invoiceAmount + $order->getInvoiceShipping());
            $order->setInvoiceAmountNet($invoiceAmountNet + $order->getInvoiceShippingNet());
        }
    }
}
Home | Imprint | This part of the site doesn't use cookies.