Subversion Repositories wpShopGermany4

Rev

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

Rev 8082 Rev 8083
Line 133... Line 133...
133
            // Kunden-Nr
133
            // Kunden-Nr
134
			$pdf->Text($rdata_left + 55, $rdata_top, __("Kunden-Nr", "wpsg"));
134
			$pdf->Text($rdata_left + 55, $rdata_top, __("Kunden-Nr", "wpsg"));
135
			$pdf->Text($rdata_left + 55, $rdata_top + 6, (($shop->view['kunde']['knr'] != '')?$shop->view['kunde']['knr']:$shop->view['kunde']['id']));
135
			$pdf->Text($rdata_left + 55, $rdata_top + 6, (($shop->view['kunde']['knr'] != '')?$shop->view['kunde']['knr']:$shop->view['kunde']['id']));
136
 
136
 
137
            // Datum
137
            // Datum
138
            $pdf->Text($rdata_left + 75, $rdata_top, __("Datum", "wpsg"));
138
            $pdf->Text($rdata_left + 75, $rdata_top, __("Rechnungsdatum", "wpsg"));
139
			$pdf->Text($rdata_left + 75, $rdata_top + 6, $shop->view['rDatum']);
139
			$pdf->Text($rdata_left + 75, $rdata_top + 6, $shop->view['rDatum']);
140
 
140
 
141
            // InnerEu Hinweistext
141
            // InnerEu Hinweistext
142
            if ($shop->view['oOrder']->isInnerEu()) {
142
            if ($shop->view['oOrder']->isInnerEu()) {
143
				
143
				
144
				$pdf->SetFont('Arial', '', 9);
144
				$pdf->SetFont('Arial', '', 9);
145
				$pdf->Text($adress_left, $rdata_top + 11.5, __("Innergemeinschaftliche Lieferung.", "wpsg"));
145
				$pdf->Text($adress_left, $rdata_top + 11.5, __("Innergemeinschaftliche Lieferung.", "wpsg"));
146
				
146
				
-
 
147
                $offset += 11.5;
-
 
148
 
147
			}
149
			}
148
 
150
 
149
            // Benutzerdefinierte Felder
151
            // Benutzerdefinierte Felder
150
			$arTexte = $shop->callMod('wpsg_mod_rechnungen', 'getRechnungstexte', array($data['id']));
152
			$arTexte = $shop->callMod('wpsg_mod_rechnungen', 'getRechnungstexte', array($data['id']));
151
			
153
			
Line 166... Line 168...
166
			
168
			
167
		}
169
		}
168
		
170
		
169
	}
171
	}
170
 
172
 
171
    // wpsg_debug($this->view['basket']); // DEBUG
-
 
172
    // wpsg_debug($this->view['kunde']); // DEBUG
-
 
173
    // wpsg_debug($this->view['data']); // DEBUG
-
 
174
    // wpsg_debug($this->view['multi_data']['orders']); // DEBUG
-
 
175
 
-
 
176
    $pdf = new wpsg_fpdf();
173
    $pdf = new wpsg_fpdf();
177
    $pdf->SetAutoPageBreak(false, 5);
174
    $pdf->SetAutoPageBreak(false, 5);
178
    AddRechnungPage($this, $pdf);
175
    AddRechnungPage($this, $pdf);
179
 
176
 
180
	$checkPageBreak = function($shop, $offset, $lines) use ($pdf, $prod_top) {
177
	$checkPageBreak = function($shop, $offset, $lines) use ($pdf, $prod_top) {
Line 190... Line 187...
190
	};
187
	};
191
	
188
	
192
    $rhead_count = 1;
189
    $rhead_count = 1;
193
    $sum_multi_offset = 0;
190
    $sum_multi_offset = 0;
194
    $orders = $this->view['multi_data']['orders']; 
191
    $orders = $this->view['multi_data']['orders']; 
195
     	
192
 
196
	// noMwSt
193
	// noMwSt
-
 
194
    $head_data = array_values($this->view['multi_data']['order_data'])[0];
-
 
195
    if ($this->view['kunde']['ustidnr'] != "" && $head_data['oCalculation']->getTaxMode() === '3' && $shop->view['oOrder']->isInnerEu()) {
-
 
196
        $bNoTax = true;
-
 
197
    } else {
197
	$bNoTax = false;
198
	    $bNoTax = false;
-
 
199
    }
198
	
200
	
199
	$bTaxCol = false;
201
	$bTaxCol = false;
