Subversion Repositories wpShopGermany4

Rev

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

Rev 8068 Rev 8069
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
	 
9
	 
10
	require_once WPSG_PATH_LIB.'wpsg_fpdf.class.php';
10
	require_once WPSG_PATH_LIB.'wpsg_fpdf.class.php';
11
	
11
	
12
	global $absender_left, $absender_top, $adress_left, $adress_top, $rdata_left, $rdata_top, $rhead_left, $rhead_top, $sum_multi_offset;
12
	global $absender_left, $absender_top, $adress_left, $adress_top, $rdata_left, $rdata_top, $rhead_left, $rhead_top, $sum_multi_offset, $pdf;
13
	
13
	 
14
	// Positionierung der Absenderadresszeile
14
	// Positionierung der Absenderadresszeile
15
	$absender_left				= 25;
15
	$absender_left				= 25;
16
	$absender_top				= 50;
16
	$absender_top				= 50;
17
	
17
	
18
	// Positionierung der Zieladress
18
	// Positionierung der Zieladress
Line 39... Line 39...
39
    $sum = $this->view['multi_data']['orders'][0]['sum'];
39
    $sum = $this->view['multi_data']['orders'][0]['sum'];
40
	
40
	
41
	if ($this->getFrontendTaxView() === WPSG_NETTO) $taxdisplay = 'netto';
41
	if ($this->getFrontendTaxView() === WPSG_NETTO) $taxdisplay = 'netto';
42
	else $taxdisplay = 'brutto';
42
	else $taxdisplay = 'brutto';
43
	
43
	
44
	// Damit die Steuer bei der Kleinunternehmerregelung nicht angezeigt wird leer ich den Array sicherheitshalber
-
 
45
	if ($this->get_option('wpsg_kleinunternehmer') == '1')
