Exemplo n.º 1
0
             $pdf->Image(FPDF_IMGPATH.'zade-inv-1.jpg',170,65,30,30);
             //IMAGE POINT 2
             $pdf->Image(FPDF_IMGPATH.'zade-inv-2.jpg',170,95,30,30);
             //IMAGE POINT 3
             $pdf->Image(FPDF_IMGPATH.'zade-inv-3.jpg',170,125,30,30);        
             //IMAGE POINT 4
             $pdf->Image(FPDF_IMGPATH.'zade-inv-4.jpg',170,160,30,30);
     */
 } elseif ($order['jng_sp_id'] == '10') {
     /////////////////////
     // EBAY.DE INVOICE //
     /////////////////////
     $pdf->logo_image = 'jng';
     $pdf->AddPage();
     //Order Counter
     $counter_display = dailyCounterNo($order['order_date'], $order['daily_count']);
     $pdf->SetXY(10, 5);
     $pdf->setFont('Arial', '', '12');
     $pdf->Cell(40, 5, $counter_display);
     //coop with otto text
     $coop_xpos = $margin + $pdf->logo_collection['jng']['w'] + 6;
     $coop_ypos = $pdf->logo_collection['jng']['y'] + $pdf->logo_collection['jng']['h'] - 4;
     $pdf->SetXY($coop_xpos, $coop_ypos);
     $pdf->Cell(100, 4, 'Ihre Bestellung über eBay.de');
     //Invoice Header
     //$header_text = 'Rechnung für '.$invoice_no;
     //$pdf->setFont('Arial','','11');
     //$pdf->SetXY($margin, $margin);
     //$pdf->Cell(70,10,$header_text,0,0);
     //$pdf->SetXY(80, $margin);
     //$pdf->Cell(70,10,tep_date_only($invoice_date),0,0);
Exemplo n.º 2
0
 } elseif (strtoupper($order['payment_method']) == strtoupper(PAYMENT_METHOD_INVOICE)) {
     //Rechnung
     $class_pi->createFromOrderJNG($order, $items);
 } else {
     //Paypal invoice
     $class_pi->createFromOrderJNG($order, $items, '+0 days', '2');
 }
 $invoice_id = tep_db_insert_id();
 if ($invoice_id != '') {
     $class_pi = new payone_invoice("invoice_id", $invoice_id);
 } else {
     $class_pi = new payone_invoice("invoice_order_id", $order_id, "invoice_order_type='J'");
 }
 //Order Counter
 $order_counter++;
 $counter_display = dailyCounterNo($order['date_purchased'], $order['daily_count']);
 $pdf->SetXY(10, 5);
 $pdf->setFont('Arial', '', '12');
 $pdf->Cell(40, 5, $counter_display);
 if (count($class_pi->detail) > 0) {
     //RETRIEVE INVOICE COMPLETE DATA
     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
     //Invoice Header
     $pdf->setFont('Arial', '', '11');
 function printPageAdmin($order_product, $orders_id)
 {
     $order = isset($this->orders[$orders_id]) ? $this->orders[$orders_id] : null;
     $pair_qty = '';
     global $cat_double_qty;
     if (in_array($order_product['categories_id'], $cat_double_qty)) {
         if ($order_product['type'] == 'CP' && $order['type'] == 'JNG') {
             $pair_qty .= $order_product['qty'] / 2;
         } else {
             $pair_qty .= $order_product['qty'];
         }
         if ($pair_qty != '') {
             $pair_qty = "{$pair_qty} pair" . ($pair_qty > 1 ? 's' : '');
         }
     }
     $op_quantity = $pair_qty == '' ? $order_product['qty'] : $pair_qty;
     $result = array();
     //$result[] = '<div class="page-head">Admin</div>';
     $result[] = '<div><table border="0" cellpadding="0" cellspacing="0" style="border:none;">';
     $result[] = '<tr><td width="500" style="border:none;">';
     //Left Part (Order & Product Info)
     $result[] = '<table class="od" border="0" cellpadding="0" cellspacing="0">';
     if (!is_null($order)) {
         $result[] = '<tr><td class="highlight" colspan="2"><strong>Shipping Info</strong></td></tr>';
         $result[] = '<tr><td class="col1">Ship to</td><td class="col2">' . $order['ship_to'] . '</td></tr>';
         $result[] = '<tr><td>Shiping Address</td><td>' . $order['ship_address'] . '</td></tr>';
         //$result[] = '<tr><td>&nbsp;</td><td>'.$order['customer']['name'].' (ID:'.$order['customer']['id'].')</td></tr>';
         //$result[] = '<tr><td>&nbsp;</td><td><strong>'.$order['customer']['status'].'</strong></td></tr>';
         /*
                                     $result[] = '<tr><td class="highlight" colspan="2"><strong>Order Info (ID:'.$order['id'].')</strong></td></tr>';
                                     $result[] = '<tr><td class="col1">Order No</td><td class="col2">'.$order['code'].' '.$order_product['count'].'</td></tr>';
                                     $result[] = '<tr><td>Order Date</td><td>'.date('j F Y H:i', strtotime($order['date'])).'</td></tr>';
                                     $result[] = '<tr><td class="highlight" colspan="2"><strong>Customer</strong></td></tr>';
                                     $result[] = '<tr><td>Name</td><td>'.$order['customer']['name'].' (ID:'.$order['customer']['id'].')</td></tr>';
                                     //if($order['customer']['email']!='') $result[] = '<tr><td>Email Address</td><td>'.$order['customer']['email'].'</td></tr>';
                                     $result[] = '<tr><td>Status</td><td><strong>'.$order['customer']['status'].'</strong></td></tr>';
         */
     }
     $result[] = '<tr><td class="highlight" colspan="2"><strong>Product</strong></td></tr>';
     if ($order_product['ean'] != '') {
         $result[] = '<tr><td>Product EAN</td><td>' . $order_product['ean'] . '</td></tr>';
     }
     if ($order_product['category'] != '') {
         $result[] = '<tr><td class="col1">Product Type</td><td class="col2">' . $order_product['category'] . '</td></tr>';
     }
     $result[] = '<tr><td>Product Code</td><td><strong>' . $order_product['code'] . '</strong> (ID:' . $order_product['id'] . ')</td></tr>';
     if ($order_product['name'] != '') {
         $result[] = '<tr><td>Product Name</td><td>' . $order_product['name'] . '</td></tr>';
     }
     //$result[] = '<tr><td>Product Sharing Status</td><td>'.$order_product['share_status'].'</td></tr>';
     $result[] = '<tr><td>Product Price per Piece</td><td>' . displayCurrency($order['currency'], $order_product['price']) . '</td></tr>';
     $result[] = '<tr><td>Product Quantity</td><td>' . $op_quantity . '</td></tr>';
     if ($order_product['qty'] > 1) {
         $result[] = '<tr><td>Product Price Total</td><td>' . displayCurrency($order['currency'], $order_product['price_total']) . '</td></tr>';
     }
     if ($order_product['custom_image'] != '') {
         $custom_img_filename = explode('_', basename($order_product['custom_image']));
         unset($custom_img_filename[0]);
         unset($custom_img_filename[1]);
         $result[] = '<tr class="important"><td>Custom Image</td><td>' . implode('_', $custom_img_filename) . '</td></tr>';
     }
     if ($order_product['custom_text'][0] != '') {
         $result[] = '<tr class="important"><td>Custom Text</td><td>' . implode('<br />', $order_product['custom_text']) . '</td></tr>';
     }
     if (count($order_product['options']) > 0) {
         $result[] = '<tr class="important"><td>Product Attributes</td>';
         $result[] = '<td>';
         foreach ($order_product['options'] as $option_key => $option) {
             if ($option == CHANGE_LENGTH) {
                 $option = 'New Length';
                 $value = $order_product['length'] + $order_product['options_values'][$option_key];
             } else {
                 $value = $order_product['options_values'][$option_key];
             }
             $result[] = "{$option} : {$value} <br />";
         }
         $result[] = '</td></tr>';
     }
     if (in_array($order_product['id'], $this->gold_plated)) {
         $result[] = '<tr class="goldplated"><td class="highlight-red">Additional Info</td><td class="highlight-red">GOLDPLATED</td></tr>';
     }
     /*
     if($order['type']=='SP' && $order_product['stock_status']=='P') {
     	$result[] = '<tr><td>Stock Status</td><td>'.$this->stock_status[$order_product['stock_status']].'</td></tr>';
     }
     */
     $result[] = '</table>';
     $result[] = '</td><td style="border:none;">';
     //Right Part
     //if($order['daily_count']>0) $result[] = '<div class="dailycount">'.date('d. M', strtotime($order['date'])).' - No. '.$order['daily_count'].'</div>';
     //(Main Barcode)
     //echo $order['id'];
     //echo $order_product['id'];
     /*COMMENT ADD BY DEWA (16112010) > FOR JNG BARCODE ORDER PRINTED : JNG-XXXX > REPLACE JNG to JG
       $barcode_code39_no = $order['type'].'-'.$order_product['item_id'];                         
        */
     //START REPLACE WITH 3 rows below
     $barcode_prefix = $order['type'];
     if ($barcode_prefix == 'JNG') {
         $barcode_prefix = 'JG';
     }
     $barcode_code39_no = $barcode_prefix . '-' . $order_product['item_id'];
     //END REPLACE WITH 3 rows above
     //$barcode_code39_no = '999999';
     $barcode_code39 = drawBarcode('CODE39', 'M', $barcode_code39_no, true);
     $result[] = '<div class="address barcode-code39">' . $barcode_code39 . '</div>';
     if ($order_product['stock_status'] == 'P') {
         $result[] = '<div class="pi-stamp">FG STOCK</div>';
     }
     //(First Order)
     //if($order['customer']['no']=='1') $result[] = '<div class="firstorder">FIRST ORDER</div>';
     //(Customer Info)
     //$result[] = '<div class="address"><h3>Customers Address</h3><div>'.$customers_address.'</div></div>';
     //$result[] = '<div class="address"><h3>Shipping Address</h3><div>'.$order['shipping'].'</div></div>';
     $result[] = '<div class="address" style="font-size:12px;">';
     $result[] = '<h3>Order Info</h3>';
     $result[] = '<strong>' . $order['customer']['name'] . '</strong><br />';
     //$result[] = '<strong>Product '..'</strong><br />';
     //$result[] = 'Order ID '.$order['id'].'<br />';
     $result[] = dailyCounterNo($order['date'], $order['daily_count']) . '<br />';
     $result[] = $order['code'] . ' (' . $order_product['count'] . ')<br />';
     $result[] = $order['customer']['status'];
     $result[] = '</div>';
     //			if($order['type']=='JNG') {
     //				if($order['billing']!=$order['shipping']) $result[] = '<div class="address"><h3>Billing Address</h3><div>'.$order['billing'].'</div></div>';
     //			}
     /*
     			if($order_product['brand_image']!='') {
         $brand_image = webImage($order_product['brand_image'],'180','');
         if(strpos($brand_image, 'color-pattern-8.png')===false) $result[] = '<div class="address" style="text-align:center;">'.$brand_image.'</div>';
     }
     */
     $result[] = '</td></tr>';
     $result[] = '</table></div>';
     $result[] = '<div>&nbsp;</div>';
     if (!is_null($order)) {
         $show = true;
         $have_comment = $order['comment'] != '' || $order_product['comment'] != '';
         $use_giftoption = count($order['gift']) > 0;
         if ($have_comment && $use_giftoption) {
             $wh1 = '315';
             $wh2 = '385';
             $wc1 = '300';
             $wc2 = '378';
         } elseif ($have_comment && !$use_giftoption || !$have_comment && $use_giftoption) {
             $wh1 = '700';
             $wh1 = '700';
             $wc1 = '690';
             $wc2 = '690';
         } else {
             $show = false;
         }
         if ($show) {
             $result[] = '<div>';
             $result[] = '<table class="noborder" border="0" cellpadding="0" cellspacing="0"><tr>';
             if ($have_comment) {
                 $result[] = '<td width="' . $wh1 . '"><div class="table-head"><h2>Order Comment:</h2></div></td>';
             }
             if ($use_giftoption) {
                 $result[] = '<td width="' . $wh2 . '"><div class="table-head"><h2>Greeting Card:</h2></div></td>';
             }
             $result[] = '</tr></table>';
             $result[] = '<table border="0" cellpadding="0" cellspacing="0"><tr>';
             if ($have_comment) {
                 $comments = array();
                 if ($order['comment'] != '') {
                     $comments[] = $order['comment'];
                 }
                 if ($order_product['comment'] != '') {
                     $comments[] = '<strong>' . $order_product['comment'] . '</strong>';
                 }
                 $comment = nl2br(implode("\n", $comments));
                 $result[] = '<td width="' . $wc1 . '"><div class="comment-box">' . $comment . '</div></td>';
             }
             if ($use_giftoption) {
                 $result[] = '<td width="' . $wc2 . '">';
                 $result[] = '<div class="comment-box"><table class="noborder" border="0" cellpadding="0" cellspacing="0"><tr>';
                 $result[] = '<td width="140">' . $order['gift']['card'] . '</td>';
                 $result[] = '<td>';
                 $result[] = '<strong>From: ' . $order['gift']['from'] . '</strong><br />';
                 $result[] = '<strong>For: ' . $order['gift']['for'] . '</strong><br />';
                 $result[] = nl2br($order['gift']['greeting']);
                 $result[] = '</td>';
                 $result[] = '</tr></table></div>';
                 $result[] = '</td>';
             }
             $result[] = '</tr></table>';
             $result[] = '</div>';
             $result[] = '<div>&nbsp;</div>';
         }
     }
     /*
     		//PRODUCTION PROCESS
     		if($order_product['type']!='NEP') {
     			$counter_123 = 1;
     			$result[] = '<div class="table-head"><h2>Production Process</h2></div>';
     			$result[] = '<div><table class="pp" border="0" cellpadding="0" cellspacing="0">';
     			$result[] = '<tr>';
     			$result[] = '<th class="col1">No</th>';
     			$result[] = '<th class="col2">Process</th>';
     			$result[] = '<th class="col3">Description</th>';
             $result[] = '<th class="col4">OK</th>';
     			$result[] = '</tr>';
             $result[] = '<tr>';
             $result[] = '<td class="no">'.$counter_123.'</td>';
             $result[] = '<td>Elements Preparation</td>';
             $result[] = '<td>Prepare Elements in WH</td>';
             $result[] = '<td>&nbsp;</td>';
             $result[] = '</tr>';
             $counter_123++;
     			if($order_product['type']=='CP') {
                 //Customized Product
                 $result[] = '<tr>';
                 $result[] = '<td class="no">'.$counter_123.'</td>';
                 $result[] = '<td>Production</td>';
                 $result[] = '<td>Check quality of all elements, exchange in WH if necessary</td>';
                 $result[] = '<td>&nbsp;</td>';
                 $result[] = '</tr>';
                 $counter_123++;
     			} elseif($order_product['type']=='SP') {
                 //Standard Product
                 $result[] = '<tr>';
                 $result[] = '<td class="no">'.$counter_123.'</td>';
                 $result[] = '<td>Workshop</td>';
                 $result[] = '<td>Smithing, Setting, Soldering, Polishing</td>';
                 $result[] = '<td>&nbsp;</td>';
                 $result[] = '</tr>';
                 $counter_123++;
                 $result[] = '<tr>';
                 $result[] = '<td class="no">'.$counter_123.'</td>';
                 $result[] = '<td>Finishing</td>';
                 $result[] = '<td>Cleaning, Plating, Antitarnishing</td>';
                 $result[] = '<td>&nbsp;</td>';
                 $result[] = '</tr>';
                 $counter_123++;
     			}
     			$result[] = '<tr>';
     			$result[] = '<td class="no">'.$counter_123.'</td>';
     			$result[] = '<td>Assembly</td>';
     			$result[] = '<td>Assemby of Jewelry</td>';
             $result[] = '<td>&nbsp;</td>';
     			$result[] = '</tr>';
     			$counter_123++;
     			if(in_array($order_product['id'],$this->gold_plated)) {
                 $result[] = '<tr class="goldplated">';
                 $result[] = '<td class="no">'.$counter_123.'</td>';
                 $result[] = '<td>Goldplating</td>';
                 $result[] = '<td>Goldplating Process of Product</td>';
                 $result[] = '<td>&nbsp;</td>';
                 $result[] = '</tr>';
                 $counter_123++;
     			}
     			$result[] = '<tr>';
     			$result[] = '<td class="no">'.$counter_123.'</td>';
     			$result[] = '<td>Quality Control</td>';
     			$result[] = '<td>Check quality of finished product</td>'; // (elements qty, weight, length, etc.)
             $result[] = '<td>&nbsp;</td>';
     			$result[] = '</tr>';
     			$counter_123++;
     			if(!is_null($order)) {
                 /*
                 $packaging = (isset($this->package_type[$order_product['item_id']])) ? $this->package_type[$order_product['item_id']] : 'Ribbon, Hang Tag, Bag, Package';
                 if($order_product['brand_name']!='') {
                         $packaging = $order_product['brand_name'].' Ribbon, '.$packaging;
                 } else {
                         if($order_product['use_logo']=='1') $packaging = 'J&G Ribbon, '.$packaging;
                         else $packaging = 'White Ribbon, '.$packaging;
                 }
                 $result[] = '<tr>';
                 $result[] = '<td class="no">'.$counter_123.'</td>';
                 $result[] = '<td>Packaging</td>';
                 $result[] = '<td>'.$packaging.'</td>';
                 $result[] = '</tr>';
                 $counter_123++;
                 
                 $result[] = '<tr class="highlight">';
                 $result[] = '<td colspan="4" style="text-align:center;">Set Product Status to &nbsp; <strong>"FINISH"</strong></td>';
                 $result[] = '</tr>';
                 $result[] = '<tr>';
     			}
     			$result[] = '</table></div>';
     			$result[] = '</div>';
     		}
     */
     $result[] = '<div>&nbsp;</div>';
     $result_text = implode("\n", $result);
     return $result_text;
 }