200
	if ($this->get_option('wpsg_showMwstAlways') === '1') $bTaxCol = true;
202
	if ($this->get_option('wpsg_showMwstAlways') === '1') $bTaxCol = true;
201
	else {
203
	else {
202
		
204
		
Line 222... Line 224...
222
        $pdf->Text($rhead_left, $rhead_top + $sum_multi_offset, $rhead_count);
224
        $pdf->Text($rhead_left, $rhead_top + $sum_multi_offset, $rhead_count);
223
        $pdf->Text($rhead_left + 6, $rhead_top + $sum_multi_offset, __("Bestellung", "wpsg"));
225
        $pdf->Text($rhead_left + 6, $rhead_top + $sum_multi_offset, __("Bestellung", "wpsg"));
224
        $rhead_count++;
226
        $rhead_count++;
225
        $pdf->SetFont('Arial', '', 9);
227
        $pdf->SetFont('Arial', '', 9);
226
 
228
 
-
 
229
        // Bestelltag anzeigen
-
 
230
        $pdf->Text($rhead_left + 85, $rhead_top + $sum_multi_offset, __("Bestelldatum", "wpsg"));
-
 
231
        $pdf->Text($rhead_left + 85, $rhead_top + $sum_multi_offset + 6, date("d.m.Y", strtotime($oOrder->cdate)));
-
 
232
 
227
        // Zahlungsbedingung anzeigen
233
        // Zahlungsbedingung anzeigen
228
        $pdf->Text($rhead_left + 100, $rhead_top + $sum_multi_offset, __("Zahlungsbedingungen", "wpsg"));
234
        $pdf->Text($rhead_left + 115, $rhead_top + $sum_multi_offset, __("Zahlungsbedingungen", "wpsg"));
229
        $pdf->Text($rhead_left + 100, $rhead_top + $sum_multi_offset + 6, $oOrder->getPaymentLabel());
235
        $pdf->Text($rhead_left + 115, $rhead_top + $sum_multi_offset + 6, $oOrder->getPaymentLabel());
230
         
236
         
231
        // Bestellnummer anzeigen
237
        // Bestellnummer anzeigen
232
        $pdf->Text($rhead_left + 155, $rhead_top + $sum_multi_offset, __("Best. Nr.", "wpsg"));
238
        $pdf->Text($rhead_left + 155, $rhead_top + $sum_multi_offset, __("Best. Nr.", "wpsg"));
233
        $pdf->Text($rhead_left + 155, $rhead_top + $sum_multi_offset + 6, $oOrder->getNr());
239
        $pdf->Text($rhead_left + 155, $rhead_top + $sum_multi_offset + 6, $oOrder->getNr());
234
        
240
        
Line 282... Line 288...
282
                
288
                
283
                $pdf->Cell(10, 8, $pnr.".", 0, 0, 'C');
289
                $pdf->Cell(10, 8, $pnr.".", 0, 0, 'C');
284
                
290
                
285
            }
291
            }
286
            
292
            
287
            if ($this->get_option('wpsg_rechnungen_pdetailname' == '1')) {
293
            if ($this->get_option('wpsg_rechnungen_pdetailname') == '1') {
288
 
294
 
289
                $produkt_text = $this->getProductName($product_id, true);
295
                $produkt_text = $this->getProductName($product_id, true);
290
 
296
 
291
            } else {
297
            } else {
292
 
298
                
293
                $produkt_text = $this->getProductName($product_id, false);
299
                $produkt_text = $this->getProductName($product_id, false);
294
 
300
 
295
            }
301
            }
296
 
302
            
297
            $produktBeschreibung = trim(strip_tags($oOrderProduct->getProduct()->getShortDescription()));
303
            $produktBeschreibung = trim(strip_tags($oOrderProduct->getProduct()->getShortDescription()));
298
            
304
            
299
            if ($this->isOtherLang()) {
305
            if ($this->isOtherLang()) {
300
                
306
                
301
                $trans_db = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_PRODUCTS."` WHERE `lang_parent` = '".wpsg_q($product_id)."' AND `lang_code` = '".wpsg_q($this->getCurrentLanguageCode())."'");
307
                $trans_db = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_PRODUCTS."` WHERE `lang_parent` = '".wpsg_q($product_id)."' AND `lang_code` = '".wpsg_q($this->getCurrentLanguageCode())."'");
Line 320... Line 326...
320
                
326
                
