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