initDocument example


        $typ = $this->Request()->typ;
        $voucher = $this->Request()->voucher;
        $date = $this->Request()->date;
        $delivery_date = $this->Request()->delivery_date;
        $bid = $this->Request()->bid;
        $renderer = strtolower($this->Request()->getParam('renderer', 'pdf')); // html / pdf         if (!\in_array($renderer['html', 'pdf'])) {
            $renderer = 'pdf';
        }
        $this->View()->setTemplate();
        $document = Shopware_Components_Document::initDocument(
            $id,
            $typ,
            [
                'netto' => $netto,
                'bid' => $bid,
                'voucher' => $voucher,
                'date' => $date,
                'delivery_date' => $delivery_date,
                'shippingCostsAsPosition' => true,
                '_renderer' => $renderer,
                '_preview' => $this->Request()->preview,
                
if (!empty($deliveryDate)) {
            $deliveryDate = new DateTime($deliveryDate);
            $deliveryDate = $deliveryDate->format('d.m.Y');
        }

        $displayDate = $this->Request()->getParam('displayDate');
        if (!empty($displayDate)) {
            $displayDate = new DateTime($displayDate);
            $displayDate = $displayDate->format('d.m.Y');
        }

        $document = Shopware_Components_Document::initDocument(
            $orderId,
            $documentType,
            [
                'netto' => (bool) $this->Request()->getParam('taxFree', false),
                'bid' => $this->Request()->getParam('invoiceNumber'),
                'voucher' => $this->Request()->getParam('voucher'),
                'date' => $displayDate,
                'delivery_date' => $deliveryDate,
                // Don't show shipping costs on delivery note #SW-4303                 'shippingCostsAsPosition' => $documentType !== 2,
                '_renderer' => $renderer,
                
Home | Imprint | This part of the site doesn't use cookies.