Subversion Repositories wpShopGermany4

Rev

Rev 7352 | Rev 7642 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5972 daniel 1
<?php
2
 
3
	/**
4
	 * Template für die PDF Rechnungskorrektur
5
	 */
7352 daniel 6
 
7
	require_once WPSG_PATH_LIB.'FPDF_1.81/fpdf.php';
8
	require_once WPSG_PATH_LIB.'FPDI_2.2.0/autoload.php';
5972 daniel 9
	require_once WPSG_PATH_LIB.'wpsg_fpdf.class.php';
10
 
11
	global $absender_left, $absender_top, $adress_left, $adress_top, $rdata_left, $rdata_top;
12
 
13
	// Positionierung der Absenderadresszeile
14
	$absender_left				= 25;
15
	$absender_top				= 50;
16
 
17
	// Positionierung der Zieladress
18
	$adress_left 				= 25;
19
	$adress_top					= 55;
20
 
21
	// Positionierung des Rechnungskopfes
22
	$rdata_left					= 25;
23
	$rdata_top					= 90;
24
 
25
	// Positionierung der Produktdaten
26
	$prod_left					= 25;
27
	$prod_top					= 105;
28
 
29
	// Anzahl an Produkten pro Seite
30
	$prod_break					= $this->get_option('wpsg_rechnungen_pdfperpage');
31
 
7490 daniel 32
	$arCalculation = $this->view['basket']['arCalculation'];
33
 
34
	if ($this->getFrontendTaxView() === WPSG_NETTO) $taxdisplay = 'netto';
35
	else $taxdisplay = 'brutto';
36
 
5972 daniel 37
	// Damit die Steuer bei der Kleinunternehmerregelung nicht angezeigt wird leer ich den Array sicherheitshalber
38
	if ($this->get_option('wpsg_kleinunternehmer') == '1')
39
	{
40
 
41
		unset($this->view['basket']['mwst']);
42
 
43
	}
44
 
45
	if (!function_exists('AddRechnungPage'))
