Subversion Repositories wpShopGermany4

Rev

Rev 8190 | Rev 8241 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8190 Rev 8214
Line 7... Line 7...
7
	require_once WPSG_PATH_LIB.'FPDF_1.81/fpdf.php';
7
	require_once WPSG_PATH_LIB.'FPDF_1.81/fpdf.php';
8
	require_once WPSG_PATH_LIB.'FPDI_2.2.0/autoload.php';
8
	require_once WPSG_PATH_LIB.'FPDI_2.2.0/autoload.php';
9
	require_once WPSG_PATH_LIB.'wpsg_fpdf.class.php';
9
	require_once WPSG_PATH_LIB.'wpsg_fpdf.class.php';
10
  
10
  
11
	global $absender_left, $absender_top, $adress_left, $adress_top, $rdata_left, $rdata_top;
11
	global $absender_left, $absender_top, $adress_left, $adress_top, $rdata_left, $rdata_top;
12
	 
12
 
-
 
13
    /** @var wpsg\wpsg_invoice|null $oInvoice */
-
 
14
    $oInvoice = $this->view['oInvoice'];
-
 
15
 
13
	// Positionierung der Absenderadresszeile
16
	// Positionierung der Absenderadresszeile
14
	$absender_left				= 25;
17
	$absender_left				= 25;
15
	$absender_top				= 50;
18
	$absender_top				= 50;
16
	
19
	
17
	// Positionierung der Zieladress
20
	// Positionierung der Zieladress
Line 45... Line 48...
45
			
48
			
46
			global $absender_left, $absender_top, $adress_left, $adress_top, $rdata_left, $rdata_top;
49
			global $absender_left, $absender_top, $adress_left, $adress_top, $rdata_left, $rdata_top;
47
			
50
			
48
			$pdf->AddPage();
51
			$pdf->AddPage();
49
			
52
			
50
			if (file_exists($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_bp.pdf"))
53
			if (file_exists($shop->callMod('wpsg_mod_rechnungen', 'getPaperPath', array())."wpsg_rechnungen_bp.pdf"))
51
			{
54
			{
52
				
55
				
53
				$pagecount = $pdf->setSourceFile($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_bp.pdf"); 
56
				$pagecount = $pdf->setSourceFile($shop->callMod('wpsg_mod_rechnungen', 'getPaperPath', array())."wpsg_rechnungen_bp.pdf");
54
				$tplidx = $pdf->importPage(1, '/MediaBox'); 
57
				$tplidx = $pdf->importPage(1, '/MediaBox'); 
55
				$pdf->useTemplate($tplidx, 0, 0, 210); 
58
				$pdf->useTemplate($tplidx, 0, 0, 210); 
56
				
59
				
57
			}
60
			}
58
			if (file_exists($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_bp.jpg"))
61
			if (file_exists($shop->callMod('wpsg_mod_rechnungen', 'getPaperPath', array())."wpsg_rechnungen_bp.jpg"))
59
			{
62
			{
60
				$pdf->image($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_bp.jpg", 0, 0, 210, 297, 'jpg');
63
				$pdf->image($shop->callMod('wpsg_mod_rechnungen', 'getPaperPath', array())."wpsg_rechnungen_bp.jpg", 0, 0, 210, 297, 'jpg');
61
			}
64
			}
62
			
65
			
63
			
66
			
64
			if (file_exists($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_logo.jpg"))
67
			if (file_exists($shop->callMod('wpsg_mod_rechnungen', 'getPaperPath', array())."wpsg_rechnungen_logo.jpg"))
65
			{
68
			{
66
	
69
	
67
				list($width, $height, $type, $attr) = getimagesize($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_logo.jpg");
70
				list($width, $height, $type, $attr) = getimagesize($shop->callMod('wpsg_mod_rechnungen', 'getPaperPath', array())."wpsg_rechnungen_logo.jpg");
68
				
71
				
69
				//wpsg_debug($width.":".$height);
72
				//wpsg_debug($width.":".$height);
70
				
73
				
71
				$wPix = (25.4 * $width) / 96;
74
				$wPix = (25.4 * $width) / 96;
72
				$hPix = (25.4 * $height) / 96;  
75
				$hPix = (25.4 * $height) / 96;  
73
				
76
				
74
				$pdf->image($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_logo.jpg", 210 - $wPix, 0, $wPix, $hPix);
77
				$pdf->image($shop->callMod('wpsg_mod_rechnungen', 'getPaperPath', array())."wpsg_rechnungen_logo.jpg", 210 - $wPix, 0, $wPix, $hPix);
75
				
78
				
76
			}
79
			}
77
			
80
			
78
			// Absenderadresszeile (Wird in der Konfiguration hinterlegt)
81
			// Absenderadresszeile (Wird in der Konfiguration hinterlegt)
79
			$pdf->SetFont('Arial', '', 6);
82
			$pdf->SetFont('Arial', '', 6);
Line 885... Line 888...
885
			}
888
			}
886
		
889
		
887
		$pdf->wpsg_MultiCell($prod_left - 1, $prod_top + $offset - 6, 5, $strBVars);
890
		$pdf->wpsg_MultiCell($prod_left - 1, $prod_top + $offset - 6, 5, $strBVars);
888
 
891
 
889
	}
892
	}
890
	
893
 
891
	if (!file_exists($this->callMod('wpsg_mod_rechnungen', 'getFilePath', array($this->view['data']['id']))))
-
 
892
	{
-
 
893
		
-
 
894
		mkdir($this->callMod('wpsg_mod_rechnungen', 'getFilePath', array($this->view['data']['id'])), 0777, true);
-
 
895
		
-
 
896
	}
-
 
897
	
-
 
898
	$this->callMods('wpsg_mod_rechnungen_pdf', array(&$pdf, &$this->view['data']['id'], &$this->view['preview'], &$this->view['invoice']));
894
	$this->callMods('wpsg_mod_rechnungen_pdf', array(&$pdf, &$this->view['data']['id'], &$this->view['preview'], &$this->view['invoice']));
899
	
895
	
900
	$filename = $this->view['filename'].".pdf";
896
	$filename = $this->view['filename'].".pdf";
901
 
897
 
902
    ob_end_clean();
898
    ob_end_clean();
903
 
899
 
904
	wpsg_debug($pdf->Output($filename, 'I'));
-
 
905
	die();
-
 
906
 
-
 
907
	if ($this->view['preview']) {
900
	if ($this->view['preview']) {
908
	    
901
	    
909
		$pdf->Output($filename, 'I');
902
		$pdf->Output($filename, 'I');
910
        
903
        
911
	} else {
904
	} else {
912
		
905
		
913
		$pdf->Output($this->callMod('wpsg_mod_rechnungen', 'getFilePath', array($this->view['data']['id'])).$filename, 'F');
906
		$pdf->Output($oInvoice->getFilePath(), 'F');
914
		
907
		
915
		// Hier wird der Dateiname an FPD übergeben. Er soll sich aus der Rechnungsnummer ergeben, auch wenn das Dokument über die ID gespeichert ist.
908
		// Hier wird der Dateiname an FPD übergeben. Er soll sich aus der Rechnungsnummer ergeben, auch wenn das Dokument über die ID gespeichert ist.
916
		$pdf->Output($this->view['filename_out'], 'I');
909
		$pdf->Output($this->view['filename_out'], 'I');
917
			
910
			
918
	} 
911
	}