321
                if (wpsg_isSizedArray($arPV)) {
327
                if (wpsg_isSizedArray($arPV)) {
322
                    
328
                    
323
                    foreach ($arPV as $pv) {
329
                    foreach ($arPV as $pv) {
324
                        
330
                        
-
 
331
                        if ($pv['value'] != '') {
-
 
332
 
325
                        $produkt_text .= "\r\n".$pv['name'].': '.$pv['value'];
333
                            $produkt_text .= "\r\n".$pv['name'].': '.$pv['value'];
326
                        $height += 5;
334
                            $height += 5;
327
                        
335
                        
-
 
336
                        }
-
 
337
 
328
                    }
338
                    }
329
                    
339
                    
330
                }
340
                }
331
                
341
                
332
            }
342
            }
Line 368... Line 378...
368
            
378
            
369
            /**
379
            /**
370
             * Produktbeschreibung anzeigen Ja/Nein
380
             * Produktbeschreibung anzeigen Ja/Nein
371
             */
381
             */
372
            $pBeschreibungHeight = 0;
382
            $pBeschreibungHeight = 0;
373
            if ($this->get_option("wpsg_rechnungen_pbeschreibung") == "1" && trim(strip_tags($p['beschreibung'])) != '') {
383
            if ($this->get_option("wpsg_rechnungen_pbeschreibung") == "1" && trim(strip_tags($oOrderProduct->getShortDescription())) != '') {
374
                
384
                
375
                $produktBeschreibung = nl2br($produktBeschreibung);
385
                $produktBeschreibung = nl2br($produktBeschreibung);
376
                preg_match_all('/\<br \/\>/', $produktBeschreibung, $treffer);
386
                preg_match_all('/\<br \/\>/', $produktBeschreibung, $treffer);
377
                $produktBeschreibung = strip_tags($produktBeschreibung);
387
                $produktBeschreibung = strip_tags($produktBeschreibung);
378
                
388
                
Line 393... Line 403...
393
            /**
403
            /**
394
             * Produktattribute ?
404
             * Produktattribute ?
395
             */
405
             */
396
            if ($this->get_option('wpsg_rechnungen_produktattribute') == '1') {
406
            if ($this->get_option('wpsg_rechnungen_produktattribute') == '1') {
397
                
407
                
398
                $attributeInfo = $this->callMod('wpsg_mod_produktattribute', 'getProductAttributeByProductId', array($this->getProduktId($p['id'])));
408
                $attributeInfo = $this->callMod('wpsg_mod_produktattribute', 'getProductAttributeByProductId', array($this->getProduktId($oOrderProduct->getId())));
399
                
409
                
400
                foreach ($attributeInfo as $pa) {
410
                foreach ($attributeInfo as $pa) {
401
                    
411
                    
402
                    $pa_text = $pa['name'].': '.$pa['value'];
412
                    $pa_text = $pa['name'].': '.$pa['value'];
403
                    $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);
413
                    $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);
Line 406... Line 416...
406
            }
416
            }
407
            
417
            
408
            /**
418
            /**
409
             * Variante ?
419
             * Variante ?
410
             */
420
             */
411
            if (preg_match('/pv_(.*)/', $p['productkey'])) {
421
            if (preg_match('/pv_(.*)/', $oOrderProduct->getProductKey())) {
412
                
422
                
413
                $variInfo = $this->callMod('wpsg_mod_productvariants', 'getVariantenInfoArray', array($p['productkey']));
423
                $variInfo = $this->callMod('wpsg_mod_productvariants', 'getVariantenInfoArray', array($oOrderProduct->getProductKey()));
414
                
424
                
415
                $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);
425
                $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
                
426
                
417
                //$height += 5;
427
                //$height += 5;
418
                
428
                
Line 521... Line 531...
521
            
531
            
522
            if ($bTaxCol) {
532
            if ($bTaxCol) {
523
                 
533
                 
524
                if ($bNoTax) {
534
                if ($bNoTax) {
525
                    
535
                    
526
                    $mwst = 0;
536
                    $mwst = wpsg_ff('0.00', '%');
527
                    
537
                    
528
                } else { 
538
                } else { 
529
                    
539
                    
530
                    if ($arCalculation['shipping'][0]['tax_key'] === '0') {
540
                    if ($arCalculation['shipping'][0]['tax_key'] === '0') {
531
                    
541
                    
Line 572... Line 582...
572
            
582
            
573
            if ($bTaxCol) {
583
            if ($bTaxCol) {
574
                
584
                
575
                if ($bNoTax) {
585
                if ($bNoTax) {
576
					
586
					
577
                    $mwst = 0;
587
                    $mwst = wpsg_ff('0.00', '%');
578
					
588
					
579
                } else {
589
                } else {
580
                    
590
                    
581
                    if ($arCalculation['payment'][0]['tax_key'] === '0') {
591
                    if ($arCalculation['payment'][0]['tax_key'] === '0') {
582
                        
592
                        
Line 677... Line 687...
677
            
687
            
678
            if ($bTaxCol) {
688
            if ($bTaxCol) {
679
                
689
                
680
                if ($bNoTax) {
690
                if ($bNoTax) {
681
					
691
					
682
                    $mwst = 0;
692
                    $mwst = wpsg_ff('0.00', '%');
683
					
693
					
684
                } else {                    
694
                } else {                    
685
                    
695
                    
686
                    $mwst = wpsg_ff($this->view['storno_fee_tax_value'], '%');
696
                    $mwst = wpsg_ff($this->view['storno_fee_tax_value'], '%');
687
                    
697
                    
Line 756... Line 766...
756
	} else {
766
	} else {
757
		
767
		
758
		if ($bNoTax) {
768
		if ($bNoTax) {
759
			
769
			
760
			$pdf->Text($prod_left, $prod_top + $offset + 10, __("Es ergibt sich folgender Gesamtbetrag", "wpsg").':');
770
			$pdf->Text($prod_left, $prod_top + $offset + 10, __("Es ergibt sich folgender Gesamtbetrag", "wpsg").':');
761
			$pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("BRUTTOBETRAG", "wpsg"));
771
			$pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("BRUTTOBETRAG GESAMT", "wpsg"));
762
			$pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
772
			$pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
763
			$pdf->Cell(37, 8, wpsg_ff($arCalculation['sum']['brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
773
			$pdf->Cell(37, 8, wpsg_ff($arCalculation['sum']['brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
764
			$offset += 5;
774
			$offset += 5;
765
			
775
			
766
			$pdf->Text($prod_left + 80, $prod_top + $offset, __("MwSt. GESAMT", "wpsg"));
776
			$pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("MwSt. GESAMT", "wpsg"));
767
			$pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
777
			$pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
768
			$pdf->Cell(37, 8, wpsg_ff(0, $this->get_option('wpsg_currency')), 0, 0, 'R');
778
			$pdf->Cell(37, 8, wpsg_ff(0, $this->get_option('wpsg_currency')), 0, 0, 'R');
769
			
779
			
770
		} else {
780
		} else {
771
			
781
			
Line 773... Line 783...
773
			
783
			
774
			$pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("NETTOBETRAG GESAMT", "wpsg"));
784
			$pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("NETTOBETRAG GESAMT", "wpsg"));
775
			$pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
785
			$pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
776
			$pdf->Cell(37, 8, wpsg_ff($arCalculation['sum']['netto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
786
			$pdf->Cell(37, 8, wpsg_ff($arCalculation['sum']['netto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
777
			
787
			
778
			if (sizeof($arCalculation['tax']) >= 1) {
788
			// if (sizeof($arCalculation['tax']) >= 1) {
779
				
-
 
780
				foreach ($arCalculation['tax'] as $k => $mw) {
789
			// 	foreach ($arCalculation['tax'] as $k => $mw) {
781
					
-
 
782
					if ($k === 0) continue;					
790
			// 		if ($k === 0) continue;					
783
					
791
					
784
					$offset += 5;
792
			// 		$offset += 5;
785
					
793
					
786
					$pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("MwSt. ", "wpsg").wpsg_ff($mw['tax_value'], '%'));
794
			// 		$pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("MwSt. ", "wpsg").wpsg_ff($mw['tax_value'], '%'));
787
					$pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
795
			// 		$pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
788
					$pdf->Cell(37, 8, wpsg_ff($mw['sum'], $this->get_option('wpsg_currency')), 0, 0, 'R');
796
			// 		$pdf->Cell(37, 8, wpsg_ff($mw['sum'], $this->get_option('wpsg_currency')), 0, 0, 'R');
789
					
797
					
790
				}
798
			// 	}
791
				
-
 
792
			}
799
			// }
793
			
800
			
794
			if (sizeof($arCalculation['tax']) > 1) {
801
			if (sizeof($arCalculation['tax']) > 1) {
795
				
802
				
796
				$offset += 5;
803
				$offset += 5;
797
				$pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("MwSt. GESAMT", "wpsg"));
804
				$pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("MwSt. GESAMT", "wpsg"));