44
	if (!function_exists('AddRechnungPage')) {
46
	{
-
 
47
		
-
 
48
		unset($this->view['basket']['mwst']);
-
 
49
		
45
		
50
	}
-
 
51
	
-
 
52
	if (!function_exists('AddRechnungPage'))
-
 
53
	{
-
 
54
		
-
 
55
		function AddRechnungPage($shop, $pdf) 
46
		function AddRechnungPage($shop, $pdf) {
56
		{
-
 
57
 
47
 
58
			global $absender_left, $absender_top, $adress_left, $adress_top, $rdata_left, $rdata_top, $offset, $sum_multi_offset;
48
			global $absender_left, $absender_top, $adress_left, $adress_top, $rdata_left, $rdata_top, $offset, $sum_multi_offset;
59
			
49
			
60
			$pdf->AddPage();
50
			$pdf->AddPage();
61
            $sum_multi_offset = 0;
51
            $sum_multi_offset = 0;
Line 146... Line 136...
146
            // Datum
136
            // Datum
147
            $pdf->Text($rdata_left + 75, $rdata_top, __("Datum", "wpsg"));
137
            $pdf->Text($rdata_left + 75, $rdata_top, __("Datum", "wpsg"));
148
			$pdf->Text($rdata_left + 75, $rdata_top + 6, $shop->view['rDatum']);
138
			$pdf->Text($rdata_left + 75, $rdata_top + 6, $shop->view['rDatum']);
149
 
139
 
150
            // InnerEu Hinweistext
140
            // InnerEu Hinweistext
151
            if ($shop->view['oOrder']->isInnerEu())
141
            if ($shop->view['oOrder']->isInnerEu()) {
152
			{
-
 
153
				
142
				
154
				$pdf->SetFont('Arial', '', 9);
143
				$pdf->SetFont('Arial', '', 9);
155
				$pdf->Text($adress_left, $rdata_top + 11.5, __("Innergemeinschaftliche Lieferung.", "wpsg"));
144
				$pdf->Text($adress_left, $rdata_top + 11.5, __("Innergemeinschaftliche Lieferung.", "wpsg"));
156
				
145
				
157
			}
146
			}
Line 182... Line 171...
182
    // wpsg_debug($this->view['kunde']); // DEBUG
171
    // wpsg_debug($this->view['kunde']); // DEBUG
183
    // wpsg_debug($this->view['data']); // DEBUG
172
    // wpsg_debug($this->view['data']); // DEBUG
184
    // wpsg_debug($this->view['multi_data']['orders']); // DEBUG
173
    // wpsg_debug($this->view['multi_data']['orders']); // DEBUG
185
 
174
 
186
    $pdf = new wpsg_fpdf();
175
    $pdf = new wpsg_fpdf();
187
    $pdf->SetAutoPageBreak(true, 5);
176
    //$pdf->SetAutoPageBreak(true, 5);
188
    AddRechnungPage($this, $pdf);
177
    AddRechnungPage($this, $pdf);
189
 
178
 
-
 
179
	$checkPageBreak = function($shop, $offset, $lines) use ($pdf, $prod_top) {
-
 
180
		
-
 
181
		if ($prod_top + $offset + ($lines * 5) > 290) {
-
 
182
		
-
 
183
			AddRechnungPage($this, $pdf);
-
 
184
		
-
 
185
			return 0;
-
 
186
 
-
 
187
		} else return $offset;
-
 
188
		
-
 
189
	};
-
 
190
	
190
    $rhead_count = 1;
191
    $rhead_count = 1;
191
    $sum_multi_offset = 0;
192
    $sum_multi_offset = 0;
192
    $orders = $this->view['multi_data']['orders']; 
193
    $orders = $this->view['multi_data']['orders']; 
193
 
194
 
194
    $sum_topay_brutto = 0;
195
    $sum_topay_brutto = 0;
Line 197... Line 198...
197
    $sum_productsum_netto = 0;
198
    $sum_productsum_netto = 0;
198
    $sum_shipping_brutto = 0;
199
    $sum_shipping_brutto = 0;
199
    $sum_shipping_netto = 0;
200
    $sum_shipping_netto = 0;
200
    $sum_payment_brutto = 0;
201
    $sum_payment_brutto = 0;
201
    $sum_payment_netto = 0;
202
    $sum_payment_netto = 0;
202
    
203
    	
-
 
204
	// moMwSt
203
    foreach ($orders as $oSum) {
205
	$bNoTax = false;
204
 
206
	
205
        // Produktgesamtsumme
207
	$bTaxCol = false;
206
        foreach ($oSum['arCalculation']['product'] as $p) {
208
	if ($this->get_option('wpsg_showMwstAlways') === '1') $bTaxCol = true;
207
            $sum_productsum_brutto += $p['brutto'];
-
 
208
            $sum_productsum_netto += $p['netto'];
-
 
209
        }
209
	else {
210
 
210
		
211
        // Zahlungssumme gesamt
-
 
212
        $sum_topay_brutto += $oSum['arCalculation']['sum']['topay_brutto'];
-
 
213
        $sum_topay_netto += $oSum['arCalculation']['sum']['topay_netto'];
211
		foreach ($this->view['multi_data']['order_data'] as $order_data) {
214
 
212
		
215
        // Gesamtzahlungskosten
-
 
216
        $sum_payment_brutto += $oSum['arCalculation']['sum']['payment_brutto'];
-
 
217
        $sum_payment_netto += $oSum['arCalculation']['sum']['payment_netto'];
213
			if (sizeof($order_data['arCalculation']['tax']) > 1) { $bTaxCol = true; break; }
218
 
214
			
219
        // Gesamtversandkosten
-
 
220
        $sum_shipping_brutto += $oSum['arCalculation']['sum']['shipping_brutto'];
-
 
221
        $sum_shipping_netto += $oSum['arCalculation']['sum']['shipping_netto'];
-
 
-
 
215
		}	
222
 
216
		
223
    }
217
	}
224
 
218
	 
225
    // FOREACH ORDER START
219
    // FOREACH ORDER START
226
    foreach ($orders as $oOrder) {
220
    foreach ($this->view['multi_data']['order_data'] as $order_data) {
227
 
221
 
-
 
222
		/** @var wpsg_order $oOrder */
-
 
223
		$oOrder = $order_data['oOrder'];
-
 
224
		
-
 
225
		/** @var \wpsg\wpsg_calculation $arCalculation */
-
 
226
		$arCalculation = $order_data['arCalculation'];
-
 
227
		
228
        // Sammelrechnung Zähler
228
        // Sammelrechnung Zähler
229
        $pdf->SetFont('Arial', 'B', 12);
229
        $pdf->SetFont('Arial', 'B', 12);
230
        $pdf->Text($rhead_left, $rhead_top + $sum_multi_offset, $rhead_count);
230
        $pdf->Text($rhead_left, $rhead_top + $sum_multi_offset, $rhead_count);
231
        $pdf->Text($rhead_left + 6, $rhead_top + $sum_multi_offset, __("Bestellung", "wpsg"));
231
        $pdf->Text($rhead_left + 6, $rhead_top + $sum_multi_offset, __("Bestellung", "wpsg"));
232
        $rhead_count++;
232
        $rhead_count++;
233
        $pdf->SetFont('Arial', '', 9);
233
        $pdf->SetFont('Arial', '', 9);
234
 
234
 
235
        // Zahlungsbedingung anzeigen
235
        // Zahlungsbedingung anzeigen
236
        if (isset($oOrder['arCalculation']['payment'][0]['payment_key']))
-
 
237
        {
-
 
238
            
-
 
239
            $pdf->Text($rhead_left + 120, $rhead_top + $sum_multi_offset, __("Zahlungsbedingungen", "wpsg"));
236
        $pdf->Text($rhead_left + 120, $rhead_top + $sum_multi_offset, __("Zahlungsbedingungen", "wpsg"));
240
            $pdf->Text($rhead_left + 120, $rhead_top + $sum_multi_offset + 6, $this->arPayment[$oOrder['arCalculation']['payment'][0]['payment_key']]['name']);
237
        $pdf->Text($rhead_left + 120, $rhead_top + $sum_multi_offset + 6, $oOrder->getPaymentLabel());
241
            
-
 
242
        }
-
 
243
        
238
         
244
        // Bestellnummer anzeigen
239
        // Bestellnummer anzeigen
245
        $pdf->Text($rhead_left + 155, $rhead_top + $sum_multi_offset, __("Best. Nr.", "wpsg"));
240
        $pdf->Text($rhead_left + 155, $rhead_top + $sum_multi_offset, __("Best. Nr.", "wpsg"));
246
        $pdf->Text($rhead_left + 155, $rhead_top + $sum_multi_offset + 6, ((trim($oOrder['data']['onr']) != '')?$oOrder['data']['onr']:$oOrder['data']['id']));
241
        $pdf->Text($rhead_left + 155, $rhead_top + $sum_multi_offset + 6, $oOrder->getNr());
247
        
242
        
248
        $summe = 0;
243
        $summe = 0;
249
        $mwst_value = array_values($oOrder['arCalculation']['tax'])[0];
-
 
250
 
244
 
251
        $bKopf = false; $pnr = 1; $offset = 0; $count = 0; 
245
        $bKopf = false; $pnr = 1; $offset = 0; $count = 0; 
252
        
246
        
253
        foreach ($oOrder['produkte'] as $p)
247
        foreach ($oOrder->getOrderProducts() as $oOrderProduct) {
254
        {
-
 
255
 
248
 
-
 
249
			$product_id = $oOrderProduct->getProductId();
-
 
250
						
256
            if (!$bKopf)
251
            if (!$bKopf) {
257
            {
-
 
258
                
252
                
259
                $pdf->SetFont('Arial', 'B', 9);
253
                $pdf->SetFont('Arial', 'B', 9);
260
                $pdf->setXY($prod_left, $prod_top + $sum_multi_offset);
254
                $pdf->setXY($prod_left, $prod_top + $sum_multi_offset);
261
                $pdf->Cell(10, 8, __("Nr.", "wpsg"), 1, 0, 'C');
255
                $pdf->Cell(10, 8, __("Nr.", "wpsg"), 1, 0, 'C');
262
                
256
                
263
                $pdf->setXY($prod_left + 10, $prod_top + $sum_multi_offset);
257
                $pdf->setXY($prod_left + 10, $prod_top + $sum_multi_offset);
-
 
258
				
264
                if(is_array($mwst_value['tax_value'])) {	
259
				$pdf->Cell((($bTaxCol)?87:102), 8, "Name", 1, 0, 'L');
265
                    $pdf->Cell( ((sizeof($oOrder['arCalculation']['tax']) >= 2 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), 8, "Name", 1, 0, 'L');
-
 
266
                }		
-
 
267
 
260
                
268
                if (sizeof($oOrder['arCalculation']['tax']) >= 2 || $this->get_option('wpsg_showMwstAlways') == '1')
-
 
269
                {
261
                if ($bTaxCol) {
270
                    
262
                    
271
                    $pdf->setXY($prod_left + 97, $prod_top + $sum_multi_offset);
263
                    $pdf->setXY($prod_left + 97, $prod_top + $sum_multi_offset);
272
                    $pdf->Cell(15, 8, __("MwSt.", "wpsg"), 1, 0, 'C');
264
                    $pdf->Cell(15, 8, __("MwSt.", "wpsg"), 1, 0, 'C');
273
                    
265
                    
274
                }
266
                }
Line 288... Line 280...
288
            }
280
            }
289
            
281
            
290
            $pdf->SetFont('Arial', '', 9);
282
            $pdf->SetFont('Arial', '', 9);
291
            $pdf->setXY($prod_left, $prod_top + $offset + $sum_multi_offset);
283
            $pdf->setXY($prod_left, $prod_top + $offset + $sum_multi_offset);
292
            
284
            
293
            if ($this->get_option('wpsg_mod_rechnungen_anr') == '1')
285
            if ($this->get_option('wpsg_mod_rechnungen_anr') == '1') {
294
            {
-
 
295
                
286
                
296
                $pdf->Cell(10, 8,  $p['anr'], 0, 0, 'C');
287
                $pdf->Cell(10, 8,  $oOrderProduct->getProduct()->getProductNr(), 0, 0, 'C');
297
                
288
                
298
            }
-
 
299
            else
289
            } else {
300
            {
-
 
301
                
290
                
302
                $pdf->Cell(10, 8, $pnr.".", 0, 0, 'C');
291
                $pdf->Cell(10, 8, $pnr.".", 0, 0, 'C');
303
                
292
                
304
            }
293
            }
305
            
294
            
306
            /* Wenn Detailname vorhanden, wird der Detailname auf Rechnung verwendet */
295
            /* Wenn Detailname vorhanden, wird der Detailname auf Rechnung verwendet */
307
            $produkt_text = $this->getProductName($this->getProduktID($p['id']), true);
296
            $produkt_text = $this->getProductName($product_id, true);
308
            
-
 
309
            /* Falls Detailname vorhanden, wird jetzt der Produktname verwendet */
-
 
310
            /* $produkt_text = $this->getProductName($this->getProduktID($p['id']), false); */
-
 
311
            
297
            
312
            $produktBeschreibung = trim(strip_tags($p['beschreibung']));
298
            $produktBeschreibung = trim(strip_tags($oOrderProduct->getProduct()->getShortDescription()));
313
            
299
            
314
            if ($this->isOtherLang())
300
            if ($this->isOtherLang()) {
315
            {
-
 
316
                
301
                
317
                $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())."'");
302
                $trans_db = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_PRODUCTS."` WHERE `lang_parent` = '".wpsg_q($product_id)."' AND `lang_code` = '".wpsg_q($this->getCurrentLanguageCode())."'");
318
                
303
                
319
                if (is_array($trans_db) && sizeof($trans_db) > 0)
304
                if (is_array($trans_db) && sizeof($trans_db) > 0) {
320
                {
-
 
321
                    
305
                    
322
                    $produkt_text = $trans_db['name'];
306
                    $produkt_text = $trans_db['name'];
323
                    $produktBeschreibung = trim(strip_tags($trans_db['beschreibung']));
307
                    $produktBeschreibung = trim(strip_tags($trans_db['beschreibung']));
324
                    
308
                    
325
                }
309
                }
Line 329... Line 313...
329
            $height = 0; // Höhe der Zeile für den Rahmen
313
            $height = 0; // Höhe der Zeile für den Rahmen
330
            
314
            
331
            $pdf->setXY($prod_left + 10, $prod_top + $offset + $sum_multi_offset);
315
            $pdf->setXY($prod_left + 10, $prod_top + $offset + $sum_multi_offset);
332
            
316
            
333
            // Produktvariablen 
317
            // Produktvariablen 
334
            if ($this->hasMod('wpsg_mod_productvars') && $this->get_option("wpsg_mod_rechnungen_showpv") == "1")
318
            if ($this->hasMod('wpsg_mod_productvars') && $this->get_option("wpsg_mod_rechnungen_showpv") == "1") {
335
            {
-
 
336
                
319
                
337
                $arPV = $this->callMod('wpsg_mod_productvars', 'getAllProductVarValues', array($oOrder['data']['id'], $p['product_index']));
320
                $arPV = $this->callMod('wpsg_mod_productvars', 'getAllProductVarValues', array($oOrder->getId(), $oOrderProduct->getProductIndex()));
338
                
321
                
339
                if (wpsg_isSizedArray($arPV))
322
                if (wpsg_isSizedArray($arPV)) {
340
                {
-
 
341
                    
323
                    
342
                    foreach ($arPV as $pv)
324
                    foreach ($arPV as $pv) {
343
                    {
-
 
344
                        
325
                        
345
                        $produkt_text .= "\r\n".$pv['name'].': '.$pv['value'];
326
                        $produkt_text .= "\r\n".$pv['name'].': '.$pv['value'];
346
                        $height += 5;
327
                        $height += 5;
347
                        
328
                        
348
                    }
329
                    }
349
                    
330
                    
350
                }
331
                }
351
                
332
                
352
            }
333
            }
353
            
334
            
354
            if ($this->get_option('wpsg_mod_rechnungen_anr') === '2')
335
            if ($this->get_option('wpsg_mod_rechnungen_anr') === '2') {
355
            {
-
 
356
                
336
                
357
                $anr = $this->getProductAnr($p['productkey']);
337
                $anr = $this->getProductAnr($oOrderProduct->getProductKey());
358
                $produkt_text .= "\r\n".wpsg_translate(__('Artikelnummer: #1#', 'wpsg'), $anr);
338
                $produkt_text .= "\r\n".wpsg_translate(__('Artikelnummer: #1#', 'wpsg'), $anr);
359
                
339
                
360
            }
340
            }
361
            
341
            			
362
            $produkt_text_cell_width = 102;
342
            if ($bTaxCol) $produkt_text_cell_width = 87;
363
            if (sizeof($oOrder['arCalculation']['tax']) >= 2 || $this->get_option('wpsg_showMwstAlways') == '1')
-
 
364
            {
-
 
365
                $produkt_text_cell_width = 87;
343
			else $produkt_text_cell_width = 102;
366
            }
-
 
367
            
344
            
368
            $produkt_text_width = $pdf->GetStringWidth($produkt_text);
345
            $produkt_text_width = $pdf->GetStringWidth($produkt_text);
369
            //$produkt_text_cell_width = (($this->arMwSt == "-1")?87:102);
-
 
370
            
346
            
371
            $height += 5 * ceil($produkt_text_width / $produkt_text_cell_width) + 3;
347
            $height += 5 * ceil($produkt_text_width / $produkt_text_cell_width) + 3;
372
            
348
            
373
            $height_y = $pdf->getY();
349
            $height_y = $pdf->getY();
374
            $height = 2 + $pdf->wpsg_MultiCell($prod_left + 10, $prod_top + $offset + 1.5 + $sum_multi_offset, 5, $produkt_text, 0, 'L', 0, $produkt_text_cell_width);
350
            $height = 2 + $pdf->wpsg_MultiCell($prod_left + 10, $prod_top + $offset + 1.5 + $sum_multi_offset, 5, $produkt_text, 0, 'L', 0, $produkt_text_cell_width);
375
            
351
             
376
            //$height += 3 + 5 + $pdf->getY() - $height_y;
352
            if ($bTaxCol) {
377
            //$pdf->Cell((($this->arMwSt == "-1")?102:87), 8, $produkt_text, 0, 0, 'L');
-
 
378
            
-
 
379
            if (sizeof($oOrder['arCalculation']['tax']) >= 2 || $this->get_option('wpsg_showMwstAlways') == '1') {
-
 
380
                
353
                
381
                $pdf->setXY($prod_left + 97, $prod_top + $offset + $sum_multi_offset);
354
                $pdf->setXY($prod_left + 97, $prod_top + $offset + $sum_multi_offset);
382
                $pdf->Cell(15, 8, (($this->view['basket']['noMwSt'] == '1')?'0.00 %':wpsg_ff($p['mwst_value'], '%')), 0, 0, 'C');
355
                $pdf->Cell(15, 8, (($bNoTax)?'0.00 %':wpsg_ff($oOrderProduct->getTaxValue(), '%')), 0, 0, 'C');
383
                
356
                
384
            }
357
            }
385
            
358
            
386
            $pdf->setXY($prod_left + 112, $prod_top + $offset + $sum_multi_offset);
359
            $pdf->setXY($prod_left + 112, $prod_top + $offset + $sum_multi_offset);
387
            $pdf->Cell(15, 8, $p['menge'], 0, 0, 'C');
360
            $pdf->Cell(15, 8, $oOrderProduct->getAmount(), 0, 0, 'C');
388
            
361
            
389
            if (wpsg_ShopController::get_option('wpsg_preisangaben') == WPSG_NETTO)
362
            $preis = $oOrderProduct->getPrice(wpsg_ShopController::getShop()->getFrontendTaxview());
390
            {
-
 
391
                $preis = $p['preis_netto'];
-
 
392
                
-
 
393
                //TODO
-
 
394
            }
-
 
395
            else
-
 
396
            {
-
 
397
                $preis = $p['preis_brutto'];
-
 
398
            }
-
 
399
            
363
            
400
            $pdf->setXY($prod_left + 127, $prod_top + $offset + $sum_multi_offset);
364
            $pdf->setXY($prod_left + 127, $prod_top + $offset + $sum_multi_offset);
401
            $pdf->Cell(25, 8, wpsg_ff($preis, $this->get_option('wpsg_currency')), 0, 0, 'R');
365
            $pdf->Cell(25, 8, wpsg_ff($preis, $this->get_option('wpsg_currency')), 0, 0, 'R');
402
            
366
            
403
            $pdf->setXY($prod_left + 152, $prod_top + $offset + $sum_multi_offset);
367
            $pdf->setXY($prod_left + 152, $prod_top + $offset + $sum_multi_offset);
404
            $pdf->Cell(25, 8, wpsg_ff($preis * $p['menge'], $this->get_option('wpsg_currency')), 0, 0, 'R');
368
            $pdf->Cell(25, 8, wpsg_ff($oOrderProduct->getPriceSum(wpsg_ShopController::getShop()->getFrontendTaxview()), $this->get_option('wpsg_currency')), 0, 0, 'R');
405
            
369
            
406
            /**
370
            /**
407
             * Produktbeschreibung anzeigen Ja/Nein
371
             * Produktbeschreibung anzeigen Ja/Nein
408
             */
372
             */
409
            $pBeschreibungHeight = 0;
373
            $pBeschreibungHeight = 0;
410
            if ($this->get_option("wpsg_rechnungen_pbeschreibung") == "1" && trim(strip_tags($p['beschreibung'])) != '')
374
            if ($this->get_option("wpsg_rechnungen_pbeschreibung") == "1" && trim(strip_tags($p['beschreibung'])) != '') {
411
            {
-
 
412
                
375
                
413
                $produktBeschreibung = nl2br($produktBeschreibung);
376
                $produktBeschreibung = nl2br($produktBeschreibung);
414
                preg_match_all('/\<br \/\>/', $produktBeschreibung, $treffer);
377
                preg_match_all('/\<br \/\>/', $produktBeschreibung, $treffer);
415
                $produktBeschreibung = strip_tags($produktBeschreibung);
378
                $produktBeschreibung = strip_tags($produktBeschreibung);
416
                
379
                
Line 429... Line 392...
429
            $height += $pBeschreibungHeight;
392
            $height += $pBeschreibungHeight;
430
            
393
            
431
            /**
394
            /**
432
             * Produktattribute ?
395
             * Produktattribute ?
433
             */
396
             */
434
            if ($this->get_option('wpsg_rechnungen_produktattribute') == '1')
397
            if ($this->get_option('wpsg_rechnungen_produktattribute') == '1') {
435
            {
-
 
436
                
398
                
437
                $attributeInfo = $this->callMod('wpsg_mod_produktattribute', 'getProductAttributeByProductId', array($this->getProduktId($p['id'])));
399
                $attributeInfo = $this->callMod('wpsg_mod_produktattribute', 'getProductAttributeByProductId', array($this->getProduktId($p['id'])));
438
                
400
                
439
                foreach ($attributeInfo as $pa)
401
                foreach ($attributeInfo as $pa) {
440
                {
-
 
441
                    
402
                    
442
                    $pa_text = $pa['name'].': '.$pa['value'];
403
                    $pa_text = $pa['name'].': '.$pa['value'];
443
                    $height += $pdf->wpsg_MultiCell($prod_left + 10, $prod_top + $height + $offset - 0.5 + $sum_multi_offset, 5, $pa_text, 0, 'L', 0, $produkt_text_cell_width);
404
                    $height += $pdf->wpsg_MultiCell($prod_left + 10, $prod_top + $height + $offset - 0.5 + $sum_multi_offset, 5, $pa_text, 0, 'L', 0, $produkt_text_cell_width);
444
                    
405
                    
445
                }
406
                }
446
            }
407
            }
447
            
408
            
448
            /**
409
            /**
449
             * Variante ?
410
             * Variante ?
450
             */
411
             */
451
            if (preg_match('/pv_(.*)/', $p['productkey']))
412
            if (preg_match('/pv_(.*)/', $p['productkey'])) {
452
            {
-
 
453
                
413
                
454
                $variInfo = $this->callMod('wpsg_mod_productvariants', 'getVariantenInfoArray', array($p['productkey']));
414
                $variInfo = $this->callMod('wpsg_mod_productvariants', 'getVariantenInfoArray', array($p['productkey']));
455
                
415
                
456
                $height += $pdf->wpsg_MultiCell($prod_left + 10, $prod_top + $height + $offset - 0.5 + $sum_multi_offset, 5, wpsg_translate(__('Variante: #1#', 'wpsg'), $variInfo['key']), 0, 'L', 0, $produkt_text_cell_width);
416
                $height += $pdf->wpsg_MultiCell($prod_left + 10, $prod_top + $height + $offset - 0.5 + $sum_multi_offset, 5, wpsg_translate(__('Variante: #1#', 'wpsg'), $variInfo['key']), 0, 'L', 0, $produkt_text_cell_width);
457
                
417
                
Line 460... Line 420...
460
            }
420
            }
461
            
421
            
462
            /**
422
            /**
463
             * Lieferschein ?
423
             * Lieferschein ?
464
             */ 
424
             */ 
465
            if ($this->hasMod('wpsg_mod_deliverynote'))
425
            if ($this->hasMod('wpsg_mod_deliverynote')) {
466
            {
-
 
467
                
426
                
468
                $arDN_order = $this->callMod('wpsg_mod_deliverynote', 'loadDeliveryNotesFromOrder', array($oOrder['data']['id']));
427
                $arDN_order = $this->callMod('wpsg_mod_deliverynote', 'loadDeliveryNotesFromOrder', array($oOrder->getId()));
469
                
428
                
470
                if (sizeof($arDN_order) > 1)
429
                if (sizeof($arDN_order) > 1) {
471
                {
-
 
472
                    
430
                    
473
                    $deliveryTimeProduct = $this->callMod('wpsg_mod_deliverynote', 'getProductDeliveryTime', array($oOrder['data']['id'], $p['product_index']));
431
                    $deliveryTimeProduct = $this->callMod('wpsg_mod_deliverynote', 'getProductDeliveryTime', array($oOrder->getId(), $oOrderProduct->getProductIndex()));
474
                    
432
                    
475
                    if ($deliveryTimeProduct !== false)
433
                    if ($deliveryTimeProduct !== false) {
476
                    {
-
 
477
                        
434
                        
478
                        $height += $pdf->wpsg_MultiCell($prod_left + 10, $prod_top + $height + $offset - 0.5 + $sum_multi_offset, 5, wpsg_translate(__('Lieferdatum: #1#', 'wpsg'), date('d.m.Y', $deliveryTimeProduct)), 0, 'L', 0, $produkt_text_cell_width);
435
                        $height += $pdf->wpsg_MultiCell($prod_left + 10, $prod_top + $height + $offset - 0.5 + $sum_multi_offset, 5, wpsg_translate(__('Lieferdatum: #1#', 'wpsg'), date('d.m.Y', $deliveryTimeProduct)), 0, 'L', 0, $produkt_text_cell_width);
479
                        
436
                        
480
                    }
437
                    }
481
                    
438
                    
Line 484... Line 441...
484
            }
441
            }
485
            
442
            
486
            // Jetzt die Rahmen zeichnen
443
            // Jetzt die Rahmen zeichnen
487
            $pdf->Rect($prod_left, $prod_top + $offset + $sum_multi_offset, 10, $height);
444
            $pdf->Rect($prod_left, $prod_top + $offset + $sum_multi_offset, 10, $height);
488
            
445
            
489
            $pdf->Rect($prod_left + 10, $prod_top + $offset + $sum_multi_offset, ((sizeof($oOrder['arCalculation']['tax']) >= 2 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), $height);
446
            $pdf->Rect($prod_left + 10, $prod_top + $offset + $sum_multi_offset, (($bTaxCol == '1')?87:102), $height);
490
            
447
            
491
            if (sizeof($oOrder['arCalculation']['tax']) >= 2 || $this->get_option('wpsg_showMwstAlways') == '1')
-
 
492
            {
448
            if ($bTaxCol) {
493
                
449
                
494
                $pdf->Rect($prod_left + 97, $prod_top + $offset + $sum_multi_offset, 15, $height);
450
                $pdf->Rect($prod_left + 97, $prod_top + $offset + $sum_multi_offset, 15, $height);
495
                
451
                
496
            }
452
            }
497
            
453
            
Line 504... Line 460...
504
            $pnr ++;
460
            $pnr ++;
505
            $count ++;
461
            $count ++;
506
            
462
            
507
            $summe += $p['price'] * $p['menge'];
463
            $summe += $p['price'] * $p['menge'];
508
            
464
            
509
            if ($pdf->getY() > 220 || ($count >= $prod_break && sizeof($oOrder['arCalculation']['produkte']) > ($pnr - 1)))
465
            if ($pdf->getY() > 220 || ($count >= $prod_break && sizeof($oOrder->getOrderProducts()) > ($pnr - 1))) {
510
            {
-
 
511
                
466
                
512
                AddRechnungPage($this, $pdf);
467
                AddRechnungPage($this, $pdf);
513
                $bKopf = false; $count = 0; $offset = 0;
468
                $bKopf = false; $count = 0; $offset = 0;
514
                
469
                
515
            }
470
            }
516
            
471
            
517
        } // produkte
472
        } // produkte
518
	wpsg_debug($oOrder['arCalculation']);
-
 
-
 
473
	
519
        // Gutschein
474
        // Gutschein
520
        if (wpsg_isSizedArray($oOrder['arCalculation']['voucher'])) {
475
        if (wpsg_isSizedArray($arCalculation['voucher'])) {
521
            
476
            
522
            foreach ($oOrder['arCalculation']['voucher'] as $v) {
477
            foreach ($arCalculation['voucher'] as $v) {
523
                
478
                
524
                $pdf->SetFont('Arial', '', 9);
479
                $pdf->SetFont('Arial', '', 9);
525
                $pdf->setXY($prod_left, $prod_top + $offset + $sum_multi_offset);
480
                $pdf->setXY($prod_left, $prod_top + $offset + $sum_multi_offset);
526
                $pdf->Cell(10, 8, $pnr.'.', 1, 0, 'C'); $pnr ++;
481
                $pdf->Cell(10, 8, $pnr.'.', 1, 0, 'C'); $pnr ++;
527
                
482
                
528
                $pdf->setXY($prod_left + 10, $prod_top + $offset + $sum_multi_offset);
483
                $pdf->setXY($prod_left + 10, $prod_top + $offset + $sum_multi_offset);
529
                $pdf->Cell( ((sizeof($oOrder['arCalculation']['tax']) >= 2 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), 8, wpsg_translate(__('Gutschein (#1#)', 'wpsg'), $v['code']), 1, 0, 'L');
484
                $pdf->Cell( (($bTaxCol)?87:102), 8, wpsg_translate(__('Gutschein (#1#)', 'wpsg'), $v['code']), 1, 0, 'L');
530
                
485
                
531
                if (sizeof($oOrder['arCalculation']['tax']) >= 2 || $this->get_option('wpsg_showMwstAlways') == '1')
-
 
532
                {
486
                if ($bTaxCol) {
533
                    
-
 
534
                    $mwst = __('anteilig', 'wpsg');
-
 
535
                    
487
                    
536
                    $pdf->setXY($prod_left + 97, $prod_top + $offset + $sum_multi_offset);
488
                    $pdf->setXY($prod_left + 97, $prod_top + $offset + $sum_multi_offset);
537
                    $pdf->Cell(15, 8, $mwst, 1, 0, 'C');
489
                    $pdf->Cell(15, 8,  __('anteilig', 'wpsg'), 1, 0, 'C');
538
                    
490
                    
539
                }
491
                }
540
                
492
                
541
                $pdf->setXY($prod_left + 112, $prod_top + $offset + $sum_multi_offset);
493
                $pdf->setXY($prod_left + 112, $prod_top + $offset + $sum_multi_offset);
542
                $pdf->Cell(15, 8, '1', 1, 0, 'C');
494
                $pdf->Cell(15, 8, '1', 1, 0, 'C');
Line 555... Line 507...
555
            }
507
            }
556
            
508
            
557
        }
509
        }
558
 
510
 
559
        // Versandkosten
511
        // Versandkosten
560
        if ($oOrder['arCalculation']['sum']['preis_shipping'] != '' && $oOrder['arCalculation']['sum']['preis_shipping'] != 0)
512
	    $cost_shipping = ((wpsg_ShopController::getShop()->getFrontendTaxview() === WPSG_BRUTTO)?$arCalculation['sum']['shipping_brutto']:$arCalculation['sum']['shipping_netto']);
561
        {
513
	    
-
 
514
        if ($arCalculation['sum']['shipping_brutto'] > 0) {
562
            
515
            
563
            $pdf->SetFont('Arial', '', 9);
516
            $pdf->SetFont('Arial', '', 9);
564
            $pdf->setXY($prod_left, $prod_top + $offset + $sum_multi_offset);
517
            $pdf->setXY($prod_left, $prod_top + $offset + $sum_multi_offset);
565
            $pdf->Cell(10, 8, $pnr.'.', 1, 0, 'C'); $pnr ++;
518
            $pdf->Cell(10, 8, $pnr.'.', 1, 0, 'C'); $pnr ++;
566
            
519
            
567
            $pdf->setXY($prod_left + 10, $prod_top + $offset + $sum_multi_offset);
520
            $pdf->setXY($prod_left + 10, $prod_top + $offset + $sum_multi_offset);
568
            $pdf->Cell( ((sizeof($oOrder['arCalculation']['tax']) >= 2 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), 8, wpsg_translate(__('Versandkosten "#1#"', 'wpsg'), $this->view['oOrder']->getShippingLabel()), 1, 0, 'L');
521
            $pdf->Cell( (($bTaxCol)?87:102), 8, wpsg_translate(__('Versandkosten "#1#"', 'wpsg'), $oOrder->getShippingLabel()), 1, 0, 'L');
569
            
522
            
570
            if (sizeof($oOrder['arCalculation']['tax']) >= 2 || $this->get_option('wpsg_showMwstAlways') == '1')
-
 
571
            {
523
            if ($bTaxCol) {
572
                
524
                 
573
                if ($this->arShipping[$oOrder['data']['type_shipping']]['mwst_null'] == '1' && $oOrder['basket']['noMwSt'] == '1')
-
 
574
                {
525
                if ($bNoTax) {
575
                    
526
                    
576
                    $mwst = 0;
527
                    $mwst = 0;
577
                    
528
                    
578
                }
-
 
579
                else
529
                } else { 
580
                {
-
 
581
                    
530
                    
582
                    if ($oOrder['arCalculation']['shipping'][0]['tax_key'] === '0') {
531
                    if ($arCalculation['shipping'][0]['tax_key'] === '0') {
583
                    
532
                    
584
                        $mwst = _('anteilig');
533
                        $mwst = _('anteilig');
585
                        
534
                        
586
                    } else {
535
                    } else {
587
                                            
536
                                            
588
                        $mwst = wpsg_ff($oOrder['arCalculation']['shipping'][0]['tax'], '%');
537
                        $mwst = wpsg_ff($arCalculation['shipping'][0]['tax'], '%');
589
                        $mwst = wpsg_ff($oOrder['arCalculation']['tax'][$oOrder['arCalculation']['shipping'][0]['tax_key']]['tax_value'], '%');
538
                        $mwst = wpsg_ff($arCalculation['tax'][$arCalculation['shipping'][0]['tax_key']]['tax_value'], '%');
590
                        
539
                        
591
                    }
540
                    }
592
                    
541
                    
593
                }
542
                }
594
                
543
                 
595
                $pdf->setXY($prod_left + 97, $prod_top + $offset + $sum_multi_offset);
544
                $pdf->setXY($prod_left + 97, $prod_top + $offset + $sum_multi_offset);
596
                $pdf->Cell(15, 8, $mwst, 1, 0, 'C');
545
                $pdf->Cell(15, 8, $mwst, 1, 0, 'C');
597
                
546
                
598
            }
547
            }
599
            
548
            
600
            $pdf->setXY($prod_left + 112, $prod_top + $offset + $sum_multi_offset);
549
            $pdf->setXY($prod_left + 112, $prod_top + $offset + $sum_multi_offset);
601
            $pdf->Cell(15, 8, '1', 1, 0, 'C');
550
            $pdf->Cell(15, 8, '1', 1, 0, 'C');
602
            
551
            
603
            $pdf->setXY($prod_left + 127, $prod_top + $offset + $sum_multi_offset);
552
            $pdf->setXY($prod_left + 127, $prod_top + $offset + $sum_multi_offset);
604
            $pdf->Cell(25, 8, wpsg_ff($oOrder['arCalculation']['sum']['preis_shipping'], $this->get_option('wpsg_currency')), 1, 0, 'R');
553
            $pdf->Cell(25, 8, wpsg_ff($arCalculation['sum']['shipping_brutto'], $this->get_option('wpsg_currency')), 1, 0, 'R');
605
            
554
            
606
            $pdf->setXY($prod_left + 152, $prod_top + $offset + $sum_multi_offset);
555
            $pdf->setXY($prod_left + 152, $prod_top + $offset + $sum_multi_offset);
607
            $pdf->Cell(25, 8, wpsg_ff($oOrder['arCalculation']['sum']['preis_shipping'], $this->get_option('wpsg_currency')), 1, 0, 'R');
556
            $pdf->Cell(25, 8, wpsg_ff($arCalculation['sum']['shipping_brutto'], $this->get_option('wpsg_currency')), 1, 0, 'R');
608
            
557
            
609
            $offset += 8;
558
            $offset += 8;
610
            
559
            
611
            // Zusammengesetzte Versandarten darstellen
-
 
612
            /*
-
 
613
            if (wpsg_isSizedArray($this->view['basket']['shipping']['methods'])) {
-
 
614
            
-
 
615
                foreach ($this->view['basket']['shipping']['methods'] as $shipping) {
-
 
616
                        
-
 
617
                    $pdf->SetFont('Arial', '', 9);
-
 
618
                    $pdf->setXY($prod_left, $prod_top + $offset);
-
 
619
                    $pdf->Cell(10, 8, '', 1, 0, 'C'); $pnr ++;
-
 
620
                        
-
 
621
                    $pdf->setXY($prod_left + 10, $prod_top + $offset);
-
 
622
                    $pdf->Cell( ((sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), 8, $this->getShippingName($shipping), 1, 0, 'L');
-
 
623
                        
-
 
624
                    if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
-
 
625
                    {
-
 
626
                    
-
 
627
                        if ($this->view['basket']['shipping'][$shipping]['tax_rata'] == 1) { $mwst = __('Anteilig', 'wpsg'); }
-
 
628
                        else { $mwst = wpsg_ff($this->view['basket']['shipping'][$shipping]['mwst'], '%'); }
-
 
629
                        
-
 
630
                        $pdf->setXY($prod_left + 97, $prod_top + $offset);
-
 
631
                        $pdf->Cell(15, 8, $mwst, 1, 0, 'C');
-
 
632
                        
-
 
633
                    }
-
 
634
                    
-
 
635
                    $pdf->setXY($prod_left + 112, $prod_top + $offset);
-
 
636
                    $pdf->Cell(15, 8, '1', 1, 0, 'C');
-
 
637
                        
-
 
638
                    $pdf->setXY($prod_left + 127, $prod_top + $offset);
-
 
639
                    $pdf->Cell(25, 8, wpsg_ff($this->view['basket']['shipping'][$shipping]['preis_shipping_brutto'], $this->get_option('wpsg_currency')), 1, 0, 'R');
-
 
640
                    
-
 
641
                    $pdf->setXY($prod_left + 152, $prod_top + $offset);
-
 
642
                    $pdf->Cell(25, 8, wpsg_ff($this->view['basket']['shipping'][$shipping]['preis_shipping_brutto'], $this->get_option('wpsg_currency')), 1, 0, 'R');
-
 
643
                        
-
 
644
                    $offset += 8;
-
 
645
                    
-
 
646
                }
-
 
647
            
-
 
648
            }
-
 
649
            */
-
 
650
            
-
 
651
            
-
 
652
        }
560
        }
653
        
561
        
654
        // Zahlungskosten
562
        // Zahlungskosten
655
        if ($oOrder['arCalculation']['sum']['preis_payment'] != '' && $oOrder['arCalculation']['sum']['preis_payment'] != 0)
563
	    $cost_payment = ((wpsg_ShopController::getShop()->getFrontendTaxview() === WPSG_BRUTTO)?$arCalculation['sum']['payment_brutto']:$arCalculation['sum']['payment_netto']);
-
 
564
	    
656
        {
565
        if ($cost_payment > 0) {
657
            
566
            
658
            $pdf->SetFont('Arial', '', 9);
567
            $pdf->SetFont('Arial', '', 9);
659
            $pdf->setXY($prod_left, $prod_top + $offset + $sum_multi_offset);
568
            $pdf->setXY($prod_left, $prod_top + $offset + $sum_multi_offset);
660
            $pdf->Cell(10, 8, $pnr.'.', 1, 0, 'C'); $pnr ++;
569
            $pdf->Cell(10, 8, $pnr.'.', 1, 0, 'C'); $pnr ++;
661
            
570
            
662
            $pdf->setXY($prod_left + 10, $prod_top + $offset + $sum_multi_offset);
571
            $pdf->setXY($prod_left + 10, $prod_top + $offset + $sum_multi_offset);
663
            $pdf->Cell( ((sizeof($oOrder['arCalculation']['tax']) >= 2 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), 8, $this->arPayment[$oOrder['data']['type_payment']]['name'], 1, 0, 'L');
572
            $pdf->Cell( (($bTaxCol)?87:102), 8, $oOrder->getPaymentLabel(), 1, 0, 'L');
664
            
573
            
665
            if (sizeof($oOrder['arCalculation']['tax']) >= 2 || $this->get_option('wpsg_showMwstAlways') == '1')
-
 
666
            {
574
            if ($bTaxCol) {
667
                
575
                
668
                if ($this->arPayment[$oOrder['data']['type_payment']]['mwst_null'] == '1' && $this->view['basket']['noMwSt'] == '1')
-
 
669
                {
576
                if ($bNoTax) {
-
 
577
					
670
                    $mwst = 0;
578
                    $mwst = 0;
671
                }
-
 
-
 
579
					
672
                else
580
                } else {
673
                {
-
 
674
                    
581
                    
675
                    if ($oOrder['arCalculation']['payment'][0]['tax_key'] === '0') {
582
                    if ($arCalculation['payment'][0]['tax_key'] === '0') {
676
                        
583
                        
677
                        $mwst = _('anteilig');
584
                        $mwst = _('anteilig');
678
                        
585
                        
679
                    } else {
586
                    } else {
680
                        
587
                        
681
                        $mwst = wpsg_ff($oOrder['arCalculation']['payment'][0]['tax'], '%');
588
                        $mwst = wpsg_ff($arCalculation['payment'][0]['tax'], '%');
682
                        $mwst = wpsg_ff($oOrder['arCalculation']['tax'][$oOrder['arCalculation']['payment'][0]['tax_key']]['tax_value'], '%');
589
                        $mwst = wpsg_ff($arCalculation['tax'][$arCalculation['payment'][0]['tax_key']]['tax_value'], '%');
683
                        
590
                        
684
                    }
591
                    }
685
                    
592
                    
686
                }
593
                }
687
                
594
                
Line 692... Line 599...
692
            
599
            
693
            $pdf->setXY($prod_left + 112, $prod_top + $offset + $sum_multi_offset);
600
            $pdf->setXY($prod_left + 112, $prod_top + $offset + $sum_multi_offset);
694
            $pdf->Cell(15, 8, '1', 1, 0, 'C');
601
            $pdf->Cell(15, 8, '1', 1, 0, 'C');
695
            
602
            
696
            $pdf->setXY($prod_left + 127, $prod_top + $offset + $sum_multi_offset);
603
            $pdf->setXY($prod_left + 127, $prod_top + $offset + $sum_multi_offset);
697
            $pdf->Cell(25, 8, wpsg_ff($oOrder['arCalculation']['sum']['preis_payment'], $this->get_option('wpsg_currency')), 1, 0, 'R');
604
            $pdf->Cell(25, 8, wpsg_ff($cost_payment, $this->get_option('wpsg_currency')), 1, 0, 'R');
698
            
605
            
699
            $pdf->setXY($prod_left + 152, $prod_top + $offset + $sum_multi_offset);
606
            $pdf->setXY($prod_left + 152, $prod_top + $offset + $sum_multi_offset);
700
            $pdf->Cell(25, 8, wpsg_ff($oOrder['arCalculation']['sum']['preis_payment'], $this->get_option('wpsg_currency')), 1, 0, 'R');
607
            $pdf->Cell(25, 8, wpsg_ff($cost_payment, $this->get_option('wpsg_currency')), 1, 0, 'R');
701
            
608
            
702
            $offset += 8;
609
            $offset += 8;
703
            
610
            
704
        }
611
        }
705
        
612
        
-
 
613
		// Rabatt
-
 
614
	    if ($arCalculation['sum']['discount_brutto'] < 0) {
-
 
615
			
-
 
616
			$pdf->SetFont('Arial', '', 9);
-
 
617
            $pdf->setXY($prod_left, $prod_top + $offset + $sum_multi_offset);
-
 
618
            $pdf->Cell(10, 8, $pnr.'.', 1, 0, 'C'); $pnr ++;
-
 
619
			
-
 
620
			$pdf->setXY($prod_left + 10, $prod_top + $offset + $sum_multi_offset);
-
 
621
            $pdf->Cell( (($bTaxCol)?87:102), 8, _('Rabatt'), 1, 0, 'L');
-
 
622
			
-
 
623
			$pdf->setXY($prod_left + 97, $prod_top + $offset + $sum_multi_offset);
-
 
624
            $pdf->Cell(15, 8, _('Anteilig'), 1, 0, 'C');
-
 
625
			
-
 
626
			$pdf->setXY($prod_left + 112, $prod_top + $offset + $sum_multi_offset);
-
 
627
            $pdf->Cell(15, 8, '1', 1, 0, 'C');
-
 
628
			
-
 
629
			$pdf->setXY($prod_left + 127, $prod_top + $offset + $sum_multi_offset);
-
 
630
            $pdf->Cell(25, 8, wpsg_ff($arCalculation['sum']['discount_brutto'], $this->get_option('wpsg_currency')), 1, 0, 'R');
-
 
631
            
-
 
632
            $pdf->setXY($prod_left + 152, $prod_top + $offset + $sum_multi_offset);
-
 
633
            $pdf->Cell(25, 8, wpsg_ff($arCalculation['sum']['discount_brutto'], $this->get_option('wpsg_currency')), 1, 0, 'R');
-
 
634
			
-
 
635
			$offset += 8;
-
 
636
			
-
 
637
	    }
-
 
638
		
706
        // Gebühr
639
        // Gebühr
707
        if (wpsg_tf(wpsg_getStr($this->view['storno_fee'])) > 0)
640
        if (wpsg_tf(wpsg_getStr($this->view['storno_fee'])) > 0) {
708
        {
-
 
709
            
641
            
710
            $pdf->SetFont('Arial', '', 9);
642
            $pdf->SetFont('Arial', '', 9);
711
            $pdf->setXY($prod_left, $prod_top + $offset + $sum_multi_offset);
643
            $pdf->setXY($prod_left, $prod_top + $offset + $sum_multi_offset);
712
            $pdf->Cell(10, 8, $pnr.'.', 1, 0, 'C'); $pnr ++;
644
            $pdf->Cell(10, 8, $pnr.'.', 1, 0, 'C'); $pnr ++;
713
            
645
            
714
            $label = __('Bearbeitungsgebühr', 'wpsg');
646
            $label = __('Bearbeitungsgebühr', 'wpsg');
715
            
647
            
716
            if (strpos($this->view['storno_fee'], '%') !== false) $label .= ' ('.wpsg_ff($this->view['storno_fee'], '%').')';
648
            if (strpos($this->view['storno_fee'], '%') !== false) $label .= ' ('.wpsg_ff($this->view['storno_fee'], '%').')';
717
            
649
            
718
            $pdf->setXY($prod_left + 10, $prod_top + $offset + $sum_multi_offset);
650
            $pdf->setXY($prod_left + 10, $prod_top + $offset + $sum_multi_offset);
719
            $pdf->Cell( ((sizeof($oOrder['arCalculation']['tax']) >= 2 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), 8, $label, 1, 0, 'L');
651
            $pdf->Cell( (($bTaxCol)?87:102), 8, $label, 1, 0, 'L');
720
            
652
            
721
            if (sizeof($oOrder['arCalculation']['tax']) >= 2 || $this->get_option('wpsg_showMwstAlways') == '1')
-
 
722
            {
653
            if ($bTaxCol) {
723
                
654
                
724
                if ($this->view['basket']['noMwSt'] == '1')
-
 
725
                {
655
                if ($bNoTax) {
-
 
656
					
726
                    $mwst = 0;
657
                    $mwst = 0;
727
                }
-
 
728
                else
-
 
729
                {
-
 
730
                    
658
					
-
 
659
                } else {                    
731
                    
660
                    
732
                    $mwst = wpsg_ff($this->view['storno_fee_tax_value'], '%');
661
                    $mwst = wpsg_ff($this->view['storno_fee_tax_value'], '%');
733
                    
662
                    
734
                }
663
                }
735
                
664
                
Line 750... Line 679...
750
            $offset += 8;
679
            $offset += 8;
751
 
680
 
752
        }
681
        }
753
 
682
 
754
        // Bestellbetrag einer einzelnen Bestellung
683
        // Bestellbetrag einer einzelnen Bestellung
755
        if ($arCalculation['noMwSt'] == '1')
684
        if ($bNoTax) {
756
		{
685
			
757
            $pdf->Text($prod_left + 115, $prod_top + $offset + $sum_multi_offset + 6, __("Bestellbetrag (NETTO):", "wpsg"));
686
            $pdf->Text($prod_left + 115, $prod_top + $offset + $sum_multi_offset + 6, __("Bestellbetrag (NETTO):", "wpsg"));
758
			$pdf->setXY($prod_left + 140, $prod_top + $offset + $sum_multi_offset + 1);
687
			$pdf->setXY($prod_left + 140, $prod_top + $offset + $sum_multi_offset + 1);
759
			$pdf->Cell(37, 8, wpsg_ff($oOrder['arCalculation']['sum']['productsum_netto'] + $oOrder['arCalculation']['sum']['preis_rabatt'], $this->get_option('wpsg_currency')), 0, 0, 'R');
688
			$pdf->Cell(37, 8, wpsg_ff($arCalculation['sum']['netto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
760
        } 
689
			
761
        else 
690
        } else  {
762
        {
691
			
763
            $pdf->Text($prod_left + 115, $prod_top + $offset + $sum_multi_offset + 6, __("Bestellbetrag (BRUTTO):", "wpsg"));
692
            $pdf->Text($prod_left + 115, $prod_top + $offset + $sum_multi_offset + 6, __("Bestellbetrag (BRUTTO):", "wpsg"));
764
			$pdf->setXY($prod_left + 140, $prod_top + $offset + $sum_multi_offset + 1);
693
			$pdf->setXY($prod_left + 140, $prod_top + $offset + $sum_multi_offset + 1);
765
			$pdf->Cell(37, 8, wpsg_ff($oOrder['arCalculation']['sum']['productsum_brutto'] + $oOrder['arCalculation']['sum']['preis_rabatt'], $this->get_option('wpsg_currency')), 0, 0, 'R');
694
			$pdf->Cell(37, 8, wpsg_ff($arCalculation['sum']['brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
-
 
695
			
766
        }
696
        }
767
 
697
 
768
 
-
 
769
        $sum_multi_offset += ($offset + 30);
698
        $sum_multi_offset += ($offset + 30);
770
 
699
		
771
    } // FOREACH ORDER END
700
    } // FOREACH ORDER END
-
 
701
			
-
 
702
	$arCalculation = $this->view['arCalculationSum'];
-
 
703
	
-
 
704
	$offset = $sum_multi_offset - 30;
772
	
705
	
773
	$pdf->SetFont('Arial', '', 9);
706
	$pdf->SetFont('Arial', '', 9);
774
	
707
	
775
	if ($this->view['kunde']['ustidnr'] != "")
708
	if ($this->view['kunde']['ustidnr'] != "") {
776
	{
709
		
777
		$offset += 10;
710
		$offset += 13;
-
 
711
		
778
		$pdf->Text($prod_left, $prod_top + $offset, __("Ihre Umsatzsteuer-Identifikationsnummer:", "wpsg"));
712
		$pdf->Text($prod_left, $prod_top + $offset, __("Ihre Umsatzsteuer-Identifikationsnummer:", "wpsg"));
779
		$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
713
		$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
780
		$pdf->Cell(37, 8, $this->view['kunde']['ustidnr'], 0, 0, 'R');
714
		$pdf->Cell(37, 8, $this->view['kunde']['ustidnr'], 0, 0, 'R');
-
 
715
		
781
	}
716
	}
782
 
717
 
783
	$offset += 10;
718
	$offset += 10;
-
 
719
		
784
	if ($this->get_option('wpsg_kleinunternehmer'))
720
	$offset = $checkPageBreak($this, $offset, 6);
785
	{
721
	
-
 
722
	if ($this->get_option('wpsg_kleinunternehmer')) {
786
		
723
		
787
		$pdf->Text($prod_left, $prod_top + $offset + 10, __("Es ergibt sich folgender Gesamtbetrag", "wpsg").':');
724
		$pdf->Text($prod_left, $prod_top + $offset + 10, __("Es ergibt sich folgender Gesamtbetrag", "wpsg").':');
788
		$pdf->Text($prod_left + 80, $prod_top + $offset, __("Summe", "wpsg"));
725
		$pdf->Text($prod_left + 80, $prod_top + $offset, __("Summe", "wpsg"));
789
		$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
726
		$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
790
		$pdf->Cell(37, 8, wpsg_ff($sum_productsum_brutto + $arCalculation['sum']['preis_rabatt'], $this->get_option('wpsg_currency')), 0, 0, 'R');
727
		$pdf->Cell(37, 8, wpsg_ff($sum_productsum_brutto + $arCalculation['sum']['preis_rabatt'], $this->get_option('wpsg_currency')), 0, 0, 'R');
-
 
728
		
791
		$offset += 5;
729
		$offset += 5;
792
		
730
		
793
	}
-
 
794
	else
731
	} else {
795
	{
-
 
796
		
732
		
797
		if ($arCalculation['noMwSt'] == '1')
733
		if ($bNoTax) {
798
		{
-
 
799
			
734
			
800
			$pdf->Text($prod_left, $prod_top + $offset + 10, __("Es ergibt sich folgender Gesamtbetrag", "wpsg").':');
735
			$pdf->Text($prod_left, $prod_top + $offset + 10, __("Es ergibt sich folgender Gesamtbetrag", "wpsg").':');
801
			$pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("BRUTTOBETRAG", "wpsg"));
736
			$pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("BRUTTOBETRAG", "wpsg"));
802
			$pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
737
			$pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
803
			$pdf->Cell(37, 8, wpsg_ff($sum_topay_brutto + $arCalculation['sum']['preis_rabatt'], $this->get_option('wpsg_currency')), 0, 0, 'R');
738
			$pdf->Cell(37, 8, wpsg_ff($arCalculation['sum']['brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
804
			$offset += 5;
739
			$offset += 5;
805
			
740
			
806
			$pdf->Text($prod_left + 80, $prod_top + $offset, __("MwSt. GESAMT", "wpsg"));
741
			$pdf->Text($prod_left + 80, $prod_top + $offset, __("MwSt. GESAMT", "wpsg"));
807
			$pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
742
			$pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
808
			$pdf->Cell(37, 8, wpsg_ff(0, $this->get_option('wpsg_currency')), 0, 0, 'R');
743
			$pdf->Cell(37, 8, wpsg_ff(0, $this->get_option('wpsg_currency')), 0, 0, 'R');
809
			
744
			
810
		}
-
 
811
		else
745
		} else {
812
		{
-
 
813
			
746
			
814
			$pdf->Text($prod_left, $prod_top + $offset + 10, __("Der Gesamtbetrag setzt sich wie folgt zusammen", "wpsg"));
747
			$pdf->Text($prod_left, $prod_top + $offset + 10, __("Der Gesamtbetrag setzt sich wie folgt zusammen", "wpsg"));
815
			
748
			
816
			$pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("NETTOBETRAG GESAMT", "wpsg"));
749
			$pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("NETTOBETRAG GESAMT", "wpsg"));
817
			$pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
750
			$pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
818
			$pdf->Cell(37, 8, wpsg_ff($sum_topay_netto + $arCalculation['sum']['preis_rabatt'], $this->get_option('wpsg_currency')), 0, 0, 'R');
751
			$pdf->Cell(37, 8, wpsg_ff($arCalculation['sum']['netto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
819
			
752
			
820
			if (sizeof($arCalculation['tax']) >= 1)
753
			if (sizeof($arCalculation['tax']) >= 1) {
821
			{
-
 
822
				
754
				
823
				foreach ($arCalculation['tax'] as $mw)
755
				foreach ($arCalculation['tax'] as $k => $mw) {
824
				{
756
					
-
 
757
					if ($k === 0) continue;					
825
					
758
					
826
					$offset += 5;
759
					$offset += 5;
-
 
760
					
827
					$pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("MwSt. ", "wpsg").wpsg_ff($mw['value'], '%'));
761
					$pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("MwSt. ", "wpsg").wpsg_ff($mw['tax_value'], '%'));
828
					$pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
762
					$pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
829
					$pdf->Cell(37, 8, wpsg_ff($mw['sum'], $this->get_option('wpsg_currency')), 0, 0, 'R');
763
					$pdf->Cell(37, 8, wpsg_ff($mw['sum'], $this->get_option('wpsg_currency')), 0, 0, 'R');
830
					
764
					
831
				}
765
				}
832
				
766
				
833
			}
767
			}
834
			
768
			
835
			if (sizeof($arCalculation['tax']) > 1)
769
			if (sizeof($arCalculation['tax']) > 1) {
836
			{
-
 
837
				
770
				
838
				$offset += 5;
771
				$offset += 5;
839
				$pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("MwSt. GESAMT", "wpsg"));
772
				$pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("MwSt. GESAMT", "wpsg"));
840
				$pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
773
				$pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
841
				$pdf->Cell(37, 8, wpsg_ff($sum_productsum_brutto - $sum_productsum_netto, $this->get_option('wpsg_currency')), 0, 0, 'R');
774
				$pdf->Cell(37, 8, wpsg_ff($arCalculation['sum']['tax'], $this->get_option('wpsg_currency')), 0, 0, 'R');
842
				
775
				
843
			}
776
			}
844
			
777
			
845
		}
778
		}
846
		
779
		
847
	}
780
	}
848
	
-
 
849
	// Rabatt
-
 
850
	if ($arCalculation['sum']['preis_rabatt'] > 0)
-
 
851
	{
-
 
852
		
-
 
853
		$offset += 5;
-
 
854
		
-
 
855
		$pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("Rabatt", "wpsg"));
-
 
856
		$pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
-
 
857
		$pdf->Cell(37, 8, '-'.wpsg_ff($arCalculation['sum']['preis_rabatt'], $this->get_option('wpsg_currency')), 0, 0, 'R');
-
 
858
		
-
 
859
	}
-
 
860
		
781
		
861
	// Wertgutschein
782
	// Wertgutschein
862
	if ($arCalculation['sum']['topay_brutto'] !== $arCalculation['sum']['brutto']) {
783
	if ($arCalculation['sum']['topay_brutto'] !== $arCalculation['sum']['brutto']) {
863
		
784
		
864
		$offset += 5;
785
		$offset += 5;
865
		$pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("Bruttobetrag GESAMT", "wpsg"));
786
		$pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("Bruttobetrag GESAMT", "wpsg"));
866
		$pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
787
		$pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
867
		
788
		
868
		$pdf->setFont('Arial', '', '9');
789
		$pdf->setFont('Arial', '', '9');
869
		$pdf->Cell(37, 8, wpsg_ff($sum_productsum_brutto, $this->get_option('wpsg_currency')), 0, 0, 'R');
790
		$pdf->Cell(37, 8, wpsg_ff($arCalculation['sum']['brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
870
		$pdf->setFont('Arial', '', '9');
791
		$pdf->setFont('Arial', '', '9');
871
 
792
 
872
        foreach ($orders as $oCoupons){
793
        foreach ($orders as $oCoupons){
873
 
794
 
874
            foreach ($arCalculation['coupon'] as $c) {
795
            foreach ($arCalculation['coupon'] as $c) {
Line 890... Line 811...
890
		$pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("ZU ZAHLEN", "wpsg"));
811
		$pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("ZU ZAHLEN", "wpsg"));
891
		$pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
812
		$pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
892
		
813
		
893
		/* Endbetrag wird fett ausgegeben */
814
		/* Endbetrag wird fett ausgegeben */
894
		$pdf->setFont('Arial', 'B', '9');
815
		$pdf->setFont('Arial', 'B', '9');
895
		$pdf->Cell(37, 8, wpsg_ff($sum_topay_brutto, $this->get_option('wpsg_currency')), 0, 0, 'R');
816
		$pdf->Cell(37, 8, wpsg_ff($arCalculation['sum']['topay_brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
896
		$pdf->setFont('Arial', '', '9');
817
		$pdf->setFont('Arial', '', '9');
897
		
818
		
898
	} else {
819
	} else {
899
	
820
	
900
		$offset += 5;
821
		$offset += 5;
901
		$pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("GESAMTSUMME", "wpsg"));
822
		$pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("GESAMTSUMME", "wpsg"));
902
		$pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
823
		$pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
903
		/* Endbetrag wird fett ausgegeben */
824
		/* Endbetrag wird fett ausgegeben */
904
		$pdf->setFont('Arial', 'B', '9');
825
		$pdf->setFont('Arial', 'B', '9');
905
		$pdf->Cell(37, 8, wpsg_ff($sum_topay_brutto, $this->get_option('wpsg_currency')), 0, 0, 'R');
826
		$pdf->Cell(37, 8, wpsg_ff($arCalculation['sum']['topay_brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
906
		$pdf->setFont('Arial', '', '9');
827
		$pdf->setFont('Arial', '', '9');
907
				
828
				
908
	}
829
	}
909
	
830
	
910
	if ($this->get_option('wpsg_kleinunternehmer') == '1')
831
	if ($this->get_option('wpsg_kleinunternehmer') == '1')
Line 946... Line 867...
946
		$offset += 10;
867
		$offset += 10;
947
		
868
		
948
	}
869
	}
949
	
870
	
950
	$shipping_adress = false;
871
	$shipping_adress = false;
951
	
-
 
952
	if ($this->hasMod('wpsg_mod_shippingadress') && $this->callMod('wpsg_mod_shippingadress', 'check_different_shippingadress', array('k_id' => $data['k_id'], 'o_id' => $data['id']))) {
-
 
953
		
-
 
954
		$pdf->setFont('Arial', 'B', 9);
-
 
955
		$pdf->Text($prod_left, $prod_top + $offset + 10, __("Lieferanschrift", "wpsg").":");
-
 
956
		$offset += 5;
-
 
957
		
-
 
958
		$pdf->setFont('Arial', '', 9);
-
 
959
		
-
 
960
		$shipping_adress = "";
-
 
961
		if ($data['shipping_firma'] != "")
-
 
962
		{
-
 
963
			$shipping_adress .= $data['shipping_firma']."\r\n";
-
 
964
		}
-
 
965
		$shipping_adress .= $data['shipping_vname'].' '.$data['shipping_name']."\r\n";
-
 
966
		$shipping_adress .= $data['shipping_strasse'].' '.$data['shipping_nr']."\r\n";
-
 
967
		//$shipping_adress .= $data['shipping_land']['kuerzel'].'-';
-
 
968
		
-
 
969
		$shipping_adress .= $data['shipping_plz'].' '.$data['shipping_ort']."\r\n";
-
 
970
		$shipping_adress .= $data['shipping_land']['name'];
-
 
971
		
-
 
972
		
-
 
973
		$start = $pdf->getY();
-
 
974
		$pdf->wpsg_MultiCell($prod_left - 1, $prod_top + $offset + 10, 5, $shipping_adress, 0, 'L', 0, 100);
-
 
975
		$offset += $pdf->getY() - $start;
-
 
976
		
-
 
977
		$shipping_adress = true;
-
 
978
		
872
		
979
	}
-
 
980
	
-
 
981
	$offset += 5;
873
	$offset += 5;
982
	
-
 
983
	// Bestellvariablen
-
 
984
	if ($this->hasMod('wpsg_mod_ordervars') && $this->get_option('wpsg_mod_rechnungen_showov') == '1')
-
 
985
	{
-
 
986
		
874
		
987
		$bvars = @unserialize($data['bvars']);
-
 
988
		if (!is_array($bvars)) $bvars = array();
-
 
989
		
-
 
990
		$strBVars = "";
-
 
991
		foreach ($bvars as $bvars_id => $bvars_value)
-
 
992
		{
-
 
993
			
-
 
994
			$bvars = $this->db->fetchRow("SELECT * FROM `".wpsg_q(WPSG_TBL_ORDERVARS)."` WHERE `id` = '".wpsg_q($bvars_id)."' ORDER BY `pos` ASC, `id` ASC ");
-
 
995
			
-
 
996
			if ($bvars['typ'] == "1") // Auswahl
-
 
997
			{
-
 
998
				if ($bvars_value <= 0) $bvars_value = __("Keine Angabe", "wpsg");
-
 
999
			}
-
 
1000
			else if ($bvars['typ'] == "2") // Texteingabe
-
 
1001
			{
-
 
1002
				if (trim($bvars_value) == "") $bvars_value = __("Keine Angabe", "wpsg");
-
 
1003
			}
-
 
1004
			else if ($bvars['typ'] == "3") // Checkbox
-
 
1005
			{
-
 
1006
				if ($bvars_value <= 0) $bvars_value = __("Keine Angabe", "wpsg");
-
 
1007
			}
-
 
1008
			
-
 
1009
			$bvars_name = $this->callMod('wpsg_mod_ordervars', 'getNameById', array($bvars_id));
-
 
1010
			$strBVars .= "\r\n".$bvars_name.": ".$bvars_value;
-
 
1011
			
-
 
1012
		}
-
 
1013
		
-
 
1014
		$pdf->SetFont('Arial', 'B', 9);
-
 
1015
		$pdf->Text($prod_left, $prod_top + $offset + 10, __("Angaben während der Bestellung", "wpsg").":");
-
 
1016
		$pdf->SetFont('Arial', '', 9);
-
 
1017
		$pdf->wpsg_MultiCell($prod_left - 1, $prod_top + $offset + 10, 5, $strBVars);
-
 
1018
		
-
 
1019
	}
-
 
1020
	
-
 
1021
	if (!file_exists($this->callMod('wpsg_mod_rechnungen', 'getFilePath', array($data['id']))))
875
	if (!file_exists($this->callMod('wpsg_mod_rechnungen', 'getFilePath', array($data['id'])))) {
1022
	{
-
 
1023
		
876
		
1024
		mkdir($this->callMod('wpsg_mod_rechnungen', 'getFilePath', array($data['id'])), 0777, true);
877
		mkdir($this->callMod('wpsg_mod_rechnungen', 'getFilePath', array($data['id'])), 0777, true);
1025
		
878
		
1026
	}
879
	}
1027
	
880
		
1028
	$this->callMods('wpsg_mod_rechnungen_pdf', array(&$pdf, &$data['id'], &$this->view['preview'], &$this->view['invoice']));
-
 
1029
	
-
 
1030
	$filename = $this->view['filename'].".pdf";
881
	$filename = $this->view['filename'].".pdf";
1031
	
882
	 
1032
	//ob_end_clean();
-
 
1033
	
-
 
1034
    // wpsg_debug("Generierter Dateipfad: ".$this->callMod('wpsg_mod_rechnungen', 'getFilePath', array($data['id'])).$filename, 'F'); // DEBUG
-
 
1035
 
-
 
1036
	if ($this->view['preview']) {
883
	if ($this->view['preview']) {
-
 
884
 
-
 
885
		//$pdf->Output($this->callMod('wpsg_mod_rechnungen', 'getFilePath', array('multi')).$filename, 'F');
-
 
886
		$pdf->Output();
1037
		
887
		
1038
		$pdf->Output($filename, 'I');
888
	    exit;
1039
		
889
		
1040
	} else {
890
	} else {
1041
		
891
		
1042
		$pdf->Output($this->callMod('wpsg_mod_rechnungen', 'getFilePath', array($data['id'])).$filename, 'F');
892
		$pdf->Output($this->callMod('wpsg_mod_rechnungen', 'getFilePath', array('multi')).$filename, 'F');
1043
		
893
		
1044
		// Hier wird der Dateiname an FPD übergeben. Er soll sich aus der Rechnungsnummer ergeben, auch wenn das Dokument über die ID gespeichert ist.
894
		// Hier wird der Dateiname an FPD übergeben. Er soll sich aus der Rechnungsnummer ergeben, auch wenn das Dokument über die ID gespeichert ist.
1045
		if ($this->view['output'] === true) $pdf->Output($this->view['filename_out'], 'I');
895
		if ($this->view['output'] === true) $pdf->Output($this->view['filename_out'], 'I');
1046
		
896
		
1047
	}
897
	}
1048
 
-
 
1049
?>
-
 
1050
898
 
-
 
899
1051
900