1093 |
daniel |
1 |
<?php
|
2759 |
daniel |
2 |
|
1093 |
daniel |
3 |
/**
|
|
|
4 |
* Template für die PDF Rechnung
|
|
|
5 |
*/
|
|
|
6 |
|
3560 |
daniel |
7 |
require_once WPSG_PATH_LIB.'fpdf/fpdf.php';
|
|
|
8 |
require_once WPSG_PATH_LIB.'fpdf/fpdi.php';
|
|
|
9 |
require_once WPSG_PATH_MOD.'mod_rechnungen/wpsg_fpdf.class.php';
|
1165 |
daniel |
10 |
|
1094 |
daniel |
11 |
global $absender_left, $absender_top, $adress_left, $adress_top, $rdata_left, $rdata_top;
|
1165 |
daniel |
12 |
|
1093 |
daniel |
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 |
// Positionierund 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
|
3828 |
thomas |
30 |
$prod_break = $this->get_option('wpsg_rechnungen_pdfperpage');
|
1242 |
david |
31 |
|
2301 |
daniel |
32 |
// Damit die Steuer bei der Kleinunternehmerregelung nicht angezeigt wird leer ich den Array sicherheitshalber
|
|
|
33 |
if ($this->get_option('wpsg_kleinunternehmer') == '1')
|
|
|
34 |
{
|
|
|
35 |
|
|
|
36 |
unset($this->view['basket']['mwst']);
|
|
|
37 |
|
|
|
38 |
}
|
|
|
39 |
|
1228 |
daniel |
40 |
if (!function_exists('AddRechnungPage'))
|
1093 |
daniel |
41 |
{
|
|
|
42 |
|
1228 |
daniel |
43 |
function AddRechnungPage($shop, $pdf)
|
1093 |
daniel |
44 |
{
|
|
|
45 |
|
1228 |
daniel |
46 |
global $absender_left, $absender_top, $adress_left, $adress_top, $rdata_left, $rdata_top;
|
1093 |
daniel |
47 |
|
1228 |
daniel |
48 |
$pdf->AddPage();
|
1093 |
daniel |
49 |
|
1228 |
daniel |
50 |
if (file_exists($shop->callMod('wpsg_mod_rechnungen', getFilePath, array(''))."wpsg_rechnungen_bp.pdf"))
|
|
|
51 |
{
|
|
|
52 |
|
|
|
53 |
$pagecount = $pdf->setSourceFile($shop->callMod('wpsg_mod_rechnungen', getFilePath, array(''))."wpsg_rechnungen_bp.pdf");
|
|
|
54 |
$tplidx = $pdf->importPage(1, '/MediaBox');
|
|
|
55 |
$pdf->useTemplate($tplidx, 0, 0, 210);
|
|
|
56 |
|
|
|
57 |
}
|
|
|
58 |
if (file_exists($shop->callMod('wpsg_mod_rechnungen', getFilePath, array(''))."wpsg_rechnungen_bp.jpg"))
|
|
|
59 |
{
|
|
|
60 |
$pdf->image($shop->callMod('wpsg_mod_rechnungen', getFilePath, array(''))."wpsg_rechnungen_bp.jpg", 0, 0, 210, 297, 'jpg');
|
|
|
61 |
}
|
1093 |
daniel |
62 |
|
|
|
63 |
|
1228 |
daniel |
64 |
if (file_exists($shop->callMod('wpsg_mod_rechnungen', getFilePath, array(''))."wpsg_rechnungen_logo.jpg"))
|
|
|
65 |
{
|
|
|
66 |
|
|
|
67 |
list($width, $height, $type, $attr) = getimagesize($shop->callMod('wpsg_mod_rechnungen', getFilePath, array(''))."wpsg_rechnungen_logo.jpg");
|
|
|
68 |
|
|
|
69 |
//wpsg_debug($width.":".$height);
|
|
|
70 |
|
|
|
71 |
$wPix = (25.4 * $width) / 96;
|
|
|
72 |
$hPix = (25.4 * $height) / 96;
|
|
|
73 |
|
|
|
74 |
$pdf->image($shop->callMod('wpsg_mod_rechnungen', getFilePath, array(''))."wpsg_rechnungen_logo.jpg", 210 - $wPix, 0, $wPix, $hPix);
|
|
|
75 |
|
|
|
76 |
}
|
1093 |
daniel |
77 |
|
1228 |
daniel |
78 |
// Absenderadresszeile (Wird in der Konfiguration hinterlegt)
|
|
|
79 |
$pdf->SetFont('Arial', '', 6);
|
3748 |
daniel |
80 |
$pdf->Text($absender_left, $absender_top, $shop->replaceUniversalPlatzhalter(__($shop->get_option("wpsg_rechnungen_adresszeile"), 'wpsg'), $shop->view['data']['id']));
|
1093 |
daniel |
81 |
|
1228 |
daniel |
82 |
if ($shop->view['kunde']['kuerzel'] != "") $shop->view['kunde']['kuerzel'] = $shop->view['kunde']['kuerzel'].'-';
|
1093 |
daniel |
83 |
|
1228 |
daniel |
84 |
// Adresse des Kunden
|
|
|
85 |
$pdf->SetFont('Arial', '', 12);
|
|
|
86 |
$pdf->Text($adress_left, $adress_top, $shop->view['kunde']['firma']);
|
|
|
87 |
$pdf->Text($adress_left, $adress_top + 5, $shop->view['kunde']['vname'].' '.$shop->view['kunde']['name']);
|
|
|
88 |
$pdf->Text($adress_left, $adress_top + 10, $shop->view['kunde']['strasse'].' '.$shop->view['kunde']['hausnr']);
|
3742 |
daniel |
89 |
$pdf->Text($adress_left, $adress_top + 15, $shop->view['kunde']['plz'].' '.$shop->view['kunde']['ort']);
|
|
|
90 |
if ($shop->get_option('wpsg_mod_rechnungen_hideCountry') != '1') $pdf->Text($adress_left, $adress_top + 20, strtoupper($shop->view['oOrder']->getShippingCountryName()));
|
|
|
91 |
|
1228 |
daniel |
92 |
// Rechnungsdaten
|
|
|
93 |
$pdf->SetFont('Arial', 'B', 16);
|
|
|
94 |
$pdf->Text($rdata_left, $rdata_top, $shop->view['title']);
|
|
|
95 |
$pdf->SetFont('Arial', 'B', 9);
|
|
|
96 |
$pdf->Text($rdata_left, $rdata_top + 6, $shop->view['rnr']);
|
|
|
97 |
$pdf->SetFont('Arial', '', 9);
|
|
|
98 |
|
|
|
99 |
if (isset($shop->view['faelligkeitdatum']))
|
|
|
100 |
{
|
|
|
101 |
|
|
|
102 |
$pdf->Text($rdata_left + 35, $rdata_top, __("Fällig am", "wpsg"));
|
|
|
103 |
$pdf->Text($rdata_left + 35, $rdata_top + 6, $shop->view['faelligkeitdatum']);
|
1093 |
daniel |
104 |
|
1228 |
daniel |
105 |
}
|
|
|
106 |
if (isset($shop->view['payment']))
|
|
|
107 |
{
|
1093 |
daniel |
108 |
|
2759 |
daniel |
109 |
$pdf->Text($rdata_left + 65, $rdata_top, __("Zahlungsbedingungen", "wpsg"));
|
|
|
110 |
$pdf->Text($rdata_left + 65, $rdata_top + 6, $shop->view['payment']);
|
1228 |
daniel |
111 |
|
|
|
112 |
}
|
1093 |
daniel |
113 |
|
1228 |
daniel |
114 |
$pdf->Text($rdata_left + 100, $rdata_top, __("Kunden-Nr", "wpsg"));
|
|
|
115 |
$pdf->Text($rdata_left + 100, $rdata_top + 6, (($shop->view['kunde']['knr'] != '')?$shop->view['kunde']['knr']:$shop->view['kunde']['id']));
|
1093 |
daniel |
116 |
|
1228 |
daniel |
117 |
$pdf->Text($rdata_left + 125, $rdata_top, __("Best. Nr.", "wpsg"));
|
|
|
118 |
$pdf->Text($rdata_left + 125, $rdata_top + 6, ((trim($shop->view['data']['onr']) != '')?$shop->view['data']['onr']:$shop->view['data']['id']));
|
|
|
119 |
|
|
|
120 |
$pdf->Text($rdata_left + 145, $rdata_top, __("Datum", "wpsg"));
|
|
|
121 |
$pdf->Text($rdata_left + 145, $rdata_top + 6, $shop->view['rDatum']);
|
|
|
122 |
|
3506 |
daniel |
123 |
if ($shop->view['oOrder']->isInnerEu())
|
1093 |
daniel |
124 |
{
|
3506 |
daniel |
125 |
|
1228 |
daniel |
126 |
$pdf->SetFont('Arial', '', 9);
|
|
|
127 |
$pdf->Text($adress_left, $rdata_top + 11.5, __("Innergemeinschaftliche Lieferung.", "wpsg"));
|
1093 |
daniel |
128 |
|
|
|
129 |
}
|
|
|
130 |
|
1228 |
daniel |
131 |
// Benutzerdefinierte Felder
|
3748 |
daniel |
132 |
$arTexte = $shop->callMod('wpsg_mod_rechnungen', 'getRechnungstexte', array($shop->view['data']['id']));
|
|
|
133 |
|
1228 |
daniel |
134 |
foreach ((array)$arTexte as $text)
|
|
|
135 |
{
|
|
|
136 |
|
|
|
137 |
if (isset($text['aktiv']) && $text['aktiv'] == 1)
|
|
|
138 |
{
|
|
|
139 |
|
|
|
140 |
$pdf->SetFont('Arial', 'B', ((intval($text['fontsize']) > 0)?intval($text['fontsize']):10));
|
|
|
141 |
$pdf->SetTextColor($text['color']);
|
|
|
142 |
$pdf->MultiCell($text['x'], $text['y'], 5, utf8_encode($text['text']));
|
|
|
143 |
$pdf->SetTextColor("#000000");
|
|
|
144 |
|
|
|
145 |
}
|
|
|
146 |
|
|
|
147 |
}
|
|
|
148 |
|
1093 |
daniel |
149 |
}
|
|
|
150 |
|
|
|
151 |
}
|
1242 |
david |
152 |
//wpsg_debug($this->view); die();
|
1093 |
daniel |
153 |
$pdf = new wpsg_fpdf();
|
|
|
154 |
$pdf->SetAutoPageBreak(true, 5);
|
|
|
155 |
AddRechnungPage($this, $pdf);
|
|
|
156 |
|
|
|
157 |
$summe = 0;
|
|
|
158 |
|
|
|
159 |
$bKopf = false; $pnr = 1; $offset = 0; $count = 0;
|
|
|
160 |
foreach ($this->view['basket']['produkte'] as $p)
|
|
|
161 |
{
|
|
|
162 |
|
|
|
163 |
if (!$bKopf)
|
|
|
164 |
{
|
|
|
165 |
|
|
|
166 |
$pdf->SetFont('Arial', 'B', 9);
|
|
|
167 |
$pdf->setXY($prod_left, $prod_top);
|
|
|
168 |
$pdf->Cell(10, 8, __("Nr.", "wpsg"), 1, 0, 'C');
|
|
|
169 |
|
|
|
170 |
$pdf->setXY($prod_left + 10, $prod_top);
|
1157 |
daniel |
171 |
$pdf->Cell( ((sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), 8, "Name", 1, 0, 'L');
|
1093 |
daniel |
172 |
|
1157 |
daniel |
173 |
if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
|
1093 |
daniel |
174 |
{
|
|
|
175 |
|
|
|
176 |
$pdf->setXY($prod_left + 97, $prod_top);
|
3024 |
daniel |
177 |
$pdf->Cell(15, 8, __("MwSt.", "wpsg"), 1, 0, 'C');
|
1093 |
daniel |
178 |
|
|
|
179 |
}
|
|
|
180 |
|
|
|
181 |
$pdf->setXY($prod_left + 112, $prod_top);
|
|
|
182 |
$pdf->Cell(15, 8, __("Menge", "wpsg"), 1, 0, 'C');
|
|
|
183 |
|
|
|
184 |
$pdf->setXY($prod_left + 127, $prod_top);
|
|
|
185 |
$pdf->Cell(25, 8, __("Einzelpreis", "wpsg"), 1, 0, 'R');
|
|
|
186 |
|
|
|
187 |
$pdf->setXY($prod_left + 152, $prod_top);
|
|
|
188 |
$pdf->Cell(25, 8, __("Gesamtpreis", "wpsg"), 1, 0, 'R');
|
|
|
189 |
|
|
|
190 |
$offset = 8;
|
|
|
191 |
$bKopf = true;
|
|
|
192 |
|
|
|
193 |
}
|
|
|
194 |
|
|
|
195 |
$pdf->SetFont('Arial', '', 9);
|
|
|
196 |
$pdf->setXY($prod_left, $prod_top + $offset);
|
3028 |
daniel |
197 |
|
|
|
198 |
if ($this->get_option('wpsg_mod_rechnungen_showanr') == '1')
|
|
|
199 |
{
|
|
|
200 |
|
|
|
201 |
$pdf->Cell(10, 8, $p['anr'], 0, 0, 'C');
|
|
|
202 |
|
|
|
203 |
}
|
|
|
204 |
else
|
|
|
205 |
{
|
|
|
206 |
|
|
|
207 |
$pdf->Cell(10, 8, $pnr.".", 0, 0, 'C');
|
|
|
208 |
|
|
|
209 |
}
|
1093 |
daniel |
210 |
|
|
|
211 |
$produkt_text = $p['name'];
|
|
|
212 |
$produktBeschreibung = trim(strip_tags($p['beschreibung']));
|
|
|
213 |
|
|
|
214 |
if ($this->isOtherLang())
|
1671 |
daniel |
215 |
{
|
1093 |
daniel |
216 |
|
1671 |
daniel |
217 |
$trans_db = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_PRODUCTS."` WHERE `lang_parent` = '".wpsg_q($this->getProduktID($p['id']))."' AND `lang_locale` = '".wpsg_q(get_locale())."'");
|
|
|
218 |
|
1093 |
daniel |
219 |
if (is_array($trans_db) && sizeof($trans_db) > 0)
|
|
|
220 |
{
|
|
|
221 |
|
|
|
222 |
$produkt_text = $trans_db['name'];
|
1671 |
daniel |
223 |
$produktBeschreibung = trim(strip_tags($trans_db['beschreibung']));
|
1093 |
daniel |
224 |
|
|
|
225 |
}
|
|
|
226 |
|
|
|
227 |
}
|
|
|
228 |
|
|
|
229 |
$height = 0; // Höhe der Zeile für den Rahmen
|
|
|
230 |
|
|
|
231 |
$pdf->setXY($prod_left + 10, $prod_top + $offset);
|
|
|
232 |
|
1671 |
daniel |
233 |
// Produktvariablen
|
|
|
234 |
if ($this->hasMod('wpsg_mod_productvars') && $this->get_option("wpsg_mod_rechnungen_showpv") == "1")
|
1093 |
daniel |
235 |
{
|
1671 |
daniel |
236 |
|
4093 |
daniel |
237 |
$arPV = $this->callMod('wpsg_mod_productvars', 'getAllProductVarValues', array($this->view['data']['id'], $p['product_index']));
|
3709 |
daniel |
238 |
|
|
|
239 |
if (wpsg_isSizedArray($arPV))
|
1093 |
daniel |
240 |
{
|
|
|
241 |
|
3709 |
daniel |
242 |
foreach ($arPV as $pv)
|
|
|
243 |
{
|
1093 |
daniel |
244 |
|
3709 |
daniel |
245 |
$produkt_text .= "\r\n".$pv['name'].': '.$pv['value'];
|
|
|
246 |
$height += 5;
|
|
|
247 |
|
|
|
248 |
}
|
1093 |
daniel |
249 |
|
3709 |
daniel |
250 |
}
|
|
|
251 |
|
1093 |
daniel |
252 |
}
|
1678 |
daniel |
253 |
|
|
|
254 |
$produkt_text_cell_width = 102;
|
|
|
255 |
if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
|
|
|
256 |
{
|
|
|
257 |
$produkt_text_cell_width = 87;
|
|
|
258 |
}
|
|
|
259 |
|
1093 |
daniel |
260 |
$produkt_text_width = $pdf->GetStringWidth($produkt_text);
|
1678 |
daniel |
261 |
//$produkt_text_cell_width = (($this->arMwSt == "-1")?87:102);
|
1093 |
daniel |
262 |
|
1671 |
daniel |
263 |
$height += 5 * ceil($produkt_text_width / $produkt_text_cell_width) + 3;
|
1093 |
daniel |
264 |
|
1678 |
daniel |
265 |
$height_y = $pdf->getY();
|
2877 |
daniel |
266 |
$height = 2 + $pdf->MultiCell($prod_left + 10, $prod_top + $offset + 1.5, 5, utf8_encode($produkt_text), 0, 'L', 0, $produkt_text_cell_width);
|
|
|
267 |
|
1678 |
daniel |
268 |
//$height += 3 + 5 + $pdf->getY() - $height_y;
|
1093 |
daniel |
269 |
//$pdf->Cell((($this->arMwSt == "-1")?102:87), 8, $produkt_text, 0, 0, 'L');
|
|
|
270 |
|
1157 |
daniel |
271 |
if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
|
1093 |
daniel |
272 |
{
|
|
|
273 |
|
|
|
274 |
$pdf->setXY($prod_left + 97, $prod_top + $offset);
|
3024 |
daniel |
275 |
$pdf->Cell(15, 8, (($this->view['basket']['noMwSt'] == '1')?'0.00 %':wpsg_ff($p['mwst_value'], '%')), 0, 0, 'C');
|
1093 |
daniel |
276 |
|
|
|
277 |
}
|
|
|
278 |
|
|
|
279 |
$pdf->setXY($prod_left + 112, $prod_top + $offset);
|
|
|
280 |
$pdf->Cell(15, 8, $p['menge'], 0, 0, 'C');
|
|
|
281 |
|
1170 |
daniel |
282 |
// Preis eines Produktes
|
|
|
283 |
if ($this->view['basket']['noMwSt'] == '1')
|
1093 |
daniel |
284 |
{
|
1170 |
daniel |
285 |
|
|
|
286 |
// Innergemeinschaftliche Lieferung, hier Netto Preis
|
|
|
287 |
$preis = $p['preis_netto'];
|
|
|
288 |
|
1093 |
daniel |
289 |
}
|
|
|
290 |
else
|
|
|
291 |
{
|
1170 |
daniel |
292 |
|
3654 |
daniel |
293 |
if ($this->getFrontendTaxview() == WPSG_BRUTTO || $this->get_option('wpsg_kleinunternehmer') == '1')
|
1170 |
daniel |
294 |
{
|
|
|
295 |
$preis = $p['preis_brutto'];
|
|
|
296 |
}
|
|
|
297 |
else
|
|
|
298 |
{
|
|
|
299 |
$preis = $p['preis_netto'];
|
|
|
300 |
}
|
|
|
301 |
|
1093 |
daniel |
302 |
}
|
|
|
303 |
|
|
|
304 |
$pdf->setXY($prod_left + 127, $prod_top + $offset);
|
|
|
305 |
$pdf->Cell(25, 8, wpsg_ff($preis, $this->get_option('wpsg_currency')), 0, 0, 'R');
|
|
|
306 |
|
|
|
307 |
$pdf->setXY($prod_left + 152, $prod_top + $offset);
|
|
|
308 |
$pdf->Cell(25, 8, wpsg_ff($preis * $p['menge'], $this->get_option('wpsg_currency')), 0, 0, 'R');
|
|
|
309 |
|
|
|
310 |
/**
|
|
|
311 |
* Produktbeschreibung anzeigen Ja/Nein
|
|
|
312 |
*/
|
|
|
313 |
$pBeschreibungHeight = 0;
|
|
|
314 |
if ($this->get_option("wpsg_rechnungen_pbeschreibung") == "1" && trim(strip_tags($p['beschreibung'])) != '')
|
|
|
315 |
{
|
|
|
316 |
|
1237 |
daniel |
317 |
$produktBeschreibung = nl2br($produktBeschreibung);
|
|
|
318 |
preg_match_all('/\<br \/\>/', $produktBeschreibung, $treffer);
|
|
|
319 |
$produktBeschreibung = strip_tags($produktBeschreibung);
|
|
|
320 |
|
1093 |
daniel |
321 |
$pBeschreibungWidth = $pdf->getStringWidth($produktBeschreibung);
|
1237 |
daniel |
322 |
$pBeschreibungHeight = 5 * (ceil($pBeschreibungWidth / $produkt_text_cell_width) + @sizeof($treffer[0]));
|
1093 |
daniel |
323 |
|
|
|
324 |
$pdf->SetFont('Arial', 'I', 9);
|
1678 |
daniel |
325 |
|
|
|
326 |
$cellY = $pdf->getY();
|
2877 |
daniel |
327 |
$pdf->MultiCell($prod_left + 10, $prod_top + $height + $offset - 1, 5, utf8_encode($produktBeschreibung), 0, 'L', 0, $produkt_text_cell_width);
|
1678 |
daniel |
328 |
$pBeschreibungHeight = $pdf->getY() - $cellY - $height + 1;
|
1093 |
daniel |
329 |
$pdf->SetFont('Arial', '', 9);
|
|
|
330 |
|
|
|
331 |
}
|
|
|
332 |
|
|
|
333 |
$height += $pBeschreibungHeight;
|
1125 |
daniel |
334 |
|
|
|
335 |
/**
|
|
|
336 |
* Variante ?
|
|
|
337 |
*/
|
3776 |
daniel |
338 |
if (preg_match('/vp_(.*)/', $p['productkey']))
|
1125 |
daniel |
339 |
{
|
|
|
340 |
|
3776 |
daniel |
341 |
$variInfo = $this->callMod('wpsg_mod_varianten', 'getVariantenInfoArray', array($p['productkey']));
|
1125 |
daniel |
342 |
|
2877 |
daniel |
343 |
$height += $pdf->MultiCell($prod_left + 10, $prod_top + $height + $offset - 1.5, 5, utf8_encode(wpsg_translate(__('Variante: #1#', 'wpsg'), $variInfo['key'])), 0, 'L', 0, $produkt_text_cell_width);
|
1125 |
daniel |
344 |
|
2877 |
daniel |
345 |
//$height += 5;
|
1125 |
daniel |
346 |
|
|
|
347 |
}
|
1093 |
daniel |
348 |
|
|
|
349 |
// Jetzt die Rahmen zeichnen
|
|
|
350 |
$pdf->Rect($prod_left, $prod_top + $offset, 10, $height);
|
|
|
351 |
|
1157 |
daniel |
352 |
$pdf->Rect($prod_left + 10, $prod_top + $offset, ((sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), $height);
|
1093 |
daniel |
353 |
|
1157 |
daniel |
354 |
if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
|
1093 |
daniel |
355 |
{
|
|
|
356 |
|
|
|
357 |
$pdf->Rect($prod_left + 97, $prod_top + $offset, 15, $height);
|
|
|
358 |
|
|
|
359 |
}
|
|
|
360 |
|
|
|
361 |
$pdf->Rect($prod_left + 112, $prod_top + $offset, 15, $height);
|
|
|
362 |
$pdf->Rect($prod_left + 127, $prod_top + $offset, 25, $height);
|
|
|
363 |
$pdf->Rect($prod_left + 152, $prod_top + $offset, 25, $height);
|
|
|
364 |
|
|
|
365 |
$offset += $height;
|
|
|
366 |
|
|
|
367 |
$pnr ++;
|
|
|
368 |
$count ++;
|
|
|
369 |
|
|
|
370 |
$summe += $p['price'] * $p['menge'];
|
|
|
371 |
|
2301 |
daniel |
372 |
if ($pdf->getY() > 220 || ($count >= $prod_break && sizeof($this->view['basket']['produkte']) > ($pnr - 1)))
|
1093 |
daniel |
373 |
{
|
|
|
374 |
|
|
|
375 |
AddRechnungPage($this, $pdf);
|
|
|
376 |
$bKopf = false; $offset = 0; $count = 0;
|
|
|
377 |
|
|
|
378 |
}
|
|
|
379 |
|
1094 |
daniel |
380 |
} // produkte
|
1671 |
daniel |
381 |
|
1633 |
daniel |
382 |
// Gutschein
|
|
|
383 |
if (isset($this->view['basket']['gs']))
|
|
|
384 |
{
|
|
|
385 |
|
|
|
386 |
$pdf->SetFont('Arial', '', 9);
|
|
|
387 |
$pdf->setXY($prod_left, $prod_top + $offset);
|
|
|
388 |
$pdf->Cell(10, 8, $pnr.'.', 1, 0, 'C'); $pnr ++;
|
|
|
389 |
|
|
|
390 |
$pdf->setXY($prod_left + 10, $prod_top + $offset);
|
|
|
391 |
$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');
|
|
|
392 |
|
|
|
393 |
if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
|
|
|
394 |
{
|
|
|
395 |
|
3024 |
daniel |
396 |
$mwst = __('anteilig', 'wpsg');
|
1633 |
daniel |
397 |
|
|
|
398 |
$pdf->setXY($prod_left + 97, $prod_top + $offset);
|
3024 |
daniel |
399 |
$pdf->Cell(15, 8, $mwst, 1, 0, 'C');
|
1633 |
daniel |
400 |
|
|
|
401 |
}
|
|
|
402 |
|
|
|
403 |
$pdf->setXY($prod_left + 112, $prod_top + $offset);
|
|
|
404 |
$pdf->Cell(15, 8, '1', 1, 0, 'C');
|
|
|
405 |
|
3024 |
daniel |
406 |
/*
|
1633 |
daniel |
407 |
if ($this->view['basket']['gs']['calc'] == 'w')
|
|
|
408 |
{
|
|
|
409 |
|
|
|
410 |
$gs_value_einzel = '-'.wpsg_ff($this->view['basket']['gs']['value'], $this->get_option('wpsg_currency'));
|
|
|
411 |
$gs_value_gesamt = '-'.wpsg_ff($this->view['basket']['gs']['value'], $this->get_option('wpsg_currency'));
|
|
|
412 |
|
|
|
413 |
}
|
|
|
414 |
else if ($this->view['basket']['gs']['calc'] == 'p')
|
|
|
415 |
{
|
|
|
416 |
|
|
|
417 |
$gs_value_einzel = '-'.wpsg_ff($this->view['basket']['gs']['value'], '%');
|
|
|
418 |
$gs_value_gesamt = '-'.wpsg_ff($this->view['basket']['sum']['gs'], $this->get_option('wpsg_currency'));
|
|
|
419 |
|
|
|
420 |
}
|
3024 |
daniel |
421 |
*/
|
1633 |
daniel |
422 |
|
3024 |
daniel |
423 |
$gs_value_einzel = '-'.wpsg_ff($this->view['basket']['sum']['gs'], $this->get_option('wpsg_currency'));
|
|
|
424 |
$gs_value_gesamt = '-'.wpsg_ff($this->view['basket']['sum']['gs'], $this->get_option('wpsg_currency'));
|
|
|
425 |
|
1633 |
daniel |
426 |
$pdf->setXY($prod_left + 127, $prod_top + $offset);
|
|
|
427 |
$pdf->Cell(25, 8, $gs_value_einzel, 1, 0, 'R');
|
|
|
428 |
|
|
|
429 |
$pdf->setXY($prod_left + 152, $prod_top + $offset);
|
|
|
430 |
$pdf->Cell(25, 8, $gs_value_gesamt, 1, 0, 'R');
|
|
|
431 |
|
|
|
432 |
$offset += 8;
|
|
|
433 |
|
|
|
434 |
}
|
|
|
435 |
|
1094 |
daniel |
436 |
// Versandkosten
|
3409 |
daniel |
437 |
if ($this->view['basket']['sum']['preis_shipping'] != '' && $this->view['basket']['sum']['preis_shipping'] != 0)
|
1094 |
daniel |
438 |
{
|
|
|
439 |
|
|
|
440 |
$pdf->SetFont('Arial', '', 9);
|
|
|
441 |
$pdf->setXY($prod_left, $prod_top + $offset);
|
|
|
442 |
$pdf->Cell(10, 8, $pnr.'.', 1, 0, 'C'); $pnr ++;
|
|
|
443 |
|
|
|
444 |
$pdf->setXY($prod_left + 10, $prod_top + $offset);
|
4132 |
daniel |
445 |
$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']->getShippingTypName()), 1, 0, 'L');
|
1094 |
daniel |
446 |
|
1157 |
daniel |
447 |
if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
|
1094 |
daniel |
448 |
{
|
|
|
449 |
|
1165 |
daniel |
450 |
if ($this->arShipping[$this->view['data']['type_shipping']]['mwst_null'] == '1' && $this->view['basket']['noMwSt'] == '1')
|
|
|
451 |
{
|
1416 |
daniel |
452 |
|
1165 |
daniel |
453 |
$mwst = 0;
|
1416 |
daniel |
454 |
|
1165 |
daniel |
455 |
}
|
|
|
456 |
else
|
|
|
457 |
{
|
4291 |
daniel |
458 |
|
4301 |
daniel |
459 |
if (isset($this->view['basket']['shipping']['tax_rata']) && $this->view['basket']['shipping']['tax_rata'] === true)
|
4121 |
daniel |
460 |
{
|
4301 |
daniel |
461 |
|
4121 |
daniel |
462 |
$mwst = __('anteilig', 'wpsg');
|
|
|
463 |
|
|
|
464 |
}
|
|
|
465 |
else
|
|
|
466 |
{
|
4301 |
daniel |
467 |
|
4121 |
daniel |
468 |
$mwst = wpsg_ff($this->arShipping[$this->view['basket']['checkout']['shipping']]['mwst_value'], '%');
|
|
|
469 |
|
|
|
470 |
}
|
|
|
471 |
|
|
|
472 |
/*
|
1416 |
daniel |
473 |
if ($this->arShipping[$this->view['data']['type_shipping']]['mwst'] == '0')
|
|
|
474 |
{
|
|
|
475 |
|
3024 |
daniel |
476 |
$mwst = __('anteilig', 'wpsg');
|
1416 |
daniel |
477 |
|
|
|
478 |
}
|
|
|
479 |
else
|
|
|
480 |
{
|
|
|
481 |
|
|
|
482 |
$mwst = wpsg_ff($this->arShipping[$this->view['data']['type_shipping']]['mwst_value'], '%');
|
|
|
483 |
|
|
|
484 |
}
|
4121 |
daniel |
485 |
*/
|
1416 |
daniel |
486 |
|
1165 |
daniel |
487 |
}
|
|
|
488 |
|
1094 |
daniel |
489 |
$pdf->setXY($prod_left + 97, $prod_top + $offset);
|
3024 |
daniel |
490 |
$pdf->Cell(15, 8, $mwst, 1, 0, 'C');
|
4132 |
daniel |
491 |
|
1094 |
daniel |
492 |
}
|
|
|
493 |
|
|
|
494 |
$pdf->setXY($prod_left + 112, $prod_top + $offset);
|
|
|
495 |
$pdf->Cell(15, 8, '1', 1, 0, 'C');
|
|
|
496 |
|
|
|
497 |
$pdf->setXY($prod_left + 127, $prod_top + $offset);
|
1633 |
daniel |
498 |
$pdf->Cell(25, 8, wpsg_ff($this->view['basket']['sum']['preis_shipping'], $this->get_option('wpsg_currency')), 1, 0, 'R');
|
1094 |
daniel |
499 |
|
|
|
500 |
$pdf->setXY($prod_left + 152, $prod_top + $offset);
|
1633 |
daniel |
501 |
$pdf->Cell(25, 8, wpsg_ff($this->view['basket']['sum']['preis_shipping'], $this->get_option('wpsg_currency')), 1, 0, 'R');
|
1094 |
daniel |
502 |
|
|
|
503 |
$offset += 8;
|
4132 |
daniel |
504 |
|
|
|
505 |
// Zusammengesetzte Versandarten darstellen
|
4291 |
daniel |
506 |
/*
|
4132 |
daniel |
507 |
if (wpsg_isSizedArray($this->view['basket']['shipping']['methods'])) {
|
1094 |
daniel |
508 |
|
4132 |
daniel |
509 |
foreach ($this->view['basket']['shipping']['methods'] as $shipping) {
|
|
|
510 |
|
|
|
511 |
$pdf->SetFont('Arial', '', 9);
|
|
|
512 |
$pdf->setXY($prod_left, $prod_top + $offset);
|
|
|
513 |
$pdf->Cell(10, 8, '', 1, 0, 'C'); $pnr ++;
|
|
|
514 |
|
|
|
515 |
$pdf->setXY($prod_left + 10, $prod_top + $offset);
|
|
|
516 |
$pdf->Cell( ((sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), 8, $this->getShippingName($shipping), 1, 0, 'L');
|
|
|
517 |
|
|
|
518 |
if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
|
|
|
519 |
{
|
|
|
520 |
|
|
|
521 |
if ($this->view['basket']['shipping'][$shipping]['tax_rata'] == 1) { $mwst = __('Anteilig', 'wpsg'); }
|
|
|
522 |
else { $mwst = wpsg_ff($this->view['basket']['shipping'][$shipping]['mwst'], '%'); }
|
|
|
523 |
|
|
|
524 |
$pdf->setXY($prod_left + 97, $prod_top + $offset);
|
|
|
525 |
$pdf->Cell(15, 8, $mwst, 1, 0, 'C');
|
|
|
526 |
|
|
|
527 |
}
|
|
|
528 |
|
|
|
529 |
$pdf->setXY($prod_left + 112, $prod_top + $offset);
|
|
|
530 |
$pdf->Cell(15, 8, '1', 1, 0, 'C');
|
|
|
531 |
|
|
|
532 |
$pdf->setXY($prod_left + 127, $prod_top + $offset);
|
|
|
533 |
$pdf->Cell(25, 8, wpsg_ff($this->view['basket']['shipping'][$shipping]['preis_shipping_brutto'], $this->get_option('wpsg_currency')), 1, 0, 'R');
|
|
|
534 |
|
|
|
535 |
$pdf->setXY($prod_left + 152, $prod_top + $offset);
|
|
|
536 |
$pdf->Cell(25, 8, wpsg_ff($this->view['basket']['shipping'][$shipping]['preis_shipping_brutto'], $this->get_option('wpsg_currency')), 1, 0, 'R');
|
|
|
537 |
|
|
|
538 |
$offset += 8;
|
|
|
539 |
|
|
|
540 |
}
|
|
|
541 |
|
|
|
542 |
}
|
4291 |
daniel |
543 |
*/
|
4132 |
daniel |
544 |
|
|
|
545 |
|
1093 |
daniel |
546 |
}
|
1094 |
daniel |
547 |
|
|
|
548 |
// Zahlungskosten
|
3409 |
daniel |
549 |
if ($this->view['basket']['sum']['preis_payment'] != '' && $this->view['basket']['sum']['preis_payment'] != 0)
|
1094 |
daniel |
550 |
{
|
|
|
551 |
|
|
|
552 |
$pdf->SetFont('Arial', '', 9);
|
|
|
553 |
$pdf->setXY($prod_left, $prod_top + $offset);
|
|
|
554 |
$pdf->Cell(10, 8, $pnr.'.', 1, 0, 'C'); $pnr ++;
|
|
|
555 |
|
|
|
556 |
$pdf->setXY($prod_left + 10, $prod_top + $offset);
|
1157 |
daniel |
557 |
$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');
|
1094 |
daniel |
558 |
|
1157 |
daniel |
559 |
if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
|
1094 |
daniel |
560 |
{
|
|
|
561 |
|
1165 |
daniel |
562 |
if ($this->arPayment[$this->view['data']['type_payment']]['mwst_null'] == '1' && $this->view['basket']['noMwSt'] == '1')
|
|
|
563 |
{
|
|
|
564 |
$mwst = 0;
|
|
|
565 |
}
|
|
|
566 |
else
|
1633 |
daniel |
567 |
{
|
|
|
568 |
|
4126 |
daniel |
569 |
if (isset($this->view['basket']['payment']['tax_rata']) && $this->view['basket']['payment']['tax_rata'] === true)
|
|
|
570 |
{
|
|
|
571 |
|
|
|
572 |
$mwst = __('anteilig', 'wpsg');
|
|
|
573 |
|
|
|
574 |
}
|
|
|
575 |
else
|
|
|
576 |
{
|
|
|
577 |
|
|
|
578 |
$mwst = wpsg_ff($this->arPayment[$this->view['basket']['checkout']['payment']]['mwst_value'], '%');
|
|
|
579 |
|
|
|
580 |
}
|
1633 |
daniel |
581 |
|
4126 |
daniel |
582 |
/*
|
1633 |
daniel |
583 |
if ($this->arPayment[$this->view['data']['type_payment']]['mwst'] == '0')
|
|
|
584 |
{
|
|
|
585 |
|
3024 |
daniel |
586 |
$mwst = __('anteilig', 'wpsg');
|
1633 |
daniel |
587 |
|
|
|
588 |
}
|
|
|
589 |
else
|
|
|
590 |
{
|
|
|
591 |
|
|
|
592 |
$mwst = wpsg_ff($this->arPayment[$this->view['data']['type_payment']]['mwst_value'], '%');
|
|
|
593 |
|
|
|
594 |
}
|
4126 |
daniel |
595 |
*/
|
1633 |
daniel |
596 |
|
1165 |
daniel |
597 |
}
|
|
|
598 |
|
1094 |
daniel |
599 |
$pdf->setXY($prod_left + 97, $prod_top + $offset);
|
3024 |
daniel |
600 |
$pdf->Cell(15, 8, $mwst, 1, 0, 'C');
|
1094 |
daniel |
601 |
|
|
|
602 |
}
|
|
|
603 |
|
|
|
604 |
$pdf->setXY($prod_left + 112, $prod_top + $offset);
|
|
|
605 |
$pdf->Cell(15, 8, '1', 1, 0, 'C');
|
|
|
606 |
|
|
|
607 |
$pdf->setXY($prod_left + 127, $prod_top + $offset);
|
|
|
608 |
$pdf->Cell(25, 8, wpsg_ff($this->view['basket']['sum']['preis_payment'], $this->get_option('wpsg_currency')), 1, 0, 'R');
|
|
|
609 |
|
|
|
610 |
$pdf->setXY($prod_left + 152, $prod_top + $offset);
|
|
|
611 |
$pdf->Cell(25, 8, wpsg_ff($this->view['basket']['sum']['preis_payment'], $this->get_option('wpsg_currency')), 1, 0, 'R');
|
|
|
612 |
|
|
|
613 |
$offset += 8;
|
|
|
614 |
|
|
|
615 |
}
|
1093 |
daniel |
616 |
|
2759 |
daniel |
617 |
// Gebühr
|
4301 |
daniel |
618 |
if (wpsg_tf($this->view['storno_fee']) > 0)
|
2759 |
daniel |
619 |
{
|
|
|
620 |
|
|
|
621 |
$pdf->SetFont('Arial', '', 9);
|
|
|
622 |
$pdf->setXY($prod_left, $prod_top + $offset);
|
|
|
623 |
$pdf->Cell(10, 8, $pnr.'.', 1, 0, 'C'); $pnr ++;
|
|
|
624 |
|
4301 |
daniel |
625 |
$label = __('Bearbeitungsgebühr', 'wpsg');
|
|
|
626 |
|
|
|
627 |
if (strpos($this->view['storno_fee'], '%') !== false) $label .= ' ('.wpsg_ff($this->view['storno_fee'], '%').')';
|
|
|
628 |
|
2759 |
daniel |
629 |
$pdf->setXY($prod_left + 10, $prod_top + $offset);
|
4301 |
daniel |
630 |
$pdf->Cell( ((sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), 8, $label, 1, 0, 'L');
|
2759 |
daniel |
631 |
|
|
|
632 |
if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
|
|
|
633 |
{
|
|
|
634 |
|
|
|
635 |
if ($this->view['basket']['noMwSt'] == '1')
|
|
|
636 |
{
|
|
|
637 |
$mwst = 0;
|
|
|
638 |
}
|
|
|
639 |
else
|
|
|
640 |
{
|
|
|
641 |
|
|
|
642 |
|
4301 |
daniel |
643 |
$mwst = wpsg_ff($this->view['storno_fee_tax_value'], '%');
|
2759 |
daniel |
644 |
|
|
|
645 |
}
|
|
|
646 |
|
|
|
647 |
$pdf->setXY($prod_left + 97, $prod_top + $offset);
|
4301 |
daniel |
648 |
$pdf->Cell(15, 8, $mwst, 1, 0, 'C');
|
2759 |
daniel |
649 |
|
|
|
650 |
}
|
|
|
651 |
|
|
|
652 |
$pdf->setXY($prod_left + 112, $prod_top + $offset);
|
|
|
653 |
$pdf->Cell(15, 8, '1', 1, 0, 'C');
|
|
|
654 |
|
|
|
655 |
$pdf->setXY($prod_left + 127, $prod_top + $offset);
|
4301 |
daniel |
656 |
$pdf->Cell(25, 8, '-'.wpsg_ff($this->view['storno_fee_value'], $this->get_option('wpsg_currency')), 1, 0, 'R');
|
2759 |
daniel |
657 |
|
|
|
658 |
$pdf->setXY($prod_left + 152, $prod_top + $offset);
|
4301 |
daniel |
659 |
$pdf->Cell(25, 8, '-'.wpsg_ff($this->view['storno_fee_value'], $this->get_option('wpsg_currency')), 1, 0, 'R');
|
2759 |
daniel |
660 |
|
|
|
661 |
$offset += 8;
|
|
|
662 |
|
|
|
663 |
}
|
|
|
664 |
|
1093 |
daniel |
665 |
$pdf->SetFont('Arial', '', 9);
|
|
|
666 |
|
|
|
667 |
if ($this->view['kunde']['ustidnr'] != "")
|
|
|
668 |
{
|
|
|
669 |
$offset += 10;
|
|
|
670 |
$pdf->Text($prod_left, $prod_top + $offset, __("Ihre Umsatzsteuer-Identifikationsnummer:", "wpsg"));
|
|
|
671 |
$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
|
|
|
672 |
$pdf->Cell(37, 8, $this->view['kunde']['ustidnr'], 0, 0, 'R');
|
|
|
673 |
}
|
|
|
674 |
|
|
|
675 |
$offset += 10;
|
3024 |
daniel |
676 |
if ($this->get_option('wpsg_kleinunternehmer'))
|
1093 |
daniel |
677 |
{
|
3024 |
daniel |
678 |
|
1093 |
daniel |
679 |
$pdf->Text($prod_left, $prod_top + $offset, __("Es ergibt sich folgender Gesamtbetrag", "wpsg").':');
|
3024 |
daniel |
680 |
$pdf->Text($prod_left + 100, $prod_top + $offset, __("Summe", "wpsg"));
|
1093 |
daniel |
681 |
$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
|
3024 |
daniel |
682 |
$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');
|
1165 |
daniel |
683 |
$offset += 5;
|
1093 |
daniel |
684 |
|
|
|
685 |
}
|
3024 |
daniel |
686 |
else
|
1093 |
daniel |
687 |
{
|
3601 |
daniel |
688 |
|
3024 |
daniel |
689 |
if ($this->view['basket']['noMwSt'] == '1')
|
1093 |
daniel |
690 |
{
|
|
|
691 |
|
3024 |
daniel |
692 |
$pdf->Text($prod_left, $prod_top + $offset, __("Es ergibt sich folgender Gesamtbetrag", "wpsg").':');
|
|
|
693 |
$pdf->Text($prod_left + 100, $prod_top + $offset, __("BRUTTOBETRAG", "wpsg"));
|
|
|
694 |
$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
|
|
|
695 |
$pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_netto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
|
|
|
696 |
$offset += 5;
|
|
|
697 |
|
|
|
698 |
$pdf->Text($prod_left + 100, $prod_top + $offset, __("MwSt. GESAMT", "wpsg"));
|
|
|
699 |
$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
|
|
|
700 |
$pdf->Cell(37, 8, wpsg_ff(0, $this->get_option('wpsg_currency')), 0, 0, 'R');
|
|
|
701 |
|
|
|
702 |
}
|
|
|
703 |
else
|
|
|
704 |
{
|
|
|
705 |
|
|
|
706 |
$pdf->Text($prod_left, $prod_top + $offset, __("Der Gesamtbetrag setzt sich wie folgt zusammen", "wpsg"));
|
|
|
707 |
|
|
|
708 |
$pdf->Text($prod_left + 100, $prod_top + $offset, __("NETTOBETRAG", "wpsg"));
|
|
|
709 |
$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
|
|
|
710 |
$pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_netto'] + $this->view['basket']['sum']['preis_payment_netto'] + $this->view['basket']['sum']['preis_shipping_netto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
|
|
|
711 |
|
3601 |
daniel |
712 |
if (sizeof($this->view['basket']['mwst']) >= 1)
|
1093 |
daniel |
713 |
{
|
|
|
714 |
|
3024 |
daniel |
715 |
foreach ($this->view['basket']['mwst'] as $mw)
|
|
|
716 |
{
|
|
|
717 |
|
|
|
718 |
$offset += 5;
|
3382 |
daniel |
719 |
$pdf->Text($prod_left + 100, $prod_top + $offset, __("MwSt. ", "wpsg").wpsg_ff($mw['value'], '%'));
|
3024 |
daniel |
720 |
$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
|
|
|
721 |
$pdf->Cell(37, 8, wpsg_ff($mw['sum'], $this->get_option('wpsg_currency')), 0, 0, 'R');
|
|
|
722 |
|
|
|
723 |
}
|
1093 |
daniel |
724 |
|
|
|
725 |
}
|
3024 |
daniel |
726 |
|
3601 |
daniel |
727 |
if (sizeof($this->view['basket']['mwst']) > 1)
|
|
|
728 |
{
|
|
|
729 |
|
|
|
730 |
$offset += 5;
|
|
|
731 |
$pdf->Text($prod_left + 100, $prod_top + $offset, __("MwSt. GESAMT", "wpsg"));
|
|
|
732 |
$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
|
|
|
733 |
$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');
|
|
|
734 |
|
|
|
735 |
}
|
3024 |
daniel |
736 |
|
|
|
737 |
}
|
1628 |
david |
738 |
|
|
|
739 |
}
|
1327 |
daniel |
740 |
|
|
|
741 |
// Rabatt
|
|
|
742 |
if ($this->view['basket']['sum']['preis_rabatt'] > 0)
|
|
|
743 |
{
|
|
|
744 |
|
|
|
745 |
$offset += 5;
|
|
|
746 |
|
|
|
747 |
$pdf->Text($prod_left + 100, $prod_top + $offset, __("Rabatt", "wpsg"));
|
|
|
748 |
$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
|
3024 |
daniel |
749 |
$pdf->Cell(37, 8, '-'.wpsg_ff($this->view['basket']['sum']['preis_rabatt'], $this->get_option('wpsg_currency')), 0, 0, 'R');
|
1327 |
daniel |
750 |
|
|
|
751 |
}
|
1633 |
daniel |
752 |
|
1330 |
daniel |
753 |
$offset += 5;
|
|
|
754 |
$pdf->Text($prod_left + 100, $prod_top + $offset, __("SUMME", "wpsg"));
|
|
|
755 |
$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
|
|
|
756 |
$pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
|
1093 |
daniel |
757 |
|
|
|
758 |
if ($this->get_option('wpsg_kleinunternehmer') == '1')
|
|
|
759 |
{
|
|
|
760 |
|
2642 |
david |
761 |
$pdf->MultiCell($prod_left - 1, $prod_top + $offset + 5, 5, utf8_encode($this->get_option('wpsg_kleinunternehmer_text')));
|
1093 |
daniel |
762 |
$offset += 15;
|
|
|
763 |
|
|
|
764 |
}
|
|
|
765 |
|
|
|
766 |
$offset += 5;
|
|
|
767 |
|
|
|
768 |
if ($this->view['fussText'] != "")
|
|
|
769 |
{
|
|
|
770 |
|
|
|
771 |
$pdf->MultiCell($prod_left - 1, $prod_top + $offset, 5, utf8_encode($this->view['fussText']));
|
|
|
772 |
$pdf->SetFont('Arial', 'B', 9);
|
|
|
773 |
$offset += 10;
|
|
|
774 |
|
|
|
775 |
}
|
1242 |
david |
776 |
|
1093 |
daniel |
777 |
$shipping_adress = false;
|
1610 |
david |
778 |
|
|
|
779 |
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'])))
|
1093 |
daniel |
780 |
{
|
|
|
781 |
|
|
|
782 |
$pdf->setFont('Arial', 'B', 9);
|
|
|
783 |
$pdf->Text($prod_left, $prod_top + $offset, __("Lieferanschrift", "wpsg").":");
|
|
|
784 |
$offset += 5;
|
|
|
785 |
|
|
|
786 |
$pdf->setFont('Arial', '', 9);
|
|
|
787 |
|
|
|
788 |
$shipping_adress = "";
|
1242 |
david |
789 |
if ($this->view['data']['shipping_firma'] != "")
|
1093 |
daniel |
790 |
{
|
1242 |
david |
791 |
$shipping_adress .= $this->view['data']['shipping_firma']."\r\n";
|
1093 |
daniel |
792 |
}
|
1242 |
david |
793 |
$shipping_adress .= $this->view['data']['shipping_vname'].' '.$this->view['data']['shipping_name']."\r\n";
|
|
|
794 |
$shipping_adress .= $this->view['data']['shipping_strasse']."\r\n";
|
|
|
795 |
$shipping_adress .= $this->view['data']['shipping_land']['kuerzel'].'-';
|
1093 |
daniel |
796 |
|
1242 |
david |
797 |
$shipping_adress .= $this->view['data']['shipping_plz'].' '.$this->view['data']['shipping_ort'];
|
1093 |
daniel |
798 |
|
|
|
799 |
$start = $pdf->getY();
|
|
|
800 |
$pdf->MultiCell($prod_left - 1, $prod_top + $offset, 5, utf8_encode($shipping_adress), 0, 'L', 0, 100);
|
|
|
801 |
$offset += $pdf->getY() - $start;
|
1242 |
david |
802 |
|
1093 |
daniel |
803 |
$shipping_adress = true;
|
|
|
804 |
|
|
|
805 |
}
|
1242 |
david |
806 |
|
1093 |
daniel |
807 |
|
|
|
808 |
$offset += 5;
|
1678 |
daniel |
809 |
|
1093 |
daniel |
810 |
// Bestellvariablen
|
1671 |
daniel |
811 |
if ($this->hasMod('wpsg_mod_ordervars') && $this->get_option('wpsg_mod_rechnungen_showov') == '1')
|
1093 |
daniel |
812 |
{
|
1671 |
daniel |
813 |
|
|
|
814 |
$bvars = @unserialize($this->view['data']['bvars']);
|
1093 |
daniel |
815 |
if (!is_array($bvars)) $bvars = array();
|
|
|
816 |
|
|
|
817 |
$strBVars = "";
|
|
|
818 |
foreach ($bvars as $bvars_id => $bvars_value)
|
|
|
819 |
{
|
|
|
820 |
|
1671 |
daniel |
821 |
$bvars = $this->db->fetchRow("SELECT * FROM `".wpsg_q(WPSG_TBL_ORDERVARS)."` WHERE `id` = '".wpsg_q($bvars_id)."'");
|
1093 |
daniel |
822 |
|
|
|
823 |
if ($bvars['typ'] == "1") // Auswahl
|
|
|
824 |
{
|
|
|
825 |
if ($bvars_value <= 0) $bvars_value = __("Keine Angabe", "wpsg");
|
|
|
826 |
}
|
|
|
827 |
else if ($bvars['typ'] == "2") // Texteingabe
|
|
|
828 |
{
|
|
|
829 |
if (trim($bvars_value) == "") $bvars_value = __("Keine Angabe", "wpsg");
|
|
|
830 |
}
|
|
|
831 |
else if ($bvars['typ'] == "3") // Checkbox
|
|
|
832 |
{
|
|
|
833 |
if ($bvars_value <= 0) $bvars_value = __("Keine Angabe", "wpsg");
|
|
|
834 |
}
|
|
|
835 |
|
1671 |
daniel |
836 |
$bvars_name = $this->callMod('wpsg_mod_ordervars', 'getNameById', array($bvars_id));
|
1093 |
daniel |
837 |
$strBVars .= "\r\n".$bvars_name.": ".$bvars_value;
|
|
|
838 |
|
|
|
839 |
}
|
|
|
840 |
|
|
|
841 |
$pdf->SetFont('Arial', 'B', 9);
|
|
|
842 |
$pdf->Text($prod_left, $prod_top + $offset, __("Angaben während der Bestellung", "wpsg").":");
|
|
|
843 |
$pdf->SetFont('Arial', '', 9);
|
|
|
844 |
$pdf->MultiCell($prod_left - 1, $prod_top + $offset, 5, utf8_encode($strBVars));
|
|
|
845 |
|
4301 |
daniel |
846 |
}
|
1093 |
daniel |
847 |
|
|
|
848 |
if (!file_exists($this->callMod('wpsg_mod_rechnungen', 'getFilePath', array($this->view['data']['id']))))
|
|
|
849 |
{
|
|
|
850 |
|
|
|
851 |
mkdir($this->callMod('wpsg_mod_rechnungen', 'getFilePath', array($this->view['data']['id'])), 0777, true);
|
|
|
852 |
|
|
|
853 |
}
|
|
|
854 |
|
1125 |
daniel |
855 |
$filename = $this->view['filename'].".pdf";
|
1093 |
daniel |
856 |
|
|
|
857 |
if ($this->view['preview'])
|
|
|
858 |
{
|
|
|
859 |
$pdf->Output($filename, 'I');
|
|
|
860 |
}
|
|
|
861 |
else
|
|
|
862 |
{
|
|
|
863 |
|
|
|
864 |
$pdf->Output($this->callMod('wpsg_mod_rechnungen', 'getFilePath', array($this->view['data']['id'])).$filename, 'F');
|
1228 |
daniel |
865 |
|
|
|
866 |
if ($this->view['output'] === true) $pdf->Output($filename, 'I');
|
1093 |
daniel |
867 |
|
4301 |
daniel |
868 |
}
|
1093 |
daniel |
869 |
|
|
|
870 |
?>
|