if (!$print_delivery_note) { //$invoice_products = $class_mi->retrieveInvoiceProducts($invoice['invoices_id']); $orders_total = $class_o->retrieveTotals($order_id); } if (strtoupper(trim($order['delivery_name'])) != strtoupper(trim($order['billing_name']))) { $print_address_note = true; } //START DRAWING INVOICE //Shipping Address $boxpos1x = $margin + 1; $boxpos2x = 80; $boxpos_y = 30; $address_height_used = $order['delivery_company'] != '' ? $address_height2 : $address_height; $pdf->setFont('Arial', '', '10'); $pdf->SetDrawColor($gray, $gray, $gray); $pdf->Rect($boxpos1x, $boxpos_y, $address_width, $address_height_used); if ($print_address_note) { $pdf->Rect($boxpos2x, $boxpos_y, $address_width, $address_height_used); } $box1x = $boxpos1x + 2; $box2x = $boxpos2x + 2; $box_y = $boxpos_y + 2; $ypos = $box_y; $pdf->SetXY($box1x, $ypos); $pdf->SetTextColor($gray, $gray, $gray); $pdf->Cell($address_width, 4, 'Empfänger:'); $ypos += 6; if ($order['delivery_company'] != '') { $pdf->SetXY($box1x, $ypos); $pdf->setFont('Arial', 'B', '10'); $pdf->SetTextColor(0, 0, 0);
//START DRAWING INVOICE //Invoice Header $pdf->setFont('Arial', '', '11'); $pdf->SetXY($margin, $margin); $header_text = $print_delivery_note ? 'Lieferschein für Bestell-Nr. ' . $order['orders_no'] : 'Rechnung für ' . $class_pi->detail['invoice_no']; $pdf->Cell(70, 10, $header_text, 0, 0); $pdf->SetXY(80, $margin); $pdf->Cell(70, 10, tep_date_only($class_pi->detail['invoice_date']), 0, 0); //Shipping Address $boxpos1x = $margin + 1; $boxpos2x = 80; $boxpos_y = 36; $address_height_used = $order['delivery_company'] != '' ? $address_height2 : $address_height; $pdf->setFont('Arial', '', '10'); $pdf->SetDrawColor($gray, $gray, $gray); $pdf->Rect($boxpos1x, $boxpos_y, $address_width, $address_height_used); if ($print_address_note) { $pdf->Rect($boxpos2x, $boxpos_y, $address_width, $address_height_used); } $box1x = $boxpos1x + 2; $box2x = $boxpos2x + 2; $box_y = $boxpos_y + 4; $ypos = $box_y; $pdf->SetXY($box1x, $ypos); $pdf->SetTextColor($gray, $gray, $gray); $pdf->Cell($address_width, 4, 'Empfänger:'); $ypos += 6; if ($order['delivery_company'] != '') { $pdf->SetXY($box1x, $ypos); $pdf->setFont('Arial', 'B', '10'); $pdf->SetTextColor(0, 0, 0);
//$pdf->Cell(70,10,tep_date_only($invoice_date),0,0); $address_width = 60; $top_pos = 30; $extra_address_line = 0; $address_height = 24; //Shipping Address if ($order['customer_shipping_address2'] != '' || $order['customer_billing_address2'] != '') { $extra_address_line = 4; } $address_height += $extra_address_line; $boxpos1x = $margin + 1; $boxpos2x = 80; $boxpos_y = $top_pos; $pdf->setFont('Arial', '', '10'); $pdf->SetDrawColor($gray, $gray, $gray); $pdf->Rect($boxpos1x, $boxpos_y, $address_width, $address_height); $box1x = $boxpos1x + 2; $box2x = $boxpos2x + 2; $box_y = $boxpos_y + 2; $shipping_address = $order['customer_shipping_title']; $shipping_address .= ' ' . $order['customer_shipping_firstname']; $shipping_address .= ' ' . $order['customer_shipping_lastname']; $shipping_address .= "\n" . $order['customer_shipping_address']; if ($order['customer_shipping_address2'] != '') { $shipping_address .= "\n" . $order['customer_shipping_address2']; } $shipping_address .= "\n" . $order['customer_shipping_postcode']; $shipping_address .= ' ' . $order['customer_shipping_city']; $ypos = $box_y; $pdf->SetXY($box1x, $ypos); $pdf->SetTextColor($gray, $gray, $gray);