46
	{
47
 
48
		function AddRechnungPage($shop, $pdf)
49
		{
50
 
51
			global $absender_left, $absender_top, $adress_left, $adress_top, $rdata_left, $rdata_top;
52
 
53
			$pdf->AddPage();
54
 
55
			if (file_exists($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_bp.pdf"))
56
			{
57
 
58
				$pagecount = $pdf->setSourceFile($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_bp.pdf");
59
				$tplidx = $pdf->importPage(1, '/MediaBox');
60
				$pdf->useTemplate($tplidx, 0, 0, 210);
61
 
62
			}
63
			if (file_exists($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_bp.jpg"))
64
			{
65
				$pdf->image($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_bp.jpg", 0, 0, 210, 297, 'jpg');
66
			}
67
 
68
 
69
			if (file_exists($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_logo.jpg"))
70
			{
71
 
72
				list($width, $height, $type, $attr) = getimagesize($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_logo.jpg");
73
 
74
				//wpsg_debug($width.":".$height);
75
 
76
				$wPix = (25.4 * $width) / 96;
77
				$hPix = (25.4 * $height) / 96;
78
 
79
				$pdf->image($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_logo.jpg", 210 - $wPix, 0, $wPix, $hPix);
80
 
81
			}
82
 
83
			// Absenderadresszeile (Wird in der Konfiguration hinterlegt)
84
			$pdf->SetFont('Arial', '', 6);
85
			$pdf->Text($absender_left, $absender_top, $shop->replaceUniversalPlatzhalter(__($shop->get_option("wpsg_rechnungen_adresszeile"), 'wpsg'), $shop->view['data']['id']));
86
 
87
			if (wpsg_getStr($shop->view['kunde']['kuerzel']) != "") $shop->view['kunde']['kuerzel'] = $shop->view['kunde']['kuerzel'].'-';
88
 
89
			// Adresse des Kunden
90
			$pdf->SetFont('Arial', '', 12);
91
			$pdf->Text($adress_left, $adress_top, $shop->view['kunde']['firma']);
92
			$pdf->Text($adress_left, $adress_top + 5, $shop->view['kunde']['vname'].' '.$shop->view['kunde']['name']);
7247 daniel 93
			$pdf->Text($adress_left, $adress_top + 10, $shop->view['kunde']['strasse'].' '.wpsg_getStr($shop->view['kunde']['nr']));
5972 daniel 94
			$pdf->Text($adress_left, $adress_top + 15, $shop->view['kunde']['plz'].' '.$shop->view['kunde']['ort']);
6798 hartmut 95
			if ($shop->get_option("wpsg_mod_rechnungen_hideCountry") == '0')
96
				$pdf->Text($adress_left, $adress_top + 20, strtoupper($shop->view['oOrder']->getInvoiceCountryName()));
5972 daniel 97
 
98
			// Rechnungsdaten
99
			$pdf->SetFont('Arial', 'B', 16);
100
			$pdf->Text($rdata_left, $rdata_top, $shop->view['title']);
101
			$pdf->SetFont('Arial', 'B', 9);
102
			$pdf->Text($rdata_left, $rdata_top + 6, $shop->view['rnr']);
103
			$pdf->SetFont('Arial', '', 9);
104
 
105
			if (isset($shop->view['faelligkeitdatum']))
106
			{
107
 
108
				$pdf->Text($rdata_left + 35, $rdata_top, __("Fällig am", "wpsg"));
109
				$pdf->Text($rdata_left + 35, $rdata_top + 6, $shop->view['faelligkeitdatum']);
110
 
111
			}
112
 
113
			if (isset($shop->view['payment']))
114
			{
115
 
116
				$pdf->Text($rdata_left + 58, $rdata_top, __("Zahlungsbedingungen", "wpsg"));
117
				$pdf->Text($rdata_left + 58, $rdata_top + 6, $shop->view['payment']);
118
 
119
			}
120
 
121
			$pdf->Text($rdata_left + 105, $rdata_top, __("Kunden-Nr", "wpsg"));
122
			$pdf->Text($rdata_left + 105, $rdata_top + 6, (($shop->view['kunde']['knr'] != '')?$shop->view['kunde']['knr']:$shop->view['kunde']['id']));
123
 
124
			$pdf->Text($rdata_left + 135, $rdata_top, __("Best. Nr.", "wpsg"));
125
			$pdf->Text($rdata_left + 135, $rdata_top + 6, ((trim($shop->view['data']['onr']) != '')?$shop->view['data']['onr']:$shop->view['data']['id']));
126
 
127
			$pdf->Text($rdata_left + 155, $rdata_top, __("Datum", "wpsg"));
128
			$pdf->Text($rdata_left + 155, $rdata_top + 6, $shop->view['rDatum']);
129
 
130
			if ($shop->view['oOrder']->isInnerEu())
131
			{
7153 thomas 132
 
133
            	$pdf->SetFont('Arial', '', 9);
134
                $pdf->Text($adress_left, $rdata_top + 11.5, __("Innergemeinschaftliche Lieferung.", "wpsg"));
135
 
136
            } else if (!$shop->view['oOrder']->isInnerEu() && $shop->view['oOrder']->getShippingCountryID() != $shop->getDefaultCountry(true)) {
137
 
138
			// Nicht InnerEU und Nicht Inland
139
 
140
             	$pdf->SetFont('Arial', '', 9);
141
                $pdf->Text($adress_left, $rdata_top + 11.5, __("Steuerfreie Ausfuhrlieferung.", "wpsg"));
142
 
5972 daniel 143
			}
7153 thomas 144
 
5972 daniel 145
			// Benutzerdefinierte Felder
146
			$arTexte = $shop->callMod('wpsg_mod_rechnungen', 'getRechnungstexte', array($shop->view['data']['id']));
147
 
148
			foreach ((array)$arTexte as $text)
149
			{
150
 
151
				if (isset($text['aktiv']) && $text['aktiv'] == 1)
152
				{
153
 
154
					$pdf->SetFont('Arial', 'B', ((intval($text['fontsize']) > 0)?intval($text['fontsize']):10));
155
					$pdf->wpsg_SetTextColor($text['color']);
156
					$pdf->wpsg_MultiCell($text['x'], $text['y'], 5, $text['text']);
157
					$pdf->wpsg_SetTextColor("#000000");
158
 
159
				}
160
 
161
			}
162
 
163
		}
164
 
165
	}
166
	//wpsg_debug($this->view); die();
167
	$pdf = new wpsg_fpdf();
168
	$pdf->SetAutoPageBreak(true, 5);
169
	AddRechnungPage($this, $pdf);
170
 
171
	$summe = 0;
172
 
173
	$bKopf = false; $pnr = 1; $offset = 0; $count = 0;
174
	foreach ($this->view['basket']['produkte'] as $p)
175
	{
176
 
177
		if (!$bKopf)
178
		{
179
 
180
			$pdf->SetFont('Arial', 'B', 9);
181
			$pdf->setXY($prod_left, $prod_top);
182
			$pdf->Cell(10, 8, __("Nr.", "wpsg"), 1, 0, 'C');
183
 
184
			$pdf->setXY($prod_left + 10, $prod_top);
185
			$pdf->Cell( ((sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), 8, "Name", 1, 0, 'L');
186
 
187
			if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
188
			{
189
 
190
				$pdf->setXY($prod_left + 97, $prod_top);
191
				$pdf->Cell(15, 8, __("MwSt.", "wpsg"), 1, 0, 'C');
192
 
193
			}
194
 
195
			$pdf->setXY($prod_left + 112, $prod_top);
196
			$pdf->Cell(15, 8, __("Menge", "wpsg"), 1, 0, 'C');
197
 
198
			$pdf->setXY($prod_left + 127, $prod_top);
199
			$pdf->Cell(25, 8, __("Einzelpreis", "wpsg"), 1, 0, 'R');
200
 
201
			$pdf->setXY($prod_left + 152, $prod_top);
202
			$pdf->Cell(25, 8, __("Gesamtpreis", "wpsg"), 1, 0, 'R');
203
 
204
			$offset = 8;
205
			$bKopf = true;
206
 
207
		}
208
 
209
		$pdf->SetFont('Arial', '', 9);
210
		$pdf->setXY($prod_left, $prod_top + $offset);
211
 
6751 daniel 212
		if ($this->get_option('wpsg_mod_rechnungen_anr') == '1')
5972 daniel 213
		{
214
 
215
			$pdf->Cell(10, 8, $p['anr'], 0, 0, 'C');
216
 
217
		}
218
		else
219
		{
220
 
221
			$pdf->Cell(10, 8, $pnr.".", 0, 0, 'C');
222
 
223
		}
224
 
225
		/* Wenn Detailname vorhanden, wird der Detailname auf Rechnung verwendet */
226
		$produkt_text = $this->getProductName($this->getProduktID($p['id']), true);
227
 
228
		/* Falls Detailname vorhanden, wird jetzt der Produktname verwendet */
229
		/* $produkt_text = $this->getProductName($this->getProduktID($p['id']), false); */
230
 
231
		$produktBeschreibung = trim(strip_tags($p['beschreibung']));
232
 
233
		if ($this->isOtherLang())
234
		{
235
 
236
			$trans_db = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_PRODUCTS."` WHERE `lang_parent` = '".wpsg_q($this->getProduktID($p['id']))."' AND `lang_code` = '".wpsg_q($this->getCurrentLanguageCode())."'");
237
 
238
			if (is_array($trans_db) && sizeof($trans_db) > 0)
239
			{
240
 
241
				$produkt_text = $trans_db['name'];
242
				$produktBeschreibung = trim(strip_tags($trans_db['beschreibung']));
243
 
244
			}
245
 
246
		}
247
 
248
		$height = 0; // Höhe der Zeile für den Rahmen
249
 
250
		$pdf->setXY($prod_left + 10, $prod_top + $offset);
251
 
252
		// Produktvariablen
253
		if ($this->hasMod('wpsg_mod_productvars') && $this->get_option("wpsg_mod_rechnungen_showpv") == "1")
254
		{
255
 
256
			$arPV = $this->callMod('wpsg_mod_productvars', 'getAllProductVarValues', array($this->view['data']['id'], $p['product_index']));
257
 
258
			if (wpsg_isSizedArray($arPV))
259
			{
260
 
261
				foreach ($arPV as $pv)
262
				{
263
 
264
					$produkt_text .= "\r\n".$pv['name'].': '.$pv['value'];
265
					$height += 5;
266
 
267
				}
268
 
269
			}
270
 
271
		}
272
 
6751 daniel 273
        if ($this->get_option('wpsg_mod_rechnungen_anr') === '2')
274
        {
275
 
276
            $anr = $this->getProductAnr($p['productkey']);
277
            $produkt_text .= "\r\n".wpsg_translate(__('Artikelnummer: #1#', 'wpsg'), $anr);
278
 
279
        }
280
 
5972 daniel 281
		$produkt_text_cell_width = 102;
282
		if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
283
		{
284
			$produkt_text_cell_width = 87;
285
		}
286
 
287
		$produkt_text_width = $pdf->GetStringWidth($produkt_text);
288
		//$produkt_text_cell_width = (($this->arMwSt == "-1")?87:102);
289
 
290
		$height += 5 * ceil($produkt_text_width / $produkt_text_cell_width) + 3;
291
 
292
		$height_y = $pdf->getY();
293
		$height = 2 + $pdf->wpsg_MultiCell($prod_left + 10, $prod_top + $offset + 1.5, 5, $produkt_text, 0, 'L', 0, $produkt_text_cell_width);
294
 
295
		//$height += 3 + 5 + $pdf->getY() - $height_y;
296
		//$pdf->Cell((($this->arMwSt == "-1")?102:87), 8, $produkt_text, 0, 0, 'L');
297
 
298
		if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
299
		{
300
 
301
			$pdf->setXY($prod_left + 97, $prod_top + $offset);
302
			$pdf->Cell(15, 8, (($this->view['basket']['noMwSt'] == '1')?'0.00 %':wpsg_ff($p['mwst_value'], '%')), 0, 0, 'C');
303
 
304
		}
305
 
306
		$pdf->setXY($prod_left + 112, $prod_top + $offset);
307
		$pdf->Cell(15, 8, $p['menge'], 0, 0, 'C');
308
 
309
		if (wpsg_ShopController::get_option('wpsg_preisangaben') == WPSG_NETTO)
310
		{
311
			$preis = $p['preis_netto'];
312
 
313
			//TODO
314
		}
315
		else
316
		{
317
			$preis = $p['preis_brutto'];
318
		}
319
 
320
		$pdf->setXY($prod_left + 127, $prod_top + $offset);
321
		$pdf->Cell(25, 8, wpsg_ff($preis, $this->get_option('wpsg_currency')), 0, 0, 'R');
322
 
323
		$pdf->setXY($prod_left + 152, $prod_top + $offset);
324
		$pdf->Cell(25, 8, wpsg_ff($preis * $p['menge'], $this->get_option('wpsg_currency')), 0, 0, 'R');
325
 
326
		/**
327
		 * Produktbeschreibung anzeigen Ja/Nein
328
		 */
329
		$pBeschreibungHeight = 0;
330
		if ($this->get_option("wpsg_rechnungen_pbeschreibung") == "1" && trim(strip_tags($p['beschreibung'])) != '')
331
		{
332
 
333
			$produktBeschreibung = nl2br($produktBeschreibung);
334
			preg_match_all('/\<br \/\>/', $produktBeschreibung, $treffer);
335
			$produktBeschreibung = strip_tags($produktBeschreibung);
336
 
337
			$pBeschreibungWidth = $pdf->getStringWidth($produktBeschreibung);
338
			$pBeschreibungHeight = 5 * (ceil($pBeschreibungWidth / $produkt_text_cell_width) + @sizeof($treffer[0]));
339
 
340
			$pdf->SetFont('Arial', 'I', 9);
341
 
342
			$cellY = $pdf->getY();
343
			$pdf->wpsg_MultiCell($prod_left + 10, $prod_top + $height + $offset - 1, 5, $produktBeschreibung, 0, 'L', 0, $produkt_text_cell_width);
344
			$pBeschreibungHeight = $pdf->getY() - $cellY - $height + 1;
345
			$pdf->SetFont('Arial', '', 9);
346
 
347
		}
348
 
349
		$height += $pBeschreibungHeight;
350
 
351
		/**
352
		 * Produktattribute ?
353
		 */
354
		if ($this->get_option('wpsg_rechnungen_produktattribute') == '1')
355
		{
356
 
357
			$attributeInfo = $this->callMod('wpsg_mod_produktattribute', 'getProductAttributeByProductId', array($this->getProduktId($p['id'])));
358
 
359
			foreach ($attributeInfo as $pa)
360
			{
361
 
362
				$pa_text = $pa['name'].': '.$pa['value'];
363
				$height += $pdf->wpsg_MultiCell($prod_left + 10, $prod_top + $height + $offset - 0.5, 5, $pa_text, 0, 'L', 0, $produkt_text_cell_width);
364
 
365
			}
366
		}
367
 
368
		/**
369
		 * Variante ?
370
		 */
6165 hartmut 371
		if (preg_match('/pv_(.*)/', $p['productkey']))
5972 daniel 372
		{
373
 
6165 hartmut 374
			$variInfo = $this->callMod('wpsg_mod_productvariants', 'getVariantenInfoArray', array($p['productkey']));
5972 daniel 375
 
376
			$height += $pdf->wpsg_MultiCell($prod_left + 10, $prod_top + $height + $offset - 0.5, 5, wpsg_translate(__('Variante: #1#', 'wpsg'), $variInfo['key']), 0, 'L', 0, $produkt_text_cell_width);
377
 
378
			//$height += 5;
379
 
380
		}
381
 
382
		if ($this->hasMod('wpsg_mod_deliverynote'))
383
		{
384
 
385
			$arDN_order = $this->callMod('wpsg_mod_deliverynote', 'loadDeliveryNotesFromOrder', array($this->view['data']['id']));
386
 
387
			if (sizeof($arDN_order) > 1)
388
			{
389
 
390
				$deliveryTimeProduct = $this->callMod('wpsg_mod_deliverynote', 'getProductDeliveryTime', array($this->view['data']['id'], $p['product_index']));
391
 
392
				if ($deliveryTimeProduct !== false)
393
				{
394
 
395
					$height += $pdf->wpsg_MultiCell($prod_left + 10, $prod_top + $height + $offset - 0.5, 5, wpsg_translate(__('Lieferdatum: #1#', 'wpsg'), date('d.m.Y', $deliveryTimeProduct)), 0, 'L', 0, $produkt_text_cell_width);
396
 
397
				}
398
 
399
			}
400
 
401
		}
402
 
403
		// Jetzt die Rahmen zeichnen
404
		$pdf->Rect($prod_left, $prod_top + $offset, 10, $height);
405
 
406
		$pdf->Rect($prod_left + 10, $prod_top + $offset, ((sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), $height);
407
 
408
		if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
409
		{
410
 
411
			$pdf->Rect($prod_left + 97, $prod_top + $offset, 15, $height);
412
 
413
		}
414
 
415
		$pdf->Rect($prod_left + 112, $prod_top + $offset, 15, $height);
416
		$pdf->Rect($prod_left + 127, $prod_top + $offset, 25, $height);
417
		$pdf->Rect($prod_left + 152, $prod_top + $offset, 25, $height);
418
 
419
		$offset += $height;
420
 
421
		$pnr ++;
422
		$count ++;
423
 
424
		$summe += $p['price'] * $p['menge'];
425
 
426
		if ($pdf->getY() > 220 || ($count >= $prod_break && sizeof($this->view['basket']['produkte']) > ($pnr - 1)))
427
		{
428
 
429
			AddRechnungPage($this, $pdf);
430
			$bKopf = false; $offset = 0; $count = 0;
431
 
432
		}
433
 
434
	} // produkte
435
 
436
	// Gutschein
7490 daniel 437
	/*
5972 daniel 438
	if ((isset($this->view['basket']['gs'])) && ($this->view['basket']['gs_value'] > 0))
439
	{
440
 
441
		$pdf->SetFont('Arial', '', 9);
442
		$pdf->setXY($prod_left, $prod_top + $offset);
443
		$pdf->Cell(10, 8, $pnr.'.', 1, 0, 'C'); $pnr ++;
444
 
445
		$pdf->setXY($prod_left + 10, $prod_top + $offset);
446
		$pdf->Cell( ((sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), 8, wpsg_translate(__('Gutschein (#1#)', 'wpsg'), $this->view['basket']['gs']['code']), 1, 0, 'L');
447
 
448
		if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
449
		{
450
 
451
			$mwst = __('anteilig', 'wpsg');
452
 
453
			$pdf->setXY($prod_left + 97, $prod_top + $offset);
454
			$pdf->Cell(15, 8, $mwst, 1, 0, 'C');
455
 
456
		}
457
 
458
		$pdf->setXY($prod_left + 112, $prod_top + $offset);
459
		$pdf->Cell(15, 8, '1', 1, 0, 'C');
460
 
461
		$gs_value_einzel = '-'.wpsg_ff($this->view['basket']['sum']['gs'], $this->get_option('wpsg_currency'));
462
		$gs_value_gesamt = '-'.wpsg_ff($this->view['basket']['sum']['gs'], $this->get_option('wpsg_currency'));
463
 
464
		$pdf->setXY($prod_left + 127, $prod_top + $offset);
465
		$pdf->Cell(25, 8, $gs_value_einzel, 1, 0, 'R');
466
 
467
		$pdf->setXY($prod_left + 152, $prod_top + $offset);
468
		$pdf->Cell(25, 8, $gs_value_gesamt, 1, 0, 'R');
469
 
470
		$offset += 8;
471
 
472
	}
7490 daniel 473
	*/
474
	if (wpsg_isSizedArray($this->view['basket']['arCalculation']['voucher'])) {
475
 
476
		foreach ($this->view['basket']['arCalculation']['voucher'] as $v) {
477
 
478
			$pdf->SetFont('Arial', '', 9);
479
			$pdf->setXY($prod_left, $prod_top + $offset);
480
			$pdf->Cell(10, 8, $pnr.'.', 1, 0, 'C'); $pnr ++;
481
 
482
			$pdf->setXY($prod_left + 10, $prod_top + $offset);
483
			$pdf->Cell( ((sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), 8, wpsg_translate(__('Gutschein (#1#)', 'wpsg'), $v['code']), 1, 0, 'L');
484
 
485
			if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
486
			{
487
 
488
				$mwst = __('anteilig', 'wpsg');
489
 
490
				$pdf->setXY($prod_left + 97, $prod_top + $offset);
491
				$pdf->Cell(15, 8, $mwst, 1, 0, 'C');
492
 
493
			}
494
 
495
			$pdf->setXY($prod_left + 112, $prod_top + $offset);
496
			$pdf->Cell(15, 8, '1', 1, 0, 'C');
497
 
498
			$gs_value_einzel = wpsg_ff($v[$taxdisplay.'_single'], $this->get_option('wpsg_currency'));
499
			$gs_value_gesamt = wpsg_ff($v[$taxdisplay], $this->get_option('wpsg_currency'));
500
 
501
			$pdf->setXY($prod_left + 127, $prod_top + $offset);
502
			$pdf->Cell(25, 8, $gs_value_einzel, 1, 0, 'R');
503
 
504
			$pdf->setXY($prod_left + 152, $prod_top + $offset);
505
			$pdf->Cell(25, 8, $gs_value_gesamt, 1, 0, 'R');
506
 
507
			$offset += 8;
508
 
509
		}
510
 
511
	}
5972 daniel 512
 
513
	// Versandkosten
514
	if ($this->view['basket']['sum']['preis_shipping'] != '' && $this->view['basket']['sum']['preis_shipping'] != 0)
515
	{
516
 
517
		$pdf->SetFont('Arial', '', 9);
518
		$pdf->setXY($prod_left, $prod_top + $offset);
519
		$pdf->Cell(10, 8, $pnr.'.', 1, 0, 'C'); $pnr ++;
520
 
521
		$pdf->setXY($prod_left + 10, $prod_top + $offset);
522
		$pdf->Cell( ((sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), 8, wpsg_translate(__('Versandkosten "#1#"', 'wpsg'), $this->view['oOrder']->getShippingLabel()), 1, 0, 'L');
523
 
524
		if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
525
		{
526
 
527
			if ($this->arShipping[$this->view['data']['type_shipping']]['mwst_null'] == '1' && $this->view['basket']['noMwSt'] == '1')
528
			{
529
 
530
				$mwst = 0;
531
 
532
			}
533
			else
534
			{
535
 
536
				if (isset($this->view['basket']['shipping']['tax_rata']) && $this->view['basket']['shipping']['tax_rata'] === true)
537
				{
538
 
539
					$mwst = __('anteilig', 'wpsg');
540
 
541
				}
542
				else
543
				{
544
 
545
					$mwst = wpsg_ff($this->arShipping[$this->view['basket']['checkout']['shipping']]['mwst_value'], '%');
6843 hartmut 546
					$mwst = wpsg_ff($this->view['basket']['shipping']['tax_value'], '%');
5972 daniel 547
 
548
				}
549
 
550
				/*
551
				if ($this->arShipping[$this->view['data']['type_shipping']]['mwst'] == '0')
552
				{
553
 
554
					$mwst = __('anteilig', 'wpsg');
555
 
556
				}
557
				else
558
				{
559
 
560
					$mwst = wpsg_ff($this->arShipping[$this->view['data']['type_shipping']]['mwst_value'], '%');
561
 
562
				}
563
				*/
564
 
565
			}
566
 
567
			$pdf->setXY($prod_left + 97, $prod_top + $offset);
568
			$pdf->Cell(15, 8, $mwst, 1, 0, 'C');
569
 
570
		}
571
 
572
		$pdf->setXY($prod_left + 112, $prod_top + $offset);
573
		$pdf->Cell(15, 8, '1', 1, 0, 'C');
574
 
575
		$pdf->setXY($prod_left + 127, $prod_top + $offset);
576
		$pdf->Cell(25, 8, wpsg_ff($this->view['basket']['sum']['preis_shipping'], $this->get_option('wpsg_currency')), 1, 0, 'R');
577
 
578
		$pdf->setXY($prod_left + 152, $prod_top + $offset);
579
		$pdf->Cell(25, 8, wpsg_ff($this->view['basket']['sum']['preis_shipping'], $this->get_option('wpsg_currency')), 1, 0, 'R');
580
 
581
		$offset += 8;
582
 
583
		// Zusammengesetzte Versandarten darstellen
584
		/*
585
		if (wpsg_isSizedArray($this->view['basket']['shipping']['methods'])) {
586
 
587
			foreach ($this->view['basket']['shipping']['methods'] as $shipping) {
588
 
589
				$pdf->SetFont('Arial', '', 9);
590
				$pdf->setXY($prod_left, $prod_top + $offset);
591
				$pdf->Cell(10, 8, '', 1, 0, 'C'); $pnr ++;
592
 
593
				$pdf->setXY($prod_left + 10, $prod_top + $offset);
594
				$pdf->Cell( ((sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), 8, $this->getShippingName($shipping), 1, 0, 'L');
595
 
596
				if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
597
				{
598
 
599
					if ($this->view['basket']['shipping'][$shipping]['tax_rata'] == 1) { $mwst = __('Anteilig', 'wpsg'); }
600
					else { $mwst = wpsg_ff($this->view['basket']['shipping'][$shipping]['mwst'], '%'); }
601
 
602
					$pdf->setXY($prod_left + 97, $prod_top + $offset);
603
					$pdf->Cell(15, 8, $mwst, 1, 0, 'C');
604
 
605
				}
606
 
607
				$pdf->setXY($prod_left + 112, $prod_top + $offset);
608
				$pdf->Cell(15, 8, '1', 1, 0, 'C');
609
 
610
				$pdf->setXY($prod_left + 127, $prod_top + $offset);
611
				$pdf->Cell(25, 8, wpsg_ff($this->view['basket']['shipping'][$shipping]['preis_shipping_brutto'], $this->get_option('wpsg_currency')), 1, 0, 'R');
612
 
613
				$pdf->setXY($prod_left + 152, $prod_top + $offset);
614
				$pdf->Cell(25, 8, wpsg_ff($this->view['basket']['shipping'][$shipping]['preis_shipping_brutto'], $this->get_option('wpsg_currency')), 1, 0, 'R');
615
 
616
				$offset += 8;
617
 
618
			}
619
 
620
		}
621
		*/
622
 
623
 
624
	}
625
 
626
	// Zahlungskosten
627
	if ($this->view['basket']['sum']['preis_payment'] != '' && $this->view['basket']['sum']['preis_payment'] != 0)
628
	{
629
 
630
		$pdf->SetFont('Arial', '', 9);
631
		$pdf->setXY($prod_left, $prod_top + $offset);
632
		$pdf->Cell(10, 8, $pnr.'.', 1, 0, 'C'); $pnr ++;
633
 
634
		$pdf->setXY($prod_left + 10, $prod_top + $offset);
635
		$pdf->Cell( ((sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), 8, $this->arPayment[$this->view['data']['type_payment']]['name'], 1, 0, 'L');
636
 
637
		if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
638
		{
639
 
640
			if ($this->arPayment[$this->view['data']['type_payment']]['mwst_null'] == '1' && $this->view['basket']['noMwSt'] == '1')
641
			{
642
				$mwst = 0;
643
			}
644
			else
645
			{
646
 
647
				if (isset($this->view['basket']['payment']['tax_rata']) && $this->view['basket']['payment']['tax_rata'] === true)
648
				{
649
 
650
					$mwst = __('anteilig', 'wpsg');
651
 
652
				}
653
				else
654
				{
655
 
656
					$mwst = wpsg_ff($this->arPayment[$this->view['basket']['checkout']['payment']]['mwst_value'], '%');
657
 
658
				}
659
 
660
				/*
661
				if ($this->arPayment[$this->view['data']['type_payment']]['mwst'] == '0')
662
				{
663
 
664
					$mwst = __('anteilig', 'wpsg');
665
 
666
				}
667
				else
668
				{
669
 
670
					$mwst = wpsg_ff($this->arPayment[$this->view['data']['type_payment']]['mwst_value'], '%');
671
 
672
				}
673
				*/
674
 
675
			}
676
 
677
			$pdf->setXY($prod_left + 97, $prod_top + $offset);
678
			$pdf->Cell(15, 8, $mwst, 1, 0, 'C');
679
 
680
		}
681
 
682
		$pdf->setXY($prod_left + 112, $prod_top + $offset);
683
		$pdf->Cell(15, 8, '1', 1, 0, 'C');
684
 
685
		$pdf->setXY($prod_left + 127, $prod_top + $offset);
686
		$pdf->Cell(25, 8, wpsg_ff($this->view['basket']['sum']['preis_payment'], $this->get_option('wpsg_currency')), 1, 0, 'R');
687
 
688
		$pdf->setXY($prod_left + 152, $prod_top + $offset);
689
		$pdf->Cell(25, 8, wpsg_ff($this->view['basket']['sum']['preis_payment'], $this->get_option('wpsg_currency')), 1, 0, 'R');
690
 
691
		$offset += 8;
692
 
693
	}
694
 
695
	// Gebühr
696
	if (wpsg_tf(wpsg_getStr($this->view['storno_fee'])) > 0)
697
	{
698
 
699
		$pdf->SetFont('Arial', '', 9);
700
		$pdf->setXY($prod_left, $prod_top + $offset);
701
		$pdf->Cell(10, 8, $pnr.'.', 1, 0, 'C'); $pnr ++;
702
 
703
		$label = __('Bearbeitungsgebühr', 'wpsg');
704
 
705
		if (strpos($this->view['storno_fee'], '%') !== false) $label .= ' ('.wpsg_ff($this->view['storno_fee'], '%').')';
706
 
707
		$pdf->setXY($prod_left + 10, $prod_top + $offset);
708
		$pdf->Cell( ((sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), 8, $label, 1, 0, 'L');
709
 
710
		if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
711
		{
712
 
713
			if ($this->view['basket']['noMwSt'] == '1')
714
			{
715
				$mwst = 0;
716
			}
717
			else
718
			{
719
 
720
 
721
				$mwst = wpsg_ff($this->view['storno_fee_tax_value'], '%');
722
 
723
			}
724
 
725
			$pdf->setXY($prod_left + 97, $prod_top + $offset);
726
			$pdf->Cell(15, 8, $mwst, 1, 0, 'C');
727
 
728
		}
729
 
730
		$pdf->setXY($prod_left + 112, $prod_top + $offset);
731
		$pdf->Cell(15, 8, '1', 1, 0, 'C');
732
 
733
		$pdf->setXY($prod_left + 127, $prod_top + $offset);
734
		$pdf->Cell(25, 8, '-'.wpsg_ff($this->view['storno_fee_value'], $this->get_option('wpsg_currency')), 1, 0, 'R');
735
 
736
		$pdf->setXY($prod_left + 152, $prod_top + $offset);
737
		$pdf->Cell(25, 8, '-'.wpsg_ff($this->view['storno_fee_value'], $this->get_option('wpsg_currency')), 1, 0, 'R');
738
 
739
		$offset += 8;
740
 
741
	}
742
 
743
	$pdf->SetFont('Arial', '', 9);
744
 
745
	if ($this->view['kunde']['ustidnr'] != "")
746
	{
747
		$offset += 10;
748
		$pdf->Text($prod_left, $prod_top + $offset, __("Ihre Umsatzsteuer-Identifikationsnummer:", "wpsg"));
749
		$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
750
		$pdf->Cell(37, 8, $this->view['kunde']['ustidnr'], 0, 0, 'R');
751
	}
752
 
753
	$offset += 10;
754
	if ($this->get_option('wpsg_kleinunternehmer'))
755
	{
756
 
757
		$pdf->Text($prod_left, $prod_top + $offset, __("Es ergibt sich folgender Gesamtbetrag", "wpsg").':');
7490 daniel 758
		$pdf->Text($prod_left + 80, $prod_top + $offset, __("Summe", "wpsg"));
5972 daniel 759
		$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
760
		$pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'] + $this->view['basket']['sum']['preis_rabatt'], $this->get_option('wpsg_currency')), 0, 0, 'R');
761
		$offset += 5;
762
 
763
	}
764
	else
765
	{
766
 
767
		if ($this->view['basket']['noMwSt'] == '1')
768
		{
769
 
770
			$pdf->Text($prod_left, $prod_top + $offset, __("Es ergibt sich folgender Gesamtbetrag", "wpsg").':');
7490 daniel 771
			$pdf->Text($prod_left + 80, $prod_top + $offset, __("BRUTTOBETRAG", "wpsg"));
5972 daniel 772
			$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
773
			$pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_netto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
774
			$offset += 5;
775
 
7490 daniel 776
			$pdf->Text($prod_left + 80, $prod_top + $offset, __("MwSt. GESAMT", "wpsg"));
5972 daniel 777
			$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
778
			$pdf->Cell(37, 8, wpsg_ff(0, $this->get_option('wpsg_currency')), 0, 0, 'R');
779
 
780
		}
781
		else
782
		{
783
 
784
			$pdf->Text($prod_left, $prod_top + $offset, __("Der Gesamtbetrag setzt sich wie folgt zusammen", "wpsg"));
785
 
7490 daniel 786
			$pdf->Text($prod_left + 80, $prod_top + $offset, __("NETTOBETRAG", "wpsg"));
5972 daniel 787
			$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
788
			$pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_netto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
789
 
790
			if (sizeof($this->view['basket']['mwst']) >= 1)
791
			{
792
 
793
				foreach ($this->view['basket']['mwst'] as $mw)
794
				{
795
 
796
					$offset += 5;
7490 daniel 797
					$pdf->Text($prod_left + 80, $prod_top + $offset, __("MwSt. ", "wpsg").wpsg_ff($mw['value'], '%'));
5972 daniel 798
					$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
799
					$pdf->Cell(37, 8, wpsg_ff($mw['sum'], $this->get_option('wpsg_currency')), 0, 0, 'R');
800
 
801
				}
802
 
803
			}
804
 
805
			if (sizeof($this->view['basket']['mwst']) > 1)
806
			{
807
 
808
				$offset += 5;
7490 daniel 809
				$pdf->Text($prod_left + 80, $prod_top + $offset, __("MwSt. GESAMT", "wpsg"));
5972 daniel 810
				$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
811
				$pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'] - $this->view['basket']['sum']['preis_gesamt_netto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
812
 
813
			}
814
 
815
		}
816
 
817
	}
818
 
819
	// Rabatt
820
	if ($this->view['basket']['sum']['preis_rabatt'] > 0)
821
	{
822
 
823
		$offset += 5;
824
 
7490 daniel 825
		$pdf->Text($prod_left + 80, $prod_top + $offset, __("Rabatt", "wpsg"));
5972 daniel 826
		$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
827
		$pdf->Cell(37, 8, '-'.wpsg_ff($this->view['basket']['sum']['preis_rabatt'], $this->get_option('wpsg_currency')), 0, 0, 'R');
828
 
829
	}
7244 thomas 830
 
7490 daniel 831
	// Wertgutschein
832
	if ($arCalculation['sum']['topay_brutto'] !== $arCalculation['sum']['brutto']) {
833
 
834
		$offset += 5;
835
		$pdf->Text($prod_left + 80, $prod_top + $offset, __("Bruttobetrag", "wpsg"));
836
		$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
837
 
838
		$pdf->setFont('Arial', '', '9');
839
		$pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
840
		$pdf->setFont('Arial', '', '9');
841
 
842
		foreach ($arCalculation['coupon'] as $c) {
843
 
844
			$offset += 5;
845
			$pdf->Text($prod_left + 80, $prod_top + $offset, __('Wertgutschein', 'wpsg').' '.((wpsg_isSizedString($c['code']))?'('.$c['code'].')':''));
846
			$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
847
 
848
			$pdf->setFont('Arial', '', '9');
849
			$pdf->Cell(37, 8, wpsg_ff($c[$taxdisplay], $this->get_option('wpsg_currency')), 0, 0, 'R');
850
			$pdf->setFont('Arial', '', '9');
851
 
852
		}
853
 
854
		$offset += 5;
855
		$pdf->setFont('Arial', 'B', '9');
856
		$pdf->Text($prod_left + 80, $prod_top + $offset, __("SUMME", "wpsg"));
857
		$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
858
 
859
		/* Endbetrag wird fett ausgegeben */
860
		$pdf->setFont('Arial', 'B', '9');
861
		$pdf->Cell(37, 8, wpsg_ff($arCalculation['sum']['topay_brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
862
		$pdf->setFont('Arial', '', '9');
863
 
864
	} else {
7244 thomas 865
 
7490 daniel 866
		$offset += 5;
867
		$pdf->Text($prod_left + 100, $prod_top + $offset, __("SUMME", "wpsg"));
868
		$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
7244 thomas 869
 
7490 daniel 870
		/* Endbetrag wird fett ausgegeben */
871
		$pdf->setFont('Arial', 'B', '9');
872
		$pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
873
		$pdf->setFont('Arial', '', '9');
874
 
875
		/* Endbetrag wird normal ausgegeben */
876
		//$pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
877
 
878
	}
879
 
5972 daniel 880
	if ($this->get_option('wpsg_kleinunternehmer') == '1')
881
	{
882
 
883
		$pdf->wpsg_MultiCell($prod_left - 1, $prod_top + $offset + 5, 5, $this->get_option('wpsg_kleinunternehmer_text'));
884
		$offset += 15;
885
 
886
	}
887
 
888
	if ($this->hasMod('wpsg_mod_deliverynote'))
889
	{
890
 
891
		$arDN_order = $this->callMod('wpsg_mod_deliverynote', 'loadDeliveryNotesFromOrder', array($this->view['data']['id']));
892
		$delivery_date = $this->callMod('wpsg_mod_deliverynote', 'getDeliveryTime', array($this->view['data']['id']));
893
 
894
		// Wenn es ein Gesamtlieferdatum gibt und nur einen Lieferschein, dann unter der Bestellung anzeigen
895
		if ($delivery_date !== false && sizeof($arDN_order) == 1)
896
		{
897
 
898
			$offset += 10;
899
 
900
			$pdf->wpsg_MultiCell($prod_left, $prod_top + $offset, 5, wpsg_translate(__('Lieferung: #1#', 'wpsg'), date('d.m.Y', $delivery_date)));
901
 
902
			$offset += 5;
903
 
904
		}
905
 
906
	}
907
 
908
	$offset += 5;
909
 
910
	if ($this->view['fussText'] != "")
911
	{
912
 
913
		//$pdf->wpsg_MultiCell($prod_left - 1, $prod_top + $offset, 5, utf8_encode($this->view['fussText']));
914
		$pdf->wpsg_MultiCell($prod_left - 1, $prod_top + $offset, 5, $this->view['fussText']);
915
		$pdf->SetFont('Arial', 'B', 9);
916
		$offset += 10;
917
 
918
	}
919
 
920
	$shipping_adress = false;
921
 
922
	if ($this->hasMod('wpsg_mod_shippingadress') && $this->callMod('wpsg_mod_shippingadress', 'check_different_shippingadress', array('k_id' => $this->view['data']['k_id'], 'o_id' => $this->view['data']['id'])))
923
	{
924
 
925
		$pdf->setFont('Arial', 'B', 9);
926
		$pdf->Text($prod_left, $prod_top + $offset, __("Lieferanschrift", "wpsg").":");
927
		$offset += 5;
928
 
929
		$pdf->setFont('Arial', '', 9);
930
 
931
		$shipping_adress = "";
932
		if ($this->view['data']['shipping_firma'] != "")
933
		{
934
			$shipping_adress .= $this->view['data']['shipping_firma']."\r\n";
935
		}
936
		$shipping_adress .= $this->view['data']['shipping_vname'].' '.$this->view['data']['shipping_name']."\r\n";
937
		$shipping_adress .= $this->view['data']['shipping_strasse']."\r\n";
938
		//$shipping_adress .= $this->view['data']['shipping_land']['kuerzel'].'-';
939
 
940
		$shipping_adress .= $this->view['data']['shipping_plz'].' '.$this->view['data']['shipping_ort']."\r\n";
941
		$shipping_adress .= $this->view['data']['shipping_land']['name'];
942
 
943
 
944
		$start = $pdf->getY();
945
		$pdf->wpsg_MultiCell($prod_left - 1, $prod_top + $offset, 5, $shipping_adress, 0, 'L', 0, 100);
946
		$offset += $pdf->getY() - $start;
947
 
948
		$shipping_adress = true;
949
 
950
	}
951
 
952
 
953
	$offset += 5;
954
 
955
	// Bestellvariablen
956
	if ($this->hasMod('wpsg_mod_ordervars') && $this->get_option('wpsg_mod_rechnungen_showov') == '1')
957
	{
958
 
959
		$bvars = @unserialize($this->view['data']['bvars']);
960
		if (!is_array($bvars)) $bvars = array();
961
 
962
		$strBVars = "";
963
		foreach ($bvars as $bvars_id => $bvars_value)
964
		{
965
 
966
			$bvars = $this->db->fetchRow("SELECT * FROM `".wpsg_q(WPSG_TBL_ORDERVARS)."` WHERE `id` = '".wpsg_q($bvars_id)."' ORDER BY `pos` ASC, `id` ASC ");
967
 
968
			if ($bvars['typ'] == "1") // Auswahl
969
			{
970
				if ($bvars_value <= 0) $bvars_value = __("Keine Angabe", "wpsg");
971
			}
972
			else if ($bvars['typ'] == "2") // Texteingabe
973
			{
974
				if (trim($bvars_value) == "") $bvars_value = __("Keine Angabe", "wpsg");
975
			}
976
			else if ($bvars['typ'] == "3") // Checkbox
977
			{
978
				if ($bvars_value <= 0) $bvars_value = __("Keine Angabe", "wpsg");
979
			}
980
 
981
			$bvars_name = $this->callMod('wpsg_mod_ordervars', 'getNameById', array($bvars_id));
982
			$strBVars .= "\r\n".$bvars_name.": ".$bvars_value;
983
 
984
		}
985
 
986
		$pdf->SetFont('Arial', 'B', 9);
987
		$pdf->Text($prod_left, $prod_top + $offset, __("Angaben während der Bestellung", "wpsg").":");
988
		$pdf->SetFont('Arial', '', 9);
989
		$pdf->wpsg_MultiCell($prod_left - 1, $prod_top + $offset, 5, $strBVars);
990
 
991
	}
992
 
993
	if (!file_exists($this->callMod('wpsg_mod_rechnungen', 'getFilePath', array($this->view['data']['id']))))
994
	{
995
 
996
		mkdir($this->callMod('wpsg_mod_rechnungen', 'getFilePath', array($this->view['data']['id'])), 0777, true);
997
 
998
	}
999
 
1000
	$this->callMods('wpsg_mod_rechnungen_pdf', array(&$pdf, &$this->view['data']['id'], &$this->view['preview'], &$this->view['invoice']));
1001
 
1002
	$filename = $this->view['filename'].".pdf";
6901 daniel 1003
 
1004
    ob_end_clean();
1005
 
5972 daniel 1006
	if ($this->view['preview'])
1007
	{
6901 daniel 1008
 
5972 daniel 1009
		$pdf->Output($filename, 'I');
6901 daniel 1010
 
5972 daniel 1011
	}
1012
	else
1013
	{
1014
 
1015
		$pdf->Output($this->callMod('wpsg_mod_rechnungen', 'getFilePath', array($this->view['data']['id'])).$filename, 'F');
1016
 
1017
		// Hier wird der Dateiname an FPD übergeben. Er soll sich aus der Rechnungsnummer ergeben, auch wenn das Dokument über die ID gespeichert ist.
1018
		if ($this->view['output'] === true) $pdf->Output($this->view['filename_out'], 'I');
1019
 
1020
	}
1021
 
1022
?>