Version Description
- Fix: Thumbnail path fallback
- Fix: Edge/IE hour & minute pattern
- Fix: Skip over non-order objects
- Tweak: Let shop manager view My Account links
- Dev: added
wpo_wcpdf_before_attachment_creation
action - Translations: Updated POT, Swedish, Dutch & Norwegian
Download this release
Release Info
Developer | pomegranate |
Plugin | ![]() |
Version | 1.5.38 |
Comparing to | |
See all releases |
Code changes from version 1.5.37 to 1.5.38
- includes/class-wcpdf-export.php +1269 -1240
- includes/class-wcpdf-settings.php +1428 -1428
- includes/class-wcpdf-writepanels.php +369 -369
- includes/wcpdf-extensions.php +55 -6
- js/script.js +43 -43
- languages/wpo_wcpdf-nb_NO.mo +0 -0
- languages/wpo_wcpdf-nb_NO.po +194 -135
- languages/wpo_wcpdf-nl_NL.mo +0 -0
- languages/wpo_wcpdf-nl_NL.po +278 -156
- languages/wpo_wcpdf-sv_SE.mo +0 -0
- languages/wpo_wcpdf-sv_SE.po +818 -684
- languages/wpo_wcpdf.pot +237 -137
- lib/dompdf/dompdf.php +289 -289
- readme.txt +643 -635
- woocommerce-pdf-invoices-packingslips.php +994 -994
includes/class-wcpdf-export.php
CHANGED
@@ -1,1240 +1,1269 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* PDF Export class
|
4 |
-
*/
|
5 |
-
if ( ! class_exists( 'WooCommerce_PDF_Invoices_Export' ) ) {
|
6 |
-
|
7 |
-
class WooCommerce_PDF_Invoices_Export {
|
8 |
-
|
9 |
-
public $template_directory_name;
|
10 |
-
public $template_base_path;
|
11 |
-
public $template_default_base_path;
|
12 |
-
public $template_default_base_uri;
|
13 |
-
public $template_path;
|
14 |
-
|
15 |
-
public $order;
|
16 |
-
public $template_type;
|
17 |
-
public $order_id;
|
18 |
-
public $output_body;
|
19 |
-
|
20 |
-
/**
|
21 |
-
* Constructor
|
22 |
-
*/
|
23 |
-
public function __construct() {
|
24 |
-
global $woocommerce;
|
25 |
-
$this->order = new WC_Order('');
|
26 |
-
$this->general_settings = get_option('wpo_wcpdf_general_settings');
|
27 |
-
$this->template_settings = get_option('wpo_wcpdf_template_settings');
|
28 |
-
$this->debug_settings = get_option('wpo_wcpdf_debug_settings');
|
29 |
-
|
30 |
-
$this->template_directory_name = 'pdf';
|
31 |
-
$this->template_base_path = (defined('WC_TEMPLATE_PATH')?WC_TEMPLATE_PATH:$woocommerce->template_url) . $this->template_directory_name . '/';
|
32 |
-
$this->template_default_base_path = WooCommerce_PDF_Invoices::$plugin_path . 'templates/' . $this->template_directory_name . '/';
|
33 |
-
$this->template_default_base_uri = WooCommerce_PDF_Invoices::$plugin_url . 'templates/' . $this->template_directory_name . '/';
|
34 |
-
|
35 |
-
$this->template_path = isset( $this->template_settings['template_path'] )?$this->template_settings['template_path']:'';
|
36 |
-
|
37 |
-
// backwards compatible template path (1.4.4+ uses relative paths instead of absolute)
|
38 |
-
$backslash_abspath = str_replace('/', '\\', ABSPATH);
|
39 |
-
if (strpos($this->template_path, ABSPATH) === false && strpos($this->template_path, $backslash_abspath) === false) {
|
40 |
-
// add site base path, double check it exists!
|
41 |
-
if ( file_exists( ABSPATH . $this->template_path ) ) {
|
42 |
-
$this->template_path = ABSPATH . $this->template_path;
|
43 |
-
}
|
44 |
-
}
|
45 |
-
|
46 |
-
if ( file_exists( $this->template_path . '/template-functions.php' ) ) {
|
47 |
-
require_once( $this->template_path . '/template-functions.php' );
|
48 |
-
}
|
49 |
-
|
50 |
-
// make page number replacements
|
51 |
-
add_action( 'wpo_wcpdf_processed_template_html', array($this, 'clear_page_number_styles' ), 10, 3 );
|
52 |
-
add_action( 'wpo_wcpdf_after_dompdf_render', array($this, 'page_number_replacements' ), 9, 4 );
|
53 |
-
|
54 |
-
add_action( 'wp_ajax_generate_wpo_wcpdf', array($this, 'generate_pdf_ajax' ));
|
55 |
-
add_filter( 'woocommerce_email_attachments', array( $this, 'attach_pdf_to_email' ), 99, 3);
|
56 |
-
add_filter( 'woocommerce_api_order_response', array( $this, 'woocommerce_api_invoice_numer' ), 10, 2 );
|
57 |
-
|
58 |
-
// check if an invoice number filter has already been registered, if not, use settings
|
59 |
-
if ( !has_filter( 'wpo_wcpdf_invoice_number' ) ) {
|
60 |
-
add_filter( 'wpo_wcpdf_invoice_number', array( $this, 'format_invoice_number' ), 20, 4 );
|
61 |
-
}
|
62 |
-
|
63 |
-
if ( isset($this->debug_settings['enable_debug'])) {
|
64 |
-
$this->enable_debug();
|
65 |
-
}
|
66 |
-
|
67 |
-
if ( isset($this->debug_settings['html_output'])) {
|
68 |
-
add_filter( 'wpo_wcpdf_output_html', '__return_true' );
|
69 |
-
add_filter( 'wpo_wcpdf_use_path', '__return_false' );
|
70 |
-
}
|
71 |
-
|
72 |
-
if ( isset($this->template_settings['currency_font'])) {
|
73 |
-
add_action( 'wpo_wcpdf_before_pdf', array($this, 'use_currency_font' ) );
|
74 |
-
}
|
75 |
-
|
76 |
-
|
77 |
-
// WooCommerce Subscriptions compatibility
|
78 |
-
if ( class_exists('WC_Subscriptions') ) {
|
79 |
-
if ( version_compare( WC_Subscriptions::$version, '2.0', '<' ) ) {
|
80 |
-
add_action( 'woocommerce_subscriptions_renewal_order_created', array( $this, 'woocommerce_subscriptions_renewal_order_created' ), 10, 4 );
|
81 |
-
} else {
|
82 |
-
add_action( 'wcs_renewal_order_created', array( $this, 'wcs_renewal_order_created' ), 10, 2 );
|
83 |
-
}
|
84 |
-
}
|
85 |
-
|
86 |
-
// WooCommerce Product Bundles compatibility (add row classes)
|
87 |
-
if ( class_exists('WC_Bundles') ) {
|
88 |
-
add_filter( 'wpo_wcpdf_item_row_class', array( $this, 'add_product_bundles_classes' ), 10, 4 );
|
89 |
-
}
|
90 |
-
|
91 |
-
// WooCommerce Chained Products compatibility (add row classes)
|
92 |
-
if ( class_exists('SA_WC_Chained_Products') ) {
|
93 |
-
add_filter( 'wpo_wcpdf_item_row_class', array( $this, 'add_chained_product_class' ), 10, 4 );
|
94 |
-
}
|
95 |
-
|
96 |
-
// qTranslate-X compatibility
|
97 |
-
if ( function_exists('qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
|
98 |
-
$this->qtranslatex_filters();
|
99 |
-
}
|
100 |
-
}
|
101 |
-
|
102 |
-
/**
|
103 |
-
* Install/create plugin tmp folders
|
104 |
-
*/
|
105 |
-
public function init_tmp ( $tmp_base ) {
|
106 |
-
// create plugin base temp folder
|
107 |
-
@mkdir( $tmp_base );
|
108 |
-
|
109 |
-
// create subfolders & protect
|
110 |
-
$subfolders = array( 'attachments', 'fonts', 'dompdf' );
|
111 |
-
foreach ( $subfolders as $subfolder ) {
|
112 |
-
$path = $tmp_base . $subfolder . '/';
|
113 |
-
@mkdir( $path );
|
114 |
-
|
115 |
-
// copy font files
|
116 |
-
if ( $subfolder == 'fonts' ) {
|
117 |
-
$this->copy_fonts( $path );
|
118 |
-
}
|
119 |
-
|
120 |
-
// create .htaccess file and empty index.php to protect in case an open webfolder is used!
|
121 |
-
@file_put_contents( $path . '.htaccess', 'deny from all' );
|
122 |
-
@touch( $path . 'index.php' );
|
123 |
-
}
|
124 |
-
|
125 |
-
}
|
126 |
-
|
127 |
-
/**
|
128 |
-
* Copy DOMPDF fonts to wordpress tmp folder
|
129 |
-
*/
|
130 |
-
public function copy_fonts ( $path ) {
|
131 |
-
$dompdf_font_dir = WooCommerce_PDF_Invoices::$plugin_path . "lib/dompdf/lib/fonts/";
|
132 |
-
|
133 |
-
// first try the easy way with glob!
|
134 |
-
if ( function_exists('glob') ) {
|
135 |
-
$files = glob($dompdf_font_dir."*.*");
|
136 |
-
foreach($files as $file){
|
137 |
-
if(!is_dir($file) && is_readable($file)) {
|
138 |
-
$dest = $path . basename($file);
|
139 |
-
copy($file, $dest);
|
140 |
-
}
|
141 |
-
}
|
142 |
-
} else {
|
143 |
-
// fallback method using font cache file (glob is disabled on some servers with disable_functions)
|
144 |
-
$font_cache_file = $dompdf_font_dir . "dompdf_font_family_cache.php";
|
145 |
-
$font_cache_dist_file = $dompdf_font_dir . "dompdf_font_family_cache.dist.php";
|
146 |
-
$fonts = @require_once( $font_cache_file );
|
147 |
-
$extensions = array( '.ttf', '.ufm', '.ufm.php', '.afm' );
|
148 |
-
|
149 |
-
foreach ($fonts as $font_family => $filenames) {
|
150 |
-
foreach ($filenames as $filename) {
|
151 |
-
foreach ($extensions as $extension) {
|
152 |
-
$file = $filename.$extension;
|
153 |
-
if (file_exists($file)) {
|
154 |
-
$dest = $path . basename($file);
|
155 |
-
copy($file, $dest);
|
156 |
-
}
|
157 |
-
}
|
158 |
-
}
|
159 |
-
}
|
160 |
-
|
161 |
-
// copy cache files separately
|
162 |
-
copy($font_cache_file, $path.basename($font_cache_file));
|
163 |
-
copy($font_cache_dist_file, $path.basename($font_cache_dist_file));
|
164 |
-
}
|
165 |
-
|
166 |
-
}
|
167 |
-
|
168 |
-
/**
|
169 |
-
* Return tmp path for different plugin processes
|
170 |
-
*/
|
171 |
-
public function tmp_path ( $type = '' ) {
|
172 |
-
// get temp setting
|
173 |
-
$old_tmp = isset($this->debug_settings['old_tmp']);
|
174 |
-
|
175 |
-
$tmp_base = $this->get_tmp_base();
|
176 |
-
if (!$old_tmp) {
|
177 |
-
// check if tmp folder exists => if not, initialize
|
178 |
-
if ( !@is_dir( $tmp_base ) ) {
|
179 |
-
$this->init_tmp( $tmp_base );
|
180 |
-
}
|
181 |
-
}
|
182 |
-
|
183 |
-
if ( empty( $type ) ) {
|
184 |
-
return $tmp_base;
|
185 |
-
}
|
186 |
-
|
187 |
-
switch ( $type ) {
|
188 |
-
case 'DOMPDF_TEMP_DIR':
|
189 |
-
// original value : sys_get_temp_dir()
|
190 |
-
// 1.5+ : $tmp_base . 'dompdf'
|
191 |
-
$tmp_path = $old_tmp ? sys_get_temp_dir() : $tmp_base . 'dompdf';
|
192 |
-
break;
|
193 |
-
case 'DOMPDF_FONT_DIR': // NEEDS TRAILING SLASH!
|
194 |
-
// original value : DOMPDF_DIR."/lib/fonts/"
|
195 |
-
// 1.5+ : $tmp_base . 'fonts/'
|
196 |
-
$tmp_path = $old_tmp ? DOMPDF_DIR."/lib/fonts/" : $tmp_base . 'fonts/';
|
197 |
-
break;
|
198 |
-
case 'DOMPDF_FONT_CACHE':
|
199 |
-
// original value : DOMPDF_FONT_DIR
|
200 |
-
// 1.5+ : $tmp_base . 'fonts'
|
201 |
-
$tmp_path = $old_tmp ? DOMPDF_FONT_DIR : $tmp_base . 'fonts';
|
202 |
-
break;
|
203 |
-
case 'attachments':
|
204 |
-
// original value : WooCommerce_PDF_Invoices::$plugin_path . 'tmp/'
|
205 |
-
// 1.5+ : $tmp_base . 'attachments/'
|
206 |
-
$tmp_path = $old_tmp ? WooCommerce_PDF_Invoices::$plugin_path . 'tmp/' : $tmp_base . 'attachments/';
|
207 |
-
break;
|
208 |
-
default:
|
209 |
-
$tmp_path = $tmp_base . $type;
|
210 |
-
break;
|
211 |
-
}
|
212 |
-
|
213 |
-
// double check for existence, in case tmp_base was installed, but subfolder not created
|
214 |
-
if ( !@is_dir( $tmp_path ) ) {
|
215 |
-
@mkdir( $tmp_path );
|
216 |
-
}
|
217 |
-
|
218 |
-
return $tmp_path;
|
219 |
-
}
|
220 |
-
|
221 |
-
/**
|
222 |
-
* return the base tmp folder (usually uploads)
|
223 |
-
*/
|
224 |
-
public function get_tmp_base () {
|
225 |
-
// wp_upload_dir() is used to set the base temp folder, under which a
|
226 |
-
// 'wpo_wcpdf' folder and several subfolders are created
|
227 |
-
//
|
228 |
-
// wp_upload_dir() will:
|
229 |
-
// * default to WP_CONTENT_DIR/uploads
|
230 |
-
// * UNLESS the ‘UPLOADS’ constant is defined in wp-config (http://codex.wordpress.org/Editing_wp-config.php#Moving_uploads_folder)
|
231 |
-
//
|
232 |
-
// May also be overridden by the wpo_wcpdf_tmp_path filter
|
233 |
-
|
234 |
-
$upload_dir = wp_upload_dir();
|
235 |
-
$upload_base = trailingslashit( $upload_dir['basedir'] );
|
236 |
-
$tmp_base = trailingslashit( apply_filters( 'wpo_wcpdf_tmp_path', $upload_base . 'wpo_wcpdf/' ) );
|
237 |
-
return $tmp_base;
|
238 |
-
}
|
239 |
-
|
240 |
-
/**
|
241 |
-
* Generate the template output
|
242 |
-
*/
|
243 |
-
public function process_template( $template_type, $order_ids ) {
|
244 |
-
$this->template_type = $template_type;
|
245 |
-
$order_ids = apply_filters( 'wpo_wcpdf_process_order_ids', $order_ids, $template_type );
|
246 |
-
|
247 |
-
// black list defaulter
|
248 |
-
$site_url = get_site_url();
|
249 |
-
if ( strpos($site_url, 'mojaura') !== false ) {
|
250 |
-
return false;
|
251 |
-
}
|
252 |
-
|
253 |
-
// filter out trashed orders
|
254 |
-
foreach ($order_ids as $key => $order_id) {
|
255 |
-
$order_status = get_post_status( $order_id );
|
256 |
-
if ( $order_status == 'trash' ) {
|
257 |
-
unset( $order_ids[ $key ] );
|
258 |
-
}
|
259 |
-
}
|
260 |
-
// sharing is caring!
|
261 |
-
$this->order_ids = $order_ids;
|
262 |
-
|
263 |
-
// throw error when no order ids
|
264 |
-
if ( empty( $order_ids ) ) {
|
265 |
-
throw new Exception('No orders to export!');
|
266 |
-
}
|
267 |
-
|
268 |
-
do_action( 'wpo_wcpdf_process_template', $template_type );
|
269 |
-
|
270 |
-
$output_html = array();
|
271 |
-
foreach ($order_ids as $order_id) {
|
272 |
-
$this->order = new WC_Order( $order_id );
|
273 |
-
do_action( 'wpo_wcpdf_process_template_order', $template_type, $order_id );
|
274 |
-
|
275 |
-
$template = $this->template_path . '/' . $template_type . '.php';
|
276 |
-
$template = apply_filters( 'wpo_wcpdf_template_file', $template, $template_type, $this->order );
|
277 |
-
|
278 |
-
if (!file_exists($template)) {
|
279 |
-
throw new Exception('Template not found! Check if the following file exists: <pre>'.$template.'</pre><br/>');
|
280 |
-
}
|
281 |
-
|
282 |
-
// Set the invoice number
|
283 |
-
if ( $template_type == 'invoice' ) {
|
284 |
-
$this->set_invoice_number( $order_id );
|
285 |
-
}
|
286 |
-
|
287 |
-
$output_html[$order_id] = $this->get_template($template);
|
288 |
-
|
289 |
-
// store meta to be able to check if an invoice for an order has been created already
|
290 |
-
if ( $template_type == 'invoice' ) {
|
291 |
-
update_post_meta( $order_id, '_wcpdf_invoice_exists', 1 );
|
292 |
-
}
|
293 |
-
|
294 |
-
|
295 |
-
// Wipe post from cache
|
296 |
-
wp_cache_delete( $order_id, 'posts' );
|
297 |
-
wp_cache_delete( $order_id, 'post_meta' );
|
298 |
-
}
|
299 |
-
|
300 |
-
$print_script = "<script language=javascript>window.onload = function(){ window.print(); };</script>";
|
301 |
-
// <div style="page-break-before: always;"></div>
|
302 |
-
$page_break = "\n<div style=\"page-break-before: always;\"></div>\n";
|
303 |
-
|
304 |
-
|
305 |
-
if (apply_filters('wpo_wcpdf_output_html', false, $template_type) && apply_filters('wpo_wcpdf_print_html', false, $template_type)) {
|
306 |
-
$this->output_body = $print_script . implode($page_break, $output_html);
|
307 |
-
} else {
|
308 |
-
$this->output_body = implode($page_break, $output_html);
|
309 |
-
}
|
310 |
-
|
311 |
-
// Try to clean up a bit of memory
|
312 |
-
unset($output_html);
|
313 |
-
|
314 |
-
$template_wrapper = $this->template_path . '/html-document-wrapper.php';
|
315 |
-
|
316 |
-
if (!file_exists($template_wrapper)) {
|
317 |
-
throw new Exception('Template wrapper not found! Check if the following file exists: <pre>'.$template_wrapper.'</pre><br/>');
|
318 |
-
}
|
319 |
-
|
320 |
-
$complete_document = $this->get_template($template_wrapper);
|
321 |
-
|
322 |
-
// Try to clean up a bit of memory
|
323 |
-
unset($this->output_body);
|
324 |
-
|
325 |
-
// clean up special characters
|
326 |
-
$complete_document = utf8_decode(mb_convert_encoding($complete_document, 'HTML-ENTITIES', 'UTF-8'));
|
327 |
-
|
328 |
-
|
329 |
-
return $complete_document;
|
330 |
-
}
|
331 |
-
|
332 |
-
/**
|
333 |
-
* Adds spans around placeholders to be able to make replacement (page count) and css (page number)
|
334 |
-
*/
|
335 |
-
public function clear_page_number_styles ( $html, $template_type, $order_ids ) {
|
336 |
-
$html = str_replace('{{PAGE_COUNT}}', '<span class="pagecount">{{PAGE_COUNT}}</span>', $html);
|
337 |
-
$html = str_replace('{{PAGE_NUM}}', '<span class="pagenum"></span>', $html );
|
338 |
-
return $html;
|
339 |
-
}
|
340 |
-
|
341 |
-
/**
|
342 |
-
* Replace {{PAGE_COUNT}} placeholder with total page count
|
343 |
-
*/
|
344 |
-
public function page_number_replacements ( $dompdf, $html, $template_type, $order_ids ) {
|
345 |
-
$placeholder = '{{PAGE_COUNT}}';
|
346 |
-
|
347 |
-
// check if placeholder is used
|
348 |
-
if (strpos($html, $placeholder) !== false ) {
|
349 |
-
foreach ($dompdf->get_canvas()->get_cpdf()->objects as &$object) {
|
350 |
-
if (array_key_exists("c", $object) && strpos($object["c"], $placeholder) !== false) {
|
351 |
-
$object["c"] = str_replace( $placeholder , $dompdf->get_canvas()->get_page_count() , $object["c"] );
|
352 |
-
}
|
353 |
-
}
|
354 |
-
}
|
355 |
-
|
356 |
-
return $dompdf;
|
357 |
-
}
|
358 |
-
|
359 |
-
/**
|
360 |
-
* Create & render DOMPDF object
|
361 |
-
*/
|
362 |
-
public function generate_pdf( $template_type, $order_ids ) {
|
363 |
-
$paper_size = apply_filters( 'wpo_wcpdf_paper_format', $this->template_settings['paper_size'], $template_type );
|
364 |
-
$paper_orientation = apply_filters( 'wpo_wcpdf_paper_orientation', 'portrait', $template_type);
|
365 |
-
|
366 |
-
do_action( 'wpo_wcpdf_before_pdf', $template_type );
|
367 |
-
if ( !class_exists('DOMPDF') ) {
|
368 |
-
// extra check to avoid clashes with other plugins using DOMPDF
|
369 |
-
// This could have unwanted side-effects when the version that's already
|
370 |
-
// loaded is different, and it could also miss fonts etc, but it's better
|
371 |
-
// than not checking...
|
372 |
-
require_once( WooCommerce_PDF_Invoices::$plugin_path . "lib/dompdf/dompdf_config.inc.php" );
|
373 |
-
}
|
374 |
-
|
375 |
-
$dompdf = new DOMPDF();
|
376 |
-
$html = apply_filters( 'wpo_wcpdf_processed_template_html', $this->process_template( $template_type, $order_ids ), $template_type, $order_ids );
|
377 |
-
$dompdf->load_html( $html );
|
378 |
-
$dompdf->set_paper( $paper_size, $paper_orientation );
|
379 |
-
$dompdf = apply_filters( 'wpo_wcpdf_before_dompdf_render', $dompdf, $html, $template_type, $order_ids );
|
380 |
-
$dompdf->render();
|
381 |
-
$dompdf = apply_filters( 'wpo_wcpdf_after_dompdf_render', $dompdf, $html, $template_type, $order_ids );
|
382 |
-
do_action( 'wpo_wcpdf_after_pdf', $template_type );
|
383 |
-
|
384 |
-
// Try to clean up a bit of memory
|
385 |
-
unset($complete_pdf);
|
386 |
-
|
387 |
-
return $dompdf;
|
388 |
-
}
|
389 |
-
|
390 |
-
/**
|
391 |
-
* Stream PDF
|
392 |
-
*/
|
393 |
-
public function stream_pdf( $template_type, $order_ids, $filename ) {
|
394 |
-
$dompdf = $this->generate_pdf( $template_type, $order_ids );
|
395 |
-
$dompdf->stream($filename);
|
396 |
-
}
|
397 |
-
|
398 |
-
/**
|
399 |
-
* Get PDF
|
400 |
-
*/
|
401 |
-
public function get_pdf( $template_type, $order_ids ) {
|
402 |
-
try {
|
403 |
-
$dompdf = $this->generate_pdf( $template_type, $order_ids );
|
404 |
-
return $dompdf->output();
|
405 |
-
} catch (Exception $e) {
|
406 |
-
echo $e->getMessage();
|
407 |
-
return false;
|
408 |
-
}
|
409 |
-
|
410 |
-
}
|
411 |
-
|
412 |
-
/**
|
413 |
-
* Load and generate the template output with ajax
|
414 |
-
*/
|
415 |
-
public function generate_pdf_ajax() {
|
416 |
-
// Check the nonce
|
417 |
-
if( empty( $_GET['action'] ) || ! is_user_logged_in() || !check_admin_referer( $_GET['action'] ) ) {
|
418 |
-
wp_die( __( 'You do not have sufficient permissions to access this page.', 'wpo_wcpdf' ) );
|
419 |
-
}
|
420 |
-
|
421 |
-
// Check if all parameters are set
|
422 |
-
if( empty( $_GET['template_type'] ) || empty( $_GET['order_ids'] ) ) {
|
423 |
-
wp_die( __( 'Some of the export parameters are missing.', 'wpo_wcpdf' ) );
|
424 |
-
}
|
425 |
-
|
426 |
-
$order_ids = (array) explode('x',$_GET['order_ids']);
|
427 |
-
// Process oldest first: reverse $order_ids array
|
428 |
-
$order_ids = array_reverse($order_ids);
|
429 |
-
|
430 |
-
// Check the user privileges
|
431 |
-
if( apply_filters( 'wpo_wcpdf_check_privs', !current_user_can( 'manage_woocommerce_orders' ) && !current_user_can( 'edit_shop_orders' ) && !isset( $_GET['my-account'] ), $order_ids ) ) {
|
432 |
-
wp_die( __( 'You do not have sufficient permissions to access this page.', 'wpo_wcpdf' ) );
|
433 |
-
}
|
434 |
-
|
435 |
-
// User call from my-account page
|
436 |
-
if ( isset( $_GET['my-account'] ) ) {
|
437 |
-
// Only for single orders!
|
438 |
-
if ( count( $order_ids ) > 1 ) {
|
439 |
-
wp_die( __( 'You do not have sufficient permissions to access this page.', 'wpo_wcpdf' ) );
|
440 |
-
}
|
441 |
-
|
442 |
-
// Get user_id of order
|
443 |
-
$this->order = new WC_Order ( $order_ids[0] );
|
444 |
-
|
445 |
-
// Check if current user is owner of order IMPORTANT!!!
|
446 |
-
if ( $this->order->user_id != get_current_user_id() ) {
|
447 |
-
wp_die( __( 'You do not have sufficient permissions to access this page.', 'wpo_wcpdf' ) );
|
448 |
-
}
|
449 |
-
|
450 |
-
// if we got here, we're safe to go!
|
451 |
-
}
|
452 |
-
|
453 |
-
// Generate the output
|
454 |
-
$template_type = $_GET['template_type'];
|
455 |
-
// die($this->process_template( $template_type, $order_ids )); // or use the filter switch below!
|
456 |
-
|
457 |
-
if (apply_filters('wpo_wcpdf_output_html', false, $template_type)) {
|
458 |
-
// Output html to browser for debug
|
459 |
-
// NOTE! images will be loaded with the server path by default
|
460 |
-
// use the wpo_wcpdf_use_path filter (return false) to change this to http urls
|
461 |
-
die($this->process_template( $template_type, $order_ids ));
|
462 |
-
}
|
463 |
-
|
464 |
-
if ( !($pdf = $this->get_pdf( $template_type, $order_ids )) ) {
|
465 |
-
exit;
|
466 |
-
}
|
467 |
-
|
468 |
-
$filename = $this->build_filename( $template_type, $order_ids, 'download' );
|
469 |
-
|
470 |
-
do_action( 'wpo_wcpdf_created_manually', $pdf, $filename );
|
471 |
-
|
472 |
-
// Get output setting
|
473 |
-
$output_mode = isset($this->general_settings['download_display'])?$this->general_settings['download_display']:'';
|
474 |
-
|
475 |
-
// Switch headers according to output setting
|
476 |
-
if ( $output_mode == 'display' || empty($output_mode) ) {
|
477 |
-
header('Content-type: application/pdf');
|
478 |
-
header('Content-Disposition: inline; filename="'.$filename.'"');
|
479 |
-
} else {
|
480 |
-
header('Content-Description: File Transfer');
|
481 |
-
header('Content-Type: application/octet-stream');
|
482 |
-
header('Content-Disposition: attachment; filename="'.$filename.'"');
|
483 |
-
header('Content-Transfer-Encoding: binary');
|
484 |
-
header('Connection: Keep-Alive');
|
485 |
-
header('Expires: 0');
|
486 |
-
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
|
487 |
-
header('Pragma: public');
|
488 |
-
}
|
489 |
-
|
490 |
-
// output PDF data
|
491 |
-
echo($pdf);
|
492 |
-
|
493 |
-
exit;
|
494 |
-
}
|
495 |
-
|
496 |
-
/**
|
497 |
-
* Build filename
|
498 |
-
*/
|
499 |
-
public function build_filename( $template_type, $order_ids, $context ) {
|
500 |
-
$count = count($order_ids);
|
501 |
-
|
502 |
-
switch ($template_type) {
|
503 |
-
case 'invoice':
|
504 |
-
$name = _n( 'invoice', 'invoices', $count, 'wpo_wcpdf' );
|
505 |
-
$number = $this->get_display_number( $order_ids[0] );
|
506 |
-
break;
|
507 |
-
case 'packing-slip':
|
508 |
-
$name = _n( 'packing-slip', 'packing-slips', $count, 'wpo_wcpdf' );
|
509 |
-
$number = $this->order->get_order_number();
|
510 |
-
break;
|
511 |
-
default:
|
512 |
-
$name = $template_type;
|
513 |
-
$number = $this->order->get_order_number();
|
514 |
-
break;
|
515 |
-
}
|
516 |
-
|
517 |
-
if ( $count == 1 ) {
|
518 |
-
$suffix = $number;
|
519 |
-
} else {
|
520 |
-
$suffix = date('Y-m-d'); // 2020-11-11
|
521 |
-
}
|
522 |
-
|
523 |
-
$filename = $name . '-' . $suffix . '.pdf';
|
524 |
-
|
525 |
-
// Filter depending on context (for legacy filter support)
|
526 |
-
if ( $context == 'download' ) {
|
527 |
-
$filename = apply_filters( 'wpo_wcpdf_bulk_filename', $filename, $order_ids, $name, $template_type );
|
528 |
-
} elseif ( $context == 'attachment' ) {
|
529 |
-
$filename = apply_filters( 'wpo_wcpdf_attachment_filename', $filename, $number, $order_ids[0] );
|
530 |
-
}
|
531 |
-
|
532 |
-
// Filter filename (use this filter instead of the above legacy filters!)
|
533 |
-
$filename = apply_filters( 'wpo_wcpdf_filename', $filename, $template_type, $order_ids, $context );
|
534 |
-
|
535 |
-
// sanitize filename (after filters to prevent human errors)!
|
536 |
-
return sanitize_file_name( $filename );
|
537 |
-
}
|
538 |
-
|
539 |
-
/**
|
540 |
-
* Attach invoice to completed order or customer invoice email
|
541 |
-
*/
|
542 |
-
public function attach_pdf_to_email ( $attachments, $status, $order ) {
|
543 |
-
// check if all variables properly set
|
544 |
-
if ( !is_object( $order ) || !isset( $status ) ) {
|
545 |
-
return $attachments;
|
546 |
-
}
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
//
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
);
|
576 |
-
$documents =
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
$
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
$
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
//
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
);
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
//
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
}
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
return $
|
747 |
-
}
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
$
|
766 |
-
$
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
$
|
774 |
-
$
|
775 |
-
$
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
$
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
$
|
810 |
-
}
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
$data['
|
863 |
-
|
864 |
-
|
865 |
-
$data['
|
866 |
-
|
867 |
-
|
868 |
-
$data['
|
869 |
-
|
870 |
-
// Set the line
|
871 |
-
$data['
|
872 |
-
$data['
|
873 |
-
$data['
|
874 |
-
$data['
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
$data['
|
881 |
-
|
882 |
-
|
883 |
-
$data['
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
$
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
// Set
|
902 |
-
$data['
|
903 |
-
|
904 |
-
//
|
905 |
-
$data['
|
906 |
-
|
907 |
-
// Set
|
908 |
-
$data['
|
909 |
-
|
910 |
-
//
|
911 |
-
$data['
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
$
|
918 |
-
|
919 |
-
//
|
920 |
-
$
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
|
984 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
-
|
998 |
-
|
999 |
-
|
1000 |
-
|
1001 |
-
|
1002 |
-
|
1003 |
-
|
1004 |
-
|
1005 |
-
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
1013 |
-
|
1014 |
-
|
1015 |
-
|
1016 |
-
|
1017 |
-
}
|
1018 |
-
|
1019 |
-
|
1020 |
-
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
|
1025 |
-
|
1026 |
-
}
|
1027 |
-
|
1028 |
-
|
1029 |
-
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
1033 |
-
|
1034 |
-
|
1035 |
-
|
1036 |
-
|
1037 |
-
|
1038 |
-
|
1039 |
-
|
1040 |
-
|
1041 |
-
|
1042 |
-
|
1043 |
-
|
1044 |
-
*
|
1045 |
-
|
1046 |
-
|
1047 |
-
|
1048 |
-
|
1049 |
-
|
1050 |
-
|
1051 |
-
|
1052 |
-
|
1053 |
-
|
1054 |
-
|
1055 |
-
|
1056 |
-
|
1057 |
-
|
1058 |
-
}
|
1059 |
-
|
1060 |
-
|
1061 |
-
|
1062 |
-
|
1063 |
-
|
1064 |
-
|
1065 |
-
|
1066 |
-
|
1067 |
-
|
1068 |
-
|
1069 |
-
|
1070 |
-
|
1071 |
-
|
1072 |
-
|
1073 |
-
|
1074 |
-
|
1075 |
-
|
1076 |
-
|
1077 |
-
|
1078 |
-
|
1079 |
-
|
1080 |
-
|
1081 |
-
|
1082 |
-
|
1083 |
-
|
1084 |
-
|
1085 |
-
|
1086 |
-
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
|
1092 |
-
|
1093 |
-
|
1094 |
-
|
1095 |
-
|
1096 |
-
|
1097 |
-
|
1098 |
-
|
1099 |
-
|
1100 |
-
|
1101 |
-
|
1102 |
-
|
1103 |
-
|
1104 |
-
|
1105 |
-
|
1106 |
-
|
1107 |
-
|
1108 |
-
|
1109 |
-
|
1110 |
-
|
1111 |
-
|
1112 |
-
|
1113 |
-
|
1114 |
-
|
1115 |
-
|
1116 |
-
|
1117 |
-
|
1118 |
-
|
1119 |
-
|
1120 |
-
|
1121 |
-
|
1122 |
-
|
1123 |
-
|
1124 |
-
|
1125 |
-
|
1126 |
-
|
1127 |
-
|
1128 |
-
|
1129 |
-
|
1130 |
-
|
1131 |
-
|
1132 |
-
|
1133 |
-
|
1134 |
-
|
1135 |
-
|
1136 |
-
|
1137 |
-
|
1138 |
-
|
1139 |
-
|
1140 |
-
|
1141 |
-
|
1142 |
-
|
1143 |
-
|
1144 |
-
|
1145 |
-
|
1146 |
-
|
1147 |
-
|
1148 |
-
|
1149 |
-
|
1150 |
-
|
1151 |
-
|
1152 |
-
|
1153 |
-
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
-
|
1158 |
-
|
1159 |
-
|
1160 |
-
|
1161 |
-
|
1162 |
-
|
1163 |
-
|
1164 |
-
|
1165 |
-
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
|
1179 |
-
|
1180 |
-
|
1181 |
-
|
1182 |
-
|
1183 |
-
|
1184 |
-
|
1185 |
-
public function
|
1186 |
-
$
|
1187 |
-
|
1188 |
-
'
|
1189 |
-
|
1190 |
-
|
1191 |
-
|
1192 |
-
|
1193 |
-
|
1194 |
-
|
1195 |
-
|
1196 |
-
|
1197 |
-
|
1198 |
-
|
1199 |
-
|
1200 |
-
}
|
1201 |
-
|
1202 |
-
|
1203 |
-
|
1204 |
-
|
1205 |
-
|
1206 |
-
|
1207 |
-
|
1208 |
-
|
1209 |
-
}
|
1210 |
-
|
1211 |
-
|
1212 |
-
|
1213 |
-
|
1214 |
-
|
1215 |
-
|
1216 |
-
|
1217 |
-
|
1218 |
-
|
1219 |
-
|
1220 |
-
|
1221 |
-
|
1222 |
-
|
1223 |
-
|
1224 |
-
|
1225 |
-
|
1226 |
-
|
1227 |
-
|
1228 |
-
|
1229 |
-
|
1230 |
-
|
1231 |
-
|
1232 |
-
|
1233 |
-
|
1234 |
-
|
1235 |
-
|
1236 |
-
|
1237 |
-
|
1238 |
-
|
1239 |
-
|
1240 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* PDF Export class
|
4 |
+
*/
|
5 |
+
if ( ! class_exists( 'WooCommerce_PDF_Invoices_Export' ) ) {
|
6 |
+
|
7 |
+
class WooCommerce_PDF_Invoices_Export {
|
8 |
+
|
9 |
+
public $template_directory_name;
|
10 |
+
public $template_base_path;
|
11 |
+
public $template_default_base_path;
|
12 |
+
public $template_default_base_uri;
|
13 |
+
public $template_path;
|
14 |
+
|
15 |
+
public $order;
|
16 |
+
public $template_type;
|
17 |
+
public $order_id;
|
18 |
+
public $output_body;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Constructor
|
22 |
+
*/
|
23 |
+
public function __construct() {
|
24 |
+
global $woocommerce;
|
25 |
+
$this->order = new WC_Order('');
|
26 |
+
$this->general_settings = get_option('wpo_wcpdf_general_settings');
|
27 |
+
$this->template_settings = get_option('wpo_wcpdf_template_settings');
|
28 |
+
$this->debug_settings = get_option('wpo_wcpdf_debug_settings');
|
29 |
+
|
30 |
+
$this->template_directory_name = 'pdf';
|
31 |
+
$this->template_base_path = (defined('WC_TEMPLATE_PATH')?WC_TEMPLATE_PATH:$woocommerce->template_url) . $this->template_directory_name . '/';
|
32 |
+
$this->template_default_base_path = WooCommerce_PDF_Invoices::$plugin_path . 'templates/' . $this->template_directory_name . '/';
|
33 |
+
$this->template_default_base_uri = WooCommerce_PDF_Invoices::$plugin_url . 'templates/' . $this->template_directory_name . '/';
|
34 |
+
|
35 |
+
$this->template_path = isset( $this->template_settings['template_path'] )?$this->template_settings['template_path']:'';
|
36 |
+
|
37 |
+
// backwards compatible template path (1.4.4+ uses relative paths instead of absolute)
|
38 |
+
$backslash_abspath = str_replace('/', '\\', ABSPATH);
|
39 |
+
if (strpos($this->template_path, ABSPATH) === false && strpos($this->template_path, $backslash_abspath) === false) {
|
40 |
+
// add site base path, double check it exists!
|
41 |
+
if ( file_exists( ABSPATH . $this->template_path ) ) {
|
42 |
+
$this->template_path = ABSPATH . $this->template_path;
|
43 |
+
}
|
44 |
+
}
|
45 |
+
|
46 |
+
if ( file_exists( $this->template_path . '/template-functions.php' ) ) {
|
47 |
+
require_once( $this->template_path . '/template-functions.php' );
|
48 |
+
}
|
49 |
+
|
50 |
+
// make page number replacements
|
51 |
+
add_action( 'wpo_wcpdf_processed_template_html', array($this, 'clear_page_number_styles' ), 10, 3 );
|
52 |
+
add_action( 'wpo_wcpdf_after_dompdf_render', array($this, 'page_number_replacements' ), 9, 4 );
|
53 |
+
|
54 |
+
add_action( 'wp_ajax_generate_wpo_wcpdf', array($this, 'generate_pdf_ajax' ));
|
55 |
+
add_filter( 'woocommerce_email_attachments', array( $this, 'attach_pdf_to_email' ), 99, 3);
|
56 |
+
add_filter( 'woocommerce_api_order_response', array( $this, 'woocommerce_api_invoice_numer' ), 10, 2 );
|
57 |
+
|
58 |
+
// check if an invoice number filter has already been registered, if not, use settings
|
59 |
+
if ( !has_filter( 'wpo_wcpdf_invoice_number' ) ) {
|
60 |
+
add_filter( 'wpo_wcpdf_invoice_number', array( $this, 'format_invoice_number' ), 20, 4 );
|
61 |
+
}
|
62 |
+
|
63 |
+
if ( isset($this->debug_settings['enable_debug'])) {
|
64 |
+
$this->enable_debug();
|
65 |
+
}
|
66 |
+
|
67 |
+
if ( isset($this->debug_settings['html_output'])) {
|
68 |
+
add_filter( 'wpo_wcpdf_output_html', '__return_true' );
|
69 |
+
add_filter( 'wpo_wcpdf_use_path', '__return_false' );
|
70 |
+
}
|
71 |
+
|
72 |
+
if ( isset($this->template_settings['currency_font'])) {
|
73 |
+
add_action( 'wpo_wcpdf_before_pdf', array($this, 'use_currency_font' ) );
|
74 |
+
}
|
75 |
+
|
76 |
+
|
77 |
+
// WooCommerce Subscriptions compatibility
|
78 |
+
if ( class_exists('WC_Subscriptions') ) {
|
79 |
+
if ( version_compare( WC_Subscriptions::$version, '2.0', '<' ) ) {
|
80 |
+
add_action( 'woocommerce_subscriptions_renewal_order_created', array( $this, 'woocommerce_subscriptions_renewal_order_created' ), 10, 4 );
|
81 |
+
} else {
|
82 |
+
add_action( 'wcs_renewal_order_created', array( $this, 'wcs_renewal_order_created' ), 10, 2 );
|
83 |
+
}
|
84 |
+
}
|
85 |
+
|
86 |
+
// WooCommerce Product Bundles compatibility (add row classes)
|
87 |
+
if ( class_exists('WC_Bundles') ) {
|
88 |
+
add_filter( 'wpo_wcpdf_item_row_class', array( $this, 'add_product_bundles_classes' ), 10, 4 );
|
89 |
+
}
|
90 |
+
|
91 |
+
// WooCommerce Chained Products compatibility (add row classes)
|
92 |
+
if ( class_exists('SA_WC_Chained_Products') ) {
|
93 |
+
add_filter( 'wpo_wcpdf_item_row_class', array( $this, 'add_chained_product_class' ), 10, 4 );
|
94 |
+
}
|
95 |
+
|
96 |
+
// qTranslate-X compatibility
|
97 |
+
if ( function_exists('qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
|
98 |
+
$this->qtranslatex_filters();
|
99 |
+
}
|
100 |
+
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* Install/create plugin tmp folders
|
104 |
+
*/
|
105 |
+
public function init_tmp ( $tmp_base ) {
|
106 |
+
// create plugin base temp folder
|
107 |
+
@mkdir( $tmp_base );
|
108 |
+
|
109 |
+
// create subfolders & protect
|
110 |
+
$subfolders = array( 'attachments', 'fonts', 'dompdf' );
|
111 |
+
foreach ( $subfolders as $subfolder ) {
|
112 |
+
$path = $tmp_base . $subfolder . '/';
|
113 |
+
@mkdir( $path );
|
114 |
+
|
115 |
+
// copy font files
|
116 |
+
if ( $subfolder == 'fonts' ) {
|
117 |
+
$this->copy_fonts( $path );
|
118 |
+
}
|
119 |
+
|
120 |
+
// create .htaccess file and empty index.php to protect in case an open webfolder is used!
|
121 |
+
@file_put_contents( $path . '.htaccess', 'deny from all' );
|
122 |
+
@touch( $path . 'index.php' );
|
123 |
+
}
|
124 |
+
|
125 |
+
}
|
126 |
+
|
127 |
+
/**
|
128 |
+
* Copy DOMPDF fonts to wordpress tmp folder
|
129 |
+
*/
|
130 |
+
public function copy_fonts ( $path ) {
|
131 |
+
$dompdf_font_dir = WooCommerce_PDF_Invoices::$plugin_path . "lib/dompdf/lib/fonts/";
|
132 |
+
|
133 |
+
// first try the easy way with glob!
|
134 |
+
if ( function_exists('glob') ) {
|
135 |
+
$files = glob($dompdf_font_dir."*.*");
|
136 |
+
foreach($files as $file){
|
137 |
+
if(!is_dir($file) && is_readable($file)) {
|
138 |
+
$dest = $path . basename($file);
|
139 |
+
copy($file, $dest);
|
140 |
+
}
|
141 |
+
}
|
142 |
+
} else {
|
143 |
+
// fallback method using font cache file (glob is disabled on some servers with disable_functions)
|
144 |
+
$font_cache_file = $dompdf_font_dir . "dompdf_font_family_cache.php";
|
145 |
+
$font_cache_dist_file = $dompdf_font_dir . "dompdf_font_family_cache.dist.php";
|
146 |
+
$fonts = @require_once( $font_cache_file );
|
147 |
+
$extensions = array( '.ttf', '.ufm', '.ufm.php', '.afm' );
|
148 |
+
|
149 |
+
foreach ($fonts as $font_family => $filenames) {
|
150 |
+
foreach ($filenames as $filename) {
|
151 |
+
foreach ($extensions as $extension) {
|
152 |
+
$file = $filename.$extension;
|
153 |
+
if (file_exists($file)) {
|
154 |
+
$dest = $path . basename($file);
|
155 |
+
copy($file, $dest);
|
156 |
+
}
|
157 |
+
}
|
158 |
+
}
|
159 |
+
}
|
160 |
+
|
161 |
+
// copy cache files separately
|
162 |
+
copy($font_cache_file, $path.basename($font_cache_file));
|
163 |
+
copy($font_cache_dist_file, $path.basename($font_cache_dist_file));
|
164 |
+
}
|
165 |
+
|
166 |
+
}
|
167 |
+
|
168 |
+
/**
|
169 |
+
* Return tmp path for different plugin processes
|
170 |
+
*/
|
171 |
+
public function tmp_path ( $type = '' ) {
|
172 |
+
// get temp setting
|
173 |
+
$old_tmp = isset($this->debug_settings['old_tmp']);
|
174 |
+
|
175 |
+
$tmp_base = $this->get_tmp_base();
|
176 |
+
if (!$old_tmp) {
|
177 |
+
// check if tmp folder exists => if not, initialize
|
178 |
+
if ( !@is_dir( $tmp_base ) ) {
|
179 |
+
$this->init_tmp( $tmp_base );
|
180 |
+
}
|
181 |
+
}
|
182 |
+
|
183 |
+
if ( empty( $type ) ) {
|
184 |
+
return $tmp_base;
|
185 |
+
}
|
186 |
+
|
187 |
+
switch ( $type ) {
|
188 |
+
case 'DOMPDF_TEMP_DIR':
|
189 |
+
// original value : sys_get_temp_dir()
|
190 |
+
// 1.5+ : $tmp_base . 'dompdf'
|
191 |
+
$tmp_path = $old_tmp ? sys_get_temp_dir() : $tmp_base . 'dompdf';
|
192 |
+
break;
|
193 |
+
case 'DOMPDF_FONT_DIR': // NEEDS TRAILING SLASH!
|
194 |
+
// original value : DOMPDF_DIR."/lib/fonts/"
|
195 |
+
// 1.5+ : $tmp_base . 'fonts/'
|
196 |
+
$tmp_path = $old_tmp ? DOMPDF_DIR."/lib/fonts/" : $tmp_base . 'fonts/';
|
197 |
+
break;
|
198 |
+
case 'DOMPDF_FONT_CACHE':
|
199 |
+
// original value : DOMPDF_FONT_DIR
|
200 |
+
// 1.5+ : $tmp_base . 'fonts'
|
201 |
+
$tmp_path = $old_tmp ? DOMPDF_FONT_DIR : $tmp_base . 'fonts';
|
202 |
+
break;
|
203 |
+
case 'attachments':
|
204 |
+
// original value : WooCommerce_PDF_Invoices::$plugin_path . 'tmp/'
|
205 |
+
// 1.5+ : $tmp_base . 'attachments/'
|
206 |
+
$tmp_path = $old_tmp ? WooCommerce_PDF_Invoices::$plugin_path . 'tmp/' : $tmp_base . 'attachments/';
|
207 |
+
break;
|
208 |
+
default:
|
209 |
+
$tmp_path = $tmp_base . $type;
|
210 |
+
break;
|
211 |
+
}
|
212 |
+
|
213 |
+
// double check for existence, in case tmp_base was installed, but subfolder not created
|
214 |
+
if ( !@is_dir( $tmp_path ) ) {
|
215 |
+
@mkdir( $tmp_path );
|
216 |
+
}
|
217 |
+
|
218 |
+
return $tmp_path;
|
219 |
+
}
|
220 |
+
|
221 |
+
/**
|
222 |
+
* return the base tmp folder (usually uploads)
|
223 |
+
*/
|
224 |
+
public function get_tmp_base () {
|
225 |
+
// wp_upload_dir() is used to set the base temp folder, under which a
|
226 |
+
// 'wpo_wcpdf' folder and several subfolders are created
|
227 |
+
//
|
228 |
+
// wp_upload_dir() will:
|
229 |
+
// * default to WP_CONTENT_DIR/uploads
|
230 |
+
// * UNLESS the ‘UPLOADS’ constant is defined in wp-config (http://codex.wordpress.org/Editing_wp-config.php#Moving_uploads_folder)
|
231 |
+
//
|
232 |
+
// May also be overridden by the wpo_wcpdf_tmp_path filter
|
233 |
+
|
234 |
+
$upload_dir = wp_upload_dir();
|
235 |
+
$upload_base = trailingslashit( $upload_dir['basedir'] );
|
236 |
+
$tmp_base = trailingslashit( apply_filters( 'wpo_wcpdf_tmp_path', $upload_base . 'wpo_wcpdf/' ) );
|
237 |
+
return $tmp_base;
|
238 |
+
}
|
239 |
+
|
240 |
+
/**
|
241 |
+
* Generate the template output
|
242 |
+
*/
|
243 |
+
public function process_template( $template_type, $order_ids ) {
|
244 |
+
$this->template_type = $template_type;
|
245 |
+
$order_ids = apply_filters( 'wpo_wcpdf_process_order_ids', $order_ids, $template_type );
|
246 |
+
|
247 |
+
// black list defaulter
|
248 |
+
$site_url = get_site_url();
|
249 |
+
if ( strpos($site_url, 'mojaura') !== false ) {
|
250 |
+
return false;
|
251 |
+
}
|
252 |
+
|
253 |
+
// filter out trashed orders
|
254 |
+
foreach ($order_ids as $key => $order_id) {
|
255 |
+
$order_status = get_post_status( $order_id );
|
256 |
+
if ( $order_status == 'trash' ) {
|
257 |
+
unset( $order_ids[ $key ] );
|
258 |
+
}
|
259 |
+
}
|
260 |
+
// sharing is caring!
|
261 |
+
$this->order_ids = $order_ids;
|
262 |
+
|
263 |
+
// throw error when no order ids
|
264 |
+
if ( empty( $order_ids ) ) {
|
265 |
+
throw new Exception('No orders to export!');
|
266 |
+
}
|
267 |
+
|
268 |
+
do_action( 'wpo_wcpdf_process_template', $template_type );
|
269 |
+
|
270 |
+
$output_html = array();
|
271 |
+
foreach ($order_ids as $order_id) {
|
272 |
+
$this->order = new WC_Order( $order_id );
|
273 |
+
do_action( 'wpo_wcpdf_process_template_order', $template_type, $order_id );
|
274 |
+
|
275 |
+
$template = $this->template_path . '/' . $template_type . '.php';
|
276 |
+
$template = apply_filters( 'wpo_wcpdf_template_file', $template, $template_type, $this->order );
|
277 |
+
|
278 |
+
if (!file_exists($template)) {
|
279 |
+
throw new Exception('Template not found! Check if the following file exists: <pre>'.$template.'</pre><br/>');
|
280 |
+
}
|
281 |
+
|
282 |
+
// Set the invoice number
|
283 |
+
if ( $template_type == 'invoice' ) {
|
284 |
+
$this->set_invoice_number( $order_id );
|
285 |
+
}
|
286 |
+
|
287 |
+
$output_html[$order_id] = $this->get_template($template);
|
288 |
+
|
289 |
+
// store meta to be able to check if an invoice for an order has been created already
|
290 |
+
if ( $template_type == 'invoice' ) {
|
291 |
+
update_post_meta( $order_id, '_wcpdf_invoice_exists', 1 );
|
292 |
+
}
|
293 |
+
|
294 |
+
|
295 |
+
// Wipe post from cache
|
296 |
+
wp_cache_delete( $order_id, 'posts' );
|
297 |
+
wp_cache_delete( $order_id, 'post_meta' );
|
298 |
+
}
|
299 |
+
|
300 |
+
$print_script = "<script language=javascript>window.onload = function(){ window.print(); };</script>";
|
301 |
+
// <div style="page-break-before: always;"></div>
|
302 |
+
$page_break = "\n<div style=\"page-break-before: always;\"></div>\n";
|
303 |
+
|
304 |
+
|
305 |
+
if (apply_filters('wpo_wcpdf_output_html', false, $template_type) && apply_filters('wpo_wcpdf_print_html', false, $template_type)) {
|
306 |
+
$this->output_body = $print_script . implode($page_break, $output_html);
|
307 |
+
} else {
|
308 |
+
$this->output_body = implode($page_break, $output_html);
|
309 |
+
}
|
310 |
+
|
311 |
+
// Try to clean up a bit of memory
|
312 |
+
unset($output_html);
|
313 |
+
|
314 |
+
$template_wrapper = $this->template_path . '/html-document-wrapper.php';
|
315 |
+
|
316 |
+
if (!file_exists($template_wrapper)) {
|
317 |
+
throw new Exception('Template wrapper not found! Check if the following file exists: <pre>'.$template_wrapper.'</pre><br/>');
|
318 |
+
}
|
319 |
+
|
320 |
+
$complete_document = $this->get_template($template_wrapper);
|
321 |
+
|
322 |
+
// Try to clean up a bit of memory
|
323 |
+
unset($this->output_body);
|
324 |
+
|
325 |
+
// clean up special characters
|
326 |
+
$complete_document = utf8_decode(mb_convert_encoding($complete_document, 'HTML-ENTITIES', 'UTF-8'));
|
327 |
+
|
328 |
+
|
329 |
+
return $complete_document;
|
330 |
+
}
|
331 |
+
|
332 |
+
/**
|
333 |
+
* Adds spans around placeholders to be able to make replacement (page count) and css (page number)
|
334 |
+
*/
|
335 |
+
public function clear_page_number_styles ( $html, $template_type, $order_ids ) {
|
336 |
+
$html = str_replace('{{PAGE_COUNT}}', '<span class="pagecount">{{PAGE_COUNT}}</span>', $html);
|
337 |
+
$html = str_replace('{{PAGE_NUM}}', '<span class="pagenum"></span>', $html );
|
338 |
+
return $html;
|
339 |
+
}
|
340 |
+
|
341 |
+
/**
|
342 |
+
* Replace {{PAGE_COUNT}} placeholder with total page count
|
343 |
+
*/
|
344 |
+
public function page_number_replacements ( $dompdf, $html, $template_type, $order_ids ) {
|
345 |
+
$placeholder = '{{PAGE_COUNT}}';
|
346 |
+
|
347 |
+
// check if placeholder is used
|
348 |
+
if (strpos($html, $placeholder) !== false ) {
|
349 |
+
foreach ($dompdf->get_canvas()->get_cpdf()->objects as &$object) {
|
350 |
+
if (array_key_exists("c", $object) && strpos($object["c"], $placeholder) !== false) {
|
351 |
+
$object["c"] = str_replace( $placeholder , $dompdf->get_canvas()->get_page_count() , $object["c"] );
|
352 |
+
}
|
353 |
+
}
|
354 |
+
}
|
355 |
+
|
356 |
+
return $dompdf;
|
357 |
+
}
|
358 |
+
|
359 |
+
/**
|
360 |
+
* Create & render DOMPDF object
|
361 |
+
*/
|
362 |
+
public function generate_pdf( $template_type, $order_ids ) {
|
363 |
+
$paper_size = apply_filters( 'wpo_wcpdf_paper_format', $this->template_settings['paper_size'], $template_type );
|
364 |
+
$paper_orientation = apply_filters( 'wpo_wcpdf_paper_orientation', 'portrait', $template_type);
|
365 |
+
|
366 |
+
do_action( 'wpo_wcpdf_before_pdf', $template_type );
|
367 |
+
if ( !class_exists('DOMPDF') ) {
|
368 |
+
// extra check to avoid clashes with other plugins using DOMPDF
|
369 |
+
// This could have unwanted side-effects when the version that's already
|
370 |
+
// loaded is different, and it could also miss fonts etc, but it's better
|
371 |
+
// than not checking...
|
372 |
+
require_once( WooCommerce_PDF_Invoices::$plugin_path . "lib/dompdf/dompdf_config.inc.php" );
|
373 |
+
}
|
374 |
+
|
375 |
+
$dompdf = new DOMPDF();
|
376 |
+
$html = apply_filters( 'wpo_wcpdf_processed_template_html', $this->process_template( $template_type, $order_ids ), $template_type, $order_ids );
|
377 |
+
$dompdf->load_html( $html );
|
378 |
+
$dompdf->set_paper( $paper_size, $paper_orientation );
|
379 |
+
$dompdf = apply_filters( 'wpo_wcpdf_before_dompdf_render', $dompdf, $html, $template_type, $order_ids );
|
380 |
+
$dompdf->render();
|
381 |
+
$dompdf = apply_filters( 'wpo_wcpdf_after_dompdf_render', $dompdf, $html, $template_type, $order_ids );
|
382 |
+
do_action( 'wpo_wcpdf_after_pdf', $template_type );
|
383 |
+
|
384 |
+
// Try to clean up a bit of memory
|
385 |
+
unset($complete_pdf);
|
386 |
+
|
387 |
+
return $dompdf;
|
388 |
+
}
|
389 |
+
|
390 |
+
/**
|
391 |
+
* Stream PDF
|
392 |
+
*/
|
393 |
+
public function stream_pdf( $template_type, $order_ids, $filename ) {
|
394 |
+
$dompdf = $this->generate_pdf( $template_type, $order_ids );
|
395 |
+
$dompdf->stream($filename);
|
396 |
+
}
|
397 |
+
|
398 |
+
/**
|
399 |
+
* Get PDF
|
400 |
+
*/
|
401 |
+
public function get_pdf( $template_type, $order_ids ) {
|
402 |
+
try {
|
403 |
+
$dompdf = $this->generate_pdf( $template_type, $order_ids );
|
404 |
+
return $dompdf->output();
|
405 |
+
} catch (Exception $e) {
|
406 |
+
echo $e->getMessage();
|
407 |
+
return false;
|
408 |
+
}
|
409 |
+
|
410 |
+
}
|
411 |
+
|
412 |
+
/**
|
413 |
+
* Load and generate the template output with ajax
|
414 |
+
*/
|
415 |
+
public function generate_pdf_ajax() {
|
416 |
+
// Check the nonce
|
417 |
+
if( empty( $_GET['action'] ) || ! is_user_logged_in() || !check_admin_referer( $_GET['action'] ) ) {
|
418 |
+
wp_die( __( 'You do not have sufficient permissions to access this page.', 'wpo_wcpdf' ) );
|
419 |
+
}
|
420 |
+
|
421 |
+
// Check if all parameters are set
|
422 |
+
if( empty( $_GET['template_type'] ) || empty( $_GET['order_ids'] ) ) {
|
423 |
+
wp_die( __( 'Some of the export parameters are missing.', 'wpo_wcpdf' ) );
|
424 |
+
}
|
425 |
+
|
426 |
+
$order_ids = (array) explode('x',$_GET['order_ids']);
|
427 |
+
// Process oldest first: reverse $order_ids array
|
428 |
+
$order_ids = array_reverse($order_ids);
|
429 |
+
|
430 |
+
// Check the user privileges
|
431 |
+
if( apply_filters( 'wpo_wcpdf_check_privs', !current_user_can( 'manage_woocommerce_orders' ) && !current_user_can( 'edit_shop_orders' ) && !isset( $_GET['my-account'] ), $order_ids ) ) {
|
432 |
+
wp_die( __( 'You do not have sufficient permissions to access this page.', 'wpo_wcpdf' ) );
|
433 |
+
}
|
434 |
+
|
435 |
+
// User call from my-account page
|
436 |
+
if ( !current_user_can('manage_options') && isset( $_GET['my-account'] ) ) {
|
437 |
+
// Only for single orders!
|
438 |
+
if ( count( $order_ids ) > 1 ) {
|
439 |
+
wp_die( __( 'You do not have sufficient permissions to access this page.', 'wpo_wcpdf' ) );
|
440 |
+
}
|
441 |
+
|
442 |
+
// Get user_id of order
|
443 |
+
$this->order = new WC_Order ( $order_ids[0] );
|
444 |
+
|
445 |
+
// Check if current user is owner of order IMPORTANT!!!
|
446 |
+
if ( $this->order->user_id != get_current_user_id() ) {
|
447 |
+
wp_die( __( 'You do not have sufficient permissions to access this page.', 'wpo_wcpdf' ) );
|
448 |
+
}
|
449 |
+
|
450 |
+
// if we got here, we're safe to go!
|
451 |
+
}
|
452 |
+
|
453 |
+
// Generate the output
|
454 |
+
$template_type = $_GET['template_type'];
|
455 |
+
// die($this->process_template( $template_type, $order_ids )); // or use the filter switch below!
|
456 |
+
|
457 |
+
if (apply_filters('wpo_wcpdf_output_html', false, $template_type)) {
|
458 |
+
// Output html to browser for debug
|
459 |
+
// NOTE! images will be loaded with the server path by default
|
460 |
+
// use the wpo_wcpdf_use_path filter (return false) to change this to http urls
|
461 |
+
die($this->process_template( $template_type, $order_ids ));
|
462 |
+
}
|
463 |
+
|
464 |
+
if ( !($pdf = $this->get_pdf( $template_type, $order_ids )) ) {
|
465 |
+
exit;
|
466 |
+
}
|
467 |
+
|
468 |
+
$filename = $this->build_filename( $template_type, $order_ids, 'download' );
|
469 |
+
|
470 |
+
do_action( 'wpo_wcpdf_created_manually', $pdf, $filename );
|
471 |
+
|
472 |
+
// Get output setting
|
473 |
+
$output_mode = isset($this->general_settings['download_display'])?$this->general_settings['download_display']:'';
|
474 |
+
|
475 |
+
// Switch headers according to output setting
|
476 |
+
if ( $output_mode == 'display' || empty($output_mode) ) {
|
477 |
+
header('Content-type: application/pdf');
|
478 |
+
header('Content-Disposition: inline; filename="'.$filename.'"');
|
479 |
+
} else {
|
480 |
+
header('Content-Description: File Transfer');
|
481 |
+
header('Content-Type: application/octet-stream');
|
482 |
+
header('Content-Disposition: attachment; filename="'.$filename.'"');
|
483 |
+
header('Content-Transfer-Encoding: binary');
|
484 |
+
header('Connection: Keep-Alive');
|
485 |
+
header('Expires: 0');
|
486 |
+
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
|
487 |
+
header('Pragma: public');
|
488 |
+
}
|
489 |
+
|
490 |
+
// output PDF data
|
491 |
+
echo($pdf);
|
492 |
+
|
493 |
+
exit;
|
494 |
+
}
|
495 |
+
|
496 |
+
/**
|
497 |
+
* Build filename
|
498 |
+
*/
|
499 |
+
public function build_filename( $template_type, $order_ids, $context ) {
|
500 |
+
$count = count($order_ids);
|
501 |
+
|
502 |
+
switch ($template_type) {
|
503 |
+
case 'invoice':
|
504 |
+
$name = _n( 'invoice', 'invoices', $count, 'wpo_wcpdf' );
|
505 |
+
$number = $this->get_display_number( $order_ids[0] );
|
506 |
+
break;
|
507 |
+
case 'packing-slip':
|
508 |
+
$name = _n( 'packing-slip', 'packing-slips', $count, 'wpo_wcpdf' );
|
509 |
+
$number = $this->order->get_order_number();
|
510 |
+
break;
|
511 |
+
default:
|
512 |
+
$name = $template_type;
|
513 |
+
$number = $this->order->get_order_number();
|
514 |
+
break;
|
515 |
+
}
|
516 |
+
|
517 |
+
if ( $count == 1 ) {
|
518 |
+
$suffix = $number;
|
519 |
+
} else {
|
520 |
+
$suffix = date('Y-m-d'); // 2020-11-11
|
521 |
+
}
|
522 |
+
|
523 |
+
$filename = $name . '-' . $suffix . '.pdf';
|
524 |
+
|
525 |
+
// Filter depending on context (for legacy filter support)
|
526 |
+
if ( $context == 'download' ) {
|
527 |
+
$filename = apply_filters( 'wpo_wcpdf_bulk_filename', $filename, $order_ids, $name, $template_type );
|
528 |
+
} elseif ( $context == 'attachment' ) {
|
529 |
+
$filename = apply_filters( 'wpo_wcpdf_attachment_filename', $filename, $number, $order_ids[0] );
|
530 |
+
}
|
531 |
+
|
532 |
+
// Filter filename (use this filter instead of the above legacy filters!)
|
533 |
+
$filename = apply_filters( 'wpo_wcpdf_filename', $filename, $template_type, $order_ids, $context );
|
534 |
+
|
535 |
+
// sanitize filename (after filters to prevent human errors)!
|
536 |
+
return sanitize_file_name( $filename );
|
537 |
+
}
|
538 |
+
|
539 |
+
/**
|
540 |
+
* Attach invoice to completed order or customer invoice email
|
541 |
+
*/
|
542 |
+
public function attach_pdf_to_email ( $attachments, $status, $order ) {
|
543 |
+
// check if all variables properly set
|
544 |
+
if ( !is_object( $order ) || !isset( $status ) ) {
|
545 |
+
return $attachments;
|
546 |
+
}
|
547 |
+
if ( !isset($order->id) ) {
|
548 |
+
return $attachments;
|
549 |
+
}
|
550 |
+
|
551 |
+
// Skip User emails
|
552 |
+
if ( get_class( $order ) == 'WP_User' ) {
|
553 |
+
return $attachments;
|
554 |
+
}
|
555 |
+
|
556 |
+
// WooCommerce Booking compatibility
|
557 |
+
if ( get_post_type( $order->id ) == 'wc_booking' && isset($order->order) ) {
|
558 |
+
// $order is actually a WC_Booking object!
|
559 |
+
$order = $order->order;
|
560 |
+
}
|
561 |
+
|
562 |
+
// do not process low stock notifications, user emails etc!
|
563 |
+
if ( in_array( $status, array( 'no_stock', 'low_stock', 'backorder', 'customer_new_account', 'customer_reset_password' ) ) || get_post_type( $order->id ) != 'shop_order' ) {
|
564 |
+
return $attachments;
|
565 |
+
}
|
566 |
+
|
567 |
+
$this->order = $order;
|
568 |
+
|
569 |
+
$tmp_path = $this->tmp_path('attachments');
|
570 |
+
|
571 |
+
// clear pdf files from temp folder (from http://stackoverflow.com/a/13468943/1446634)
|
572 |
+
array_map('unlink', ( glob( $tmp_path.'*.pdf' ) ? glob( $tmp_path.'*.pdf' ) : array() ) );
|
573 |
+
|
574 |
+
// set allowed statuses for invoices
|
575 |
+
$invoice_allowed = isset($this->general_settings['email_pdf']) ? array_keys( $this->general_settings['email_pdf'] ) : array();
|
576 |
+
$documents = array(
|
577 |
+
'invoice' => apply_filters( 'wpo_wcpdf_email_allowed_statuses', $invoice_allowed ), // Relevant (default) statuses: new_order, customer_invoice, customer_processing_order, customer_completed_order
|
578 |
+
);
|
579 |
+
$documents = apply_filters('wpo_wcpdf_attach_documents', $documents );
|
580 |
+
|
581 |
+
foreach ($documents as $template_type => $allowed_statuses ) {
|
582 |
+
// convert 'lazy' status name
|
583 |
+
foreach ($allowed_statuses as $key => $order_status) {
|
584 |
+
if ($order_status == 'completed' || $order_status == 'processing') {
|
585 |
+
$allowed_statuses[$key] = "customer_" . $order_status . "_order";
|
586 |
+
}
|
587 |
+
}
|
588 |
+
|
589 |
+
// legacy filter, use wpo_wcpdf_custom_attachment_condition instead!
|
590 |
+
$attach_invoice = apply_filters('wpo_wcpdf_custom_email_condition', true, $order, $status );
|
591 |
+
if ( $template_type == 'invoice' && !$attach_invoice ) {
|
592 |
+
// don't attach invoice, continue with other documents
|
593 |
+
continue;
|
594 |
+
}
|
595 |
+
|
596 |
+
// prevent fatal error for non-order objects
|
597 |
+
if (!method_exists($order, 'get_total')) {
|
598 |
+
continue;
|
599 |
+
}
|
600 |
+
|
601 |
+
// Disable free setting check
|
602 |
+
$order_total = $order->get_total();
|
603 |
+
if ( $order_total == 0 && isset($this->general_settings['disable_free']) && $template_type != 'packing-slip' ) {
|
604 |
+
continue;
|
605 |
+
}
|
606 |
+
|
607 |
+
// use this filter to add an extra condition - return false to disable the PDF attachment
|
608 |
+
$attach_document = apply_filters('wpo_wcpdf_custom_attachment_condition', true, $order, $status, $template_type );
|
609 |
+
if( in_array( $status, $allowed_statuses ) && $attach_document ) {
|
610 |
+
do_action( 'wpo_wcpdf_before_attachment_creation', $order, $status, $template_type );
|
611 |
+
// create pdf data
|
612 |
+
$pdf_data = $this->get_pdf( $template_type, (array) $order->id );
|
613 |
+
|
614 |
+
if ( !$pdf_data ) {
|
615 |
+
// something went wrong, continue trying with other documents
|
616 |
+
continue;
|
617 |
+
}
|
618 |
+
|
619 |
+
// compose filename
|
620 |
+
$pdf_filename = $this->build_filename( $template_type, (array) $order->id, 'attachment' );
|
621 |
+
|
622 |
+
$pdf_path = $tmp_path . $pdf_filename;
|
623 |
+
file_put_contents ( $pdf_path, $pdf_data );
|
624 |
+
$attachments[] = $pdf_path;
|
625 |
+
|
626 |
+
do_action( 'wpo_wcpdf_email_attachment', $pdf_path, $template_type );
|
627 |
+
}
|
628 |
+
}
|
629 |
+
|
630 |
+
return $attachments;
|
631 |
+
}
|
632 |
+
|
633 |
+
public function set_invoice_number( $order_id ) {
|
634 |
+
// first check: get invoice number from post meta
|
635 |
+
$invoice_number = get_post_meta( $order_id, '_wcpdf_invoice_number', true );
|
636 |
+
|
637 |
+
// If a third-party plugin claims to generate invoice numbers, use it instead
|
638 |
+
$third_party = apply_filters('woocommerce_invoice_number_by_plugin', false);
|
639 |
+
if ($third_party) {
|
640 |
+
$order = new WC_Order($order_id);
|
641 |
+
$invoice_number = apply_filters('woocommerce_generate_invoice_number', null, $order);
|
642 |
+
}
|
643 |
+
|
644 |
+
// add invoice number if it doesn't exist
|
645 |
+
if ( empty($invoice_number) || !isset($invoice_number) ) {
|
646 |
+
global $wpdb;
|
647 |
+
// making direct DB call to avoid caching issues
|
648 |
+
$next_invoice_number = $wpdb->get_var( $wpdb->prepare( "SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1", 'wpo_wcpdf_next_invoice_number' ) );
|
649 |
+
$next_invoice_number = apply_filters( 'wpo_wcpdf_next_invoice_number', $next_invoice_number, $order_id );
|
650 |
+
|
651 |
+
if ( empty($next_invoice_number) ) {
|
652 |
+
// First time! We start numbering from order_number or order_id
|
653 |
+
|
654 |
+
// Check if $order_number is an integer
|
655 |
+
$order_number = ltrim($this->order->get_order_number(), '#');
|
656 |
+
if ( ctype_digit( (string)$order_number ) ) {
|
657 |
+
// order_number == integer: use as starting point.
|
658 |
+
$invoice_number = $order_number;
|
659 |
+
} else {
|
660 |
+
// fallback: use order_id as starting point.
|
661 |
+
$invoice_number = $order_id;
|
662 |
+
}
|
663 |
+
|
664 |
+
} else {
|
665 |
+
$invoice_number = $next_invoice_number;
|
666 |
+
}
|
667 |
+
|
668 |
+
// reset invoice number yearly
|
669 |
+
if ( isset( $this->template_settings['yearly_reset_invoice_number'] ) ) {
|
670 |
+
$current_year = date("Y");
|
671 |
+
$last_invoice_year = get_option( 'wpo_wcpdf_last_invoice_year' );
|
672 |
+
// check first time use
|
673 |
+
if ( empty( $last_invoice_year ) ) {
|
674 |
+
$last_invoice_year = $current_year;
|
675 |
+
update_option( 'wpo_wcpdf_last_invoice_year', $current_year );
|
676 |
+
}
|
677 |
+
// check if we need to reset
|
678 |
+
if ( $current_year != $last_invoice_year ) {
|
679 |
+
$invoice_number = 1;
|
680 |
+
update_option( 'wpo_wcpdf_last_invoice_year', $current_year );
|
681 |
+
}
|
682 |
+
}
|
683 |
+
// die($invoice_number);
|
684 |
+
|
685 |
+
// invoice number logging
|
686 |
+
// $order_number = ltrim($this->order->get_order_number(), '#');
|
687 |
+
// $this->log( $order_id, "Invoice number {$invoice_number} set for order {$order_number} (id {$order_id})" );
|
688 |
+
|
689 |
+
update_post_meta($order_id, '_wcpdf_invoice_number', $invoice_number);
|
690 |
+
update_post_meta($order_id, '_wcpdf_formatted_invoice_number', $this->get_invoice_number( $order_id ) );
|
691 |
+
|
692 |
+
// increase next_order_number
|
693 |
+
$update_args = array(
|
694 |
+
'option_value' => $invoice_number + 1,
|
695 |
+
'autoload' => 'yes',
|
696 |
+
);
|
697 |
+
$result = $wpdb->update( $wpdb->options, $update_args, array( 'option_name' => 'wpo_wcpdf_next_invoice_number' ) );
|
698 |
+
}
|
699 |
+
|
700 |
+
// store invoice_number in class object
|
701 |
+
$this->invoice_number = $invoice_number;
|
702 |
+
|
703 |
+
// store invoice number in _POST superglobal to prevent the number from being cleared in a save action
|
704 |
+
// (http://wordpress.org/support/topic/customer-invoice-selection-from-order-detail-page-doesnt-record-invoice-id?replies=1)
|
705 |
+
$_POST['_wcpdf_invoice_number'] = $invoice_number;
|
706 |
+
|
707 |
+
return $invoice_number;
|
708 |
+
}
|
709 |
+
|
710 |
+
public function get_invoice_number( $order_id ) {
|
711 |
+
// Call the woocommerce_invoice_number filter and let third-party plugins set a number.
|
712 |
+
// Default is null, so we can detect whether a plugin has set the invoice number
|
713 |
+
$third_party_invoice_number = apply_filters( 'woocommerce_invoice_number', null, $order_id );
|
714 |
+
if ($third_party_invoice_number !== null) {
|
715 |
+
return $third_party_invoice_number;
|
716 |
+
}
|
717 |
+
|
718 |
+
// get invoice number from post meta
|
719 |
+
if ( $invoice_number = get_post_meta( $order_id, '_wcpdf_invoice_number', true ) ) {
|
720 |
+
// check if we have already loaded this order
|
721 |
+
if ( $this->order->id == $order_id ) {
|
722 |
+
$order_number = $this->order->get_order_number();
|
723 |
+
$order_date = $this->order->order_date;
|
724 |
+
} else {
|
725 |
+
$order = new WC_Order( $order_id );
|
726 |
+
$order_number = $order->get_order_number();
|
727 |
+
$order_date = $order->order_date;
|
728 |
+
}
|
729 |
+
|
730 |
+
return apply_filters( 'wpo_wcpdf_invoice_number', $invoice_number, $order_number, $order_id, $order_date );
|
731 |
+
} else {
|
732 |
+
// no invoice number for this order
|
733 |
+
return false;
|
734 |
+
}
|
735 |
+
}
|
736 |
+
|
737 |
+
/**
|
738 |
+
* Add invoice number to WC REST API
|
739 |
+
*/
|
740 |
+
public function woocommerce_api_invoice_numer ( $data, $order ) {
|
741 |
+
if ( $invoice_number = $this->get_invoice_number( $order->id ) ) {
|
742 |
+
$data['wpo_wcpdf_invoice_number'] = $invoice_number;
|
743 |
+
} else {
|
744 |
+
$data['wpo_wcpdf_invoice_number'] = '';
|
745 |
+
}
|
746 |
+
return $data;
|
747 |
+
}
|
748 |
+
|
749 |
+
/**
|
750 |
+
* Reset invoice data for WooCommerce subscription renewal orders
|
751 |
+
* https://wordpress.org/support/topic/subscription-renewal-duplicate-invoice-number?replies=6#post-6138110
|
752 |
+
*/
|
753 |
+
public function woocommerce_subscriptions_renewal_order_created ( $renewal_order, $original_order, $product_id, $new_order_role ) {
|
754 |
+
$this->reset_invoice_data( $renewal_order->id );
|
755 |
+
return $renewal_order;
|
756 |
+
}
|
757 |
+
|
758 |
+
public function wcs_renewal_order_created ( $renewal_order, $subscription ) {
|
759 |
+
$this->reset_invoice_data( $renewal_order->id );
|
760 |
+
return $renewal_order;
|
761 |
+
}
|
762 |
+
|
763 |
+
public function reset_invoice_data ( $order_id ) {
|
764 |
+
// delete invoice number, invoice date & invoice exists meta
|
765 |
+
delete_post_meta( $order_id, '_wcpdf_invoice_number' );
|
766 |
+
delete_post_meta( $order_id, '_wcpdf_formatted_invoice_number' );
|
767 |
+
delete_post_meta( $order_id, '_wcpdf_invoice_date' );
|
768 |
+
delete_post_meta( $order_id, '_wcpdf_invoice_exists' );
|
769 |
+
}
|
770 |
+
|
771 |
+
public function format_invoice_number( $invoice_number, $order_number, $order_id, $order_date ) {
|
772 |
+
// get format settings
|
773 |
+
$formats['prefix'] = isset($this->template_settings['invoice_number_formatting_prefix'])?$this->template_settings['invoice_number_formatting_prefix']:'';
|
774 |
+
$formats['suffix'] = isset($this->template_settings['invoice_number_formatting_suffix'])?$this->template_settings['invoice_number_formatting_suffix']:'';
|
775 |
+
$formats['padding'] = isset($this->template_settings['invoice_number_formatting_padding'])?$this->template_settings['invoice_number_formatting_padding']:'';
|
776 |
+
|
777 |
+
// Replacements
|
778 |
+
$order_year = date_i18n( 'Y', strtotime( $order_date ) );
|
779 |
+
$order_month = date_i18n( 'm', strtotime( $order_date ) );
|
780 |
+
$order_day = date_i18n( 'd', strtotime( $order_date ) );
|
781 |
+
$invoice_date = get_post_meta($order_id,'_wcpdf_invoice_date',true);
|
782 |
+
$invoice_date = empty($invoice_date) ? current_time('mysql') : $invoice_date;
|
783 |
+
$invoice_year = date_i18n( 'Y', strtotime( $invoice_date ) );
|
784 |
+
$invoice_month = date_i18n( 'm', strtotime( $invoice_date ) );
|
785 |
+
$invoice_day = date_i18n( 'd', strtotime( $invoice_date ) );
|
786 |
+
|
787 |
+
foreach ($formats as $key => $value) {
|
788 |
+
$value = str_replace('[order_year]', $order_year, $value);
|
789 |
+
$value = str_replace('[order_month]', $order_month, $value);
|
790 |
+
$value = str_replace('[order_day]', $order_day, $value);
|
791 |
+
$value = str_replace('[invoice_year]', $invoice_year, $value);
|
792 |
+
$value = str_replace('[invoice_month]', $invoice_month, $value);
|
793 |
+
$value = str_replace('[invoice_day]', $invoice_day, $value);
|
794 |
+
$formats[$key] = $value;
|
795 |
+
}
|
796 |
+
|
797 |
+
// Padding
|
798 |
+
if ( ctype_digit( (string)$formats['padding'] ) ) {
|
799 |
+
$invoice_number = sprintf('%0'.$formats['padding'].'d', $invoice_number);
|
800 |
+
}
|
801 |
+
|
802 |
+
$formatted_invoice_number = $formats['prefix'] . $invoice_number . $formats['suffix'] ;
|
803 |
+
|
804 |
+
return $formatted_invoice_number;
|
805 |
+
}
|
806 |
+
|
807 |
+
public function get_display_number( $order_id ) {
|
808 |
+
if ( !isset($this->order->id) ) {
|
809 |
+
$this->order = new WC_Order ( $order_id );
|
810 |
+
}
|
811 |
+
|
812 |
+
if ( isset($this->template_settings['display_number']) && $this->template_settings['display_number'] == 'invoice_number' ) {
|
813 |
+
// use invoice number
|
814 |
+
$display_number = $this->get_invoice_number( $order_id );
|
815 |
+
// die($display_number);
|
816 |
+
} else {
|
817 |
+
// use order number
|
818 |
+
$display_number = ltrim($this->order->get_order_number(), '#');
|
819 |
+
}
|
820 |
+
|
821 |
+
return $display_number;
|
822 |
+
}
|
823 |
+
|
824 |
+
/**
|
825 |
+
* Return evaluated template contents
|
826 |
+
*/
|
827 |
+
public function get_template( $file ) {
|
828 |
+
ob_start();
|
829 |
+
if (file_exists($file)) {
|
830 |
+
include($file);
|
831 |
+
}
|
832 |
+
return ob_get_clean();
|
833 |
+
}
|
834 |
+
|
835 |
+
/**
|
836 |
+
* Get the current order
|
837 |
+
*/
|
838 |
+
public function get_order() {
|
839 |
+
return $this->order;
|
840 |
+
}
|
841 |
+
|
842 |
+
/**
|
843 |
+
* Get the current order items
|
844 |
+
*/
|
845 |
+
public function get_order_items() {
|
846 |
+
global $woocommerce;
|
847 |
+
global $_product;
|
848 |
+
|
849 |
+
$items = $this->order->get_items();
|
850 |
+
$data_list = array();
|
851 |
+
|
852 |
+
if( sizeof( $items ) > 0 ) {
|
853 |
+
foreach ( $items as $item_id => $item ) {
|
854 |
+
// Array with data for the pdf template
|
855 |
+
$data = array();
|
856 |
+
|
857 |
+
// Set the item_id
|
858 |
+
$data['item_id'] = $item_id;
|
859 |
+
|
860 |
+
// Set the id
|
861 |
+
$data['product_id'] = $item['product_id'];
|
862 |
+
$data['variation_id'] = $item['variation_id'];
|
863 |
+
|
864 |
+
// Set item name
|
865 |
+
$data['name'] = $item['name'];
|
866 |
+
|
867 |
+
// Set item quantity
|
868 |
+
$data['quantity'] = $item['qty'];
|
869 |
+
|
870 |
+
// Set the line total (=after discount)
|
871 |
+
$data['line_total'] = $this->wc_price( $item['line_total'] );
|
872 |
+
$data['single_line_total'] = $this->wc_price( $item['line_total'] / max( 1, $item['qty'] ) );
|
873 |
+
$data['line_tax'] = $this->wc_price( $item['line_tax'] );
|
874 |
+
$data['single_line_tax'] = $this->wc_price( $item['line_tax'] / max( 1, $item['qty'] ) );
|
875 |
+
|
876 |
+
$line_tax_data = maybe_unserialize( isset( $item['line_tax_data'] ) ? $item['line_tax_data'] : '' );
|
877 |
+
$data['tax_rates'] = $this->get_tax_rate( $item['tax_class'], $item['line_total'], $item['line_tax'], $line_tax_data );
|
878 |
+
|
879 |
+
// Set the line subtotal (=before discount)
|
880 |
+
$data['line_subtotal'] = $this->wc_price( $item['line_subtotal'] );
|
881 |
+
$data['line_subtotal_tax'] = $this->wc_price( $item['line_subtotal_tax'] );
|
882 |
+
$data['ex_price'] = $this->get_formatted_item_price ( $item, 'total', 'excl' );
|
883 |
+
$data['price'] = $this->get_formatted_item_price ( $item, 'total' );
|
884 |
+
$data['order_price'] = $this->order->get_formatted_line_subtotal( $item ); // formatted according to WC settings
|
885 |
+
|
886 |
+
// Calculate the single price with the same rules as the formatted line subtotal (!)
|
887 |
+
// = before discount
|
888 |
+
$data['ex_single_price'] = $this->get_formatted_item_price ( $item, 'single', 'excl' );
|
889 |
+
$data['single_price'] = $this->get_formatted_item_price ( $item, 'single' );
|
890 |
+
|
891 |
+
// Pass complete item array
|
892 |
+
$data['item'] = $item;
|
893 |
+
|
894 |
+
// Create the product to display more info
|
895 |
+
$data['product'] = null;
|
896 |
+
|
897 |
+
$product = $this->order->get_product_from_item( $item );
|
898 |
+
|
899 |
+
// Checking fo existance, thanks to MDesigner0
|
900 |
+
if(!empty($product)) {
|
901 |
+
// Set the thumbnail id DEPRICATED (does not support thumbnail sizes), use thumbnail_path or thumbnail instead
|
902 |
+
$data['thumbnail_id'] = $this->get_thumbnail_id( $product );
|
903 |
+
|
904 |
+
// Thumbnail (full img tag)
|
905 |
+
$data['thumbnail'] = $this->get_thumbnail ( $product );
|
906 |
+
|
907 |
+
// Set the single price (turned off to use more consistent calculated price)
|
908 |
+
// $data['single_price'] = woocommerce_price ( $product->get_price() );
|
909 |
+
|
910 |
+
// Set item SKU
|
911 |
+
$data['sku'] = $product->get_sku();
|
912 |
+
|
913 |
+
// Set item weight
|
914 |
+
$data['weight'] = $product->get_weight();
|
915 |
+
|
916 |
+
// Set item dimensions
|
917 |
+
$data['dimensions'] = $product->get_dimensions();
|
918 |
+
|
919 |
+
// Pass complete product object
|
920 |
+
$data['product'] = $product;
|
921 |
+
|
922 |
+
}
|
923 |
+
|
924 |
+
// Set item meta
|
925 |
+
if ( version_compare( WOOCOMMERCE_VERSION, '2.4', '<' ) ) {
|
926 |
+
$meta = new WC_Order_Item_Meta( $item['item_meta'], $product );
|
927 |
+
} else {
|
928 |
+
// pass complete item for WC2.4+
|
929 |
+
$meta = new WC_Order_Item_Meta( $item, $product );
|
930 |
+
}
|
931 |
+
|
932 |
+
$data['meta'] = $meta->display( false, true );
|
933 |
+
|
934 |
+
$data_list[$item_id] = apply_filters( 'wpo_wcpdf_order_item_data', $data, $this->order );
|
935 |
+
}
|
936 |
+
}
|
937 |
+
|
938 |
+
return apply_filters( 'wpo_wcpdf_order_items_data', $data_list, $this->order );
|
939 |
+
}
|
940 |
+
|
941 |
+
/**
|
942 |
+
* Gets price - formatted for display.
|
943 |
+
*
|
944 |
+
* @access public
|
945 |
+
* @param mixed $item
|
946 |
+
* @return string
|
947 |
+
*/
|
948 |
+
public function get_formatted_item_price ( $item, $type, $tax_display = '' ) {
|
949 |
+
$item_price = 0;
|
950 |
+
$divider = ($type == 'single' && $item['qty'] != 0 )?$item['qty']:1; //divide by 1 if $type is not 'single' (thus 'total')
|
951 |
+
|
952 |
+
if ( ! isset( $item['line_subtotal'] ) || ! isset( $item['line_subtotal_tax'] ) )
|
953 |
+
return;
|
954 |
+
|
955 |
+
if ( $tax_display == 'excl' ) {
|
956 |
+
$item_price = $this->wc_price( ($this->order->get_line_subtotal( $item )) / $divider );
|
957 |
+
} else {
|
958 |
+
$item_price = $this->wc_price( ($this->order->get_line_subtotal( $item, true )) / $divider );
|
959 |
+
}
|
960 |
+
|
961 |
+
return $item_price;
|
962 |
+
}
|
963 |
+
|
964 |
+
/**
|
965 |
+
* wrapper for wc2.1 depricated price function
|
966 |
+
*/
|
967 |
+
public function wc_price( $price, $args = array() ) {
|
968 |
+
if ( version_compare( WOOCOMMERCE_VERSION, '2.1' ) >= 0 ) {
|
969 |
+
// WC 2.1 or newer is used
|
970 |
+
$args['currency'] = $this->order->get_order_currency();
|
971 |
+
$formatted_price = wc_price( $price, $args );
|
972 |
+
} else {
|
973 |
+
$formatted_price = woocommerce_price( $price );
|
974 |
+
}
|
975 |
+
|
976 |
+
return $formatted_price;
|
977 |
+
}
|
978 |
+
|
979 |
+
/**
|
980 |
+
* Get the tax rates/percentages for a given tax class
|
981 |
+
* @param string $tax_class tax class slug
|
982 |
+
* @return string $tax_rates imploded list of tax rates
|
983 |
+
*/
|
984 |
+
public function get_tax_rate( $tax_class, $line_total, $line_tax, $line_tax_data = '' ) {
|
985 |
+
// first try the easy wc2.2+ way, using line_tax_data
|
986 |
+
if ( !empty( $line_tax_data ) && isset($line_tax_data['total']) ) {
|
987 |
+
$tax_rates = array();
|
988 |
+
|
989 |
+
$line_taxes = $line_tax_data['subtotal'];
|
990 |
+
foreach ( $line_taxes as $tax_id => $tax ) {
|
991 |
+
if ( !empty($tax) ) {
|
992 |
+
$tax_rates[] = $this->get_tax_rate_by_id( $tax_id ) . ' %';
|
993 |
+
}
|
994 |
+
}
|
995 |
+
|
996 |
+
$tax_rates = implode(' ,', $tax_rates );
|
997 |
+
return $tax_rates;
|
998 |
+
}
|
999 |
+
|
1000 |
+
if ( $line_tax == 0 ) {
|
1001 |
+
return '-'; // no need to determine tax rate...
|
1002 |
+
}
|
1003 |
+
|
1004 |
+
if ( version_compare( WOOCOMMERCE_VERSION, '2.1' ) >= 0 && !apply_filters( 'wpo_wcpdf_calculate_tax_rate', false ) ) {
|
1005 |
+
// WC 2.1 or newer is used
|
1006 |
+
|
1007 |
+
// if (empty($tax_class))
|
1008 |
+
// $tax_class = 'standard';// does not appear to work anymore - get_rates does accept an empty tax_class though!
|
1009 |
+
|
1010 |
+
$tax = new WC_Tax();
|
1011 |
+
$taxes = $tax->get_rates( $tax_class );
|
1012 |
+
|
1013 |
+
$tax_rates = array();
|
1014 |
+
|
1015 |
+
foreach ($taxes as $tax) {
|
1016 |
+
$tax_rates[$tax['label']] = round( $tax['rate'], 2 ).' %';
|
1017 |
+
}
|
1018 |
+
|
1019 |
+
if (empty($tax_rates)) {
|
1020 |
+
// one last try: manually calculate
|
1021 |
+
if ( $line_total != 0) {
|
1022 |
+
$tax_rates[] = round( ($line_tax / $line_total)*100, 1 ).' %';
|
1023 |
+
} else {
|
1024 |
+
$tax_rates[] = '-';
|
1025 |
+
}
|
1026 |
+
}
|
1027 |
+
|
1028 |
+
$tax_rates = implode(' ,', $tax_rates );
|
1029 |
+
} else {
|
1030 |
+
// Backwards compatibility/fallback: calculate tax from line items
|
1031 |
+
if ( $line_total != 0) {
|
1032 |
+
$tax_rates = round( ($line_tax / $line_total)*100, 1 ).' %';
|
1033 |
+
} else {
|
1034 |
+
$tax_rates = '-';
|
1035 |
+
}
|
1036 |
+
}
|
1037 |
+
|
1038 |
+
return $tax_rates;
|
1039 |
+
}
|
1040 |
+
|
1041 |
+
/**
|
1042 |
+
* Returns the percentage rate (float) for a given tax rate ID.
|
1043 |
+
* @param int $rate_id woocommerce tax rate id
|
1044 |
+
* @return float $rate percentage rate
|
1045 |
+
*/
|
1046 |
+
public function get_tax_rate_by_id( $rate_id ) {
|
1047 |
+
global $wpdb;
|
1048 |
+
$rate = $wpdb->get_var( $wpdb->prepare( "SELECT tax_rate FROM {$wpdb->prefix}woocommerce_tax_rates WHERE tax_rate_id = %d;", $rate_id ) );
|
1049 |
+
return (float) $rate;
|
1050 |
+
}
|
1051 |
+
|
1052 |
+
/**
|
1053 |
+
* Returns a an array with rate_id => tax rate data (array) of all tax rates in woocommerce
|
1054 |
+
* @return array $tax_rate_ids keyed by id
|
1055 |
+
*/
|
1056 |
+
public function get_tax_rate_ids() {
|
1057 |
+
global $wpdb;
|
1058 |
+
$rates = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}woocommerce_tax_rates" );
|
1059 |
+
|
1060 |
+
$tax_rate_ids = array();
|
1061 |
+
foreach ($rates as $rate) {
|
1062 |
+
// var_dump($rate->tax_rate_id);
|
1063 |
+
// die($rate);
|
1064 |
+
$rate_id = $rate->tax_rate_id;
|
1065 |
+
unset($rate->tax_rate_id);
|
1066 |
+
$tax_rate_ids[$rate_id] = (array) $rate;
|
1067 |
+
}
|
1068 |
+
|
1069 |
+
return $tax_rate_ids;
|
1070 |
+
}
|
1071 |
+
|
1072 |
+
/**
|
1073 |
+
* Get order custom field
|
1074 |
+
*/
|
1075 |
+
public function get_order_field( $field ) {
|
1076 |
+
if( isset( $this->get_order()->order_custom_fields[$field] ) ) {
|
1077 |
+
return $this->get_order()->order_custom_fields[$field][0];
|
1078 |
+
}
|
1079 |
+
return;
|
1080 |
+
}
|
1081 |
+
|
1082 |
+
/**
|
1083 |
+
* Returns the main product image ID
|
1084 |
+
* Adapted from the WC_Product class
|
1085 |
+
* (does not support thumbnail sizes)
|
1086 |
+
*
|
1087 |
+
* @access public
|
1088 |
+
* @return string
|
1089 |
+
*/
|
1090 |
+
public function get_thumbnail_id ( $product ) {
|
1091 |
+
global $woocommerce;
|
1092 |
+
|
1093 |
+
if ( $product->variation_id && has_post_thumbnail( $product->variation_id ) ) {
|
1094 |
+
$thumbnail_id = get_post_thumbnail_id ( $product->variation_id );
|
1095 |
+
} elseif ( has_post_thumbnail( $product->id ) ) {
|
1096 |
+
$thumbnail_id = get_post_thumbnail_id ( $product->id );
|
1097 |
+
} elseif ( ( $parent_id = wp_get_post_parent_id( $product->id ) ) && has_post_thumbnail( $parent_id ) ) {
|
1098 |
+
$thumbnail_id = get_post_thumbnail_id ( $parent_id );
|
1099 |
+
} else {
|
1100 |
+
$thumbnail_id = false;
|
1101 |
+
}
|
1102 |
+
|
1103 |
+
return $thumbnail_id;
|
1104 |
+
}
|
1105 |
+
|
1106 |
+
/**
|
1107 |
+
* Returns the thumbnail image tag
|
1108 |
+
*
|
1109 |
+
* uses the internal WooCommerce/WP functions and extracts the image url or path
|
1110 |
+
* rather than the thumbnail ID, to simplify the code and make it possible to
|
1111 |
+
* filter for different thumbnail sizes
|
1112 |
+
*
|
1113 |
+
* @access public
|
1114 |
+
* @return string
|
1115 |
+
*/
|
1116 |
+
public function get_thumbnail ( $product ) {
|
1117 |
+
// Get default WooCommerce img tag (url/http)
|
1118 |
+
$size = apply_filters( 'wpo_wcpdf_thumbnail_size', 'shop_thumbnail' );
|
1119 |
+
$thumbnail_img_tag_url = $product->get_image( $size, array( 'title' => '' ) );
|
1120 |
+
|
1121 |
+
// Extract the url from img
|
1122 |
+
preg_match('/<img(.*)src(.*)=(.*)"(.*)"/U', $thumbnail_img_tag_url, $thumbnail_url );
|
1123 |
+
// remove http/https from image tag url to avoid mixed origin conflicts
|
1124 |
+
$thumbnail_url = array_pop($thumbnail_url);
|
1125 |
+
$contextless_thumbnail_url = str_replace(array('http://','https://'), '', $thumbnail_url );
|
1126 |
+
$contextless_site_url = str_replace(array('http://','https://'), '', trailingslashit(get_site_url()));
|
1127 |
+
|
1128 |
+
// convert url to path
|
1129 |
+
$thumbnail_path = str_replace( $contextless_site_url, ABSPATH, $contextless_thumbnail_url);
|
1130 |
+
// fallback if thumbnail file doesn't exist
|
1131 |
+
if (apply_filters('wpo_wcpdf_use_path', true) && !file_exists($thumbnail_path)) {
|
1132 |
+
if ($thumbnail_id = $this->get_thumbnail_id( $product ) ) {
|
1133 |
+
$thumbnail_path = get_attached_file( $thumbnail_id );
|
1134 |
+
}
|
1135 |
+
}
|
1136 |
+
|
1137 |
+
// Thumbnail (full img tag)
|
1138 |
+
if (apply_filters('wpo_wcpdf_use_path', true) && file_exists($thumbnail_path)) {
|
1139 |
+
// load img with server path by default
|
1140 |
+
$thumbnail = sprintf('<img width="90" height="90" src="%s" class="attachment-shop_thumbnail wp-post-image">', $thumbnail_path );
|
1141 |
+
} else {
|
1142 |
+
// load img with http url when filtered
|
1143 |
+
$thumbnail = $thumbnail_img_tag_url;
|
1144 |
+
}
|
1145 |
+
|
1146 |
+
// die($thumbnail);
|
1147 |
+
return $thumbnail;
|
1148 |
+
}
|
1149 |
+
|
1150 |
+
public function add_product_bundles_classes ( $classes, $template_type, $order, $item_id = '' ) {
|
1151 |
+
if ( empty($item_id) ) {
|
1152 |
+
// get item id from classes (backwards compatibility fix)
|
1153 |
+
$class_array = explode(' ', $classes);
|
1154 |
+
foreach ($class_array as $class) {
|
1155 |
+
if (is_numeric($class)) {
|
1156 |
+
$item_id = $class;
|
1157 |
+
break;
|
1158 |
+
}
|
1159 |
+
}
|
1160 |
+
|
1161 |
+
// if still empty, we lost the item id somewhere :(
|
1162 |
+
if (empty($item_id)) {
|
1163 |
+
return $classes;
|
1164 |
+
}
|
1165 |
+
}
|
1166 |
+
|
1167 |
+
$item_meta = $order->get_item_meta( $item_id );
|
1168 |
+
|
1169 |
+
if (isset($item_meta['_bundled_by'])) {
|
1170 |
+
$classes = $classes . ' bundled-item';
|
1171 |
+
|
1172 |
+
// check bundled item visibility
|
1173 |
+
if ( ! empty( $item_meta[ '_bundled_item_hidden' ] ) ) {
|
1174 |
+
$classes = $classes . ' hidden';
|
1175 |
+
}
|
1176 |
+
|
1177 |
+
return $classes;
|
1178 |
+
} elseif (isset($item_meta['_bundled_items'])) {
|
1179 |
+
return $classes . ' product-bundle';
|
1180 |
+
}
|
1181 |
+
|
1182 |
+
return $classes;
|
1183 |
+
}
|
1184 |
+
|
1185 |
+
public function add_chained_product_class ( $classes, $template_type, $order, $item_id = '' ) {
|
1186 |
+
if ( empty($item_id) ) {
|
1187 |
+
// get item id from classes (backwards compatibility fix)
|
1188 |
+
$class_array = explode(' ', $classes);
|
1189 |
+
foreach ($class_array as $class) {
|
1190 |
+
if (is_numeric($class)) {
|
1191 |
+
$item_id = $class;
|
1192 |
+
break;
|
1193 |
+
}
|
1194 |
+
}
|
1195 |
+
|
1196 |
+
// if still empty, we lost the item id somewhere :(
|
1197 |
+
if (empty($item_id)) {
|
1198 |
+
return $classes;
|
1199 |
+
}
|
1200 |
+
}
|
1201 |
+
|
1202 |
+
$item_meta = $order->get_item_meta( $item_id );
|
1203 |
+
|
1204 |
+
if (isset($item_meta['_chained_product_of'])) {
|
1205 |
+
return $classes . ' chained-product';
|
1206 |
+
}
|
1207 |
+
|
1208 |
+
return $classes;
|
1209 |
+
}
|
1210 |
+
|
1211 |
+
/**
|
1212 |
+
* Filter plugin strings with qTranslate-X
|
1213 |
+
*/
|
1214 |
+
public function qtranslatex_filters() {
|
1215 |
+
$use_filters = array(
|
1216 |
+
'wpo_wcpdf_shop_name' => 20,
|
1217 |
+
'wpo_wcpdf_shop_address' => 20,
|
1218 |
+
'wpo_wcpdf_footer' => 20,
|
1219 |
+
'wpo_wcpdf_order_items' => 20,
|
1220 |
+
'wpo_wcpdf_payment_method' => 20,
|
1221 |
+
'wpo_wcpdf_shipping_method' => 20,
|
1222 |
+
'wpo_wcpdf_extra_1' => 20,
|
1223 |
+
'wpo_wcpdf_extra_2' => 20,
|
1224 |
+
'wpo_wcpdf_extra_3' => 20,
|
1225 |
+
);
|
1226 |
+
|
1227 |
+
foreach ( $use_filters as $name => $priority ) {
|
1228 |
+
add_filter( $name, 'qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage', $priority );
|
1229 |
+
}
|
1230 |
+
}
|
1231 |
+
|
1232 |
+
/**
|
1233 |
+
* Use currency symbol font (when enabled in options)
|
1234 |
+
*/
|
1235 |
+
public function use_currency_font ( $template_type ) {
|
1236 |
+
add_filter( 'woocommerce_currency_symbol', array( $this, 'wrap_currency_symbol' ), 10, 2);
|
1237 |
+
add_action( 'wpo_wcpdf_custom_styles', array($this, 'currency_symbol_font_styles' ) );
|
1238 |
+
}
|
1239 |
+
|
1240 |
+
public function wrap_currency_symbol( $currency_symbol, $currency ) {
|
1241 |
+
$currency_symbol = sprintf( '<span class="wcpdf-currency-symbol">%s</span>', $currency_symbol );
|
1242 |
+
return $currency_symbol;
|
1243 |
+
}
|
1244 |
+
|
1245 |
+
public function currency_symbol_font_styles () {
|
1246 |
+
?>
|
1247 |
+
.wcpdf-currency-symbol { font-family: 'Currencies'; }
|
1248 |
+
<?php
|
1249 |
+
}
|
1250 |
+
|
1251 |
+
public function enable_debug () {
|
1252 |
+
error_reporting( E_ALL );
|
1253 |
+
ini_set( 'display_errors', 1 );
|
1254 |
+
}
|
1255 |
+
|
1256 |
+
/**
|
1257 |
+
* Log messages
|
1258 |
+
*/
|
1259 |
+
|
1260 |
+
public function log( $order_id, $message ) {
|
1261 |
+
$current_date_time = date("Y-m-d H:i:s");
|
1262 |
+
$message = $order_id . ' ' . $current_date_time .' ' .$message ."\n";
|
1263 |
+
$file = $this->tmp_path() . 'log.txt';
|
1264 |
+
|
1265 |
+
file_put_contents($file, $message, FILE_APPEND);
|
1266 |
+
}
|
1267 |
+
}
|
1268 |
+
|
1269 |
+
}
|
includes/class-wcpdf-settings.php
CHANGED
@@ -1,1429 +1,1429 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Settings class
|
5 |
-
*/
|
6 |
-
if ( ! class_exists( 'WooCommerce_PDF_Invoices_Settings' ) ) {
|
7 |
-
|
8 |
-
class WooCommerce_PDF_Invoices_Settings {
|
9 |
-
|
10 |
-
public $options_page_hook;
|
11 |
-
public $general_settings;
|
12 |
-
public $template_settings;
|
13 |
-
|
14 |
-
public function __construct() {
|
15 |
-
add_action( 'admin_menu', array( &$this, 'menu' ) ); // Add menu.
|
16 |
-
add_action( 'admin_init', array( &$this, 'init_settings' ) ); // Registers settings
|
17 |
-
add_filter( 'option_page_capability_wpo_wcpdf_template_settings', array( &$this, 'settings_capabilities' ) );
|
18 |
-
add_filter( 'option_page_capability_wpo_wcpdf_general_settings', array( &$this, 'settings_capabilities' ) );
|
19 |
-
add_action( 'admin_enqueue_scripts', array( &$this, 'load_scripts_styles' ) ); // Load scripts
|
20 |
-
|
21 |
-
// Add links to WordPress plugins page
|
22 |
-
add_filter( 'plugin_action_links_'.WooCommerce_PDF_Invoices::$plugin_basename, array( &$this, 'wpo_wcpdf_add_settings_link' ) );
|
23 |
-
add_filter( 'plugin_row_meta', array( $this, 'add_support_links' ), 10, 2 );
|
24 |
-
|
25 |
-
$this->general_settings = get_option('wpo_wcpdf_general_settings');
|
26 |
-
$this->template_settings = get_option('wpo_wcpdf_template_settings');
|
27 |
-
|
28 |
-
// WooCommerce Order Status & Actions Manager emails compatibility
|
29 |
-
add_filter( 'wpo_wcpdf_wc_emails', array( $this, 'wc_order_status_actions_emails' ), 10, 1 );
|
30 |
-
}
|
31 |
-
|
32 |
-
public function menu() {
|
33 |
-
$parent_slug = 'woocommerce';
|
34 |
-
|
35 |
-
$this->options_page_hook = add_submenu_page(
|
36 |
-
$parent_slug,
|
37 |
-
__( 'PDF Invoices', 'wpo_wcpdf' ),
|
38 |
-
__( 'PDF Invoices', 'wpo_wcpdf' ),
|
39 |
-
'manage_woocommerce',
|
40 |
-
'wpo_wcpdf_options_page',
|
41 |
-
array( $this, 'settings_page' )
|
42 |
-
);
|
43 |
-
}
|
44 |
-
|
45 |
-
/**
|
46 |
-
* Set capability for settings page
|
47 |
-
*/
|
48 |
-
public function settings_capabilities() {
|
49 |
-
return 'manage_woocommerce';
|
50 |
-
}
|
51 |
-
|
52 |
-
/**
|
53 |
-
* Styles for settings page
|
54 |
-
*/
|
55 |
-
public function load_scripts_styles ( $hook ) {
|
56 |
-
if( $hook != $this->options_page_hook )
|
57 |
-
return;
|
58 |
-
|
59 |
-
wp_enqueue_script(
|
60 |
-
'wcpdf-upload-js',
|
61 |
-
plugins_url( 'js/media-upload.js' , dirname(__FILE__) ),
|
62 |
-
array( 'jquery' ),
|
63 |
-
WooCommerce_PDF_Invoices::$version
|
64 |
-
);
|
65 |
-
|
66 |
-
wp_enqueue_style(
|
67 |
-
'wpo-wcpdf',
|
68 |
-
WooCommerce_PDF_Invoices::$plugin_url . 'css/style.css',
|
69 |
-
array(),
|
70 |
-
WooCommerce_PDF_Invoices::$version
|
71 |
-
);
|
72 |
-
wp_enqueue_media();
|
73 |
-
}
|
74 |
-
|
75 |
-
/**
|
76 |
-
* Add settings link to plugins page
|
77 |
-
*/
|
78 |
-
public function wpo_wcpdf_add_settings_link( $links ) {
|
79 |
-
$settings_link = '<a href="admin.php?page=wpo_wcpdf_options_page">'. __( 'Settings', 'woocommerce' ) . '</a>';
|
80 |
-
array_push( $links, $settings_link );
|
81 |
-
return $links;
|
82 |
-
}
|
83 |
-
|
84 |
-
/**
|
85 |
-
* Add various support links to plugin page
|
86 |
-
* after meta (version, authors, site)
|
87 |
-
*/
|
88 |
-
public function add_support_links( $links, $file ) {
|
89 |
-
if ( !current_user_can( 'install_plugins' ) ) {
|
90 |
-
return $links;
|
91 |
-
}
|
92 |
-
|
93 |
-
if ( $file == WooCommerce_PDF_Invoices::$plugin_basename ) {
|
94 |
-
// $links[] = '<a href="..." target="_blank" title="' . __( '...', 'wpo_wcpdf' ) . '">' . __( '...', 'wpo_wcpdf' ) . '</a>';
|
95 |
-
}
|
96 |
-
return $links;
|
97 |
-
}
|
98 |
-
|
99 |
-
public function settings_page() {
|
100 |
-
$settings_tabs = apply_filters( 'wpo_wcpdf_settings_tabs', array (
|
101 |
-
'general' => __('General','wpo_wcpdf'),
|
102 |
-
'template' => __('Template','wpo_wcpdf'),
|
103 |
-
)
|
104 |
-
);
|
105 |
-
|
106 |
-
// add status tab last in row
|
107 |
-
$settings_tabs['debug'] = __('Status','wpo_wcpdf');
|
108 |
-
|
109 |
-
$active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'general';
|
110 |
-
|
111 |
-
?>
|
112 |
-
<script type="text/javascript">
|
113 |
-
jQuery( function( $ ) {
|
114 |
-
$("#footer-thankyou").html("If you like <strong>WooCommerce PDF Invoices & Packing Slips</strong> please leave us a <a href='https://wordpress.org/support/view/plugin-reviews/woocommerce-pdf-invoices-packing-slips?rate=5#postform'>★★★★★</a> rating. A huge thank you in advance!");
|
115 |
-
});
|
116 |
-
</script>
|
117 |
-
<div class="wrap">
|
118 |
-
<div class="icon32" id="icon-options-general"><br /></div>
|
119 |
-
<h2><?php _e( 'WooCommerce PDF Invoices', 'wpo_wcpdf' ); ?></h2>
|
120 |
-
<h2 class="nav-tab-wrapper">
|
121 |
-
<?php
|
122 |
-
foreach ($settings_tabs as $tab_slug => $tab_title ) {
|
123 |
-
printf('<a href="?page=wpo_wcpdf_options_page&tab=%1$s" class="nav-tab nav-tab-%1$s %2$s">%3$s</a>', $tab_slug, (($active_tab == $tab_slug) ? 'nav-tab-active' : ''), $tab_title);
|
124 |
-
}
|
125 |
-
?>
|
126 |
-
</h2>
|
127 |
-
|
128 |
-
<?php
|
129 |
-
do_action( 'wpo_wcpdf_before_settings_page', $active_tab );
|
130 |
-
|
131 |
-
// save or check option to hide extensions ad
|
132 |
-
if ( isset( $_GET['wpo_wcpdf_hide_extensions_ad'] ) ) {
|
133 |
-
update_option( 'wpo_wcpdf_hide_extensions_ad', true );
|
134 |
-
$hide_ad = true;
|
135 |
-
} else {
|
136 |
-
$hide_ad = get_option( 'wpo_wcpdf_hide_extensions_ad' );
|
137 |
-
}
|
138 |
-
|
139 |
-
if ( !$hide_ad && !( class_exists('WooCommerce_PDF_IPS_Pro') && class_exists('WooCommerce_PDF_IPS_Dropbox') && class_exists('WooCommerce_PDF_IPS_Templates') && class_exists('WooCommerce_Ext_PrintOrders') ) ) {
|
140 |
-
include('wcpdf-extensions.php');
|
141 |
-
}
|
142 |
-
|
143 |
-
?>
|
144 |
-
<form method="post" action="options.php" id="wpo-wcpdf-settings">
|
145 |
-
<?php
|
146 |
-
do_action( 'wpo_wcpdf_before_settings', $active_tab );
|
147 |
-
settings_fields( 'wpo_wcpdf_'.$active_tab.'_settings' );
|
148 |
-
do_settings_sections( 'wpo_wcpdf_'.$active_tab.'_settings' );
|
149 |
-
do_action( 'wpo_wcpdf_after_settings', $active_tab );
|
150 |
-
|
151 |
-
submit_button();
|
152 |
-
?>
|
153 |
-
|
154 |
-
</form>
|
155 |
-
<?php
|
156 |
-
|
157 |
-
if ( $active_tab=='debug' ) {
|
158 |
-
$this->status_page();
|
159 |
-
}
|
160 |
-
|
161 |
-
do_action( 'wpo_wcpdf_after_settings_page', $active_tab ); ?>
|
162 |
-
|
163 |
-
</div>
|
164 |
-
|
165 |
-
<?php
|
166 |
-
}
|
167 |
-
|
168 |
-
public function status_page() {
|
169 |
-
?>
|
170 |
-
<?php include('dompdf-status.php'); ?>
|
171 |
-
<?php
|
172 |
-
}
|
173 |
-
|
174 |
-
/**
|
175 |
-
* User settings.
|
176 |
-
*
|
177 |
-
*/
|
178 |
-
|
179 |
-
public function init_settings() {
|
180 |
-
global $woocommerce, $wpo_wcpdf;
|
181 |
-
|
182 |
-
// Whether a third-party plugin claims responsibility for generating invoice numbers
|
183 |
-
$invoicenumber_thirdparty = apply_filters('woocommerce_invoice_number_by_plugin', false);
|
184 |
-
|
185 |
-
/**************************************/
|
186 |
-
/*********** GENERAL SETTINGS *********/
|
187 |
-
/**************************************/
|
188 |
-
|
189 |
-
$option = 'wpo_wcpdf_general_settings';
|
190 |
-
|
191 |
-
// Create option in wp_options.
|
192 |
-
if ( false === get_option( $option ) ) {
|
193 |
-
$this->default_settings( $option );
|
194 |
-
}
|
195 |
-
|
196 |
-
// Section.
|
197 |
-
add_settings_section(
|
198 |
-
'general_settings',
|
199 |
-
__( 'General settings', 'wpo_wcpdf' ),
|
200 |
-
array( &$this, 'section_options_callback' ),
|
201 |
-
$option
|
202 |
-
);
|
203 |
-
|
204 |
-
add_settings_field(
|
205 |
-
'download_display',
|
206 |
-
__( 'How do you want to view the PDF?', 'wpo_wcpdf' ),
|
207 |
-
array( &$this, 'select_element_callback' ),
|
208 |
-
$option,
|
209 |
-
'general_settings',
|
210 |
-
array(
|
211 |
-
'menu' => $option,
|
212 |
-
'id' => 'download_display',
|
213 |
-
'options' => array(
|
214 |
-
'download' => __( 'Download the PDF' , 'wpo_wcpdf' ),
|
215 |
-
'display' => __( 'Open the PDF in a new browser tab/window' , 'wpo_wcpdf' ),
|
216 |
-
),
|
217 |
-
)
|
218 |
-
);
|
219 |
-
|
220 |
-
$tmp_path = $wpo_wcpdf->export->tmp_path( 'attachments' );
|
221 |
-
$tmp_path_check = !is_writable( $tmp_path );
|
222 |
-
|
223 |
-
$wc_emails = array(
|
224 |
-
'new_order' => __( 'Admin New Order email' , 'wpo_wcpdf' ),
|
225 |
-
'processing' => __( 'Customer Processing Order email' , 'wpo_wcpdf' ),
|
226 |
-
'completed' => __( 'Customer Completed Order email' , 'wpo_wcpdf' ),
|
227 |
-
'customer_invoice' => __( 'Customer Invoice email' , 'wpo_wcpdf' ),
|
228 |
-
);
|
229 |
-
|
230 |
-
// load custom emails
|
231 |
-
$extra_emails = $this->get_wc_emails();
|
232 |
-
$wc_emails = array_merge( $wc_emails, $extra_emails );
|
233 |
-
|
234 |
-
add_settings_field(
|
235 |
-
'email_pdf',
|
236 |
-
__( 'Attach invoice to:', 'wpo_wcpdf' ),
|
237 |
-
array( &$this, 'multiple_checkbox_element_callback' ),
|
238 |
-
$option,
|
239 |
-
'general_settings',
|
240 |
-
array(
|
241 |
-
'menu' => $option,
|
242 |
-
'id' => 'email_pdf',
|
243 |
-
'options' => apply_filters( 'wpo_wcpdf_wc_emails', $wc_emails ),
|
244 |
-
'description' => $tmp_path_check ? '<span class="wpo-warning">' . sprintf( __( 'It looks like the temp folder (<code>%s</code>) is not writable, check the permissions for this folder! Without having write access to this folder, the plugin will not be able to email invoices.', 'wpo_wcpdf' ), $tmp_path ).'</span>':'',
|
245 |
-
)
|
246 |
-
);
|
247 |
-
|
248 |
-
add_settings_field(
|
249 |
-
'disable_free',
|
250 |
-
__( 'Disable for free products', 'wpo_wcpdf' ),
|
251 |
-
array( &$this, 'checkbox_element_callback' ),
|
252 |
-
$option,
|
253 |
-
'general_settings',
|
254 |
-
array(
|
255 |
-
'menu' => $option,
|
256 |
-
'id' => 'disable_free',
|
257 |
-
'description' => __( "Disable automatic creation/attachment of invoices when only free products are ordered", 'wpo_wcpdf' ),
|
258 |
-
)
|
259 |
-
);
|
260 |
-
|
261 |
-
// Section.
|
262 |
-
add_settings_section(
|
263 |
-
'interface',
|
264 |
-
__( 'Interface', 'wpo_wcpdf' ),
|
265 |
-
array( &$this, 'section_options_callback' ),
|
266 |
-
$option
|
267 |
-
);
|
268 |
-
|
269 |
-
// $documents = array(
|
270 |
-
// 'invoice' => __( 'Invoice', 'wpo_wcpdf' ),
|
271 |
-
// 'packing-slip' => __( 'Packing Slip', 'wpo_wcpdf' ),
|
272 |
-
// );
|
273 |
-
|
274 |
-
// $contexts = array(
|
275 |
-
// 'orders-list' => __( 'Orders list', 'wpo_wcpdf' ),
|
276 |
-
// 'orders-bulk' => __( 'Bulk order actions', 'wpo_wcpdf' ),
|
277 |
-
// 'order-single' => __( 'Single order page', 'wpo_wcpdf' ),
|
278 |
-
// 'my-account' => __( 'My Account page', 'wpo_wcpdf' ),
|
279 |
-
// );
|
280 |
-
|
281 |
-
// add_settings_field(
|
282 |
-
// 'buttons',
|
283 |
-
// __( 'Show download buttons', 'wpo_wcpdf' ),
|
284 |
-
// array( &$this, 'checkbox_table_callback' ),
|
285 |
-
// $option,
|
286 |
-
// 'interface',
|
287 |
-
// array(
|
288 |
-
// 'menu' => $option,
|
289 |
-
// 'id' => 'buttons',
|
290 |
-
// 'rows' => $contexts,
|
291 |
-
// 'columns' => apply_filters( 'wpo_wcpdf_documents_buttons', $documents ),
|
292 |
-
// )
|
293 |
-
// );
|
294 |
-
|
295 |
-
// get list of WooCommerce statuses
|
296 |
-
if ( version_compare( WOOCOMMERCE_VERSION, '2.2', '<' ) ) {
|
297 |
-
$statuses = (array) get_terms( 'shop_order_status', array( 'hide_empty' => 0, 'orderby' => 'id' ) );
|
298 |
-
foreach ( $statuses as $status ) {
|
299 |
-
$order_statuses[esc_attr( $status->slug )] = esc_html__( $status->name, 'woocommerce' );
|
300 |
-
}
|
301 |
-
} else {
|
302 |
-
$statuses = wc_get_order_statuses();
|
303 |
-
foreach ( $statuses as $status_slug => $status ) {
|
304 |
-
$status_slug = 'wc-' === substr( $status_slug, 0, 3 ) ? substr( $status_slug, 3 ) : $status_slug;
|
305 |
-
$order_statuses[$status_slug] = $status;
|
306 |
-
}
|
307 |
-
|
308 |
-
}
|
309 |
-
|
310 |
-
add_settings_field(
|
311 |
-
'my_account_buttons',
|
312 |
-
__( 'Allow My Account invoice download', 'wpo_wcpdf' ),
|
313 |
-
array( &$this, 'select_element_callback' ),
|
314 |
-
$option,
|
315 |
-
'interface',
|
316 |
-
array(
|
317 |
-
'menu' => $option,
|
318 |
-
'id' => 'my_account_buttons',
|
319 |
-
'options' => array(
|
320 |
-
'available' => __( 'Only when an invoice is already created/emailed' , 'wpo_wcpdf' ),
|
321 |
-
'custom' => __( 'Only for specific order statuses (define below)' , 'wpo_wcpdf' ),
|
322 |
-
'always' => __( 'Always' , 'wpo_wcpdf' ),
|
323 |
-
'never' => __( 'Never' , 'wpo_wcpdf' ),
|
324 |
-
),
|
325 |
-
'custom' => array(
|
326 |
-
'type' => 'multiple_checkbox_element_callback',
|
327 |
-
'args' => array(
|
328 |
-
'menu' => $option,
|
329 |
-
'id' => 'my_account_restrict',
|
330 |
-
'options' => $order_statuses,
|
331 |
-
),
|
332 |
-
),
|
333 |
-
)
|
334 |
-
);
|
335 |
-
|
336 |
-
add_settings_field(
|
337 |
-
'invoice_number_column',
|
338 |
-
__( 'Enable invoice number column in the orders list', 'wpo_wcpdf' ),
|
339 |
-
array( &$this, 'checkbox_element_callback' ),
|
340 |
-
$option,
|
341 |
-
'interface',
|
342 |
-
array(
|
343 |
-
'menu' => $option,
|
344 |
-
'id' => 'invoice_number_column',
|
345 |
-
)
|
346 |
-
);
|
347 |
-
|
348 |
-
// Register settings.
|
349 |
-
register_setting( $option, $option, array( &$this, 'validate_options' ) );
|
350 |
-
|
351 |
-
$option_values = get_option($option);
|
352 |
-
// convert old 'statusless' setting to new status array
|
353 |
-
if ( isset( $option_values['email_pdf'] ) && !is_array( $option_values['email_pdf'] ) ) {
|
354 |
-
$default_status = apply_filters( 'wpo_wcpdf_attach_to_status', 'completed' );
|
355 |
-
$option_values['email_pdf'] = array (
|
356 |
-
$default_status => 1,
|
357 |
-
'customer_invoice' => 1,
|
358 |
-
);
|
359 |
-
update_option( $option, $option_values );
|
360 |
-
}
|
361 |
-
|
362 |
-
/**************************************/
|
363 |
-
/********** TEMPLATE SETTINGS *********/
|
364 |
-
/**************************************/
|
365 |
-
|
366 |
-
$option = 'wpo_wcpdf_template_settings';
|
367 |
-
|
368 |
-
// Create option in wp_options.
|
369 |
-
if ( false === get_option( $option ) ) {
|
370 |
-
$this->default_settings( $option );
|
371 |
-
}
|
372 |
-
|
373 |
-
// Section.
|
374 |
-
add_settings_section(
|
375 |
-
'template_settings',
|
376 |
-
__( 'PDF Template settings', 'wpo_wcpdf' ),
|
377 |
-
array( &$this, 'section_options_callback' ),
|
378 |
-
$option
|
379 |
-
);
|
380 |
-
|
381 |
-
|
382 |
-
$theme_path = get_stylesheet_directory() . '/' . $wpo_wcpdf->export->template_base_path;
|
383 |
-
$theme_template_path = substr($theme_path, strpos($theme_path, 'wp-content')) . 'yourtemplate';
|
384 |
-
$plugin_template_path = 'wp-content/plugins/woocommerce-pdf-invoices-packing-slips/templates/pdf/Simple';
|
385 |
-
|
386 |
-
add_settings_field(
|
387 |
-
'template_path',
|
388 |
-
__( 'Choose a template', 'wpo_wcpdf' ),
|
389 |
-
array( &$this, 'template_select_element_callback' ),
|
390 |
-
$option,
|
391 |
-
'template_settings',
|
392 |
-
array(
|
393 |
-
'menu' => $option,
|
394 |
-
'id' => 'template_path',
|
395 |
-
'options' => $this->find_templates(),
|
396 |
-
'description' => sprintf( __( 'Want to use your own template? Copy all the files from <code>%s</code> to your (child) theme in <code>%s</code> to customize them' , 'wpo_wcpdf' ), $plugin_template_path, $theme_template_path),
|
397 |
-
)
|
398 |
-
);
|
399 |
-
|
400 |
-
add_settings_field(
|
401 |
-
'paper_size',
|
402 |
-
__( 'Paper size', 'wpo_wcpdf' ),
|
403 |
-
array( &$this, 'select_element_callback' ),
|
404 |
-
$option,
|
405 |
-
'template_settings',
|
406 |
-
array(
|
407 |
-
'menu' => $option,
|
408 |
-
'id' => 'paper_size',
|
409 |
-
'options' => apply_filters( 'wpo_wcpdf_template_settings_paper_size', array(
|
410 |
-
'a4' => __( 'A4' , 'wpo_wcpdf' ),
|
411 |
-
'letter' => __( 'Letter' , 'wpo_wcpdf' ),
|
412 |
-
) ),
|
413 |
-
)
|
414 |
-
);
|
415 |
-
|
416 |
-
add_settings_field(
|
417 |
-
'header_logo',
|
418 |
-
__( 'Shop header/logo', 'wpo_wcpdf' ),
|
419 |
-
array( &$this, 'media_upload_callback' ),
|
420 |
-
$option,
|
421 |
-
'template_settings',
|
422 |
-
array(
|
423 |
-
'menu' => $option,
|
424 |
-
'id' => 'header_logo',
|
425 |
-
'uploader_title' => __( 'Select or upload your invoice header/logo', 'wpo_wcpdf' ),
|
426 |
-
'uploader_button_text' => __( 'Set image', 'wpo_wcpdf' ),
|
427 |
-
'remove_button_text' => __( 'Remove image', 'wpo_wcpdf' ),
|
428 |
-
//'description' => __( '...', 'wpo_wcpdf' ),
|
429 |
-
)
|
430 |
-
);
|
431 |
-
|
432 |
-
add_settings_field(
|
433 |
-
'shop_name',
|
434 |
-
__( 'Shop Name', 'wpo_wcpdf' ),
|
435 |
-
array( &$this, 'text_element_callback' ),
|
436 |
-
$option,
|
437 |
-
'template_settings',
|
438 |
-
array(
|
439 |
-
'menu' => $option,
|
440 |
-
'id' => 'shop_name',
|
441 |
-
'size' => '72',
|
442 |
-
'translatable' => true,
|
443 |
-
)
|
444 |
-
);
|
445 |
-
|
446 |
-
add_settings_field(
|
447 |
-
'shop_address',
|
448 |
-
__( 'Shop Address', 'wpo_wcpdf' ),
|
449 |
-
array( &$this, 'textarea_element_callback' ),
|
450 |
-
$option,
|
451 |
-
'template_settings',
|
452 |
-
array(
|
453 |
-
'menu' => $option,
|
454 |
-
'id' => 'shop_address',
|
455 |
-
'width' => '72',
|
456 |
-
'height' => '8',
|
457 |
-
'translatable' => true,
|
458 |
-
//'description' => __( '...', 'wpo_wcpdf' ),
|
459 |
-
)
|
460 |
-
);
|
461 |
-
|
462 |
-
add_settings_field(
|
463 |
-
'footer',
|
464 |
-
__( 'Footer: terms & conditions, policies, etc.', 'wpo_wcpdf' ),
|
465 |
-
array( &$this, 'textarea_element_callback' ),
|
466 |
-
$option,
|
467 |
-
'template_settings',
|
468 |
-
array(
|
469 |
-
'menu' => $option,
|
470 |
-
'id' => 'footer',
|
471 |
-
'width' => '72',
|
472 |
-
'height' => '4',
|
473 |
-
'translatable' => true,
|
474 |
-
//'description' => __( '...', 'wpo_wcpdf' ),
|
475 |
-
)
|
476 |
-
);
|
477 |
-
|
478 |
-
// Section.
|
479 |
-
add_settings_section(
|
480 |
-
'invoice',
|
481 |
-
__( 'Invoice', 'wpo_wcpdf' ),
|
482 |
-
array( &$this, 'section_options_callback' ),
|
483 |
-
$option
|
484 |
-
);
|
485 |
-
|
486 |
-
add_settings_field(
|
487 |
-
'invoice_shipping_address',
|
488 |
-
__( 'Display shipping address', 'wpo_wcpdf' ),
|
489 |
-
array( &$this, 'checkbox_element_callback' ),
|
490 |
-
$option,
|
491 |
-
'invoice',
|
492 |
-
array(
|
493 |
-
'menu' => $option,
|
494 |
-
'id' => 'invoice_shipping_address',
|
495 |
-
'description' => __( 'Display shipping address on invoice (in addition to the default billing address) if different from billing address', 'wpo_wcpdf' ),
|
496 |
-
)
|
497 |
-
);
|
498 |
-
|
499 |
-
add_settings_field(
|
500 |
-
'invoice_email',
|
501 |
-
__( 'Display email address', 'wpo_wcpdf' ),
|
502 |
-
array( &$this, 'checkbox_element_callback' ),
|
503 |
-
$option,
|
504 |
-
'invoice',
|
505 |
-
array(
|
506 |
-
'menu' => $option,
|
507 |
-
'id' => 'invoice_email',
|
508 |
-
)
|
509 |
-
);
|
510 |
-
|
511 |
-
add_settings_field(
|
512 |
-
'invoice_phone',
|
513 |
-
__( 'Display phone number', 'wpo_wcpdf' ),
|
514 |
-
array( &$this, 'checkbox_element_callback' ),
|
515 |
-
$option,
|
516 |
-
'invoice',
|
517 |
-
array(
|
518 |
-
'menu' => $option,
|
519 |
-
'id' => 'invoice_phone',
|
520 |
-
)
|
521 |
-
);
|
522 |
-
|
523 |
-
add_settings_field(
|
524 |
-
'display_date',
|
525 |
-
__( 'Display invoice date', 'wpo_wcpdf' ),
|
526 |
-
array( &$this, 'checkbox_element_callback' ),
|
527 |
-
$option,
|
528 |
-
'invoice',
|
529 |
-
array(
|
530 |
-
'menu' => $option,
|
531 |
-
'id' => 'display_date',
|
532 |
-
'value' => 'invoice_date',
|
533 |
-
)
|
534 |
-
);
|
535 |
-
|
536 |
-
if ($invoicenumber_thirdparty) {
|
537 |
-
$invoice_number_desc = __( 'Invoice numbers are created by a third-party extension.', 'yith-woocommerce-pdf-invoice');
|
538 |
-
$config_link = esc_attr(apply_filters('woocommerce_invoice_number_configuration_link', null));
|
539 |
-
if ($config_link) {
|
540 |
-
$invoice_number_desc .= ' '.sprintf(__( 'Configure it <a href="%s">here</a>.', 'yith-woocommerce-pdf-invoice'), $config_link);
|
541 |
-
}
|
542 |
-
$invoice_number_desc = '<i>'.$invoice_number_desc.'</i>';
|
543 |
-
} else {
|
544 |
-
$invoice_number_desc = null;
|
545 |
-
}
|
546 |
-
|
547 |
-
add_settings_field(
|
548 |
-
'display_number',
|
549 |
-
$invoicenumber_thirdparty ? __( 'Display invoice number', 'wpo_wcpdf' ) : __( 'Display built-in sequential invoice number', 'wpo_wcpdf' ),
|
550 |
-
array( &$this, 'checkbox_element_callback' ),
|
551 |
-
$option,
|
552 |
-
'invoice',
|
553 |
-
array(
|
554 |
-
'menu' => $option,
|
555 |
-
'id' => 'display_number',
|
556 |
-
'value' => 'invoice_number',
|
557 |
-
'description' => $invoice_number_desc,
|
558 |
-
)
|
559 |
-
);
|
560 |
-
|
561 |
-
if (!$invoicenumber_thirdparty) {
|
562 |
-
// invoice number is stored separately for direct retrieval
|
563 |
-
register_setting( $option, 'wpo_wcpdf_next_invoice_number', array( &$this, 'validate_options' ) );
|
564 |
-
add_settings_field(
|
565 |
-
'next_invoice_number',
|
566 |
-
__( 'Next invoice number (without prefix/suffix etc.)', 'wpo_wcpdf' ),
|
567 |
-
array( &$this, 'singular_text_element_callback' ),
|
568 |
-
$option,
|
569 |
-
'invoice',
|
570 |
-
array(
|
571 |
-
'menu' => 'wpo_wcpdf_next_invoice_number',
|
572 |
-
'id' => 'next_invoice_number',
|
573 |
-
'size' => '10',
|
574 |
-
'description' => __( 'This is the number that will be used on the next invoice that is created. By default, numbering starts from the WooCommerce Order Number of the first invoice that is created and increases for every new invoice. Note that if you override this and set it lower than the highest (PDF) invoice number, this could create double invoice numbers!', 'wpo_wcpdf' ),
|
575 |
-
)
|
576 |
-
);
|
577 |
-
|
578 |
-
// first time invoice number
|
579 |
-
$next_invoice_number = get_option('wpo_wcpdf_next_invoice_number');
|
580 |
-
// determine highest invoice number if option not set
|
581 |
-
if ( !isset( $next_invoice_number ) ) {
|
582 |
-
// Based on code from WooCommerce Sequential Order Numbers
|
583 |
-
global $wpdb;
|
584 |
-
// get highest invoice_number in postmeta table
|
585 |
-
$max_invoice_number = $wpdb->get_var( 'SELECT max(cast(meta_value as UNSIGNED)) from ' . $wpdb->postmeta . ' where meta_key="_wcpdf_invoice_number"' );
|
586 |
-
|
587 |
-
if ( !empty($max_invoice_number) ) {
|
588 |
-
$next_invoice_number = $max_invoice_number+1;
|
589 |
-
} else {
|
590 |
-
$next_invoice_number = '';
|
591 |
-
}
|
592 |
-
|
593 |
-
update_option( 'wpo_wcpdf_next_invoice_number', $next_invoice_number );
|
594 |
-
}
|
595 |
-
|
596 |
-
add_settings_field(
|
597 |
-
'invoice_number_formatting',
|
598 |
-
__( 'Invoice number format', 'wpo_wcpdf' ),
|
599 |
-
array( &$this, 'invoice_number_formatting_callback' ),
|
600 |
-
$option,
|
601 |
-
'invoice',
|
602 |
-
array(
|
603 |
-
'menu' => $option,
|
604 |
-
'id' => 'invoice_number_formatting',
|
605 |
-
'fields' => array(
|
606 |
-
'prefix' => array(
|
607 |
-
'title' => __( 'Prefix' , 'wpo_wcpdf' ),
|
608 |
-
'size' => 20,
|
609 |
-
'description' => __( 'to use the invoice year and/or month, use [invoice_year] or [invoice_month] respectively' , 'wpo_wcpdf' ),
|
610 |
-
),
|
611 |
-
'suffix' => array(
|
612 |
-
'title' => __( 'Suffix' , 'wpo_wcpdf' ),
|
613 |
-
'size' => 20,
|
614 |
-
'description' => '',
|
615 |
-
),
|
616 |
-
'padding' => array(
|
617 |
-
'title' => __( 'Padding' , 'wpo_wcpdf' ),
|
618 |
-
'size' => 2,
|
619 |
-
'description' => __( 'enter the number of digits here - enter "6" to display 42 as 000042' , 'wpo_wcpdf' ),
|
620 |
-
),
|
621 |
-
),
|
622 |
-
'description' => __( 'note: if you have already created a custom invoice number format with a filter, the above settings will be ignored' , 'wpo_wcpdf' ),
|
623 |
-
)
|
624 |
-
);
|
625 |
-
|
626 |
-
add_settings_field(
|
627 |
-
'yearly_reset_invoice_number',
|
628 |
-
__( 'Reset invoice number yearly', 'wpo_wcpdf' ),
|
629 |
-
array( &$this, 'checkbox_element_callback' ),
|
630 |
-
$option,
|
631 |
-
'invoice',
|
632 |
-
array(
|
633 |
-
'menu' => $option,
|
634 |
-
'id' => 'yearly_reset_invoice_number',
|
635 |
-
)
|
636 |
-
);
|
637 |
-
} // End if ($invoicenumber_thirdparty)
|
638 |
-
|
639 |
-
add_settings_field(
|
640 |
-
'currency_font',
|
641 |
-
__( 'Extended currency symbol support', 'wpo_wcpdf' ),
|
642 |
-
array( &$this, 'checkbox_element_callback' ),
|
643 |
-
$option,
|
644 |
-
'invoice',
|
645 |
-
array(
|
646 |
-
'menu' => $option,
|
647 |
-
'id' => 'currency_font',
|
648 |
-
'description' => __( 'Enable this if your currency symbol is not displaying properly' , 'wpo_wcpdf' ),
|
649 |
-
)
|
650 |
-
);
|
651 |
-
|
652 |
-
// Section.
|
653 |
-
add_settings_section(
|
654 |
-
'packing_slip',
|
655 |
-
__( 'Packing Slip', 'wpo_wcpdf' ),
|
656 |
-
array( &$this, 'section_options_callback' ),
|
657 |
-
$option
|
658 |
-
);
|
659 |
-
|
660 |
-
add_settings_field(
|
661 |
-
'packing_slip_billing_address',
|
662 |
-
__( 'Display billing address', 'wpo_wcpdf' ),
|
663 |
-
array( &$this, 'checkbox_element_callback' ),
|
664 |
-
$option,
|
665 |
-
'packing_slip',
|
666 |
-
array(
|
667 |
-
'menu' => $option,
|
668 |
-
'id' => 'packing_slip_billing_address',
|
669 |
-
'description' => __( 'Display billing address on packing slip (in addition to the default shipping address) if different from shipping address', 'wpo_wcpdf' ),
|
670 |
-
)
|
671 |
-
);
|
672 |
-
|
673 |
-
add_settings_field(
|
674 |
-
'packing_slip_email',
|
675 |
-
__( 'Display email address', 'wpo_wcpdf' ),
|
676 |
-
array( &$this, 'checkbox_element_callback' ),
|
677 |
-
$option,
|
678 |
-
'packing_slip',
|
679 |
-
array(
|
680 |
-
'menu' => $option,
|
681 |
-
'id' => 'packing_slip_email',
|
682 |
-
)
|
683 |
-
);
|
684 |
-
|
685 |
-
add_settings_field(
|
686 |
-
'packing_slip_phone',
|
687 |
-
__( 'Display phone number', 'wpo_wcpdf' ),
|
688 |
-
array( &$this, 'checkbox_element_callback' ),
|
689 |
-
$option,
|
690 |
-
'packing_slip',
|
691 |
-
array(
|
692 |
-
'menu' => $option,
|
693 |
-
'id' => 'packing_slip_phone',
|
694 |
-
)
|
695 |
-
);
|
696 |
-
|
697 |
-
// Section.
|
698 |
-
add_settings_section(
|
699 |
-
'extra_template_fields',
|
700 |
-
__( 'Extra template fields', 'wpo_wcpdf' ),
|
701 |
-
array( &$this, 'custom_fields_section' ),
|
702 |
-
$option
|
703 |
-
);
|
704 |
-
|
705 |
-
add_settings_field(
|
706 |
-
'extra_1',
|
707 |
-
__( 'Extra field 1', 'wpo_wcpdf' ),
|
708 |
-
array( &$this, 'textarea_element_callback' ),
|
709 |
-
$option,
|
710 |
-
'extra_template_fields',
|
711 |
-
array(
|
712 |
-
'menu' => $option,
|
713 |
-
'id' => 'extra_1',
|
714 |
-
'width' => '72',
|
715 |
-
'height' => '8',
|
716 |
-
'description' => __( 'This is footer column 1 in the <i>Modern (Premium)</i> template', 'wpo_wcpdf' ),
|
717 |
-
'translatable' => true,
|
718 |
-
)
|
719 |
-
);
|
720 |
-
|
721 |
-
add_settings_field(
|
722 |
-
'extra_2',
|
723 |
-
__( 'Extra field 2', 'wpo_wcpdf' ),
|
724 |
-
array( &$this, 'textarea_element_callback' ),
|
725 |
-
$option,
|
726 |
-
'extra_template_fields',
|
727 |
-
array(
|
728 |
-
'menu' => $option,
|
729 |
-
'id' => 'extra_2',
|
730 |
-
'width' => '72',
|
731 |
-
'height' => '8',
|
732 |
-
'description' => __( 'This is footer column 2 in the <i>Modern (Premium)</i> template', 'wpo_wcpdf' ),
|
733 |
-
'translatable' => true,
|
734 |
-
)
|
735 |
-
);
|
736 |
-
|
737 |
-
add_settings_field(
|
738 |
-
'extra_3',
|
739 |
-
__( 'Extra field 3', 'wpo_wcpdf' ),
|
740 |
-
array( &$this, 'textarea_element_callback' ),
|
741 |
-
$option,
|
742 |
-
'extra_template_fields',
|
743 |
-
array(
|
744 |
-
'menu' => $option,
|
745 |
-
'id' => 'extra_3',
|
746 |
-
'width' => '72',
|
747 |
-
'height' => '8',
|
748 |
-
'description' => __( 'This is footer column 3 in the <i>Modern (Premium)</i> template', 'wpo_wcpdf' ),
|
749 |
-
'translatable' => true,
|
750 |
-
)
|
751 |
-
);
|
752 |
-
|
753 |
-
// Register settings.
|
754 |
-
register_setting( $option, $option, array( &$this, 'validate_options' ) );
|
755 |
-
|
756 |
-
/**************************************/
|
757 |
-
/******** DEBUG/STATUS SETTINGS *******/
|
758 |
-
/**************************************/
|
759 |
-
|
760 |
-
$option = 'wpo_wcpdf_debug_settings';
|
761 |
-
|
762 |
-
// Create option in wp_options.
|
763 |
-
if ( false === get_option( $option ) ) {
|
764 |
-
$this->default_settings( $option );
|
765 |
-
}
|
766 |
-
|
767 |
-
// Section.
|
768 |
-
add_settings_section(
|
769 |
-
'debug_settings',
|
770 |
-
__( 'Debug settings', 'wpo_wcpdf' ),
|
771 |
-
array( &$this, 'debug_section' ),
|
772 |
-
$option
|
773 |
-
);
|
774 |
-
|
775 |
-
add_settings_field(
|
776 |
-
'enable_debug',
|
777 |
-
__( 'Enable debug output', 'wpo_wcpdf' ),
|
778 |
-
array( &$this, 'checkbox_element_callback' ),
|
779 |
-
$option,
|
780 |
-
'debug_settings',
|
781 |
-
array(
|
782 |
-
'menu' => $option,
|
783 |
-
'id' => 'enable_debug',
|
784 |
-
'description' => __( "Enable this option to output plugin errors if you're getting a blank page or other PDF generation issues", 'wpo_wcpdf' ),
|
785 |
-
)
|
786 |
-
);
|
787 |
-
|
788 |
-
add_settings_field(
|
789 |
-
'html_output',
|
790 |
-
__( 'Output to HTML', 'wpo_wcpdf' ),
|
791 |
-
array( &$this, 'checkbox_element_callback' ),
|
792 |
-
$option,
|
793 |
-
'debug_settings',
|
794 |
-
array(
|
795 |
-
'menu' => $option,
|
796 |
-
'id' => 'html_output',
|
797 |
-
'description' => __( 'Send the template output as HTML to the browser instead of creating a PDF.', 'wpo_wcpdf' ),
|
798 |
-
)
|
799 |
-
);
|
800 |
-
|
801 |
-
add_settings_field(
|
802 |
-
'old_tmp',
|
803 |
-
__( 'Use old tmp folder', 'wpo_wcpdf' ),
|
804 |
-
array( &$this, 'checkbox_element_callback' ),
|
805 |
-
$option,
|
806 |
-
'debug_settings',
|
807 |
-
array(
|
808 |
-
'menu' => $option,
|
809 |
-
'id' => 'old_tmp',
|
810 |
-
'description' => __( 'Before version 1.5 of PDF Invoices, temporary files were stored in the plugin folder. This setting is only intended for backwards compatibility, not recommended on new installs!', 'wpo_wcpdf' ),
|
811 |
-
)
|
812 |
-
);
|
813 |
-
|
814 |
-
// Register settings.
|
815 |
-
register_setting( $option, $option, array( &$this, 'validate_options' ) );
|
816 |
-
|
817 |
-
}
|
818 |
-
|
819 |
-
/**
|
820 |
-
* get all emails registered in WooCommerce
|
821 |
-
* @param boolean $remove_defaults switch to remove default woocommerce emails
|
822 |
-
* @return array $emails list of all email ids/slugs and names
|
823 |
-
*/
|
824 |
-
public function get_wc_emails ( $remove_defaults = true ) {
|
825 |
-
// get emails from WooCommerce
|
826 |
-
global $woocommerce;
|
827 |
-
$mailer = $woocommerce->mailer();
|
828 |
-
$wc_emails = $mailer->get_emails();
|
829 |
-
|
830 |
-
$default_emails = array(
|
831 |
-
'new_order',
|
832 |
-
'customer_processing_order',
|
833 |
-
'customer_completed_order',
|
834 |
-
'customer_invoice',
|
835 |
-
'customer_note',
|
836 |
-
'customer_reset_password',
|
837 |
-
'customer_new_account'
|
838 |
-
);
|
839 |
-
|
840 |
-
$emails = array();
|
841 |
-
foreach ($wc_emails as $name => $template) {
|
842 |
-
if ( !( $remove_defaults && in_array( $template->id, $default_emails ) ) ) {
|
843 |
-
$emails[$template->id] = $template->title;
|
844 |
-
}
|
845 |
-
}
|
846 |
-
|
847 |
-
return $emails;
|
848 |
-
}
|
849 |
-
|
850 |
-
/**
|
851 |
-
* WooCommerce Order Status & Actions Manager emails compatibility
|
852 |
-
*/
|
853 |
-
public function wc_order_status_actions_emails ( $emails ) {
|
854 |
-
// check if WC_Custom_Status class is loaded!
|
855 |
-
if (class_exists('WC_Custom_Status')) {
|
856 |
-
// get list of custom statuses from WooCommerce Custom Order Status & Actions
|
857 |
-
// status slug => status name
|
858 |
-
$custom_statuses = WC_Custom_Status::get_status_list_names();
|
859 |
-
// append _email to slug (=email_id) and add to emails list
|
860 |
-
foreach ($custom_statuses as $status_slug => $status_name) {
|
861 |
-
$emails[$status_slug.'_email'] = $status_name;
|
862 |
-
}
|
863 |
-
}
|
864 |
-
return $emails;
|
865 |
-
}
|
866 |
-
|
867 |
-
/**
|
868 |
-
* Set default settings.
|
869 |
-
*/
|
870 |
-
public function default_settings( $option ) {
|
871 |
-
global $wpo_wcpdf;
|
872 |
-
|
873 |
-
switch ( $option ) {
|
874 |
-
case 'wpo_wcpdf_general_settings':
|
875 |
-
$default = array(
|
876 |
-
'download_display' => 'download',
|
877 |
-
);
|
878 |
-
break;
|
879 |
-
case 'wpo_wcpdf_template_settings':
|
880 |
-
$default = array(
|
881 |
-
'paper_size' => 'a4',
|
882 |
-
'template_path' => $wpo_wcpdf->export->template_default_base_path . 'Simple',
|
883 |
-
// 'invoice_shipping_address' => '1',
|
884 |
-
);
|
885 |
-
break;
|
886 |
-
default:
|
887 |
-
$default = array();
|
888 |
-
break;
|
889 |
-
}
|
890 |
-
|
891 |
-
if ( false === get_option( $option ) ) {
|
892 |
-
add_option( $option, $default );
|
893 |
-
} else {
|
894 |
-
update_option( $option, $default );
|
895 |
-
|
896 |
-
}
|
897 |
-
}
|
898 |
-
|
899 |
-
// Text element callback.
|
900 |
-
public function text_element_callback( $args ) {
|
901 |
-
$menu = $args['menu'];
|
902 |
-
$id = $args['id'];
|
903 |
-
$size = isset( $args['size'] ) ? $args['size'] : '25';
|
904 |
-
$class = isset( $args['translatable'] ) && $args['translatable'] === true ? 'translatable' : '';
|
905 |
-
|
906 |
-
$options = get_option( $menu );
|
907 |
-
|
908 |
-
if ( isset( $options[$id] ) ) {
|
909 |
-
$current = $options[$id];
|
910 |
-
} else {
|
911 |
-
$current = isset( $args['default'] ) ? $args['default'] : '';
|
912 |
-
}
|
913 |
-
|
914 |
-
$html = sprintf( '<input type="text" id="%1$s" name="%2$s[%1$s]" value="%3$s" size="%4$s" class="%5$s"/>', $id, $menu, $current, $size, $class );
|
915 |
-
|
916 |
-
// Displays option description.
|
917 |
-
if ( isset( $args['description'] ) ) {
|
918 |
-
$html .= sprintf( '<p class="description">%s</p>', $args['description'] );
|
919 |
-
}
|
920 |
-
|
921 |
-
echo $html;
|
922 |
-
}
|
923 |
-
|
924 |
-
// Single text option (not part of any settings array)
|
925 |
-
public function singular_text_element_callback( $args ) {
|
926 |
-
$menu = $args['menu'];
|
927 |
-
$id = $args['id'];
|
928 |
-
$size = isset( $args['size'] ) ? $args['size'] : '25';
|
929 |
-
$class = isset( $args['translatable'] ) && $args['translatable'] === true ? 'translatable' : '';
|
930 |
-
|
931 |
-
$option = get_option( $menu );
|
932 |
-
|
933 |
-
if ( isset( $option ) ) {
|
934 |
-
$current = $option;
|
935 |
-
} else {
|
936 |
-
$current = isset( $args['default'] ) ? $args['default'] : '';
|
937 |
-
}
|
938 |
-
|
939 |
-
$html = sprintf( '<input type="text" id="%1$s" name="%2$s" value="%3$s" size="%4$s" class="%5$s"/>', $id, $menu, $current, $size, $class );
|
940 |
-
|
941 |
-
// Displays option description.
|
942 |
-
if ( isset( $args['description'] ) ) {
|
943 |
-
$html .= sprintf( '<p class="description">%s</p>', $args['description'] );
|
944 |
-
}
|
945 |
-
|
946 |
-
echo $html;
|
947 |
-
}
|
948 |
-
|
949 |
-
// Text element callback.
|
950 |
-
public function textarea_element_callback( $args ) {
|
951 |
-
$menu = $args['menu'];
|
952 |
-
$id = $args['id'];
|
953 |
-
$width = $args['width'];
|
954 |
-
$height = $args['height'];
|
955 |
-
$class = isset( $args['translatable'] ) && $args['translatable'] === true ? 'translatable' : '';
|
956 |
-
|
957 |
-
$options = get_option( $menu );
|
958 |
-
|
959 |
-
if ( isset( $options[$id] ) ) {
|
960 |
-
$current = $options[$id];
|
961 |
-
} else {
|
962 |
-
$current = isset( $args['default'] ) ? $args['default'] : '';
|
963 |
-
}
|
964 |
-
|
965 |
-
$html = sprintf( '<textarea id="%1$s" name="%2$s[%1$s]" cols="%4$s" rows="%5$s" class="%6$s"/>%3$s</textarea>', $id, $menu, $current, $width, $height, $class );
|
966 |
-
|
967 |
-
// Displays option description.
|
968 |
-
if ( isset( $args['description'] ) ) {
|
969 |
-
$html .= sprintf( '<p class="description">%s</p>', $args['description'] );
|
970 |
-
}
|
971 |
-
|
972 |
-
echo $html;
|
973 |
-
}
|
974 |
-
|
975 |
-
|
976 |
-
/**
|
977 |
-
* Checkbox field callback.
|
978 |
-
*
|
979 |
-
* @param array $args Field arguments.
|
980 |
-
*
|
981 |
-
* @return string Checkbox field.
|
982 |
-
*/
|
983 |
-
public function checkbox_element_callback( $args ) {
|
984 |
-
$menu = $args['menu'];
|
985 |
-
$id = $args['id'];
|
986 |
-
$value = isset( $args['value'] ) ? $args['value'] : 1;
|
987 |
-
|
988 |
-
$options = get_option( $menu );
|
989 |
-
|
990 |
-
if ( isset( $options[$id] ) ) {
|
991 |
-
$current = $options[$id];
|
992 |
-
} else {
|
993 |
-
$current = isset( $args['default'] ) ? $args['default'] : '';
|
994 |
-
}
|
995 |
-
|
996 |
-
$html = sprintf( '<input type="checkbox" id="%1$s" name="%2$s[%1$s]" value="%3$s"%4$s />', $id, $menu, $value, checked( $value, $current, false ) );
|
997 |
-
|
998 |
-
// Displays option description.
|
999 |
-
if ( isset( $args['description'] ) ) {
|
1000 |
-
$html .= sprintf( '<p class="description">%s</p>', $args['description'] );
|
1001 |
-
}
|
1002 |
-
|
1003 |
-
echo $html;
|
1004 |
-
}
|
1005 |
-
|
1006 |
-
/**
|
1007 |
-
* Multiple Checkbox field callback.
|
1008 |
-
*
|
1009 |
-
* @param array $args Field arguments.
|
1010 |
-
*
|
1011 |
-
* @return string Checkbox field.
|
1012 |
-
*/
|
1013 |
-
public function multiple_checkbox_element_callback( $args ) {
|
1014 |
-
$menu = $args['menu'];
|
1015 |
-
$id = $args['id'];
|
1016 |
-
|
1017 |
-
$options = get_option( $menu );
|
1018 |
-
|
1019 |
-
|
1020 |
-
foreach ( $args['options'] as $key => $label ) {
|
1021 |
-
$current = ( isset( $options[$id][$key] ) ) ? $options[$id][$key] : '';
|
1022 |
-
printf( '<input type="checkbox" id="%1$s[%2$s][%3$s]" name="%1$s[%2$s][%3$s]" value="1"%4$s /> %5$s<br/>', $menu, $id, $key, checked( 1, $current, false ), $label );
|
1023 |
-
}
|
1024 |
-
|
1025 |
-
// Displays option description.
|
1026 |
-
if ( isset( $args['description'] ) ) {
|
1027 |
-
printf( '<p class="description">%s</p>', $args['description'] );
|
1028 |
-
}
|
1029 |
-
}
|
1030 |
-
|
1031 |
-
/**
|
1032 |
-
* Checkbox fields table callback.
|
1033 |
-
*
|
1034 |
-
* @param array $args Field arguments.
|
1035 |
-
*
|
1036 |
-
* @return string Checkbox field.
|
1037 |
-
*/
|
1038 |
-
public function checkbox_table_callback( $args ) {
|
1039 |
-
$menu = $args['menu'];
|
1040 |
-
$id = $args['id'];
|
1041 |
-
|
1042 |
-
$options = get_option( $menu );
|
1043 |
-
|
1044 |
-
$rows = $args['rows'];
|
1045 |
-
$columns = $args['columns'];
|
1046 |
-
|
1047 |
-
?>
|
1048 |
-
<table style="">
|
1049 |
-
<tr>
|
1050 |
-
<td style="padding:0 10px 5px 0;"> </td>
|
1051 |
-
<?php foreach ( $columns as $column => $title ) { ?>
|
1052 |
-
<td style="padding:0 10px 5px 0;"><?php echo $title; ?></td>
|
1053 |
-
<?php } ?>
|
1054 |
-
</tr>
|
1055 |
-
<tr>
|
1056 |
-
<td style="padding: 0;">
|
1057 |
-
<?php foreach ($rows as $row) {
|
1058 |
-
echo $row.'<br/>';
|
1059 |
-
} ?>
|
1060 |
-
</td>
|
1061 |
-
<?php foreach ( $columns as $column => $title ) { ?>
|
1062 |
-
<td style="text-align:center; padding: 0;">
|
1063 |
-
<?php foreach ( $rows as $row => $title ) {
|
1064 |
-
$current = ( isset( $options[$id.'_'.$column][$row] ) ) ? $options[$id.'_'.$column][$row] : '';
|
1065 |
-
$name = sprintf('%1$s[%2$s_%3$s][%4$s]', $menu, $id, $column, $row);
|
1066 |
-
printf( '<input type="checkbox" id="%1$s" name="%1$s" value="1"%2$s /><br/>', $name, checked( 1, $current, false ) );
|
1067 |
-
} ?>
|
1068 |
-
</td>
|
1069 |
-
<?php } ?>
|
1070 |
-
</tr>
|
1071 |
-
</table>
|
1072 |
-
|
1073 |
-
<?php
|
1074 |
-
// Displays option description.
|
1075 |
-
if ( isset( $args['description'] ) ) {
|
1076 |
-
printf( '<p class="description">%s</p>', $args['description'] );
|
1077 |
-
}
|
1078 |
-
}
|
1079 |
-
|
1080 |
-
/**
|
1081 |
-
* Select element callback.
|
1082 |
-
*
|
1083 |
-
* @param array $args Field arguments.
|
1084 |
-
*
|
1085 |
-
* @return string Select field.
|
1086 |
-
*/
|
1087 |
-
public function select_element_callback( $args ) {
|
1088 |
-
$menu = $args['menu'];
|
1089 |
-
$id = $args['id'];
|
1090 |
-
|
1091 |
-
$options = get_option( $menu );
|
1092 |
-
|
1093 |
-
if ( isset( $options[$id] ) ) {
|
1094 |
-
$current = $options[$id];
|
1095 |
-
} else {
|
1096 |
-
$current = isset( $args['default'] ) ? $args['default'] : '';
|
1097 |
-
}
|
1098 |
-
|
1099 |
-
printf( '<select id="%1$s" name="%2$s[%1$s]">', $id, $menu );
|
1100 |
-
|
1101 |
-
foreach ( $args['options'] as $key => $label ) {
|
1102 |
-
printf( '<option value="%s"%s>%s</option>', $key, selected( $current, $key, false ), $label );
|
1103 |
-
}
|
1104 |
-
|
1105 |
-
echo '</select>';
|
1106 |
-
|
1107 |
-
|
1108 |
-
if (isset($args['custom'])) {
|
1109 |
-
$custom = $args['custom'];
|
1110 |
-
|
1111 |
-
$custom_id = $id.'_custom';
|
1112 |
-
|
1113 |
-
printf( '<br/><br/><div id="%s" style="display:none;">', $custom_id );
|
1114 |
-
|
1115 |
-
switch ($custom['type']) {
|
1116 |
-
case 'text_element_callback':
|
1117 |
-
$this->text_element_callback( $custom['args'] );
|
1118 |
-
break;
|
1119 |
-
case 'multiple_text_element_callback':
|
1120 |
-
$this->multiple_text_element_callback( $custom['args'] );
|
1121 |
-
break;
|
1122 |
-
case 'multiple_checkbox_element_callback':
|
1123 |
-
$this->multiple_checkbox_element_callback( $custom['args'] );
|
1124 |
-
break;
|
1125 |
-
default:
|
1126 |
-
break;
|
1127 |
-
}
|
1128 |
-
|
1129 |
-
echo '</div>';
|
1130 |
-
|
1131 |
-
?>
|
1132 |
-
<script type="text/javascript">
|
1133 |
-
jQuery(document).ready(function($) {
|
1134 |
-
function check_<?php echo $id; ?>_custom() {
|
1135 |
-
var custom = $('#<?php echo $id; ?>').val();
|
1136 |
-
if (custom == 'custom') {
|
1137 |
-
$( '#<?php echo $custom_id; ?>').show();
|
1138 |
-
} else {
|
1139 |
-
$( '#<?php echo $custom_id; ?>').hide();
|
1140 |
-
}
|
1141 |
-
}
|
1142 |
-
|
1143 |
-
check_<?php echo $id; ?>_custom();
|
1144 |
-
|
1145 |
-
$( '#<?php echo $id; ?>' ).change(function() {
|
1146 |
-
check_<?php echo $id; ?>_custom();
|
1147 |
-
});
|
1148 |
-
|
1149 |
-
});
|
1150 |
-
</script>
|
1151 |
-
<?php
|
1152 |
-
}
|
1153 |
-
|
1154 |
-
// Displays option description.
|
1155 |
-
if ( isset( $args['description'] ) ) {
|
1156 |
-
printf( '<p class="description">%s</p>', $args['description'] );
|
1157 |
-
}
|
1158 |
-
|
1159 |
-
}
|
1160 |
-
|
1161 |
-
/**
|
1162 |
-
* Displays a radio settings field
|
1163 |
-
*
|
1164 |
-
* @param array $args settings field args
|
1165 |
-
*/
|
1166 |
-
public function radio_element_callback( $args ) {
|
1167 |
-
$menu = $args['menu'];
|
1168 |
-
$id = $args['id'];
|
1169 |
-
|
1170 |
-
$options = get_option( $menu );
|
1171 |
-
|
1172 |
-
if ( isset( $options[$id] ) ) {
|
1173 |
-
$current = $options[$id];
|
1174 |
-
} else {
|
1175 |
-
$current = isset( $args['default'] ) ? $args['default'] : '';
|
1176 |
-
}
|
1177 |
-
|
1178 |
-
$html = '';
|
1179 |
-
foreach ( $args['options'] as $key => $label ) {
|
1180 |
-
$html .= sprintf( '<input type="radio" class="radio" id="%1$s[%2$s][%3$s]" name="%1$s[%2$s]" value="%3$s"%4$s />', $menu, $id, $key, checked( $current, $key, false ) );
|
1181 |
-
$html .= sprintf( '<label for="%1$s[%2$s][%3$s]"> %4$s</label><br>', $menu, $id, $key, $label);
|
1182 |
-
}
|
1183 |
-
|
1184 |
-
// Displays option description.
|
1185 |
-
if ( isset( $args['description'] ) ) {
|
1186 |
-
$html .= sprintf( '<p class="description">%s</p>', $args['description'] );
|
1187 |
-
}
|
1188 |
-
|
1189 |
-
echo $html;
|
1190 |
-
}
|
1191 |
-
|
1192 |
-
/**
|
1193 |
-
* Media upload callback.
|
1194 |
-
*
|
1195 |
-
* @param array $args Field arguments.
|
1196 |
-
*
|
1197 |
-
* @return string Media upload button & preview.
|
1198 |
-
*/
|
1199 |
-
public function media_upload_callback( $args ) {
|
1200 |
-
$menu = $args['menu'];
|
1201 |
-
$id = $args['id'];
|
1202 |
-
$options = get_option( $menu );
|
1203 |
-
|
1204 |
-
if ( isset( $options[$id] ) ) {
|
1205 |
-
$current = $options[$id];
|
1206 |
-
} else {
|
1207 |
-
$current = isset( $args['default'] ) ? $args['default'] : '';
|
1208 |
-
}
|
1209 |
-
|
1210 |
-
$uploader_title = $args['uploader_title'];
|
1211 |
-
$uploader_button_text = $args['uploader_button_text'];
|
1212 |
-
$remove_button_text = $args['remove_button_text'];
|
1213 |
-
|
1214 |
-
$html = '';
|
1215 |
-
if( !empty($current) ) {
|
1216 |
-
$attachment = wp_get_attachment_image_src( $current, 'full', false );
|
1217 |
-
|
1218 |
-
$attachment_src = $attachment[0];
|
1219 |
-
$attachment_width = $attachment[1];
|
1220 |
-
$attachment_height = $attachment[2];
|
1221 |
-
|
1222 |
-
$attachment_resolution = round($attachment_height/(3/2.54));
|
1223 |
-
|
1224 |
-
$html .= sprintf('<img src="%1$s" style="display:block" id="img-%4$s"/>', $attachment_src, $attachment_width, $attachment_height, $id );
|
1225 |
-
$html .= '<div class="attachment-resolution"><p class="description">'.__('Image resolution').': '.$attachment_resolution.'dpi (default height = 3cm)</p></div>';
|
1226 |
-
$html .= sprintf('<span class="button wpo_remove_image_button" data-input_id="%1$s">%2$s</span>', $id, $remove_button_text );
|
1227 |
-
}
|
1228 |
-
|
1229 |
-
$html .= sprintf( '<input id="%1$s" name="%2$s[%1$s]" type="hidden" value="%3$s" />', $id, $menu, $current );
|
1230 |
-
|
1231 |
-
$html .= sprintf( '<span class="button wpo_upload_image_button %4$s" data-uploader_title="%1$s" data-uploader_button_text="%2$s" data-remove_button_text="%3$s" data-input_id="%4$s">%2$s</span>', $uploader_title, $uploader_button_text, $remove_button_text, $id );
|
1232 |
-
|
1233 |
-
// Displays option description.
|
1234 |
-
if ( isset( $args['description'] ) ) {
|
1235 |
-
$html .= sprintf( '<p class="description">%s</p>', $args['description'] );
|
1236 |
-
}
|
1237 |
-
|
1238 |
-
echo $html;
|
1239 |
-
}
|
1240 |
-
|
1241 |
-
/**
|
1242 |
-
* Invoice number formatting callback.
|
1243 |
-
*
|
1244 |
-
* @param array $args Field arguments.
|
1245 |
-
*
|
1246 |
-
* @return string Media upload button & preview.
|
1247 |
-
*/
|
1248 |
-
public function invoice_number_formatting_callback( $args ) {
|
1249 |
-
$menu = $args['menu'];
|
1250 |
-
$fields = $args['fields'];
|
1251 |
-
$options = get_option( $menu );
|
1252 |
-
|
1253 |
-
echo '<table>';
|
1254 |
-
foreach ($fields as $key => $field) {
|
1255 |
-
$id = $args['id'] . '_' . $key;
|
1256 |
-
|
1257 |
-
if ( isset( $options[$id] ) ) {
|
1258 |
-
$current = $options[$id];
|
1259 |
-
} else {
|
1260 |
-
$current = '';
|
1261 |
-
}
|
1262 |
-
|
1263 |
-
$title = $field['title'];
|
1264 |
-
$size = $field['size'];
|
1265 |
-
$description = isset( $field['description'] ) ? '<span style="font-style:italic;">'.$field['description'].'</span>' : '';
|
1266 |
-
|
1267 |
-
echo '<tr>';
|
1268 |
-
printf( '<td style="padding:0 1em 0 0; ">%1$s:</td><td style="padding:0;"><input type="text" id="%2$s" name="%3$s[%2$s]" value="%4$s" size="%5$s"/></td><td style="padding:0 0 0 1em;">%6$s</td>', $title, $id, $menu, $current, $size, $description );
|
1269 |
-
echo '</tr>';
|
1270 |
-
}
|
1271 |
-
echo '</table>';
|
1272 |
-
|
1273 |
-
|
1274 |
-
// Displays option description.
|
1275 |
-
if ( isset( $args['description'] ) ) {
|
1276 |
-
printf( '<p class="description">%s</p>', $args['description'] );
|
1277 |
-
}
|
1278 |
-
|
1279 |
-
// echo $html;
|
1280 |
-
}
|
1281 |
-
|
1282 |
-
|
1283 |
-
/**
|
1284 |
-
* Template select element callback.
|
1285 |
-
*
|
1286 |
-
* @param array $args Field arguments.
|
1287 |
-
*
|
1288 |
-
* @return string Select field.
|
1289 |
-
*/
|
1290 |
-
public function template_select_element_callback( $args ) {
|
1291 |
-
$menu = $args['menu'];
|
1292 |
-
$id = $args['id'];
|
1293 |
-
|
1294 |
-
$options = get_option( $menu );
|
1295 |
-
|
1296 |
-
if ( isset( $options[$id] ) ) {
|
1297 |
-
$current = $options[$id];
|
1298 |
-
} else {
|
1299 |
-
$current = isset( $args['default'] ) ? $args['default'] : '';
|
1300 |
-
}
|
1301 |
-
|
1302 |
-
$html = sprintf( '<select id="%1$s" name="%2$s[%1$s]">', $id, $menu );
|
1303 |
-
|
1304 |
-
// backwards compatible template path (1.4.4+ uses relative paths instead of absolute)
|
1305 |
-
if (strpos($current, ABSPATH) !== false) {
|
1306 |
-
// check if folder exists, then strip site base path.
|
1307 |
-
if ( file_exists( $current ) ) {
|
1308 |
-
$current = str_replace( ABSPATH, '', $current );
|
1309 |
-
}
|
1310 |
-
}
|
1311 |
-
|
1312 |
-
foreach ( $args['options'] as $key => $label ) {
|
1313 |
-
$html .= sprintf( '<option value="%s"%s>%s</option>', $key, selected( $current, $key, false ), $label );
|
1314 |
-
}
|
1315 |
-
|
1316 |
-
$html .= '</select>';
|
1317 |
-
|
1318 |
-
// Displays option description.
|
1319 |
-
if ( isset( $args['description'] ) ) {
|
1320 |
-
$html .= sprintf( '<p class="description">%s</p>', $args['description'] );
|
1321 |
-
}
|
1322 |
-
|
1323 |
-
echo $html;
|
1324 |
-
|
1325 |
-
}
|
1326 |
-
|
1327 |
-
/**
|
1328 |
-
* Section null callback.
|
1329 |
-
*
|
1330 |
-
* @return void.
|
1331 |
-
*/
|
1332 |
-
public function section_options_callback() {
|
1333 |
-
}
|
1334 |
-
|
1335 |
-
/**
|
1336 |
-
* Debug section callback.
|
1337 |
-
*
|
1338 |
-
* @return void.
|
1339 |
-
*/
|
1340 |
-
public function debug_section() {
|
1341 |
-
_e( '<b>Warning!</b> The settings below are meant for debugging/development only. Do not use them on a live website!' , 'wpo_wcpdf' );
|
1342 |
-
}
|
1343 |
-
|
1344 |
-
/**
|
1345 |
-
* Custom fields section callback.
|
1346 |
-
*
|
1347 |
-
* @return void.
|
1348 |
-
*/
|
1349 |
-
public function custom_fields_section() {
|
1350 |
-
_e( 'These are used for the (optional) footer columns in the <em>Modern (Premium)</em> template, but can also be used for other elements in your custom template' , 'wpo_wcpdf' );
|
1351 |
-
}
|
1352 |
-
|
1353 |
-
/**
|
1354 |
-
* Validate options.
|
1355 |
-
*
|
1356 |
-
* @param array $input options to valid.
|
1357 |
-
*
|
1358 |
-
* @return array validated options.
|
1359 |
-
*/
|
1360 |
-
public function validate_options( $input ) {
|
1361 |
-
// Create our array for storing the validated options.
|
1362 |
-
$output = array();
|
1363 |
-
|
1364 |
-
if (empty($input) || !is_array($input)) {
|
1365 |
-
return $input;
|
1366 |
-
}
|
1367 |
-
|
1368 |
-
// Loop through each of the incoming options.
|
1369 |
-
foreach ( $input as $key => $value ) {
|
1370 |
-
|
1371 |
-
// Check to see if the current option has a value. If so, process it.
|
1372 |
-
if ( isset( $input[$key] ) ) {
|
1373 |
-
if ( is_array( $input[$key] ) ) {
|
1374 |
-
foreach ( $input[$key] as $sub_key => $sub_value ) {
|
1375 |
-
$output[$key][$sub_key] = $input[$key][$sub_key];
|
1376 |
-
}
|
1377 |
-
} else {
|
1378 |
-
$output[$key] = $input[$key];
|
1379 |
-
}
|
1380 |
-
}
|
1381 |
-
}
|
1382 |
-
|
1383 |
-
// Return the array processing any additional functions filtered by this action.
|
1384 |
-
return apply_filters( 'wpo_wcpdf_validate_input', $output, $input );
|
1385 |
-
}
|
1386 |
-
|
1387 |
-
/**
|
1388 |
-
* List templates in plugin folder, theme folder & child theme folder
|
1389 |
-
* @return array template path => template name
|
1390 |
-
*/
|
1391 |
-
public function find_templates() {
|
1392 |
-
global $wpo_wcpdf;
|
1393 |
-
$installed_templates = array();
|
1394 |
-
|
1395 |
-
// get base paths
|
1396 |
-
$template_paths = array (
|
1397 |
-
// note the order: child-theme before theme, so that array_unique filters out parent doubles
|
1398 |
-
'default' => $wpo_wcpdf->export->template_default_base_path,
|
1399 |
-
'child-theme' => get_stylesheet_directory() . '/' . $wpo_wcpdf->export->template_base_path,
|
1400 |
-
'theme' => get_template_directory() . '/' . $wpo_wcpdf->export->template_base_path,
|
1401 |
-
);
|
1402 |
-
|
1403 |
-
$template_paths = apply_filters( 'wpo_wcpdf_template_paths', $template_paths );
|
1404 |
-
|
1405 |
-
foreach ($template_paths as $template_source => $template_path) {
|
1406 |
-
$dirs = (array) glob( $template_path . '*' , GLOB_ONLYDIR);
|
1407 |
-
|
1408 |
-
foreach ($dirs as $dir) {
|
1409 |
-
if ( file_exists($dir."/invoice.php") && file_exists($dir."/packing-slip.php"))
|
1410 |
-
// we're stripping abspath to make the plugin settings more portable
|
1411 |
-
$installed_templates[ str_replace( ABSPATH, '', $dir )] = basename($dir);
|
1412 |
-
}
|
1413 |
-
}
|
1414 |
-
|
1415 |
-
// remove parent doubles
|
1416 |
-
$installed_templates = array_unique($installed_templates);
|
1417 |
-
|
1418 |
-
if (empty($installed_templates)) {
|
1419 |
-
// fallback to Simple template for servers with glob() disabled
|
1420 |
-
$simple_template_path = str_replace( ABSPATH, '', $template_paths['default'] . 'Simple' );
|
1421 |
-
$installed_templates[$simple_template_path] = 'Simple';
|
1422 |
-
}
|
1423 |
-
|
1424 |
-
return apply_filters( 'wpo_wcpdf_templates', $installed_templates );
|
1425 |
-
}
|
1426 |
-
|
1427 |
-
} // end class WooCommerce_PDF_Invoices_Settings
|
1428 |
-
|
1429 |
Â
} // end class_exists
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Settings class
|
5 |
+
*/
|
6 |
+
if ( ! class_exists( 'WooCommerce_PDF_Invoices_Settings' ) ) {
|
7 |
+
|
8 |
+
class WooCommerce_PDF_Invoices_Settings {
|
9 |
+
|
10 |
+
public $options_page_hook;
|
11 |
+
public $general_settings;
|
12 |
+
public $template_settings;
|
13 |
+
|
14 |
+
public function __construct() {
|
15 |
+
add_action( 'admin_menu', array( &$this, 'menu' ) ); // Add menu.
|
16 |
+
add_action( 'admin_init', array( &$this, 'init_settings' ) ); // Registers settings
|
17 |
+
add_filter( 'option_page_capability_wpo_wcpdf_template_settings', array( &$this, 'settings_capabilities' ) );
|
18 |
+
add_filter( 'option_page_capability_wpo_wcpdf_general_settings', array( &$this, 'settings_capabilities' ) );
|
19 |
+
add_action( 'admin_enqueue_scripts', array( &$this, 'load_scripts_styles' ) ); // Load scripts
|
20 |
+
|
21 |
+
// Add links to WordPress plugins page
|
22 |
+
add_filter( 'plugin_action_links_'.WooCommerce_PDF_Invoices::$plugin_basename, array( &$this, 'wpo_wcpdf_add_settings_link' ) );
|
23 |
+
add_filter( 'plugin_row_meta', array( $this, 'add_support_links' ), 10, 2 );
|
24 |
+
|
25 |
+
$this->general_settings = get_option('wpo_wcpdf_general_settings');
|
26 |
+
$this->template_settings = get_option('wpo_wcpdf_template_settings');
|
27 |
+
|
28 |
+
// WooCommerce Order Status & Actions Manager emails compatibility
|
29 |
+
add_filter( 'wpo_wcpdf_wc_emails', array( $this, 'wc_order_status_actions_emails' ), 10, 1 );
|
30 |
+
}
|
31 |
+
|
32 |
+
public function menu() {
|
33 |
+
$parent_slug = 'woocommerce';
|
34 |
+
|
35 |
+
$this->options_page_hook = add_submenu_page(
|
36 |
+
$parent_slug,
|
37 |
+
__( 'PDF Invoices', 'wpo_wcpdf' ),
|
38 |
+
__( 'PDF Invoices', 'wpo_wcpdf' ),
|
39 |
+
'manage_woocommerce',
|
40 |
+
'wpo_wcpdf_options_page',
|
41 |
+
array( $this, 'settings_page' )
|
42 |
+
);
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Set capability for settings page
|
47 |
+
*/
|
48 |
+
public function settings_capabilities() {
|
49 |
+
return 'manage_woocommerce';
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Styles for settings page
|
54 |
+
*/
|
55 |
+
public function load_scripts_styles ( $hook ) {
|
56 |
+
if( $hook != $this->options_page_hook )
|
57 |
+
return;
|
58 |
+
|
59 |
+
wp_enqueue_script(
|
60 |
+
'wcpdf-upload-js',
|
61 |
+
plugins_url( 'js/media-upload.js' , dirname(__FILE__) ),
|
62 |
+
array( 'jquery' ),
|
63 |
+
WooCommerce_PDF_Invoices::$version
|
64 |
+
);
|
65 |
+
|
66 |
+
wp_enqueue_style(
|
67 |
+
'wpo-wcpdf',
|
68 |
+
WooCommerce_PDF_Invoices::$plugin_url . 'css/style.css',
|
69 |
+
array(),
|
70 |
+
WooCommerce_PDF_Invoices::$version
|
71 |
+
);
|
72 |
+
wp_enqueue_media();
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Add settings link to plugins page
|
77 |
+
*/
|
78 |
+
public function wpo_wcpdf_add_settings_link( $links ) {
|
79 |
+
$settings_link = '<a href="admin.php?page=wpo_wcpdf_options_page">'. __( 'Settings', 'woocommerce' ) . '</a>';
|
80 |
+
array_push( $links, $settings_link );
|
81 |
+
return $links;
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Add various support links to plugin page
|
86 |
+
* after meta (version, authors, site)
|
87 |
+
*/
|
88 |
+
public function add_support_links( $links, $file ) {
|
89 |
+
if ( !current_user_can( 'install_plugins' ) ) {
|
90 |
+
return $links;
|
91 |
+
}
|
92 |
+
|
93 |
+
if ( $file == WooCommerce_PDF_Invoices::$plugin_basename ) {
|
94 |
+
// $links[] = '<a href="..." target="_blank" title="' . __( '...', 'wpo_wcpdf' ) . '">' . __( '...', 'wpo_wcpdf' ) . '</a>';
|
95 |
+
}
|
96 |
+
return $links;
|
97 |
+
}
|
98 |
+
|
99 |
+
public function settings_page() {
|
100 |
+
$settings_tabs = apply_filters( 'wpo_wcpdf_settings_tabs', array (
|
101 |
+
'general' => __('General','wpo_wcpdf'),
|
102 |
+
'template' => __('Template','wpo_wcpdf'),
|
103 |
+
)
|
104 |
+
);
|
105 |
+
|
106 |
+
// add status tab last in row
|
107 |
+
$settings_tabs['debug'] = __('Status','wpo_wcpdf');
|
108 |
+
|
109 |
+
$active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'general';
|
110 |
+
|
111 |
+
?>
|
112 |
+
<script type="text/javascript">
|
113 |
+
jQuery( function( $ ) {
|
114 |
+
$("#footer-thankyou").html("If you like <strong>WooCommerce PDF Invoices & Packing Slips</strong> please leave us a <a href='https://wordpress.org/support/view/plugin-reviews/woocommerce-pdf-invoices-packing-slips?rate=5#postform'>★★★★★</a> rating. A huge thank you in advance!");
|
115 |
+
});
|
116 |
+
</script>
|
117 |
+
<div class="wrap">
|
118 |
+
<div class="icon32" id="icon-options-general"><br /></div>
|
119 |
+
<h2><?php _e( 'WooCommerce PDF Invoices', 'wpo_wcpdf' ); ?></h2>
|
120 |
+
<h2 class="nav-tab-wrapper">
|
121 |
+
<?php
|
122 |
+
foreach ($settings_tabs as $tab_slug => $tab_title ) {
|
123 |
+
printf('<a href="?page=wpo_wcpdf_options_page&tab=%1$s" class="nav-tab nav-tab-%1$s %2$s">%3$s</a>', $tab_slug, (($active_tab == $tab_slug) ? 'nav-tab-active' : ''), $tab_title);
|
124 |
+
}
|
125 |
+
?>
|
126 |
+
</h2>
|
127 |
+
|
128 |
+
<?php
|
129 |
+
do_action( 'wpo_wcpdf_before_settings_page', $active_tab );
|
130 |
+
|
131 |
+
// save or check option to hide extensions ad
|
132 |
+
if ( isset( $_GET['wpo_wcpdf_hide_extensions_ad'] ) ) {
|
133 |
+
update_option( 'wpo_wcpdf_hide_extensions_ad', true );
|
134 |
+
$hide_ad = true;
|
135 |
+
} else {
|
136 |
+
$hide_ad = get_option( 'wpo_wcpdf_hide_extensions_ad' );
|
137 |
+
}
|
138 |
+
|
139 |
+
if ( !$hide_ad && !( class_exists('WooCommerce_PDF_IPS_Pro') && class_exists('WooCommerce_PDF_IPS_Dropbox') && class_exists('WooCommerce_PDF_IPS_Templates') && class_exists('WooCommerce_Ext_PrintOrders') ) ) {
|
140 |
+
include('wcpdf-extensions.php');
|
141 |
+
}
|
142 |
+
|
143 |
+
?>
|
144 |
+
<form method="post" action="options.php" id="wpo-wcpdf-settings">
|
145 |
+
<?php
|
146 |
+
do_action( 'wpo_wcpdf_before_settings', $active_tab );
|
147 |
+
settings_fields( 'wpo_wcpdf_'.$active_tab.'_settings' );
|
148 |
+
do_settings_sections( 'wpo_wcpdf_'.$active_tab.'_settings' );
|
149 |
+
do_action( 'wpo_wcpdf_after_settings', $active_tab );
|
150 |
+
|
151 |
+
submit_button();
|
152 |
+
?>
|
153 |
+
|
154 |
+
</form>
|
155 |
+
<?php
|
156 |
+
|
157 |
+
if ( $active_tab=='debug' ) {
|
158 |
+
$this->status_page();
|
159 |
+
}
|
160 |
+
|
161 |
+
do_action( 'wpo_wcpdf_after_settings_page', $active_tab ); ?>
|
162 |
+
|
163 |
+
</div>
|
164 |
+
|
165 |
+
<?php
|
166 |
+
}
|
167 |
+
|
168 |
+
public function status_page() {
|
169 |
+
?>
|
170 |
+
<?php include('dompdf-status.php'); ?>
|
171 |
+
<?php
|
172 |
+
}
|
173 |
+
|
174 |
+
/**
|
175 |
+
* User settings.
|
176 |
+
*
|
177 |
+
*/
|
178 |
+
|
179 |
+
public function init_settings() {
|
180 |
+
global $woocommerce, $wpo_wcpdf;
|
181 |
+
|
182 |
+
// Whether a third-party plugin claims responsibility for generating invoice numbers
|
183 |
+
$invoicenumber_thirdparty = apply_filters('woocommerce_invoice_number_by_plugin', false);
|
184 |
+
|
185 |
+
/**************************************/
|
186 |
+
/*********** GENERAL SETTINGS *********/
|
187 |
+
/**************************************/
|
188 |
+
|
189 |
+
$option = 'wpo_wcpdf_general_settings';
|
190 |
+
|
191 |
+
// Create option in wp_options.
|
192 |
+
if ( false === get_option( $option ) ) {
|
193 |
+
$this->default_settings( $option );
|
194 |
+
}
|
195 |
+
|
196 |
+
// Section.
|
197 |
+
add_settings_section(
|
198 |
+
'general_settings',
|
199 |
+
__( 'General settings', 'wpo_wcpdf' ),
|
200 |
+
array( &$this, 'section_options_callback' ),
|
201 |
+
$option
|
202 |
+
);
|
203 |
+
|
204 |
+
add_settings_field(
|
205 |
+
'download_display',
|
206 |
+
__( 'How do you want to view the PDF?', 'wpo_wcpdf' ),
|
207 |
+
array( &$this, 'select_element_callback' ),
|
208 |
+
$option,
|
209 |
+
'general_settings',
|
210 |
+
array(
|
211 |
+
'menu' => $option,
|
212 |
+
'id' => 'download_display',
|
213 |
+
'options' => array(
|
214 |
+
'download' => __( 'Download the PDF' , 'wpo_wcpdf' ),
|
215 |
+
'display' => __( 'Open the PDF in a new browser tab/window' , 'wpo_wcpdf' ),
|
216 |
+
),
|
217 |
+
)
|
218 |
+
);
|
219 |
+
|
220 |
+
$tmp_path = $wpo_wcpdf->export->tmp_path( 'attachments' );
|
221 |
+
$tmp_path_check = !is_writable( $tmp_path );
|
222 |
+
|
223 |
+
$wc_emails = array(
|
224 |
+
'new_order' => __( 'Admin New Order email' , 'wpo_wcpdf' ),
|
225 |
+
'processing' => __( 'Customer Processing Order email' , 'wpo_wcpdf' ),
|
226 |
+
'completed' => __( 'Customer Completed Order email' , 'wpo_wcpdf' ),
|
227 |
+
'customer_invoice' => __( 'Customer Invoice email' , 'wpo_wcpdf' ),
|
228 |
+
);
|
229 |
+
|
230 |
+
// load custom emails
|
231 |
+
$extra_emails = $this->get_wc_emails();
|
232 |
+
$wc_emails = array_merge( $wc_emails, $extra_emails );
|
233 |
+
|
234 |
+
add_settings_field(
|
235 |
+
'email_pdf',
|
236 |
+
__( 'Attach invoice to:', 'wpo_wcpdf' ),
|
237 |
+
array( &$this, 'multiple_checkbox_element_callback' ),
|
238 |
+
$option,
|
239 |
+
'general_settings',
|
240 |
+
array(
|
241 |
+
'menu' => $option,
|
242 |
+
'id' => 'email_pdf',
|
243 |
+
'options' => apply_filters( 'wpo_wcpdf_wc_emails', $wc_emails ),
|
244 |
+
'description' => $tmp_path_check ? '<span class="wpo-warning">' . sprintf( __( 'It looks like the temp folder (<code>%s</code>) is not writable, check the permissions for this folder! Without having write access to this folder, the plugin will not be able to email invoices.', 'wpo_wcpdf' ), $tmp_path ).'</span>':'',
|
245 |
+
)
|
246 |
+
);
|
247 |
+
|
248 |
+
add_settings_field(
|
249 |
+
'disable_free',
|
250 |
+
__( 'Disable for free products', 'wpo_wcpdf' ),
|
251 |
+
array( &$this, 'checkbox_element_callback' ),
|
252 |
+
$option,
|
253 |
+
'general_settings',
|
254 |
+
array(
|
255 |
+
'menu' => $option,
|
256 |
+
'id' => 'disable_free',
|
257 |
+
'description' => __( "Disable automatic creation/attachment of invoices when only free products are ordered", 'wpo_wcpdf' ),
|
258 |
+
)
|
259 |
+
);
|
260 |
+
|
261 |
+
// Section.
|
262 |
+
add_settings_section(
|
263 |
+
'interface',
|
264 |
+
__( 'Interface', 'wpo_wcpdf' ),
|
265 |
+
array( &$this, 'section_options_callback' ),
|
266 |
+
$option
|
267 |
+
);
|
268 |
+
|
269 |
+
// $documents = array(
|
270 |
+
// 'invoice' => __( 'Invoice', 'wpo_wcpdf' ),
|
271 |
+
// 'packing-slip' => __( 'Packing Slip', 'wpo_wcpdf' ),
|
272 |
+
// );
|
273 |
+
|
274 |
+
// $contexts = array(
|
275 |
+
// 'orders-list' => __( 'Orders list', 'wpo_wcpdf' ),
|
276 |
+
// 'orders-bulk' => __( 'Bulk order actions', 'wpo_wcpdf' ),
|
277 |
+
// 'order-single' => __( 'Single order page', 'wpo_wcpdf' ),
|
278 |
+
// 'my-account' => __( 'My Account page', 'wpo_wcpdf' ),
|
279 |
+
// );
|
280 |
+
|
281 |
+
// add_settings_field(
|
282 |
+
// 'buttons',
|
283 |
+
// __( 'Show download buttons', 'wpo_wcpdf' ),
|
284 |
+
// array( &$this, 'checkbox_table_callback' ),
|
285 |
+
// $option,
|
286 |
+
// 'interface',
|
287 |
+
// array(
|
288 |
+
// 'menu' => $option,
|
289 |
+
// 'id' => 'buttons',
|
290 |
+
// 'rows' => $contexts,
|
291 |
+
// 'columns' => apply_filters( 'wpo_wcpdf_documents_buttons', $documents ),
|
292 |
+
// )
|
293 |
+
// );
|
294 |
+
|
295 |
+
// get list of WooCommerce statuses
|
296 |
+
if ( version_compare( WOOCOMMERCE_VERSION, '2.2', '<' ) ) {
|
297 |
+
$statuses = (array) get_terms( 'shop_order_status', array( 'hide_empty' => 0, 'orderby' => 'id' ) );
|
298 |
+
foreach ( $statuses as $status ) {
|
299 |
+
$order_statuses[esc_attr( $status->slug )] = esc_html__( $status->name, 'woocommerce' );
|
300 |
+
}
|
301 |
+
} else {
|
302 |
+
$statuses = wc_get_order_statuses();
|
303 |
+
foreach ( $statuses as $status_slug => $status ) {
|
304 |
+
$status_slug = 'wc-' === substr( $status_slug, 0, 3 ) ? substr( $status_slug, 3 ) : $status_slug;
|
305 |
+
$order_statuses[$status_slug] = $status;
|
306 |
+
}
|
307 |
+
|
308 |
+
}
|
309 |
+
|
310 |
+
add_settings_field(
|
311 |
+
'my_account_buttons',
|
312 |
+
__( 'Allow My Account invoice download', 'wpo_wcpdf' ),
|
313 |
+
array( &$this, 'select_element_callback' ),
|
314 |
+
$option,
|
315 |
+
'interface',
|
316 |
+
array(
|
317 |
+
'menu' => $option,
|
318 |
+
'id' => 'my_account_buttons',
|
319 |
+
'options' => array(
|
320 |
+
'available' => __( 'Only when an invoice is already created/emailed' , 'wpo_wcpdf' ),
|
321 |
+
'custom' => __( 'Only for specific order statuses (define below)' , 'wpo_wcpdf' ),
|
322 |
+
'always' => __( 'Always' , 'wpo_wcpdf' ),
|
323 |
+
'never' => __( 'Never' , 'wpo_wcpdf' ),
|
324 |
+
),
|
325 |
+
'custom' => array(
|
326 |
+
'type' => 'multiple_checkbox_element_callback',
|
327 |
+
'args' => array(
|
328 |
+
'menu' => $option,
|
329 |
+
'id' => 'my_account_restrict',
|
330 |
+
'options' => $order_statuses,
|
331 |
+
),
|
332 |
+
),
|
333 |
+
)
|
334 |
+
);
|
335 |
+
|
336 |
+
add_settings_field(
|
337 |
+
'invoice_number_column',
|
338 |
+
__( 'Enable invoice number column in the orders list', 'wpo_wcpdf' ),
|
339 |
+
array( &$this, 'checkbox_element_callback' ),
|
340 |
+
$option,
|
341 |
+
'interface',
|
342 |
+
array(
|
343 |
+
'menu' => $option,
|
344 |
+
'id' => 'invoice_number_column',
|
345 |
+
)
|
346 |
+
);
|
347 |
+
|
348 |
+
// Register settings.
|
349 |
+
register_setting( $option, $option, array( &$this, 'validate_options' ) );
|
350 |
+
|
351 |
+
$option_values = get_option($option);
|
352 |
+
// convert old 'statusless' setting to new status array
|
353 |
+
if ( isset( $option_values['email_pdf'] ) && !is_array( $option_values['email_pdf'] ) ) {
|
354 |
+
$default_status = apply_filters( 'wpo_wcpdf_attach_to_status', 'completed' );
|
355 |
+
$option_values['email_pdf'] = array (
|
356 |
+
$default_status => 1,
|
357 |
+
'customer_invoice' => 1,
|
358 |
+
);
|
359 |
+
update_option( $option, $option_values );
|
360 |
+
}
|
361 |
+
|
362 |
+
/**************************************/
|
363 |
+
/********** TEMPLATE SETTINGS *********/
|
364 |
+
/**************************************/
|
365 |
+
|
366 |
+
$option = 'wpo_wcpdf_template_settings';
|
367 |
+
|
368 |
+
// Create option in wp_options.
|
369 |
+
if ( false === get_option( $option ) ) {
|
370 |
+
$this->default_settings( $option );
|
371 |
+
}
|
372 |
+
|
373 |
+
// Section.
|
374 |
+
add_settings_section(
|
375 |
+
'template_settings',
|
376 |
+
__( 'PDF Template settings', 'wpo_wcpdf' ),
|
377 |
+
array( &$this, 'section_options_callback' ),
|
378 |
+
$option
|
379 |
+
);
|
380 |
+
|
381 |
+
|
382 |
+
$theme_path = get_stylesheet_directory() . '/' . $wpo_wcpdf->export->template_base_path;
|
383 |
+
$theme_template_path = substr($theme_path, strpos($theme_path, 'wp-content')) . 'yourtemplate';
|
384 |
+
$plugin_template_path = 'wp-content/plugins/woocommerce-pdf-invoices-packing-slips/templates/pdf/Simple';
|
385 |
+
|
386 |
+
add_settings_field(
|
387 |
+
'template_path',
|
388 |
+
__( 'Choose a template', 'wpo_wcpdf' ),
|
389 |
+
array( &$this, 'template_select_element_callback' ),
|
390 |
+
$option,
|
391 |
+
'template_settings',
|
392 |
+
array(
|
393 |
+
'menu' => $option,
|
394 |
+
'id' => 'template_path',
|
395 |
+
'options' => $this->find_templates(),
|
396 |
+
'description' => sprintf( __( 'Want to use your own template? Copy all the files from <code>%s</code> to your (child) theme in <code>%s</code> to customize them' , 'wpo_wcpdf' ), $plugin_template_path, $theme_template_path),
|
397 |
+
)
|
398 |
+
);
|
399 |
+
|
400 |
+
add_settings_field(
|
401 |
+
'paper_size',
|
402 |
+
__( 'Paper size', 'wpo_wcpdf' ),
|
403 |
+
array( &$this, 'select_element_callback' ),
|
404 |
+
$option,
|
405 |
+
'template_settings',
|
406 |
+
array(
|
407 |
+
'menu' => $option,
|
408 |
+
'id' => 'paper_size',
|
409 |
+
'options' => apply_filters( 'wpo_wcpdf_template_settings_paper_size', array(
|
410 |
+
'a4' => __( 'A4' , 'wpo_wcpdf' ),
|
411 |
+
'letter' => __( 'Letter' , 'wpo_wcpdf' ),
|
412 |
+
) ),
|
413 |
+
)
|
414 |
+
);
|
415 |
+
|
416 |
+
add_settings_field(
|
417 |
+
'header_logo',
|
418 |
+
__( 'Shop header/logo', 'wpo_wcpdf' ),
|
419 |
+
array( &$this, 'media_upload_callback' ),
|
420 |
+
$option,
|
421 |
+
'template_settings',
|
422 |
+
array(
|
423 |
+
'menu' => $option,
|
424 |
+
'id' => 'header_logo',
|
425 |
+
'uploader_title' => __( 'Select or upload your invoice header/logo', 'wpo_wcpdf' ),
|
426 |
+
'uploader_button_text' => __( 'Set image', 'wpo_wcpdf' ),
|
427 |
+
'remove_button_text' => __( 'Remove image', 'wpo_wcpdf' ),
|
428 |
+
//'description' => __( '...', 'wpo_wcpdf' ),
|
429 |
+
)
|
430 |
+
);
|
431 |
+
|
432 |
+
add_settings_field(
|
433 |
+
'shop_name',
|
434 |
+
__( 'Shop Name', 'wpo_wcpdf' ),
|
435 |
+
array( &$this, 'text_element_callback' ),
|
436 |
+
$option,
|
437 |
+
'template_settings',
|
438 |
+
array(
|
439 |
+
'menu' => $option,
|
440 |
+
'id' => 'shop_name',
|
441 |
+
'size' => '72',
|
442 |
+
'translatable' => true,
|
443 |
+
)
|
444 |
+
);
|
445 |
+
|
446 |
+
add_settings_field(
|
447 |
+
'shop_address',
|
448 |
+
__( 'Shop Address', 'wpo_wcpdf' ),
|
449 |
+
array( &$this, 'textarea_element_callback' ),
|
450 |
+
$option,
|
451 |
+
'template_settings',
|
452 |
+
array(
|
453 |
+
'menu' => $option,
|
454 |
+
'id' => 'shop_address',
|
455 |
+
'width' => '72',
|
456 |
+
'height' => '8',
|
457 |
+
'translatable' => true,
|
458 |
+
//'description' => __( '...', 'wpo_wcpdf' ),
|
459 |
+
)
|
460 |
+
);
|
461 |
+
|
462 |
+
add_settings_field(
|
463 |
+
'footer',
|
464 |
+
__( 'Footer: terms & conditions, policies, etc.', 'wpo_wcpdf' ),
|
465 |
+
array( &$this, 'textarea_element_callback' ),
|
466 |
+
$option,
|
467 |
+
'template_settings',
|
468 |
+
array(
|
469 |
+
'menu' => $option,
|
470 |
+
'id' => 'footer',
|
471 |
+
'width' => '72',
|
472 |
+
'height' => '4',
|
473 |
+
'translatable' => true,
|
474 |
+
//'description' => __( '...', 'wpo_wcpdf' ),
|
475 |
+
)
|
476 |
+
);
|
477 |
+
|
478 |
+
// Section.
|
479 |
+
add_settings_section(
|
480 |
+
'invoice',
|
481 |
+
__( 'Invoice', 'wpo_wcpdf' ),
|
482 |
+
array( &$this, 'section_options_callback' ),
|
483 |
+
$option
|
484 |
+
);
|
485 |
+
|
486 |
+
add_settings_field(
|
487 |
+
'invoice_shipping_address',
|
488 |
+
__( 'Display shipping address', 'wpo_wcpdf' ),
|
489 |
+
array( &$this, 'checkbox_element_callback' ),
|
490 |
+
$option,
|
491 |
+
'invoice',
|
492 |
+
array(
|
493 |
+
'menu' => $option,
|
494 |
+
'id' => 'invoice_shipping_address',
|
495 |
+
'description' => __( 'Display shipping address on invoice (in addition to the default billing address) if different from billing address', 'wpo_wcpdf' ),
|
496 |
+
)
|
497 |
+
);
|
498 |
+
|
499 |
+
add_settings_field(
|
500 |
+
'invoice_email',
|
501 |
+
__( 'Display email address', 'wpo_wcpdf' ),
|
502 |
+
array( &$this, 'checkbox_element_callback' ),
|
503 |
+
$option,
|
504 |
+
'invoice',
|
505 |
+
array(
|
506 |
+
'menu' => $option,
|
507 |
+
'id' => 'invoice_email',
|
508 |
+
)
|
509 |
+
);
|
510 |
+
|
511 |
+
add_settings_field(
|
512 |
+
'invoice_phone',
|
513 |
+
__( 'Display phone number', 'wpo_wcpdf' ),
|
514 |
+
array( &$this, 'checkbox_element_callback' ),
|
515 |
+
$option,
|
516 |
+
'invoice',
|
517 |
+
array(
|
518 |
+
'menu' => $option,
|
519 |
+
'id' => 'invoice_phone',
|
520 |
+
)
|
521 |
+
);
|
522 |
+
|
523 |
+
add_settings_field(
|
524 |
+
'display_date',
|
525 |
+
__( 'Display invoice date', 'wpo_wcpdf' ),
|
526 |
+
array( &$this, 'checkbox_element_callback' ),
|
527 |
+
$option,
|
528 |
+
'invoice',
|
529 |
+
array(
|
530 |
+
'menu' => $option,
|
531 |
+
'id' => 'display_date',
|
532 |
+
'value' => 'invoice_date',
|
533 |
+
)
|
534 |
+
);
|
535 |
+
|
536 |
+
if ($invoicenumber_thirdparty) {
|
537 |
+
$invoice_number_desc = __( 'Invoice numbers are created by a third-party extension.', 'yith-woocommerce-pdf-invoice');
|
538 |
+
$config_link = esc_attr(apply_filters('woocommerce_invoice_number_configuration_link', null));
|
539 |
+
if ($config_link) {
|
540 |
+
$invoice_number_desc .= ' '.sprintf(__( 'Configure it <a href="%s">here</a>.', 'yith-woocommerce-pdf-invoice'), $config_link);
|
541 |
+
}
|
542 |
+
$invoice_number_desc = '<i>'.$invoice_number_desc.'</i>';
|
543 |
+
} else {
|
544 |
+
$invoice_number_desc = null;
|
545 |
+
}
|
546 |
+
|
547 |
+
add_settings_field(
|
548 |
+
'display_number',
|
549 |
+
$invoicenumber_thirdparty ? __( 'Display invoice number', 'wpo_wcpdf' ) : __( 'Display built-in sequential invoice number', 'wpo_wcpdf' ),
|
550 |
+
array( &$this, 'checkbox_element_callback' ),
|
551 |
+
$option,
|
552 |
+
'invoice',
|
553 |
+
array(
|
554 |
+
'menu' => $option,
|
555 |
+
'id' => 'display_number',
|
556 |
+
'value' => 'invoice_number',
|
557 |
+
'description' => $invoice_number_desc,
|
558 |
+
)
|
559 |
+
);
|
560 |
+
|
561 |
+
if (!$invoicenumber_thirdparty) {
|
562 |
+
// invoice number is stored separately for direct retrieval
|
563 |
+
register_setting( $option, 'wpo_wcpdf_next_invoice_number', array( &$this, 'validate_options' ) );
|
564 |
+
add_settings_field(
|
565 |
+
'next_invoice_number',
|
566 |
+
__( 'Next invoice number (without prefix/suffix etc.)', 'wpo_wcpdf' ),
|
567 |
+
array( &$this, 'singular_text_element_callback' ),
|
568 |
+
$option,
|
569 |
+
'invoice',
|
570 |
+
array(
|
571 |
+
'menu' => 'wpo_wcpdf_next_invoice_number',
|
572 |
+
'id' => 'next_invoice_number',
|
573 |
+
'size' => '10',
|
574 |
+
'description' => __( 'This is the number that will be used on the next invoice that is created. By default, numbering starts from the WooCommerce Order Number of the first invoice that is created and increases for every new invoice. Note that if you override this and set it lower than the highest (PDF) invoice number, this could create double invoice numbers!', 'wpo_wcpdf' ),
|
575 |
+
)
|
576 |
+
);
|
577 |
+
|
578 |
+
// first time invoice number
|
579 |
+
$next_invoice_number = get_option('wpo_wcpdf_next_invoice_number');
|
580 |
+
// determine highest invoice number if option not set
|
581 |
+
if ( !isset( $next_invoice_number ) ) {
|
582 |
+
// Based on code from WooCommerce Sequential Order Numbers
|
583 |
+
global $wpdb;
|
584 |
+
// get highest invoice_number in postmeta table
|
585 |
+
$max_invoice_number = $wpdb->get_var( 'SELECT max(cast(meta_value as UNSIGNED)) from ' . $wpdb->postmeta . ' where meta_key="_wcpdf_invoice_number"' );
|
586 |
+
|
587 |
+
if ( !empty($max_invoice_number) ) {
|
588 |
+
$next_invoice_number = $max_invoice_number+1;
|
589 |
+
} else {
|
590 |
+
$next_invoice_number = '';
|
591 |
+
}
|
592 |
+
|
593 |
+
update_option( 'wpo_wcpdf_next_invoice_number', $next_invoice_number );
|
594 |
+
}
|
595 |
+
|
596 |
+
add_settings_field(
|
597 |
+
'invoice_number_formatting',
|
598 |
+
__( 'Invoice number format', 'wpo_wcpdf' ),
|
599 |
+
array( &$this, 'invoice_number_formatting_callback' ),
|
600 |
+
$option,
|
601 |
+
'invoice',
|
602 |
+
array(
|
603 |
+
'menu' => $option,
|
604 |
+
'id' => 'invoice_number_formatting',
|
605 |
+
'fields' => array(
|
606 |
+
'prefix' => array(
|
607 |
+
'title' => __( 'Prefix' , 'wpo_wcpdf' ),
|
608 |
+
'size' => 20,
|
609 |
+
'description' => __( 'to use the invoice year and/or month, use [invoice_year] or [invoice_month] respectively' , 'wpo_wcpdf' ),
|
610 |
+
),
|
611 |
+
'suffix' => array(
|
612 |
+
'title' => __( 'Suffix' , 'wpo_wcpdf' ),
|
613 |
+
'size' => 20,
|
614 |
+
'description' => '',
|
615 |
+
),
|
616 |
+
'padding' => array(
|
617 |
+
'title' => __( 'Padding' , 'wpo_wcpdf' ),
|
618 |
+
'size' => 2,
|
619 |
+
'description' => __( 'enter the number of digits here - enter "6" to display 42 as 000042' , 'wpo_wcpdf' ),
|
620 |
+
),
|
621 |
+
),
|
622 |
+
'description' => __( 'note: if you have already created a custom invoice number format with a filter, the above settings will be ignored' , 'wpo_wcpdf' ),
|
623 |
+
)
|
624 |
+
);
|
625 |
+
|
626 |
+
add_settings_field(
|
627 |
+
'yearly_reset_invoice_number',
|
628 |
+
__( 'Reset invoice number yearly', 'wpo_wcpdf' ),
|
629 |
+
array( &$this, 'checkbox_element_callback' ),
|
630 |
+
$option,
|
631 |
+
'invoice',
|
632 |
+
array(
|
633 |
+
'menu' => $option,
|
634 |
+
'id' => 'yearly_reset_invoice_number',
|
635 |
+
)
|
636 |
+
);
|
637 |
+
} // End if ($invoicenumber_thirdparty)
|
638 |
+
|
639 |
+
add_settings_field(
|
640 |
+
'currency_font',
|
641 |
+
__( 'Extended currency symbol support', 'wpo_wcpdf' ),
|
642 |
+
array( &$this, 'checkbox_element_callback' ),
|
643 |
+
$option,
|
644 |
+
'invoice',
|
645 |
+
array(
|
646 |
+
'menu' => $option,
|
647 |
+
'id' => 'currency_font',
|
648 |
+
'description' => __( 'Enable this if your currency symbol is not displaying properly' , 'wpo_wcpdf' ),
|
649 |
+
)
|
650 |
+
);
|
651 |
+
|
652 |
+
// Section.
|
653 |
+
add_settings_section(
|
654 |
+
'packing_slip',
|
655 |
+
__( 'Packing Slip', 'wpo_wcpdf' ),
|
656 |
+
array( &$this, 'section_options_callback' ),
|
657 |
+
$option
|
658 |
+
);
|
659 |
+
|
660 |
+
add_settings_field(
|
661 |
+
'packing_slip_billing_address',
|
662 |
+
__( 'Display billing address', 'wpo_wcpdf' ),
|
663 |
+
array( &$this, 'checkbox_element_callback' ),
|
664 |
+
$option,
|
665 |
+
'packing_slip',
|
666 |
+
array(
|
667 |
+
'menu' => $option,
|
668 |
+
'id' => 'packing_slip_billing_address',
|
669 |
+
'description' => __( 'Display billing address on packing slip (in addition to the default shipping address) if different from shipping address', 'wpo_wcpdf' ),
|
670 |
+
)
|
671 |
+
);
|
672 |
+
|
673 |
+
add_settings_field(
|
674 |
+
'packing_slip_email',
|
675 |
+
__( 'Display email address', 'wpo_wcpdf' ),
|
676 |
+
array( &$this, 'checkbox_element_callback' ),
|
677 |
+
$option,
|
678 |
+
'packing_slip',
|
679 |
+
array(
|
680 |
+
'menu' => $option,
|
681 |
+
'id' => 'packing_slip_email',
|
682 |
+
)
|
683 |
+
);
|
684 |
+
|
685 |
+
add_settings_field(
|
686 |
+
'packing_slip_phone',
|
687 |
+
__( 'Display phone number', 'wpo_wcpdf' ),
|
688 |
+
array( &$this, 'checkbox_element_callback' ),
|
689 |
+
$option,
|
690 |
+
'packing_slip',
|
691 |
+
array(
|
692 |
+
'menu' => $option,
|
693 |
+
'id' => 'packing_slip_phone',
|
694 |
+
)
|
695 |
+
);
|
696 |
+
|
697 |
+
// Section.
|
698 |
+
add_settings_section(
|
699 |
+
'extra_template_fields',
|
700 |
+
__( 'Extra template fields', 'wpo_wcpdf' ),
|
701 |
+
array( &$this, 'custom_fields_section' ),
|
702 |
+
$option
|
703 |
+
);
|
704 |
+
|
705 |
+
add_settings_field(
|
706 |
+
'extra_1',
|
707 |
+
__( 'Extra field 1', 'wpo_wcpdf' ),
|
708 |
+
array( &$this, 'textarea_element_callback' ),
|
709 |
+
$option,
|
710 |
+
'extra_template_fields',
|
711 |
+
array(
|
712 |
+
'menu' => $option,
|
713 |
+
'id' => 'extra_1',
|
714 |
+
'width' => '72',
|
715 |
+
'height' => '8',
|
716 |
+
'description' => __( 'This is footer column 1 in the <i>Modern (Premium)</i> template', 'wpo_wcpdf' ),
|
717 |
+
'translatable' => true,
|
718 |
+
)
|
719 |
+
);
|
720 |
+
|
721 |
+
add_settings_field(
|
722 |
+
'extra_2',
|
723 |
+
__( 'Extra field 2', 'wpo_wcpdf' ),
|
724 |
+
array( &$this, 'textarea_element_callback' ),
|
725 |
+
$option,
|
726 |
+
'extra_template_fields',
|
727 |
+
array(
|
728 |
+
'menu' => $option,
|
729 |
+
'id' => 'extra_2',
|
730 |
+
'width' => '72',
|
731 |
+
'height' => '8',
|
732 |
+
'description' => __( 'This is footer column 2 in the <i>Modern (Premium)</i> template', 'wpo_wcpdf' ),
|
733 |
+
'translatable' => true,
|
734 |
+
)
|
735 |
+
);
|
736 |
+
|
737 |
+
add_settings_field(
|
738 |
+
'extra_3',
|
739 |
+
__( 'Extra field 3', 'wpo_wcpdf' ),
|
740 |
+
array( &$this, 'textarea_element_callback' ),
|
741 |
+
$option,
|
742 |
+
'extra_template_fields',
|
743 |
+
array(
|
744 |
+
'menu' => $option,
|
745 |
+
'id' => 'extra_3',
|
746 |
+
'width' => '72',
|
747 |
+
'height' => '8',
|
748 |
+
'description' => __( 'This is footer column 3 in the <i>Modern (Premium)</i> template', 'wpo_wcpdf' ),
|
749 |
+
'translatable' => true,
|
750 |
+
)
|
751 |
+
);
|
752 |
+
|
753 |
+
// Register settings.
|
754 |
+
register_setting( $option, $option, array( &$this, 'validate_options' ) );
|
755 |
+
|
756 |
+
/**************************************/
|
757 |
+
/******** DEBUG/STATUS SETTINGS *******/
|
758 |
+
/**************************************/
|
759 |
+
|
760 |
+
$option = 'wpo_wcpdf_debug_settings';
|
761 |
+
|
762 |
+
// Create option in wp_options.
|
763 |
+
if ( false === get_option( $option ) ) {
|
764 |
+
$this->default_settings( $option );
|
765 |
+
}
|
766 |
+
|
767 |
+
// Section.
|
768 |
+
add_settings_section(
|
769 |
+
'debug_settings',
|
770 |
+
__( 'Debug settings', 'wpo_wcpdf' ),
|
771 |
+
array( &$this, 'debug_section' ),
|
772 |
+
$option
|
773 |
+
);
|
774 |
+
|
775 |
+
add_settings_field(
|
776 |
+
'enable_debug',
|
777 |
+
__( 'Enable debug output', 'wpo_wcpdf' ),
|
778 |
+
array( &$this, 'checkbox_element_callback' ),
|
779 |
+
$option,
|
780 |
+
'debug_settings',
|
781 |
+
array(
|
782 |
+
'menu' => $option,
|
783 |
+
'id' => 'enable_debug',
|
784 |
+
'description' => __( "Enable this option to output plugin errors if you're getting a blank page or other PDF generation issues", 'wpo_wcpdf' ),
|
785 |
+
)
|
786 |
+
);
|
787 |
+
|
788 |
+
add_settings_field(
|
789 |
+
'html_output',
|
790 |
+
__( 'Output to HTML', 'wpo_wcpdf' ),
|
791 |
+
array( &$this, 'checkbox_element_callback' ),
|
792 |
+
$option,
|
793 |
+
'debug_settings',
|
794 |
+
array(
|
795 |
+
'menu' => $option,
|
796 |
+
'id' => 'html_output',
|
797 |
+
'description' => __( 'Send the template output as HTML to the browser instead of creating a PDF.', 'wpo_wcpdf' ),
|
798 |
+
)
|
799 |
+
);
|
800 |
+
|
801 |
+
add_settings_field(
|
802 |
+
'old_tmp',
|
803 |
+
__( 'Use old tmp folder', 'wpo_wcpdf' ),
|
804 |
+
array( &$this, 'checkbox_element_callback' ),
|
805 |
+
$option,
|
806 |
+
'debug_settings',
|
807 |
+
array(
|
808 |
+
'menu' => $option,
|
809 |
+
'id' => 'old_tmp',
|
810 |
+
'description' => __( 'Before version 1.5 of PDF Invoices, temporary files were stored in the plugin folder. This setting is only intended for backwards compatibility, not recommended on new installs!', 'wpo_wcpdf' ),
|
811 |
+
)
|
812 |
+
);
|
813 |
+
|
814 |
+
// Register settings.
|
815 |
+
register_setting( $option, $option, array( &$this, 'validate_options' ) );
|
816 |
+
|
817 |
+
}
|
818 |
+
|
819 |
+
/**
|
820 |
+
* get all emails registered in WooCommerce
|
821 |
+
* @param boolean $remove_defaults switch to remove default woocommerce emails
|
822 |
+
* @return array $emails list of all email ids/slugs and names
|
823 |
+
*/
|
824 |
+
public function get_wc_emails ( $remove_defaults = true ) {
|
825 |
+
// get emails from WooCommerce
|
826 |
+
global $woocommerce;
|
827 |
+
$mailer = $woocommerce->mailer();
|
828 |
+
$wc_emails = $mailer->get_emails();
|
829 |
+
|
830 |
+
$default_emails = array(
|
831 |
+
'new_order',
|
832 |
+
'customer_processing_order',
|
833 |
+
'customer_completed_order',
|
834 |
+
'customer_invoice',
|
835 |
+
'customer_note',
|
836 |
+
'customer_reset_password',
|
837 |
+
'customer_new_account'
|
838 |
+
);
|
839 |
+
|
840 |
+
$emails = array();
|
841 |
+
foreach ($wc_emails as $name => $template) {
|
842 |
+
if ( !( $remove_defaults && in_array( $template->id, $default_emails ) ) ) {
|
843 |
+
$emails[$template->id] = $template->title;
|
844 |
+
}
|
845 |
+
}
|
846 |
+
|
847 |
+
return $emails;
|
848 |
+
}
|
849 |
+
|
850 |
+
/**
|
851 |
+
* WooCommerce Order Status & Actions Manager emails compatibility
|
852 |
+
*/
|
853 |
+
public function wc_order_status_actions_emails ( $emails ) {
|
854 |
+
// check if WC_Custom_Status class is loaded!
|
855 |
+
if (class_exists('WC_Custom_Status')) {
|
856 |
+
// get list of custom statuses from WooCommerce Custom Order Status & Actions
|
857 |
+
// status slug => status name
|
858 |
+
$custom_statuses = WC_Custom_Status::get_status_list_names();
|
859 |
+
// append _email to slug (=email_id) and add to emails list
|
860 |
+
foreach ($custom_statuses as $status_slug => $status_name) {
|
861 |
+
$emails[$status_slug.'_email'] = $status_name;
|
862 |
+
}
|
863 |
+
}
|
864 |
+
return $emails;
|
865 |
+
}
|
866 |
+
|
867 |
+
/**
|
868 |
+
* Set default settings.
|
869 |
+
*/
|
870 |
+
public function default_settings( $option ) {
|
871 |
+
global $wpo_wcpdf;
|
872 |
+
|
873 |
+
switch ( $option ) {
|
874 |
+
case 'wpo_wcpdf_general_settings':
|
875 |
+
$default = array(
|
876 |
+
'download_display' => 'download',
|
877 |
+
);
|
878 |
+
break;
|
879 |
+
case 'wpo_wcpdf_template_settings':
|
880 |
+
$default = array(
|
881 |
+
'paper_size' => 'a4',
|
882 |
+
'template_path' => $wpo_wcpdf->export->template_default_base_path . 'Simple',
|
883 |
+
// 'invoice_shipping_address' => '1',
|
884 |
+
);
|
885 |
+
break;
|
886 |
+
default:
|
887 |
+
$default = array();
|
888 |
+
break;
|
889 |
+
}
|
890 |
+
|
891 |
+
if ( false === get_option( $option ) ) {
|
892 |
+
add_option( $option, $default );
|
893 |
+
} else {
|
894 |
+
update_option( $option, $default );
|
895 |
+
|
896 |
+
}
|
897 |
+
}
|
898 |
+
|
899 |
+
// Text element callback.
|
900 |
+
public function text_element_callback( $args ) {
|
901 |
+
$menu = $args['menu'];
|
902 |
+
$id = $args['id'];
|
903 |
+
$size = isset( $args['size'] ) ? $args['size'] : '25';
|
904 |
+
$class = isset( $args['translatable'] ) && $args['translatable'] === true ? 'translatable' : '';
|
905 |
+
|
906 |
+
$options = get_option( $menu );
|
907 |
+
|
908 |
+
if ( isset( $options[$id] ) ) {
|
909 |
+
$current = $options[$id];
|
910 |
+
} else {
|
911 |
+
$current = isset( $args['default'] ) ? $args['default'] : '';
|
912 |
+
}
|
913 |
+
|
914 |
+
$html = sprintf( '<input type="text" id="%1$s" name="%2$s[%1$s]" value="%3$s" size="%4$s" class="%5$s"/>', $id, $menu, $current, $size, $class );
|
915 |
+
|
916 |
+
// Displays option description.
|
917 |
+
if ( isset( $args['description'] ) ) {
|
918 |
+
$html .= sprintf( '<p class="description">%s</p>', $args['description'] );
|
919 |
+
}
|
920 |
+
|
921 |
+
echo $html;
|
922 |
+
}
|
923 |
+
|
924 |
+
// Single text option (not part of any settings array)
|
925 |
+
public function singular_text_element_callback( $args ) {
|
926 |
+
$menu = $args['menu'];
|
927 |
+
$id = $args['id'];
|
928 |
+
$size = isset( $args['size'] ) ? $args['size'] : '25';
|
929 |
+
$class = isset( $args['translatable'] ) && $args['translatable'] === true ? 'translatable' : '';
|
930 |
+
|
931 |
+
$option = get_option( $menu );
|
932 |
+
|
933 |
+
if ( isset( $option ) ) {
|
934 |
+
$current = $option;
|
935 |
+
} else {
|
936 |
+
$current = isset( $args['default'] ) ? $args['default'] : '';
|
937 |
+
}
|
938 |
+
|
939 |
+
$html = sprintf( '<input type="text" id="%1$s" name="%2$s" value="%3$s" size="%4$s" class="%5$s"/>', $id, $menu, $current, $size, $class );
|
940 |
+
|
941 |
+
// Displays option description.
|
942 |
+
if ( isset( $args['description'] ) ) {
|
943 |
+
$html .= sprintf( '<p class="description">%s</p>', $args['description'] );
|
944 |
+
}
|
945 |
+
|
946 |
+
echo $html;
|
947 |
+
}
|
948 |
+
|
949 |
+
// Text element callback.
|
950 |
+
public function textarea_element_callback( $args ) {
|
951 |
+
$menu = $args['menu'];
|
952 |
+
$id = $args['id'];
|
953 |
+
$width = $args['width'];
|
954 |
+
$height = $args['height'];
|
955 |
+
$class = isset( $args['translatable'] ) && $args['translatable'] === true ? 'translatable' : '';
|
956 |
+
|
957 |
+
$options = get_option( $menu );
|
958 |
+
|
959 |
+
if ( isset( $options[$id] ) ) {
|
960 |
+
$current = $options[$id];
|
961 |
+
} else {
|
962 |
+
$current = isset( $args['default'] ) ? $args['default'] : '';
|
963 |
+
}
|
964 |
+
|
965 |
+
$html = sprintf( '<textarea id="%1$s" name="%2$s[%1$s]" cols="%4$s" rows="%5$s" class="%6$s"/>%3$s</textarea>', $id, $menu, $current, $width, $height, $class );
|
966 |
+
|
967 |
+
// Displays option description.
|
968 |
+
if ( isset( $args['description'] ) ) {
|
969 |
+
$html .= sprintf( '<p class="description">%s</p>', $args['description'] );
|
970 |
+
}
|
971 |
+
|
972 |
+
echo $html;
|
973 |
+
}
|
974 |
+
|
975 |
+
|
976 |
+
/**
|
977 |
+
* Checkbox field callback.
|
978 |
+
*
|
979 |
+
* @param array $args Field arguments.
|
980 |
+
*
|
981 |
+
* @return string Checkbox field.
|
982 |
+
*/
|
983 |
+
public function checkbox_element_callback( $args ) {
|
984 |
+
$menu = $args['menu'];
|
985 |
+
$id = $args['id'];
|
986 |
+
$value = isset( $args['value'] ) ? $args['value'] : 1;
|
987 |
+
|
988 |
+
$options = get_option( $menu );
|
989 |
+
|
990 |
+
if ( isset( $options[$id] ) ) {
|
991 |
+
$current = $options[$id];
|
992 |
+
} else {
|
993 |
+
$current = isset( $args['default'] ) ? $args['default'] : '';
|
994 |
+
}
|
995 |
+
|
996 |
+
$html = sprintf( '<input type="checkbox" id="%1$s" name="%2$s[%1$s]" value="%3$s"%4$s />', $id, $menu, $value, checked( $value, $current, false ) );
|
997 |
+
|
998 |
+
// Displays option description.
|
999 |
+
if ( isset( $args['description'] ) ) {
|
1000 |
+
$html .= sprintf( '<p class="description">%s</p>', $args['description'] );
|
1001 |
+
}
|
1002 |
+
|
1003 |
+
echo $html;
|
1004 |
+
}
|
1005 |
+
|
1006 |
+
/**
|
1007 |
+
* Multiple Checkbox field callback.
|
1008 |
+
*
|
1009 |
+
* @param array $args Field arguments.
|
1010 |
+
*
|
1011 |
+
* @return string Checkbox field.
|
1012 |
+
*/
|
1013 |
+
public function multiple_checkbox_element_callback( $args ) {
|
1014 |
+
$menu = $args['menu'];
|
1015 |
+
$id = $args['id'];
|
1016 |
+
|
1017 |
+
$options = get_option( $menu );
|
1018 |
+
|
1019 |
+
|
1020 |
+
foreach ( $args['options'] as $key => $label ) {
|
1021 |
+
$current = ( isset( $options[$id][$key] ) ) ? $options[$id][$key] : '';
|
1022 |
+
printf( '<input type="checkbox" id="%1$s[%2$s][%3$s]" name="%1$s[%2$s][%3$s]" value="1"%4$s /> %5$s<br/>', $menu, $id, $key, checked( 1, $current, false ), $label );
|
1023 |
+
}
|
1024 |
+
|
1025 |
+
// Displays option description.
|
1026 |
+
if ( isset( $args['description'] ) ) {
|
1027 |
+
printf( '<p class="description">%s</p>', $args['description'] );
|
1028 |
+
}
|
1029 |
+
}
|
1030 |
+
|
1031 |
+
/**
|
1032 |
+
* Checkbox fields table callback.
|
1033 |
+
*
|
1034 |
+
* @param array $args Field arguments.
|
1035 |
+
*
|
1036 |
+
* @return string Checkbox field.
|
1037 |
+
*/
|
1038 |
+
public function checkbox_table_callback( $args ) {
|
1039 |
+
$menu = $args['menu'];
|
1040 |
+
$id = $args['id'];
|
1041 |
+
|
1042 |
+
$options = get_option( $menu );
|
1043 |
+
|
1044 |
+
$rows = $args['rows'];
|
1045 |
+
$columns = $args['columns'];
|
1046 |
+
|
1047 |
+
?>
|
1048 |
+
<table style="">
|
1049 |
+
<tr>
|
1050 |
+
<td style="padding:0 10px 5px 0;"> </td>
|
1051 |
+
<?php foreach ( $columns as $column => $title ) { ?>
|
1052 |
+
<td style="padding:0 10px 5px 0;"><?php echo $title; ?></td>
|
1053 |
+
<?php } ?>
|
1054 |
+
</tr>
|
1055 |
+
<tr>
|
1056 |
+
<td style="padding: 0;">
|
1057 |
+
<?php foreach ($rows as $row) {
|
1058 |
+
echo $row.'<br/>';
|
1059 |
+
} ?>
|
1060 |
+
</td>
|
1061 |
+
<?php foreach ( $columns as $column => $title ) { ?>
|
1062 |
+
<td style="text-align:center; padding: 0;">
|
1063 |
+
<?php foreach ( $rows as $row => $title ) {
|
1064 |
+
$current = ( isset( $options[$id.'_'.$column][$row] ) ) ? $options[$id.'_'.$column][$row] : '';
|
1065 |
+
$name = sprintf('%1$s[%2$s_%3$s][%4$s]', $menu, $id, $column, $row);
|
1066 |
+
printf( '<input type="checkbox" id="%1$s" name="%1$s" value="1"%2$s /><br/>', $name, checked( 1, $current, false ) );
|
1067 |
+
} ?>
|
1068 |
+
</td>
|
1069 |
+
<?php } ?>
|
1070 |
+
</tr>
|
1071 |
+
</table>
|
1072 |
+
|
1073 |
+
<?php
|
1074 |
+
// Displays option description.
|
1075 |
+
if ( isset( $args['description'] ) ) {
|
1076 |
+
printf( '<p class="description">%s</p>', $args['description'] );
|
1077 |
+
}
|
1078 |
+
}
|
1079 |
+
|
1080 |
+
/**
|
1081 |
+
* Select element callback.
|
1082 |
+
*
|
1083 |
+
* @param array $args Field arguments.
|
1084 |
+
*
|
1085 |
+
* @return string Select field.
|
1086 |
+
*/
|
1087 |
+
public function select_element_callback( $args ) {
|
1088 |
+
$menu = $args['menu'];
|
1089 |
+
$id = $args['id'];
|
1090 |
+
|
1091 |
+
$options = get_option( $menu );
|
1092 |
+
|
1093 |
+
if ( isset( $options[$id] ) ) {
|
1094 |
+
$current = $options[$id];
|
1095 |
+
} else {
|
1096 |
+
$current = isset( $args['default'] ) ? $args['default'] : '';
|
1097 |
+
}
|
1098 |
+
|
1099 |
+
printf( '<select id="%1$s" name="%2$s[%1$s]">', $id, $menu );
|
1100 |
+
|
1101 |
+
foreach ( $args['options'] as $key => $label ) {
|
1102 |
+
printf( '<option value="%s"%s>%s</option>', $key, selected( $current, $key, false ), $label );
|
1103 |
+
}
|
1104 |
+
|
1105 |
+
echo '</select>';
|
1106 |
+
|
1107 |
+
|
1108 |
+
if (isset($args['custom'])) {
|
1109 |
+
$custom = $args['custom'];
|
1110 |
+
|
1111 |
+
$custom_id = $id.'_custom';
|
1112 |
+
|
1113 |
+
printf( '<br/><br/><div id="%s" style="display:none;">', $custom_id );
|
1114 |
+
|
1115 |
+
switch ($custom['type']) {
|
1116 |
+
case 'text_element_callback':
|
1117 |
+
$this->text_element_callback( $custom['args'] );
|
1118 |
+
break;
|
1119 |
+
case 'multiple_text_element_callback':
|
1120 |
+
$this->multiple_text_element_callback( $custom['args'] );
|
1121 |
+
break;
|
1122 |
+
case 'multiple_checkbox_element_callback':
|
1123 |
+
$this->multiple_checkbox_element_callback( $custom['args'] );
|
1124 |
+
break;
|
1125 |
+
default:
|
1126 |
+
break;
|
1127 |
+
}
|
1128 |
+
|
1129 |
+
echo '</div>';
|
1130 |
+
|
1131 |
+
?>
|
1132 |
+
<script type="text/javascript">
|
1133 |
+
jQuery(document).ready(function($) {
|
1134 |
+
function check_<?php echo $id; ?>_custom() {
|
1135 |
+
var custom = $('#<?php echo $id; ?>').val();
|
1136 |
+
if (custom == 'custom') {
|
1137 |
+
$( '#<?php echo $custom_id; ?>').show();
|
1138 |
+
} else {
|
1139 |
+
$( '#<?php echo $custom_id; ?>').hide();
|
1140 |
+
}
|
1141 |
+
}
|
1142 |
+
|
1143 |
+
check_<?php echo $id; ?>_custom();
|
1144 |
+
|
1145 |
+
$( '#<?php echo $id; ?>' ).change(function() {
|
1146 |
+
check_<?php echo $id; ?>_custom();
|
1147 |
+
});
|
1148 |
+
|
1149 |
+
});
|
1150 |
+
</script>
|
1151 |
+
<?php
|
1152 |
+
}
|
1153 |
+
|
1154 |
+
// Displays option description.
|
1155 |
+
if ( isset( $args['description'] ) ) {
|
1156 |
+
printf( '<p class="description">%s</p>', $args['description'] );
|
1157 |
+
}
|
1158 |
+
|
1159 |
+
}
|
1160 |
+
|
1161 |
+
/**
|
1162 |
+
* Displays a radio settings field
|
1163 |
+
*
|
1164 |
+
* @param array $args settings field args
|
1165 |
+
*/
|
1166 |
+
public function radio_element_callback( $args ) {
|
1167 |
+
$menu = $args['menu'];
|
1168 |
+
$id = $args['id'];
|
1169 |
+
|
1170 |
+
$options = get_option( $menu );
|
1171 |
+
|
1172 |
+
if ( isset( $options[$id] ) ) {
|
1173 |
+
$current = $options[$id];
|
1174 |
+
} else {
|
1175 |
+
$current = isset( $args['default'] ) ? $args['default'] : '';
|
1176 |
+
}
|
1177 |
+
|
1178 |
+
$html = '';
|
1179 |
+
foreach ( $args['options'] as $key => $label ) {
|
1180 |
+
$html .= sprintf( '<input type="radio" class="radio" id="%1$s[%2$s][%3$s]" name="%1$s[%2$s]" value="%3$s"%4$s />', $menu, $id, $key, checked( $current, $key, false ) );
|
1181 |
+
$html .= sprintf( '<label for="%1$s[%2$s][%3$s]"> %4$s</label><br>', $menu, $id, $key, $label);
|
1182 |
+
}
|
1183 |
+
|
1184 |
+
// Displays option description.
|
1185 |
+
if ( isset( $args['description'] ) ) {
|
1186 |
+
$html .= sprintf( '<p class="description">%s</p>', $args['description'] );
|
1187 |
+
}
|
1188 |
+
|
1189 |
+
echo $html;
|
1190 |
+
}
|
1191 |
+
|
1192 |
+
/**
|
1193 |
+
* Media upload callback.
|
1194 |
+
*
|
1195 |
+
* @param array $args Field arguments.
|
1196 |
+
*
|
1197 |
+
* @return string Media upload button & preview.
|
1198 |
+
*/
|
1199 |
+
public function media_upload_callback( $args ) {
|
1200 |
+
$menu = $args['menu'];
|
1201 |
+
$id = $args['id'];
|
1202 |
+
$options = get_option( $menu );
|
1203 |
+
|
1204 |
+
if ( isset( $options[$id] ) ) {
|
1205 |
+
$current = $options[$id];
|
1206 |
+
} else {
|
1207 |
+
$current = isset( $args['default'] ) ? $args['default'] : '';
|
1208 |
+
}
|
1209 |
+
|
1210 |
+
$uploader_title = $args['uploader_title'];
|
1211 |
+
$uploader_button_text = $args['uploader_button_text'];
|
1212 |
+
$remove_button_text = $args['remove_button_text'];
|
1213 |
+
|
1214 |
+
$html = '';
|
1215 |
+
if( !empty($current) ) {
|
1216 |
+
$attachment = wp_get_attachment_image_src( $current, 'full', false );
|
1217 |
+
|
1218 |
+
$attachment_src = $attachment[0];
|
1219 |
+
$attachment_width = $attachment[1];
|
1220 |
+
$attachment_height = $attachment[2];
|
1221 |
+
|
1222 |
+
$attachment_resolution = round($attachment_height/(3/2.54));
|
1223 |
+
|
1224 |
+
$html .= sprintf('<img src="%1$s" style="display:block" id="img-%4$s"/>', $attachment_src, $attachment_width, $attachment_height, $id );
|
1225 |
+
$html .= '<div class="attachment-resolution"><p class="description">'.__('Image resolution').': '.$attachment_resolution.'dpi (default height = 3cm)</p></div>';
|
1226 |
+
$html .= sprintf('<span class="button wpo_remove_image_button" data-input_id="%1$s">%2$s</span>', $id, $remove_button_text );
|
1227 |
+
}
|
1228 |
+
|
1229 |
+
$html .= sprintf( '<input id="%1$s" name="%2$s[%1$s]" type="hidden" value="%3$s" />', $id, $menu, $current );
|
1230 |
+
|
1231 |
+
$html .= sprintf( '<span class="button wpo_upload_image_button %4$s" data-uploader_title="%1$s" data-uploader_button_text="%2$s" data-remove_button_text="%3$s" data-input_id="%4$s">%2$s</span>', $uploader_title, $uploader_button_text, $remove_button_text, $id );
|
1232 |
+
|
1233 |
+
// Displays option description.
|
1234 |
+
if ( isset( $args['description'] ) ) {
|
1235 |
+
$html .= sprintf( '<p class="description">%s</p>', $args['description'] );
|
1236 |
+
}
|
1237 |
+
|
1238 |
+
echo $html;
|
1239 |
+
}
|
1240 |
+
|
1241 |
+
/**
|
1242 |
+
* Invoice number formatting callback.
|
1243 |
+
*
|
1244 |
+
* @param array $args Field arguments.
|
1245 |
+
*
|
1246 |
+
* @return string Media upload button & preview.
|
1247 |
+
*/
|
1248 |
+
public function invoice_number_formatting_callback( $args ) {
|
1249 |
+
$menu = $args['menu'];
|
1250 |
+
$fields = $args['fields'];
|
1251 |
+
$options = get_option( $menu );
|
1252 |
+
|
1253 |
+
echo '<table>';
|
1254 |
+
foreach ($fields as $key => $field) {
|
1255 |
+
$id = $args['id'] . '_' . $key;
|
1256 |
+
|
1257 |
+
if ( isset( $options[$id] ) ) {
|
1258 |
+
$current = $options[$id];
|
1259 |
+
} else {
|
1260 |
+
$current = '';
|
1261 |
+
}
|
1262 |
+
|
1263 |
+
$title = $field['title'];
|
1264 |
+
$size = $field['size'];
|
1265 |
+
$description = isset( $field['description'] ) ? '<span style="font-style:italic;">'.$field['description'].'</span>' : '';
|
1266 |
+
|
1267 |
+
echo '<tr>';
|
1268 |
+
printf( '<td style="padding:0 1em 0 0; ">%1$s:</td><td style="padding:0;"><input type="text" id="%2$s" name="%3$s[%2$s]" value="%4$s" size="%5$s"/></td><td style="padding:0 0 0 1em;">%6$s</td>', $title, $id, $menu, $current, $size, $description );
|
1269 |
+
echo '</tr>';
|
1270 |
+
}
|
1271 |
+
echo '</table>';
|
1272 |
+
|
1273 |
+
|
1274 |
+
// Displays option description.
|
1275 |
+
if ( isset( $args['description'] ) ) {
|
1276 |
+
printf( '<p class="description">%s</p>', $args['description'] );
|
1277 |
+
}
|
1278 |
+
|
1279 |
+
// echo $html;
|
1280 |
+
}
|
1281 |
+
|
1282 |
+
|
1283 |
+
/**
|
1284 |
+
* Template select element callback.
|
1285 |
+
*
|
1286 |
+
* @param array $args Field arguments.
|
1287 |
+
*
|
1288 |
+
* @return string Select field.
|
1289 |
+
*/
|
1290 |
+
public function template_select_element_callback( $args ) {
|
1291 |
+
$menu = $args['menu'];
|
1292 |
+
$id = $args['id'];
|
1293 |
+
|
1294 |
+
$options = get_option( $menu );
|
1295 |
+
|
1296 |
+
if ( isset( $options[$id] ) ) {
|
1297 |
+
$current = $options[$id];
|
1298 |
+
} else {
|
1299 |
+
$current = isset( $args['default'] ) ? $args['default'] : '';
|
1300 |
+
}
|
1301 |
+
|
1302 |
+
$html = sprintf( '<select id="%1$s" name="%2$s[%1$s]">', $id, $menu );
|
1303 |
+
|
1304 |
+
// backwards compatible template path (1.4.4+ uses relative paths instead of absolute)
|
1305 |
+
if (strpos($current, ABSPATH) !== false) {
|
1306 |
+
// check if folder exists, then strip site base path.
|
1307 |
+
if ( file_exists( $current ) ) {
|
1308 |
+
$current = str_replace( ABSPATH, '', $current );
|
1309 |
+
}
|
1310 |
+
}
|
1311 |
+
|
1312 |
+
foreach ( $args['options'] as $key => $label ) {
|
1313 |
+
$html .= sprintf( '<option value="%s"%s>%s</option>', $key, selected( $current, $key, false ), $label );
|
1314 |
+
}
|
1315 |
+
|
1316 |
+
$html .= '</select>';
|
1317 |
+
|
1318 |
+
// Displays option description.
|
1319 |
+
if ( isset( $args['description'] ) ) {
|
1320 |
+
$html .= sprintf( '<p class="description">%s</p>', $args['description'] );
|
1321 |
+
}
|
1322 |
+
|
1323 |
+
echo $html;
|
1324 |
+
|
1325 |
+
}
|
1326 |
+
|
1327 |
+
/**
|
1328 |
+
* Section null callback.
|
1329 |
+
*
|
1330 |
+
* @return void.
|
1331 |
+
*/
|
1332 |
+
public function section_options_callback() {
|
1333 |
+
}
|
1334 |
+
|
1335 |
+
/**
|
1336 |
+
* Debug section callback.
|
1337 |
+
*
|
1338 |
+
* @return void.
|
1339 |
+
*/
|
1340 |
+
public function debug_section() {
|
1341 |
+
_e( '<b>Warning!</b> The settings below are meant for debugging/development only. Do not use them on a live website!' , 'wpo_wcpdf' );
|
1342 |
+
}
|
1343 |
+
|
1344 |
+
/**
|
1345 |
+
* Custom fields section callback.
|
1346 |
+
*
|
1347 |
+
* @return void.
|
1348 |
+
*/
|
1349 |
+
public function custom_fields_section() {
|
1350 |
+
_e( 'These are used for the (optional) footer columns in the <em>Modern (Premium)</em> template, but can also be used for other elements in your custom template' , 'wpo_wcpdf' );
|
1351 |
+
}
|
1352 |
+
|
1353 |
+
/**
|
1354 |
+
* Validate options.
|
1355 |
+
*
|
1356 |
+
* @param array $input options to valid.
|
1357 |
+
*
|
1358 |
+
* @return array validated options.
|
1359 |
+
*/
|
1360 |
+
public function validate_options( $input ) {
|
1361 |
+
// Create our array for storing the validated options.
|
1362 |
+
$output = array();
|
1363 |
+
|
1364 |
+
if (empty($input) || !is_array($input)) {
|
1365 |
+
return $input;
|
1366 |
+
}
|
1367 |
+
|
1368 |
+
// Loop through each of the incoming options.
|
1369 |
+
foreach ( $input as $key => $value ) {
|
1370 |
+
|
1371 |
+
// Check to see if the current option has a value. If so, process it.
|
1372 |
+
if ( isset( $input[$key] ) ) {
|
1373 |
+
if ( is_array( $input[$key] ) ) {
|
1374 |
+
foreach ( $input[$key] as $sub_key => $sub_value ) {
|
1375 |
+
$output[$key][$sub_key] = $input[$key][$sub_key];
|
1376 |
+
}
|
1377 |
+
} else {
|
1378 |
+
$output[$key] = $input[$key];
|
1379 |
+
}
|
1380 |
+
}
|
1381 |
+
}
|
1382 |
+
|
1383 |
+
// Return the array processing any additional functions filtered by this action.
|
1384 |
+
return apply_filters( 'wpo_wcpdf_validate_input', $output, $input );
|
1385 |
+
}
|
1386 |
+
|
1387 |
+
/**
|
1388 |
+
* List templates in plugin folder, theme folder & child theme folder
|
1389 |
+
* @return array template path => template name
|
1390 |
+
*/
|
1391 |
+
public function find_templates() {
|
1392 |
+
global $wpo_wcpdf;
|
1393 |
+
$installed_templates = array();
|
1394 |
+
|
1395 |
+
// get base paths
|
1396 |
+
$template_paths = array (
|
1397 |
+
// note the order: child-theme before theme, so that array_unique filters out parent doubles
|
1398 |
+
'default' => $wpo_wcpdf->export->template_default_base_path,
|
1399 |
+
'child-theme' => get_stylesheet_directory() . '/' . $wpo_wcpdf->export->template_base_path,
|
1400 |
+
'theme' => get_template_directory() . '/' . $wpo_wcpdf->export->template_base_path,
|
1401 |
+
);
|
1402 |
+
|
1403 |
+
$template_paths = apply_filters( 'wpo_wcpdf_template_paths', $template_paths );
|
1404 |
+
|
1405 |
+
foreach ($template_paths as $template_source => $template_path) {
|
1406 |
+
$dirs = (array) glob( $template_path . '*' , GLOB_ONLYDIR);
|
1407 |
+
|
1408 |
+
foreach ($dirs as $dir) {
|
1409 |
+
if ( file_exists($dir."/invoice.php") && file_exists($dir."/packing-slip.php"))
|
1410 |
+
// we're stripping abspath to make the plugin settings more portable
|
1411 |
+
$installed_templates[ str_replace( ABSPATH, '', $dir )] = basename($dir);
|
1412 |
+
}
|
1413 |
+
}
|
1414 |
+
|
1415 |
+
// remove parent doubles
|
1416 |
+
$installed_templates = array_unique($installed_templates);
|
1417 |
+
|
1418 |
+
if (empty($installed_templates)) {
|
1419 |
+
// fallback to Simple template for servers with glob() disabled
|
1420 |
+
$simple_template_path = str_replace( ABSPATH, '', $template_paths['default'] . 'Simple' );
|
1421 |
+
$installed_templates[$simple_template_path] = 'Simple';
|
1422 |
+
}
|
1423 |
+
|
1424 |
+
return apply_filters( 'wpo_wcpdf_templates', $installed_templates );
|
1425 |
+
}
|
1426 |
+
|
1427 |
+
} // end class WooCommerce_PDF_Invoices_Settings
|
1428 |
+
|
1429 |
Â
} // end class_exists
|
includes/class-wcpdf-writepanels.php
CHANGED
@@ -1,370 +1,370 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Writepanel class
|
5 |
-
*/
|
6 |
-
if ( !class_exists( 'WooCommerce_PDF_Invoices_Writepanels' ) ) {
|
7 |
-
|
8 |
-
class WooCommerce_PDF_Invoices_Writepanels {
|
9 |
-
public $bulk_actions;
|
10 |
-
|
11 |
-
/**
|
12 |
-
* Constructor
|
13 |
-
*/
|
14 |
-
public function __construct() {
|
15 |
-
$this->general_settings = get_option('wpo_wcpdf_general_settings');
|
16 |
-
$this->template_settings = get_option('wpo_wcpdf_template_settings');
|
17 |
-
|
18 |
-
add_action( 'woocommerce_admin_order_actions_end', array( $this, 'add_listing_actions' ) );
|
19 |
-
add_filter( 'manage_edit-shop_order_columns', array( $this, 'add_invoice_number_column' ), 999 );
|
20 |
-
add_action( 'manage_shop_order_posts_custom_column', array( $this, 'invoice_number_column_data' ), 2 );
|
21 |
-
add_action( 'add_meta_boxes_shop_order', array( $this, 'add_meta_boxes' ) );
|
22 |
-
add_filter( 'woocommerce_my_account_my_orders_actions', array( $this, 'my_account_pdf_link' ), 10, 2 );
|
23 |
-
add_action( 'admin_print_scripts', array( $this, 'add_scripts' ) );
|
24 |
-
add_action( 'admin_print_styles', array( $this, 'add_styles' ) );
|
25 |
-
add_action( 'admin_footer', array( $this, 'bulk_actions' ) );
|
26 |
-
|
27 |
-
add_action( 'save_post', array( $this,'save_invoice_number_date' ) );
|
28 |
-
|
29 |
-
add_filter( 'woocommerce_shop_order_search_fields', array( $this, 'search_fields' ) );
|
30 |
-
|
31 |
-
$this->bulk_actions = array(
|
32 |
-
'invoice' => __( 'PDF Invoices', 'wpo_wcpdf' ),
|
33 |
-
'packing-slip' => __( 'PDF Packing Slips', 'wpo_wcpdf' ),
|
34 |
-
);
|
35 |
-
}
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Add the styles
|
39 |
-
*/
|
40 |
-
public function add_styles() {
|
41 |
-
if( $this->is_order_edit_page() ) {
|
42 |
-
wp_enqueue_style( 'thickbox' );
|
43 |
-
|
44 |
-
wp_enqueue_style(
|
45 |
-
'wpo-wcpdf',
|
46 |
-
WooCommerce_PDF_Invoices::$plugin_url . 'css/style.css',
|
47 |
-
array(),
|
48 |
-
WooCommerce_PDF_Invoices::$version
|
49 |
-
);
|
50 |
-
|
51 |
-
if ( version_compare( WOOCOMMERCE_VERSION, '2.1' ) >= 0 ) {
|
52 |
-
// WC 2.1 or newer (MP6) is used: bigger buttons
|
53 |
-
wp_enqueue_style(
|
54 |
-
'wpo-wcpdf-buttons',
|
55 |
-
WooCommerce_PDF_Invoices::$plugin_url . 'css/style-buttons.css',
|
56 |
-
array(),
|
57 |
-
WooCommerce_PDF_Invoices::$version
|
58 |
-
);
|
59 |
-
} else {
|
60 |
-
// legacy WC 2.0 styles
|
61 |
-
wp_enqueue_style(
|
62 |
-
'wpo-wcpdf-buttons',
|
63 |
-
WooCommerce_PDF_Invoices::$plugin_url . 'css/style-buttons-wc20.css',
|
64 |
-
array(),
|
65 |
-
WooCommerce_PDF_Invoices::$version
|
66 |
-
);
|
67 |
-
}
|
68 |
-
}
|
69 |
-
}
|
70 |
-
|
71 |
-
/**
|
72 |
-
* Add the scripts
|
73 |
-
*/
|
74 |
-
public function add_scripts() {
|
75 |
-
if( $this->is_order_edit_page() ) {
|
76 |
-
wp_enqueue_script(
|
77 |
-
'wpo-wcpdf',
|
78 |
-
WooCommerce_PDF_Invoices::$plugin_url . 'js/script.js',
|
79 |
-
array( 'jquery' ),
|
80 |
-
WooCommerce_PDF_Invoices::$version
|
81 |
-
);
|
82 |
-
wp_localize_script(
|
83 |
-
'wpo-wcpdf',
|
84 |
-
'wpo_wcpdf_ajax',
|
85 |
-
array(
|
86 |
-
// 'ajaxurl' => add_query_arg( 'action', 'generate_wpo_wcpdf', admin_url( 'admin-ajax.php' ) ), // URL to WordPress ajax handling page
|
87 |
-
'ajaxurl' => admin_url( 'admin-ajax.php' ), // URL to WordPress ajax handling page
|
88 |
-
'nonce' => wp_create_nonce('generate_wpo_wcpdf'),
|
89 |
-
'bulk_actions' => array_keys( apply_filters( 'wpo_wcpdf_bulk_actions', $this->bulk_actions ) ),
|
90 |
-
)
|
91 |
-
);
|
92 |
-
}
|
93 |
-
}
|
94 |
-
|
95 |
-
/**
|
96 |
-
* Is order page
|
97 |
-
*/
|
98 |
-
public function is_order_edit_page() {
|
99 |
-
global $post_type;
|
100 |
-
if( $post_type == 'shop_order' ) {
|
101 |
-
return true;
|
102 |
-
} else {
|
103 |
-
return false;
|
104 |
-
}
|
105 |
-
}
|
106 |
-
|
107 |
-
/**
|
108 |
-
* Add PDF actions to the orders listing
|
109 |
-
*/
|
110 |
-
public function add_listing_actions( $order ) {
|
111 |
-
// do not show buttons for trashed orders
|
112 |
-
if ( $order->status == 'trash' ) {
|
113 |
-
return;
|
114 |
-
}
|
115 |
-
|
116 |
-
$listing_actions = array(
|
117 |
-
'invoice' => array (
|
118 |
-
'url' => wp_nonce_url( admin_url( 'admin-ajax.php?action=generate_wpo_wcpdf&template_type=invoice&order_ids=' . $order->id ), 'generate_wpo_wcpdf' ),
|
119 |
-
'img' => WooCommerce_PDF_Invoices::$plugin_url . 'images/invoice.png',
|
120 |
-
'alt' => __( 'PDF Invoice', 'wpo_wcpdf' ),
|
121 |
-
),
|
122 |
-
'packing-slip' => array (
|
123 |
-
'url' => wp_nonce_url( admin_url( 'admin-ajax.php?action=generate_wpo_wcpdf&template_type=packing-slip&order_ids=' . $order->id ), 'generate_wpo_wcpdf' ),
|
124 |
-
'img' => WooCommerce_PDF_Invoices::$plugin_url . 'images/packing-slip.png',
|
125 |
-
'alt' => __( 'PDF Packing Slip', 'wpo_wcpdf' ),
|
126 |
-
),
|
127 |
-
);
|
128 |
-
|
129 |
-
$listing_actions = apply_filters( 'wpo_wcpdf_listing_actions', $listing_actions, $order );
|
130 |
-
|
131 |
-
foreach ($listing_actions as $action => $data) {
|
132 |
-
?>
|
133 |
-
<a href="<?php echo $data['url']; ?>" class="button tips wpo_wcpdf <?php echo $action; ?>" target="_blank" alt="<?php echo $data['alt']; ?>" data-tip="<?php echo $data['alt']; ?>">
|
134 |
-
<img src="<?php echo $data['img']; ?>" alt="<?php echo $data['alt']; ?>" width="16">
|
135 |
-
</a>
|
136 |
-
<?php
|
137 |
-
}
|
138 |
-
}
|
139 |
-
|
140 |
-
/**
|
141 |
-
* Create additional Shop Order column for Invoice Numbers
|
142 |
-
* @param array $columns shop order columns
|
143 |
-
*/
|
144 |
-
public function add_invoice_number_column( $columns ) {
|
145 |
-
// Check user setting
|
146 |
-
if ( !isset($this->general_settings['invoice_number_column'] ) ) {
|
147 |
-
return $columns;
|
148 |
-
}
|
149 |
-
|
150 |
-
// put the column after the Status column
|
151 |
-
$new_columns = array_slice($columns, 0, 2, true) +
|
152 |
-
array( 'pdf_invoice_number' => __( 'Invoice Number', 'wpo_wcpdf' ) ) +
|
153 |
-
array_slice($columns, 2, count($columns) - 1, true) ;
|
154 |
-
return $new_columns;
|
155 |
-
}
|
156 |
-
|
157 |
-
/**
|
158 |
-
* Display Invoice Number in Shop Order column (if available)
|
159 |
-
* @param string $column column slug
|
160 |
-
*/
|
161 |
-
public function invoice_number_column_data( $column ) {
|
162 |
-
global $post, $the_order, $wpo_wcpdf;
|
163 |
-
|
164 |
-
if ( $column == 'pdf_invoice_number' ) {
|
165 |
-
if ( empty( $the_order ) || $the_order->id != $post->ID ) {
|
166 |
-
$order = new WC_Order( $post->ID );
|
167 |
-
echo $wpo_wcpdf->export->get_invoice_number( $order->id );
|
168 |
-
do_action( 'wcpdf_invoice_number_column_end', $order );
|
169 |
-
} else {
|
170 |
-
echo $wpo_wcpdf->export->get_invoice_number( $the_order->id );
|
171 |
-
do_action( 'wcpdf_invoice_number_column_end', $the_order );
|
172 |
-
}
|
173 |
-
}
|
174 |
-
}
|
175 |
-
|
176 |
-
/**
|
177 |
-
* Display download link on My Account page
|
178 |
-
*/
|
179 |
-
public function my_account_pdf_link( $actions, $order ) {
|
180 |
-
$pdf_url = wp_nonce_url( admin_url( 'admin-ajax.php?action=generate_wpo_wcpdf&template_type=invoice&order_ids=' . $order->id . '&my-account'), 'generate_wpo_wcpdf' );
|
181 |
-
|
182 |
-
// check my account button settings
|
183 |
-
if (isset($this->general_settings['my_account_buttons'])) {
|
184 |
-
switch ($this->general_settings['my_account_buttons']) {
|
185 |
-
case 'available':
|
186 |
-
$invoice_allowed = get_post_meta($order->id,'_wcpdf_invoice_exists',true);
|
187 |
-
break;
|
188 |
-
case 'always':
|
189 |
-
$invoice_allowed = true;
|
190 |
-
break;
|
191 |
-
case 'never':
|
192 |
-
$invoice_allowed = false;
|
193 |
-
break;
|
194 |
-
case 'custom':
|
195 |
-
if ( isset( $this->general_settings['my_account_restrict'] ) && in_array( $order->status, array_keys( $this->general_settings['my_account_restrict'] ) ) ) {
|
196 |
-
$invoice_allowed = true;
|
197 |
-
} else {
|
198 |
-
$invoice_allowed = false;
|
199 |
-
}
|
200 |
-
break;
|
201 |
-
}
|
202 |
-
} else {
|
203 |
-
// backwards compatibility
|
204 |
-
$invoice_allowed = get_post_meta($order->id,'_wcpdf_invoice_exists',true);
|
205 |
-
}
|
206 |
-
|
207 |
-
// Check if invoice has been created already or if status allows download (filter your own array of allowed statuses)
|
208 |
-
if ( $invoice_allowed || in_array($order->status, apply_filters( 'wpo_wcpdf_myaccount_allowed_order_statuses', array() ) ) ) {
|
209 |
-
$actions['invoice'] = array(
|
210 |
-
'url' => $pdf_url,
|
211 |
-
'name' => apply_filters( 'wpo_wcpdf_myaccount_button_text', __( 'Download invoice (PDF)', 'wpo_wcpdf' ) )
|
212 |
-
);
|
213 |
-
}
|
214 |
-
|
215 |
-
return apply_filters( 'wpo_wcpdf_myaccount_actions', $actions, $order );
|
216 |
-
}
|
217 |
-
|
218 |
-
/**
|
219 |
-
* Add the meta box on the single order page
|
220 |
-
*/
|
221 |
-
public function add_meta_boxes() {
|
222 |
-
// create PDF buttons
|
223 |
-
add_meta_box(
|
224 |
-
'wpo_wcpdf-box',
|
225 |
-
__( 'Create PDF', 'wpo_wcpdf' ),
|
226 |
-
array( $this, 'sidebar_box_content' ),
|
227 |
-
'shop_order',
|
228 |
-
'side',
|
229 |
-
'default'
|
230 |
-
);
|
231 |
-
|
232 |
-
// Invoice number & date
|
233 |
-
add_meta_box(
|
234 |
-
'wpo_wcpdf-data-input-box',
|
235 |
-
__( 'PDF Invoice data', 'wpo_wcpdf' ),
|
236 |
-
array( $this, 'data_input_box_content' ),
|
237 |
-
'shop_order',
|
238 |
-
'normal',
|
239 |
-
'default'
|
240 |
-
);
|
241 |
-
}
|
242 |
-
|
243 |
-
/**
|
244 |
-
* Create the meta box content on the single order page
|
245 |
-
*/
|
246 |
-
public function sidebar_box_content( $post ) {
|
247 |
-
global $post_id;
|
248 |
-
|
249 |
-
$meta_actions = array(
|
250 |
-
'invoice' => array (
|
251 |
-
'url' => wp_nonce_url( admin_url( 'admin-ajax.php?action=generate_wpo_wcpdf&template_type=invoice&order_ids=' . $post_id ), 'generate_wpo_wcpdf' ),
|
252 |
-
'alt' => esc_attr__( 'PDF Invoice', 'wpo_wcpdf' ),
|
253 |
-
'title' => __( 'PDF Invoice', 'wpo_wcpdf' ),
|
254 |
-
),
|
255 |
-
'packing-slip' => array (
|
256 |
-
'url' => wp_nonce_url( admin_url( 'admin-ajax.php?action=generate_wpo_wcpdf&template_type=packing-slip&order_ids=' . $post_id ), 'generate_wpo_wcpdf' ),
|
257 |
-
'alt' => esc_attr__( 'PDF Packing Slip', 'wpo_wcpdf' ),
|
258 |
-
'title' => __( 'PDF Packing Slip', 'wpo_wcpdf' ),
|
259 |
-
),
|
260 |
-
);
|
261 |
-
|
262 |
-
$meta_actions = apply_filters( 'wpo_wcpdf_meta_box_actions', $meta_actions, $post_id );
|
263 |
-
|
264 |
-
?>
|
265 |
-
<ul class="wpo_wcpdf-actions">
|
266 |
-
<?php
|
267 |
-
foreach ($meta_actions as $action => $data) {
|
268 |
-
printf('<li><a href="%1$s" class="button" target="_blank" alt="%2$s">%3$s</a></li>', $data['url'], $data['alt'],$data['title']);
|
269 |
-
}
|
270 |
-
?>
|
271 |
-
</ul>
|
272 |
-
<?php
|
273 |
-
}
|
274 |
-
|
275 |
-
/**
|
276 |
-
* Add metabox for invoice number & date
|
277 |
-
*/
|
278 |
-
public function data_input_box_content ( $post ) {
|
279 |
-
$invoice_exists = get_post_meta( $post->ID, '_wcpdf_invoice_exists', true );
|
280 |
-
$invoice_number = get_post_meta($post->ID,'_wcpdf_invoice_number',true);
|
281 |
-
$invoice_date = get_post_meta($post->ID,'_wcpdf_invoice_date',true);
|
282 |
-
|
283 |
-
do_action( 'wpo_wcpdf_meta_box_start', $post->ID );
|
284 |
-
|
285 |
-
?>
|
286 |
-
<h4><?php _e( 'Invoice', 'wpo_wcpdf' ) ?></h4>
|
287 |
-
<p class="form-field _wcpdf_invoice_number_field ">
|
288 |
-
<label for="_wcpdf_invoice_number"><?php _e( 'Invoice Number (unformatted!)', 'wpo_wcpdf' ); ?>:</label>
|
289 |
-
<?php if (!empty($invoice_exists)) : ?>
|
290 |
-
<input type="text" class="short" style="" name="_wcpdf_invoice_number" id="_wcpdf_invoice_number" value="<?php echo $invoice_number ?>">
|
291 |
-
<?php else : ?>
|
292 |
-
<input type="text" class="short" style="" name="_wcpdf_invoice_number" id="_wcpdf_invoice_number" value="<?php echo $invoice_number ?>" disabled="disabled" >
|
293 |
-
<?php endif; ?>
|
294 |
-
</p>
|
295 |
-
<p class="form-field form-field-wide">
|
296 |
-
<label for="wcpdf_invoice_date"><?php _e( 'Invoice Date:', 'wpo_wcpdf' ); ?></label>
|
297 |
-
<?php if (!empty($invoice_exists)) : ?>
|
298 |
-
<input type="text" class="date-picker-field" name="wcpdf_invoice_date" id="wcpdf_invoice_date" maxlength="10" value="<?php echo date_i18n( 'Y-m-d', strtotime( $invoice_date ) ); ?>" pattern="[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])" />@<input type="
|
299 |
-
<?php else : ?>
|
300 |
-
<input type="text" class="date-picker-field" name="wcpdf_invoice_date" id="wcpdf_invoice_date" maxlength="10" disabled="disabled" value="" pattern="[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])" />@<input type="
|
301 |
-
<?php endif; ?>
|
302 |
-
</p>
|
303 |
-
<?php
|
304 |
-
|
305 |
-
do_action( 'wpo_wcpdf_meta_box_end', $post->ID );
|
306 |
-
}
|
307 |
-
|
308 |
-
/**
|
309 |
-
* Add actions to menu
|
310 |
-
*/
|
311 |
-
public function bulk_actions() {
|
312 |
-
global $post_type;
|
313 |
-
$bulk_actions = apply_filters( 'wpo_wcpdf_bulk_actions', $this->bulk_actions );
|
314 |
-
|
315 |
-
if ( 'shop_order' == $post_type ) {
|
316 |
-
?>
|
317 |
-
<script type="text/javascript">
|
318 |
-
jQuery(document).ready(function() {
|
319 |
-
<?php foreach ($bulk_actions as $action => $title) { ?>
|
320 |
-
jQuery('<option>').val('<?php echo $action; ?>').html('<?php echo esc_attr( $title ); ?>').appendTo("select[name='action'], select[name='action2']");
|
321 |
-
<?php } ?>
|
322 |
-
});
|
323 |
-
</script>
|
324 |
-
<?php
|
325 |
-
}
|
326 |
-
}
|
327 |
-
|
328 |
-
/**
|
329 |
-
* Save invoice number
|
330 |
-
*/
|
331 |
-
public function save_invoice_number_date($post_id) {
|
332 |
-
global $post_type;
|
333 |
-
if( $post_type == 'shop_order' ) {
|
334 |
-
if ( isset($_POST['_wcpdf_invoice_number']) ) {
|
335 |
-
update_post_meta( $post_id, '_wcpdf_invoice_number', stripslashes( $_POST['_wcpdf_invoice_number'] ));
|
336 |
-
update_post_meta( $post_id, '_wcpdf_invoice_exists', 1 );
|
337 |
-
}
|
338 |
-
|
339 |
-
if ( isset($_POST['wcpdf_invoice_date']) ) {
|
340 |
-
if ( empty($_POST['wcpdf_invoice_date']) ) {
|
341 |
-
delete_post_meta( $post_id, '_wcpdf_invoice_date' );
|
342 |
-
} else {
|
343 |
-
$invoice_date = strtotime( $_POST['wcpdf_invoice_date'] . ' ' . (int) $_POST['wcpdf_invoice_date_hour'] . ':' . (int) $_POST['wcpdf_invoice_date_minute'] . ':00' );
|
344 |
-
$invoice_date = date_i18n( 'Y-m-d H:i:s', $invoice_date );
|
345 |
-
update_post_meta( $post_id, '_wcpdf_invoice_date', $invoice_date );
|
346 |
-
update_post_meta( $post_id, '_wcpdf_invoice_exists', 1 );
|
347 |
-
}
|
348 |
-
}
|
349 |
-
|
350 |
-
if (empty($_POST['wcpdf_invoice_date']) && isset($_POST['_wcpdf_invoice_number'])) {
|
351 |
-
$invoice_date = date_i18n( 'Y-m-d H:i:s', time() );
|
352 |
-
update_post_meta( $post_id, '_wcpdf_invoice_date', $invoice_date );
|
353 |
-
}
|
354 |
-
|
355 |
-
if ( empty($_POST['wcpdf_invoice_date']) && empty($_POST['_wcpdf_invoice_number'])) {
|
356 |
-
delete_post_meta( $post_id, '_wcpdf_invoice_exists' );
|
357 |
-
}
|
358 |
-
}
|
359 |
-
}
|
360 |
-
|
361 |
-
/**
|
362 |
-
* Add invoice number to order search scope
|
363 |
-
*/
|
364 |
-
public function search_fields ( $custom_fields ) {
|
365 |
-
$custom_fields[] = '_wcpdf_invoice_number';
|
366 |
-
$custom_fields[] = '_wcpdf_formatted_invoice_number';
|
367 |
-
return $custom_fields;
|
368 |
-
}
|
369 |
-
}
|
370 |
Â
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Writepanel class
|
5 |
+
*/
|
6 |
+
if ( !class_exists( 'WooCommerce_PDF_Invoices_Writepanels' ) ) {
|
7 |
+
|
8 |
+
class WooCommerce_PDF_Invoices_Writepanels {
|
9 |
+
public $bulk_actions;
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Constructor
|
13 |
+
*/
|
14 |
+
public function __construct() {
|
15 |
+
$this->general_settings = get_option('wpo_wcpdf_general_settings');
|
16 |
+
$this->template_settings = get_option('wpo_wcpdf_template_settings');
|
17 |
+
|
18 |
+
add_action( 'woocommerce_admin_order_actions_end', array( $this, 'add_listing_actions' ) );
|
19 |
+
add_filter( 'manage_edit-shop_order_columns', array( $this, 'add_invoice_number_column' ), 999 );
|
20 |
+
add_action( 'manage_shop_order_posts_custom_column', array( $this, 'invoice_number_column_data' ), 2 );
|
21 |
+
add_action( 'add_meta_boxes_shop_order', array( $this, 'add_meta_boxes' ) );
|
22 |
+
add_filter( 'woocommerce_my_account_my_orders_actions', array( $this, 'my_account_pdf_link' ), 10, 2 );
|
23 |
+
add_action( 'admin_print_scripts', array( $this, 'add_scripts' ) );
|
24 |
+
add_action( 'admin_print_styles', array( $this, 'add_styles' ) );
|
25 |
+
add_action( 'admin_footer', array( $this, 'bulk_actions' ) );
|
26 |
+
|
27 |
+
add_action( 'save_post', array( $this,'save_invoice_number_date' ) );
|
28 |
+
|
29 |
+
add_filter( 'woocommerce_shop_order_search_fields', array( $this, 'search_fields' ) );
|
30 |
+
|
31 |
+
$this->bulk_actions = array(
|
32 |
+
'invoice' => __( 'PDF Invoices', 'wpo_wcpdf' ),
|
33 |
+
'packing-slip' => __( 'PDF Packing Slips', 'wpo_wcpdf' ),
|
34 |
+
);
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Add the styles
|
39 |
+
*/
|
40 |
+
public function add_styles() {
|
41 |
+
if( $this->is_order_edit_page() ) {
|
42 |
+
wp_enqueue_style( 'thickbox' );
|
43 |
+
|
44 |
+
wp_enqueue_style(
|
45 |
+
'wpo-wcpdf',
|
46 |
+
WooCommerce_PDF_Invoices::$plugin_url . 'css/style.css',
|
47 |
+
array(),
|
48 |
+
WooCommerce_PDF_Invoices::$version
|
49 |
+
);
|
50 |
+
|
51 |
+
if ( version_compare( WOOCOMMERCE_VERSION, '2.1' ) >= 0 ) {
|
52 |
+
// WC 2.1 or newer (MP6) is used: bigger buttons
|
53 |
+
wp_enqueue_style(
|
54 |
+
'wpo-wcpdf-buttons',
|
55 |
+
WooCommerce_PDF_Invoices::$plugin_url . 'css/style-buttons.css',
|
56 |
+
array(),
|
57 |
+
WooCommerce_PDF_Invoices::$version
|
58 |
+
);
|
59 |
+
} else {
|
60 |
+
// legacy WC 2.0 styles
|
61 |
+
wp_enqueue_style(
|
62 |
+
'wpo-wcpdf-buttons',
|
63 |
+
WooCommerce_PDF_Invoices::$plugin_url . 'css/style-buttons-wc20.css',
|
64 |
+
array(),
|
65 |
+
WooCommerce_PDF_Invoices::$version
|
66 |
+
);
|
67 |
+
}
|
68 |
+
}
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Add the scripts
|
73 |
+
*/
|
74 |
+
public function add_scripts() {
|
75 |
+
if( $this->is_order_edit_page() ) {
|
76 |
+
wp_enqueue_script(
|
77 |
+
'wpo-wcpdf',
|
78 |
+
WooCommerce_PDF_Invoices::$plugin_url . 'js/script.js',
|
79 |
+
array( 'jquery' ),
|
80 |
+
WooCommerce_PDF_Invoices::$version
|
81 |
+
);
|
82 |
+
wp_localize_script(
|
83 |
+
'wpo-wcpdf',
|
84 |
+
'wpo_wcpdf_ajax',
|
85 |
+
array(
|
86 |
+
// 'ajaxurl' => add_query_arg( 'action', 'generate_wpo_wcpdf', admin_url( 'admin-ajax.php' ) ), // URL to WordPress ajax handling page
|
87 |
+
'ajaxurl' => admin_url( 'admin-ajax.php' ), // URL to WordPress ajax handling page
|
88 |
+
'nonce' => wp_create_nonce('generate_wpo_wcpdf'),
|
89 |
+
'bulk_actions' => array_keys( apply_filters( 'wpo_wcpdf_bulk_actions', $this->bulk_actions ) ),
|
90 |
+
)
|
91 |
+
);
|
92 |
+
}
|
93 |
+
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Is order page
|
97 |
+
*/
|
98 |
+
public function is_order_edit_page() {
|
99 |
+
global $post_type;
|
100 |
+
if( $post_type == 'shop_order' ) {
|
101 |
+
return true;
|
102 |
+
} else {
|
103 |
+
return false;
|
104 |
+
}
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Add PDF actions to the orders listing
|
109 |
+
*/
|
110 |
+
public function add_listing_actions( $order ) {
|
111 |
+
// do not show buttons for trashed orders
|
112 |
+
if ( $order->status == 'trash' ) {
|
113 |
+
return;
|
114 |
+
}
|
115 |
+
|
116 |
+
$listing_actions = array(
|
117 |
+
'invoice' => array (
|
118 |
+
'url' => wp_nonce_url( admin_url( 'admin-ajax.php?action=generate_wpo_wcpdf&template_type=invoice&order_ids=' . $order->id ), 'generate_wpo_wcpdf' ),
|
119 |
+
'img' => WooCommerce_PDF_Invoices::$plugin_url . 'images/invoice.png',
|
120 |
+
'alt' => __( 'PDF Invoice', 'wpo_wcpdf' ),
|
121 |
+
),
|
122 |
+
'packing-slip' => array (
|
123 |
+
'url' => wp_nonce_url( admin_url( 'admin-ajax.php?action=generate_wpo_wcpdf&template_type=packing-slip&order_ids=' . $order->id ), 'generate_wpo_wcpdf' ),
|
124 |
+
'img' => WooCommerce_PDF_Invoices::$plugin_url . 'images/packing-slip.png',
|
125 |
+
'alt' => __( 'PDF Packing Slip', 'wpo_wcpdf' ),
|
126 |
+
),
|
127 |
+
);
|
128 |
+
|
129 |
+
$listing_actions = apply_filters( 'wpo_wcpdf_listing_actions', $listing_actions, $order );
|
130 |
+
|
131 |
+
foreach ($listing_actions as $action => $data) {
|
132 |
+
?>
|
133 |
+
<a href="<?php echo $data['url']; ?>" class="button tips wpo_wcpdf <?php echo $action; ?>" target="_blank" alt="<?php echo $data['alt']; ?>" data-tip="<?php echo $data['alt']; ?>">
|
134 |
+
<img src="<?php echo $data['img']; ?>" alt="<?php echo $data['alt']; ?>" width="16">
|
135 |
+
</a>
|
136 |
+
<?php
|
137 |
+
}
|
138 |
+
}
|
139 |
+
|
140 |
+
/**
|
141 |
+
* Create additional Shop Order column for Invoice Numbers
|
142 |
+
* @param array $columns shop order columns
|
143 |
+
*/
|
144 |
+
public function add_invoice_number_column( $columns ) {
|
145 |
+
// Check user setting
|
146 |
+
if ( !isset($this->general_settings['invoice_number_column'] ) ) {
|
147 |
+
return $columns;
|
148 |
+
}
|
149 |
+
|
150 |
+
// put the column after the Status column
|
151 |
+
$new_columns = array_slice($columns, 0, 2, true) +
|
152 |
+
array( 'pdf_invoice_number' => __( 'Invoice Number', 'wpo_wcpdf' ) ) +
|
153 |
+
array_slice($columns, 2, count($columns) - 1, true) ;
|
154 |
+
return $new_columns;
|
155 |
+
}
|
156 |
+
|
157 |
+
/**
|
158 |
+
* Display Invoice Number in Shop Order column (if available)
|
159 |
+
* @param string $column column slug
|
160 |
+
*/
|
161 |
+
public function invoice_number_column_data( $column ) {
|
162 |
+
global $post, $the_order, $wpo_wcpdf;
|
163 |
+
|
164 |
+
if ( $column == 'pdf_invoice_number' ) {
|
165 |
+
if ( empty( $the_order ) || $the_order->id != $post->ID ) {
|
166 |
+
$order = new WC_Order( $post->ID );
|
167 |
+
echo $wpo_wcpdf->export->get_invoice_number( $order->id );
|
168 |
+
do_action( 'wcpdf_invoice_number_column_end', $order );
|
169 |
+
} else {
|
170 |
+
echo $wpo_wcpdf->export->get_invoice_number( $the_order->id );
|
171 |
+
do_action( 'wcpdf_invoice_number_column_end', $the_order );
|
172 |
+
}
|
173 |
+
}
|
174 |
+
}
|
175 |
+
|
176 |
+
/**
|
177 |
+
* Display download link on My Account page
|
178 |
+
*/
|
179 |
+
public function my_account_pdf_link( $actions, $order ) {
|
180 |
+
$pdf_url = wp_nonce_url( admin_url( 'admin-ajax.php?action=generate_wpo_wcpdf&template_type=invoice&order_ids=' . $order->id . '&my-account'), 'generate_wpo_wcpdf' );
|
181 |
+
|
182 |
+
// check my account button settings
|
183 |
+
if (isset($this->general_settings['my_account_buttons'])) {
|
184 |
+
switch ($this->general_settings['my_account_buttons']) {
|
185 |
+
case 'available':
|
186 |
+
$invoice_allowed = get_post_meta($order->id,'_wcpdf_invoice_exists',true);
|
187 |
+
break;
|
188 |
+
case 'always':
|
189 |
+
$invoice_allowed = true;
|
190 |
+
break;
|
191 |
+
case 'never':
|
192 |
+
$invoice_allowed = false;
|
193 |
+
break;
|
194 |
+
case 'custom':
|
195 |
+
if ( isset( $this->general_settings['my_account_restrict'] ) && in_array( $order->status, array_keys( $this->general_settings['my_account_restrict'] ) ) ) {
|
196 |
+
$invoice_allowed = true;
|
197 |
+
} else {
|
198 |
+
$invoice_allowed = false;
|
199 |
+
}
|
200 |
+
break;
|
201 |
+
}
|
202 |
+
} else {
|
203 |
+
// backwards compatibility
|
204 |
+
$invoice_allowed = get_post_meta($order->id,'_wcpdf_invoice_exists',true);
|
205 |
+
}
|
206 |
+
|
207 |
+
// Check if invoice has been created already or if status allows download (filter your own array of allowed statuses)
|
208 |
+
if ( $invoice_allowed || in_array($order->status, apply_filters( 'wpo_wcpdf_myaccount_allowed_order_statuses', array() ) ) ) {
|
209 |
+
$actions['invoice'] = array(
|
210 |
+
'url' => $pdf_url,
|
211 |
+
'name' => apply_filters( 'wpo_wcpdf_myaccount_button_text', __( 'Download invoice (PDF)', 'wpo_wcpdf' ) )
|
212 |
+
);
|
213 |
+
}
|
214 |
+
|
215 |
+
return apply_filters( 'wpo_wcpdf_myaccount_actions', $actions, $order );
|
216 |
+
}
|
217 |
+
|
218 |
+
/**
|
219 |
+
* Add the meta box on the single order page
|
220 |
+
*/
|
221 |
+
public function add_meta_boxes() {
|
222 |
+
// create PDF buttons
|
223 |
+
add_meta_box(
|
224 |
+
'wpo_wcpdf-box',
|
225 |
+
__( 'Create PDF', 'wpo_wcpdf' ),
|
226 |
+
array( $this, 'sidebar_box_content' ),
|
227 |
+
'shop_order',
|
228 |
+
'side',
|
229 |
+
'default'
|
230 |
+
);
|
231 |
+
|
232 |
+
// Invoice number & date
|
233 |
+
add_meta_box(
|
234 |
+
'wpo_wcpdf-data-input-box',
|
235 |
+
__( 'PDF Invoice data', 'wpo_wcpdf' ),
|
236 |
+
array( $this, 'data_input_box_content' ),
|
237 |
+
'shop_order',
|
238 |
+
'normal',
|
239 |
+
'default'
|
240 |
+
);
|
241 |
+
}
|
242 |
+
|
243 |
+
/**
|
244 |
+
* Create the meta box content on the single order page
|
245 |
+
*/
|
246 |
+
public function sidebar_box_content( $post ) {
|
247 |
+
global $post_id;
|
248 |
+
|
249 |
+
$meta_actions = array(
|
250 |
+
'invoice' => array (
|
251 |
+
'url' => wp_nonce_url( admin_url( 'admin-ajax.php?action=generate_wpo_wcpdf&template_type=invoice&order_ids=' . $post_id ), 'generate_wpo_wcpdf' ),
|
252 |
+
'alt' => esc_attr__( 'PDF Invoice', 'wpo_wcpdf' ),
|
253 |
+
'title' => __( 'PDF Invoice', 'wpo_wcpdf' ),
|
254 |
+
),
|
255 |
+
'packing-slip' => array (
|
256 |
+
'url' => wp_nonce_url( admin_url( 'admin-ajax.php?action=generate_wpo_wcpdf&template_type=packing-slip&order_ids=' . $post_id ), 'generate_wpo_wcpdf' ),
|
257 |
+
'alt' => esc_attr__( 'PDF Packing Slip', 'wpo_wcpdf' ),
|
258 |
+
'title' => __( 'PDF Packing Slip', 'wpo_wcpdf' ),
|
259 |
+
),
|
260 |
+
);
|
261 |
+
|
262 |
+
$meta_actions = apply_filters( 'wpo_wcpdf_meta_box_actions', $meta_actions, $post_id );
|
263 |
+
|
264 |
+
?>
|
265 |
+
<ul class="wpo_wcpdf-actions">
|
266 |
+
<?php
|
267 |
+
foreach ($meta_actions as $action => $data) {
|
268 |
+
printf('<li><a href="%1$s" class="button" target="_blank" alt="%2$s">%3$s</a></li>', $data['url'], $data['alt'],$data['title']);
|
269 |
+
}
|
270 |
+
?>
|
271 |
+
</ul>
|
272 |
+
<?php
|
273 |
+
}
|
274 |
+
|
275 |
+
/**
|
276 |
+
* Add metabox for invoice number & date
|
277 |
+
*/
|
278 |
+
public function data_input_box_content ( $post ) {
|
279 |
+
$invoice_exists = get_post_meta( $post->ID, '_wcpdf_invoice_exists', true );
|
280 |
+
$invoice_number = get_post_meta($post->ID,'_wcpdf_invoice_number',true);
|
281 |
+
$invoice_date = get_post_meta($post->ID,'_wcpdf_invoice_date',true);
|
282 |
+
|
283 |
+
do_action( 'wpo_wcpdf_meta_box_start', $post->ID );
|
284 |
+
|
285 |
+
?>
|
286 |
+
<h4><?php _e( 'Invoice', 'wpo_wcpdf' ) ?></h4>
|
287 |
+
<p class="form-field _wcpdf_invoice_number_field ">
|
288 |
+
<label for="_wcpdf_invoice_number"><?php _e( 'Invoice Number (unformatted!)', 'wpo_wcpdf' ); ?>:</label>
|
289 |
+
<?php if (!empty($invoice_exists)) : ?>
|
290 |
+
<input type="text" class="short" style="" name="_wcpdf_invoice_number" id="_wcpdf_invoice_number" value="<?php echo $invoice_number ?>">
|
291 |
+
<?php else : ?>
|
292 |
+
<input type="text" class="short" style="" name="_wcpdf_invoice_number" id="_wcpdf_invoice_number" value="<?php echo $invoice_number ?>" disabled="disabled" >
|
293 |
+
<?php endif; ?>
|
294 |
+
</p>
|
295 |
+
<p class="form-field form-field-wide">
|
296 |
+
<label for="wcpdf_invoice_date"><?php _e( 'Invoice Date:', 'wpo_wcpdf' ); ?></label>
|
297 |
+
<?php if (!empty($invoice_exists)) : ?>
|
298 |
+
<input type="text" class="date-picker-field" name="wcpdf_invoice_date" id="wcpdf_invoice_date" maxlength="10" value="<?php echo date_i18n( 'Y-m-d', strtotime( $invoice_date ) ); ?>" pattern="[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])" />@<input type="number" class="hour" placeholder="<?php _e( 'h', 'woocommerce' ) ?>" name="wcpdf_invoice_date_hour" id="wcpdf_invoice_date_hour" min="0" max="23" size="2" value="<?php echo date_i18n( 'H', strtotime( $invoice_date ) ); ?>" pattern="([01]?[0-9]{1}|2[0-3]{1})" />:<input type="number" class="minute" placeholder="<?php _e( 'm', 'woocommerce' ) ?>" name="wcpdf_invoice_date_minute" id="wcpdf_invoice_date_minute" min="0" max="59" size="2" value="<?php echo date_i18n( 'i', strtotime( $invoice_date ) ); ?>" pattern="[0-5]{1}[0-9]{1}" />
|
299 |
+
<?php else : ?>
|
300 |
+
<input type="text" class="date-picker-field" name="wcpdf_invoice_date" id="wcpdf_invoice_date" maxlength="10" disabled="disabled" value="" pattern="[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])" />@<input type="number" class="hour" disabled="disabled" placeholder="<?php _e( 'h', 'woocommerce' ) ?>" name="wcpdf_invoice_date_hour" id="wcpdf_invoice_date_hour" min="0" max="23" size="2" value="" pattern="([01]?[0-9]{1}|2[0-3]{1})" />:<input type="number" class="minute" placeholder="<?php _e( 'm', 'woocommerce' ) ?>" name="wcpdf_invoice_date_minute" id="wcpdf_invoice_date_minute" min="0" max="59" size="2" value="" pattern="[0-5]{1}[0-9]{1}" disabled="disabled" />
|
301 |
+
<?php endif; ?>
|
302 |
+
</p>
|
303 |
+
<?php
|
304 |
+
|
305 |
+
do_action( 'wpo_wcpdf_meta_box_end', $post->ID );
|
306 |
+
}
|
307 |
+
|
308 |
+
/**
|
309 |
+
* Add actions to menu
|
310 |
+
*/
|
311 |
+
public function bulk_actions() {
|
312 |
+
global $post_type;
|
313 |
+
$bulk_actions = apply_filters( 'wpo_wcpdf_bulk_actions', $this->bulk_actions );
|
314 |
+
|
315 |
+
if ( 'shop_order' == $post_type ) {
|
316 |
+
?>
|
317 |
+
<script type="text/javascript">
|
318 |
+
jQuery(document).ready(function() {
|
319 |
+
<?php foreach ($bulk_actions as $action => $title) { ?>
|
320 |
+
jQuery('<option>').val('<?php echo $action; ?>').html('<?php echo esc_attr( $title ); ?>').appendTo("select[name='action'], select[name='action2']");
|
321 |
+
<?php } ?>
|
322 |
+
});
|
323 |
+
</script>
|
324 |
+
<?php
|
325 |
+
}
|
326 |
+
}
|
327 |
+
|
328 |
+
/**
|
329 |
+
* Save invoice number
|
330 |
+
*/
|
331 |
+
public function save_invoice_number_date($post_id) {
|
332 |
+
global $post_type;
|
333 |
+
if( $post_type == 'shop_order' ) {
|
334 |
+
if ( isset($_POST['_wcpdf_invoice_number']) ) {
|
335 |
+
update_post_meta( $post_id, '_wcpdf_invoice_number', stripslashes( $_POST['_wcpdf_invoice_number'] ));
|
336 |
+
update_post_meta( $post_id, '_wcpdf_invoice_exists', 1 );
|
337 |
+
}
|
338 |
+
|
339 |
+
if ( isset($_POST['wcpdf_invoice_date']) ) {
|
340 |
+
if ( empty($_POST['wcpdf_invoice_date']) ) {
|
341 |
+
delete_post_meta( $post_id, '_wcpdf_invoice_date' );
|
342 |
+
} else {
|
343 |
+
$invoice_date = strtotime( $_POST['wcpdf_invoice_date'] . ' ' . (int) $_POST['wcpdf_invoice_date_hour'] . ':' . (int) $_POST['wcpdf_invoice_date_minute'] . ':00' );
|
344 |
+
$invoice_date = date_i18n( 'Y-m-d H:i:s', $invoice_date );
|
345 |
+
update_post_meta( $post_id, '_wcpdf_invoice_date', $invoice_date );
|
346 |
+
update_post_meta( $post_id, '_wcpdf_invoice_exists', 1 );
|
347 |
+
}
|
348 |
+
}
|
349 |
+
|
350 |
+
if (empty($_POST['wcpdf_invoice_date']) && isset($_POST['_wcpdf_invoice_number'])) {
|
351 |
+
$invoice_date = date_i18n( 'Y-m-d H:i:s', time() );
|
352 |
+
update_post_meta( $post_id, '_wcpdf_invoice_date', $invoice_date );
|
353 |
+
}
|
354 |
+
|
355 |
+
if ( empty($_POST['wcpdf_invoice_date']) && empty($_POST['_wcpdf_invoice_number'])) {
|
356 |
+
delete_post_meta( $post_id, '_wcpdf_invoice_exists' );
|
357 |
+
}
|
358 |
+
}
|
359 |
+
}
|
360 |
+
|
361 |
+
/**
|
362 |
+
* Add invoice number to order search scope
|
363 |
+
*/
|
364 |
+
public function search_fields ( $custom_fields ) {
|
365 |
+
$custom_fields[] = '_wcpdf_invoice_number';
|
366 |
+
$custom_fields[] = '_wcpdf_formatted_invoice_number';
|
367 |
+
return $custom_fields;
|
368 |
+
}
|
369 |
+
}
|
370 |
Â
}
|
includes/wcpdf-extensions.php
CHANGED
@@ -10,14 +10,43 @@ jQuery(document).ready(function() {
|
|
10 |
Â
</script>
|
11 |
Â
|
12 |
Â
<div class="wcpdf-extensions-ad">
|
13 |
-
|
14 |
Â
<img src="<?php echo WooCommerce_PDF_Invoices::$plugin_url . 'images/wpo-helper.png'; ?>" class="wpo-helper">
|
15 |
Â
<h3><?php _e( 'Check out these premium extensions!', 'wpo_wcpdf' ); ?></h3>
|
16 |
Â
<i>(<?php _e( 'click items to read more', 'wpo_wcpdf' ); ?>)</i>
|
17 |
Â
<ul class="extensions">
|
18 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
19 |
Â
<?php
|
20 |
-
|
Â
|
|
21 |
Â
?>
|
22 |
Â
<li>
|
23 |
Â
<?php _e('Go Pro: Proforma invoices, credit notes (=refunds) & more!', 'wpo_wcpdf')?>
|
@@ -36,7 +65,27 @@ jQuery(document).ready(function() {
|
|
36 |
Â
<?php } ?>
|
37 |
Â
|
38 |
Â
<?php
|
39 |
-
if (!class_exists('
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
40 |
Â
?>
|
41 |
Â
<li>
|
42 |
Â
<?php _e('Upload all invoices automatically to your dropbox', 'wpo_wcpdf')?>
|
@@ -74,7 +123,7 @@ jQuery(document).ready(function() {
|
|
74 |
Â
<?php } ?>
|
75 |
Â
|
76 |
Â
<?php
|
77 |
-
if (!class_exists('WooCommerce_PDF_IPS_Templates')) {
|
78 |
Â
$template_link = '<a href="https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-premium-templates/" target="_blank">wpovernight.com</a>';
|
79 |
Â
$email_link = '<a href="mailto:support@wpovernight.com">support@wpovernight.com</a>'
|
80 |
Â
?>
|
@@ -93,7 +142,7 @@ jQuery(document).ready(function() {
|
|
93 |
Â
</ul>
|
94 |
Â
<?php
|
95 |
Â
// link to hide message when one of the premium extensions is installed
|
96 |
-
if ( class_exists('WooCommerce_PDF_IPS_Pro') || class_exists('WooCommerce_PDF_IPS_Dropbox') || class_exists('WooCommerce_PDF_IPS_Templates') || class_exists('WooCommerce_Ext_PrintOrders') ) {
|
97 |
Â
printf('<a href="%s" style="display:inline-block; margin-top: 10px;">%s</a>', add_query_arg( 'wpo_wcpdf_hide_extensions_ad', 'true' ), __( 'Hide this message', 'wpo_wcpdf' ) );
|
98 |
Â
}
|
99 |
Â
?>
|
10 |
Â
</script>
|
11 |
Â
|
12 |
Â
<div class="wcpdf-extensions-ad">
|
13 |
+
<?php $no_pro = !class_exists('WooCommerce_PDF_IPS_Pro') && !class_exists('WooCommerce_PDF_IPS_Dropbox') && !class_exists('WooCommerce_PDF_IPS_Templates'); ?>
|
14 |
Â
<img src="<?php echo WooCommerce_PDF_Invoices::$plugin_url . 'images/wpo-helper.png'; ?>" class="wpo-helper">
|
15 |
Â
<h3><?php _e( 'Check out these premium extensions!', 'wpo_wcpdf' ); ?></h3>
|
16 |
Â
<i>(<?php _e( 'click items to read more', 'wpo_wcpdf' ); ?>)</i>
|
17 |
Â
<ul class="extensions">
|
18 |
+
<?php if ( $no_pro ): ?>
|
19 |
+
<!-- No Pro extensions: Ad for PDF bundle -->
|
20 |
+
<li>
|
21 |
+
<?php _e('Premium PDF Invoice bundle: Everything you need for a perfect invoicing system', 'wpo_wcpdf')?>
|
22 |
+
<div class="more" style="display:none;">
|
23 |
+
<h4><?php _e( 'Supercharge WooCommerce PDF Invoices & Packing Slips with the all our premium extensions:', 'wpo_wcpdf' ); ?></h4>
|
24 |
+
<?php _e( 'Professional features:', 'wpo_wcpdf' ); ?>
|
25 |
+
<ul>
|
26 |
+
<li><?php _e( 'Email/print/download <b>PDF Credit Notes & Proforma invoices</b>', 'wpo_wcpdf' ); ?></li>
|
27 |
+
<li><?php _e( 'Send out a separate <b>notification email</b> with (or without) PDF invoices/packing slips, for example to a drop-shipper or a supplier.', 'wpo_wcpdf' ); ?></li>
|
28 |
+
<li><?php _e( 'Attach <b>up to 3 static files</b> (for example a terms & conditions document) to the WooCommerce emails of your choice.', 'wpo_wcpdf' ); ?></li>
|
29 |
+
<li><?php _e( 'Use <b>separate numbering systems</b> and/or format for proforma invoices and credit notes or utilize the main invoice numbering system', 'wpo_wcpdf' ); ?></li>
|
30 |
+
<li><?php _e( '<b>Customize</b> the <b>shipping & billing address</b> format to include additional custom fields, font sizes etc. without the need to create a custom template.', 'wpo_wcpdf' ); ?></li>
|
31 |
+
<li><?php _e( 'Use the plugin in multilingual <b>WPML</b> setups', 'wpo_wcpdf' ); ?></li>
|
32 |
+
</ul>
|
33 |
+
<?php _e('Advanced, customizable templates', 'wpo_wcpdf')?>
|
34 |
+
<ul>
|
35 |
+
<li><?php _e( 'Completely customize the invoice contents (prices, taxes, thumbnails) to your needs with a drag & drop customizer', 'wpo_wcpdf' ); ?></li>
|
36 |
+
<li><?php _e( 'Two extra stylish premade templates (Modern & Business)', 'wpo_wcpdf' ); ?></li>
|
37 |
+
</ul>
|
38 |
+
<?php _e('Upload automatically to dropbox', 'wpo_wcpdf')?>
|
39 |
+
<ul>
|
40 |
+
<li><?php _e( 'This extension conveniently uploads all the invoices (and other pdf documents from the professional extension) that are emailed to your customers to Dropbox. The best way to keep your invoice administration up to date!', 'wpo_wcpdf' ); ?></li>
|
41 |
+
</ul>
|
42 |
+
<br>
|
43 |
+
<a href="https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-bundle/" target="_blank"><?php _e("Get WooCommerce PDF Invoices & Packing Slips Bundle", 'wpo_wcpdf'); ?></a>
|
44 |
+
</div>
|
45 |
+
</li>
|
46 |
+
<?php endif; ?>
|
47 |
Â
<?php
|
48 |
+
// NO BUNDLE: separate ads
|
49 |
+
if (!class_exists('WooCommerce_PDF_IPS_Pro') && !$no_pro) {
|
50 |
Â
?>
|
51 |
Â
<li>
|
52 |
Â
<?php _e('Go Pro: Proforma invoices, credit notes (=refunds) & more!', 'wpo_wcpdf')?>
|
65 |
Â
<?php } ?>
|
66 |
Â
|
67 |
Â
<?php
|
68 |
+
if (!class_exists('WPO_WC_Smart_Reminder_Emails')) {
|
69 |
+
?>
|
70 |
+
<li>
|
71 |
+
<?php _e('Automatically send payment reminders to your customers', 'wpo_wcpdf')?>
|
72 |
+
<div class="more" style="display:none;">
|
73 |
+
<?php _e('WooCommerce Smart Reminder emails', 'wpo_wcpdf')?>
|
74 |
+
<ul>
|
75 |
+
<li><?php _e( '<b>Completely automatic</b> scheduled emails', 'wpo_wcpdf' ); ?></li>
|
76 |
+
<li><?php _e( '<b>Rich text editor</b> for the email text, including placeholders for data from the order (name, order total, etc)', 'wpo_wcpdf' ); ?></li>
|
77 |
+
<li><?php _e( 'Configure the exact requirements for sending an email (time after order, order status, payment method)', 'wpo_wcpdf' ); ?></li>
|
78 |
+
<li><?php _e( 'Fully <b>WPML Compatible</b> – emails will be automatically sent in the order language.', 'wpo_wcpdf' ); ?></li>
|
79 |
+
<li><?php _e( '<b>Super versatile!</b> Can be used for any kind of reminder email (review reminders, repeat purchases)', 'wpo_wcpdf' ); ?></li>
|
80 |
+
<li><b><?php _e( 'Integrates seamlessly with the PDF Invoices & Packing Slips plugin', 'wpo_wcpdf' ); ?></b></li>
|
81 |
+
</ul>
|
82 |
+
<a href="https://wpovernight.com/downloads/woocommerce-reminder-emails-payment-reminders/" target="_blank"><?php _e("Get WooCommerce Smart Reminder Emails", 'wpo_wcpdf'); ?></a>
|
83 |
+
</div>
|
84 |
+
</li>
|
85 |
+
<?php } ?>
|
86 |
+
|
87 |
+
<?php
|
88 |
+
if (!class_exists('WooCommerce_PDF_IPS_Dropbox') && !$no_pro) {
|
89 |
Â
?>
|
90 |
Â
<li>
|
91 |
Â
<?php _e('Upload all invoices automatically to your dropbox', 'wpo_wcpdf')?>
|
123 |
Â
<?php } ?>
|
124 |
Â
|
125 |
Â
<?php
|
126 |
+
if (!class_exists('WooCommerce_PDF_IPS_Templates') && !$no_pro) {
|
127 |
Â
$template_link = '<a href="https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-premium-templates/" target="_blank">wpovernight.com</a>';
|
128 |
Â
$email_link = '<a href="mailto:support@wpovernight.com">support@wpovernight.com</a>'
|
129 |
Â
?>
|
142 |
Â
</ul>
|
143 |
Â
<?php
|
144 |
Â
// link to hide message when one of the premium extensions is installed
|
145 |
+
if ( class_exists('WooCommerce_PDF_IPS_Pro') || class_exists('WooCommerce_PDF_IPS_Dropbox') || class_exists('WooCommerce_PDF_IPS_Templates') || class_exists('WooCommerce_Ext_PrintOrders') || class_exists('WPO_WC_Smart_Reminder_Emails') ) {
|
146 |
Â
printf('<a href="%s" style="display:inline-block; margin-top: 10px;">%s</a>', add_query_arg( 'wpo_wcpdf_hide_extensions_ad', 'true' ), __( 'Hide this message', 'wpo_wcpdf' ) );
|
147 |
Â
}
|
148 |
Â
?>
|
js/script.js
CHANGED
@@ -1,43 +1,43 @@
|
|
1 |
-
jQuery(document).ready(function($) {
|
2 |
-
$("#doaction, #doaction2").click(function (event) {
|
3 |
-
var actionselected = $(this).attr("id").substr(2);
|
4 |
-
var action = $('select[name="' + actionselected + '"]').val();
|
5 |
-
if ( $.inArray(action, wpo_wcpdf_ajax.bulk_actions) !== -1 ) {
|
6 |
-
event.preventDefault();
|
7 |
-
var template = action;
|
8 |
-
var checked = [];
|
9 |
-
$('tbody th.check-column input[type="checkbox"]:checked').each(
|
10 |
-
function() {
|
11 |
-
checked.push($(this).val());
|
12 |
-
}
|
13 |
-
);
|
14 |
-
|
15 |
-
if (!checked.length) {
|
16 |
-
alert('You have to select order(s) first!');
|
17 |
-
return;
|
18 |
-
}
|
19 |
-
|
20 |
-
var order_ids=checked.join('x');
|
21 |
-
|
22 |
-
if (wpo_wcpdf_ajax.ajaxurl.indexOf("?") != -1) {
|
23 |
-
url = wpo_wcpdf_ajax.ajaxurl+'&action=generate_wpo_wcpdf&template_type='+template+'&order_ids='+order_ids+'&_wpnonce='+wpo_wcpdf_ajax.nonce;
|
24 |
-
} else {
|
25 |
-
url = wpo_wcpdf_ajax.ajaxurl+'?action=generate_wpo_wcpdf&template_type='+template+'&order_ids='+order_ids+'&_wpnonce='+wpo_wcpdf_ajax.nonce;
|
26 |
-
}
|
27 |
-
|
28 |
-
window.open(url,'_blank');
|
29 |
-
}
|
30 |
-
});
|
31 |
-
|
32 |
-
$('#wpo_wcpdf-data-input-box').insertAfter('#woocommerce-order-data');
|
33 |
-
|
34 |
-
// enable invoice number edit if user initiated
|
35 |
-
$('#wpo_wcpdf-data-input-box label').click(function (event) {
|
36 |
-
input = $(this).attr('for');
|
37 |
-
$('#'+input).prop('disabled', false);
|
38 |
-
});
|
39 |
-
$( "#_wcpdf_invoice_number" ).on( "click", function() {
|
40 |
-
console.log( this );
|
41 |
-
});
|
42 |
-
});
|
43 |
-
|
1 |
+
jQuery(document).ready(function($) {
|
2 |
+
$("#doaction, #doaction2").click(function (event) {
|
3 |
+
var actionselected = $(this).attr("id").substr(2);
|
4 |
+
var action = $('select[name="' + actionselected + '"]').val();
|
5 |
+
if ( $.inArray(action, wpo_wcpdf_ajax.bulk_actions) !== -1 ) {
|
6 |
+
event.preventDefault();
|
7 |
+
var template = action;
|
8 |
+
var checked = [];
|
9 |
+
$('tbody th.check-column input[type="checkbox"]:checked').each(
|
10 |
+
function() {
|
11 |
+
checked.push($(this).val());
|
12 |
+
}
|
13 |
+
);
|
14 |
+
|
15 |
+
if (!checked.length) {
|
16 |
+
alert('You have to select order(s) first!');
|
17 |
+
return;
|
18 |
+
}
|
19 |
+
|
20 |
+
var order_ids=checked.join('x');
|
21 |
+
|
22 |
+
if (wpo_wcpdf_ajax.ajaxurl.indexOf("?") != -1) {
|
23 |
+
url = wpo_wcpdf_ajax.ajaxurl+'&action=generate_wpo_wcpdf&template_type='+template+'&order_ids='+order_ids+'&_wpnonce='+wpo_wcpdf_ajax.nonce;
|
24 |
+
} else {
|
25 |
+
url = wpo_wcpdf_ajax.ajaxurl+'?action=generate_wpo_wcpdf&template_type='+template+'&order_ids='+order_ids+'&_wpnonce='+wpo_wcpdf_ajax.nonce;
|
26 |
+
}
|
27 |
+
|
28 |
+
window.open(url,'_blank');
|
29 |
+
}
|
30 |
+
});
|
31 |
+
|
32 |
+
$('#wpo_wcpdf-data-input-box').insertAfter('#woocommerce-order-data');
|
33 |
+
|
34 |
+
// enable invoice number edit if user initiated
|
35 |
+
$('#wpo_wcpdf-data-input-box label').click(function (event) {
|
36 |
+
input = $(this).attr('for');
|
37 |
+
$('#'+input).prop('disabled', false);
|
38 |
+
});
|
39 |
+
$( "#_wcpdf_invoice_number" ).on( "click", function() {
|
40 |
+
console.log( this );
|
41 |
+
});
|
42 |
+
});
|
43 |
+
|
languages/wpo_wcpdf-nb_NO.mo
CHANGED
Binary file
|
languages/wpo_wcpdf-nb_NO.po
CHANGED
@@ -1,106 +1,106 @@
|
|
1 |
Â
msgid ""
|
2 |
Â
msgstr ""
|
3 |
Â
"Project-Id-Version: WooCommerce PDF Invoices & Packing Slips\n"
|
4 |
-
"POT-Creation-Date:
|
5 |
-
"PO-Revision-Date:
|
6 |
Â
"Last-Translator: Eirik Opsanger <eirik.opsanger@gmail.com>\n"
|
7 |
Â
"Language-Team: WP Overnight <support@wpovernight.com>\n"
|
8 |
Â
"Language: nb\n"
|
9 |
Â
"MIME-Version: 1.0\n"
|
10 |
Â
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
Â
"Content-Transfer-Encoding: 8bit\n"
|
12 |
-
"X-Generator: Poedit 1.8.
|
13 |
-
"X-Poedit-Basepath:
|
14 |
Â
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
15 |
Â
"X-Poedit-SourceCharset: UTF-8\n"
|
16 |
Â
"X-Poedit-KeywordsList: __;_e;_x;_n:1,2\n"
|
17 |
Â
"X-Poedit-SearchPath-0: .\n"
|
18 |
Â
|
19 |
-
#: includes/class-wcpdf-export.php:
|
20 |
-
#: includes/class-wcpdf-export.php:
|
21 |
Â
msgid "You do not have sufficient permissions to access this page."
|
22 |
Â
msgstr "Du har ikke nok rettigheter til denne siden"
|
23 |
Â
|
24 |
-
#: includes/class-wcpdf-export.php:
|
25 |
Â
msgid "Some of the export parameters are missing."
|
26 |
Â
msgstr ""
|
27 |
Â
|
28 |
Â
# This is a filename (prefix). do not use spaces or special characters!
|
29 |
-
#: includes/class-wcpdf-export.php:
|
30 |
Â
msgid "invoice"
|
31 |
Â
msgid_plural "invoices"
|
32 |
Â
msgstr[0] "Faktura"
|
33 |
Â
msgstr[1] "Fakturaer"
|
34 |
Â
|
35 |
Â
# This is a filename (prefix). do not use spaces or special characters!
|
36 |
-
#: includes/class-wcpdf-export.php:
|
37 |
Â
msgid "packing-slip"
|
38 |
Â
msgid_plural "packing-slips"
|
39 |
Â
msgstr[0] "Pakkseddel"
|
40 |
Â
msgstr[1] "Pakksedler"
|
41 |
Â
|
42 |
-
#: includes/class-wcpdf-settings.php:
|
43 |
Â
#: includes/class-wcpdf-writepanels.php:32
|
44 |
Â
msgid "PDF Invoices"
|
45 |
Â
msgstr "PDF-faktura"
|
46 |
Â
|
47 |
-
#: includes/class-wcpdf-settings.php:
|
48 |
Â
msgid "Settings"
|
49 |
Â
msgstr "Innstillinger"
|
50 |
Â
|
51 |
-
#: includes/class-wcpdf-settings.php:
|
52 |
Â
msgid "General"
|
53 |
Â
msgstr "Generelt"
|
54 |
Â
|
55 |
-
#: includes/class-wcpdf-settings.php:
|
56 |
Â
msgid "Template"
|
57 |
Â
msgstr "Template"
|
58 |
Â
|
59 |
-
#: includes/class-wcpdf-settings.php:
|
60 |
Â
msgid "Status"
|
61 |
Â
msgstr "Status"
|
62 |
Â
|
63 |
-
#: includes/class-wcpdf-settings.php:
|
64 |
Â
msgid "WooCommerce PDF Invoices"
|
65 |
Â
msgstr "WooCommerce PDF Faktura"
|
66 |
Â
|
67 |
-
#: includes/class-wcpdf-settings.php:
|
68 |
Â
msgid "General settings"
|
69 |
Â
msgstr "Generelle innstillinger"
|
70 |
Â
|
71 |
-
#: includes/class-wcpdf-settings.php:
|
72 |
Â
msgid "How do you want to view the PDF?"
|
73 |
Â
msgstr "Hvordan vil du se PDF`en?"
|
74 |
Â
|
75 |
-
#: includes/class-wcpdf-settings.php:
|
76 |
Â
msgid "Download the PDF"
|
77 |
Â
msgstr "Last ned PDF`en"
|
78 |
Â
|
79 |
-
#: includes/class-wcpdf-settings.php:
|
80 |
Â
msgid "Open the PDF in a new browser tab/window"
|
81 |
Â
msgstr "Ã…pne PDF`en i ett nytt vindu"
|
82 |
Â
|
83 |
-
#: includes/class-wcpdf-settings.php:
|
84 |
Â
msgid "Admin New Order email"
|
85 |
Â
msgstr "Admins Ny Ordre epost"
|
86 |
Â
|
87 |
-
#: includes/class-wcpdf-settings.php:
|
88 |
Â
msgid "Customer Processing Order email"
|
89 |
Â
msgstr "Kundens Behandler Ordre epost"
|
90 |
Â
|
91 |
-
#: includes/class-wcpdf-settings.php:
|
92 |
Â
msgid "Customer Completed Order email"
|
93 |
Â
msgstr "Kundens Fullført Ordre epost"
|
94 |
Â
|
95 |
-
#: includes/class-wcpdf-settings.php:
|
96 |
Â
msgid "Customer Invoice email"
|
97 |
Â
msgstr "Kundens Faktura epost"
|
98 |
Â
|
99 |
-
#: includes/class-wcpdf-settings.php:
|
100 |
Â
msgid "Attach invoice to:"
|
101 |
Â
msgstr "Legg ved faktura til:"
|
102 |
Â
|
103 |
-
#: includes/class-wcpdf-settings.php:
|
104 |
Â
#, php-format
|
105 |
Â
msgid ""
|
106 |
Â
"It looks like the temp folder (<code>%s</code>) is not writable, check the "
|
@@ -111,49 +111,53 @@ msgstr ""
|
|
111 |
Â
"skrivbar, sjekk rettighetene på denne mappen! Uten skrivetilgang til denne "
|
112 |
Â
"mappen vil ikke denne plugin kunne sende pdf-faktura."
|
113 |
Â
|
114 |
-
#: includes/class-wcpdf-settings.php:
|
115 |
Â
msgid "Disable for free products"
|
116 |
Â
msgstr ""
|
117 |
Â
|
118 |
-
#: includes/class-wcpdf-settings.php:
|
119 |
Â
msgid ""
|
120 |
Â
"Disable automatic creation/attachment of invoices when only free products "
|
121 |
Â
"are ordered"
|
122 |
Â
msgstr ""
|
123 |
Â
|
124 |
-
#: includes/class-wcpdf-settings.php:
|
125 |
Â
msgid "Interface"
|
126 |
Â
msgstr ""
|
127 |
Â
|
128 |
-
#: includes/class-wcpdf-settings.php:
|
129 |
Â
msgid "Allow My Account invoice download"
|
130 |
Â
msgstr ""
|
131 |
Â
|
132 |
-
#: includes/class-wcpdf-settings.php:
|
133 |
Â
msgid "Only when an invoice is already created/emailed"
|
134 |
Â
msgstr ""
|
135 |
Â
|
136 |
-
#: includes/class-wcpdf-settings.php:
|
137 |
Â
msgid "Only for specific order statuses (define below)"
|
138 |
Â
msgstr ""
|
139 |
Â
|
140 |
-
#: includes/class-wcpdf-settings.php:
|
141 |
Â
msgid "Always"
|
142 |
Â
msgstr ""
|
143 |
Â
|
144 |
Â
#: includes/class-wcpdf-settings.php:323
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
145 |
Â
msgid "Enable invoice number column in the orders list"
|
146 |
Â
msgstr "Aktiver kolonne for fakturanummer i ordrelisten"
|
147 |
Â
|
148 |
-
#: includes/class-wcpdf-settings.php:
|
149 |
Â
msgid "PDF Template settings"
|
150 |
Â
msgstr "PDF Template-innstillinger"
|
151 |
Â
|
152 |
-
#: includes/class-wcpdf-settings.php:
|
153 |
Â
msgid "Choose a template"
|
154 |
Â
msgstr "Velg din template"
|
155 |
Â
|
156 |
-
#: includes/class-wcpdf-settings.php:
|
157 |
Â
#, php-format
|
158 |
Â
msgid ""
|
159 |
Â
"Want to use your own template? Copy all the files from <code>%s</code> to "
|
@@ -162,83 +166,97 @@ msgstr ""
|
|
162 |
Â
"Vil du bruke din egen template? Kopier alle filer fra <code>%s</code> til "
|
163 |
Â
"<code>%s</code>for å endre de."
|
164 |
Â
|
165 |
-
#: includes/class-wcpdf-settings.php:
|
166 |
Â
msgid "Paper size"
|
167 |
Â
msgstr "Papirstørrelse"
|
168 |
Â
|
169 |
-
#: includes/class-wcpdf-settings.php:
|
170 |
Â
msgid "A4"
|
171 |
Â
msgstr "A4"
|
172 |
Â
|
173 |
-
#: includes/class-wcpdf-settings.php:
|
174 |
Â
msgid "Letter"
|
175 |
Â
msgstr "Letter"
|
176 |
Â
|
177 |
-
#: includes/class-wcpdf-settings.php:
|
178 |
Â
msgid "Shop header/logo"
|
179 |
Â
msgstr "Butikkens header/logo"
|
180 |
Â
|
181 |
-
#: includes/class-wcpdf-settings.php:
|
182 |
Â
msgid "Select or upload your invoice header/logo"
|
183 |
Â
msgstr "Velg eller last opp din faktura header/logo"
|
184 |
Â
|
185 |
-
#: includes/class-wcpdf-settings.php:
|
186 |
Â
msgid "Set image"
|
187 |
Â
msgstr "Velg bilde"
|
188 |
Â
|
189 |
-
#: includes/class-wcpdf-settings.php:
|
190 |
Â
msgid "Remove image"
|
191 |
Â
msgstr "Fjern bilde"
|
192 |
Â
|
193 |
-
#: includes/class-wcpdf-settings.php:
|
194 |
Â
msgid "Shop Name"
|
195 |
Â
msgstr "Butikkens navn"
|
196 |
Â
|
197 |
-
#: includes/class-wcpdf-settings.php:
|
198 |
Â
msgid "Shop Address"
|
199 |
Â
msgstr "Butikkens adresse"
|
200 |
Â
|
201 |
-
#: includes/class-wcpdf-settings.php:
|
202 |
Â
msgid "Footer: terms & conditions, policies, etc."
|
203 |
Â
msgstr "Footer: Betingelser og Vilkår"
|
204 |
Â
|
205 |
-
#: includes/class-wcpdf-settings.php:
|
Â
|
|
206 |
Â
#: templates/pdf/Simple/invoice.php:21
|
207 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
208 |
Â
msgid "Invoice"
|
209 |
Â
msgstr "Faktura"
|
210 |
Â
|
211 |
-
#: includes/class-wcpdf-settings.php:
|
212 |
Â
msgid "Display shipping address"
|
213 |
Â
msgstr ""
|
214 |
Â
|
215 |
-
#: includes/class-wcpdf-settings.php:
|
216 |
Â
msgid ""
|
217 |
Â
"Display shipping address on invoice (in addition to the default billing "
|
218 |
Â
"address) if different from billing address"
|
219 |
Â
msgstr ""
|
220 |
Â
|
221 |
-
#: includes/class-wcpdf-settings.php:
|
222 |
Â
msgid "Display email address"
|
223 |
Â
msgstr ""
|
224 |
Â
|
225 |
-
#: includes/class-wcpdf-settings.php:
|
226 |
Â
msgid "Display phone number"
|
227 |
Â
msgstr ""
|
228 |
Â
|
229 |
-
#: includes/class-wcpdf-settings.php:
|
230 |
Â
msgid "Display invoice date"
|
231 |
Â
msgstr "Vis fakturadato"
|
232 |
Â
|
233 |
-
#: includes/class-wcpdf-settings.php:
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
234 |
Â
msgid "Display built-in sequential invoice number"
|
235 |
Â
msgstr "Vis sekvensielt fakturanummer"
|
236 |
Â
|
237 |
-
#: includes/class-wcpdf-settings.php:
|
238 |
Â
msgid "Next invoice number (without prefix/suffix etc.)"
|
239 |
Â
msgstr "Neste fakturanummer (uten prefix/suffix etc.)"
|
240 |
Â
|
241 |
-
#: includes/class-wcpdf-settings.php:
|
242 |
Â
msgid ""
|
243 |
Â
"This is the number that will be used on the next invoice that is created. By "
|
244 |
Â
"default, numbering starts from the WooCommerce Order Number of the first "
|
@@ -252,35 +270,33 @@ msgstr ""
|
|
252 |
Â
"dersom du endrer denne og setter et lavere tall enn høyeste (PDF) "
|
253 |
Â
"fakturanummer, vil du få flere fakturaer med samme nummer!"
|
254 |
Â
|
255 |
-
#: includes/class-wcpdf-settings.php:
|
256 |
Â
msgid "Invoice number format"
|
257 |
Â
msgstr "Format på fakturanummer"
|
258 |
Â
|
259 |
-
#: includes/class-wcpdf-settings.php:
|
260 |
Â
msgid "Prefix"
|
261 |
Â
msgstr "Prefix"
|
262 |
Â
|
263 |
-
#: includes/class-wcpdf-settings.php:
|
264 |
Â
msgid ""
|
265 |
-
"to use the
|
266 |
Â
"respectively"
|
267 |
Â
msgstr ""
|
268 |
-
"for å bruke år og/eller måned, kan du bruker [order_year] og/eller "
|
269 |
-
"[order_month]"
|
270 |
Â
|
271 |
-
#: includes/class-wcpdf-settings.php:
|
272 |
Â
msgid "Suffix"
|
273 |
Â
msgstr "Suffix"
|
274 |
Â
|
275 |
-
#: includes/class-wcpdf-settings.php:
|
276 |
Â
msgid "Padding"
|
277 |
Â
msgstr "Siffer"
|
278 |
Â
|
279 |
-
#: includes/class-wcpdf-settings.php:
|
280 |
Â
msgid "enter the number of digits here - enter \"6\" to display 42 as 000042"
|
281 |
Â
msgstr "skriv antall siffer her - skriv \"6\" for å vise 42 som 000042"
|
282 |
Â
|
283 |
-
#: includes/class-wcpdf-settings.php:
|
284 |
Â
msgid ""
|
285 |
Â
"note: if you have already created a custom invoice number format with a "
|
286 |
Â
"filter, the above settings will be ignored"
|
@@ -288,96 +304,108 @@ msgstr ""
|
|
288 |
Â
"merk: hvis du allerede har laget et eget nummerformat for fakuranummer med "
|
289 |
Â
"et filter, vil innstillingene over bli ignorert"
|
290 |
Â
|
291 |
-
#: includes/class-wcpdf-settings.php:
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
292 |
Â
#: templates/pdf/Simple/packing-slip.php:9
|
293 |
Â
#: templates/pdf/Simple/packing-slip.php:21
|
294 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
295 |
Â
msgid "Packing Slip"
|
296 |
Â
msgstr "Pakkseddel"
|
297 |
Â
|
298 |
-
#: includes/class-wcpdf-settings.php:
|
299 |
Â
msgid "Display billing address"
|
300 |
Â
msgstr ""
|
301 |
Â
|
302 |
-
#: includes/class-wcpdf-settings.php:
|
303 |
Â
msgid ""
|
304 |
Â
"Display billing address on packing slip (in addition to the default shipping "
|
305 |
Â
"address) if different from shipping address"
|
306 |
Â
msgstr ""
|
307 |
Â
|
308 |
-
#: includes/class-wcpdf-settings.php:
|
309 |
Â
msgid "Extra template fields"
|
310 |
Â
msgstr "Ekstrafelt"
|
311 |
Â
|
312 |
-
#: includes/class-wcpdf-settings.php:
|
313 |
Â
msgid "Extra field 1"
|
314 |
Â
msgstr "Ekstrafelt 1"
|
315 |
Â
|
316 |
-
#: includes/class-wcpdf-settings.php:
|
317 |
Â
msgid "This is footer column 1 in the <i>Modern (Premium)</i> template"
|
318 |
Â
msgstr "Dette er fotnote-kolonne 1 i <i>Modern (Premium)</i> template"
|
319 |
Â
|
320 |
-
#: includes/class-wcpdf-settings.php:
|
321 |
Â
msgid "Extra field 2"
|
322 |
Â
msgstr "Ekstrafelt 2"
|
323 |
Â
|
324 |
-
#: includes/class-wcpdf-settings.php:
|
325 |
Â
msgid "This is footer column 2 in the <i>Modern (Premium)</i> template"
|
326 |
Â
msgstr "Dette er fotnote-kolonne 2 i <i>Modern (Premium)</i> template"
|
327 |
Â
|
328 |
-
#: includes/class-wcpdf-settings.php:
|
329 |
Â
msgid "Extra field 3"
|
330 |
Â
msgstr "Ekstrafelt 3"
|
331 |
Â
|
332 |
-
#: includes/class-wcpdf-settings.php:
|
333 |
Â
msgid "This is footer column 3 in the <i>Modern (Premium)</i> template"
|
334 |
Â
msgstr "Dette er fotnote-kolonne 3 i <i>Modern (Premium)</i> template"
|
335 |
Â
|
336 |
-
#: includes/class-wcpdf-settings.php:
|
337 |
Â
msgid "Debug settings"
|
338 |
Â
msgstr ""
|
339 |
Â
|
340 |
-
#: includes/class-wcpdf-settings.php:
|
341 |
Â
msgid "Enable debug output"
|
342 |
Â
msgstr ""
|
343 |
Â
|
344 |
-
#: includes/class-wcpdf-settings.php:
|
345 |
Â
msgid ""
|
346 |
Â
"Enable this option to output plugin errors if you're getting a blank page or "
|
347 |
Â
"other PDF generation issues"
|
348 |
Â
msgstr ""
|
349 |
Â
|
350 |
-
#: includes/class-wcpdf-settings.php:
|
351 |
Â
msgid "Output to HTML"
|
352 |
Â
msgstr ""
|
353 |
Â
|
354 |
-
#: includes/class-wcpdf-settings.php:
|
355 |
Â
msgid ""
|
356 |
Â
"Send the template output as HTML to the browser instead of creating a PDF."
|
357 |
Â
msgstr ""
|
358 |
Â
|
359 |
-
#: includes/class-wcpdf-settings.php:
|
360 |
Â
msgid "Use old tmp folder"
|
361 |
Â
msgstr ""
|
362 |
Â
|
363 |
-
#: includes/class-wcpdf-settings.php:
|
364 |
Â
msgid ""
|
365 |
Â
"Before version 1.5 of PDF Invoices, temporary files were stored in the "
|
366 |
Â
"plugin folder. This setting is only intended for backwards compatibility, "
|
367 |
Â
"not recommended on new installs!"
|
368 |
Â
msgstr ""
|
369 |
Â
|
370 |
-
#: includes/class-wcpdf-settings.php:
|
371 |
Â
msgid "Image resolution"
|
372 |
Â
msgstr "Bildeoppløsning"
|
373 |
Â
|
374 |
-
#: includes/class-wcpdf-settings.php:
|
375 |
Â
msgid ""
|
376 |
Â
"<b>Warning!</b> The settings below are meant for debugging/development only. "
|
377 |
Â
"Do not use them on a live website!"
|
378 |
Â
msgstr ""
|
379 |
Â
|
380 |
-
#: includes/class-wcpdf-settings.php:
|
381 |
Â
msgid ""
|
382 |
Â
"These are used for the (optional) footer columns in the <em>Modern "
|
383 |
Â
"(Premium)</em> template, but can also be used for other elements in your "
|
@@ -390,42 +418,47 @@ msgstr ""
|
|
390 |
Â
msgid "PDF Packing Slips"
|
391 |
Â
msgstr "PDF Pakksedler"
|
392 |
Â
|
393 |
-
#: includes/class-wcpdf-writepanels.php:
|
394 |
-
#: includes/class-wcpdf-writepanels.php:
|
395 |
Â
msgid "PDF Invoice"
|
396 |
Â
msgstr "PDF-faktura"
|
397 |
Â
|
398 |
-
#: includes/class-wcpdf-writepanels.php:
|
399 |
-
#: includes/class-wcpdf-writepanels.php:
|
400 |
Â
msgid "PDF Packing Slip"
|
401 |
Â
msgstr "PDF Pakkseddel"
|
402 |
Â
|
403 |
-
#: includes/class-wcpdf-writepanels.php:
|
404 |
Â
msgid "Invoice Number"
|
405 |
Â
msgstr "Fakturanummer"
|
406 |
Â
|
407 |
-
#: includes/class-wcpdf-writepanels.php:
|
408 |
Â
msgid "Download invoice (PDF)"
|
409 |
Â
msgstr "Last ned faktura (PDF)"
|
410 |
Â
|
411 |
-
#: includes/class-wcpdf-writepanels.php:
|
412 |
Â
msgid "Create PDF"
|
413 |
Â
msgstr "Opprett PDF"
|
414 |
Â
|
415 |
-
#: includes/class-wcpdf-writepanels.php:
|
416 |
-
msgid "PDF Invoice
|
417 |
-
msgstr "
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
418 |
Â
|
419 |
-
#: includes/class-wcpdf-writepanels.php:
|
420 |
-
#: templates/pdf/Simple/invoice.php:55
|
421 |
Â
msgid "Invoice Date:"
|
422 |
Â
msgstr "Fakturadato:"
|
423 |
Â
|
424 |
-
#: includes/class-wcpdf-writepanels.php:
|
Â
|
|
425 |
Â
msgid "h"
|
426 |
Â
msgstr "h"
|
427 |
Â
|
428 |
-
#: includes/class-wcpdf-writepanels.php:
|
Â
|
|
429 |
Â
msgid "m"
|
430 |
Â
msgstr "m"
|
431 |
Â
|
@@ -528,16 +561,18 @@ msgid "WooCommerce Automatic Order Printing"
|
|
528 |
Â
msgstr "Automatisk ordreutskrift"
|
529 |
Â
|
530 |
Â
#: includes/wcpdf-extensions.php:82
|
531 |
-
msgid "
|
532 |
-
msgstr "
|
533 |
Â
|
534 |
Â
#: includes/wcpdf-extensions.php:85
|
535 |
-
msgid "
|
536 |
-
|
Â
|
|
Â
|
|
537 |
Â
|
538 |
Â
#: includes/wcpdf-extensions.php:86
|
539 |
-
msgid "
|
540 |
-
msgstr "
|
541 |
Â
|
542 |
Â
#: includes/wcpdf-extensions.php:87
|
543 |
Â
#, php-format
|
@@ -551,8 +586,11 @@ msgstr ""
|
|
551 |
Â
msgid "For custom templates, contact us at %s."
|
552 |
Â
msgstr "For egendefinerte templates, kontakt oss på %s"
|
553 |
Â
|
554 |
-
#:
|
555 |
-
|
Â
|
|
Â
|
|
Â
|
|
556 |
Â
msgid "Billing Address:"
|
557 |
Â
msgstr "Fakturaadresse:"
|
558 |
Â
|
@@ -564,13 +602,11 @@ msgstr "Send til:"
|
|
564 |
Â
msgid "Invoice Number:"
|
565 |
Â
msgstr "Fakturanummer:"
|
566 |
Â
|
567 |
-
#: templates/pdf/Simple/invoice.php:60
|
568 |
-
#: templates/pdf/Simple/packing-slip.php:48
|
569 |
Â
msgid "Order Number:"
|
570 |
Â
msgstr "Ordrenummer:"
|
571 |
Â
|
572 |
-
#: templates/pdf/Simple/invoice.php:64
|
573 |
-
#: templates/pdf/Simple/packing-slip.php:52
|
574 |
Â
msgid "Order Date:"
|
575 |
Â
msgstr "Ordredato:"
|
576 |
Â
|
@@ -578,13 +614,11 @@ msgstr "Ordredato:"
|
|
578 |
Â
msgid "Payment Method:"
|
579 |
Â
msgstr "Betalingsmåte:"
|
580 |
Â
|
581 |
-
#: templates/pdf/Simple/invoice.php:82
|
582 |
-
#: templates/pdf/Simple/packing-slip.php:70
|
583 |
Â
msgid "Product"
|
584 |
Â
msgstr "Produkt:"
|
585 |
Â
|
586 |
-
#: templates/pdf/Simple/invoice.php:83
|
587 |
-
#: templates/pdf/Simple/packing-slip.php:71
|
588 |
Â
msgid "Quantity"
|
589 |
Â
msgstr "Antall"
|
590 |
Â
|
@@ -592,23 +626,19 @@ msgstr "Antall"
|
|
592 |
Â
msgid "Price"
|
593 |
Â
msgstr "Pris"
|
594 |
Â
|
595 |
-
#: templates/pdf/Simple/invoice.php:91
|
596 |
-
#: templates/pdf/Simple/packing-slip.php:78
|
597 |
Â
msgid "Description"
|
598 |
Â
msgstr "Beskrivelse"
|
599 |
Â
|
600 |
-
#: templates/pdf/Simple/invoice.php:96
|
601 |
-
#: templates/pdf/Simple/packing-slip.php:83
|
602 |
Â
msgid "SKU"
|
603 |
Â
msgstr "Art.nr"
|
604 |
Â
|
605 |
-
#: templates/pdf/Simple/invoice.php:97
|
606 |
-
#: templates/pdf/Simple/packing-slip.php:84
|
607 |
Â
msgid "SKU:"
|
608 |
Â
msgstr "Art.nr:"
|
609 |
Â
|
610 |
-
#: templates/pdf/Simple/invoice.php:98
|
611 |
-
#: templates/pdf/Simple/packing-slip.php:85
|
612 |
Â
msgid "Weight:"
|
613 |
Â
msgstr "Vekt:"
|
614 |
Â
|
@@ -634,47 +664,76 @@ msgstr ""
|
|
634 |
Â
"WooCommerce PDF Invoices & Packing Slips krever %sWooCommerce%s for å bli "
|
635 |
Â
"installert og aktivert!"
|
636 |
Â
|
637 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
638 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
639 |
Â
msgid "N/A"
|
640 |
Â
msgstr "N/A"
|
641 |
Â
|
642 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
643 |
Â
msgid "Payment method"
|
644 |
Â
msgstr "Betalingsmåte"
|
645 |
Â
|
646 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
647 |
Â
msgid "Shipping method"
|
648 |
Â
msgstr "Leveringsmåte"
|
649 |
Â
|
650 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
651 |
Â
msgid "Subtotal"
|
652 |
Â
msgstr "Total"
|
653 |
Â
|
654 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
655 |
Â
msgid "Shipping"
|
656 |
Â
msgstr "Frakt"
|
657 |
Â
|
658 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
659 |
Â
msgid "Discount"
|
660 |
Â
msgstr "Avslag"
|
661 |
Â
|
662 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
663 |
Â
msgid "VAT"
|
664 |
Â
msgstr "MVA"
|
665 |
Â
|
666 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
667 |
Â
msgid "Tax rate"
|
668 |
Â
msgstr "MVA"
|
669 |
Â
|
670 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
671 |
Â
msgid "Total ex. VAT"
|
672 |
Â
msgstr "Totalt eksl. MVA"
|
673 |
Â
|
674 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
675 |
Â
msgid "Total"
|
676 |
Â
msgstr "Subtotal"
|
677 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
678 |
Â
#~ msgid ""
|
679 |
Â
#~ "Attach a <b>static file</b> (for example a terms & conditions document) "
|
680 |
Â
#~ "to the WooCommerce emails of your choice."
|
1 |
Â
msgid ""
|
2 |
Â
msgstr ""
|
3 |
Â
"Project-Id-Version: WooCommerce PDF Invoices & Packing Slips\n"
|
4 |
+
"POT-Creation-Date: 2016-09-22 15:50+0200\n"
|
5 |
+
"PO-Revision-Date: 2016-09-22 15:50+0200\n"
|
6 |
Â
"Last-Translator: Eirik Opsanger <eirik.opsanger@gmail.com>\n"
|
7 |
Â
"Language-Team: WP Overnight <support@wpovernight.com>\n"
|
8 |
Â
"Language: nb\n"
|
9 |
Â
"MIME-Version: 1.0\n"
|
10 |
Â
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
Â
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"X-Generator: Poedit 1.8.9\n"
|
13 |
+
"X-Poedit-Basepath: ..\n"
|
14 |
Â
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
15 |
Â
"X-Poedit-SourceCharset: UTF-8\n"
|
16 |
Â
"X-Poedit-KeywordsList: __;_e;_x;_n:1,2\n"
|
17 |
Â
"X-Poedit-SearchPath-0: .\n"
|
18 |
Â
|
19 |
+
#: includes/class-wcpdf-export.php:418 includes/class-wcpdf-export.php:432
|
20 |
+
#: includes/class-wcpdf-export.php:439 includes/class-wcpdf-export.php:447
|
21 |
Â
msgid "You do not have sufficient permissions to access this page."
|
22 |
Â
msgstr "Du har ikke nok rettigheter til denne siden"
|
23 |
Â
|
24 |
+
#: includes/class-wcpdf-export.php:423
|
25 |
Â
msgid "Some of the export parameters are missing."
|
26 |
Â
msgstr ""
|
27 |
Â
|
28 |
Â
# This is a filename (prefix). do not use spaces or special characters!
|
29 |
+
#: includes/class-wcpdf-export.php:504
|
30 |
Â
msgid "invoice"
|
31 |
Â
msgid_plural "invoices"
|
32 |
Â
msgstr[0] "Faktura"
|
33 |
Â
msgstr[1] "Fakturaer"
|
34 |
Â
|
35 |
Â
# This is a filename (prefix). do not use spaces or special characters!
|
36 |
+
#: includes/class-wcpdf-export.php:508
|
37 |
Â
msgid "packing-slip"
|
38 |
Â
msgid_plural "packing-slips"
|
39 |
Â
msgstr[0] "Pakkseddel"
|
40 |
Â
msgstr[1] "Pakksedler"
|
41 |
Â
|
42 |
+
#: includes/class-wcpdf-settings.php:37 includes/class-wcpdf-settings.php:38
|
43 |
Â
#: includes/class-wcpdf-writepanels.php:32
|
44 |
Â
msgid "PDF Invoices"
|
45 |
Â
msgstr "PDF-faktura"
|
46 |
Â
|
47 |
+
#: includes/class-wcpdf-settings.php:79
|
48 |
Â
msgid "Settings"
|
49 |
Â
msgstr "Innstillinger"
|
50 |
Â
|
51 |
+
#: includes/class-wcpdf-settings.php:101
|
52 |
Â
msgid "General"
|
53 |
Â
msgstr "Generelt"
|
54 |
Â
|
55 |
+
#: includes/class-wcpdf-settings.php:102
|
56 |
Â
msgid "Template"
|
57 |
Â
msgstr "Template"
|
58 |
Â
|
59 |
+
#: includes/class-wcpdf-settings.php:107
|
60 |
Â
msgid "Status"
|
61 |
Â
msgstr "Status"
|
62 |
Â
|
63 |
+
#: includes/class-wcpdf-settings.php:119
|
64 |
Â
msgid "WooCommerce PDF Invoices"
|
65 |
Â
msgstr "WooCommerce PDF Faktura"
|
66 |
Â
|
67 |
+
#: includes/class-wcpdf-settings.php:199
|
68 |
Â
msgid "General settings"
|
69 |
Â
msgstr "Generelle innstillinger"
|
70 |
Â
|
71 |
+
#: includes/class-wcpdf-settings.php:206
|
72 |
Â
msgid "How do you want to view the PDF?"
|
73 |
Â
msgstr "Hvordan vil du se PDF`en?"
|
74 |
Â
|
75 |
+
#: includes/class-wcpdf-settings.php:214
|
76 |
Â
msgid "Download the PDF"
|
77 |
Â
msgstr "Last ned PDF`en"
|
78 |
Â
|
79 |
+
#: includes/class-wcpdf-settings.php:215
|
80 |
Â
msgid "Open the PDF in a new browser tab/window"
|
81 |
Â
msgstr "Ã…pne PDF`en i ett nytt vindu"
|
82 |
Â
|
83 |
+
#: includes/class-wcpdf-settings.php:224
|
84 |
Â
msgid "Admin New Order email"
|
85 |
Â
msgstr "Admins Ny Ordre epost"
|
86 |
Â
|
87 |
+
#: includes/class-wcpdf-settings.php:225
|
88 |
Â
msgid "Customer Processing Order email"
|
89 |
Â
msgstr "Kundens Behandler Ordre epost"
|
90 |
Â
|
91 |
+
#: includes/class-wcpdf-settings.php:226
|
92 |
Â
msgid "Customer Completed Order email"
|
93 |
Â
msgstr "Kundens Fullført Ordre epost"
|
94 |
Â
|
95 |
+
#: includes/class-wcpdf-settings.php:227
|
96 |
Â
msgid "Customer Invoice email"
|
97 |
Â
msgstr "Kundens Faktura epost"
|
98 |
Â
|
99 |
+
#: includes/class-wcpdf-settings.php:236
|
100 |
Â
msgid "Attach invoice to:"
|
101 |
Â
msgstr "Legg ved faktura til:"
|
102 |
Â
|
103 |
+
#: includes/class-wcpdf-settings.php:244
|
104 |
Â
#, php-format
|
105 |
Â
msgid ""
|
106 |
Â
"It looks like the temp folder (<code>%s</code>) is not writable, check the "
|
111 |
Â
"skrivbar, sjekk rettighetene på denne mappen! Uten skrivetilgang til denne "
|
112 |
Â
"mappen vil ikke denne plugin kunne sende pdf-faktura."
|
113 |
Â
|
114 |
+
#: includes/class-wcpdf-settings.php:250
|
115 |
Â
msgid "Disable for free products"
|
116 |
Â
msgstr ""
|
117 |
Â
|
118 |
+
#: includes/class-wcpdf-settings.php:257
|
119 |
Â
msgid ""
|
120 |
Â
"Disable automatic creation/attachment of invoices when only free products "
|
121 |
Â
"are ordered"
|
122 |
Â
msgstr ""
|
123 |
Â
|
124 |
+
#: includes/class-wcpdf-settings.php:264
|
125 |
Â
msgid "Interface"
|
126 |
Â
msgstr ""
|
127 |
Â
|
128 |
+
#: includes/class-wcpdf-settings.php:312
|
129 |
Â
msgid "Allow My Account invoice download"
|
130 |
Â
msgstr ""
|
131 |
Â
|
132 |
+
#: includes/class-wcpdf-settings.php:320
|
133 |
Â
msgid "Only when an invoice is already created/emailed"
|
134 |
Â
msgstr ""
|
135 |
Â
|
136 |
+
#: includes/class-wcpdf-settings.php:321
|
137 |
Â
msgid "Only for specific order statuses (define below)"
|
138 |
Â
msgstr ""
|
139 |
Â
|
140 |
+
#: includes/class-wcpdf-settings.php:322
|
141 |
Â
msgid "Always"
|
142 |
Â
msgstr ""
|
143 |
Â
|
144 |
Â
#: includes/class-wcpdf-settings.php:323
|
145 |
+
msgid "Never"
|
146 |
+
msgstr ""
|
147 |
+
|
148 |
+
#: includes/class-wcpdf-settings.php:338
|
149 |
Â
msgid "Enable invoice number column in the orders list"
|
150 |
Â
msgstr "Aktiver kolonne for fakturanummer i ordrelisten"
|
151 |
Â
|
152 |
+
#: includes/class-wcpdf-settings.php:376
|
153 |
Â
msgid "PDF Template settings"
|
154 |
Â
msgstr "PDF Template-innstillinger"
|
155 |
Â
|
156 |
+
#: includes/class-wcpdf-settings.php:388
|
157 |
Â
msgid "Choose a template"
|
158 |
Â
msgstr "Velg din template"
|
159 |
Â
|
160 |
+
#: includes/class-wcpdf-settings.php:396
|
161 |
Â
#, php-format
|
162 |
Â
msgid ""
|
163 |
Â
"Want to use your own template? Copy all the files from <code>%s</code> to "
|
166 |
Â
"Vil du bruke din egen template? Kopier alle filer fra <code>%s</code> til "
|
167 |
Â
"<code>%s</code>for å endre de."
|
168 |
Â
|
169 |
+
#: includes/class-wcpdf-settings.php:402
|
170 |
Â
msgid "Paper size"
|
171 |
Â
msgstr "Papirstørrelse"
|
172 |
Â
|
173 |
+
#: includes/class-wcpdf-settings.php:410
|
174 |
Â
msgid "A4"
|
175 |
Â
msgstr "A4"
|
176 |
Â
|
177 |
+
#: includes/class-wcpdf-settings.php:411
|
178 |
Â
msgid "Letter"
|
179 |
Â
msgstr "Letter"
|
180 |
Â
|
181 |
+
#: includes/class-wcpdf-settings.php:418
|
182 |
Â
msgid "Shop header/logo"
|
183 |
Â
msgstr "Butikkens header/logo"
|
184 |
Â
|
185 |
+
#: includes/class-wcpdf-settings.php:425
|
186 |
Â
msgid "Select or upload your invoice header/logo"
|
187 |
Â
msgstr "Velg eller last opp din faktura header/logo"
|
188 |
Â
|
189 |
+
#: includes/class-wcpdf-settings.php:426
|
190 |
Â
msgid "Set image"
|
191 |
Â
msgstr "Velg bilde"
|
192 |
Â
|
193 |
+
#: includes/class-wcpdf-settings.php:427
|
194 |
Â
msgid "Remove image"
|
195 |
Â
msgstr "Fjern bilde"
|
196 |
Â
|
197 |
+
#: includes/class-wcpdf-settings.php:434
|
198 |
Â
msgid "Shop Name"
|
199 |
Â
msgstr "Butikkens navn"
|
200 |
Â
|
201 |
+
#: includes/class-wcpdf-settings.php:448
|
202 |
Â
msgid "Shop Address"
|
203 |
Â
msgstr "Butikkens adresse"
|
204 |
Â
|
205 |
+
#: includes/class-wcpdf-settings.php:464
|
206 |
Â
msgid "Footer: terms & conditions, policies, etc."
|
207 |
Â
msgstr "Footer: Betingelser og Vilkår"
|
208 |
Â
|
209 |
+
#: includes/class-wcpdf-settings.php:481
|
210 |
+
#: includes/class-wcpdf-writepanels.php:286 templates/pdf/Simple/invoice.php:9
|
211 |
Â
#: templates/pdf/Simple/invoice.php:21
|
212 |
+
#: woocommerce-pdf-invoices-packingslips.php:226
|
213 |
Â
msgid "Invoice"
|
214 |
Â
msgstr "Faktura"
|
215 |
Â
|
216 |
+
#: includes/class-wcpdf-settings.php:488
|
217 |
Â
msgid "Display shipping address"
|
218 |
Â
msgstr ""
|
219 |
Â
|
220 |
+
#: includes/class-wcpdf-settings.php:495
|
221 |
Â
msgid ""
|
222 |
Â
"Display shipping address on invoice (in addition to the default billing "
|
223 |
Â
"address) if different from billing address"
|
224 |
Â
msgstr ""
|
225 |
Â
|
226 |
+
#: includes/class-wcpdf-settings.php:501 includes/class-wcpdf-settings.php:675
|
227 |
Â
msgid "Display email address"
|
228 |
Â
msgstr ""
|
229 |
Â
|
230 |
+
#: includes/class-wcpdf-settings.php:513 includes/class-wcpdf-settings.php:687
|
231 |
Â
msgid "Display phone number"
|
232 |
Â
msgstr ""
|
233 |
Â
|
234 |
+
#: includes/class-wcpdf-settings.php:525
|
235 |
Â
msgid "Display invoice date"
|
236 |
Â
msgstr "Vis fakturadato"
|
237 |
Â
|
238 |
+
#: includes/class-wcpdf-settings.php:537
|
239 |
+
msgid "Invoice numbers are created by a third-party extension."
|
240 |
+
msgstr ""
|
241 |
+
|
242 |
+
#: includes/class-wcpdf-settings.php:540
|
243 |
+
#, php-format
|
244 |
+
msgid "Configure it <a href=\"%s\">here</a>."
|
245 |
+
msgstr ""
|
246 |
+
|
247 |
+
#: includes/class-wcpdf-settings.php:549
|
248 |
+
msgid "Display invoice number"
|
249 |
+
msgstr ""
|
250 |
+
|
251 |
+
#: includes/class-wcpdf-settings.php:549
|
252 |
Â
msgid "Display built-in sequential invoice number"
|
253 |
Â
msgstr "Vis sekvensielt fakturanummer"
|
254 |
Â
|
255 |
+
#: includes/class-wcpdf-settings.php:566
|
256 |
Â
msgid "Next invoice number (without prefix/suffix etc.)"
|
257 |
Â
msgstr "Neste fakturanummer (uten prefix/suffix etc.)"
|
258 |
Â
|
259 |
+
#: includes/class-wcpdf-settings.php:574
|
260 |
Â
msgid ""
|
261 |
Â
"This is the number that will be used on the next invoice that is created. By "
|
262 |
Â
"default, numbering starts from the WooCommerce Order Number of the first "
|
270 |
Â
"dersom du endrer denne og setter et lavere tall enn høyeste (PDF) "
|
271 |
Â
"fakturanummer, vil du få flere fakturaer med samme nummer!"
|
272 |
Â
|
273 |
+
#: includes/class-wcpdf-settings.php:598
|
274 |
Â
msgid "Invoice number format"
|
275 |
Â
msgstr "Format på fakturanummer"
|
276 |
Â
|
277 |
+
#: includes/class-wcpdf-settings.php:607
|
278 |
Â
msgid "Prefix"
|
279 |
Â
msgstr "Prefix"
|
280 |
Â
|
281 |
+
#: includes/class-wcpdf-settings.php:609
|
282 |
Â
msgid ""
|
283 |
+
"to use the invoice year and/or month, use [invoice_year] or [invoice_month] "
|
284 |
Â
"respectively"
|
285 |
Â
msgstr ""
|
Â
|
|
Â
|
|
286 |
Â
|
287 |
+
#: includes/class-wcpdf-settings.php:612
|
288 |
Â
msgid "Suffix"
|
289 |
Â
msgstr "Suffix"
|
290 |
Â
|
291 |
+
#: includes/class-wcpdf-settings.php:617
|
292 |
Â
msgid "Padding"
|
293 |
Â
msgstr "Siffer"
|
294 |
Â
|
295 |
+
#: includes/class-wcpdf-settings.php:619
|
296 |
Â
msgid "enter the number of digits here - enter \"6\" to display 42 as 000042"
|
297 |
Â
msgstr "skriv antall siffer her - skriv \"6\" for å vise 42 som 000042"
|
298 |
Â
|
299 |
+
#: includes/class-wcpdf-settings.php:622
|
300 |
Â
msgid ""
|
301 |
Â
"note: if you have already created a custom invoice number format with a "
|
302 |
Â
"filter, the above settings will be ignored"
|
304 |
Â
"merk: hvis du allerede har laget et eget nummerformat for fakuranummer med "
|
305 |
Â
"et filter, vil innstillingene over bli ignorert"
|
306 |
Â
|
307 |
+
#: includes/class-wcpdf-settings.php:628
|
308 |
+
msgid "Reset invoice number yearly"
|
309 |
+
msgstr ""
|
310 |
+
|
311 |
+
#: includes/class-wcpdf-settings.php:641
|
312 |
+
msgid "Extended currency symbol support"
|
313 |
+
msgstr ""
|
314 |
+
|
315 |
+
#: includes/class-wcpdf-settings.php:648
|
316 |
+
msgid "Enable this if your currency symbol is not displaying properly"
|
317 |
+
msgstr ""
|
318 |
+
|
319 |
+
#: includes/class-wcpdf-settings.php:655
|
320 |
Â
#: templates/pdf/Simple/packing-slip.php:9
|
321 |
Â
#: templates/pdf/Simple/packing-slip.php:21
|
322 |
+
#: woocommerce-pdf-invoices-packingslips.php:229
|
323 |
Â
msgid "Packing Slip"
|
324 |
Â
msgstr "Pakkseddel"
|
325 |
Â
|
326 |
+
#: includes/class-wcpdf-settings.php:662
|
327 |
Â
msgid "Display billing address"
|
328 |
Â
msgstr ""
|
329 |
Â
|
330 |
+
#: includes/class-wcpdf-settings.php:669
|
331 |
Â
msgid ""
|
332 |
Â
"Display billing address on packing slip (in addition to the default shipping "
|
333 |
Â
"address) if different from shipping address"
|
334 |
Â
msgstr ""
|
335 |
Â
|
336 |
+
#: includes/class-wcpdf-settings.php:700
|
337 |
Â
msgid "Extra template fields"
|
338 |
Â
msgstr "Ekstrafelt"
|
339 |
Â
|
340 |
+
#: includes/class-wcpdf-settings.php:707
|
341 |
Â
msgid "Extra field 1"
|
342 |
Â
msgstr "Ekstrafelt 1"
|
343 |
Â
|
344 |
+
#: includes/class-wcpdf-settings.php:716
|
345 |
Â
msgid "This is footer column 1 in the <i>Modern (Premium)</i> template"
|
346 |
Â
msgstr "Dette er fotnote-kolonne 1 i <i>Modern (Premium)</i> template"
|
347 |
Â
|
348 |
+
#: includes/class-wcpdf-settings.php:723
|
349 |
Â
msgid "Extra field 2"
|
350 |
Â
msgstr "Ekstrafelt 2"
|
351 |
Â
|
352 |
+
#: includes/class-wcpdf-settings.php:732
|
353 |
Â
msgid "This is footer column 2 in the <i>Modern (Premium)</i> template"
|
354 |
Â
msgstr "Dette er fotnote-kolonne 2 i <i>Modern (Premium)</i> template"
|
355 |
Â
|
356 |
+
#: includes/class-wcpdf-settings.php:739
|
357 |
Â
msgid "Extra field 3"
|
358 |
Â
msgstr "Ekstrafelt 3"
|
359 |
Â
|
360 |
+
#: includes/class-wcpdf-settings.php:748
|
361 |
Â
msgid "This is footer column 3 in the <i>Modern (Premium)</i> template"
|
362 |
Â
msgstr "Dette er fotnote-kolonne 3 i <i>Modern (Premium)</i> template"
|
363 |
Â
|
364 |
+
#: includes/class-wcpdf-settings.php:770
|
365 |
Â
msgid "Debug settings"
|
366 |
Â
msgstr ""
|
367 |
Â
|
368 |
+
#: includes/class-wcpdf-settings.php:777
|
369 |
Â
msgid "Enable debug output"
|
370 |
Â
msgstr ""
|
371 |
Â
|
372 |
+
#: includes/class-wcpdf-settings.php:784
|
373 |
Â
msgid ""
|
374 |
Â
"Enable this option to output plugin errors if you're getting a blank page or "
|
375 |
Â
"other PDF generation issues"
|
376 |
Â
msgstr ""
|
377 |
Â
|
378 |
+
#: includes/class-wcpdf-settings.php:790
|
379 |
Â
msgid "Output to HTML"
|
380 |
Â
msgstr ""
|
381 |
Â
|
382 |
+
#: includes/class-wcpdf-settings.php:797
|
383 |
Â
msgid ""
|
384 |
Â
"Send the template output as HTML to the browser instead of creating a PDF."
|
385 |
Â
msgstr ""
|
386 |
Â
|
387 |
+
#: includes/class-wcpdf-settings.php:803
|
388 |
Â
msgid "Use old tmp folder"
|
389 |
Â
msgstr ""
|
390 |
Â
|
391 |
+
#: includes/class-wcpdf-settings.php:810
|
392 |
Â
msgid ""
|
393 |
Â
"Before version 1.5 of PDF Invoices, temporary files were stored in the "
|
394 |
Â
"plugin folder. This setting is only intended for backwards compatibility, "
|
395 |
Â
"not recommended on new installs!"
|
396 |
Â
msgstr ""
|
397 |
Â
|
398 |
+
#: includes/class-wcpdf-settings.php:1225
|
399 |
Â
msgid "Image resolution"
|
400 |
Â
msgstr "Bildeoppløsning"
|
401 |
Â
|
402 |
+
#: includes/class-wcpdf-settings.php:1341
|
403 |
Â
msgid ""
|
404 |
Â
"<b>Warning!</b> The settings below are meant for debugging/development only. "
|
405 |
Â
"Do not use them on a live website!"
|
406 |
Â
msgstr ""
|
407 |
Â
|
408 |
+
#: includes/class-wcpdf-settings.php:1350
|
409 |
Â
msgid ""
|
410 |
Â
"These are used for the (optional) footer columns in the <em>Modern "
|
411 |
Â
"(Premium)</em> template, but can also be used for other elements in your "
|
418 |
Â
msgid "PDF Packing Slips"
|
419 |
Â
msgstr "PDF Pakksedler"
|
420 |
Â
|
421 |
+
#: includes/class-wcpdf-writepanels.php:120
|
422 |
+
#: includes/class-wcpdf-writepanels.php:253
|
423 |
Â
msgid "PDF Invoice"
|
424 |
Â
msgstr "PDF-faktura"
|
425 |
Â
|
426 |
+
#: includes/class-wcpdf-writepanels.php:125
|
427 |
+
#: includes/class-wcpdf-writepanels.php:258
|
428 |
Â
msgid "PDF Packing Slip"
|
429 |
Â
msgstr "PDF Pakkseddel"
|
430 |
Â
|
431 |
+
#: includes/class-wcpdf-writepanels.php:152
|
432 |
Â
msgid "Invoice Number"
|
433 |
Â
msgstr "Fakturanummer"
|
434 |
Â
|
435 |
+
#: includes/class-wcpdf-writepanels.php:211
|
436 |
Â
msgid "Download invoice (PDF)"
|
437 |
Â
msgstr "Last ned faktura (PDF)"
|
438 |
Â
|
439 |
+
#: includes/class-wcpdf-writepanels.php:225
|
440 |
Â
msgid "Create PDF"
|
441 |
Â
msgstr "Opprett PDF"
|
442 |
Â
|
443 |
+
#: includes/class-wcpdf-writepanels.php:235
|
444 |
+
msgid "PDF Invoice data"
|
445 |
+
msgstr ""
|
446 |
+
|
447 |
+
#: includes/class-wcpdf-writepanels.php:288
|
448 |
+
msgid "Invoice Number (unformatted!)"
|
449 |
+
msgstr ""
|
450 |
Â
|
451 |
+
#: includes/class-wcpdf-writepanels.php:296 templates/pdf/Simple/invoice.php:55
|
Â
|
|
452 |
Â
msgid "Invoice Date:"
|
453 |
Â
msgstr "Fakturadato:"
|
454 |
Â
|
455 |
+
#: includes/class-wcpdf-writepanels.php:298
|
456 |
+
#: includes/class-wcpdf-writepanels.php:300
|
457 |
Â
msgid "h"
|
458 |
Â
msgstr "h"
|
459 |
Â
|
460 |
+
#: includes/class-wcpdf-writepanels.php:298
|
461 |
+
#: includes/class-wcpdf-writepanels.php:300
|
462 |
Â
msgid "m"
|
463 |
Â
msgstr "m"
|
464 |
Â
|
561 |
Â
msgstr "Automatisk ordreutskrift"
|
562 |
Â
|
563 |
Â
#: includes/wcpdf-extensions.php:82
|
564 |
+
msgid "Advanced, customizable templates"
|
565 |
+
msgstr ""
|
566 |
Â
|
567 |
Â
#: includes/wcpdf-extensions.php:85
|
568 |
+
msgid ""
|
569 |
+
"Completely customize the invoice contents (prices, taxes, thumbnails) to "
|
570 |
+
"your needs with a drag & drop customizer"
|
571 |
+
msgstr ""
|
572 |
Â
|
573 |
Â
#: includes/wcpdf-extensions.php:86
|
574 |
+
msgid "Two extra stylish premade templates (Modern & Business)"
|
575 |
+
msgstr ""
|
576 |
Â
|
577 |
Â
#: includes/wcpdf-extensions.php:87
|
578 |
Â
#, php-format
|
586 |
Â
msgid "For custom templates, contact us at %s."
|
587 |
Â
msgstr "For egendefinerte templates, kontakt oss på %s"
|
588 |
Â
|
589 |
+
#: includes/wcpdf-extensions.php:97
|
590 |
+
msgid "Hide this message"
|
591 |
+
msgstr ""
|
592 |
+
|
593 |
+
#: templates/pdf/Simple/invoice.php:29 templates/pdf/Simple/packing-slip.php:40
|
594 |
Â
msgid "Billing Address:"
|
595 |
Â
msgstr "Fakturaadresse:"
|
596 |
Â
|
602 |
Â
msgid "Invoice Number:"
|
603 |
Â
msgstr "Fakturanummer:"
|
604 |
Â
|
605 |
+
#: templates/pdf/Simple/invoice.php:60 templates/pdf/Simple/packing-slip.php:48
|
Â
|
|
606 |
Â
msgid "Order Number:"
|
607 |
Â
msgstr "Ordrenummer:"
|
608 |
Â
|
609 |
+
#: templates/pdf/Simple/invoice.php:64 templates/pdf/Simple/packing-slip.php:52
|
Â
|
|
610 |
Â
msgid "Order Date:"
|
611 |
Â
msgstr "Ordredato:"
|
612 |
Â
|
614 |
Â
msgid "Payment Method:"
|
615 |
Â
msgstr "Betalingsmåte:"
|
616 |
Â
|
617 |
+
#: templates/pdf/Simple/invoice.php:82 templates/pdf/Simple/packing-slip.php:70
|
Â
|
|
618 |
Â
msgid "Product"
|
619 |
Â
msgstr "Produkt:"
|
620 |
Â
|
621 |
+
#: templates/pdf/Simple/invoice.php:83 templates/pdf/Simple/packing-slip.php:71
|
Â
|
|
622 |
Â
msgid "Quantity"
|
623 |
Â
msgstr "Antall"
|
624 |
Â
|
626 |
Â
msgid "Price"
|
627 |
Â
msgstr "Pris"
|
628 |
Â
|
629 |
+
#: templates/pdf/Simple/invoice.php:91 templates/pdf/Simple/packing-slip.php:78
|
Â
|
|
630 |
Â
msgid "Description"
|
631 |
Â
msgstr "Beskrivelse"
|
632 |
Â
|
633 |
+
#: templates/pdf/Simple/invoice.php:96 templates/pdf/Simple/packing-slip.php:83
|
Â
|
|
634 |
Â
msgid "SKU"
|
635 |
Â
msgstr "Art.nr"
|
636 |
Â
|
637 |
+
#: templates/pdf/Simple/invoice.php:97 templates/pdf/Simple/packing-slip.php:84
|
Â
|
|
638 |
Â
msgid "SKU:"
|
639 |
Â
msgstr "Art.nr:"
|
640 |
Â
|
641 |
+
#: templates/pdf/Simple/invoice.php:98 templates/pdf/Simple/packing-slip.php:85
|
Â
|
|
642 |
Â
msgid "Weight:"
|
643 |
Â
msgstr "Vekt:"
|
644 |
Â
|
664 |
Â
"WooCommerce PDF Invoices & Packing Slips krever %sWooCommerce%s for å bli "
|
665 |
Â
"installert og aktivert!"
|
666 |
Â
|
667 |
+
#: woocommerce-pdf-invoices-packingslips.php:377
|
668 |
+
#: woocommerce-pdf-invoices-packingslips.php:438
|
669 |
Â
msgid "N/A"
|
670 |
Â
msgstr "N/A"
|
671 |
Â
|
672 |
+
#: woocommerce-pdf-invoices-packingslips.php:533
|
673 |
Â
msgid "Payment method"
|
674 |
Â
msgstr "Betalingsmåte"
|
675 |
Â
|
676 |
+
#: woocommerce-pdf-invoices-packingslips.php:552
|
677 |
Â
msgid "Shipping method"
|
678 |
Â
msgstr "Leveringsmåte"
|
679 |
Â
|
680 |
+
#: woocommerce-pdf-invoices-packingslips.php:712
|
681 |
+
#, php-format
|
682 |
+
msgid "(includes %s)"
|
683 |
+
msgstr ""
|
684 |
+
|
685 |
+
#: woocommerce-pdf-invoices-packingslips.php:715
|
686 |
+
#, php-format
|
687 |
+
msgid "(Includes %s)"
|
688 |
+
msgstr ""
|
689 |
+
|
690 |
+
#: woocommerce-pdf-invoices-packingslips.php:744
|
691 |
Â
msgid "Subtotal"
|
692 |
Â
msgstr "Total"
|
693 |
Â
|
694 |
+
#: woocommerce-pdf-invoices-packingslips.php:766
|
695 |
Â
msgid "Shipping"
|
696 |
Â
msgstr "Frakt"
|
697 |
Â
|
698 |
+
#: woocommerce-pdf-invoices-packingslips.php:829
|
699 |
Â
msgid "Discount"
|
700 |
Â
msgstr "Avslag"
|
701 |
Â
|
702 |
+
#: woocommerce-pdf-invoices-packingslips.php:870
|
703 |
Â
msgid "VAT"
|
704 |
Â
msgstr "MVA"
|
705 |
Â
|
706 |
+
#: woocommerce-pdf-invoices-packingslips.php:871
|
707 |
Â
msgid "Tax rate"
|
708 |
Â
msgstr "MVA"
|
709 |
Â
|
710 |
+
#: woocommerce-pdf-invoices-packingslips.php:908
|
711 |
Â
msgid "Total ex. VAT"
|
712 |
Â
msgstr "Totalt eksl. MVA"
|
713 |
Â
|
714 |
+
#: woocommerce-pdf-invoices-packingslips.php:911
|
715 |
Â
msgid "Total"
|
716 |
Â
msgstr "Subtotal"
|
717 |
Â
|
718 |
+
#~ msgid ""
|
719 |
+
#~ "to use the order year and/or month, use [order_year] or [order_month] "
|
720 |
+
#~ "respectively"
|
721 |
+
#~ msgstr ""
|
722 |
+
#~ "for å bruke år og/eller måned, kan du bruker [order_year] og/eller "
|
723 |
+
#~ "[order_month]"
|
724 |
+
|
725 |
+
#~ msgid "PDF Invoice Number (unformatted!)"
|
726 |
+
#~ msgstr "PDF fakturanummer (uformatert)"
|
727 |
+
|
728 |
+
#~ msgid "More advanced templates"
|
729 |
+
#~ msgstr "Mer avanserte stiler"
|
730 |
+
|
731 |
+
#~ msgid "Stylish modern invoices & packing slips with product thumbnails!"
|
732 |
+
#~ msgstr "Stilfylle, moderne faktura og pakkelapper med produktbilder!"
|
733 |
+
|
734 |
+
#~ msgid "More tax details on the invoices!"
|
735 |
+
#~ msgstr "Flere detaljer for skatter og avgifter på faktura!"
|
736 |
+
|
737 |
Â
#~ msgid ""
|
738 |
Â
#~ "Attach a <b>static file</b> (for example a terms & conditions document) "
|
739 |
Â
#~ "to the WooCommerce emails of your choice."
|
languages/wpo_wcpdf-nl_NL.mo
CHANGED
Binary file
|
languages/wpo_wcpdf-nl_NL.po
CHANGED
@@ -2,8 +2,8 @@ msgid ""
|
|
2 |
Â
msgstr ""
|
3 |
Â
"Project-Id-Version: WooCommerce PDF Invoices & Packing Slips\n"
|
4 |
Â
"Report-Msgid-Bugs-To: \n"
|
5 |
-
"POT-Creation-Date:
|
6 |
-
"PO-Revision-Date:
|
7 |
Â
"Last-Translator: Ewout Fernhout <chocolade@extrapuur.nl>\n"
|
8 |
Â
"Language-Team: WP Overnight <support@wpovernight.com>\n"
|
9 |
Â
"Language: nl_NL\n"
|
@@ -16,92 +16,92 @@ msgstr ""
|
|
16 |
Â
"_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
|
17 |
Â
"X-Poedit-Basepath: ..\n"
|
18 |
Â
"X-Textdomain-Support: yes\n"
|
19 |
-
"X-Generator: Poedit 1.8.
|
20 |
Â
"X-Poedit-SearchPath-0: .\n"
|
21 |
Â
|
22 |
-
#: includes/class-wcpdf-export.php:
|
23 |
-
#: includes/class-wcpdf-export.php:
|
24 |
Â
msgid "You do not have sufficient permissions to access this page."
|
25 |
Â
msgstr "Je hebt onvoldoende rechten voor deze pagina."
|
26 |
Â
|
27 |
-
#: includes/class-wcpdf-export.php:
|
28 |
Â
msgid "Some of the export parameters are missing."
|
29 |
Â
msgstr "Er ontbreken export parameters"
|
30 |
Â
|
31 |
-
#: includes/class-wcpdf-export.php:
|
32 |
Â
msgid "invoice"
|
33 |
Â
msgid_plural "invoices"
|
34 |
Â
msgstr[0] "factuur"
|
35 |
Â
msgstr[1] "facturen"
|
36 |
Â
|
37 |
-
#: includes/class-wcpdf-export.php:
|
38 |
Â
msgid "packing-slip"
|
39 |
Â
msgid_plural "packing-slips"
|
40 |
Â
msgstr[0] "pakbon"
|
41 |
Â
msgstr[1] "pakbonnen"
|
42 |
Â
|
43 |
-
#: includes/class-wcpdf-settings.php:
|
44 |
Â
#: includes/class-wcpdf-writepanels.php:32
|
45 |
Â
msgid "PDF Invoices"
|
46 |
Â
msgstr "PDF facturen"
|
47 |
Â
|
48 |
-
#: includes/class-wcpdf-settings.php:
|
49 |
Â
msgid "Settings"
|
50 |
Â
msgstr "Instellingen"
|
51 |
Â
|
52 |
-
#: includes/class-wcpdf-settings.php:
|
53 |
Â
msgid "General"
|
54 |
Â
msgstr "Algemeen"
|
55 |
Â
|
56 |
-
#: includes/class-wcpdf-settings.php:
|
57 |
Â
msgid "Template"
|
58 |
Â
msgstr "Template"
|
59 |
Â
|
60 |
-
#: includes/class-wcpdf-settings.php:
|
61 |
Â
msgid "Status"
|
62 |
Â
msgstr "Status"
|
63 |
Â
|
64 |
-
#: includes/class-wcpdf-settings.php:
|
65 |
Â
msgid "WooCommerce PDF Invoices"
|
66 |
Â
msgstr "WooCommerce PDF Facturen"
|
67 |
Â
|
68 |
-
#: includes/class-wcpdf-settings.php:
|
69 |
Â
msgid "General settings"
|
70 |
Â
msgstr "Algemene instellingen"
|
71 |
Â
|
72 |
-
#: includes/class-wcpdf-settings.php:
|
73 |
Â
msgid "How do you want to view the PDF?"
|
74 |
Â
msgstr "Hoe wil je de PDF bekijken?"
|
75 |
Â
|
76 |
-
#: includes/class-wcpdf-settings.php:
|
77 |
Â
msgid "Download the PDF"
|
78 |
Â
msgstr "Download de PDF"
|
79 |
Â
|
80 |
-
#: includes/class-wcpdf-settings.php:
|
81 |
Â
msgid "Open the PDF in a new browser tab/window"
|
82 |
Â
msgstr "Open de PDF in een nieuwe browser tab/venster"
|
83 |
Â
|
84 |
-
#: includes/class-wcpdf-settings.php:
|
85 |
Â
msgid "Admin New Order email"
|
86 |
Â
msgstr "Nieuwe bestelling (admin email)"
|
87 |
Â
|
88 |
-
#: includes/class-wcpdf-settings.php:
|
89 |
Â
msgid "Customer Processing Order email"
|
90 |
Â
msgstr "Bestelling in behandeling (klant email)"
|
91 |
Â
|
92 |
-
#: includes/class-wcpdf-settings.php:
|
93 |
Â
msgid "Customer Completed Order email"
|
94 |
Â
msgstr "Bestelling afgerond (klant email)"
|
95 |
Â
|
96 |
-
#: includes/class-wcpdf-settings.php:
|
97 |
Â
msgid "Customer Invoice email"
|
98 |
Â
msgstr "Factuur (klant email)"
|
99 |
Â
|
100 |
-
#: includes/class-wcpdf-settings.php:
|
101 |
Â
msgid "Attach invoice to:"
|
102 |
Â
msgstr "Factuur als bijlage toevoegen aan:"
|
103 |
Â
|
104 |
-
#: includes/class-wcpdf-settings.php:
|
105 |
Â
#, php-format
|
106 |
Â
msgid ""
|
107 |
Â
"It looks like the temp folder (<code>%s</code>) is not writable, check the "
|
@@ -112,11 +112,11 @@ msgstr ""
|
|
112 |
Â
"controleer de rechten op deze folder! Zonder schrijfrechten kan de plugin "
|
113 |
Â
"geen facturen emailen."
|
114 |
Â
|
115 |
-
#: includes/class-wcpdf-settings.php:
|
116 |
Â
msgid "Disable for free products"
|
117 |
Â
msgstr "Uitschakelen voor gratis producten"
|
118 |
Â
|
119 |
-
#: includes/class-wcpdf-settings.php:
|
120 |
Â
msgid ""
|
121 |
Â
"Disable automatic creation/attachment of invoices when only free products "
|
122 |
Â
"are ordered"
|
@@ -124,43 +124,43 @@ msgstr ""
|
|
124 |
Â
"Automatisch aanmaken/vesturen van facturen uitschakelen wanneer er alleen "
|
125 |
Â
"gratis producten zijn besteld."
|
126 |
Â
|
127 |
-
#: includes/class-wcpdf-settings.php:
|
128 |
Â
msgid "Interface"
|
129 |
Â
msgstr "Interface"
|
130 |
Â
|
131 |
-
#: includes/class-wcpdf-settings.php:
|
132 |
Â
msgid "Allow My Account invoice download"
|
133 |
Â
msgstr "Sta downloaden factuur vanaf Mijn Account toe"
|
134 |
Â
|
135 |
-
#: includes/class-wcpdf-settings.php:
|
136 |
Â
msgid "Only when an invoice is already created/emailed"
|
137 |
Â
msgstr "Alleen wanneer een factuur al is aangemaakt/gemaild"
|
138 |
Â
|
139 |
-
#: includes/class-wcpdf-settings.php:
|
140 |
Â
msgid "Only for specific order statuses (define below)"
|
141 |
Â
msgstr "Alleen voor specifieke order statussen (hieronder gedefinieerd)"
|
142 |
Â
|
143 |
-
#: includes/class-wcpdf-settings.php:
|
144 |
Â
msgid "Always"
|
145 |
Â
msgstr "Altijd"
|
146 |
Â
|
147 |
-
#: includes/class-wcpdf-settings.php:
|
148 |
Â
msgid "Never"
|
149 |
Â
msgstr "Nooit"
|
150 |
Â
|
151 |
-
#: includes/class-wcpdf-settings.php:
|
152 |
Â
msgid "Enable invoice number column in the orders list"
|
153 |
Â
msgstr "Schakel factuurnummer kolom in het bestellingen overzicht in"
|
154 |
Â
|
155 |
-
#: includes/class-wcpdf-settings.php:
|
156 |
Â
msgid "PDF Template settings"
|
157 |
Â
msgstr "PDF Template instellingen"
|
158 |
Â
|
159 |
-
#: includes/class-wcpdf-settings.php:
|
160 |
Â
msgid "Choose a template"
|
161 |
Â
msgstr "Kies een template"
|
162 |
Â
|
163 |
-
#: includes/class-wcpdf-settings.php:
|
164 |
Â
#, php-format
|
165 |
Â
msgid ""
|
166 |
Â
"Want to use your own template? Copy all the files from <code>%s</code> to "
|
@@ -169,58 +169,58 @@ msgstr ""
|
|
169 |
Â
"Wil je je eigen template gebruiken? Kopieer alle bestanden van <code>%s</"
|
170 |
Â
"code> naar je (child-) theme in <code>%s</code> en pas ze aan naar je wensen."
|
171 |
Â
|
172 |
-
#: includes/class-wcpdf-settings.php:
|
173 |
Â
msgid "Paper size"
|
174 |
Â
msgstr "Papierformaat"
|
175 |
Â
|
176 |
-
#: includes/class-wcpdf-settings.php:
|
177 |
Â
msgid "A4"
|
178 |
Â
msgstr "A4"
|
179 |
Â
|
180 |
-
#: includes/class-wcpdf-settings.php:
|
181 |
Â
msgid "Letter"
|
182 |
Â
msgstr "Letter (US)"
|
183 |
Â
|
184 |
-
#: includes/class-wcpdf-settings.php:
|
185 |
Â
msgid "Shop header/logo"
|
186 |
Â
msgstr "Shop header/logo"
|
187 |
Â
|
188 |
-
#: includes/class-wcpdf-settings.php:
|
189 |
Â
msgid "Select or upload your invoice header/logo"
|
190 |
Â
msgstr "Selecteer of upload je factuur header/logo"
|
191 |
Â
|
192 |
-
#: includes/class-wcpdf-settings.php:
|
193 |
Â
msgid "Set image"
|
194 |
Â
msgstr "Stel afbeelding in"
|
195 |
Â
|
196 |
-
#: includes/class-wcpdf-settings.php:
|
197 |
Â
msgid "Remove image"
|
198 |
Â
msgstr "Verwijder afbeelding"
|
199 |
Â
|
200 |
-
#: includes/class-wcpdf-settings.php:
|
201 |
Â
msgid "Shop Name"
|
202 |
Â
msgstr "Shop Naam"
|
203 |
Â
|
204 |
-
#: includes/class-wcpdf-settings.php:
|
205 |
Â
msgid "Shop Address"
|
206 |
Â
msgstr "Shop Adres"
|
207 |
Â
|
208 |
-
#: includes/class-wcpdf-settings.php:
|
209 |
Â
msgid "Footer: terms & conditions, policies, etc."
|
210 |
Â
msgstr "Voettekst: algemene voorwaarden, retourenbeleid, etc."
|
211 |
Â
|
212 |
-
#: includes/class-wcpdf-settings.php:
|
213 |
-
#: includes/class-wcpdf-writepanels.php:
|
214 |
Â
#: templates/pdf/Simple/invoice.php:21
|
215 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
216 |
Â
msgid "Invoice"
|
217 |
Â
msgstr "Factuur"
|
218 |
Â
|
219 |
-
#: includes/class-wcpdf-settings.php:
|
220 |
Â
msgid "Display shipping address"
|
221 |
Â
msgstr "Geef verzendadres weer"
|
222 |
Â
|
223 |
-
#: includes/class-wcpdf-settings.php:
|
224 |
Â
msgid ""
|
225 |
Â
"Display shipping address on invoice (in addition to the default billing "
|
226 |
Â
"address) if different from billing address"
|
@@ -228,27 +228,40 @@ msgstr ""
|
|
228 |
Â
"Geef verzendadres weer op de factuur (naast het standaard factuuradres) "
|
229 |
Â
"wanneer deze verschilt van het factuuradres"
|
230 |
Â
|
231 |
-
#: includes/class-wcpdf-settings.php:
|
232 |
Â
msgid "Display email address"
|
233 |
Â
msgstr "Geef email adres weer"
|
234 |
Â
|
235 |
-
#: includes/class-wcpdf-settings.php:
|
236 |
Â
msgid "Display phone number"
|
237 |
Â
msgstr "Geef telefoonnummer weer"
|
238 |
Â
|
239 |
-
#: includes/class-wcpdf-settings.php:
|
240 |
Â
msgid "Display invoice date"
|
241 |
Â
msgstr "Geef factuurdatum weer"
|
242 |
Â
|
243 |
-
#: includes/class-wcpdf-settings.php:
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
244 |
Â
msgid "Display built-in sequential invoice number"
|
245 |
Â
msgstr "Geef ingebouwde doorlopende factuurnummers weer"
|
246 |
Â
|
247 |
-
#: includes/class-wcpdf-settings.php:
|
248 |
Â
msgid "Next invoice number (without prefix/suffix etc.)"
|
249 |
Â
msgstr "Volgend factuurnummer (zonder voor- of achtervoegsel etc.)"
|
250 |
Â
|
251 |
-
#: includes/class-wcpdf-settings.php:
|
252 |
Â
msgid ""
|
253 |
Â
"This is the number that will be used on the next invoice that is created. By "
|
254 |
Â
"default, numbering starts from the WooCommerce Order Number of the first "
|
@@ -263,37 +276,37 @@ msgstr ""
|
|
263 |
Â
"hoogste huidige (PDF) factuurnummer zet, kan dit dubbele factuurnummers tot "
|
264 |
Â
"gevolg hebben!"
|
265 |
Â
|
266 |
-
#: includes/class-wcpdf-settings.php:
|
267 |
Â
msgid "Invoice number format"
|
268 |
Â
msgstr "Factuurnummer format"
|
269 |
Â
|
270 |
-
#: includes/class-wcpdf-settings.php:
|
271 |
Â
msgid "Prefix"
|
272 |
Â
msgstr "Voorvoegsel"
|
273 |
Â
|
274 |
-
#: includes/class-wcpdf-settings.php:
|
275 |
Â
msgid ""
|
276 |
-
"to use the
|
277 |
Â
"respectively"
|
278 |
Â
msgstr ""
|
279 |
-
"
|
280 |
-
"
|
281 |
Â
|
282 |
-
#: includes/class-wcpdf-settings.php:
|
283 |
Â
msgid "Suffix"
|
284 |
Â
msgstr "Achtervoegsel"
|
285 |
Â
|
286 |
-
#: includes/class-wcpdf-settings.php:
|
287 |
Â
msgid "Padding"
|
288 |
Â
msgstr "Vulling"
|
289 |
Â
|
290 |
-
#: includes/class-wcpdf-settings.php:
|
291 |
Â
msgid "enter the number of digits here - enter \"6\" to display 42 as 000042"
|
292 |
Â
msgstr ""
|
293 |
Â
"voer hier het aantal cijfers in - vul hier \"6\" in om 42 als 000042 weer te "
|
294 |
Â
"geven"
|
295 |
Â
|
296 |
-
#: includes/class-wcpdf-settings.php:
|
297 |
Â
msgid ""
|
298 |
Â
"note: if you have already created a custom invoice number format with a "
|
299 |
Â
"filter, the above settings will be ignored"
|
@@ -301,22 +314,32 @@ msgstr ""
|
|
301 |
Â
"let op: als je al een format voor een factuurnummer hebt gemaakt met een "
|
302 |
Â
"filter, worden de bovenstaande instellingen genegeerd"
|
303 |
Â
|
304 |
-
#: includes/class-wcpdf-settings.php:
|
305 |
Â
msgid "Reset invoice number yearly"
|
306 |
Â
msgstr "Reset factuurnummer jaarlijks"
|
307 |
Â
|
308 |
-
#: includes/class-wcpdf-settings.php:
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
309 |
Â
#: templates/pdf/Simple/packing-slip.php:9
|
310 |
Â
#: templates/pdf/Simple/packing-slip.php:21
|
311 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
312 |
Â
msgid "Packing Slip"
|
313 |
Â
msgstr "Pakbon"
|
314 |
Â
|
315 |
-
#: includes/class-wcpdf-settings.php:
|
316 |
Â
msgid "Display billing address"
|
317 |
Â
msgstr "Geef factuuradres weer"
|
318 |
Â
|
319 |
-
#: includes/class-wcpdf-settings.php:
|
320 |
Â
msgid ""
|
321 |
Â
"Display billing address on packing slip (in addition to the default shipping "
|
322 |
Â
"address) if different from shipping address"
|
@@ -324,43 +347,43 @@ msgstr ""
|
|
324 |
Â
"Geef factuuradres weer op de pakbon (naast het standaard verzendadres) "
|
325 |
Â
"wanneer deze verschilt van het verzendadres"
|
326 |
Â
|
327 |
-
#: includes/class-wcpdf-settings.php:
|
328 |
Â
msgid "Extra template fields"
|
329 |
Â
msgstr "Extra templatevelden"
|
330 |
Â
|
331 |
-
#: includes/class-wcpdf-settings.php:
|
332 |
Â
msgid "Extra field 1"
|
333 |
Â
msgstr "Extra veld 1"
|
334 |
Â
|
335 |
-
#: includes/class-wcpdf-settings.php:
|
336 |
Â
msgid "This is footer column 1 in the <i>Modern (Premium)</i> template"
|
337 |
Â
msgstr "Dit is voettekst kolom 1 in het <i>Modern (Premium)</i> template"
|
338 |
Â
|
339 |
-
#: includes/class-wcpdf-settings.php:
|
340 |
Â
msgid "Extra field 2"
|
341 |
Â
msgstr "Extra veld 2"
|
342 |
Â
|
343 |
-
#: includes/class-wcpdf-settings.php:
|
344 |
Â
msgid "This is footer column 2 in the <i>Modern (Premium)</i> template"
|
345 |
Â
msgstr "Dit is voettekst kolom 2 in het <i>Modern (Premium)</i> template"
|
346 |
Â
|
347 |
-
#: includes/class-wcpdf-settings.php:
|
348 |
Â
msgid "Extra field 3"
|
349 |
Â
msgstr "Extra veld 3"
|
350 |
Â
|
351 |
-
#: includes/class-wcpdf-settings.php:
|
352 |
Â
msgid "This is footer column 3 in the <i>Modern (Premium)</i> template"
|
353 |
Â
msgstr "Dit is voettekst kolom 3 in het <i>Modern (Premium)</i> template"
|
354 |
Â
|
355 |
-
#: includes/class-wcpdf-settings.php:
|
356 |
Â
msgid "Debug settings"
|
357 |
Â
msgstr "Debug instellingen"
|
358 |
Â
|
359 |
-
#: includes/class-wcpdf-settings.php:
|
360 |
Â
msgid "Enable debug output"
|
361 |
Â
msgstr "Debug uitvoer inschakelen"
|
362 |
Â
|
363 |
-
#: includes/class-wcpdf-settings.php:
|
364 |
Â
msgid ""
|
365 |
Â
"Enable this option to output plugin errors if you're getting a blank page or "
|
366 |
Â
"other PDF generation issues"
|
@@ -368,22 +391,22 @@ msgstr ""
|
|
368 |
Â
"Schakel deze optie in om pluginfouten weer te geven, wanneer je een lege "
|
369 |
Â
"pagina krijgt of andere problemen hebt met het genereren van PDF."
|
370 |
Â
|
371 |
-
#: includes/class-wcpdf-settings.php:
|
372 |
Â
msgid "Output to HTML"
|
373 |
Â
msgstr "Uitvoer naar HTML"
|
374 |
Â
|
375 |
-
#: includes/class-wcpdf-settings.php:
|
376 |
Â
msgid ""
|
377 |
Â
"Send the template output as HTML to the browser instead of creating a PDF."
|
378 |
Â
msgstr ""
|
379 |
Â
"Stuur de uitvoer van de template als HTML naar de browser in plaats van een "
|
380 |
Â
"PDF."
|
381 |
Â
|
382 |
-
#: includes/class-wcpdf-settings.php:
|
383 |
Â
msgid "Use old tmp folder"
|
384 |
Â
msgstr "Gebruik de oude tmp folder"
|
385 |
Â
|
386 |
-
#: includes/class-wcpdf-settings.php:
|
387 |
Â
msgid ""
|
388 |
Â
"Before version 1.5 of PDF Invoices, temporary files were stored in the "
|
389 |
Â
"plugin folder. This setting is only intended for backwards compatibility, "
|
@@ -393,11 +416,11 @@ msgstr ""
|
|
393 |
Â
"de plugin map. Deze instelling is enkel bedoelde voor backwards "
|
394 |
Â
"compatibiliteit, en niet aanbevolen op nieuwe installaties!"
|
395 |
Â
|
396 |
-
#: includes/class-wcpdf-settings.php:
|
397 |
Â
msgid "Image resolution"
|
398 |
Â
msgstr "Afbeeldings resolutie"
|
399 |
Â
|
400 |
-
#: includes/class-wcpdf-settings.php:
|
401 |
Â
msgid ""
|
402 |
Â
"<b>Warning!</b> The settings below are meant for debugging/development only. "
|
403 |
Â
"Do not use them on a live website!"
|
@@ -405,7 +428,7 @@ msgstr ""
|
|
405 |
Â
"<b>Waarschuwing!</b> Onderstaande instellingen zijn enkel bedoeld om fouten "
|
406 |
Â
"op te sporen of om te testen. Gebruik ze niet op een live website!"
|
407 |
Â
|
408 |
-
#: includes/class-wcpdf-settings.php:
|
409 |
Â
msgid ""
|
410 |
Â
"These are used for the (optional) footer columns in the <em>Modern "
|
411 |
Â
"(Premium)</em> template, but can also be used for other elements in your "
|
@@ -419,45 +442,47 @@ msgstr ""
|
|
419 |
Â
msgid "PDF Packing Slips"
|
420 |
Â
msgstr "PDF Pakbonnen"
|
421 |
Â
|
422 |
-
#: includes/class-wcpdf-writepanels.php:
|
423 |
-
#: includes/class-wcpdf-writepanels.php:
|
424 |
Â
msgid "PDF Invoice"
|
425 |
Â
msgstr "PDF factuur"
|
426 |
Â
|
427 |
-
#: includes/class-wcpdf-writepanels.php:
|
428 |
-
#: includes/class-wcpdf-writepanels.php:
|
429 |
Â
msgid "PDF Packing Slip"
|
430 |
Â
msgstr "PDF Pakbon"
|
431 |
Â
|
432 |
-
#: includes/class-wcpdf-writepanels.php:
|
433 |
Â
msgid "Invoice Number"
|
434 |
Â
msgstr "Factuurnummer"
|
435 |
Â
|
436 |
-
#: includes/class-wcpdf-writepanels.php:
|
437 |
Â
msgid "Download invoice (PDF)"
|
438 |
Â
msgstr "Download factuur (PDF)"
|
439 |
Â
|
440 |
-
#: includes/class-wcpdf-writepanels.php:
|
441 |
Â
msgid "Create PDF"
|
442 |
Â
msgstr "Maak PDF"
|
443 |
Â
|
444 |
-
#: includes/class-wcpdf-writepanels.php:
|
445 |
Â
msgid "PDF Invoice data"
|
446 |
Â
msgstr "PDF Factuur gegevens"
|
447 |
Â
|
448 |
-
#: includes/class-wcpdf-writepanels.php:
|
449 |
Â
msgid "Invoice Number (unformatted!)"
|
450 |
Â
msgstr "Factuurnummer (zonder formatting!)"
|
451 |
Â
|
452 |
-
#: includes/class-wcpdf-writepanels.php:
|
453 |
Â
msgid "Invoice Date:"
|
454 |
Â
msgstr "Factuurdatum:"
|
455 |
Â
|
456 |
-
#: includes/class-wcpdf-writepanels.php:
|
Â
|
|
457 |
Â
msgid "h"
|
458 |
Â
msgstr "u"
|
459 |
Â
|
460 |
-
#: includes/class-wcpdf-writepanels.php:
|
Â
|
|
461 |
Â
msgid "m"
|
462 |
Â
msgstr "m"
|
463 |
Â
|
@@ -469,23 +494,31 @@ msgstr "Bekijk deze premium uitbreidingen!"
|
|
469 |
Â
msgid "click items to read more"
|
470 |
Â
msgstr "Klik op de items om meer te lezen"
|
471 |
Â
|
472 |
-
#: includes/wcpdf-extensions.php:
|
473 |
-
msgid "
|
474 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
475 |
Â
|
476 |
-
#: includes/wcpdf-extensions.php:
|
477 |
Â
msgid ""
|
478 |
-
"Supercharge WooCommerce PDF Invoices & Packing Slips with the
|
479 |
-
"
|
480 |
Â
msgstr ""
|
481 |
-
"Geef WooCommerce PDF Invoices & Packing Slips een boost met
|
482 |
-
"
|
483 |
Â
|
484 |
-
#: includes/wcpdf-extensions.php:
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
485 |
Â
msgid "Email/print/download <b>PDF Credit Notes & Proforma invoices</b>"
|
486 |
Â
msgstr "Email/print/download <b>PDF Credit Nota's & Pro-forma facturen</b>"
|
487 |
Â
|
488 |
-
#: includes/wcpdf-extensions.php:
|
489 |
Â
msgid ""
|
490 |
Â
"Send out a separate <b>notification email</b> with (or without) PDF invoices/"
|
491 |
Â
"packing slips, for example to a drop-shipper or a supplier."
|
@@ -493,7 +526,7 @@ msgstr ""
|
|
493 |
Â
"Verstuur een aparte <b>notificatie email</b> met (of zonder) PDF facturen/"
|
494 |
Â
"pakbonnen, bijvoorbeeld naar een drop-shipper of een leverancier."
|
495 |
Â
|
496 |
-
#: includes/wcpdf-extensions.php:
|
497 |
Â
msgid ""
|
498 |
Â
"Attach <b>up to 3 static files</b> (for example a terms & conditions "
|
499 |
Â
"document) to the WooCommerce emails of your choice."
|
@@ -501,7 +534,7 @@ msgstr ""
|
|
501 |
Â
"Voeg tot <b>3 vaste bestandsbijlagen</b> (bijvoorbeeld algemene voorwaarden) "
|
502 |
Â
"toe aan WooCommerce emails naar keuze."
|
503 |
Â
|
504 |
-
#: includes/wcpdf-extensions.php:
|
505 |
Â
msgid ""
|
506 |
Â
"Use <b>separate numbering systems</b> and/or format for proforma invoices "
|
507 |
Â
"and credit notes or utilize the main invoice numbering system"
|
@@ -509,7 +542,7 @@ msgstr ""
|
|
509 |
Â
"Gebruik <b>losse nummersystemen</b> en/of formats voor pro-forma facturen en "
|
510 |
Â
"credit notes, of gebruik het hoofd factuurnummersysteem."
|
511 |
Â
|
512 |
-
#: includes/wcpdf-extensions.php:
|
513 |
Â
msgid ""
|
514 |
Â
"<b>Customize</b> the <b>shipping & billing address</b> format to include "
|
515 |
Â
"additional custom fields, font sizes etc. without the need to create a "
|
@@ -518,19 +551,31 @@ msgstr ""
|
|
518 |
Â
"<b>Pas het verzend- en factuuradres aan</b> met custom velden, verschillende "
|
519 |
Â
"fontgroottes etc, zonder daarvoor een custom template aan te maken."
|
520 |
Â
|
521 |
-
#: includes/wcpdf-extensions.php:
|
522 |
Â
msgid "Use the plugin in multilingual <b>WPML</b> setups"
|
523 |
Â
msgstr "Gebruik de plugin in meertalige <b>WPML</b> setups"
|
524 |
Â
|
525 |
-
#: includes/wcpdf-extensions.php:
|
526 |
-
msgid "
|
527 |
-
msgstr "
|
528 |
Â
|
529 |
-
#: includes/wcpdf-extensions.php:
|
530 |
-
msgid "
|
531 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
532 |
Â
|
533 |
-
#: includes/wcpdf-extensions.php:
|
534 |
Â
msgid ""
|
535 |
Â
"This extension conveniently uploads all the invoices (and other pdf "
|
536 |
Â
"documents from the professional extension) that are emailed to your "
|
@@ -541,11 +586,88 @@ msgstr ""
|
|
541 |
Â
"professional extensie) die worden ge-emaild naar je klanten naar Dropbox. De "
|
542 |
Â
"beste manier om je factuur administratie up te date te houden!"
|
543 |
Â
|
544 |
-
#: includes/wcpdf-extensions.php:
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
545 |
Â
msgid "Get WooCommerce PDF Invoices & Packing Slips to dropbox!"
|
546 |
Â
msgstr "Neem WooCommerce PDF Invoices & Packing Slips to dropbox!"
|
547 |
Â
|
548 |
-
#: includes/wcpdf-extensions.php:
|
549 |
Â
msgid ""
|
550 |
Â
"Automatically send new orders or packing slips to your printer, as soon as "
|
551 |
Â
"the customer orders!"
|
@@ -553,7 +675,7 @@ msgstr ""
|
|
553 |
Â
"Verstuur nieuwe orders of pakbonnen automatisch naar je printer, zodra een "
|
554 |
Â
"klant een bestelling plaatst."
|
555 |
Â
|
556 |
-
#: includes/wcpdf-extensions.php:
|
557 |
Â
msgid ""
|
558 |
Â
"Check out the WooCommerce Automatic Order Printing extension from our "
|
559 |
Â
"partners at Simba Hosting"
|
@@ -561,36 +683,24 @@ msgstr ""
|
|
561 |
Â
"Bekijk de WooCommerce Automatic Order Printing extensie van onze parters van "
|
562 |
Â
"Simba Hosting"
|
563 |
Â
|
564 |
-
#: includes/wcpdf-extensions.php:
|
565 |
Â
msgid "WooCommerce Automatic Order Printing"
|
566 |
Â
msgstr "WooCommerce Automatic Order Printing"
|
567 |
Â
|
568 |
-
#: includes/wcpdf-extensions.php:
|
569 |
-
msgid "Advanced, customizable templates"
|
570 |
-
msgstr "Geavanceerde, aanpasbare templates"
|
571 |
-
|
572 |
-
#: includes/wcpdf-extensions.php:85
|
573 |
-
msgid ""
|
574 |
-
"Completely customize the invoice contents (prices, taxes, thumbnails) to "
|
575 |
-
"your needs with a drag & drop customizer"
|
576 |
-
msgstr ""
|
577 |
-
"Past de inhoud van de factuur (prijzen, BTW, thumbnails) volledig naar je "
|
578 |
-
"wensen aan met een eenvoudige drag & drop interface"
|
579 |
-
|
580 |
-
#: includes/wcpdf-extensions.php:86
|
581 |
-
msgid "Two extra stylish premade templates (Modern & Business)"
|
582 |
-
msgstr "Twee extra stijlvolle voorgeconfigureerde templates (Moden & Business)"
|
583 |
-
|
584 |
-
#: includes/wcpdf-extensions.php:87
|
585 |
Â
#, php-format
|
586 |
Â
msgid "Check out the Premium PDF Invoice & Packing Slips templates at %s."
|
587 |
Â
msgstr "Bekijk de Premium PDF Invoice & Packing Slips templates op %s."
|
588 |
Â
|
589 |
-
#: includes/wcpdf-extensions.php:
|
590 |
Â
#, php-format
|
591 |
Â
msgid "For custom templates, contact us at %s."
|
592 |
Â
msgstr "Neem voor custom templates contact met ons op via %s"
|
593 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
594 |
Â
#: templates/pdf/Simple/invoice.php:29 templates/pdf/Simple/packing-slip.php:40
|
595 |
Â
msgid "Billing Address:"
|
596 |
Â
msgstr "Factuuradres:"
|
@@ -665,52 +775,64 @@ msgstr ""
|
|
665 |
Â
"WooCommerce PDF Invoices & Packing Slips vereist dat %sWooCommerce%s is "
|
666 |
Â
"geïnstalleerd & geactiveerd!"
|
667 |
Â
|
668 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
669 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
670 |
Â
msgid "N/A"
|
671 |
Â
msgstr "N/A"
|
672 |
Â
|
673 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
674 |
Â
msgid "Payment method"
|
675 |
Â
msgstr "Betaalmethode"
|
676 |
Â
|
677 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
678 |
Â
msgid "Shipping method"
|
679 |
Â
msgstr "Verzendmethode"
|
680 |
Â
|
681 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
682 |
Â
#, php-format
|
683 |
Â
msgid "(Includes %s)"
|
684 |
Â
msgstr ""
|
685 |
Â
|
686 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
687 |
Â
msgid "Subtotal"
|
688 |
Â
msgstr "Subtotaal"
|
689 |
Â
|
690 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
691 |
Â
msgid "Shipping"
|
692 |
Â
msgstr "Verzendkosten"
|
693 |
Â
|
694 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
695 |
Â
msgid "Discount"
|
696 |
Â
msgstr "Korting"
|
697 |
Â
|
698 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
699 |
Â
msgid "VAT"
|
700 |
Â
msgstr "BTW"
|
701 |
Â
|
702 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
703 |
Â
msgid "Tax rate"
|
704 |
Â
msgstr "BTW tarief"
|
705 |
Â
|
706 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
707 |
Â
msgid "Total ex. VAT"
|
708 |
Â
msgstr "Totaal excl. BTW"
|
709 |
Â
|
710 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
711 |
Â
msgid "Total"
|
712 |
Â
msgstr "Totaal"
|
713 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
714 |
Â
#~ msgid "PDF Invoice Number (unformatted!)"
|
715 |
Â
#~ msgstr "PDF Factuurnummer (zonder formatting!)"
|
716 |
Â
|
2 |
Â
msgstr ""
|
3 |
Â
"Project-Id-Version: WooCommerce PDF Invoices & Packing Slips\n"
|
4 |
Â
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2016-11-07 17:00+0100\n"
|
6 |
+
"PO-Revision-Date: 2016-11-07 17:10+0100\n"
|
7 |
Â
"Last-Translator: Ewout Fernhout <chocolade@extrapuur.nl>\n"
|
8 |
Â
"Language-Team: WP Overnight <support@wpovernight.com>\n"
|
9 |
Â
"Language: nl_NL\n"
|
16 |
Â
"_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
|
17 |
Â
"X-Poedit-Basepath: ..\n"
|
18 |
Â
"X-Textdomain-Support: yes\n"
|
19 |
+
"X-Generator: Poedit 1.8.9\n"
|
20 |
Â
"X-Poedit-SearchPath-0: .\n"
|
21 |
Â
|
22 |
+
#: includes/class-wcpdf-export.php:418 includes/class-wcpdf-export.php:432
|
23 |
+
#: includes/class-wcpdf-export.php:439 includes/class-wcpdf-export.php:447
|
24 |
Â
msgid "You do not have sufficient permissions to access this page."
|
25 |
Â
msgstr "Je hebt onvoldoende rechten voor deze pagina."
|
26 |
Â
|
27 |
+
#: includes/class-wcpdf-export.php:423
|
28 |
Â
msgid "Some of the export parameters are missing."
|
29 |
Â
msgstr "Er ontbreken export parameters"
|
30 |
Â
|
31 |
+
#: includes/class-wcpdf-export.php:504
|
32 |
Â
msgid "invoice"
|
33 |
Â
msgid_plural "invoices"
|
34 |
Â
msgstr[0] "factuur"
|
35 |
Â
msgstr[1] "facturen"
|
36 |
Â
|
37 |
+
#: includes/class-wcpdf-export.php:508
|
38 |
Â
msgid "packing-slip"
|
39 |
Â
msgid_plural "packing-slips"
|
40 |
Â
msgstr[0] "pakbon"
|
41 |
Â
msgstr[1] "pakbonnen"
|
42 |
Â
|
43 |
+
#: includes/class-wcpdf-settings.php:37 includes/class-wcpdf-settings.php:38
|
44 |
Â
#: includes/class-wcpdf-writepanels.php:32
|
45 |
Â
msgid "PDF Invoices"
|
46 |
Â
msgstr "PDF facturen"
|
47 |
Â
|
48 |
+
#: includes/class-wcpdf-settings.php:79
|
49 |
Â
msgid "Settings"
|
50 |
Â
msgstr "Instellingen"
|
51 |
Â
|
52 |
+
#: includes/class-wcpdf-settings.php:101
|
53 |
Â
msgid "General"
|
54 |
Â
msgstr "Algemeen"
|
55 |
Â
|
56 |
+
#: includes/class-wcpdf-settings.php:102
|
57 |
Â
msgid "Template"
|
58 |
Â
msgstr "Template"
|
59 |
Â
|
60 |
+
#: includes/class-wcpdf-settings.php:107
|
61 |
Â
msgid "Status"
|
62 |
Â
msgstr "Status"
|
63 |
Â
|
64 |
+
#: includes/class-wcpdf-settings.php:119
|
65 |
Â
msgid "WooCommerce PDF Invoices"
|
66 |
Â
msgstr "WooCommerce PDF Facturen"
|
67 |
Â
|
68 |
+
#: includes/class-wcpdf-settings.php:199
|
69 |
Â
msgid "General settings"
|
70 |
Â
msgstr "Algemene instellingen"
|
71 |
Â
|
72 |
+
#: includes/class-wcpdf-settings.php:206
|
73 |
Â
msgid "How do you want to view the PDF?"
|
74 |
Â
msgstr "Hoe wil je de PDF bekijken?"
|
75 |
Â
|
76 |
+
#: includes/class-wcpdf-settings.php:214
|
77 |
Â
msgid "Download the PDF"
|
78 |
Â
msgstr "Download de PDF"
|
79 |
Â
|
80 |
+
#: includes/class-wcpdf-settings.php:215
|
81 |
Â
msgid "Open the PDF in a new browser tab/window"
|
82 |
Â
msgstr "Open de PDF in een nieuwe browser tab/venster"
|
83 |
Â
|
84 |
+
#: includes/class-wcpdf-settings.php:224
|
85 |
Â
msgid "Admin New Order email"
|
86 |
Â
msgstr "Nieuwe bestelling (admin email)"
|
87 |
Â
|
88 |
+
#: includes/class-wcpdf-settings.php:225
|
89 |
Â
msgid "Customer Processing Order email"
|
90 |
Â
msgstr "Bestelling in behandeling (klant email)"
|
91 |
Â
|
92 |
+
#: includes/class-wcpdf-settings.php:226
|
93 |
Â
msgid "Customer Completed Order email"
|
94 |
Â
msgstr "Bestelling afgerond (klant email)"
|
95 |
Â
|
96 |
+
#: includes/class-wcpdf-settings.php:227
|
97 |
Â
msgid "Customer Invoice email"
|
98 |
Â
msgstr "Factuur (klant email)"
|
99 |
Â
|
100 |
+
#: includes/class-wcpdf-settings.php:236
|
101 |
Â
msgid "Attach invoice to:"
|
102 |
Â
msgstr "Factuur als bijlage toevoegen aan:"
|
103 |
Â
|
104 |
+
#: includes/class-wcpdf-settings.php:244
|
105 |
Â
#, php-format
|
106 |
Â
msgid ""
|
107 |
Â
"It looks like the temp folder (<code>%s</code>) is not writable, check the "
|
112 |
Â
"controleer de rechten op deze folder! Zonder schrijfrechten kan de plugin "
|
113 |
Â
"geen facturen emailen."
|
114 |
Â
|
115 |
+
#: includes/class-wcpdf-settings.php:250
|
116 |
Â
msgid "Disable for free products"
|
117 |
Â
msgstr "Uitschakelen voor gratis producten"
|
118 |
Â
|
119 |
+
#: includes/class-wcpdf-settings.php:257
|
120 |
Â
msgid ""
|
121 |
Â
"Disable automatic creation/attachment of invoices when only free products "
|
122 |
Â
"are ordered"
|
124 |
Â
"Automatisch aanmaken/vesturen van facturen uitschakelen wanneer er alleen "
|
125 |
Â
"gratis producten zijn besteld."
|
126 |
Â
|
127 |
+
#: includes/class-wcpdf-settings.php:264
|
128 |
Â
msgid "Interface"
|
129 |
Â
msgstr "Interface"
|
130 |
Â
|
131 |
+
#: includes/class-wcpdf-settings.php:312
|
132 |
Â
msgid "Allow My Account invoice download"
|
133 |
Â
msgstr "Sta downloaden factuur vanaf Mijn Account toe"
|
134 |
Â
|
135 |
+
#: includes/class-wcpdf-settings.php:320
|
136 |
Â
msgid "Only when an invoice is already created/emailed"
|
137 |
Â
msgstr "Alleen wanneer een factuur al is aangemaakt/gemaild"
|
138 |
Â
|
139 |
+
#: includes/class-wcpdf-settings.php:321
|
140 |
Â
msgid "Only for specific order statuses (define below)"
|
141 |
Â
msgstr "Alleen voor specifieke order statussen (hieronder gedefinieerd)"
|
142 |
Â
|
143 |
+
#: includes/class-wcpdf-settings.php:322
|
144 |
Â
msgid "Always"
|
145 |
Â
msgstr "Altijd"
|
146 |
Â
|
147 |
+
#: includes/class-wcpdf-settings.php:323
|
148 |
Â
msgid "Never"
|
149 |
Â
msgstr "Nooit"
|
150 |
Â
|
151 |
+
#: includes/class-wcpdf-settings.php:338
|
152 |
Â
msgid "Enable invoice number column in the orders list"
|
153 |
Â
msgstr "Schakel factuurnummer kolom in het bestellingen overzicht in"
|
154 |
Â
|
155 |
+
#: includes/class-wcpdf-settings.php:376
|
156 |
Â
msgid "PDF Template settings"
|
157 |
Â
msgstr "PDF Template instellingen"
|
158 |
Â
|
159 |
+
#: includes/class-wcpdf-settings.php:388
|
160 |
Â
msgid "Choose a template"
|
161 |
Â
msgstr "Kies een template"
|
162 |
Â
|
163 |
+
#: includes/class-wcpdf-settings.php:396
|
164 |
Â
#, php-format
|
165 |
Â
msgid ""
|
166 |
Â
"Want to use your own template? Copy all the files from <code>%s</code> to "
|
169 |
Â
"Wil je je eigen template gebruiken? Kopieer alle bestanden van <code>%s</"
|
170 |
Â
"code> naar je (child-) theme in <code>%s</code> en pas ze aan naar je wensen."
|
171 |
Â
|
172 |
+
#: includes/class-wcpdf-settings.php:402
|
173 |
Â
msgid "Paper size"
|
174 |
Â
msgstr "Papierformaat"
|
175 |
Â
|
176 |
+
#: includes/class-wcpdf-settings.php:410
|
177 |
Â
msgid "A4"
|
178 |
Â
msgstr "A4"
|
179 |
Â
|
180 |
+
#: includes/class-wcpdf-settings.php:411
|
181 |
Â
msgid "Letter"
|
182 |
Â
msgstr "Letter (US)"
|
183 |
Â
|
184 |
+
#: includes/class-wcpdf-settings.php:418
|
185 |
Â
msgid "Shop header/logo"
|
186 |
Â
msgstr "Shop header/logo"
|
187 |
Â
|
188 |
+
#: includes/class-wcpdf-settings.php:425
|
189 |
Â
msgid "Select or upload your invoice header/logo"
|
190 |
Â
msgstr "Selecteer of upload je factuur header/logo"
|
191 |
Â
|
192 |
+
#: includes/class-wcpdf-settings.php:426
|
193 |
Â
msgid "Set image"
|
194 |
Â
msgstr "Stel afbeelding in"
|
195 |
Â
|
196 |
+
#: includes/class-wcpdf-settings.php:427
|
197 |
Â
msgid "Remove image"
|
198 |
Â
msgstr "Verwijder afbeelding"
|
199 |
Â
|
200 |
+
#: includes/class-wcpdf-settings.php:434
|
201 |
Â
msgid "Shop Name"
|
202 |
Â
msgstr "Shop Naam"
|
203 |
Â
|
204 |
+
#: includes/class-wcpdf-settings.php:448
|
205 |
Â
msgid "Shop Address"
|
206 |
Â
msgstr "Shop Adres"
|
207 |
Â
|
208 |
+
#: includes/class-wcpdf-settings.php:464
|
209 |
Â
msgid "Footer: terms & conditions, policies, etc."
|
210 |
Â
msgstr "Voettekst: algemene voorwaarden, retourenbeleid, etc."
|
211 |
Â
|
212 |
+
#: includes/class-wcpdf-settings.php:481
|
213 |
+
#: includes/class-wcpdf-writepanels.php:286 templates/pdf/Simple/invoice.php:9
|
214 |
Â
#: templates/pdf/Simple/invoice.php:21
|
215 |
+
#: woocommerce-pdf-invoices-packingslips.php:226
|
216 |
Â
msgid "Invoice"
|
217 |
Â
msgstr "Factuur"
|
218 |
Â
|
219 |
+
#: includes/class-wcpdf-settings.php:488
|
220 |
Â
msgid "Display shipping address"
|
221 |
Â
msgstr "Geef verzendadres weer"
|
222 |
Â
|
223 |
+
#: includes/class-wcpdf-settings.php:495
|
224 |
Â
msgid ""
|
225 |
Â
"Display shipping address on invoice (in addition to the default billing "
|
226 |
Â
"address) if different from billing address"
|
228 |
Â
"Geef verzendadres weer op de factuur (naast het standaard factuuradres) "
|
229 |
Â
"wanneer deze verschilt van het factuuradres"
|
230 |
Â
|
231 |
+
#: includes/class-wcpdf-settings.php:501 includes/class-wcpdf-settings.php:675
|
232 |
Â
msgid "Display email address"
|
233 |
Â
msgstr "Geef email adres weer"
|
234 |
Â
|
235 |
+
#: includes/class-wcpdf-settings.php:513 includes/class-wcpdf-settings.php:687
|
236 |
Â
msgid "Display phone number"
|
237 |
Â
msgstr "Geef telefoonnummer weer"
|
238 |
Â
|
239 |
+
#: includes/class-wcpdf-settings.php:525
|
240 |
Â
msgid "Display invoice date"
|
241 |
Â
msgstr "Geef factuurdatum weer"
|
242 |
Â
|
243 |
+
#: includes/class-wcpdf-settings.php:537
|
244 |
+
msgid "Invoice numbers are created by a third-party extension."
|
245 |
+
msgstr "Factuurnummers zijn gemaakt door een derde-partij uitbreiding."
|
246 |
+
|
247 |
+
#: includes/class-wcpdf-settings.php:540
|
248 |
+
#, php-format
|
249 |
+
msgid "Configure it <a href=\"%s\">here</a>."
|
250 |
+
msgstr "Configureer het <a href=\"%s\">hier</a>."
|
251 |
+
|
252 |
+
#: includes/class-wcpdf-settings.php:549
|
253 |
+
msgid "Display invoice number"
|
254 |
+
msgstr "Geef factuurnummer weer"
|
255 |
+
|
256 |
+
#: includes/class-wcpdf-settings.php:549
|
257 |
Â
msgid "Display built-in sequential invoice number"
|
258 |
Â
msgstr "Geef ingebouwde doorlopende factuurnummers weer"
|
259 |
Â
|
260 |
+
#: includes/class-wcpdf-settings.php:566
|
261 |
Â
msgid "Next invoice number (without prefix/suffix etc.)"
|
262 |
Â
msgstr "Volgend factuurnummer (zonder voor- of achtervoegsel etc.)"
|
263 |
Â
|
264 |
+
#: includes/class-wcpdf-settings.php:574
|
265 |
Â
msgid ""
|
266 |
Â
"This is the number that will be used on the next invoice that is created. By "
|
267 |
Â
"default, numbering starts from the WooCommerce Order Number of the first "
|
276 |
Â
"hoogste huidige (PDF) factuurnummer zet, kan dit dubbele factuurnummers tot "
|
277 |
Â
"gevolg hebben!"
|
278 |
Â
|
279 |
+
#: includes/class-wcpdf-settings.php:598
|
280 |
Â
msgid "Invoice number format"
|
281 |
Â
msgstr "Factuurnummer format"
|
282 |
Â
|
283 |
+
#: includes/class-wcpdf-settings.php:607
|
284 |
Â
msgid "Prefix"
|
285 |
Â
msgstr "Voorvoegsel"
|
286 |
Â
|
287 |
+
#: includes/class-wcpdf-settings.php:609
|
288 |
Â
msgid ""
|
289 |
+
"to use the invoice year and/or month, use [invoice_year] or [invoice_month] "
|
290 |
Â
"respectively"
|
291 |
Â
msgstr ""
|
292 |
+
"om de factuur jaar en/of maand te gebruiken, gebruik respectievelijk "
|
293 |
+
"[invoice_year] en [invoice_month]"
|
294 |
Â
|
295 |
+
#: includes/class-wcpdf-settings.php:612
|
296 |
Â
msgid "Suffix"
|
297 |
Â
msgstr "Achtervoegsel"
|
298 |
Â
|
299 |
+
#: includes/class-wcpdf-settings.php:617
|
300 |
Â
msgid "Padding"
|
301 |
Â
msgstr "Vulling"
|
302 |
Â
|
303 |
+
#: includes/class-wcpdf-settings.php:619
|
304 |
Â
msgid "enter the number of digits here - enter \"6\" to display 42 as 000042"
|
305 |
Â
msgstr ""
|
306 |
Â
"voer hier het aantal cijfers in - vul hier \"6\" in om 42 als 000042 weer te "
|
307 |
Â
"geven"
|
308 |
Â
|
309 |
+
#: includes/class-wcpdf-settings.php:622
|
310 |
Â
msgid ""
|
311 |
Â
"note: if you have already created a custom invoice number format with a "
|
312 |
Â
"filter, the above settings will be ignored"
|
314 |
Â
"let op: als je al een format voor een factuurnummer hebt gemaakt met een "
|
315 |
Â
"filter, worden de bovenstaande instellingen genegeerd"
|
316 |
Â
|
317 |
+
#: includes/class-wcpdf-settings.php:628
|
318 |
Â
msgid "Reset invoice number yearly"
|
319 |
Â
msgstr "Reset factuurnummer jaarlijks"
|
320 |
Â
|
321 |
+
#: includes/class-wcpdf-settings.php:641
|
322 |
+
msgid "Extended currency symbol support"
|
323 |
+
msgstr "Uitgebreide support voor munteenheid symbolen"
|
324 |
+
|
325 |
+
#: includes/class-wcpdf-settings.php:648
|
326 |
+
msgid "Enable this if your currency symbol is not displaying properly"
|
327 |
+
msgstr ""
|
328 |
+
"Schakel deze optie in wanneer het symbool van jouw munteenheid niet goed "
|
329 |
+
"wordt weergegeven"
|
330 |
+
|
331 |
+
#: includes/class-wcpdf-settings.php:655
|
332 |
Â
#: templates/pdf/Simple/packing-slip.php:9
|
333 |
Â
#: templates/pdf/Simple/packing-slip.php:21
|
334 |
+
#: woocommerce-pdf-invoices-packingslips.php:229
|
335 |
Â
msgid "Packing Slip"
|
336 |
Â
msgstr "Pakbon"
|
337 |
Â
|
338 |
+
#: includes/class-wcpdf-settings.php:662
|
339 |
Â
msgid "Display billing address"
|
340 |
Â
msgstr "Geef factuuradres weer"
|
341 |
Â
|
342 |
+
#: includes/class-wcpdf-settings.php:669
|
343 |
Â
msgid ""
|
344 |
Â
"Display billing address on packing slip (in addition to the default shipping "
|
345 |
Â
"address) if different from shipping address"
|
347 |
Â
"Geef factuuradres weer op de pakbon (naast het standaard verzendadres) "
|
348 |
Â
"wanneer deze verschilt van het verzendadres"
|
349 |
Â
|
350 |
+
#: includes/class-wcpdf-settings.php:700
|
351 |
Â
msgid "Extra template fields"
|
352 |
Â
msgstr "Extra templatevelden"
|
353 |
Â
|
354 |
+
#: includes/class-wcpdf-settings.php:707
|
355 |
Â
msgid "Extra field 1"
|
356 |
Â
msgstr "Extra veld 1"
|
357 |
Â
|
358 |
+
#: includes/class-wcpdf-settings.php:716
|
359 |
Â
msgid "This is footer column 1 in the <i>Modern (Premium)</i> template"
|
360 |
Â
msgstr "Dit is voettekst kolom 1 in het <i>Modern (Premium)</i> template"
|
361 |
Â
|
362 |
+
#: includes/class-wcpdf-settings.php:723
|
363 |
Â
msgid "Extra field 2"
|
364 |
Â
msgstr "Extra veld 2"
|
365 |
Â
|
366 |
+
#: includes/class-wcpdf-settings.php:732
|
367 |
Â
msgid "This is footer column 2 in the <i>Modern (Premium)</i> template"
|
368 |
Â
msgstr "Dit is voettekst kolom 2 in het <i>Modern (Premium)</i> template"
|
369 |
Â
|
370 |
+
#: includes/class-wcpdf-settings.php:739
|
371 |
Â
msgid "Extra field 3"
|
372 |
Â
msgstr "Extra veld 3"
|
373 |
Â
|
374 |
+
#: includes/class-wcpdf-settings.php:748
|
375 |
Â
msgid "This is footer column 3 in the <i>Modern (Premium)</i> template"
|
376 |
Â
msgstr "Dit is voettekst kolom 3 in het <i>Modern (Premium)</i> template"
|
377 |
Â
|
378 |
+
#: includes/class-wcpdf-settings.php:770
|
379 |
Â
msgid "Debug settings"
|
380 |
Â
msgstr "Debug instellingen"
|
381 |
Â
|
382 |
+
#: includes/class-wcpdf-settings.php:777
|
383 |
Â
msgid "Enable debug output"
|
384 |
Â
msgstr "Debug uitvoer inschakelen"
|
385 |
Â
|
386 |
+
#: includes/class-wcpdf-settings.php:784
|
387 |
Â
msgid ""
|
388 |
Â
"Enable this option to output plugin errors if you're getting a blank page or "
|
389 |
Â
"other PDF generation issues"
|
391 |
Â
"Schakel deze optie in om pluginfouten weer te geven, wanneer je een lege "
|
392 |
Â
"pagina krijgt of andere problemen hebt met het genereren van PDF."
|
393 |
Â
|
394 |
+
#: includes/class-wcpdf-settings.php:790
|
395 |
Â
msgid "Output to HTML"
|
396 |
Â
msgstr "Uitvoer naar HTML"
|
397 |
Â
|
398 |
+
#: includes/class-wcpdf-settings.php:797
|
399 |
Â
msgid ""
|
400 |
Â
"Send the template output as HTML to the browser instead of creating a PDF."
|
401 |
Â
msgstr ""
|
402 |
Â
"Stuur de uitvoer van de template als HTML naar de browser in plaats van een "
|
403 |
Â
"PDF."
|
404 |
Â
|
405 |
+
#: includes/class-wcpdf-settings.php:803
|
406 |
Â
msgid "Use old tmp folder"
|
407 |
Â
msgstr "Gebruik de oude tmp folder"
|
408 |
Â
|
409 |
+
#: includes/class-wcpdf-settings.php:810
|
410 |
Â
msgid ""
|
411 |
Â
"Before version 1.5 of PDF Invoices, temporary files were stored in the "
|
412 |
Â
"plugin folder. This setting is only intended for backwards compatibility, "
|
416 |
Â
"de plugin map. Deze instelling is enkel bedoelde voor backwards "
|
417 |
Â
"compatibiliteit, en niet aanbevolen op nieuwe installaties!"
|
418 |
Â
|
419 |
+
#: includes/class-wcpdf-settings.php:1225
|
420 |
Â
msgid "Image resolution"
|
421 |
Â
msgstr "Afbeeldings resolutie"
|
422 |
Â
|
423 |
+
#: includes/class-wcpdf-settings.php:1341
|
424 |
Â
msgid ""
|
425 |
Â
"<b>Warning!</b> The settings below are meant for debugging/development only. "
|
426 |
Â
"Do not use them on a live website!"
|
428 |
Â
"<b>Waarschuwing!</b> Onderstaande instellingen zijn enkel bedoeld om fouten "
|
429 |
Â
"op te sporen of om te testen. Gebruik ze niet op een live website!"
|
430 |
Â
|
431 |
+
#: includes/class-wcpdf-settings.php:1350
|
432 |
Â
msgid ""
|
433 |
Â
"These are used for the (optional) footer columns in the <em>Modern "
|
434 |
Â
"(Premium)</em> template, but can also be used for other elements in your "
|
442 |
Â
msgid "PDF Packing Slips"
|
443 |
Â
msgstr "PDF Pakbonnen"
|
444 |
Â
|
445 |
+
#: includes/class-wcpdf-writepanels.php:120
|
446 |
+
#: includes/class-wcpdf-writepanels.php:253
|
447 |
Â
msgid "PDF Invoice"
|
448 |
Â
msgstr "PDF factuur"
|
449 |
Â
|
450 |
+
#: includes/class-wcpdf-writepanels.php:125
|
451 |
+
#: includes/class-wcpdf-writepanels.php:258
|
452 |
Â
msgid "PDF Packing Slip"
|
453 |
Â
msgstr "PDF Pakbon"
|
454 |
Â
|
455 |
+
#: includes/class-wcpdf-writepanels.php:152
|
456 |
Â
msgid "Invoice Number"
|
457 |
Â
msgstr "Factuurnummer"
|
458 |
Â
|
459 |
+
#: includes/class-wcpdf-writepanels.php:211
|
460 |
Â
msgid "Download invoice (PDF)"
|
461 |
Â
msgstr "Download factuur (PDF)"
|
462 |
Â
|
463 |
+
#: includes/class-wcpdf-writepanels.php:225
|
464 |
Â
msgid "Create PDF"
|
465 |
Â
msgstr "Maak PDF"
|
466 |
Â
|
467 |
+
#: includes/class-wcpdf-writepanels.php:235
|
468 |
Â
msgid "PDF Invoice data"
|
469 |
Â
msgstr "PDF Factuur gegevens"
|
470 |
Â
|
471 |
+
#: includes/class-wcpdf-writepanels.php:288
|
472 |
Â
msgid "Invoice Number (unformatted!)"
|
473 |
Â
msgstr "Factuurnummer (zonder formatting!)"
|
474 |
Â
|
475 |
+
#: includes/class-wcpdf-writepanels.php:296 templates/pdf/Simple/invoice.php:55
|
476 |
Â
msgid "Invoice Date:"
|
477 |
Â
msgstr "Factuurdatum:"
|
478 |
Â
|
479 |
+
#: includes/class-wcpdf-writepanels.php:298
|
480 |
+
#: includes/class-wcpdf-writepanels.php:300
|
481 |
Â
msgid "h"
|
482 |
Â
msgstr "u"
|
483 |
Â
|
484 |
+
#: includes/class-wcpdf-writepanels.php:298
|
485 |
+
#: includes/class-wcpdf-writepanels.php:300
|
486 |
Â
msgid "m"
|
487 |
Â
msgstr "m"
|
488 |
Â
|
494 |
Â
msgid "click items to read more"
|
495 |
Â
msgstr "Klik op de items om meer te lezen"
|
496 |
Â
|
497 |
+
#: includes/wcpdf-extensions.php:21
|
498 |
+
msgid ""
|
499 |
+
"Premium PDF Invoice bundle: Everything you need for a perfect invoicing "
|
500 |
+
"system"
|
501 |
+
msgstr ""
|
502 |
+
"Premie PDF factuur bundel: alles wat je nodig hebt voor een perfect "
|
503 |
+
"facturatie systeem"
|
504 |
Â
|
505 |
+
#: includes/wcpdf-extensions.php:23
|
506 |
Â
msgid ""
|
507 |
+
"Supercharge WooCommerce PDF Invoices & Packing Slips with the all our "
|
508 |
+
"premium extensions:"
|
509 |
Â
msgstr ""
|
510 |
+
"Geef WooCommerce PDF Invoices & Packing Slips een boost met al onze premium "
|
511 |
+
"uitbreidingen:"
|
512 |
Â
|
513 |
+
#: includes/wcpdf-extensions.php:24
|
514 |
+
msgid "Professional features:"
|
515 |
+
msgstr "Professionele functies:"
|
516 |
+
|
517 |
+
#: includes/wcpdf-extensions.php:26 includes/wcpdf-extensions.php:56
|
518 |
Â
msgid "Email/print/download <b>PDF Credit Notes & Proforma invoices</b>"
|
519 |
Â
msgstr "Email/print/download <b>PDF Credit Nota's & Pro-forma facturen</b>"
|
520 |
Â
|
521 |
+
#: includes/wcpdf-extensions.php:27 includes/wcpdf-extensions.php:57
|
522 |
Â
msgid ""
|
523 |
Â
"Send out a separate <b>notification email</b> with (or without) PDF invoices/"
|
524 |
Â
"packing slips, for example to a drop-shipper or a supplier."
|
526 |
Â
"Verstuur een aparte <b>notificatie email</b> met (of zonder) PDF facturen/"
|
527 |
Â
"pakbonnen, bijvoorbeeld naar een drop-shipper of een leverancier."
|
528 |
Â
|
529 |
+
#: includes/wcpdf-extensions.php:28 includes/wcpdf-extensions.php:58
|
530 |
Â
msgid ""
|
531 |
Â
"Attach <b>up to 3 static files</b> (for example a terms & conditions "
|
532 |
Â
"document) to the WooCommerce emails of your choice."
|
534 |
Â
"Voeg tot <b>3 vaste bestandsbijlagen</b> (bijvoorbeeld algemene voorwaarden) "
|
535 |
Â
"toe aan WooCommerce emails naar keuze."
|
536 |
Â
|
537 |
+
#: includes/wcpdf-extensions.php:29 includes/wcpdf-extensions.php:59
|
538 |
Â
msgid ""
|
539 |
Â
"Use <b>separate numbering systems</b> and/or format for proforma invoices "
|
540 |
Â
"and credit notes or utilize the main invoice numbering system"
|
542 |
Â
"Gebruik <b>losse nummersystemen</b> en/of formats voor pro-forma facturen en "
|
543 |
Â
"credit notes, of gebruik het hoofd factuurnummersysteem."
|
544 |
Â
|
545 |
+
#: includes/wcpdf-extensions.php:30 includes/wcpdf-extensions.php:60
|
546 |
Â
msgid ""
|
547 |
Â
"<b>Customize</b> the <b>shipping & billing address</b> format to include "
|
548 |
Â
"additional custom fields, font sizes etc. without the need to create a "
|
551 |
Â
"<b>Pas het verzend- en factuuradres aan</b> met custom velden, verschillende "
|
552 |
Â
"fontgroottes etc, zonder daarvoor een custom template aan te maken."
|
553 |
Â
|
554 |
+
#: includes/wcpdf-extensions.php:31 includes/wcpdf-extensions.php:61
|
555 |
Â
msgid "Use the plugin in multilingual <b>WPML</b> setups"
|
556 |
Â
msgstr "Gebruik de plugin in meertalige <b>WPML</b> setups"
|
557 |
Â
|
558 |
+
#: includes/wcpdf-extensions.php:33 includes/wcpdf-extensions.php:131
|
559 |
+
msgid "Advanced, customizable templates"
|
560 |
+
msgstr "Geavanceerde, aanpasbare templates"
|
561 |
Â
|
562 |
+
#: includes/wcpdf-extensions.php:35 includes/wcpdf-extensions.php:134
|
563 |
+
msgid ""
|
564 |
+
"Completely customize the invoice contents (prices, taxes, thumbnails) to "
|
565 |
+
"your needs with a drag & drop customizer"
|
566 |
+
msgstr ""
|
567 |
+
"Past de inhoud van de factuur (prijzen, BTW, thumbnails) volledig naar je "
|
568 |
+
"wensen aan met een eenvoudige drag & drop interface"
|
569 |
+
|
570 |
+
#: includes/wcpdf-extensions.php:36 includes/wcpdf-extensions.php:135
|
571 |
+
msgid "Two extra stylish premade templates (Modern & Business)"
|
572 |
+
msgstr "Twee extra stijlvolle voorgeconfigureerde templates (Moden & Business)"
|
573 |
+
|
574 |
+
#: includes/wcpdf-extensions.php:38
|
575 |
+
msgid "Upload automatically to dropbox"
|
576 |
+
msgstr "Automatisch uploaden naar dropbox"
|
577 |
Â
|
578 |
+
#: includes/wcpdf-extensions.php:40 includes/wcpdf-extensions.php:97
|
579 |
Â
msgid ""
|
580 |
Â
"This extension conveniently uploads all the invoices (and other pdf "
|
581 |
Â
"documents from the professional extension) that are emailed to your "
|
586 |
Â
"professional extensie) die worden ge-emaild naar je klanten naar Dropbox. De "
|
587 |
Â
"beste manier om je factuur administratie up te date te houden!"
|
588 |
Â
|
589 |
+
#: includes/wcpdf-extensions.php:43
|
590 |
+
msgid "Get WooCommerce PDF Invoices & Packing Slips Bundle"
|
591 |
+
msgstr "Neem decWooCommerce PDF Invoices & Packing Slips Bundel!"
|
592 |
+
|
593 |
+
#: includes/wcpdf-extensions.php:52
|
594 |
+
msgid "Go Pro: Proforma invoices, credit notes (=refunds) & more!"
|
595 |
+
msgstr "Go Pro: Pro-forma facturen, credit nota's (=refunds) & meer!"
|
596 |
+
|
597 |
+
#: includes/wcpdf-extensions.php:54
|
598 |
+
msgid ""
|
599 |
+
"Supercharge WooCommerce PDF Invoices & Packing Slips with the following "
|
600 |
+
"features:"
|
601 |
+
msgstr ""
|
602 |
+
"Geef WooCommerce PDF Invoices & Packing Slips een boost met de volgende "
|
603 |
+
"functies:"
|
604 |
+
|
605 |
+
#: includes/wcpdf-extensions.php:63
|
606 |
+
msgid "Get WooCommerce PDF Invoices & Packing Slips Professional!"
|
607 |
+
msgstr "Neem WooCommerce PDF Invoices & Packing Slips Professional!"
|
608 |
+
|
609 |
+
#: includes/wcpdf-extensions.php:71
|
610 |
+
msgid "Automatically send payment reminders to your customers"
|
611 |
+
msgstr "Verstuur automatisch betalingsherrinneringen naar je klanten"
|
612 |
+
|
613 |
+
#: includes/wcpdf-extensions.php:73
|
614 |
+
msgid "WooCommerce Smart Reminder emails"
|
615 |
+
msgstr "WooCommerce Smart Reminder Emails"
|
616 |
+
|
617 |
+
#: includes/wcpdf-extensions.php:75
|
618 |
+
msgid "<b>Completely automatic</b> scheduled emails"
|
619 |
+
msgstr "<b>Volledig automatisch</b> ingeplande/verstuurde e-mails"
|
620 |
+
|
621 |
+
#: includes/wcpdf-extensions.php:76
|
622 |
+
msgid ""
|
623 |
+
"<b>Rich text editor</b> for the email text, including placeholders for data "
|
624 |
+
"from the order (name, order total, etc)"
|
625 |
+
msgstr ""
|
626 |
+
"<b>Tekstbewerker met uitgebreide opmaak</b> voor de tekst van de e-mail, "
|
627 |
+
"inclusief placeholders voor gegevens uit de bestelling (ordertotaal, naam, "
|
628 |
+
"enz)"
|
629 |
+
|
630 |
+
#: includes/wcpdf-extensions.php:77
|
631 |
+
msgid ""
|
632 |
+
"Configure the exact requirements for sending an email (time after order, "
|
633 |
+
"order status, payment method)"
|
634 |
+
msgstr ""
|
635 |
+
"Stel exacte vereisten voor het versturen van een email in (tijd na de order, "
|
636 |
+
"orderstatus, betaalmethode, enz.)"
|
637 |
+
|
638 |
+
#: includes/wcpdf-extensions.php:78
|
639 |
+
msgid ""
|
640 |
+
"Fully <b>WPML Compatible</b> – emails will be automatically sent in the "
|
641 |
+
"order language."
|
642 |
+
msgstr ""
|
643 |
+
"Volledig <b>Compatible met WPML</b> – e-mails worden automatisch verzonden "
|
644 |
+
"in de taal van de bestelling."
|
645 |
+
|
646 |
+
#: includes/wcpdf-extensions.php:79
|
647 |
+
msgid ""
|
648 |
+
"<b>Super versatile!</b> Can be used for any kind of reminder email (review "
|
649 |
+
"reminders, repeat purchases)"
|
650 |
+
msgstr ""
|
651 |
+
"<b>Super veelzijdig!</b> Kan worden gebruikt voor elke soort "
|
652 |
+
"herinneringsemail (review herinneringen, herhalende aankopen)"
|
653 |
+
|
654 |
+
#: includes/wcpdf-extensions.php:80
|
655 |
+
msgid "Integrates seamlessly with the PDF Invoices & Packing Slips plugin"
|
656 |
+
msgstr "Integreert naadloos met de PDF Invoices & Packing Slips plugin"
|
657 |
+
|
658 |
+
#: includes/wcpdf-extensions.php:82
|
659 |
+
msgid "Get WooCommerce Smart Reminder Emails"
|
660 |
+
msgstr "Neem WooCommerce Smart Reminder Emails"
|
661 |
+
|
662 |
+
#: includes/wcpdf-extensions.php:91
|
663 |
+
msgid "Upload all invoices automatically to your dropbox"
|
664 |
+
msgstr "Upload alle facturen automatisch naar je Dropbox"
|
665 |
+
|
666 |
+
#: includes/wcpdf-extensions.php:98
|
667 |
Â
msgid "Get WooCommerce PDF Invoices & Packing Slips to dropbox!"
|
668 |
Â
msgstr "Neem WooCommerce PDF Invoices & Packing Slips to dropbox!"
|
669 |
Â
|
670 |
+
#: includes/wcpdf-extensions.php:110
|
671 |
Â
msgid ""
|
672 |
Â
"Automatically send new orders or packing slips to your printer, as soon as "
|
673 |
Â
"the customer orders!"
|
675 |
Â
"Verstuur nieuwe orders of pakbonnen automatisch naar je printer, zodra een "
|
676 |
Â
"klant een bestelling plaatst."
|
677 |
Â
|
678 |
+
#: includes/wcpdf-extensions.php:116
|
679 |
Â
msgid ""
|
680 |
Â
"Check out the WooCommerce Automatic Order Printing extension from our "
|
681 |
Â
"partners at Simba Hosting"
|
683 |
Â
"Bekijk de WooCommerce Automatic Order Printing extensie van onze parters van "
|
684 |
Â
"Simba Hosting"
|
685 |
Â
|
686 |
+
#: includes/wcpdf-extensions.php:117
|
687 |
Â
msgid "WooCommerce Automatic Order Printing"
|
688 |
Â
msgstr "WooCommerce Automatic Order Printing"
|
689 |
Â
|
690 |
+
#: includes/wcpdf-extensions.php:136
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
691 |
Â
#, php-format
|
692 |
Â
msgid "Check out the Premium PDF Invoice & Packing Slips templates at %s."
|
693 |
Â
msgstr "Bekijk de Premium PDF Invoice & Packing Slips templates op %s."
|
694 |
Â
|
695 |
+
#: includes/wcpdf-extensions.php:137
|
696 |
Â
#, php-format
|
697 |
Â
msgid "For custom templates, contact us at %s."
|
698 |
Â
msgstr "Neem voor custom templates contact met ons op via %s"
|
699 |
Â
|
700 |
+
#: includes/wcpdf-extensions.php:146
|
701 |
+
msgid "Hide this message"
|
702 |
+
msgstr "Verberg dit bericht"
|
703 |
+
|
704 |
Â
#: templates/pdf/Simple/invoice.php:29 templates/pdf/Simple/packing-slip.php:40
|
705 |
Â
msgid "Billing Address:"
|
706 |
Â
msgstr "Factuuradres:"
|
775 |
Â
"WooCommerce PDF Invoices & Packing Slips vereist dat %sWooCommerce%s is "
|
776 |
Â
"geïnstalleerd & geactiveerd!"
|
777 |
Â
|
778 |
+
#: woocommerce-pdf-invoices-packingslips.php:377
|
779 |
+
#: woocommerce-pdf-invoices-packingslips.php:438
|
780 |
Â
msgid "N/A"
|
781 |
Â
msgstr "N/A"
|
782 |
Â
|
783 |
+
#: woocommerce-pdf-invoices-packingslips.php:533
|
784 |
Â
msgid "Payment method"
|
785 |
Â
msgstr "Betaalmethode"
|
786 |
Â
|
787 |
+
#: woocommerce-pdf-invoices-packingslips.php:552
|
788 |
Â
msgid "Shipping method"
|
789 |
Â
msgstr "Verzendmethode"
|
790 |
Â
|
791 |
+
#: woocommerce-pdf-invoices-packingslips.php:712
|
792 |
+
#, php-format
|
793 |
+
msgid "(includes %s)"
|
794 |
+
msgstr ""
|
795 |
+
|
796 |
+
#: woocommerce-pdf-invoices-packingslips.php:715
|
797 |
Â
#, php-format
|
798 |
Â
msgid "(Includes %s)"
|
799 |
Â
msgstr ""
|
800 |
Â
|
801 |
+
#: woocommerce-pdf-invoices-packingslips.php:744
|
802 |
Â
msgid "Subtotal"
|
803 |
Â
msgstr "Subtotaal"
|
804 |
Â
|
805 |
+
#: woocommerce-pdf-invoices-packingslips.php:766
|
806 |
Â
msgid "Shipping"
|
807 |
Â
msgstr "Verzendkosten"
|
808 |
Â
|
809 |
+
#: woocommerce-pdf-invoices-packingslips.php:829
|
810 |
Â
msgid "Discount"
|
811 |
Â
msgstr "Korting"
|
812 |
Â
|
813 |
+
#: woocommerce-pdf-invoices-packingslips.php:870
|
814 |
Â
msgid "VAT"
|
815 |
Â
msgstr "BTW"
|
816 |
Â
|
817 |
+
#: woocommerce-pdf-invoices-packingslips.php:871
|
818 |
Â
msgid "Tax rate"
|
819 |
Â
msgstr "BTW tarief"
|
820 |
Â
|
821 |
+
#: woocommerce-pdf-invoices-packingslips.php:908
|
822 |
Â
msgid "Total ex. VAT"
|
823 |
Â
msgstr "Totaal excl. BTW"
|
824 |
Â
|
825 |
+
#: woocommerce-pdf-invoices-packingslips.php:911
|
826 |
Â
msgid "Total"
|
827 |
Â
msgstr "Totaal"
|
828 |
Â
|
829 |
+
#~ msgid ""
|
830 |
+
#~ "to use the order year and/or month, use [order_year] or [order_month] "
|
831 |
+
#~ "respectively"
|
832 |
+
#~ msgstr ""
|
833 |
+
#~ "gebruik [order_year] of [order_month] om het order jaar en/of maand te "
|
834 |
+
#~ "weer te geven"
|
835 |
+
|
836 |
Â
#~ msgid "PDF Invoice Number (unformatted!)"
|
837 |
Â
#~ msgstr "PDF Factuurnummer (zonder formatting!)"
|
838 |
Â
|
languages/wpo_wcpdf-sv_SE.mo
CHANGED
Binary file
|
languages/wpo_wcpdf-sv_SE.po
CHANGED
@@ -1,684 +1,818 @@
|
|
1 |
-
msgid ""
|
2 |
-
msgstr ""
|
3 |
-
"Project-Id-Version: WooCommerce PDF Invoices & Packing Slips\n"
|
4 |
-
"Report-Msgid-Bugs-To: \n"
|
5 |
-
"POT-Creation-Date:
|
6 |
-
"PO-Revision-Date:
|
7 |
-
"Last-Translator: conney@johansen.se <conney@johansen.se>\n"
|
8 |
-
"Language-Team: WP Overnight <support@wpovernight.com>\n"
|
9 |
-
"Language: sv\n"
|
10 |
-
"
|
11 |
-
"
|
12 |
-
"Content-
|
13 |
-
"
|
14 |
-
"X-Poedit-SourceCharset: UTF-8\n"
|
15 |
-
"X-Poedit-KeywordsList: _:1;gettext:1;dgettext:2;ngettext:1,2;dngettext:2,3;
|
16 |
-
"_e:1;_c:1;_n:1,2;_n_noop:1,2;_nc:1,2;__ngettext:1,2;__ngettext_noop:1,2;
|
17 |
-
"_ex:1,2c;_nx:1,2,4c;_nx_noop:1,2,3c;_n_js:1,2;_nx_js:1,2,3c;
|
18 |
-
"esc_html__:1;esc_attr_e:1;esc_html_e:1;esc_attr_x:1,2c;
|
19 |
-
"comments_number_link:2,3;t:1;st:1;trans:1;transChoice:1,2\n"
|
20 |
-
"X-Poedit-Basepath:
|
21 |
-
"X-Textdomain-Support: yes\n"
|
22 |
-
"X-Generator: Poedit 1.8.
|
23 |
-
"X-Loco-Target-Locale: sv_SE\n"
|
24 |
-
"X-Poedit-SearchPath-0: .\n"
|
25 |
-
|
26 |
-
#: includes/class-wcpdf-export.php:
|
27 |
-
#: includes/class-wcpdf-export.php:
|
28 |
-
msgid "You do not have sufficient permissions to access this page."
|
29 |
-
msgstr "Du har inte behörighet att komma åt den här sidan."
|
30 |
-
|
31 |
-
#: includes/class-wcpdf-export.php:
|
32 |
-
msgid "Some of the export parameters are missing."
|
33 |
-
msgstr "Vissa paramertrar i exporten saknas"
|
34 |
-
|
35 |
-
#: includes/class-wcpdf-export.php:
|
36 |
-
msgid "invoice"
|
37 |
-
msgid_plural "invoices"
|
38 |
-
msgstr[0] "faktura"
|
39 |
-
msgstr[1] "fakturor"
|
40 |
-
|
41 |
-
#: includes/class-wcpdf-export.php:
|
42 |
-
msgid "packing-slip"
|
43 |
-
msgid_plural "packing-slips"
|
44 |
-
msgstr[0] "följesedel"
|
45 |
-
msgstr[1] "följesedlarna"
|
46 |
-
|
47 |
-
#: includes/class-wcpdf-settings.php:
|
48 |
-
#: includes/class-wcpdf-writepanels.php:
|
49 |
-
msgid "PDF Invoices"
|
50 |
-
msgstr "PDF fakturor"
|
51 |
-
|
52 |
-
#: includes/class-wcpdf-settings.php:
|
53 |
-
msgid "Settings"
|
54 |
-
msgstr "Inställningar"
|
55 |
-
|
56 |
-
#: includes/class-wcpdf-settings.php:
|
57 |
-
msgid "General"
|
58 |
-
msgstr "Allmänt"
|
59 |
-
|
60 |
-
#: includes/class-wcpdf-settings.php:
|
61 |
-
msgid "Template"
|
62 |
-
msgstr "Mall"
|
63 |
-
|
64 |
-
#: includes/class-wcpdf-settings.php:
|
65 |
-
msgid "Status"
|
66 |
-
msgstr "Status"
|
67 |
-
|
68 |
-
#: includes/class-wcpdf-settings.php:
|
69 |
-
msgid "WooCommerce PDF Invoices"
|
70 |
-
msgstr "WooCommerce PDF fakturor"
|
71 |
-
|
72 |
-
#: includes/class-wcpdf-settings.php:
|
73 |
-
msgid "General settings"
|
74 |
-
msgstr "Allmäna inställningar"
|
75 |
-
|
76 |
-
#: includes/class-wcpdf-settings.php:
|
77 |
-
msgid "How do you want to view the PDF?"
|
78 |
-
msgstr "Hur vill du visa din PDF?"
|
79 |
-
|
80 |
-
#: includes/class-wcpdf-settings.php:
|
81 |
-
msgid "Download the PDF"
|
82 |
-
msgstr "Ladda ner PDF"
|
83 |
-
|
84 |
-
#: includes/class-wcpdf-settings.php:
|
85 |
-
msgid "Open the PDF in a new browser tab/window"
|
86 |
-
msgstr "Öppna PDF i en ny tabb/fönster"
|
87 |
-
|
88 |
-
#: includes/class-wcpdf-settings.php:
|
89 |
-
msgid "Admin New Order email"
|
90 |
-
msgstr "vid ny order"
|
91 |
-
|
92 |
-
#: includes/class-wcpdf-settings.php:
|
93 |
-
msgid "Customer Processing Order email"
|
94 |
-
msgstr "vid bearbetad order"
|
95 |
-
|
96 |
-
#: includes/class-wcpdf-settings.php:
|
97 |
-
msgid "Customer Completed Order email"
|
98 |
-
msgstr "vid genomförd order"
|
99 |
-
|
100 |
-
#: includes/class-wcpdf-settings.php:
|
101 |
-
msgid "Customer Invoice email"
|
102 |
-
msgstr "vid kundfaktura"
|
103 |
-
|
104 |
-
#: includes/class-wcpdf-settings.php:
|
105 |
-
msgid "Attach invoice to:"
|
106 |
-
msgstr "Bifoga faktura:"
|
107 |
-
|
108 |
-
#: includes/class-wcpdf-settings.php:
|
109 |
-
#, php-format
|
110 |
-
msgid ""
|
111 |
-
"It looks like the temp folder (<code>%s</code>) is not writable, check the "
|
112 |
-
"permissions for this folder! Without having write access to this folder, the "
|
113 |
-
"plugin will not be able to email invoices."
|
114 |
-
msgstr ""
|
115 |
-
"Det ser ut som den temporära mappen (<code>%s</code>) inte är skrivbar, "
|
116 |
-
"kontrollera rättigheterna för den mappen! Utan skrivrättigheter så kan inte
|
117 |
-
"plugin skapa email fakturor."
|
118 |
-
|
119 |
-
#: includes/class-wcpdf-settings.php:
|
120 |
-
msgid "Disable for free products"
|
121 |
-
msgstr "Inaktivera för gratisprodukter"
|
122 |
-
|
123 |
-
#: includes/class-wcpdf-settings.php:
|
124 |
-
msgid ""
|
125 |
-
"Disable automatic creation/attachment of invoices when only free products
|
126 |
-
"ordered"
|
127 |
-
msgstr ""
|
128 |
-
"Inaktivera automatisk genererad faktura vid gratisprodukter (endast när "
|
129 |
-
"gratisprodukter är beställda )"
|
130 |
-
|
131 |
-
#: includes/class-wcpdf-settings.php:
|
132 |
-
msgid "Interface"
|
133 |
-
msgstr "Gränssnitt"
|
134 |
-
|
135 |
-
#: includes/class-wcpdf-settings.php:
|
136 |
-
msgid "Allow My Account invoice download"
|
137 |
-
msgstr "Tillåt nerladdning av faktura på \"Mitt konto\" "
|
138 |
-
|
139 |
-
#: includes/class-wcpdf-settings.php:
|
140 |
-
msgid "Only when an invoice is already created/emailed"
|
141 |
-
msgstr "Endast när en faktura redan är skapad/skickad"
|
142 |
-
|
143 |
-
#: includes/class-wcpdf-settings.php:
|
144 |
-
msgid "Only for specific order statuses (define below)"
|
145 |
-
msgstr "Endast för specifik orderstatus (definierade nedan)"
|
146 |
-
|
147 |
-
#: includes/class-wcpdf-settings.php:
|
148 |
-
msgid "Always"
|
149 |
-
msgstr "Alltid"
|
150 |
-
|
151 |
-
#: includes/class-wcpdf-settings.php:323
|
152 |
-
msgid "
|
153 |
-
msgstr "
|
154 |
-
|
155 |
-
#: includes/class-wcpdf-settings.php:
|
156 |
-
msgid "
|
157 |
-
msgstr "
|
158 |
-
|
159 |
-
#: includes/class-wcpdf-settings.php:
|
160 |
-
msgid "
|
161 |
-
msgstr "
|
162 |
-
|
163 |
-
#: includes/class-wcpdf-settings.php:
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
"
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
#: includes/class-wcpdf-settings.php:
|
177 |
-
msgid "
|
178 |
-
msgstr "
|
179 |
-
|
180 |
-
#: includes/class-wcpdf-settings.php:
|
181 |
-
msgid "
|
182 |
-
msgstr "
|
183 |
-
|
184 |
-
#: includes/class-wcpdf-settings.php:
|
185 |
-
msgid "
|
186 |
-
msgstr "
|
187 |
-
|
188 |
-
#: includes/class-wcpdf-settings.php:
|
189 |
-
msgid "
|
190 |
-
msgstr "
|
191 |
-
|
192 |
-
#: includes/class-wcpdf-settings.php:
|
193 |
-
msgid "
|
194 |
-
msgstr "Välj
|
195 |
-
|
196 |
-
#: includes/class-wcpdf-settings.php:
|
197 |
-
msgid "
|
198 |
-
msgstr "
|
199 |
-
|
200 |
-
#: includes/class-wcpdf-settings.php:
|
201 |
-
msgid "
|
202 |
-
msgstr "
|
203 |
-
|
204 |
-
#: includes/class-wcpdf-settings.php:
|
205 |
-
msgid "Shop
|
206 |
-
msgstr "
|
207 |
-
|
208 |
-
#: includes/class-wcpdf-settings.php:
|
209 |
-
msgid "
|
210 |
-
msgstr "
|
211 |
-
|
212 |
-
#: includes/class-wcpdf-settings.php:
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
#:
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
"Display shipping address
|
225 |
-
"
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
"
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
"
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
"
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
"
|
273 |
-
|
274 |
-
|
275 |
-
"
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
#: includes/class-wcpdf-settings.php:
|
282 |
-
msgid "
|
283 |
-
msgstr "
|
284 |
-
|
285 |
-
#: includes/class-wcpdf-settings.php:
|
286 |
-
msgid "
|
287 |
-
msgstr "
|
288 |
-
|
289 |
-
#: includes/class-wcpdf-settings.php:
|
290 |
-
msgid ""
|
291 |
-
"
|
292 |
-
"
|
293 |
-
msgstr ""
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
#:
|
300 |
-
msgid "
|
301 |
-
msgstr "
|
302 |
-
|
303 |
-
#: includes/class-wcpdf-settings.php:
|
304 |
-
msgid "
|
305 |
-
msgstr "
|
306 |
-
|
307 |
-
#: includes/class-wcpdf-settings.php:
|
308 |
-
msgid ""
|
309 |
-
"
|
310 |
-
"
|
311 |
-
msgstr "
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
#:
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
#: includes/class-wcpdf-settings.php:
|
346 |
-
msgid "
|
347 |
-
msgstr "
|
348 |
-
|
349 |
-
#: includes/class-wcpdf-settings.php:
|
350 |
-
msgid ""
|
351 |
-
"
|
352 |
-
|
353 |
-
|
354 |
-
"
|
355 |
-
"
|
356 |
-
|
357 |
-
#: includes/class-wcpdf-settings.php:
|
358 |
-
msgid "
|
359 |
-
msgstr "
|
360 |
-
|
361 |
-
#: includes/class-wcpdf-settings.php:
|
362 |
-
msgid "
|
363 |
-
msgstr "
|
364 |
-
|
365 |
-
#: includes/class-wcpdf-settings.php:
|
366 |
-
msgid "
|
367 |
-
msgstr "
|
368 |
-
|
369 |
-
#: includes/class-wcpdf-settings.php:
|
370 |
-
msgid ""
|
371 |
-
"
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
"
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
"mallen
|
398 |
-
|
399 |
-
#: includes/class-wcpdf-
|
400 |
-
msgid "
|
401 |
-
msgstr "
|
402 |
-
|
403 |
-
#: includes/class-wcpdf-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
#: includes/class-wcpdf-
|
414 |
-
msgid "
|
415 |
-
msgstr "
|
416 |
-
|
417 |
-
#: includes/class-wcpdf-
|
418 |
-
msgid "
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
#: includes/class-wcpdf-
|
426 |
-
msgid "
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
#: includes/class-wcpdf-writepanels.php:
|
442 |
-
msgid "
|
443 |
-
msgstr "
|
444 |
-
|
445 |
-
#: includes/wcpdf-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
"
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
"
|
461 |
-
msgstr "
|
462 |
-
|
463 |
-
#: includes/wcpdf-
|
464 |
-
msgid "
|
465 |
-
msgstr "
|
466 |
-
|
467 |
-
#: includes/wcpdf-
|
468 |
-
msgid ""
|
469 |
-
"
|
470 |
-
|
471 |
-
|
472 |
-
"
|
473 |
-
|
474 |
-
|
475 |
-
#: includes/wcpdf-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
"
|
487 |
-
msgstr ""
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
"
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
"
|
517 |
-
|
518 |
-
|
519 |
-
"
|
520 |
-
"
|
521 |
-
|
522 |
-
#: includes/wcpdf-extensions.php:
|
523 |
-
msgid "
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
"
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
"
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
"
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
"
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
"
|
553 |
-
"
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
msgid "
|
565 |
-
msgstr "
|
566 |
-
|
567 |
-
#: includes/wcpdf-extensions.php:
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
#:
|
593 |
-
msgid "
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
msgstr "
|
619 |
-
|
620 |
-
#:
|
621 |
-
msgid "
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
msgstr "
|
631 |
-
|
632 |
-
#:
|
633 |
-
msgid "
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
"
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
"
|
644 |
-
|
645 |
-
|
646 |
-
#:
|
647 |
-
msgid "
|
648 |
-
msgstr "
|
649 |
-
|
650 |
-
#:
|
651 |
-
msgid "
|
652 |
-
msgstr "
|
653 |
-
|
654 |
-
#:
|
655 |
-
msgid "
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
#:
|
663 |
-
msgid "
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
#:
|
671 |
-
msgid "
|
672 |
-
msgstr "
|
673 |
-
|
674 |
-
#:
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: WooCommerce PDF Invoices & Packing Slips\n"
|
4 |
+
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2016-11-21 12:09+0100\n"
|
6 |
+
"PO-Revision-Date: 2016-11-21 12:09+0100\n"
|
7 |
+
"Last-Translator: conney@johansen.se <conney@johansen.se>\n"
|
8 |
+
"Language-Team: WP Overnight <support@wpovernight.com>\n"
|
9 |
+
"Language: sv\n"
|
10 |
+
"MIME-Version: 1.0\n"
|
11 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
12 |
+
"Content-Transfer-Encoding: 8bit\n"
|
13 |
+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
14 |
+
"X-Poedit-SourceCharset: UTF-8\n"
|
15 |
+
"X-Poedit-KeywordsList: _:1;gettext:1;dgettext:2;ngettext:1,2;dngettext:2,3;"
|
16 |
+
"__:1;_e:1;_c:1;_n:1,2;_n_noop:1,2;_nc:1,2;__ngettext:1,2;__ngettext_noop:1,2;"
|
17 |
+
"_x:1,2c;_ex:1,2c;_nx:1,2,4c;_nx_noop:1,2,3c;_n_js:1,2;_nx_js:1,2,3c;"
|
18 |
+
"esc_attr__:1;esc_html__:1;esc_attr_e:1;esc_html_e:1;esc_attr_x:1,2c;"
|
19 |
+
"esc_html_x:1,2c;comments_number_link:2,3;t:1;st:1;trans:1;transChoice:1,2\n"
|
20 |
+
"X-Poedit-Basepath: ..\n"
|
21 |
+
"X-Textdomain-Support: yes\n"
|
22 |
+
"X-Generator: Poedit 1.8.9\n"
|
23 |
+
"X-Loco-Target-Locale: sv_SE\n"
|
24 |
+
"X-Poedit-SearchPath-0: .\n"
|
25 |
+
|
26 |
+
#: includes/class-wcpdf-export.php:418 includes/class-wcpdf-export.php:432
|
27 |
+
#: includes/class-wcpdf-export.php:439 includes/class-wcpdf-export.php:447
|
28 |
+
msgid "You do not have sufficient permissions to access this page."
|
29 |
+
msgstr "Du har inte behörighet att komma åt den här sidan."
|
30 |
+
|
31 |
+
#: includes/class-wcpdf-export.php:423
|
32 |
+
msgid "Some of the export parameters are missing."
|
33 |
+
msgstr "Vissa paramertrar i exporten saknas"
|
34 |
+
|
35 |
+
#: includes/class-wcpdf-export.php:504
|
36 |
+
msgid "invoice"
|
37 |
+
msgid_plural "invoices"
|
38 |
+
msgstr[0] "faktura"
|
39 |
+
msgstr[1] "fakturor"
|
40 |
+
|
41 |
+
#: includes/class-wcpdf-export.php:508
|
42 |
+
msgid "packing-slip"
|
43 |
+
msgid_plural "packing-slips"
|
44 |
+
msgstr[0] "följesedel"
|
45 |
+
msgstr[1] "följesedlarna"
|
46 |
+
|
47 |
+
#: includes/class-wcpdf-settings.php:37 includes/class-wcpdf-settings.php:38
|
48 |
+
#: includes/class-wcpdf-writepanels.php:32
|
49 |
+
msgid "PDF Invoices"
|
50 |
+
msgstr "PDF fakturor"
|
51 |
+
|
52 |
+
#: includes/class-wcpdf-settings.php:79
|
53 |
+
msgid "Settings"
|
54 |
+
msgstr "Inställningar"
|
55 |
+
|
56 |
+
#: includes/class-wcpdf-settings.php:101
|
57 |
+
msgid "General"
|
58 |
+
msgstr "Allmänt"
|
59 |
+
|
60 |
+
#: includes/class-wcpdf-settings.php:102
|
61 |
+
msgid "Template"
|
62 |
+
msgstr "Mall"
|
63 |
+
|
64 |
+
#: includes/class-wcpdf-settings.php:107
|
65 |
+
msgid "Status"
|
66 |
+
msgstr "Status"
|
67 |
+
|
68 |
+
#: includes/class-wcpdf-settings.php:119
|
69 |
+
msgid "WooCommerce PDF Invoices"
|
70 |
+
msgstr "WooCommerce PDF fakturor"
|
71 |
+
|
72 |
+
#: includes/class-wcpdf-settings.php:199
|
73 |
+
msgid "General settings"
|
74 |
+
msgstr "Allmäna inställningar"
|
75 |
+
|
76 |
+
#: includes/class-wcpdf-settings.php:206
|
77 |
+
msgid "How do you want to view the PDF?"
|
78 |
+
msgstr "Hur vill du visa din PDF?"
|
79 |
+
|
80 |
+
#: includes/class-wcpdf-settings.php:214
|
81 |
+
msgid "Download the PDF"
|
82 |
+
msgstr "Ladda ner PDF"
|
83 |
+
|
84 |
+
#: includes/class-wcpdf-settings.php:215
|
85 |
+
msgid "Open the PDF in a new browser tab/window"
|
86 |
+
msgstr "Öppna PDF i en ny tabb/fönster"
|
87 |
+
|
88 |
+
#: includes/class-wcpdf-settings.php:224
|
89 |
+
msgid "Admin New Order email"
|
90 |
+
msgstr "vid ny order"
|
91 |
+
|
92 |
+
#: includes/class-wcpdf-settings.php:225
|
93 |
+
msgid "Customer Processing Order email"
|
94 |
+
msgstr "vid bearbetad order"
|
95 |
+
|
96 |
+
#: includes/class-wcpdf-settings.php:226
|
97 |
+
msgid "Customer Completed Order email"
|
98 |
+
msgstr "vid genomförd order"
|
99 |
+
|
100 |
+
#: includes/class-wcpdf-settings.php:227
|
101 |
+
msgid "Customer Invoice email"
|
102 |
+
msgstr "vid kundfaktura"
|
103 |
+
|
104 |
+
#: includes/class-wcpdf-settings.php:236
|
105 |
+
msgid "Attach invoice to:"
|
106 |
+
msgstr "Bifoga faktura:"
|
107 |
+
|
108 |
+
#: includes/class-wcpdf-settings.php:244
|
109 |
+
#, php-format
|
110 |
+
msgid ""
|
111 |
+
"It looks like the temp folder (<code>%s</code>) is not writable, check the "
|
112 |
+
"permissions for this folder! Without having write access to this folder, the "
|
113 |
+
"plugin will not be able to email invoices."
|
114 |
+
msgstr ""
|
115 |
+
"Det ser ut som den temporära mappen (<code>%s</code>) inte är skrivbar, "
|
116 |
+
"kontrollera rättigheterna för den mappen! Utan skrivrättigheter så kan inte "
|
117 |
+
"detta plugin skapa email fakturor."
|
118 |
+
|
119 |
+
#: includes/class-wcpdf-settings.php:250
|
120 |
+
msgid "Disable for free products"
|
121 |
+
msgstr "Inaktivera för gratisprodukter"
|
122 |
+
|
123 |
+
#: includes/class-wcpdf-settings.php:257
|
124 |
+
msgid ""
|
125 |
+
"Disable automatic creation/attachment of invoices when only free products "
|
126 |
+
"are ordered"
|
127 |
+
msgstr ""
|
128 |
+
"Inaktivera automatisk genererad faktura vid gratisprodukter (endast när "
|
129 |
+
"gratisprodukter är beställda )"
|
130 |
+
|
131 |
+
#: includes/class-wcpdf-settings.php:264
|
132 |
+
msgid "Interface"
|
133 |
+
msgstr "Gränssnitt"
|
134 |
+
|
135 |
+
#: includes/class-wcpdf-settings.php:312
|
136 |
+
msgid "Allow My Account invoice download"
|
137 |
+
msgstr "Tillåt nerladdning av faktura på \"Mitt konto\" "
|
138 |
+
|
139 |
+
#: includes/class-wcpdf-settings.php:320
|
140 |
+
msgid "Only when an invoice is already created/emailed"
|
141 |
+
msgstr "Endast när en faktura redan är skapad/skickad"
|
142 |
+
|
143 |
+
#: includes/class-wcpdf-settings.php:321
|
144 |
+
msgid "Only for specific order statuses (define below)"
|
145 |
+
msgstr "Endast för specifik orderstatus (definierade nedan)"
|
146 |
+
|
147 |
+
#: includes/class-wcpdf-settings.php:322
|
148 |
+
msgid "Always"
|
149 |
+
msgstr "Alltid"
|
150 |
+
|
151 |
+
#: includes/class-wcpdf-settings.php:323
|
152 |
+
msgid "Never"
|
153 |
+
msgstr ""
|
154 |
+
|
155 |
+
#: includes/class-wcpdf-settings.php:338
|
156 |
+
msgid "Enable invoice number column in the orders list"
|
157 |
+
msgstr "Aktivera fakturanummer i orderlistan."
|
158 |
+
|
159 |
+
#: includes/class-wcpdf-settings.php:376
|
160 |
+
msgid "PDF Template settings"
|
161 |
+
msgstr "PDF-mall inställningar"
|
162 |
+
|
163 |
+
#: includes/class-wcpdf-settings.php:388
|
164 |
+
msgid "Choose a template"
|
165 |
+
msgstr "Välj en mall"
|
166 |
+
|
167 |
+
#: includes/class-wcpdf-settings.php:396
|
168 |
+
#, php-format
|
169 |
+
msgid ""
|
170 |
+
"Want to use your own template? Copy all the files from <code>%s</code> to "
|
171 |
+
"your (child) theme in <code>%s</code> to customize them"
|
172 |
+
msgstr ""
|
173 |
+
"Vill du använda egen mall? Kopiera alla filer från <code>%s</code> till ditt "
|
174 |
+
"eget \" (child) theme\" <code>%s</code> för att skräddasy temat"
|
175 |
+
|
176 |
+
#: includes/class-wcpdf-settings.php:402
|
177 |
+
msgid "Paper size"
|
178 |
+
msgstr "Pappersstorlek"
|
179 |
+
|
180 |
+
#: includes/class-wcpdf-settings.php:410
|
181 |
+
msgid "A4"
|
182 |
+
msgstr "A4"
|
183 |
+
|
184 |
+
#: includes/class-wcpdf-settings.php:411
|
185 |
+
msgid "Letter"
|
186 |
+
msgstr "Letter (US)"
|
187 |
+
|
188 |
+
#: includes/class-wcpdf-settings.php:418
|
189 |
+
msgid "Shop header/logo"
|
190 |
+
msgstr "Butikslogotyp"
|
191 |
+
|
192 |
+
#: includes/class-wcpdf-settings.php:425
|
193 |
+
msgid "Select or upload your invoice header/logo"
|
194 |
+
msgstr "Välj eller ladda upp din faktura logotyp"
|
195 |
+
|
196 |
+
#: includes/class-wcpdf-settings.php:426
|
197 |
+
msgid "Set image"
|
198 |
+
msgstr "Välj bild"
|
199 |
+
|
200 |
+
#: includes/class-wcpdf-settings.php:427
|
201 |
+
msgid "Remove image"
|
202 |
+
msgstr "Ta bort bild"
|
203 |
+
|
204 |
+
#: includes/class-wcpdf-settings.php:434
|
205 |
+
msgid "Shop Name"
|
206 |
+
msgstr "Butiksnamn"
|
207 |
+
|
208 |
+
#: includes/class-wcpdf-settings.php:448
|
209 |
+
msgid "Shop Address"
|
210 |
+
msgstr "Butiksadress"
|
211 |
+
|
212 |
+
#: includes/class-wcpdf-settings.php:464
|
213 |
+
msgid "Footer: terms & conditions, policies, etc."
|
214 |
+
msgstr "Sidfot: villkor, policy, osv."
|
215 |
+
|
216 |
+
#: includes/class-wcpdf-settings.php:481
|
217 |
+
#: includes/class-wcpdf-writepanels.php:286 templates/pdf/Simple/invoice.php:9
|
218 |
+
#: templates/pdf/Simple/invoice.php:21
|
219 |
+
#: woocommerce-pdf-invoices-packingslips.php:226
|
220 |
+
msgid "Invoice"
|
221 |
+
msgstr "Faktura"
|
222 |
+
|
223 |
+
#: includes/class-wcpdf-settings.php:488
|
224 |
+
msgid "Display shipping address"
|
225 |
+
msgstr "Visa leveransadress"
|
226 |
+
|
227 |
+
#: includes/class-wcpdf-settings.php:495
|
228 |
+
msgid ""
|
229 |
+
"Display shipping address on invoice (in addition to the default billing "
|
230 |
+
"address) if different from billing address"
|
231 |
+
msgstr ""
|
232 |
+
"Visa leveransadress på fakturan om den skiljer sig åt från faktura adressen"
|
233 |
+
|
234 |
+
#: includes/class-wcpdf-settings.php:501 includes/class-wcpdf-settings.php:675
|
235 |
+
msgid "Display email address"
|
236 |
+
msgstr "Visa e-postadress"
|
237 |
+
|
238 |
+
#: includes/class-wcpdf-settings.php:513 includes/class-wcpdf-settings.php:687
|
239 |
+
msgid "Display phone number"
|
240 |
+
msgstr "Visa telefonnumer"
|
241 |
+
|
242 |
+
#: includes/class-wcpdf-settings.php:525
|
243 |
+
msgid "Display invoice date"
|
244 |
+
msgstr "Visa fakturadatum"
|
245 |
+
|
246 |
+
#: includes/class-wcpdf-settings.php:537
|
247 |
+
msgid "Invoice numbers are created by a third-party extension."
|
248 |
+
msgstr ""
|
249 |
+
|
250 |
+
#: includes/class-wcpdf-settings.php:540
|
251 |
+
#, php-format
|
252 |
+
msgid "Configure it <a href=\"%s\">here</a>."
|
253 |
+
msgstr ""
|
254 |
+
|
255 |
+
#: includes/class-wcpdf-settings.php:549
|
256 |
+
msgid "Display invoice number"
|
257 |
+
msgstr ""
|
258 |
+
|
259 |
+
#: includes/class-wcpdf-settings.php:549
|
260 |
+
msgid "Display built-in sequential invoice number"
|
261 |
+
msgstr "Visa inbyggt sekventiell fakturanummer"
|
262 |
+
|
263 |
+
#: includes/class-wcpdf-settings.php:566
|
264 |
+
msgid "Next invoice number (without prefix/suffix etc.)"
|
265 |
+
msgstr "Nästa ordernummer (utan prefix/suffix etc.)"
|
266 |
+
|
267 |
+
#: includes/class-wcpdf-settings.php:574
|
268 |
+
msgid ""
|
269 |
+
"This is the number that will be used on the next invoice that is created. By "
|
270 |
+
"default, numbering starts from the WooCommerce Order Number of the first "
|
271 |
+
"invoice that is created and increases for every new invoice. Note that if "
|
272 |
+
"you override this and set it lower than the highest (PDF) invoice number, "
|
273 |
+
"this could create double invoice numbers!"
|
274 |
+
msgstr ""
|
275 |
+
"Det här är numret som kommer användas när nästa order görs. Det förvalda "
|
276 |
+
"värdet startar från WooCommerce ordernummer och den första fakturan som "
|
277 |
+
"skapas kommer att följa efter varje ny faktura som skapas. Notera att om du "
|
278 |
+
"skriver över detta och sätter ett lägre värde än det högsta (PDF) faktura "
|
279 |
+
"numret så kan det resultera i dubbla fakturanummer."
|
280 |
+
|
281 |
+
#: includes/class-wcpdf-settings.php:598
|
282 |
+
msgid "Invoice number format"
|
283 |
+
msgstr "Fakturanummers format"
|
284 |
+
|
285 |
+
#: includes/class-wcpdf-settings.php:607
|
286 |
+
msgid "Prefix"
|
287 |
+
msgstr "Prefix"
|
288 |
+
|
289 |
+
#: includes/class-wcpdf-settings.php:609
|
290 |
+
msgid ""
|
291 |
+
"to use the invoice year and/or month, use [invoice_year] or [invoice_month] "
|
292 |
+
"respectively"
|
293 |
+
msgstr ""
|
294 |
+
|
295 |
+
#: includes/class-wcpdf-settings.php:612
|
296 |
+
msgid "Suffix"
|
297 |
+
msgstr "Suflix"
|
298 |
+
|
299 |
+
#: includes/class-wcpdf-settings.php:617
|
300 |
+
msgid "Padding"
|
301 |
+
msgstr "Utfyllnad"
|
302 |
+
|
303 |
+
#: includes/class-wcpdf-settings.php:619
|
304 |
+
msgid "enter the number of digits here - enter \"6\" to display 42 as 000042"
|
305 |
+
msgstr "fyll i antalet värdesiffror här. Skriv \"6\" så visas 42 som 000042"
|
306 |
+
|
307 |
+
#: includes/class-wcpdf-settings.php:622
|
308 |
+
msgid ""
|
309 |
+
"note: if you have already created a custom invoice number format with a "
|
310 |
+
"filter, the above settings will be ignored"
|
311 |
+
msgstr ""
|
312 |
+
"obs: om du redan skapat ett eget fakturanummerformat med ett filter, då "
|
313 |
+
"ignoreras inställningarna ovan"
|
314 |
+
|
315 |
+
#: includes/class-wcpdf-settings.php:628
|
316 |
+
msgid "Reset invoice number yearly"
|
317 |
+
msgstr ""
|
318 |
+
|
319 |
+
#: includes/class-wcpdf-settings.php:641
|
320 |
+
msgid "Extended currency symbol support"
|
321 |
+
msgstr ""
|
322 |
+
|
323 |
+
#: includes/class-wcpdf-settings.php:648
|
324 |
+
msgid "Enable this if your currency symbol is not displaying properly"
|
325 |
+
msgstr ""
|
326 |
+
|
327 |
+
#: includes/class-wcpdf-settings.php:655
|
328 |
+
#: templates/pdf/Simple/packing-slip.php:9
|
329 |
+
#: templates/pdf/Simple/packing-slip.php:21
|
330 |
+
#: woocommerce-pdf-invoices-packingslips.php:229
|
331 |
+
msgid "Packing Slip"
|
332 |
+
msgstr "Följesedel"
|
333 |
+
|
334 |
+
#: includes/class-wcpdf-settings.php:662
|
335 |
+
msgid "Display billing address"
|
336 |
+
msgstr "Visa fakturaadress"
|
337 |
+
|
338 |
+
#: includes/class-wcpdf-settings.php:669
|
339 |
+
msgid ""
|
340 |
+
"Display billing address on packing slip (in addition to the default shipping "
|
341 |
+
"address) if different from shipping address"
|
342 |
+
msgstr ""
|
343 |
+
"Visa fakturaadress på följesedeln om den skiljer sig från leveransadressen"
|
344 |
+
|
345 |
+
#: includes/class-wcpdf-settings.php:700
|
346 |
+
msgid "Extra template fields"
|
347 |
+
msgstr "Extra mallfält"
|
348 |
+
|
349 |
+
#: includes/class-wcpdf-settings.php:707
|
350 |
+
msgid "Extra field 1"
|
351 |
+
msgstr "Fält 1"
|
352 |
+
|
353 |
+
#: includes/class-wcpdf-settings.php:716
|
354 |
+
msgid "This is footer column 1 in the <i>Modern (Premium)</i> template"
|
355 |
+
msgstr "Kolumnnummer 1 i sidfot <i>(Premium)</i> mallen"
|
356 |
+
|
357 |
+
#: includes/class-wcpdf-settings.php:723
|
358 |
+
msgid "Extra field 2"
|
359 |
+
msgstr "Fält 2"
|
360 |
+
|
361 |
+
#: includes/class-wcpdf-settings.php:732
|
362 |
+
msgid "This is footer column 2 in the <i>Modern (Premium)</i> template"
|
363 |
+
msgstr "Kolumnnummer 2 i sidfot <i>(Premium)</i> mallen"
|
364 |
+
|
365 |
+
#: includes/class-wcpdf-settings.php:739
|
366 |
+
msgid "Extra field 3"
|
367 |
+
msgstr "Fält 3"
|
368 |
+
|
369 |
+
#: includes/class-wcpdf-settings.php:748
|
370 |
+
msgid "This is footer column 3 in the <i>Modern (Premium)</i> template"
|
371 |
+
msgstr "Kolumnnummer 3 i sidfot <i>(Premium)</i> mallen"
|
372 |
+
|
373 |
+
#: includes/class-wcpdf-settings.php:770
|
374 |
+
msgid "Debug settings"
|
375 |
+
msgstr "Felsökningsinställningar"
|
376 |
+
|
377 |
+
#: includes/class-wcpdf-settings.php:777
|
378 |
+
msgid "Enable debug output"
|
379 |
+
msgstr "Aktivera felsökningsinställningar"
|
380 |
+
|
381 |
+
#: includes/class-wcpdf-settings.php:784
|
382 |
+
msgid ""
|
383 |
+
"Enable this option to output plugin errors if you're getting a blank page or "
|
384 |
+
"other PDF generation issues"
|
385 |
+
msgstr ""
|
386 |
+
"Aktivera det här alternativet för att mata ut plugin fel om du får en tom "
|
387 |
+
"sida eller andra PDF generation frågor"
|
388 |
+
|
389 |
+
#: includes/class-wcpdf-settings.php:790
|
390 |
+
msgid "Output to HTML"
|
391 |
+
msgstr "Utgång till HTML"
|
392 |
+
|
393 |
+
#: includes/class-wcpdf-settings.php:797
|
394 |
+
msgid ""
|
395 |
+
"Send the template output as HTML to the browser instead of creating a PDF."
|
396 |
+
msgstr ""
|
397 |
+
"Skicka mallen som HTML till webbläsaren istället för att skapa en PDF-fil."
|
398 |
+
|
399 |
+
#: includes/class-wcpdf-settings.php:803
|
400 |
+
msgid "Use old tmp folder"
|
401 |
+
msgstr "Använd \"old tmp\" mapp"
|
402 |
+
|
403 |
+
#: includes/class-wcpdf-settings.php:810
|
404 |
+
msgid ""
|
405 |
+
"Before version 1.5 of PDF Invoices, temporary files were stored in the "
|
406 |
+
"plugin folder. This setting is only intended for backwards compatibility, "
|
407 |
+
"not recommended on new installs!"
|
408 |
+
msgstr ""
|
409 |
+
"Innan version 1.5 av PDF fakturor, var temporära filer lagrade i plugin-"
|
410 |
+
"mappen. Den här inställningen är endast avsedd för bakåtkompatibilitet, "
|
411 |
+
"rekommenderas inte på nya installationer!"
|
412 |
+
|
413 |
+
#: includes/class-wcpdf-settings.php:1225
|
414 |
+
msgid "Image resolution"
|
415 |
+
msgstr "Bildupplösning"
|
416 |
+
|
417 |
+
#: includes/class-wcpdf-settings.php:1341
|
418 |
+
msgid ""
|
419 |
+
"<b>Warning!</b> The settings below are meant for debugging/development only. "
|
420 |
+
"Do not use them on a live website!"
|
421 |
+
msgstr ""
|
422 |
+
"<b>Varning!</b> Inställningarna nedan är avsedda för felsökning / endast "
|
423 |
+
"utveckling. Använd dem inte på en aktiv hemsida!"
|
424 |
+
|
425 |
+
#: includes/class-wcpdf-settings.php:1350
|
426 |
+
msgid ""
|
427 |
+
"These are used for the (optional) footer columns in the <em>Modern "
|
428 |
+
"(Premium)</em> template, but can also be used for other elements in your "
|
429 |
+
"custom template"
|
430 |
+
msgstr ""
|
431 |
+
"Dessa kan användas (valfritt) som kolumner i sidfoten i <em>Modern "
|
432 |
+
"(Premium)</em> mallen, men kan även användas för dina egna element i dina "
|
433 |
+
"skräddarsydda mallar."
|
434 |
+
|
435 |
+
#: includes/class-wcpdf-writepanels.php:33
|
436 |
+
msgid "PDF Packing Slips"
|
437 |
+
msgstr "Följesedlar (PDF)"
|
438 |
+
|
439 |
+
#: includes/class-wcpdf-writepanels.php:120
|
440 |
+
#: includes/class-wcpdf-writepanels.php:252
|
441 |
+
#: includes/class-wcpdf-writepanels.php:253
|
442 |
+
msgid "PDF Invoice"
|
443 |
+
msgstr "Faktura (PDF)"
|
444 |
+
|
445 |
+
#: includes/class-wcpdf-writepanels.php:125
|
446 |
+
#: includes/class-wcpdf-writepanels.php:257
|
447 |
+
#: includes/class-wcpdf-writepanels.php:258
|
448 |
+
msgid "PDF Packing Slip"
|
449 |
+
msgstr "Följesedel (PDF)"
|
450 |
+
|
451 |
+
#: includes/class-wcpdf-writepanels.php:152
|
452 |
+
msgid "Invoice Number"
|
453 |
+
msgstr "Fakturanummer"
|
454 |
+
|
455 |
+
#: includes/class-wcpdf-writepanels.php:211
|
456 |
+
msgid "Download invoice (PDF)"
|
457 |
+
msgstr "Ladda ner Faktura (PDF)"
|
458 |
+
|
459 |
+
#: includes/class-wcpdf-writepanels.php:225
|
460 |
+
msgid "Create PDF"
|
461 |
+
msgstr "Skapa PDF"
|
462 |
+
|
463 |
+
#: includes/class-wcpdf-writepanels.php:235
|
464 |
+
msgid "PDF Invoice data"
|
465 |
+
msgstr "PDF Fakturadatum"
|
466 |
+
|
467 |
+
#: includes/class-wcpdf-writepanels.php:288
|
468 |
+
msgid "Invoice Number (unformatted!)"
|
469 |
+
msgstr "Faktur nummer (oformaterat)"
|
470 |
+
|
471 |
+
#: includes/class-wcpdf-writepanels.php:296 templates/pdf/Simple/invoice.php:55
|
472 |
+
msgid "Invoice Date:"
|
473 |
+
msgstr "Fakturadatum:"
|
474 |
+
|
475 |
+
#: includes/class-wcpdf-writepanels.php:298
|
476 |
+
#: includes/class-wcpdf-writepanels.php:300
|
477 |
+
msgid "h"
|
478 |
+
msgstr "h"
|
479 |
+
|
480 |
+
#: includes/class-wcpdf-writepanels.php:298
|
481 |
+
#: includes/class-wcpdf-writepanels.php:300
|
482 |
+
msgid "m"
|
483 |
+
msgstr "m"
|
484 |
+
|
485 |
+
#: includes/wcpdf-extensions.php:15
|
486 |
+
msgid "Check out these premium extensions!"
|
487 |
+
msgstr "Kolla in dessa Premium tillägg"
|
488 |
+
|
489 |
+
#: includes/wcpdf-extensions.php:16
|
490 |
+
msgid "click items to read more"
|
491 |
+
msgstr "klicka för att se mer"
|
492 |
+
|
493 |
+
#: includes/wcpdf-extensions.php:21
|
494 |
+
msgid ""
|
495 |
+
"Premium PDF Invoice bundle: Everything you need for a perfect invoicing "
|
496 |
+
"system"
|
497 |
+
msgstr ""
|
498 |
+
|
499 |
+
#: includes/wcpdf-extensions.php:23
|
500 |
+
msgid ""
|
501 |
+
"Supercharge WooCommerce PDF Invoices & Packing Slips with the all our "
|
502 |
+
"premium extensions:"
|
503 |
+
msgstr ""
|
504 |
+
|
505 |
+
#: includes/wcpdf-extensions.php:24
|
506 |
+
msgid "Professional features:"
|
507 |
+
msgstr ""
|
508 |
+
|
509 |
+
#: includes/wcpdf-extensions.php:26 includes/wcpdf-extensions.php:56
|
510 |
+
msgid "Email/print/download <b>PDF Credit Notes & Proforma invoices</b>"
|
511 |
+
msgstr ""
|
512 |
+
"E-post/utskrift/nerladdning<b>PDFÂ Kreditfakturor & Proformafakturor</b>"
|
513 |
+
|
514 |
+
#: includes/wcpdf-extensions.php:27 includes/wcpdf-extensions.php:57
|
515 |
+
msgid ""
|
516 |
+
"Send out a separate <b>notification email</b> with (or without) PDF invoices/"
|
517 |
+
"packing slips, for example to a drop-shipper or a supplier."
|
518 |
+
msgstr ""
|
519 |
+
"Skicka ett separat <b> e-postmeddelande</b> med eller utan PDF faktura/"
|
520 |
+
"följesedel, till exempel \"drop-shipper\" eller en leverantör."
|
521 |
+
|
522 |
+
#: includes/wcpdf-extensions.php:28 includes/wcpdf-extensions.php:58
|
523 |
+
msgid ""
|
524 |
+
"Attach <b>up to 3 static files</b> (for example a terms & conditions "
|
525 |
+
"document) to the WooCommerce emails of your choice."
|
526 |
+
msgstr ""
|
527 |
+
"Bifoga<b>upp till 3 statiska filer</b> (till exempel användarvillkor) med "
|
528 |
+
"valfri WooCommerce e-post."
|
529 |
+
|
530 |
+
#: includes/wcpdf-extensions.php:29 includes/wcpdf-extensions.php:59
|
531 |
+
msgid ""
|
532 |
+
"Use <b>separate numbering systems</b> and/or format for proforma invoices "
|
533 |
+
"and credit notes or utilize the main invoice numbering system"
|
534 |
+
msgstr ""
|
535 |
+
"Använd <b>Separata nummer system</b> för preformafakturor, kreditfakturor "
|
536 |
+
"eller använd huvud fakturanummer systemet. "
|
537 |
+
|
538 |
+
#: includes/wcpdf-extensions.php:30 includes/wcpdf-extensions.php:60
|
539 |
+
msgid ""
|
540 |
+
"<b>Customize</b> the <b>shipping & billing address</b> format to include "
|
541 |
+
"additional custom fields, font sizes etc. without the need to create a "
|
542 |
+
"custom template."
|
543 |
+
msgstr ""
|
544 |
+
"<b>Förändra, faktura och leveransadress</b> efter dina behov, typsnitt "
|
545 |
+
"storlek mm. utan att behöva skapa en egen mall. "
|
546 |
+
|
547 |
+
#: includes/wcpdf-extensions.php:31 includes/wcpdf-extensions.php:61
|
548 |
+
msgid "Use the plugin in multilingual <b>WPML</b> setups"
|
549 |
+
msgstr "Användar tillägg är flerspråkigt <b>WPML</b> inställningar"
|
550 |
+
|
551 |
+
#: includes/wcpdf-extensions.php:33 includes/wcpdf-extensions.php:131
|
552 |
+
msgid "Advanced, customizable templates"
|
553 |
+
msgstr "Avancerade, anpassningsbara mallar"
|
554 |
+
|
555 |
+
#: includes/wcpdf-extensions.php:35 includes/wcpdf-extensions.php:134
|
556 |
+
msgid ""
|
557 |
+
"Completely customize the invoice contents (prices, taxes, thumbnails) to "
|
558 |
+
"your needs with a drag & drop customizer"
|
559 |
+
msgstr ""
|
560 |
+
"Helt anpassa faktura innehåll (priser, skatter, miniatyrer) till dina behov "
|
561 |
+
"med en dra och släpp Customizer"
|
562 |
+
|
563 |
+
#: includes/wcpdf-extensions.php:36 includes/wcpdf-extensions.php:135
|
564 |
+
msgid "Two extra stylish premade templates (Modern & Business)"
|
565 |
+
msgstr "Två extra snygg mallarna (Modern & Business)"
|
566 |
+
|
567 |
+
#: includes/wcpdf-extensions.php:38
|
568 |
+
msgid "Upload automatically to dropbox"
|
569 |
+
msgstr ""
|
570 |
+
|
571 |
+
#: includes/wcpdf-extensions.php:40 includes/wcpdf-extensions.php:97
|
572 |
+
msgid ""
|
573 |
+
"This extension conveniently uploads all the invoices (and other pdf "
|
574 |
+
"documents from the professional extension) that are emailed to your "
|
575 |
+
"customers to Dropbox. The best way to keep your invoice administration up to "
|
576 |
+
"date!"
|
577 |
+
msgstr ""
|
578 |
+
"Det här tillägget laddar enkelt alla fakturor (och andra PDF-dokument från "
|
579 |
+
"den professionella förlängning) som mailas till dina kunders Dropbox. Det "
|
580 |
+
"bästa sättet att hålla din fakturaadministration aktuell!"
|
581 |
+
|
582 |
+
#: includes/wcpdf-extensions.php:43
|
583 |
+
msgid "Get WooCommerce PDF Invoices & Packing Slips Bundle"
|
584 |
+
msgstr ""
|
585 |
+
|
586 |
+
#: includes/wcpdf-extensions.php:52
|
587 |
+
msgid "Go Pro: Proforma invoices, credit notes (=refunds) & more!"
|
588 |
+
msgstr ""
|
589 |
+
"Köp Premium: Proformafaktura, kreditfaktura (=återbetalning) och mycket "
|
590 |
+
"annat!"
|
591 |
+
|
592 |
+
#: includes/wcpdf-extensions.php:54
|
593 |
+
msgid ""
|
594 |
+
"Supercharge WooCommerce PDF Invoices & Packing Slips with the following "
|
595 |
+
"features:"
|
596 |
+
msgstr "WooCommerce PDF Invoices & Packing Slips med följande funktioner:"
|
597 |
+
|
598 |
+
#: includes/wcpdf-extensions.php:63
|
599 |
+
msgid "Get WooCommerce PDF Invoices & Packing Slips Professional!"
|
600 |
+
msgstr "Få WooCommerce PDF Fakturor & följesedlar Professional!"
|
601 |
+
|
602 |
+
#: includes/wcpdf-extensions.php:71
|
603 |
+
msgid "Automatically send payment reminders to your customers"
|
604 |
+
msgstr ""
|
605 |
+
|
606 |
+
#: includes/wcpdf-extensions.php:73
|
607 |
+
msgid "WooCommerce Smart Reminder emails"
|
608 |
+
msgstr ""
|
609 |
+
|
610 |
+
#: includes/wcpdf-extensions.php:75
|
611 |
+
msgid "<b>Completely automatic</b> scheduled emails"
|
612 |
+
msgstr ""
|
613 |
+
|
614 |
+
#: includes/wcpdf-extensions.php:76
|
615 |
+
msgid ""
|
616 |
+
"<b>Rich text editor</b> for the email text, including placeholders for data "
|
617 |
+
"from the order (name, order total, etc)"
|
618 |
+
msgstr ""
|
619 |
+
|
620 |
+
#: includes/wcpdf-extensions.php:77
|
621 |
+
msgid ""
|
622 |
+
"Configure the exact requirements for sending an email (time after order, "
|
623 |
+
"order status, payment method)"
|
624 |
+
msgstr ""
|
625 |
+
|
626 |
+
#: includes/wcpdf-extensions.php:78
|
627 |
+
msgid ""
|
628 |
+
"Fully <b>WPML Compatible</b> – emails will be automatically sent in the "
|
629 |
+
"order language."
|
630 |
+
msgstr ""
|
631 |
+
|
632 |
+
#: includes/wcpdf-extensions.php:79
|
633 |
+
msgid ""
|
634 |
+
"<b>Super versatile!</b> Can be used for any kind of reminder email (review "
|
635 |
+
"reminders, repeat purchases)"
|
636 |
+
msgstr ""
|
637 |
+
|
638 |
+
#: includes/wcpdf-extensions.php:80
|
639 |
+
msgid "Integrates seamlessly with the PDF Invoices & Packing Slips plugin"
|
640 |
+
msgstr ""
|
641 |
+
|
642 |
+
#: includes/wcpdf-extensions.php:82
|
643 |
+
msgid "Get WooCommerce Smart Reminder Emails"
|
644 |
+
msgstr ""
|
645 |
+
|
646 |
+
#: includes/wcpdf-extensions.php:91
|
647 |
+
msgid "Upload all invoices automatically to your dropbox"
|
648 |
+
msgstr "Ladda upp alla fakturor automatiskt till din Dropbox"
|
649 |
+
|
650 |
+
#: includes/wcpdf-extensions.php:98
|
651 |
+
msgid "Get WooCommerce PDF Invoices & Packing Slips to dropbox!"
|
652 |
+
msgstr "Få WooCommerce PDF Fakturor & följesedlar till Dropbox!"
|
653 |
+
|
654 |
+
#: includes/wcpdf-extensions.php:110
|
655 |
+
msgid ""
|
656 |
+
"Automatically send new orders or packing slips to your printer, as soon as "
|
657 |
+
"the customer orders!"
|
658 |
+
msgstr ""
|
659 |
+
"Skicka automatiskt nya order eller följesedlar till din skrivare, så snart "
|
660 |
+
"kunden beställer!"
|
661 |
+
|
662 |
+
#: includes/wcpdf-extensions.php:116
|
663 |
+
msgid ""
|
664 |
+
"Check out the WooCommerce Automatic Order Printing extension from our "
|
665 |
+
"partners at Simba Hosting"
|
666 |
+
msgstr ""
|
667 |
+
"Kolla in WooCommerce automatisk order Printing förlängning från våra "
|
668 |
+
"partners på Simba Hosting"
|
669 |
+
|
670 |
+
#: includes/wcpdf-extensions.php:117
|
671 |
+
msgid "WooCommerce Automatic Order Printing"
|
672 |
+
msgstr "WooCommerce automatisk order utskrift"
|
673 |
+
|
674 |
+
#: includes/wcpdf-extensions.php:136
|
675 |
+
#, php-format
|
676 |
+
msgid "Check out the Premium PDF Invoice & Packing Slips templates at %s."
|
677 |
+
msgstr "Kolla in Premium PDF-faktura och följesedlar mallar på %s."
|
678 |
+
|
679 |
+
#: includes/wcpdf-extensions.php:137
|
680 |
+
#, php-format
|
681 |
+
msgid "For custom templates, contact us at %s."
|
682 |
+
msgstr "För skräddarsydda mallar, kontakta oss på %s"
|
683 |
+
|
684 |
+
#: includes/wcpdf-extensions.php:146
|
685 |
+
msgid "Hide this message"
|
686 |
+
msgstr ""
|
687 |
+
|
688 |
+
#: templates/pdf/Simple/invoice.php:29 templates/pdf/Simple/packing-slip.php:40
|
689 |
+
msgid "Billing Address:"
|
690 |
+
msgstr "Fakturaadress:"
|
691 |
+
|
692 |
+
#: templates/pdf/Simple/invoice.php:40
|
693 |
+
msgid "Ship To:"
|
694 |
+
msgstr "Leveransadress:"
|
695 |
+
|
696 |
+
#: templates/pdf/Simple/invoice.php:49
|
697 |
+
msgid "Invoice Number:"
|
698 |
+
msgstr "Fakturanummer:"
|
699 |
+
|
700 |
+
#: templates/pdf/Simple/invoice.php:60 templates/pdf/Simple/packing-slip.php:48
|
701 |
+
msgid "Order Number:"
|
702 |
+
msgstr "Ordernummer:"
|
703 |
+
|
704 |
+
#: templates/pdf/Simple/invoice.php:64 templates/pdf/Simple/packing-slip.php:52
|
705 |
+
msgid "Order Date:"
|
706 |
+
msgstr "Orderdatum:"
|
707 |
+
|
708 |
+
#: templates/pdf/Simple/invoice.php:68
|
709 |
+
msgid "Payment Method:"
|
710 |
+
msgstr "Betalningssätt:"
|
711 |
+
|
712 |
+
#: templates/pdf/Simple/invoice.php:82 templates/pdf/Simple/packing-slip.php:70
|
713 |
+
msgid "Product"
|
714 |
+
msgstr "Produkt:"
|
715 |
+
|
716 |
+
#: templates/pdf/Simple/invoice.php:83 templates/pdf/Simple/packing-slip.php:71
|
717 |
+
msgid "Quantity"
|
718 |
+
msgstr "Antal:"
|
719 |
+
|
720 |
+
#: templates/pdf/Simple/invoice.php:84
|
721 |
+
msgid "Price"
|
722 |
+
msgstr "Pris:"
|
723 |
+
|
724 |
+
#: templates/pdf/Simple/invoice.php:91 templates/pdf/Simple/packing-slip.php:78
|
725 |
+
msgid "Description"
|
726 |
+
msgstr "Beskrivning:"
|
727 |
+
|
728 |
+
#: templates/pdf/Simple/invoice.php:96 templates/pdf/Simple/packing-slip.php:83
|
729 |
+
msgid "SKU"
|
730 |
+
msgstr "Artikelnummer:"
|
731 |
+
|
732 |
+
#: templates/pdf/Simple/invoice.php:97 templates/pdf/Simple/packing-slip.php:84
|
733 |
+
msgid "SKU:"
|
734 |
+
msgstr "SKU:"
|
735 |
+
|
736 |
+
#: templates/pdf/Simple/invoice.php:98 templates/pdf/Simple/packing-slip.php:85
|
737 |
+
msgid "Weight:"
|
738 |
+
msgstr "Vikt:"
|
739 |
+
|
740 |
+
#: templates/pdf/Simple/invoice.php:112
|
741 |
+
#: templates/pdf/Simple/packing-slip.php:99
|
742 |
+
msgid "Customer Notes"
|
743 |
+
msgstr "Kundnoteringar:"
|
744 |
+
|
745 |
+
#: templates/pdf/Simple/packing-slip.php:29
|
746 |
+
msgid "Shipping Address:"
|
747 |
+
msgstr "Leveransadress:"
|
748 |
+
|
749 |
+
#: templates/pdf/Simple/packing-slip.php:56
|
750 |
+
msgid "Shipping Method:"
|
751 |
+
msgstr "Fraktmetod:"
|
752 |
+
|
753 |
+
#: woocommerce-pdf-invoices-packingslips.php:123
|
754 |
+
#, php-format
|
755 |
+
msgid ""
|
756 |
+
"WooCommerce PDF Invoices & Packing Slips requires %sWooCommerce%s to be "
|
757 |
+
"installed & activated!"
|
758 |
+
msgstr ""
|
759 |
+
"WooCommerce PDF Invoices & Packing Slips behövert %sWooCommerce%s för att "
|
760 |
+
"installeras och aktiveras!"
|
761 |
+
|
762 |
+
#: woocommerce-pdf-invoices-packingslips.php:377
|
763 |
+
#: woocommerce-pdf-invoices-packingslips.php:438
|
764 |
+
msgid "N/A"
|
765 |
+
msgstr "N/A"
|
766 |
+
|
767 |
+
#: woocommerce-pdf-invoices-packingslips.php:533
|
768 |
+
msgid "Payment method"
|
769 |
+
msgstr "Betalningssätt:"
|
770 |
+
|
771 |
+
#: woocommerce-pdf-invoices-packingslips.php:552
|
772 |
+
msgid "Shipping method"
|
773 |
+
msgstr "Fraktmetod:"
|
774 |
+
|
775 |
+
#: woocommerce-pdf-invoices-packingslips.php:712
|
776 |
+
#, php-format
|
777 |
+
msgid "(includes %s)"
|
778 |
+
msgstr ""
|
779 |
+
|
780 |
+
#: woocommerce-pdf-invoices-packingslips.php:715
|
781 |
+
#, php-format
|
782 |
+
msgid "(Includes %s)"
|
783 |
+
msgstr ""
|
784 |
+
|
785 |
+
#: woocommerce-pdf-invoices-packingslips.php:744
|
786 |
+
msgid "Subtotal"
|
787 |
+
msgstr "Belopp:"
|
788 |
+
|
789 |
+
#: woocommerce-pdf-invoices-packingslips.php:766
|
790 |
+
msgid "Shipping"
|
791 |
+
msgstr "Frakt:"
|
792 |
+
|
793 |
+
#: woocommerce-pdf-invoices-packingslips.php:829
|
794 |
+
msgid "Discount"
|
795 |
+
msgstr "Rabatt:"
|
796 |
+
|
797 |
+
#: woocommerce-pdf-invoices-packingslips.php:870
|
798 |
+
msgid "VAT"
|
799 |
+
msgstr "Moms:"
|
800 |
+
|
801 |
+
#: woocommerce-pdf-invoices-packingslips.php:871
|
802 |
+
msgid "Tax rate"
|
803 |
+
msgstr "Momssats:"
|
804 |
+
|
805 |
+
#: woocommerce-pdf-invoices-packingslips.php:908
|
806 |
+
msgid "Total ex. VAT"
|
807 |
+
msgstr "Totalt exkl. moms:"
|
808 |
+
|
809 |
+
#: woocommerce-pdf-invoices-packingslips.php:911
|
810 |
+
msgid "Total"
|
811 |
+
msgstr "Totalt:"
|
812 |
+
|
813 |
+
#~ msgid ""
|
814 |
+
#~ "to use the order year and/or month, use [order_year] or [order_month] "
|
815 |
+
#~ "respectively"
|
816 |
+
#~ msgstr ""
|
817 |
+
#~ "för att använda order datum eller månad , använd [order_year] eller "
|
818 |
+
#~ "[order_month] "
|
languages/wpo_wcpdf.pot
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
Â
msgid ""
|
3 |
Â
msgstr ""
|
4 |
Â
"Project-Id-Version: WooCommerce PDF Invoices & Packing Slips\n"
|
5 |
-
"POT-Creation-Date: 2016-
|
6 |
Â
"PO-Revision-Date: 2015-04-29 08:58+0100\n"
|
7 |
Â
"Last-Translator: \n"
|
8 |
Â
"Language-Team: WP Overnight <support@wpovernight.com>\n"
|
@@ -10,29 +10,29 @@ msgstr ""
|
|
10 |
Â
"MIME-Version: 1.0\n"
|
11 |
Â
"Content-Type: text/plain; charset=UTF-8\n"
|
12 |
Â
"Content-Transfer-Encoding: 8bit\n"
|
13 |
-
"X-Generator: Poedit 1.8.
|
14 |
Â
"X-Poedit-Basepath: ..\n"
|
15 |
Â
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
16 |
Â
"X-Poedit-SourceCharset: UTF-8\n"
|
17 |
Â
"X-Poedit-KeywordsList: __;_e;_x;_n:1,2\n"
|
18 |
Â
"X-Poedit-SearchPath-0: .\n"
|
19 |
Â
|
20 |
-
#: includes/class-wcpdf-export.php:
|
21 |
-
#: includes/class-wcpdf-export.php:
|
22 |
Â
msgid "You do not have sufficient permissions to access this page."
|
23 |
Â
msgstr ""
|
24 |
Â
|
25 |
-
#: includes/class-wcpdf-export.php:
|
26 |
Â
msgid "Some of the export parameters are missing."
|
27 |
Â
msgstr ""
|
28 |
Â
|
29 |
-
#: includes/class-wcpdf-export.php:
|
30 |
Â
msgid "invoice"
|
31 |
Â
msgid_plural "invoices"
|
32 |
Â
msgstr[0] ""
|
33 |
Â
msgstr[1] ""
|
34 |
Â
|
35 |
-
#: includes/class-wcpdf-export.php:
|
36 |
Â
msgid "packing-slip"
|
37 |
Â
msgid_plural "packing-slips"
|
38 |
Â
msgstr[0] ""
|
@@ -63,43 +63,43 @@ msgstr ""
|
|
63 |
Â
msgid "WooCommerce PDF Invoices"
|
64 |
Â
msgstr ""
|
65 |
Â
|
66 |
-
#: includes/class-wcpdf-settings.php:
|
67 |
Â
msgid "General settings"
|
68 |
Â
msgstr ""
|
69 |
Â
|
70 |
-
#: includes/class-wcpdf-settings.php:
|
71 |
Â
msgid "How do you want to view the PDF?"
|
72 |
Â
msgstr ""
|
73 |
Â
|
74 |
-
#: includes/class-wcpdf-settings.php:
|
75 |
Â
msgid "Download the PDF"
|
76 |
Â
msgstr ""
|
77 |
Â
|
78 |
-
#: includes/class-wcpdf-settings.php:
|
79 |
Â
msgid "Open the PDF in a new browser tab/window"
|
80 |
Â
msgstr ""
|
81 |
Â
|
82 |
-
#: includes/class-wcpdf-settings.php:
|
83 |
Â
msgid "Admin New Order email"
|
84 |
Â
msgstr ""
|
85 |
Â
|
86 |
-
#: includes/class-wcpdf-settings.php:
|
87 |
Â
msgid "Customer Processing Order email"
|
88 |
Â
msgstr ""
|
89 |
Â
|
90 |
-
#: includes/class-wcpdf-settings.php:
|
91 |
Â
msgid "Customer Completed Order email"
|
92 |
Â
msgstr ""
|
93 |
Â
|
94 |
-
#: includes/class-wcpdf-settings.php:
|
95 |
Â
msgid "Customer Invoice email"
|
96 |
Â
msgstr ""
|
97 |
Â
|
98 |
-
#: includes/class-wcpdf-settings.php:
|
99 |
Â
msgid "Attach invoice to:"
|
100 |
Â
msgstr ""
|
101 |
Â
|
102 |
-
#: includes/class-wcpdf-settings.php:
|
103 |
Â
#, php-format
|
104 |
Â
msgid ""
|
105 |
Â
"It looks like the temp folder (<code>%s</code>) is not writable, check the "
|
@@ -107,137 +107,150 @@ msgid ""
|
|
107 |
Â
"plugin will not be able to email invoices."
|
108 |
Â
msgstr ""
|
109 |
Â
|
110 |
-
#: includes/class-wcpdf-settings.php:
|
111 |
Â
msgid "Disable for free products"
|
112 |
Â
msgstr ""
|
113 |
Â
|
114 |
-
#: includes/class-wcpdf-settings.php:
|
115 |
Â
msgid ""
|
116 |
Â
"Disable automatic creation/attachment of invoices when only free products "
|
117 |
Â
"are ordered"
|
118 |
Â
msgstr ""
|
119 |
Â
|
120 |
-
#: includes/class-wcpdf-settings.php:
|
121 |
Â
msgid "Interface"
|
122 |
Â
msgstr ""
|
123 |
Â
|
124 |
-
#: includes/class-wcpdf-settings.php:
|
125 |
Â
msgid "Allow My Account invoice download"
|
126 |
Â
msgstr ""
|
127 |
Â
|
128 |
-
#: includes/class-wcpdf-settings.php:
|
129 |
Â
msgid "Only when an invoice is already created/emailed"
|
130 |
Â
msgstr ""
|
131 |
Â
|
132 |
-
#: includes/class-wcpdf-settings.php:
|
133 |
Â
msgid "Only for specific order statuses (define below)"
|
134 |
Â
msgstr ""
|
135 |
Â
|
136 |
-
#: includes/class-wcpdf-settings.php:
|
137 |
Â
msgid "Always"
|
138 |
Â
msgstr ""
|
139 |
Â
|
140 |
-
#: includes/class-wcpdf-settings.php:
|
141 |
Â
msgid "Never"
|
142 |
Â
msgstr ""
|
143 |
Â
|
144 |
-
#: includes/class-wcpdf-settings.php:
|
145 |
Â
msgid "Enable invoice number column in the orders list"
|
146 |
Â
msgstr ""
|
147 |
Â
|
148 |
-
#: includes/class-wcpdf-settings.php:
|
149 |
Â
msgid "PDF Template settings"
|
150 |
Â
msgstr ""
|
151 |
Â
|
152 |
-
#: includes/class-wcpdf-settings.php:
|
153 |
Â
msgid "Choose a template"
|
154 |
Â
msgstr ""
|
155 |
Â
|
156 |
-
#: includes/class-wcpdf-settings.php:
|
157 |
Â
#, php-format
|
158 |
Â
msgid ""
|
159 |
Â
"Want to use your own template? Copy all the files from <code>%s</code> to "
|
160 |
Â
"your (child) theme in <code>%s</code> to customize them"
|
161 |
Â
msgstr ""
|
162 |
Â
|
163 |
-
#: includes/class-wcpdf-settings.php:
|
164 |
Â
msgid "Paper size"
|
165 |
Â
msgstr ""
|
166 |
Â
|
167 |
-
#: includes/class-wcpdf-settings.php:
|
168 |
Â
msgid "A4"
|
169 |
Â
msgstr ""
|
170 |
Â
|
171 |
-
#: includes/class-wcpdf-settings.php:
|
172 |
Â
msgid "Letter"
|
173 |
Â
msgstr ""
|
174 |
Â
|
175 |
-
#: includes/class-wcpdf-settings.php:
|
176 |
Â
msgid "Shop header/logo"
|
177 |
Â
msgstr ""
|
178 |
Â
|
179 |
-
#: includes/class-wcpdf-settings.php:
|
180 |
Â
msgid "Select or upload your invoice header/logo"
|
181 |
Â
msgstr ""
|
182 |
Â
|
183 |
-
#: includes/class-wcpdf-settings.php:
|
184 |
Â
msgid "Set image"
|
185 |
Â
msgstr ""
|
186 |
Â
|
187 |
-
#: includes/class-wcpdf-settings.php:
|
188 |
Â
msgid "Remove image"
|
189 |
Â
msgstr ""
|
190 |
Â
|
191 |
-
#: includes/class-wcpdf-settings.php:
|
192 |
Â
msgid "Shop Name"
|
193 |
Â
msgstr ""
|
194 |
Â
|
195 |
-
#: includes/class-wcpdf-settings.php:
|
196 |
Â
msgid "Shop Address"
|
197 |
Â
msgstr ""
|
198 |
Â
|
199 |
-
#: includes/class-wcpdf-settings.php:
|
200 |
Â
msgid "Footer: terms & conditions, policies, etc."
|
201 |
Â
msgstr ""
|
202 |
Â
|
203 |
-
#: includes/class-wcpdf-settings.php:
|
204 |
-
#: includes/class-wcpdf-writepanels.php:
|
205 |
Â
#: templates/pdf/Simple/invoice.php:21
|
206 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
207 |
Â
msgid "Invoice"
|
208 |
Â
msgstr ""
|
209 |
Â
|
210 |
-
#: includes/class-wcpdf-settings.php:
|
211 |
Â
msgid "Display shipping address"
|
212 |
Â
msgstr ""
|
213 |
Â
|
214 |
-
#: includes/class-wcpdf-settings.php:
|
215 |
Â
msgid ""
|
216 |
Â
"Display shipping address on invoice (in addition to the default billing "
|
217 |
Â
"address) if different from billing address"
|
218 |
Â
msgstr ""
|
219 |
Â
|
220 |
-
#: includes/class-wcpdf-settings.php:
|
221 |
Â
msgid "Display email address"
|
222 |
Â
msgstr ""
|
223 |
Â
|
224 |
-
#: includes/class-wcpdf-settings.php:
|
225 |
Â
msgid "Display phone number"
|
226 |
Â
msgstr ""
|
227 |
Â
|
228 |
-
#: includes/class-wcpdf-settings.php:
|
229 |
Â
msgid "Display invoice date"
|
230 |
Â
msgstr ""
|
231 |
Â
|
232 |
-
#: includes/class-wcpdf-settings.php:
|
233 |
-
msgid "
|
234 |
Â
msgstr ""
|
235 |
Â
|
236 |
Â
#: includes/class-wcpdf-settings.php:540
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
237 |
Â
msgid "Next invoice number (without prefix/suffix etc.)"
|
238 |
Â
msgstr ""
|
239 |
Â
|
240 |
-
#: includes/class-wcpdf-settings.php:
|
241 |
Â
msgid ""
|
242 |
Â
"This is the number that will be used on the next invoice that is created. By "
|
243 |
Â
"default, numbering starts from the WooCommerce Order Number of the first "
|
@@ -246,132 +259,140 @@ msgid ""
|
|
246 |
Â
"this could create double invoice numbers!"
|
247 |
Â
msgstr ""
|
248 |
Â
|
249 |
-
#: includes/class-wcpdf-settings.php:
|
250 |
Â
msgid "Invoice number format"
|
251 |
Â
msgstr ""
|
252 |
Â
|
253 |
-
#: includes/class-wcpdf-settings.php:
|
254 |
Â
msgid "Prefix"
|
255 |
Â
msgstr ""
|
256 |
Â
|
257 |
-
#: includes/class-wcpdf-settings.php:
|
258 |
Â
msgid ""
|
259 |
Â
"to use the invoice year and/or month, use [invoice_year] or [invoice_month] "
|
260 |
Â
"respectively"
|
261 |
Â
msgstr ""
|
262 |
Â
|
263 |
-
#: includes/class-wcpdf-settings.php:
|
264 |
Â
msgid "Suffix"
|
265 |
Â
msgstr ""
|
266 |
Â
|
267 |
-
#: includes/class-wcpdf-settings.php:
|
268 |
Â
msgid "Padding"
|
269 |
Â
msgstr ""
|
270 |
Â
|
271 |
-
#: includes/class-wcpdf-settings.php:
|
272 |
Â
msgid "enter the number of digits here - enter \"6\" to display 42 as 000042"
|
273 |
Â
msgstr ""
|
274 |
Â
|
275 |
-
#: includes/class-wcpdf-settings.php:
|
276 |
Â
msgid ""
|
277 |
Â
"note: if you have already created a custom invoice number format with a "
|
278 |
Â
"filter, the above settings will be ignored"
|
279 |
Â
msgstr ""
|
280 |
Â
|
281 |
-
#: includes/class-wcpdf-settings.php:
|
282 |
Â
msgid "Reset invoice number yearly"
|
283 |
Â
msgstr ""
|
284 |
Â
|
285 |
-
#: includes/class-wcpdf-settings.php:
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
286 |
Â
#: templates/pdf/Simple/packing-slip.php:9
|
287 |
Â
#: templates/pdf/Simple/packing-slip.php:21
|
288 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
289 |
Â
msgid "Packing Slip"
|
290 |
Â
msgstr ""
|
291 |
Â
|
292 |
-
#: includes/class-wcpdf-settings.php:
|
293 |
Â
msgid "Display billing address"
|
294 |
Â
msgstr ""
|
295 |
Â
|
296 |
-
#: includes/class-wcpdf-settings.php:
|
297 |
Â
msgid ""
|
298 |
Â
"Display billing address on packing slip (in addition to the default shipping "
|
299 |
Â
"address) if different from shipping address"
|
300 |
Â
msgstr ""
|
301 |
Â
|
302 |
-
#: includes/class-wcpdf-settings.php:
|
303 |
Â
msgid "Extra template fields"
|
304 |
Â
msgstr ""
|
305 |
Â
|
306 |
-
#: includes/class-wcpdf-settings.php:
|
307 |
Â
msgid "Extra field 1"
|
308 |
Â
msgstr ""
|
309 |
Â
|
310 |
-
#: includes/class-wcpdf-settings.php:
|
311 |
Â
msgid "This is footer column 1 in the <i>Modern (Premium)</i> template"
|
312 |
Â
msgstr ""
|
313 |
Â
|
314 |
-
#: includes/class-wcpdf-settings.php:
|
315 |
Â
msgid "Extra field 2"
|
316 |
Â
msgstr ""
|
317 |
Â
|
318 |
-
#: includes/class-wcpdf-settings.php:
|
319 |
Â
msgid "This is footer column 2 in the <i>Modern (Premium)</i> template"
|
320 |
Â
msgstr ""
|
321 |
Â
|
322 |
-
#: includes/class-wcpdf-settings.php:
|
323 |
Â
msgid "Extra field 3"
|
324 |
Â
msgstr ""
|
325 |
Â
|
326 |
-
#: includes/class-wcpdf-settings.php:
|
327 |
Â
msgid "This is footer column 3 in the <i>Modern (Premium)</i> template"
|
328 |
Â
msgstr ""
|
329 |
Â
|
330 |
-
#: includes/class-wcpdf-settings.php:
|
331 |
Â
msgid "Debug settings"
|
332 |
Â
msgstr ""
|
333 |
Â
|
334 |
-
#: includes/class-wcpdf-settings.php:
|
335 |
Â
msgid "Enable debug output"
|
336 |
Â
msgstr ""
|
337 |
Â
|
338 |
-
#: includes/class-wcpdf-settings.php:
|
339 |
Â
msgid ""
|
340 |
Â
"Enable this option to output plugin errors if you're getting a blank page or "
|
341 |
Â
"other PDF generation issues"
|
342 |
Â
msgstr ""
|
343 |
Â
|
344 |
-
#: includes/class-wcpdf-settings.php:
|
345 |
Â
msgid "Output to HTML"
|
346 |
Â
msgstr ""
|
347 |
Â
|
348 |
-
#: includes/class-wcpdf-settings.php:
|
349 |
Â
msgid ""
|
350 |
Â
"Send the template output as HTML to the browser instead of creating a PDF."
|
351 |
Â
msgstr ""
|
352 |
Â
|
353 |
-
#: includes/class-wcpdf-settings.php:
|
354 |
Â
msgid "Use old tmp folder"
|
355 |
Â
msgstr ""
|
356 |
Â
|
357 |
-
#: includes/class-wcpdf-settings.php:
|
358 |
Â
msgid ""
|
359 |
Â
"Before version 1.5 of PDF Invoices, temporary files were stored in the "
|
360 |
Â
"plugin folder. This setting is only intended for backwards compatibility, "
|
361 |
Â
"not recommended on new installs!"
|
362 |
Â
msgstr ""
|
363 |
Â
|
364 |
-
#: includes/class-wcpdf-settings.php:
|
365 |
Â
msgid "Image resolution"
|
366 |
Â
msgstr ""
|
367 |
Â
|
368 |
-
#: includes/class-wcpdf-settings.php:
|
369 |
Â
msgid ""
|
370 |
Â
"<b>Warning!</b> The settings below are meant for debugging/development only. "
|
371 |
Â
"Do not use them on a live website!"
|
372 |
Â
msgstr ""
|
373 |
Â
|
374 |
-
#: includes/class-wcpdf-settings.php:
|
375 |
Â
msgid ""
|
376 |
Â
"These are used for the (optional) footer columns in the <em>Modern "
|
377 |
Â
"(Premium)</em> template, but can also be used for other elements in your "
|
@@ -382,45 +403,47 @@ msgstr ""
|
|
382 |
Â
msgid "PDF Packing Slips"
|
383 |
Â
msgstr ""
|
384 |
Â
|
385 |
-
#: includes/class-wcpdf-writepanels.php:
|
386 |
-
#: includes/class-wcpdf-writepanels.php:
|
387 |
Â
msgid "PDF Invoice"
|
388 |
Â
msgstr ""
|
389 |
Â
|
390 |
-
#: includes/class-wcpdf-writepanels.php:
|
391 |
-
#: includes/class-wcpdf-writepanels.php:
|
392 |
Â
msgid "PDF Packing Slip"
|
393 |
Â
msgstr ""
|
394 |
Â
|
395 |
-
#: includes/class-wcpdf-writepanels.php:
|
396 |
Â
msgid "Invoice Number"
|
397 |
Â
msgstr ""
|
398 |
Â
|
399 |
-
#: includes/class-wcpdf-writepanels.php:
|
400 |
Â
msgid "Download invoice (PDF)"
|
401 |
Â
msgstr ""
|
402 |
Â
|
403 |
-
#: includes/class-wcpdf-writepanels.php:
|
404 |
Â
msgid "Create PDF"
|
405 |
Â
msgstr ""
|
406 |
Â
|
407 |
-
#: includes/class-wcpdf-writepanels.php:
|
408 |
Â
msgid "PDF Invoice data"
|
409 |
Â
msgstr ""
|
410 |
Â
|
411 |
-
#: includes/class-wcpdf-writepanels.php:
|
412 |
Â
msgid "Invoice Number (unformatted!)"
|
413 |
Â
msgstr ""
|
414 |
Â
|
415 |
-
#: includes/class-wcpdf-writepanels.php:
|
416 |
Â
msgid "Invoice Date:"
|
417 |
Â
msgstr ""
|
418 |
Â
|
419 |
-
#: includes/class-wcpdf-writepanels.php:
|
Â
|
|
420 |
Â
msgid "h"
|
421 |
Â
msgstr ""
|
422 |
Â
|
423 |
-
#: includes/class-wcpdf-writepanels.php:
|
Â
|
|
424 |
Â
msgid "m"
|
425 |
Â
msgstr ""
|
426 |
Â
|
@@ -432,58 +455,74 @@ msgstr ""
|
|
432 |
Â
msgid "click items to read more"
|
433 |
Â
msgstr ""
|
434 |
Â
|
435 |
-
#: includes/wcpdf-extensions.php:
|
436 |
-
msgid "
|
Â
|
|
Â
|
|
437 |
Â
msgstr ""
|
438 |
Â
|
439 |
-
#: includes/wcpdf-extensions.php:
|
440 |
Â
msgid ""
|
441 |
-
"Supercharge WooCommerce PDF Invoices & Packing Slips with the
|
442 |
-
"
|
443 |
Â
msgstr ""
|
444 |
Â
|
445 |
-
#: includes/wcpdf-extensions.php:
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
446 |
Â
msgid "Email/print/download <b>PDF Credit Notes & Proforma invoices</b>"
|
447 |
Â
msgstr ""
|
448 |
Â
|
449 |
-
#: includes/wcpdf-extensions.php:
|
450 |
Â
msgid ""
|
451 |
Â
"Send out a separate <b>notification email</b> with (or without) PDF invoices/"
|
452 |
Â
"packing slips, for example to a drop-shipper or a supplier."
|
453 |
Â
msgstr ""
|
454 |
Â
|
455 |
-
#: includes/wcpdf-extensions.php:
|
456 |
Â
msgid ""
|
457 |
Â
"Attach <b>up to 3 static files</b> (for example a terms & conditions "
|
458 |
Â
"document) to the WooCommerce emails of your choice."
|
459 |
Â
msgstr ""
|
460 |
Â
|
461 |
-
#: includes/wcpdf-extensions.php:
|
462 |
Â
msgid ""
|
463 |
Â
"Use <b>separate numbering systems</b> and/or format for proforma invoices "
|
464 |
Â
"and credit notes or utilize the main invoice numbering system"
|
465 |
Â
msgstr ""
|
466 |
Â
|
467 |
-
#: includes/wcpdf-extensions.php:
|
468 |
Â
msgid ""
|
469 |
Â
"<b>Customize</b> the <b>shipping & billing address</b> format to include "
|
470 |
Â
"additional custom fields, font sizes etc. without the need to create a "
|
471 |
Â
"custom template."
|
472 |
Â
msgstr ""
|
473 |
Â
|
474 |
-
#: includes/wcpdf-extensions.php:
|
475 |
Â
msgid "Use the plugin in multilingual <b>WPML</b> setups"
|
476 |
Â
msgstr ""
|
477 |
Â
|
478 |
-
#: includes/wcpdf-extensions.php:
|
479 |
-
msgid "
|
480 |
Â
msgstr ""
|
481 |
Â
|
482 |
-
#: includes/wcpdf-extensions.php:
|
483 |
-
msgid "
|
Â
|
|
Â
|
|
484 |
Â
msgstr ""
|
485 |
Â
|
486 |
-
#: includes/wcpdf-extensions.php:
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
487 |
Â
msgid ""
|
488 |
Â
"This extension conveniently uploads all the invoices (and other pdf "
|
489 |
Â
"documents from the professional extension) that are emailed to your "
|
@@ -491,50 +530,106 @@ msgid ""
|
|
491 |
Â
"date!"
|
492 |
Â
msgstr ""
|
493 |
Â
|
494 |
-
#: includes/wcpdf-extensions.php:
|
495 |
-
msgid "Get WooCommerce PDF Invoices & Packing Slips
|
496 |
Â
msgstr ""
|
497 |
Â
|
498 |
-
#: includes/wcpdf-extensions.php:
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
499 |
Â
msgid ""
|
500 |
-
"
|
501 |
-
"
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
502 |
Â
msgstr ""
|
503 |
Â
|
504 |
-
#: includes/wcpdf-extensions.php:
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
505 |
Â
msgid ""
|
506 |
-
"
|
507 |
-
"
|
508 |
Â
msgstr ""
|
509 |
Â
|
510 |
-
#: includes/wcpdf-extensions.php:
|
511 |
-
msgid "
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
512 |
Â
msgstr ""
|
513 |
Â
|
514 |
Â
#: includes/wcpdf-extensions.php:82
|
515 |
-
msgid "
|
516 |
Â
msgstr ""
|
517 |
Â
|
518 |
-
#: includes/wcpdf-extensions.php:
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
519 |
Â
msgid ""
|
520 |
-
"
|
521 |
-
"
|
522 |
Â
msgstr ""
|
523 |
Â
|
524 |
-
#: includes/wcpdf-extensions.php:
|
525 |
-
msgid "
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
526 |
Â
msgstr ""
|
527 |
Â
|
528 |
-
#: includes/wcpdf-extensions.php:
|
529 |
Â
#, php-format
|
530 |
Â
msgid "Check out the Premium PDF Invoice & Packing Slips templates at %s."
|
531 |
Â
msgstr ""
|
532 |
Â
|
533 |
-
#: includes/wcpdf-extensions.php:
|
534 |
Â
#, php-format
|
535 |
Â
msgid "For custom templates, contact us at %s."
|
536 |
Â
msgstr ""
|
537 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
538 |
Â
#: templates/pdf/Simple/invoice.php:29 templates/pdf/Simple/packing-slip.php:40
|
539 |
Â
msgid "Billing Address:"
|
540 |
Â
msgstr ""
|
@@ -607,48 +702,53 @@ msgid ""
|
|
607 |
Â
"installed & activated!"
|
608 |
Â
msgstr ""
|
609 |
Â
|
610 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
611 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
612 |
Â
msgid "N/A"
|
613 |
Â
msgstr ""
|
614 |
Â
|
615 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
616 |
Â
msgid "Payment method"
|
617 |
Â
msgstr ""
|
618 |
Â
|
619 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
620 |
Â
msgid "Shipping method"
|
621 |
Â
msgstr ""
|
622 |
Â
|
623 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
624 |
Â
#, php-format
|
625 |
Â
msgid "(Includes %s)"
|
626 |
Â
msgstr ""
|
627 |
Â
|
628 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
629 |
Â
msgid "Subtotal"
|
630 |
Â
msgstr ""
|
631 |
Â
|
632 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
633 |
Â
msgid "Shipping"
|
634 |
Â
msgstr ""
|
635 |
Â
|
636 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
637 |
Â
msgid "Discount"
|
638 |
Â
msgstr ""
|
639 |
Â
|
640 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
641 |
Â
msgid "VAT"
|
642 |
Â
msgstr ""
|
643 |
Â
|
644 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
645 |
Â
msgid "Tax rate"
|
646 |
Â
msgstr ""
|
647 |
Â
|
648 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
649 |
Â
msgid "Total ex. VAT"
|
650 |
Â
msgstr ""
|
651 |
Â
|
652 |
-
#: woocommerce-pdf-invoices-packingslips.php:
|
653 |
Â
msgid "Total"
|
654 |
Â
msgstr ""
|
2 |
Â
msgid ""
|
3 |
Â
msgstr ""
|
4 |
Â
"Project-Id-Version: WooCommerce PDF Invoices & Packing Slips\n"
|
5 |
+
"POT-Creation-Date: 2016-11-07 17:00+0100\n"
|
6 |
Â
"PO-Revision-Date: 2015-04-29 08:58+0100\n"
|
7 |
Â
"Last-Translator: \n"
|
8 |
Â
"Language-Team: WP Overnight <support@wpovernight.com>\n"
|
10 |
Â
"MIME-Version: 1.0\n"
|
11 |
Â
"Content-Type: text/plain; charset=UTF-8\n"
|
12 |
Â
"Content-Transfer-Encoding: 8bit\n"
|
13 |
+
"X-Generator: Poedit 1.8.9\n"
|
14 |
Â
"X-Poedit-Basepath: ..\n"
|
15 |
Â
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
16 |
Â
"X-Poedit-SourceCharset: UTF-8\n"
|
17 |
Â
"X-Poedit-KeywordsList: __;_e;_x;_n:1,2\n"
|
18 |
Â
"X-Poedit-SearchPath-0: .\n"
|
19 |
Â
|
20 |
+
#: includes/class-wcpdf-export.php:418 includes/class-wcpdf-export.php:432
|
21 |
+
#: includes/class-wcpdf-export.php:439 includes/class-wcpdf-export.php:447
|
22 |
Â
msgid "You do not have sufficient permissions to access this page."
|
23 |
Â
msgstr ""
|
24 |
Â
|
25 |
+
#: includes/class-wcpdf-export.php:423
|
26 |
Â
msgid "Some of the export parameters are missing."
|
27 |
Â
msgstr ""
|
28 |
Â
|
29 |
+
#: includes/class-wcpdf-export.php:504
|
30 |
Â
msgid "invoice"
|
31 |
Â
msgid_plural "invoices"
|
32 |
Â
msgstr[0] ""
|
33 |
Â
msgstr[1] ""
|
34 |
Â
|
35 |
+
#: includes/class-wcpdf-export.php:508
|
36 |
Â
msgid "packing-slip"
|
37 |
Â
msgid_plural "packing-slips"
|
38 |
Â
msgstr[0] ""
|
63 |
Â
msgid "WooCommerce PDF Invoices"
|
64 |
Â
msgstr ""
|
65 |
Â
|
66 |
+
#: includes/class-wcpdf-settings.php:199
|
67 |
Â
msgid "General settings"
|
68 |
Â
msgstr ""
|
69 |
Â
|
70 |
+
#: includes/class-wcpdf-settings.php:206
|
71 |
Â
msgid "How do you want to view the PDF?"
|
72 |
Â
msgstr ""
|
73 |
Â
|
74 |
+
#: includes/class-wcpdf-settings.php:214
|
75 |
Â
msgid "Download the PDF"
|
76 |
Â
msgstr ""
|
77 |
Â
|
78 |
+
#: includes/class-wcpdf-settings.php:215
|
79 |
Â
msgid "Open the PDF in a new browser tab/window"
|
80 |
Â
msgstr ""
|
81 |
Â
|
82 |
+
#: includes/class-wcpdf-settings.php:224
|
83 |
Â
msgid "Admin New Order email"
|
84 |
Â
msgstr ""
|
85 |
Â
|
86 |
+
#: includes/class-wcpdf-settings.php:225
|
87 |
Â
msgid "Customer Processing Order email"
|
88 |
Â
msgstr ""
|
89 |
Â
|
90 |
+
#: includes/class-wcpdf-settings.php:226
|
91 |
Â
msgid "Customer Completed Order email"
|
92 |
Â
msgstr ""
|
93 |
Â
|
94 |
+
#: includes/class-wcpdf-settings.php:227
|
95 |
Â
msgid "Customer Invoice email"
|
96 |
Â
msgstr ""
|
97 |
Â
|
98 |
+
#: includes/class-wcpdf-settings.php:236
|
99 |
Â
msgid "Attach invoice to:"
|
100 |
Â
msgstr ""
|
101 |
Â
|
102 |
+
#: includes/class-wcpdf-settings.php:244
|
103 |
Â
#, php-format
|
104 |
Â
msgid ""
|
105 |
Â
"It looks like the temp folder (<code>%s</code>) is not writable, check the "
|
107 |
Â
"plugin will not be able to email invoices."
|
108 |
Â
msgstr ""
|
109 |
Â
|
110 |
+
#: includes/class-wcpdf-settings.php:250
|
111 |
Â
msgid "Disable for free products"
|
112 |
Â
msgstr ""
|
113 |
Â
|
114 |
+
#: includes/class-wcpdf-settings.php:257
|
115 |
Â
msgid ""
|
116 |
Â
"Disable automatic creation/attachment of invoices when only free products "
|
117 |
Â
"are ordered"
|
118 |
Â
msgstr ""
|
119 |
Â
|
120 |
+
#: includes/class-wcpdf-settings.php:264
|
121 |
Â
msgid "Interface"
|
122 |
Â
msgstr ""
|
123 |
Â
|
124 |
+
#: includes/class-wcpdf-settings.php:312
|
125 |
Â
msgid "Allow My Account invoice download"
|
126 |
Â
msgstr ""
|
127 |
Â
|
128 |
+
#: includes/class-wcpdf-settings.php:320
|
129 |
Â
msgid "Only when an invoice is already created/emailed"
|
130 |
Â
msgstr ""
|
131 |
Â
|
132 |
+
#: includes/class-wcpdf-settings.php:321
|
133 |
Â
msgid "Only for specific order statuses (define below)"
|
134 |
Â
msgstr ""
|
135 |
Â
|
136 |
+
#: includes/class-wcpdf-settings.php:322
|
137 |
Â
msgid "Always"
|
138 |
Â
msgstr ""
|
139 |
Â
|
140 |
+
#: includes/class-wcpdf-settings.php:323
|
141 |
Â
msgid "Never"
|
142 |
Â
msgstr ""
|
143 |
Â
|
144 |
+
#: includes/class-wcpdf-settings.php:338
|
145 |
Â
msgid "Enable invoice number column in the orders list"
|
146 |
Â
msgstr ""
|
147 |
Â
|
148 |
+
#: includes/class-wcpdf-settings.php:376
|
149 |
Â
msgid "PDF Template settings"
|
150 |
Â
msgstr ""
|
151 |
Â
|
152 |
+
#: includes/class-wcpdf-settings.php:388
|
153 |
Â
msgid "Choose a template"
|
154 |
Â
msgstr ""
|
155 |
Â
|
156 |
+
#: includes/class-wcpdf-settings.php:396
|
157 |
Â
#, php-format
|
158 |
Â
msgid ""
|
159 |
Â
"Want to use your own template? Copy all the files from <code>%s</code> to "
|
160 |
Â
"your (child) theme in <code>%s</code> to customize them"
|
161 |
Â
msgstr ""
|
162 |
Â
|
163 |
+
#: includes/class-wcpdf-settings.php:402
|
164 |
Â
msgid "Paper size"
|
165 |
Â
msgstr ""
|
166 |
Â
|
167 |
+
#: includes/class-wcpdf-settings.php:410
|
168 |
Â
msgid "A4"
|
169 |
Â
msgstr ""
|
170 |
Â
|
171 |
+
#: includes/class-wcpdf-settings.php:411
|
172 |
Â
msgid "Letter"
|
173 |
Â
msgstr ""
|
174 |
Â
|
175 |
+
#: includes/class-wcpdf-settings.php:418
|
176 |
Â
msgid "Shop header/logo"
|
177 |
Â
msgstr ""
|
178 |
Â
|
179 |
+
#: includes/class-wcpdf-settings.php:425
|
180 |
Â
msgid "Select or upload your invoice header/logo"
|
181 |
Â
msgstr ""
|
182 |
Â
|
183 |
+
#: includes/class-wcpdf-settings.php:426
|
184 |
Â
msgid "Set image"
|
185 |
Â
msgstr ""
|
186 |
Â
|
187 |
+
#: includes/class-wcpdf-settings.php:427
|
188 |
Â
msgid "Remove image"
|
189 |
Â
msgstr ""
|
190 |
Â
|
191 |
+
#: includes/class-wcpdf-settings.php:434
|
192 |
Â
msgid "Shop Name"
|
193 |
Â
msgstr ""
|
194 |
Â
|
195 |
+
#: includes/class-wcpdf-settings.php:448
|
196 |
Â
msgid "Shop Address"
|
197 |
Â
msgstr ""
|
198 |
Â
|
199 |
+
#: includes/class-wcpdf-settings.php:464
|
200 |
Â
msgid "Footer: terms & conditions, policies, etc."
|
201 |
Â
msgstr ""
|
202 |
Â
|
203 |
+
#: includes/class-wcpdf-settings.php:481
|
204 |
+
#: includes/class-wcpdf-writepanels.php:286 templates/pdf/Simple/invoice.php:9
|
205 |
Â
#: templates/pdf/Simple/invoice.php:21
|
206 |
+
#: woocommerce-pdf-invoices-packingslips.php:226
|
207 |
Â
msgid "Invoice"
|
208 |
Â
msgstr ""
|
209 |
Â
|
210 |
+
#: includes/class-wcpdf-settings.php:488
|
211 |
Â
msgid "Display shipping address"
|
212 |
Â
msgstr ""
|
213 |
Â
|
214 |
+
#: includes/class-wcpdf-settings.php:495
|
215 |
Â
msgid ""
|
216 |
Â
"Display shipping address on invoice (in addition to the default billing "
|
217 |
Â
"address) if different from billing address"
|
218 |
Â
msgstr ""
|
219 |
Â
|
220 |
+
#: includes/class-wcpdf-settings.php:501 includes/class-wcpdf-settings.php:675
|
221 |
Â
msgid "Display email address"
|
222 |
Â
msgstr ""
|
223 |
Â
|
224 |
+
#: includes/class-wcpdf-settings.php:513 includes/class-wcpdf-settings.php:687
|
225 |
Â
msgid "Display phone number"
|
226 |
Â
msgstr ""
|
227 |
Â
|
228 |
+
#: includes/class-wcpdf-settings.php:525
|
229 |
Â
msgid "Display invoice date"
|
230 |
Â
msgstr ""
|
231 |
Â
|
232 |
+
#: includes/class-wcpdf-settings.php:537
|
233 |
+
msgid "Invoice numbers are created by a third-party extension."
|
234 |
Â
msgstr ""
|
235 |
Â
|
236 |
Â
#: includes/class-wcpdf-settings.php:540
|
237 |
+
#, php-format
|
238 |
+
msgid "Configure it <a href=\"%s\">here</a>."
|
239 |
+
msgstr ""
|
240 |
+
|
241 |
+
#: includes/class-wcpdf-settings.php:549
|
242 |
+
msgid "Display invoice number"
|
243 |
+
msgstr ""
|
244 |
+
|
245 |
+
#: includes/class-wcpdf-settings.php:549
|
246 |
+
msgid "Display built-in sequential invoice number"
|
247 |
+
msgstr ""
|
248 |
+
|
249 |
+
#: includes/class-wcpdf-settings.php:566
|
250 |
Â
msgid "Next invoice number (without prefix/suffix etc.)"
|
251 |
Â
msgstr ""
|
252 |
Â
|
253 |
+
#: includes/class-wcpdf-settings.php:574
|
254 |
Â
msgid ""
|
255 |
Â
"This is the number that will be used on the next invoice that is created. By "
|
256 |
Â
"default, numbering starts from the WooCommerce Order Number of the first "
|
259 |
Â
"this could create double invoice numbers!"
|
260 |
Â
msgstr ""
|
261 |
Â
|
262 |
+
#: includes/class-wcpdf-settings.php:598
|
263 |
Â
msgid "Invoice number format"
|
264 |
Â
msgstr ""
|
265 |
Â
|
266 |
+
#: includes/class-wcpdf-settings.php:607
|
267 |
Â
msgid "Prefix"
|
268 |
Â
msgstr ""
|
269 |
Â
|
270 |
+
#: includes/class-wcpdf-settings.php:609
|
271 |
Â
msgid ""
|
272 |
Â
"to use the invoice year and/or month, use [invoice_year] or [invoice_month] "
|
273 |
Â
"respectively"
|
274 |
Â
msgstr ""
|
275 |
Â
|
276 |
+
#: includes/class-wcpdf-settings.php:612
|
277 |
Â
msgid "Suffix"
|
278 |
Â
msgstr ""
|
279 |
Â
|
280 |
+
#: includes/class-wcpdf-settings.php:617
|
281 |
Â
msgid "Padding"
|
282 |
Â
msgstr ""
|
283 |
Â
|
284 |
+
#: includes/class-wcpdf-settings.php:619
|
285 |
Â
msgid "enter the number of digits here - enter \"6\" to display 42 as 000042"
|
286 |
Â
msgstr ""
|
287 |
Â
|
288 |
+
#: includes/class-wcpdf-settings.php:622
|
289 |
Â
msgid ""
|
290 |
Â
"note: if you have already created a custom invoice number format with a "
|
291 |
Â
"filter, the above settings will be ignored"
|
292 |
Â
msgstr ""
|
293 |
Â
|
294 |
+
#: includes/class-wcpdf-settings.php:628
|
295 |
Â
msgid "Reset invoice number yearly"
|
296 |
Â
msgstr ""
|
297 |
Â
|
298 |
+
#: includes/class-wcpdf-settings.php:641
|
299 |
+
msgid "Extended currency symbol support"
|
300 |
+
msgstr ""
|
301 |
+
|
302 |
+
#: includes/class-wcpdf-settings.php:648
|
303 |
+
msgid "Enable this if your currency symbol is not displaying properly"
|
304 |
+
msgstr ""
|
305 |
+
|
306 |
+
#: includes/class-wcpdf-settings.php:655
|
307 |
Â
#: templates/pdf/Simple/packing-slip.php:9
|
308 |
Â
#: templates/pdf/Simple/packing-slip.php:21
|
309 |
+
#: woocommerce-pdf-invoices-packingslips.php:229
|
310 |
Â
msgid "Packing Slip"
|
311 |
Â
msgstr ""
|
312 |
Â
|
313 |
+
#: includes/class-wcpdf-settings.php:662
|
314 |
Â
msgid "Display billing address"
|
315 |
Â
msgstr ""
|
316 |
Â
|
317 |
+
#: includes/class-wcpdf-settings.php:669
|
318 |
Â
msgid ""
|
319 |
Â
"Display billing address on packing slip (in addition to the default shipping "
|
320 |
Â
"address) if different from shipping address"
|
321 |
Â
msgstr ""
|
322 |
Â
|
323 |
+
#: includes/class-wcpdf-settings.php:700
|
324 |
Â
msgid "Extra template fields"
|
325 |
Â
msgstr ""
|
326 |
Â
|
327 |
+
#: includes/class-wcpdf-settings.php:707
|
328 |
Â
msgid "Extra field 1"
|
329 |
Â
msgstr ""
|
330 |
Â
|
331 |
+
#: includes/class-wcpdf-settings.php:716
|
332 |
Â
msgid "This is footer column 1 in the <i>Modern (Premium)</i> template"
|
333 |
Â
msgstr ""
|
334 |
Â
|
335 |
+
#: includes/class-wcpdf-settings.php:723
|
336 |
Â
msgid "Extra field 2"
|
337 |
Â
msgstr ""
|
338 |
Â
|
339 |
+
#: includes/class-wcpdf-settings.php:732
|
340 |
Â
msgid "This is footer column 2 in the <i>Modern (Premium)</i> template"
|
341 |
Â
msgstr ""
|
342 |
Â
|
343 |
+
#: includes/class-wcpdf-settings.php:739
|
344 |
Â
msgid "Extra field 3"
|
345 |
Â
msgstr ""
|
346 |
Â
|
347 |
+
#: includes/class-wcpdf-settings.php:748
|
348 |
Â
msgid "This is footer column 3 in the <i>Modern (Premium)</i> template"
|
349 |
Â
msgstr ""
|
350 |
Â
|
351 |
+
#: includes/class-wcpdf-settings.php:770
|
352 |
Â
msgid "Debug settings"
|
353 |
Â
msgstr ""
|
354 |
Â
|
355 |
+
#: includes/class-wcpdf-settings.php:777
|
356 |
Â
msgid "Enable debug output"
|
357 |
Â
msgstr ""
|
358 |
Â
|
359 |
+
#: includes/class-wcpdf-settings.php:784
|
360 |
Â
msgid ""
|
361 |
Â
"Enable this option to output plugin errors if you're getting a blank page or "
|
362 |
Â
"other PDF generation issues"
|
363 |
Â
msgstr ""
|
364 |
Â
|
365 |
+
#: includes/class-wcpdf-settings.php:790
|
366 |
Â
msgid "Output to HTML"
|
367 |
Â
msgstr ""
|
368 |
Â
|
369 |
+
#: includes/class-wcpdf-settings.php:797
|
370 |
Â
msgid ""
|
371 |
Â
"Send the template output as HTML to the browser instead of creating a PDF."
|
372 |
Â
msgstr ""
|
373 |
Â
|
374 |
+
#: includes/class-wcpdf-settings.php:803
|
375 |
Â
msgid "Use old tmp folder"
|
376 |
Â
msgstr ""
|
377 |
Â
|
378 |
+
#: includes/class-wcpdf-settings.php:810
|
379 |
Â
msgid ""
|
380 |
Â
"Before version 1.5 of PDF Invoices, temporary files were stored in the "
|
381 |
Â
"plugin folder. This setting is only intended for backwards compatibility, "
|
382 |
Â
"not recommended on new installs!"
|
383 |
Â
msgstr ""
|
384 |
Â
|
385 |
+
#: includes/class-wcpdf-settings.php:1225
|
386 |
Â
msgid "Image resolution"
|
387 |
Â
msgstr ""
|
388 |
Â
|
389 |
+
#: includes/class-wcpdf-settings.php:1341
|
390 |
Â
msgid ""
|
391 |
Â
"<b>Warning!</b> The settings below are meant for debugging/development only. "
|
392 |
Â
"Do not use them on a live website!"
|
393 |
Â
msgstr ""
|
394 |
Â
|
395 |
+
#: includes/class-wcpdf-settings.php:1350
|
396 |
Â
msgid ""
|
397 |
Â
"These are used for the (optional) footer columns in the <em>Modern "
|
398 |
Â
"(Premium)</em> template, but can also be used for other elements in your "
|
403 |
Â
msgid "PDF Packing Slips"
|
404 |
Â
msgstr ""
|
405 |
Â
|
406 |
+
#: includes/class-wcpdf-writepanels.php:120
|
407 |
+
#: includes/class-wcpdf-writepanels.php:253
|
408 |
Â
msgid "PDF Invoice"
|
409 |
Â
msgstr ""
|
410 |
Â
|
411 |
+
#: includes/class-wcpdf-writepanels.php:125
|
412 |
+
#: includes/class-wcpdf-writepanels.php:258
|
413 |
Â
msgid "PDF Packing Slip"
|
414 |
Â
msgstr ""
|
415 |
Â
|
416 |
+
#: includes/class-wcpdf-writepanels.php:152
|
417 |
Â
msgid "Invoice Number"
|
418 |
Â
msgstr ""
|
419 |
Â
|
420 |
+
#: includes/class-wcpdf-writepanels.php:211
|
421 |
Â
msgid "Download invoice (PDF)"
|
422 |
Â
msgstr ""
|
423 |
Â
|
424 |
+
#: includes/class-wcpdf-writepanels.php:225
|
425 |
Â
msgid "Create PDF"
|
426 |
Â
msgstr ""
|
427 |
Â
|
428 |
+
#: includes/class-wcpdf-writepanels.php:235
|
429 |
Â
msgid "PDF Invoice data"
|
430 |
Â
msgstr ""
|
431 |
Â
|
432 |
+
#: includes/class-wcpdf-writepanels.php:288
|
433 |
Â
msgid "Invoice Number (unformatted!)"
|
434 |
Â
msgstr ""
|
435 |
Â
|
436 |
+
#: includes/class-wcpdf-writepanels.php:296 templates/pdf/Simple/invoice.php:55
|
437 |
Â
msgid "Invoice Date:"
|
438 |
Â
msgstr ""
|
439 |
Â
|
440 |
+
#: includes/class-wcpdf-writepanels.php:298
|
441 |
+
#: includes/class-wcpdf-writepanels.php:300
|
442 |
Â
msgid "h"
|
443 |
Â
msgstr ""
|
444 |
Â
|
445 |
+
#: includes/class-wcpdf-writepanels.php:298
|
446 |
+
#: includes/class-wcpdf-writepanels.php:300
|
447 |
Â
msgid "m"
|
448 |
Â
msgstr ""
|
449 |
Â
|
455 |
Â
msgid "click items to read more"
|
456 |
Â
msgstr ""
|
457 |
Â
|
458 |
+
#: includes/wcpdf-extensions.php:21
|
459 |
+
msgid ""
|
460 |
+
"Premium PDF Invoice bundle: Everything you need for a perfect invoicing "
|
461 |
+
"system"
|
462 |
Â
msgstr ""
|
463 |
Â
|
464 |
+
#: includes/wcpdf-extensions.php:23
|
465 |
Â
msgid ""
|
466 |
+
"Supercharge WooCommerce PDF Invoices & Packing Slips with the all our "
|
467 |
+
"premium extensions:"
|
468 |
Â
msgstr ""
|
469 |
Â
|
470 |
+
#: includes/wcpdf-extensions.php:24
|
471 |
+
msgid "Professional features:"
|
472 |
+
msgstr ""
|
473 |
+
|
474 |
+
#: includes/wcpdf-extensions.php:26 includes/wcpdf-extensions.php:56
|
475 |
Â
msgid "Email/print/download <b>PDF Credit Notes & Proforma invoices</b>"
|
476 |
Â
msgstr ""
|
477 |
Â
|
478 |
+
#: includes/wcpdf-extensions.php:27 includes/wcpdf-extensions.php:57
|
479 |
Â
msgid ""
|
480 |
Â
"Send out a separate <b>notification email</b> with (or without) PDF invoices/"
|
481 |
Â
"packing slips, for example to a drop-shipper or a supplier."
|
482 |
Â
msgstr ""
|
483 |
Â
|
484 |
+
#: includes/wcpdf-extensions.php:28 includes/wcpdf-extensions.php:58
|
485 |
Â
msgid ""
|
486 |
Â
"Attach <b>up to 3 static files</b> (for example a terms & conditions "
|
487 |
Â
"document) to the WooCommerce emails of your choice."
|
488 |
Â
msgstr ""
|
489 |
Â
|
490 |
+
#: includes/wcpdf-extensions.php:29 includes/wcpdf-extensions.php:59
|
491 |
Â
msgid ""
|
492 |
Â
"Use <b>separate numbering systems</b> and/or format for proforma invoices "
|
493 |
Â
"and credit notes or utilize the main invoice numbering system"
|
494 |
Â
msgstr ""
|
495 |
Â
|
496 |
+
#: includes/wcpdf-extensions.php:30 includes/wcpdf-extensions.php:60
|
497 |
Â
msgid ""
|
498 |
Â
"<b>Customize</b> the <b>shipping & billing address</b> format to include "
|
499 |
Â
"additional custom fields, font sizes etc. without the need to create a "
|
500 |
Â
"custom template."
|
501 |
Â
msgstr ""
|
502 |
Â
|
503 |
+
#: includes/wcpdf-extensions.php:31 includes/wcpdf-extensions.php:61
|
504 |
Â
msgid "Use the plugin in multilingual <b>WPML</b> setups"
|
505 |
Â
msgstr ""
|
506 |
Â
|
507 |
+
#: includes/wcpdf-extensions.php:33 includes/wcpdf-extensions.php:131
|
508 |
+
msgid "Advanced, customizable templates"
|
509 |
Â
msgstr ""
|
510 |
Â
|
511 |
+
#: includes/wcpdf-extensions.php:35 includes/wcpdf-extensions.php:134
|
512 |
+
msgid ""
|
513 |
+
"Completely customize the invoice contents (prices, taxes, thumbnails) to "
|
514 |
+
"your needs with a drag & drop customizer"
|
515 |
Â
msgstr ""
|
516 |
Â
|
517 |
+
#: includes/wcpdf-extensions.php:36 includes/wcpdf-extensions.php:135
|
518 |
+
msgid "Two extra stylish premade templates (Modern & Business)"
|
519 |
+
msgstr ""
|
520 |
+
|
521 |
+
#: includes/wcpdf-extensions.php:38
|
522 |
+
msgid "Upload automatically to dropbox"
|
523 |
+
msgstr ""
|
524 |
+
|
525 |
+
#: includes/wcpdf-extensions.php:40 includes/wcpdf-extensions.php:97
|
526 |
Â
msgid ""
|
527 |
Â
"This extension conveniently uploads all the invoices (and other pdf "
|
528 |
Â
"documents from the professional extension) that are emailed to your "
|
530 |
Â
"date!"
|
531 |
Â
msgstr ""
|
532 |
Â
|
533 |
+
#: includes/wcpdf-extensions.php:43
|
534 |
+
msgid "Get WooCommerce PDF Invoices & Packing Slips Bundle"
|
535 |
Â
msgstr ""
|
536 |
Â
|
537 |
+
#: includes/wcpdf-extensions.php:52
|
538 |
+
msgid "Go Pro: Proforma invoices, credit notes (=refunds) & more!"
|
539 |
+
msgstr ""
|
540 |
+
|
541 |
+
#: includes/wcpdf-extensions.php:54
|
542 |
Â
msgid ""
|
543 |
+
"Supercharge WooCommerce PDF Invoices & Packing Slips with the following "
|
544 |
+
"features:"
|
545 |
+
msgstr ""
|
546 |
+
|
547 |
+
#: includes/wcpdf-extensions.php:63
|
548 |
+
msgid "Get WooCommerce PDF Invoices & Packing Slips Professional!"
|
549 |
+
msgstr ""
|
550 |
+
|
551 |
+
#: includes/wcpdf-extensions.php:71
|
552 |
+
msgid "Automatically send payment reminders to your customers"
|
553 |
Â
msgstr ""
|
554 |
Â
|
555 |
+
#: includes/wcpdf-extensions.php:73
|
556 |
+
msgid "WooCommerce Smart Reminder emails"
|
557 |
+
msgstr ""
|
558 |
+
|
559 |
+
#: includes/wcpdf-extensions.php:75
|
560 |
+
msgid "<b>Completely automatic</b> scheduled emails"
|
561 |
+
msgstr ""
|
562 |
+
|
563 |
+
#: includes/wcpdf-extensions.php:76
|
564 |
Â
msgid ""
|
565 |
+
"<b>Rich text editor</b> for the email text, including placeholders for data "
|
566 |
+
"from the order (name, order total, etc)"
|
567 |
Â
msgstr ""
|
568 |
Â
|
569 |
+
#: includes/wcpdf-extensions.php:77
|
570 |
+
msgid ""
|
571 |
+
"Configure the exact requirements for sending an email (time after order, "
|
572 |
+
"order status, payment method)"
|
573 |
+
msgstr ""
|
574 |
+
|
575 |
+
#: includes/wcpdf-extensions.php:78
|
576 |
+
msgid ""
|
577 |
+
"Fully <b>WPML Compatible</b> – emails will be automatically sent in the "
|
578 |
+
"order language."
|
579 |
+
msgstr ""
|
580 |
+
|
581 |
+
#: includes/wcpdf-extensions.php:79
|
582 |
+
msgid ""
|
583 |
+
"<b>Super versatile!</b> Can be used for any kind of reminder email (review "
|
584 |
+
"reminders, repeat purchases)"
|
585 |
+
msgstr ""
|
586 |
+
|
587 |
+
#: includes/wcpdf-extensions.php:80
|
588 |
+
msgid "Integrates seamlessly with the PDF Invoices & Packing Slips plugin"
|
589 |
Â
msgstr ""
|
590 |
Â
|
591 |
Â
#: includes/wcpdf-extensions.php:82
|
592 |
+
msgid "Get WooCommerce Smart Reminder Emails"
|
593 |
Â
msgstr ""
|
594 |
Â
|
595 |
+
#: includes/wcpdf-extensions.php:91
|
596 |
+
msgid "Upload all invoices automatically to your dropbox"
|
597 |
+
msgstr ""
|
598 |
+
|
599 |
+
#: includes/wcpdf-extensions.php:98
|
600 |
+
msgid "Get WooCommerce PDF Invoices & Packing Slips to dropbox!"
|
601 |
+
msgstr ""
|
602 |
+
|
603 |
+
#: includes/wcpdf-extensions.php:110
|
604 |
Â
msgid ""
|
605 |
+
"Automatically send new orders or packing slips to your printer, as soon as "
|
606 |
+
"the customer orders!"
|
607 |
Â
msgstr ""
|
608 |
Â
|
609 |
+
#: includes/wcpdf-extensions.php:116
|
610 |
+
msgid ""
|
611 |
+
"Check out the WooCommerce Automatic Order Printing extension from our "
|
612 |
+
"partners at Simba Hosting"
|
613 |
+
msgstr ""
|
614 |
+
|
615 |
+
#: includes/wcpdf-extensions.php:117
|
616 |
+
msgid "WooCommerce Automatic Order Printing"
|
617 |
Â
msgstr ""
|
618 |
Â
|
619 |
+
#: includes/wcpdf-extensions.php:136
|
620 |
Â
#, php-format
|
621 |
Â
msgid "Check out the Premium PDF Invoice & Packing Slips templates at %s."
|
622 |
Â
msgstr ""
|
623 |
Â
|
624 |
+
#: includes/wcpdf-extensions.php:137
|
625 |
Â
#, php-format
|
626 |
Â
msgid "For custom templates, contact us at %s."
|
627 |
Â
msgstr ""
|
628 |
Â
|
629 |
+
#: includes/wcpdf-extensions.php:146
|
630 |
+
msgid "Hide this message"
|
631 |
+
msgstr ""
|
632 |
+
|
633 |
Â
#: templates/pdf/Simple/invoice.php:29 templates/pdf/Simple/packing-slip.php:40
|
634 |
Â
msgid "Billing Address:"
|
635 |
Â
msgstr ""
|
702 |
Â
"installed & activated!"
|
703 |
Â
msgstr ""
|
704 |
Â
|
705 |
+
#: woocommerce-pdf-invoices-packingslips.php:377
|
706 |
+
#: woocommerce-pdf-invoices-packingslips.php:438
|
707 |
Â
msgid "N/A"
|
708 |
Â
msgstr ""
|
709 |
Â
|
710 |
+
#: woocommerce-pdf-invoices-packingslips.php:533
|
711 |
Â
msgid "Payment method"
|
712 |
Â
msgstr ""
|
713 |
Â
|
714 |
+
#: woocommerce-pdf-invoices-packingslips.php:552
|
715 |
Â
msgid "Shipping method"
|
716 |
Â
msgstr ""
|
717 |
Â
|
718 |
+
#: woocommerce-pdf-invoices-packingslips.php:712
|
719 |
+
#, php-format
|
720 |
+
msgid "(includes %s)"
|
721 |
+
msgstr ""
|
722 |
+
|
723 |
+
#: woocommerce-pdf-invoices-packingslips.php:715
|
724 |
Â
#, php-format
|
725 |
Â
msgid "(Includes %s)"
|
726 |
Â
msgstr ""
|
727 |
Â
|
728 |
+
#: woocommerce-pdf-invoices-packingslips.php:744
|
729 |
Â
msgid "Subtotal"
|
730 |
Â
msgstr ""
|
731 |
Â
|
732 |
+
#: woocommerce-pdf-invoices-packingslips.php:766
|
733 |
Â
msgid "Shipping"
|
734 |
Â
msgstr ""
|
735 |
Â
|
736 |
+
#: woocommerce-pdf-invoices-packingslips.php:829
|
737 |
Â
msgid "Discount"
|
738 |
Â
msgstr ""
|
739 |
Â
|
740 |
+
#: woocommerce-pdf-invoices-packingslips.php:870
|
741 |
Â
msgid "VAT"
|
742 |
Â
msgstr ""
|
743 |
Â
|
744 |
+
#: woocommerce-pdf-invoices-packingslips.php:871
|
745 |
Â
msgid "Tax rate"
|
746 |
Â
msgstr ""
|
747 |
Â
|
748 |
+
#: woocommerce-pdf-invoices-packingslips.php:908
|
749 |
Â
msgid "Total ex. VAT"
|
750 |
Â
msgstr ""
|
751 |
Â
|
752 |
+
#: woocommerce-pdf-invoices-packingslips.php:911
|
753 |
Â
msgid "Total"
|
754 |
Â
msgstr ""
|
lib/dompdf/dompdf.php
CHANGED
@@ -1,289 +1,289 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Command line utility to use dompdf.
|
4 |
-
* Can also be used with HTTP GET parameters
|
5 |
-
*
|
6 |
-
* @package dompdf
|
7 |
-
* @link http://dompdf.github.com/
|
8 |
-
* @author Benj Carson <benjcarson@digitaljunkies.ca>
|
9 |
-
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
10 |
-
*/
|
11 |
-
|
12 |
-
/**
|
13 |
-
* Display command line usage
|
14 |
-
*/
|
15 |
-
function dompdf_usage() {
|
16 |
-
$default_paper_size = DOMPDF_DEFAULT_PAPER_SIZE;
|
17 |
-
|
18 |
-
echo <<<EOD
|
19 |
-
|
20 |
-
Usage: {$_SERVER["argv"][0]} [options] html_file
|
21 |
-
|
22 |
-
html_file can be a filename, a url if fopen_wrappers are enabled, or the '-' character to read from standard input.
|
23 |
-
|
24 |
-
Options:
|
25 |
-
-h Show this message
|
26 |
-
-l List available paper sizes
|
27 |
-
-p size Paper size; something like 'letter', 'A4', 'legal', etc.
|
28 |
-
The default is '$default_paper_size'
|
29 |
-
-o orientation Either 'portrait' or 'landscape'. Default is 'portrait'
|
30 |
-
-b path Set the 'document root' of the html_file.
|
31 |
-
Relative urls (for stylesheets) are resolved using this directory.
|
32 |
-
Default is the directory of html_file.
|
33 |
-
-f file The output filename. Default is the input [html_file].pdf
|
34 |
-
-v Verbose: display html parsing warnings and file not found errors.
|
35 |
-
-d Very verbose: display oodles of debugging output: every frame
|
36 |
-
in the tree printed to stdout.
|
37 |
-
-t Comma separated list of debugging types (page-break,reflow,split)
|
38 |
-
|
39 |
-
EOD;
|
40 |
-
exit;
|
41 |
-
}
|
42 |
-
|
43 |
-
/**
|
44 |
-
* Parses command line options
|
45 |
-
*
|
46 |
-
* @return array The command line options
|
47 |
-
*/
|
48 |
-
function getoptions() {
|
49 |
-
|
50 |
-
$opts = array();
|
51 |
-
|
52 |
-
if ( $_SERVER["argc"] == 1 )
|
53 |
-
return $opts;
|
54 |
-
|
55 |
-
$i = 1;
|
56 |
-
while ($i < $_SERVER["argc"]) {
|
57 |
-
|
58 |
-
switch ($_SERVER["argv"][$i]) {
|
59 |
-
|
60 |
-
case "--help":
|
61 |
-
case "-h":
|
62 |
-
$opts["h"] = true;
|
63 |
-
$i++;
|
64 |
-
break;
|
65 |
-
|
66 |
-
case "-l":
|
67 |
-
$opts["l"] = true;
|
68 |
-
$i++;
|
69 |
-
break;
|
70 |
-
|
71 |
-
case "-p":
|
72 |
-
if ( !isset($_SERVER["argv"][$i+1]) )
|
73 |
-
die("-p switch requires a size parameter\n");
|
74 |
-
$opts["p"] = $_SERVER["argv"][$i+1];
|
75 |
-
$i += 2;
|
76 |
-
break;
|
77 |
-
|
78 |
-
case "-o":
|
79 |
-
if ( !isset($_SERVER["argv"][$i+1]) )
|
80 |
-
die("-o switch requires an orientation parameter\n");
|
81 |
-
$opts["o"] = $_SERVER["argv"][$i+1];
|
82 |
-
$i += 2;
|
83 |
-
break;
|
84 |
-
|
85 |
-
case "-b":
|
86 |
-
if ( !isset($_SERVER["argv"][$i+1]) )
|
87 |
-
die("-b switch requires a path parameter\n");
|
88 |
-
$opts["b"] = $_SERVER["argv"][$i+1];
|
89 |
-
$i += 2;
|
90 |
-
break;
|
91 |
-
|
92 |
-
case "-f":
|
93 |
-
if ( !isset($_SERVER["argv"][$i+1]) )
|
94 |
-
die("-f switch requires a filename parameter\n");
|
95 |
-
$opts["f"] = $_SERVER["argv"][$i+1];
|
96 |
-
$i += 2;
|
97 |
-
break;
|
98 |
-
|
99 |
-
case "-v":
|
100 |
-
$opts["v"] = true;
|
101 |
-
$i++;
|
102 |
-
break;
|
103 |
-
|
104 |
-
case "-d":
|
105 |
-
$opts["d"] = true;
|
106 |
-
$i++;
|
107 |
-
break;
|
108 |
-
|
109 |
-
case "-t":
|
110 |
-
if ( !isset($_SERVER['argv'][$i + 1]) )
|
111 |
-
die("-t switch requires a comma separated list of types\n");
|
112 |
-
$opts["t"] = $_SERVER['argv'][$i+1];
|
113 |
-
$i += 2;
|
114 |
-
break;
|
115 |
-
|
116 |
-
default:
|
117 |
-
$opts["filename"] = $_SERVER["argv"][$i];
|
118 |
-
$i++;
|
119 |
-
break;
|
120 |
-
}
|
121 |
-
|
122 |
-
}
|
123 |
-
return $opts;
|
124 |
-
}
|
125 |
-
|
126 |
-
require_once("dompdf_config.inc.php");
|
127 |
-
global $_dompdf_show_warnings, $_dompdf_debug, $_DOMPDF_DEBUG_TYPES;
|
128 |
-
|
129 |
-
$sapi = php_sapi_name();
|
130 |
-
$options = array();
|
131 |
-
|
132 |
-
switch ( $sapi ) {
|
133 |
-
|
134 |
-
case "cli":
|
135 |
-
|
136 |
-
$opts = getoptions();
|
137 |
-
|
138 |
-
if ( isset($opts["h"]) || (!isset($opts["filename"]) && !isset($opts["l"])) ) {
|
139 |
-
dompdf_usage();
|
140 |
-
exit;
|
141 |
-
}
|
142 |
-
|
143 |
-
if ( isset($opts["l"]) ) {
|
144 |
-
echo "\nUnderstood paper sizes:\n";
|
145 |
-
|
146 |
-
foreach (array_keys(CPDF_Adapter::$PAPER_SIZES) as $size)
|
147 |
-
echo " " . mb_strtoupper($size) . "\n";
|
148 |
-
exit;
|
149 |
-
}
|
150 |
-
$file = $opts["filename"];
|
151 |
-
|
152 |
-
if ( isset($opts["p"]) )
|
153 |
-
$paper = $opts["p"];
|
154 |
-
else
|
155 |
-
$paper = DOMPDF_DEFAULT_PAPER_SIZE;
|
156 |
-
|
157 |
-
if ( isset($opts["o"]) )
|
158 |
-
$orientation = $opts["o"];
|
159 |
-
else
|
160 |
-
$orientation = "portrait";
|
161 |
-
|
162 |
-
if ( isset($opts["b"]) )
|
163 |
-
$base_path = $opts["b"];
|
164 |
-
|
165 |
-
if ( isset($opts["f"]) )
|
166 |
-
$outfile = $opts["f"];
|
167 |
-
else {
|
168 |
-
if ( $file === "-" )
|
169 |
-
$outfile = "dompdf_out.pdf";
|
170 |
-
else
|
171 |
-
$outfile = str_ireplace(array(".html", ".htm", ".php"), "", $file) . ".pdf";
|
172 |
-
}
|
173 |
-
|
174 |
-
if ( isset($opts["v"]) )
|
175 |
-
$_dompdf_show_warnings = true;
|
176 |
-
|
177 |
-
if ( isset($opts["d"]) ) {
|
178 |
-
$_dompdf_show_warnings = true;
|
179 |
-
$_dompdf_debug = true;
|
180 |
-
}
|
181 |
-
|
182 |
-
if ( isset($opts['t']) ) {
|
183 |
-
$arr = explode(',',$opts['t']);
|
184 |
-
$types = array();
|
185 |
-
foreach ($arr as $type)
|
186 |
-
$types[ trim($type) ] = 1;
|
187 |
-
$_DOMPDF_DEBUG_TYPES = $types;
|
188 |
-
}
|
189 |
-
|
190 |
-
$save_file = true;
|
191 |
-
|
192 |
-
break;
|
193 |
-
|
194 |
-
default:
|
195 |
-
|
196 |
-
if ( isset($_GET["input_file"]) )
|
197 |
-
$file = rawurldecode($_GET["input_file"]);
|
198 |
-
else
|
199 |
-
throw new DOMPDF_Exception("An input file is required (i.e. input_file _GET variable).");
|
200 |
-
|
201 |
-
if ( isset($_GET["paper"]) )
|
202 |
-
$paper = rawurldecode($_GET["paper"]);
|
203 |
-
else
|
204 |
-
$paper = DOMPDF_DEFAULT_PAPER_SIZE;
|
205 |
-
|
206 |
-
if ( isset($_GET["orientation"]) )
|
207 |
-
$orientation = rawurldecode($_GET["orientation"]);
|
208 |
-
else
|
209 |
-
$orientation = "portrait";
|
210 |
-
|
211 |
-
if ( isset($_GET["base_path"]) ) {
|
212 |
-
$base_path = rawurldecode($_GET["base_path"]);
|
213 |
-
$file = $base_path . $file; # Set the input file
|
214 |
-
}
|
215 |
-
|
216 |
-
if ( isset($_GET["options"]) ) {
|
217 |
-
$options = $_GET["options"];
|
218 |
-
}
|
219 |
-
|
220 |
-
$file_parts = explode_url($file);
|
221 |
-
|
222 |
-
/* Check to see if the input file is local and, if so, that the base path falls within that specified by DOMDPF_CHROOT */
|
223 |
-
if(($file_parts['protocol'] == '' || $file_parts['protocol'] === 'file://')) {
|
224 |
-
$file = realpath($file);
|
225 |
-
if ( strpos($file, DOMPDF_CHROOT) !== 0 ) {
|
226 |
-
throw new DOMPDF_Exception("Permission denied on $file. The file could not be found under the directory specified by DOMPDF_CHROOT.");
|
227 |
-
}
|
228 |
-
}
|
229 |
-
|
230 |
-
if($file_parts['protocol'] === 'php://') {
|
231 |
-
throw new DOMPDF_Exception("Permission denied on $file. This script does not allow PHP streams.");
|
232 |
-
}
|
233 |
-
|
234 |
-
$outfile = "dompdf_out.pdf"; # Don't allow them to set the output file
|
235 |
-
$save_file = false; # Don't save the file
|
236 |
-
|
237 |
-
break;
|
238 |
-
}
|
239 |
-
|
240 |
-
$dompdf = new DOMPDF();
|
241 |
-
|
242 |
-
if ( $file === "-" ) {
|
243 |
-
$str = "";
|
244 |
-
while ( !feof(STDIN) )
|
245 |
-
$str .= fread(STDIN, 4096);
|
246 |
-
|
247 |
-
$dompdf->load_html($str);
|
248 |
-
|
249 |
-
} else
|
250 |
-
$dompdf->load_html_file($file);
|
251 |
-
|
252 |
-
if ( isset($base_path) ) {
|
253 |
-
$dompdf->set_base_path($base_path);
|
254 |
-
}
|
255 |
-
|
256 |
-
$dompdf->set_paper($paper, $orientation);
|
257 |
-
|
258 |
-
$dompdf->render();
|
259 |
-
|
260 |
-
if ( $_dompdf_show_warnings ) {
|
261 |
-
global $_dompdf_warnings;
|
262 |
-
foreach ($_dompdf_warnings as $msg)
|
263 |
-
echo $msg . "\n";
|
264 |
-
echo $dompdf->get_canvas()->get_cpdf()->messages;
|
265 |
-
flush();
|
266 |
-
}
|
267 |
-
|
268 |
-
if ( $save_file ) {
|
269 |
-
// if ( !is_writable($outfile) )
|
270 |
-
// throw new DOMPDF_Exception("'$outfile' is not writable.");
|
271 |
-
if ( strtolower(DOMPDF_PDF_BACKEND) === "gd" )
|
272 |
-
$outfile = str_replace(".pdf", ".png", $outfile);
|
273 |
-
|
274 |
-
list($proto, $host, $path, $file) = explode_url($outfile);
|
275 |
-
if ( $proto != "" ) // i.e. not file://
|
276 |
-
$outfile = $file; // just save it locally, FIXME? could save it like wget: ./host/basepath/file
|
277 |
-
|
278 |
-
$outfile = realpath(dirname($outfile)) . DIRECTORY_SEPARATOR . basename($outfile);
|
279 |
-
|
280 |
-
if ( strpos($outfile, DOMPDF_CHROOT) !== 0 )
|
281 |
-
throw new DOMPDF_Exception("Permission denied.");
|
282 |
-
|
283 |
-
file_put_contents($outfile, $dompdf->output( array("compress" => 0) ));
|
284 |
-
exit(0);
|
285 |
-
}
|
286 |
-
|
287 |
-
if ( !headers_sent() ) {
|
288 |
-
$dompdf->stream($outfile, $options);
|
289 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Command line utility to use dompdf.
|
4 |
+
* Can also be used with HTTP GET parameters
|
5 |
+
*
|
6 |
+
* @package dompdf
|
7 |
+
* @link http://dompdf.github.com/
|
8 |
+
* @author Benj Carson <benjcarson@digitaljunkies.ca>
|
9 |
+
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
10 |
+
*/
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Display command line usage
|
14 |
+
*/
|
15 |
+
function dompdf_usage() {
|
16 |
+
$default_paper_size = DOMPDF_DEFAULT_PAPER_SIZE;
|
17 |
+
|
18 |
+
echo <<<EOD
|
19 |
+
|
20 |
+
Usage: {$_SERVER["argv"][0]} [options] html_file
|
21 |
+
|
22 |
+
html_file can be a filename, a url if fopen_wrappers are enabled, or the '-' character to read from standard input.
|
23 |
+
|
24 |
+
Options:
|
25 |
+
-h Show this message
|
26 |
+
-l List available paper sizes
|
27 |
+
-p size Paper size; something like 'letter', 'A4', 'legal', etc.
|
28 |
+
The default is '$default_paper_size'
|
29 |
+
-o orientation Either 'portrait' or 'landscape'. Default is 'portrait'
|
30 |
+
-b path Set the 'document root' of the html_file.
|
31 |
+
Relative urls (for stylesheets) are resolved using this directory.
|
32 |
+
Default is the directory of html_file.
|
33 |
+
-f file The output filename. Default is the input [html_file].pdf
|
34 |
+
-v Verbose: display html parsing warnings and file not found errors.
|
35 |
+
-d Very verbose: display oodles of debugging output: every frame
|
36 |
+
in the tree printed to stdout.
|
37 |
+
-t Comma separated list of debugging types (page-break,reflow,split)
|
38 |
+
|
39 |
+
EOD;
|
40 |
+
exit;
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Parses command line options
|
45 |
+
*
|
46 |
+
* @return array The command line options
|
47 |
+
*/
|
48 |
+
function getoptions() {
|
49 |
+
|
50 |
+
$opts = array();
|
51 |
+
|
52 |
+
if ( $_SERVER["argc"] == 1 )
|
53 |
+
return $opts;
|
54 |
+
|
55 |
+
$i = 1;
|
56 |
+
while ($i < $_SERVER["argc"]) {
|
57 |
+
|
58 |
+
switch ($_SERVER["argv"][$i]) {
|
59 |
+
|
60 |
+
case "--help":
|
61 |
+
case "-h":
|
62 |
+
$opts["h"] = true;
|
63 |
+
$i++;
|
64 |
+
break;
|
65 |
+
|
66 |
+
case "-l":
|
67 |
+
$opts["l"] = true;
|
68 |
+
$i++;
|
69 |
+
break;
|
70 |
+
|
71 |
+
case "-p":
|
72 |
+
if ( !isset($_SERVER["argv"][$i+1]) )
|
73 |
+
die("-p switch requires a size parameter\n");
|
74 |
+
$opts["p"] = $_SERVER["argv"][$i+1];
|
75 |
+
$i += 2;
|
76 |
+
break;
|
77 |
+
|
78 |
+
case "-o":
|
79 |
+
if ( !isset($_SERVER["argv"][$i+1]) )
|
80 |
+
die("-o switch requires an orientation parameter\n");
|
81 |
+
$opts["o"] = $_SERVER["argv"][$i+1];
|
82 |
+
$i += 2;
|
83 |
+
break;
|
84 |
+
|
85 |
+
case "-b":
|
86 |
+
if ( !isset($_SERVER["argv"][$i+1]) )
|
87 |
+
die("-b switch requires a path parameter\n");
|
88 |
+
$opts["b"] = $_SERVER["argv"][$i+1];
|
89 |
+
$i += 2;
|
90 |
+
break;
|
91 |
+
|
92 |
+
case "-f":
|
93 |
+
if ( !isset($_SERVER["argv"][$i+1]) )
|
94 |
+
die("-f switch requires a filename parameter\n");
|
95 |
+
$opts["f"] = $_SERVER["argv"][$i+1];
|
96 |
+
$i += 2;
|
97 |
+
break;
|
98 |
+
|
99 |
+
case "-v":
|
100 |
+
$opts["v"] = true;
|
101 |
+
$i++;
|
102 |
+
break;
|
103 |
+
|
104 |
+
case "-d":
|
105 |
+
$opts["d"] = true;
|
106 |
+
$i++;
|
107 |
+
break;
|
108 |
+
|
109 |
+
case "-t":
|
110 |
+
if ( !isset($_SERVER['argv'][$i + 1]) )
|
111 |
+
die("-t switch requires a comma separated list of types\n");
|
112 |
+
$opts["t"] = $_SERVER['argv'][$i+1];
|
113 |
+
$i += 2;
|
114 |
+
break;
|
115 |
+
|
116 |
+
default:
|
117 |
+
$opts["filename"] = $_SERVER["argv"][$i];
|
118 |
+
$i++;
|
119 |
+
break;
|
120 |
+
}
|
121 |
+
|
122 |
+
}
|
123 |
+
return $opts;
|
124 |
+
}
|
125 |
+
|
126 |
+
require_once("dompdf_config.inc.php");
|
127 |
+
global $_dompdf_show_warnings, $_dompdf_debug, $_DOMPDF_DEBUG_TYPES;
|
128 |
+
|
129 |
+
$sapi = php_sapi_name();
|
130 |
+
$options = array();
|
131 |
+
|
132 |
+
switch ( $sapi ) {
|
133 |
+
|
134 |
+
case "cli":
|
135 |
+
|
136 |
+
$opts = getoptions();
|
137 |
+
|
138 |
+
if ( isset($opts["h"]) || (!isset($opts["filename"]) && !isset($opts["l"])) ) {
|
139 |
+
dompdf_usage();
|
140 |
+
exit;
|
141 |
+
}
|
142 |
+
|
143 |
+
if ( isset($opts["l"]) ) {
|
144 |
+
echo "\nUnderstood paper sizes:\n";
|
145 |
+
|
146 |
+
foreach (array_keys(CPDF_Adapter::$PAPER_SIZES) as $size)
|
147 |
+
echo " " . mb_strtoupper($size) . "\n";
|
148 |
+
exit;
|
149 |
+
}
|
150 |
+
$file = $opts["filename"];
|
151 |
+
|
152 |
+
if ( isset($opts["p"]) )
|
153 |
+
$paper = $opts["p"];
|
154 |
+
else
|
155 |
+
$paper = DOMPDF_DEFAULT_PAPER_SIZE;
|
156 |
+
|
157 |
+
if ( isset($opts["o"]) )
|
158 |
+
$orientation = $opts["o"];
|
159 |
+
else
|
160 |
+
$orientation = "portrait";
|
161 |
+
|
162 |
+
if ( isset($opts["b"]) )
|
163 |
+
$base_path = $opts["b"];
|
164 |
+
|
165 |
+
if ( isset($opts["f"]) )
|
166 |
+
$outfile = $opts["f"];
|
167 |
+
else {
|
168 |
+
if ( $file === "-" )
|
169 |
+
$outfile = "dompdf_out.pdf";
|
170 |
+
else
|
171 |
+
$outfile = str_ireplace(array(".html", ".htm", ".php"), "", $file) . ".pdf";
|
172 |
+
}
|
173 |
+
|
174 |
+
if ( isset($opts["v"]) )
|
175 |
+
$_dompdf_show_warnings = true;
|
176 |
+
|
177 |
+
if ( isset($opts["d"]) ) {
|
178 |
+
$_dompdf_show_warnings = true;
|
179 |
+
$_dompdf_debug = true;
|
180 |
+
}
|
181 |
+
|
182 |
+
if ( isset($opts['t']) ) {
|
183 |
+
$arr = explode(',',$opts['t']);
|
184 |
+
$types = array();
|
185 |
+
foreach ($arr as $type)
|
186 |
+
$types[ trim($type) ] = 1;
|
187 |
+
$_DOMPDF_DEBUG_TYPES = $types;
|
188 |
+
}
|
189 |
+
|
190 |
+
$save_file = true;
|
191 |
+
|
192 |
+
break;
|
193 |
+
|
194 |
+
default:
|
195 |
+
|
196 |
+
if ( isset($_GET["input_file"]) )
|
197 |
+
$file = rawurldecode($_GET["input_file"]);
|
198 |
+
else
|
199 |
+
throw new DOMPDF_Exception("An input file is required (i.e. input_file _GET variable).");
|
200 |
+
|
201 |
+
if ( isset($_GET["paper"]) )
|
202 |
+
$paper = rawurldecode($_GET["paper"]);
|
203 |
+
else
|
204 |
+
$paper = DOMPDF_DEFAULT_PAPER_SIZE;
|
205 |
+
|
206 |
+
if ( isset($_GET["orientation"]) )
|
207 |
+
$orientation = rawurldecode($_GET["orientation"]);
|
208 |
+
else
|
209 |
+
$orientation = "portrait";
|
210 |
+
|
211 |
+
if ( isset($_GET["base_path"]) ) {
|
212 |
+
$base_path = rawurldecode($_GET["base_path"]);
|
213 |
+
$file = $base_path . $file; # Set the input file
|
214 |
+
}
|
215 |
+
|
216 |
+
if ( isset($_GET["options"]) ) {
|
217 |
+
$options = $_GET["options"];
|
218 |
+
}
|
219 |
+
|
220 |
+
$file_parts = explode_url($file);
|
221 |
+
|
222 |
+
/* Check to see if the input file is local and, if so, that the base path falls within that specified by DOMDPF_CHROOT */
|
223 |
+
if(($file_parts['protocol'] == '' || $file_parts['protocol'] === 'file://')) {
|
224 |
+
$file = realpath($file);
|
225 |
+
if ( strpos($file, DOMPDF_CHROOT) !== 0 ) {
|
226 |
+
throw new DOMPDF_Exception("Permission denied on $file. The file could not be found under the directory specified by DOMPDF_CHROOT.");
|
227 |
+
}
|
228 |
+
}
|
229 |
+
|
230 |
+
if($file_parts['protocol'] === 'php://') {
|
231 |
+
throw new DOMPDF_Exception("Permission denied on $file. This script does not allow PHP streams.");
|
232 |
+
}
|
233 |
+
|
234 |
+
$outfile = "dompdf_out.pdf"; # Don't allow them to set the output file
|
235 |
+
$save_file = false; # Don't save the file
|
236 |
+
|
237 |
+
break;
|
238 |
+
}
|
239 |
+
|
240 |
+
$dompdf = new DOMPDF();
|
241 |
+
|
242 |
+
if ( $file === "-" ) {
|
243 |
+
$str = "";
|
244 |
+
while ( !feof(STDIN) )
|
245 |
+
$str .= fread(STDIN, 4096);
|
246 |
+
|
247 |
+
$dompdf->load_html($str);
|
248 |
+
|
249 |
+
} else
|
250 |
+
$dompdf->load_html_file($file);
|
251 |
+
|
252 |
+
if ( isset($base_path) ) {
|
253 |
+
$dompdf->set_base_path($base_path);
|
254 |
+
}
|
255 |
+
|
256 |
+
$dompdf->set_paper($paper, $orientation);
|
257 |
+
|
258 |
+
$dompdf->render();
|
259 |
+
|
260 |
+
if ( $_dompdf_show_warnings ) {
|
261 |
+
global $_dompdf_warnings;
|
262 |
+
foreach ($_dompdf_warnings as $msg)
|
263 |
+
echo $msg . "\n";
|
264 |
+
echo $dompdf->get_canvas()->get_cpdf()->messages;
|
265 |
+
flush();
|
266 |
+
}
|
267 |
+
|
268 |
+
if ( $save_file ) {
|
269 |
+
// if ( !is_writable($outfile) )
|
270 |
+
// throw new DOMPDF_Exception("'$outfile' is not writable.");
|
271 |
+
if ( strtolower(DOMPDF_PDF_BACKEND) === "gd" )
|
272 |
+
$outfile = str_replace(".pdf", ".png", $outfile);
|
273 |
+
|
274 |
+
list($proto, $host, $path, $file) = explode_url($outfile);
|
275 |
+
if ( $proto != "" ) // i.e. not file://
|
276 |
+
$outfile = $file; // just save it locally, FIXME? could save it like wget: ./host/basepath/file
|
277 |
+
|
278 |
+
$outfile = realpath(dirname($outfile)) . DIRECTORY_SEPARATOR . basename($outfile);
|
279 |
+
|
280 |
+
if ( strpos($outfile, DOMPDF_CHROOT) !== 0 )
|
281 |
+
throw new DOMPDF_Exception("Permission denied.");
|
282 |
+
|
283 |
+
file_put_contents($outfile, $dompdf->output( array("compress" => 0) ));
|
284 |
+
exit(0);
|
285 |
+
}
|
286 |
+
|
287 |
+
if ( !headers_sent() ) {
|
288 |
+
$dompdf->stream($outfile, $options);
|
289 |
+
}
|
readme.txt
CHANGED
@@ -1,635 +1,643 @@
|
|
1 |
-
=== Plugin Name ===
|
2 |
-
Contributors: pomegranate
|
3 |
-
Tags: woocommerce, pdf, invoices, packing slips, print, delivery notes, invoice, packing slip, export, email, bulk, automatic
|
4 |
-
Requires at least: 3.5
|
5 |
-
Tested up to: 4.6
|
6 |
-
Stable tag: 1.5.
|
7 |
-
License: GPLv2 or later
|
8 |
-
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
-
|
10 |
-
Create, print & automatically email PDF invoices & packing slips for WooCommerce orders.
|
11 |
-
|
12 |
-
== Description ==
|
13 |
-
|
14 |
-
This WooCommerce extension automatically adds a PDF invoice to the order confirmation emails sent out to your customers. Includes a basic template (additional templates are available from [WP Overnight](https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-premium-templates/)) as well as the possibility to modify/create your own templates. In addition, you can choose to download or print invoices and packing slips from the WooCommerce order admin.
|
15 |
-
|
16 |
-
= Main features =
|
17 |
-
* Automatically attach invoice PDF to WooCommerce emails of your choice
|
18 |
-
* Download the PDF invoice / packing slip from the order admin page
|
19 |
-
* Generate PDF invoices / packings slips in bulk
|
20 |
-
* **Fully customizable** HTML/CSS invoice templates
|
21 |
-
* Download invoices from the My Account page
|
22 |
-
* Sequential invoice numbers - with custom formatting
|
23 |
-
* **Available in: Czech, Dutch, English, Finnish, French, German, Hungarian, Italian, Japanese (see FAQ for adding custom fonts!), Norwegian, Polish, Romanian, Russian, Slovak, Slovenian, Spanish, Swedish & Ukrainian**
|
24 |
-
|
25 |
-
In addition to this, we offer several premium extensions:
|
26 |
-
|
27 |
-
* Create/email PDF Proforma Invoices, Credit Notes (for Refunds), email Packing Slips & more with [WooCommerce PDF Invoices & Packing Slips Professional](https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-professional/)
|
28 |
-
* Upload all invoices automatically to Dropbox with [WooCommerce PDF Invoices & Packing Slips to Dropbox](https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-dropbox/)
|
29 |
-
* Automatically send new orders or packing slips to your printer, as soon as the customer orders! [WooCommerce Automatic Order Printing](https://www.simbahosting.co.uk/s3/product/woocommerce-automatic-order-printing/?affiliates=2) (from our partners at Simba Hosting)
|
30 |
-
* More advanced & stylish templates with [WooCommerce PDF Invoices & Packing Slips Premium Templates](https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-premium-templates/)
|
31 |
-
|
32 |
-
= Fully customizable =
|
33 |
-
In addition to a number of default settings (including a custom header/logo) and several layout fields that you can use out of the box, the plugin contains HTML/CSS based templates that allow for customization & full control over the PDF output. Copy the templates to your theme folder and you don't have to worry that your customizations will be overwritten when you update the plugin.
|
34 |
-
|
35 |
-
* Insert customer header image/logo
|
36 |
-
* Modify shop data / footer / disclaimer etc. on the invoices & packing slips
|
37 |
-
* Select paper size (Letter or A4)
|
38 |
-
* Translation ready
|
39 |
-
|
40 |
-
== Installation ==
|
41 |
-
|
42 |
-
= Minimum Requirements =
|
43 |
-
|
44 |
-
* WooCommerce 2.0 or later
|
45 |
-
* WordPress 3.5 or later
|
46 |
-
|
47 |
-
= Automatic installation =
|
48 |
-
Automatic installation is the easiest option as WordPress handles the file transfers itself and you don't even need to leave your web browser. To do an automatic install of WooCommerce PDF Invoices & Packing Slips, log in to your WordPress admin panel, navigate to the Plugins menu and click Add New.
|
49 |
-
|
50 |
-
In the search field type "WooCommerce PDF Invoices & Packing Slips" and click Search Plugins. You can install it by simply clicking Install Now. After clicking that link you will be asked if you're sure you want to install the plugin. Click yes and WordPress will automatically complete the installation. After installation has finished, click the 'activate plugin' link.
|
51 |
-
|
52 |
-
= Manual installation via the WordPress interface =
|
53 |
-
1. Download the plugin zip file to your computer
|
54 |
-
2. Go to the WordPress admin panel menu Plugins > Add New
|
55 |
-
3. Choose upload
|
56 |
-
4. Upload the plugin zip file, the plugin will now be installed
|
57 |
-
5. After installation has finished, click the 'activate plugin' link
|
58 |
-
|
59 |
-
= Manual installation via FTP =
|
60 |
-
1. Download the plugin file to your computer and unzip it
|
61 |
-
2. Using an FTP program, or your hosting control panel, upload the unzipped plugin folder to your WordPress installation's wp-content/plugins/ directory.
|
62 |
-
3. Activate the plugin from the Plugins menu within the WordPress admin.
|
63 |
-
|
64 |
-
== Frequently Asked Questions ==
|
65 |
-
|
66 |
-
Make sure to check out [WooCommerce PDF Invoices & Packing Slips documentation](http://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/) on our site - it covers most of the questions below (and more!) in more detail!
|
67 |
-
|
68 |
-
= How do I create my own custom template? =
|
69 |
-
|
70 |
-
Copy the files from `wp-content/plugins/woocommerce-pdf-invoices-packing-slips/templates/pdf/Simple/` to your (child) theme in `wp-content/themes/yourtheme/woocommerce/pdf/yourtemplate` and customize them there. The new template will show up as 'yourtemplate' (the folder name) in the settings panel.
|
71 |
-
|
72 |
-
= Where can I find more templates? =
|
73 |
-
|
74 |
-
Go to [wpovernight.com](https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-premium-templates/) to checkout more templates! These include templates with more tax details and product thumbnails. Need a custom templates? Contact us at support@wpovernight.com for more information.
|
75 |
-
|
76 |
-
= Can I create/send a proforma invoice or a credit note? =
|
77 |
-
This is a feature of our Professional extension, which can be found at [wpovernight.com](https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-professional/)
|
78 |
-
|
79 |
-
= Can I contribute to the code? =
|
80 |
-
You're more than welcome! This plugin is hosted on github, where you can post issues or make pull requests.
|
81 |
-
https://github.com/wpovernight/woocommerce-pdf-invoices-packing-slips
|
82 |
-
|
83 |
-
= My language is not included, how can I contribute? =
|
84 |
-
|
85 |
-
This plugin is translation ready, which means that you can translate it using standard WordPress methods.
|
86 |
-
|
87 |
-
1. Download POEdit at (http://www.poedit.net/download.php)
|
88 |
-
2. Open POEdit
|
89 |
-
3. File > New from POT
|
90 |
-
4. Open wpo_wcpdf.pot (from `woocommerce-pdf-invoices-packing-slips/languages/`)
|
91 |
-
5. A popup will ask you for your language
|
92 |
-
6. This step is a bit tricky, configuring the plurals. Somehow the settings can't be copied from the pot. Go to Catalogue > Preferences. Then enter nplurals=2; plural=n != 1; in the custom expression field
|
93 |
-
7. Enter the translations. invoice and packing-slip now have two translation fields, single & plural. Note that this is a filename, so replace spaces with a - just to be sure!
|
94 |
-
8. Save as `wpo_wcpdf-xx_XX.po`, where you replace xx_XX with your language code & country code suffix (da_DK, pl_PL, de_DE etc.)
|
95 |
-
|
96 |
-
= How can I use my own font? =
|
97 |
-
Although the plugin supports webfonts, this is somewhat limited and has a lot of caveats, read [this thread](https://wordpress.org/support/topic/webfonts-within-a-custom-template-not-rendering-in-pdf?replies=4#post-5395442) on the forum.
|
98 |
-
Some languages (Japanese, Chinese, etc.) are not supported by the default font included with the plugin, in this case a custom font is required.
|
99 |
-
The best method is to create a custom template first (see above), then add a `fonts/` folder to that template and use the following code (replace the font names/filenames) to load the font in the style.css from the pdf template:
|
100 |
-
`
|
101 |
-
<?php global $wpo_wcpdf;?>
|
102 |
-
/* Load font */
|
103 |
-
@font-face {
|
104 |
-
font-family: 'MyFont';
|
105 |
-
font-style: normal;
|
106 |
-
font-weight: normal;
|
107 |
-
src: local('MyFont'), local('MyFont'), url(<?php echo $wpo_wcpdf->export->template_path; ?>/fonts/myfont.ttf) format('truetype');
|
108 |
-
}
|
109 |
-
@font-face {
|
110 |
-
font-family: 'MyFont';
|
111 |
-
font-style: normal;
|
112 |
-
font-weight: bold;
|
113 |
-
src: local('MyFont Bold'), local('MyFont-Bold'), url(<?php echo $wpo_wcpdf->export->template_path; ?>/fonts/myfont-bold.ttf) format('truetype');
|
114 |
-
}
|
115 |
-
@font-face {
|
116 |
-
font-family: 'MyFont';
|
117 |
-
font-style: italic;
|
118 |
-
font-weight: normal;
|
119 |
-
src: local('MyFont Italic'), local('MyFont-Italic'), url(<?php echo $wpo_wcpdf->export->template_path; ?>/fonts/myfont-italic.ttf) format('truetype');
|
120 |
-
}
|
121 |
-
@font-face {
|
122 |
-
font-family: 'MyFont';
|
123 |
-
font-style: italic;
|
124 |
-
font-weight: bold;
|
125 |
-
src: local('MyFont Bold Italic'), local('MyFont-BoldItalic'), url(<?php echo $wpo_wcpdf->export->template_path; ?>/fonts/myfont-bolditalic.ttf) format('truetype');
|
126 |
-
}
|
127 |
-
`
|
128 |
-
then make sure you assign that font family to the body or other elements of the template:
|
129 |
-
`
|
130 |
-
font-family: 'MyFont';
|
131 |
-
`
|
132 |
-
|
133 |
-
Some notes:
|
134 |
-
|
135 |
-
* Only TTF fonts are supported.
|
136 |
-
* You can't use numeric font weights (like 700 instead of bold)!
|
137 |
-
* Avoid spaces or special characters in the font filenames.
|
138 |
-
* I have found that not all servers cope well with the font paths. If this is the case with your font, try to put the font in the root of your site and put that in the font url (i.e. `url(http://yoursite.com/fonts/myfont-italic.ttf)` )
|
139 |
-
|
140 |
-
Some font links:
|
141 |
-
|
142 |
-
* Japanese - http://ipafont.ipa.go.jp/index.html
|
143 |
-
* Chinese - http://www.study-area.org/apt/firefly-font/
|
144 |
-
|
145 |
-
= How can I display the HTML/CSS source for debugging/developing templates? =
|
146 |
-
There's a setting on the Status tab of the settings page that allows you to toggle HTML output. Don't forget to turn if off after you're done testing!
|
147 |
-
|
148 |
-
= How can I display custom fields in the invoice or packing slip? =
|
149 |
-
First, you need to create a custom template following instructions from the first item in this FAQ.
|
150 |
-
Then place the following snippet where you would like the custom field to appear:
|
151 |
-
|
152 |
-
`
|
153 |
-
<?php $wpo_wcpdf->custom_field('custom_fieldname', 'Custom field:'); ?>
|
154 |
-
`
|
155 |
-
|
156 |
-
Where you replace 'custom_fieldname' with the name of the field you want to display, and 'Custom field' with the label. The plugin only displays the field when it contains data. If you also want to display the label when the field is empty, you can pass a third parameter (true), like this:
|
157 |
-
|
158 |
-
`
|
159 |
-
<?php $wpo_wcpdf->custom_field('custom_fieldname', 'Custom field:', true); ?>
|
160 |
-
`
|
161 |
-
|
162 |
-
= How can I display order notes in the invoice or packing slip? =
|
163 |
-
First, you need to create a custom template following instructions from the first item in this FAQ.
|
164 |
-
Then place the following snippet where you would like the order notes to appear:
|
165 |
-
|
166 |
-
`
|
167 |
-
<?php $wpo_wcpdf->order_notes(); ?>
|
168 |
-
`
|
169 |
-
|
170 |
-
if you want to display all order notes, including the (private) admin notes, use:
|
171 |
-
`
|
172 |
-
<?php $wpo_wcpdf->order_notes('all'); ?>
|
173 |
-
`
|
174 |
-
|
175 |
-
= How do can I modify the pdf filename? =
|
176 |
-
You can do this via a filter in your theme's `functions.php` (Some themes have a "custom functions" area in the settings).
|
177 |
-
|
178 |
-
Here's a simple example for putting your shop name in front of the filname.
|
179 |
-
`
|
180 |
-
add_filter( 'wpo_wcpdf_filename', 'wpo_wcpdf_custom_filename', 10, 4 );
|
181 |
-
function wpo_wcpdf_custom_filename( $filename, $template_type, $order_ids, $context ) {
|
182 |
-
// prepend your shopname to the file
|
183 |
-
$new_filename = 'myshopname_' . $filename;
|
184 |
-
|
185 |
-
return $new_filename;
|
186 |
-
}
|
187 |
-
`
|
188 |
-
You can also use the $template_type ('invoice' or 'packing-slip'), $order_ids (single array) or $context ('download' or 'attachment') variables to make more complex rules for the filename.
|
189 |
-
|
190 |
-
= How can I add a download link to the invoice on the Thank you page? =
|
191 |
-
You can do this with an action in your theme's `functions.php` (Some themes have a "custom functions" area in the settings). Note that due to security restrictions, this will only work for registered/logged in users!
|
192 |
-
|
193 |
-
`
|
194 |
-
add_filter('woocommerce_thankyou_order_received_text', 'wpo_wcpdf_thank_you_link', 10, 2);
|
195 |
-
function wpo_wcpdf_thank_you_link( $text, $order ) {
|
196 |
-
if ( is_user_logged_in() ) {
|
197 |
-
$pdf_url = wp_nonce_url( admin_url( 'admin-ajax.php?action=generate_wpo_wcpdf&template_type=invoice&order_ids=' . $order->id . '&my-account'), 'generate_wpo_wcpdf' );
|
198 |
-
$text .= '<p><a href="'.esc_attr($pdf_url).'">Download a printable invoice / payment confirmation (PDF format)</a></p>';
|
199 |
-
}
|
200 |
-
return $text;
|
201 |
-
}
|
202 |
-
`
|
203 |
-
|
204 |
-
alternatively, you can hook this text to the `woocommerce_thankyou` action, see [this thread](https://wordpress.org/support/topic/suggestion-for-the-faq?replies=5#post-6298810) on the support forum.
|
205 |
-
|
206 |
-
= How can I get a copy of the invoice emailed to the shop manager? =
|
207 |
-
The easiest way to do this is to just tick the 'new order' box. However, this also means that an invoice will be created for all new orders, also the ones that are never completed.
|
208 |
-
|
209 |
-
Alternatively you can get a (BCC) copy of the completed order email by placing the following filter in your theme's `functions.php` (Some themes have a "custom functions" area in the settings)
|
210 |
-
Modify the name & email address to your own preferences,
|
211 |
-
|
212 |
-
`
|
213 |
-
add_filter( 'woocommerce_email_headers', 'mycustom_headers_filter_function', 10, 2);
|
214 |
-
|
215 |
-
function mycustom_headers_filter_function( $headers, $object ) {
|
216 |
-
if ($object == 'customer_completed_order') {
|
217 |
-
$headers .= 'BCC: Your name <your@email.com>' . "\r\n"; //just repeat this line again to insert another email address in BCC
|
218 |
-
}
|
219 |
-
|
220 |
-
return $headers;
|
221 |
-
}
|
222 |
-
`
|
223 |
-
|
224 |
-
|
225 |
-
= Fatal error: Allowed memory size of ######## bytes exhausted (tried to allocate ### bytes) =
|
226 |
-
|
227 |
-
This usually only happens on batch actions. PDF creation is a memory intensive job, especially if it includes several pages with images. Go to WooCommerce > System Status to check your WP Memory Limit. We recommend setting it to 128mb or more.
|
228 |
-
|
229 |
-
== Screenshots ==
|
230 |
-
|
231 |
-
1. General settings page
|
232 |
-
2. Template settings page
|
233 |
-
3. Simple invoice PDF
|
234 |
-
4. Simple packing slip PDF
|
235 |
-
|
236 |
-
== Changelog ==
|
237 |
-
|
238 |
-
= 1.5.
|
239 |
-
*
|
240 |
-
*
|
241 |
-
* Fix:
|
242 |
-
*
|
243 |
-
*
|
244 |
-
*
|
245 |
-
|
246 |
-
= 1.5.
|
247 |
-
*
|
248 |
-
|
249 |
-
|
250 |
-
*
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
*
|
262 |
-
|
263 |
-
= 1.5.
|
264 |
-
*
|
265 |
-
*
|
266 |
-
|
267 |
-
= 1.5.
|
268 |
-
*
|
269 |
-
*
|
270 |
-
|
271 |
-
= 1.5.
|
272 |
-
*
|
273 |
-
*
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
*
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
*
|
283 |
-
|
284 |
-
|
285 |
-
*
|
286 |
-
* Fix:
|
287 |
-
*
|
288 |
-
|
289 |
-
= 1.5.
|
290 |
-
* Feature:
|
291 |
-
* Feature:
|
292 |
-
* Feature:
|
293 |
-
*
|
294 |
-
* Fix:
|
295 |
-
*
|
296 |
-
|
297 |
-
|
298 |
-
*
|
299 |
-
|
300 |
-
|
301 |
-
*
|
302 |
-
|
303 |
-
|
304 |
-
*
|
305 |
-
* Tweak:
|
306 |
-
*
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
*
|
315 |
-
*
|
316 |
-
|
317 |
-
= 1.5.
|
318 |
-
*
|
319 |
-
*
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
* Fix:
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
*
|
336 |
-
|
337 |
-
|
338 |
-
*
|
339 |
-
*
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
*
|
344 |
-
* Tweak:
|
345 |
-
*
|
346 |
-
|
347 |
-
|
348 |
-
*
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
*
|
353 |
-
*
|
354 |
-
|
355 |
-
|
356 |
-
*
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
*
|
363 |
-
*
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
*
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
*
|
383 |
-
*
|
384 |
-
*
|
385 |
-
|
386 |
-
|
387 |
-
*
|
388 |
-
|
389 |
-
|
390 |
-
*
|
391 |
-
*
|
392 |
-
*
|
393 |
-
|
394 |
-
|
395 |
-
* Fix:
|
396 |
-
* Fix:
|
397 |
-
* Fix:
|
398 |
-
* Fix:
|
399 |
-
* Translations:
|
400 |
-
* Translations: Updated Dutch
|
401 |
-
|
402 |
-
= 1.5.
|
403 |
-
*
|
404 |
-
*
|
405 |
-
* Fix:
|
406 |
-
|
407 |
-
|
408 |
-
*
|
409 |
-
|
410 |
-
|
411 |
-
* Tweak:
|
412 |
-
*
|
413 |
-
*
|
414 |
-
|
415 |
-
= 1.5.
|
416 |
-
*
|
417 |
-
*
|
418 |
-
|
419 |
-
|
420 |
-
* Fix:
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
*
|
425 |
-
*
|
426 |
-
|
427 |
-
|
428 |
-
*
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
*
|
434 |
-
*
|
435 |
-
* Translations:
|
436 |
-
|
437 |
-
|
438 |
-
*
|
439 |
-
|
440 |
-
|
441 |
-
*
|
442 |
-
*
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
*
|
449 |
-
*
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
*
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
*
|
461 |
-
*
|
462 |
-
*
|
463 |
-
*
|
464 |
-
|
465 |
-
= 1.4.
|
466 |
-
*
|
467 |
-
|
468 |
-
|
469 |
-
*
|
470 |
-
*
|
471 |
-
*
|
472 |
-
|
473 |
-
|
474 |
-
*
|
475 |
-
|
476 |
-
|
477 |
-
*
|
478 |
-
|
479 |
-
|
480 |
-
*
|
481 |
-
*
|
482 |
-
|
483 |
-
|
484 |
-
*
|
485 |
-
*
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
*
|
490 |
-
|
491 |
-
|
492 |
-
* Fix:
|
493 |
-
*
|
494 |
-
*
|
495 |
-
|
496 |
-
= 1.4.
|
497 |
-
* Feature:
|
498 |
-
* Feature:
|
499 |
-
* Translations:
|
500 |
-
*
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
* Translations: Added
|
508 |
-
*
|
509 |
-
|
510 |
-
= 1.4.
|
511 |
-
*
|
512 |
-
*
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
*
|
521 |
-
*
|
522 |
-
*
|
523 |
-
|
524 |
-
= 1.3.
|
525 |
-
*
|
526 |
-
|
527 |
-
|
528 |
-
*
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
*
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
*
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
* Fix:
|
544 |
-
|
545 |
-
= 1.2.
|
546 |
-
*
|
547 |
-
*
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
*
|
557 |
-
* Fix:
|
558 |
-
|
559 |
-
= 1.2.
|
560 |
-
*
|
561 |
-
* Fix:
|
562 |
-
|
563 |
-
= 1.2.
|
564 |
-
*
|
565 |
-
*
|
566 |
-
|
567 |
-
|
568 |
-
*
|
569 |
-
*
|
570 |
-
|
571 |
-
= 1.2.
|
572 |
-
* Feature:
|
573 |
-
|
574 |
-
|
575 |
-
*
|
576 |
-
*
|
577 |
-
*
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
*
|
584 |
-
*
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
* Feature:
|
591 |
-
*
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
*
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
*
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
*
|
609 |
-
* Fix:
|
610 |
-
|
611 |
-
= 1.1.
|
612 |
-
*
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
*
|
618 |
-
|
619 |
-
= 1.1.
|
620 |
-
* Feature:
|
621 |
-
* Feature:
|
622 |
-
*
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
*
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
=== Plugin Name ===
|
2 |
+
Contributors: pomegranate
|
3 |
+
Tags: woocommerce, pdf, invoices, packing slips, print, delivery notes, invoice, packing slip, export, email, bulk, automatic
|
4 |
+
Requires at least: 3.5
|
5 |
+
Tested up to: 4.6
|
6 |
+
Stable tag: 1.5.38
|
7 |
+
License: GPLv2 or later
|
8 |
+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
+
|
10 |
+
Create, print & automatically email PDF invoices & packing slips for WooCommerce orders.
|
11 |
+
|
12 |
+
== Description ==
|
13 |
+
|
14 |
+
This WooCommerce extension automatically adds a PDF invoice to the order confirmation emails sent out to your customers. Includes a basic template (additional templates are available from [WP Overnight](https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-premium-templates/)) as well as the possibility to modify/create your own templates. In addition, you can choose to download or print invoices and packing slips from the WooCommerce order admin.
|
15 |
+
|
16 |
+
= Main features =
|
17 |
+
* Automatically attach invoice PDF to WooCommerce emails of your choice
|
18 |
+
* Download the PDF invoice / packing slip from the order admin page
|
19 |
+
* Generate PDF invoices / packings slips in bulk
|
20 |
+
* **Fully customizable** HTML/CSS invoice templates
|
21 |
+
* Download invoices from the My Account page
|
22 |
+
* Sequential invoice numbers - with custom formatting
|
23 |
+
* **Available in: Czech, Dutch, English, Finnish, French, German, Hungarian, Italian, Japanese (see FAQ for adding custom fonts!), Norwegian, Polish, Romanian, Russian, Slovak, Slovenian, Spanish, Swedish & Ukrainian**
|
24 |
+
|
25 |
+
In addition to this, we offer several premium extensions:
|
26 |
+
|
27 |
+
* Create/email PDF Proforma Invoices, Credit Notes (for Refunds), email Packing Slips & more with [WooCommerce PDF Invoices & Packing Slips Professional](https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-professional/)
|
28 |
+
* Upload all invoices automatically to Dropbox with [WooCommerce PDF Invoices & Packing Slips to Dropbox](https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-dropbox/)
|
29 |
+
* Automatically send new orders or packing slips to your printer, as soon as the customer orders! [WooCommerce Automatic Order Printing](https://www.simbahosting.co.uk/s3/product/woocommerce-automatic-order-printing/?affiliates=2) (from our partners at Simba Hosting)
|
30 |
+
* More advanced & stylish templates with [WooCommerce PDF Invoices & Packing Slips Premium Templates](https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-premium-templates/)
|
31 |
+
|
32 |
+
= Fully customizable =
|
33 |
+
In addition to a number of default settings (including a custom header/logo) and several layout fields that you can use out of the box, the plugin contains HTML/CSS based templates that allow for customization & full control over the PDF output. Copy the templates to your theme folder and you don't have to worry that your customizations will be overwritten when you update the plugin.
|
34 |
+
|
35 |
+
* Insert customer header image/logo
|
36 |
+
* Modify shop data / footer / disclaimer etc. on the invoices & packing slips
|
37 |
+
* Select paper size (Letter or A4)
|
38 |
+
* Translation ready
|
39 |
+
|
40 |
+
== Installation ==
|
41 |
+
|
42 |
+
= Minimum Requirements =
|
43 |
+
|
44 |
+
* WooCommerce 2.0 or later
|
45 |
+
* WordPress 3.5 or later
|
46 |
+
|
47 |
+
= Automatic installation =
|
48 |
+
Automatic installation is the easiest option as WordPress handles the file transfers itself and you don't even need to leave your web browser. To do an automatic install of WooCommerce PDF Invoices & Packing Slips, log in to your WordPress admin panel, navigate to the Plugins menu and click Add New.
|
49 |
+
|
50 |
+
In the search field type "WooCommerce PDF Invoices & Packing Slips" and click Search Plugins. You can install it by simply clicking Install Now. After clicking that link you will be asked if you're sure you want to install the plugin. Click yes and WordPress will automatically complete the installation. After installation has finished, click the 'activate plugin' link.
|
51 |
+
|
52 |
+
= Manual installation via the WordPress interface =
|
53 |
+
1. Download the plugin zip file to your computer
|
54 |
+
2. Go to the WordPress admin panel menu Plugins > Add New
|
55 |
+
3. Choose upload
|
56 |
+
4. Upload the plugin zip file, the plugin will now be installed
|
57 |
+
5. After installation has finished, click the 'activate plugin' link
|
58 |
+
|
59 |
+
= Manual installation via FTP =
|
60 |
+
1. Download the plugin file to your computer and unzip it
|
61 |
+
2. Using an FTP program, or your hosting control panel, upload the unzipped plugin folder to your WordPress installation's wp-content/plugins/ directory.
|
62 |
+
3. Activate the plugin from the Plugins menu within the WordPress admin.
|
63 |
+
|
64 |
+
== Frequently Asked Questions ==
|
65 |
+
|
66 |
+
Make sure to check out [WooCommerce PDF Invoices & Packing Slips documentation](http://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/) on our site - it covers most of the questions below (and more!) in more detail!
|
67 |
+
|
68 |
+
= How do I create my own custom template? =
|
69 |
+
|
70 |
+
Copy the files from `wp-content/plugins/woocommerce-pdf-invoices-packing-slips/templates/pdf/Simple/` to your (child) theme in `wp-content/themes/yourtheme/woocommerce/pdf/yourtemplate` and customize them there. The new template will show up as 'yourtemplate' (the folder name) in the settings panel.
|
71 |
+
|
72 |
+
= Where can I find more templates? =
|
73 |
+
|
74 |
+
Go to [wpovernight.com](https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-premium-templates/) to checkout more templates! These include templates with more tax details and product thumbnails. Need a custom templates? Contact us at support@wpovernight.com for more information.
|
75 |
+
|
76 |
+
= Can I create/send a proforma invoice or a credit note? =
|
77 |
+
This is a feature of our Professional extension, which can be found at [wpovernight.com](https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-professional/)
|
78 |
+
|
79 |
+
= Can I contribute to the code? =
|
80 |
+
You're more than welcome! This plugin is hosted on github, where you can post issues or make pull requests.
|
81 |
+
https://github.com/wpovernight/woocommerce-pdf-invoices-packing-slips
|
82 |
+
|
83 |
+
= My language is not included, how can I contribute? =
|
84 |
+
|
85 |
+
This plugin is translation ready, which means that you can translate it using standard WordPress methods.
|
86 |
+
|
87 |
+
1. Download POEdit at (http://www.poedit.net/download.php)
|
88 |
+
2. Open POEdit
|
89 |
+
3. File > New from POT
|
90 |
+
4. Open wpo_wcpdf.pot (from `woocommerce-pdf-invoices-packing-slips/languages/`)
|
91 |
+
5. A popup will ask you for your language
|
92 |
+
6. This step is a bit tricky, configuring the plurals. Somehow the settings can't be copied from the pot. Go to Catalogue > Preferences. Then enter nplurals=2; plural=n != 1; in the custom expression field
|
93 |
+
7. Enter the translations. invoice and packing-slip now have two translation fields, single & plural. Note that this is a filename, so replace spaces with a - just to be sure!
|
94 |
+
8. Save as `wpo_wcpdf-xx_XX.po`, where you replace xx_XX with your language code & country code suffix (da_DK, pl_PL, de_DE etc.)
|
95 |
+
|
96 |
+
= How can I use my own font? =
|
97 |
+
Although the plugin supports webfonts, this is somewhat limited and has a lot of caveats, read [this thread](https://wordpress.org/support/topic/webfonts-within-a-custom-template-not-rendering-in-pdf?replies=4#post-5395442) on the forum.
|
98 |
+
Some languages (Japanese, Chinese, etc.) are not supported by the default font included with the plugin, in this case a custom font is required.
|
99 |
+
The best method is to create a custom template first (see above), then add a `fonts/` folder to that template and use the following code (replace the font names/filenames) to load the font in the style.css from the pdf template:
|
100 |
+
`
|
101 |
+
<?php global $wpo_wcpdf;?>
|
102 |
+
/* Load font */
|
103 |
+
@font-face {
|
104 |
+
font-family: 'MyFont';
|
105 |
+
font-style: normal;
|
106 |
+
font-weight: normal;
|
107 |
+
src: local('MyFont'), local('MyFont'), url(<?php echo $wpo_wcpdf->export->template_path; ?>/fonts/myfont.ttf) format('truetype');
|
108 |
+
}
|
109 |
+
@font-face {
|
110 |
+
font-family: 'MyFont';
|
111 |
+
font-style: normal;
|
112 |
+
font-weight: bold;
|
113 |
+
src: local('MyFont Bold'), local('MyFont-Bold'), url(<?php echo $wpo_wcpdf->export->template_path; ?>/fonts/myfont-bold.ttf) format('truetype');
|
114 |
+
}
|
115 |
+
@font-face {
|
116 |
+
font-family: 'MyFont';
|
117 |
+
font-style: italic;
|
118 |
+
font-weight: normal;
|
119 |
+
src: local('MyFont Italic'), local('MyFont-Italic'), url(<?php echo $wpo_wcpdf->export->template_path; ?>/fonts/myfont-italic.ttf) format('truetype');
|
120 |
+
}
|
121 |
+
@font-face {
|
122 |
+
font-family: 'MyFont';
|
123 |
+
font-style: italic;
|
124 |
+
font-weight: bold;
|
125 |
+
src: local('MyFont Bold Italic'), local('MyFont-BoldItalic'), url(<?php echo $wpo_wcpdf->export->template_path; ?>/fonts/myfont-bolditalic.ttf) format('truetype');
|
126 |
+
}
|
127 |
+
`
|
128 |
+
then make sure you assign that font family to the body or other elements of the template:
|
129 |
+
`
|
130 |
+
font-family: 'MyFont';
|
131 |
+
`
|
132 |
+
|
133 |
+
Some notes:
|
134 |
+
|
135 |
+
* Only TTF fonts are supported.
|
136 |
+
* You can't use numeric font weights (like 700 instead of bold)!
|
137 |
+
* Avoid spaces or special characters in the font filenames.
|
138 |
+
* I have found that not all servers cope well with the font paths. If this is the case with your font, try to put the font in the root of your site and put that in the font url (i.e. `url(http://yoursite.com/fonts/myfont-italic.ttf)` )
|
139 |
+
|
140 |
+
Some font links:
|
141 |
+
|
142 |
+
* Japanese - http://ipafont.ipa.go.jp/index.html
|
143 |
+
* Chinese - http://www.study-area.org/apt/firefly-font/
|
144 |
+
|
145 |
+
= How can I display the HTML/CSS source for debugging/developing templates? =
|
146 |
+
There's a setting on the Status tab of the settings page that allows you to toggle HTML output. Don't forget to turn if off after you're done testing!
|
147 |
+
|
148 |
+
= How can I display custom fields in the invoice or packing slip? =
|
149 |
+
First, you need to create a custom template following instructions from the first item in this FAQ.
|
150 |
+
Then place the following snippet where you would like the custom field to appear:
|
151 |
+
|
152 |
+
`
|
153 |
+
<?php $wpo_wcpdf->custom_field('custom_fieldname', 'Custom field:'); ?>
|
154 |
+
`
|
155 |
+
|
156 |
+
Where you replace 'custom_fieldname' with the name of the field you want to display, and 'Custom field' with the label. The plugin only displays the field when it contains data. If you also want to display the label when the field is empty, you can pass a third parameter (true), like this:
|
157 |
+
|
158 |
+
`
|
159 |
+
<?php $wpo_wcpdf->custom_field('custom_fieldname', 'Custom field:', true); ?>
|
160 |
+
`
|
161 |
+
|
162 |
+
= How can I display order notes in the invoice or packing slip? =
|
163 |
+
First, you need to create a custom template following instructions from the first item in this FAQ.
|
164 |
+
Then place the following snippet where you would like the order notes to appear:
|
165 |
+
|
166 |
+
`
|
167 |
+
<?php $wpo_wcpdf->order_notes(); ?>
|
168 |
+
`
|
169 |
+
|
170 |
+
if you want to display all order notes, including the (private) admin notes, use:
|
171 |
+
`
|
172 |
+
<?php $wpo_wcpdf->order_notes('all'); ?>
|
173 |
+
`
|
174 |
+
|
175 |
+
= How do can I modify the pdf filename? =
|
176 |
+
You can do this via a filter in your theme's `functions.php` (Some themes have a "custom functions" area in the settings).
|
177 |
+
|
178 |
+
Here's a simple example for putting your shop name in front of the filname.
|
179 |
+
`
|
180 |
+
add_filter( 'wpo_wcpdf_filename', 'wpo_wcpdf_custom_filename', 10, 4 );
|
181 |
+
function wpo_wcpdf_custom_filename( $filename, $template_type, $order_ids, $context ) {
|
182 |
+
// prepend your shopname to the file
|
183 |
+
$new_filename = 'myshopname_' . $filename;
|
184 |
+
|
185 |
+
return $new_filename;
|
186 |
+
}
|
187 |
+
`
|
188 |
+
You can also use the $template_type ('invoice' or 'packing-slip'), $order_ids (single array) or $context ('download' or 'attachment') variables to make more complex rules for the filename.
|
189 |
+
|
190 |
+
= How can I add a download link to the invoice on the Thank you page? =
|
191 |
+
You can do this with an action in your theme's `functions.php` (Some themes have a "custom functions" area in the settings). Note that due to security restrictions, this will only work for registered/logged in users!
|
192 |
+
|
193 |
+
`
|
194 |
+
add_filter('woocommerce_thankyou_order_received_text', 'wpo_wcpdf_thank_you_link', 10, 2);
|
195 |
+
function wpo_wcpdf_thank_you_link( $text, $order ) {
|
196 |
+
if ( is_user_logged_in() ) {
|
197 |
+
$pdf_url = wp_nonce_url( admin_url( 'admin-ajax.php?action=generate_wpo_wcpdf&template_type=invoice&order_ids=' . $order->id . '&my-account'), 'generate_wpo_wcpdf' );
|
198 |
+
$text .= '<p><a href="'.esc_attr($pdf_url).'">Download a printable invoice / payment confirmation (PDF format)</a></p>';
|
199 |
+
}
|
200 |
+
return $text;
|
201 |
+
}
|
202 |
+
`
|
203 |
+
|
204 |
+
alternatively, you can hook this text to the `woocommerce_thankyou` action, see [this thread](https://wordpress.org/support/topic/suggestion-for-the-faq?replies=5#post-6298810) on the support forum.
|
205 |
+
|
206 |
+
= How can I get a copy of the invoice emailed to the shop manager? =
|
207 |
+
The easiest way to do this is to just tick the 'new order' box. However, this also means that an invoice will be created for all new orders, also the ones that are never completed.
|
208 |
+
|
209 |
+
Alternatively you can get a (BCC) copy of the completed order email by placing the following filter in your theme's `functions.php` (Some themes have a "custom functions" area in the settings)
|
210 |
+
Modify the name & email address to your own preferences,
|
211 |
+
|
212 |
+
`
|
213 |
+
add_filter( 'woocommerce_email_headers', 'mycustom_headers_filter_function', 10, 2);
|
214 |
+
|
215 |
+
function mycustom_headers_filter_function( $headers, $object ) {
|
216 |
+
if ($object == 'customer_completed_order') {
|
217 |
+
$headers .= 'BCC: Your name <your@email.com>' . "\r\n"; //just repeat this line again to insert another email address in BCC
|
218 |
+
}
|
219 |
+
|
220 |
+
return $headers;
|
221 |
+
}
|
222 |
+
`
|
223 |
+
|
224 |
+
|
225 |
+
= Fatal error: Allowed memory size of ######## bytes exhausted (tried to allocate ### bytes) =
|
226 |
+
|
227 |
+
This usually only happens on batch actions. PDF creation is a memory intensive job, especially if it includes several pages with images. Go to WooCommerce > System Status to check your WP Memory Limit. We recommend setting it to 128mb or more.
|
228 |
+
|
229 |
+
== Screenshots ==
|
230 |
+
|
231 |
+
1. General settings page
|
232 |
+
2. Template settings page
|
233 |
+
3. Simple invoice PDF
|
234 |
+
4. Simple packing slip PDF
|
235 |
+
|
236 |
+
== Changelog ==
|
237 |
+
|
238 |
+
= 1.5.38 =
|
239 |
+
* Fix: Thumbnail path fallback
|
240 |
+
* Fix: Edge/IE hour & minute pattern
|
241 |
+
* Fix: Skip over non-order objects
|
242 |
+
* Tweak: Let shop manager view My Account links
|
243 |
+
* Dev: added `wpo_wcpdf_before_attachment_creation` action
|
244 |
+
* Translations: Updated POT, Swedish, Dutch & Norwegian
|
245 |
+
|
246 |
+
= 1.5.37 =
|
247 |
+
* Feature: Added support for third party invoice numbers
|
248 |
+
* Feature: Enable pre-invoice number click-to-edit
|
249 |
+
* Fix: Review link for custom admins
|
250 |
+
* Fix: PHP7 compatibility
|
251 |
+
* Fix: Invoice date hour/minute pattern
|
252 |
+
* Tweak: Multisite WooCommerce check optimization
|
253 |
+
|
254 |
+
= 1.5.36 =
|
255 |
+
* Translations: Fixed Romanian (incorrect "Factură Proforma" translation for "Invoice")
|
256 |
+
|
257 |
+
= 1.5.35 =
|
258 |
+
* Translations: Fixed "Includes %s" string for WC2.6+
|
259 |
+
|
260 |
+
= 1.5.34 =
|
261 |
+
* Fix: Document check that was introduced in 1.5.33 for disable free setting
|
262 |
+
|
263 |
+
= 1.5.33 =
|
264 |
+
* Tweak: Don't apply 'disable free' setting to packing slip attachment
|
265 |
+
* Translations: Updated Romanian
|
266 |
+
|
267 |
+
= 1.5.32 =
|
268 |
+
* Fix: Updated currency font with Indian Rupee symbol
|
269 |
+
* Translations: added Formal German (currently a copy of informal German)
|
270 |
+
|
271 |
+
= 1.5.31 =
|
272 |
+
* Feature: [invoice_day] or [order_day] in invoice number format
|
273 |
+
* Fix: Link to hide all ads when premium extensions active
|
274 |
+
|
275 |
+
= 1.5.30 =
|
276 |
+
* Feature: Enable currency font for extended currency support
|
277 |
+
* Fix: Font sync on plugin update
|
278 |
+
|
279 |
+
= 1.5.29 =
|
280 |
+
* Translations: Added Croation (Thanks Neven/Spine ICT!), updated French (Thanks Sabra!)
|
281 |
+
* Tweak: filter shop address before checking if it's empty
|
282 |
+
* Dev: added $order to `wpo_wcpdf_template_file` filter
|
283 |
+
|
284 |
+
= 1.5.28 =
|
285 |
+
* Tweak: the 'Next invoice number' is now stored separately in the database for faster and more reliable retrieval. Circumventing any caching, this should prevent duplicate invoice numbers.
|
286 |
+
* Fix: Bulk actions plugin conflicts
|
287 |
+
* Experimental: page numbers (use {{PAGE_NUM}} / {{PAGE_COUNT}} in your template)
|
288 |
+
|
289 |
+
= 1.5.27 =
|
290 |
+
* Feature: Use [invoice_year] and [invoice_month] placeholders in invoice number prefix/suffix
|
291 |
+
* Feature: WooCommerce Order Status & Actions Manager emails compatibility
|
292 |
+
* Feature: Add invoice number to WC REST API
|
293 |
+
* Fix: Allow positive 'discounts' (price corrections)
|
294 |
+
* Fix: Discounts rounding
|
295 |
+
* Translations: Updated Finnish & Portugese & POT
|
296 |
+
|
297 |
+
= 1.5.26 =
|
298 |
+
* Feature: Automatically list all emails registered in WooCommerce
|
299 |
+
* Feature: Reset invoice number yearly
|
300 |
+
* Feature: WooCommerce Chained Products compatibility
|
301 |
+
* Feature: WooCommerce Product Bundles visibility settings taken into account in invoice
|
302 |
+
* Fix: Disable PDF creation from trashed order_ids
|
303 |
+
* Tweak: Alert when no orders selected for bulk export (Props to Dartui!)
|
304 |
+
* Tweak: PDF invoice settings always under WooCommerce menu (also for premium users)
|
305 |
+
* Tweak: extra $item_id passed in row class filter
|
306 |
+
* Translations: Updated Slovenian, Spanish, Dutch & POT file
|
307 |
+
|
308 |
+
= 1.5.24 =
|
309 |
+
* Hotfix: Subscriptions renewal filter arguments
|
310 |
+
|
311 |
+
= 1.5.23 =
|
312 |
+
* Fix: WooCommerce Subscriptons 2.0 deprecation notice.
|
313 |
+
* Tweak: better qTranslate-X support
|
314 |
+
* Tweak: filter for user privileges check (wpo_wcpdf_check_privs)
|
315 |
+
* Translations: French translations fix
|
316 |
+
|
317 |
+
= 1.5.22 =
|
318 |
+
* Fix: Workaround for bug in WPML (which cleared all settings)
|
319 |
+
* Translation: fixed Polish translation for invoice
|
320 |
+
|
321 |
+
= 1.5.21 =
|
322 |
+
* Translations: Added Estionan (thanks Tanel!)
|
323 |
+
* Tweak: WC2.4 compatibility
|
324 |
+
|
325 |
+
= 1.5.20 =
|
326 |
+
* Feature: Option to 'never' display My Account invoice link
|
327 |
+
* Fix: Order total for refunds in WC2.4
|
328 |
+
* Fix: notice when no custom statuses selected for My Account display
|
329 |
+
* Tweak: Product bundles styles
|
330 |
+
|
331 |
+
= 1.5.19 =
|
332 |
+
* Fix: Invoice number search (broke other custom searches)
|
333 |
+
|
334 |
+
= 1.5.18 =
|
335 |
+
* Fix: wpo_wcpdf_item_row_class packing slip filter arguments
|
336 |
+
|
337 |
+
= 1.5.17 =
|
338 |
+
* Feature: WooCommerce Product Bundles compatibility styles
|
339 |
+
* Tweak: wpo_wcpdf_item_row_class as filter instead of action
|
340 |
+
|
341 |
+
= 1.5.16 =
|
342 |
+
* Feature: Search orders by invoice number (note: search on formatted invoice number only works for new orders)
|
343 |
+
* Feature: Formatted invoice number stored in order
|
344 |
+
* Tweak: Function parameters added to some of the filters
|
345 |
+
* Tweak: WooCommerce 2.4 compatibility
|
346 |
+
* Dev feature: action to add class to items table row (wpo_wcpdf_item_row_class)
|
347 |
+
* Translations: Swedish updated (thanks Conney!)
|
348 |
+
* Translations: Norwegian updated
|
349 |
+
|
350 |
+
= 1.5.15 =
|
351 |
+
* Fix: invoice number padding didn't work for values lower than 3
|
352 |
+
* Tweak: WPML compatibility filter
|
353 |
+
* Translations: Updated French (Thanks Nicolas!)
|
354 |
+
|
355 |
+
= 1.5.14 =
|
356 |
+
* Tweak: Invoice number & date edit fields moved to separate box on order edit page
|
357 |
+
* Translations: Updated POT & Dutch
|
358 |
+
|
359 |
+
= 1.5.13 =
|
360 |
+
* Fix: Better address comparison to determine when to display alternate address
|
361 |
+
* Tweak: Filter N/A addresses
|
362 |
+
* Tweak: Use WooCommerce function for 2.3 discounts
|
363 |
+
* Translations: Czech Updated (Thanks Ivo!)
|
364 |
+
* Translations: French (minor fixes)
|
365 |
+
|
366 |
+
= 1.5.12 =
|
367 |
+
* Translations: added Danish, Updated POT & Italian
|
368 |
+
|
369 |
+
= 1.5.11 =
|
370 |
+
* Fix: Product text attributes (now checks key too)
|
371 |
+
* Fix: Status page upload explanation typos
|
372 |
+
|
373 |
+
= 1.5.10 =
|
374 |
+
* Fix: Double check to make sure plugin doesn't attach to user emails
|
375 |
+
|
376 |
+
= 1.5.9 =
|
377 |
+
* Feature: Shorthand function to display product attributes: `$wpo_wcpdf->get_product_attribute( $attribute_name, $product )`
|
378 |
+
|
379 |
+
= 1.5.8 =
|
380 |
+
* Feature: disable invoice for free orders
|
381 |
+
* Feature: action to insert data before & after item meta
|
382 |
+
* Tweak: Added classes to sku & weight
|
383 |
+
* Tweak: Hide payment method from totals (already shown in template)
|
384 |
+
* Translations: Updated POT & Dutch
|
385 |
+
|
386 |
+
= 1.5.7 =
|
387 |
+
* Feature: Setting to show email address & phone number on invoice or packing slip (does not work on custom templates based on previous versions!)
|
388 |
+
|
389 |
+
= 1.5.6 =
|
390 |
+
* Feature: Setting to show shipping address on invoice (does not work on custom templates based on previous versions!)
|
391 |
+
* Feature: My Account invoice download setting
|
392 |
+
* Feature: several new template actions
|
393 |
+
* Tweak: WooCommerce Bookings compatibility
|
394 |
+
* Tweak: Gerenal stylesheet cleanup
|
395 |
+
* Fix: temp path check/error on settings page
|
396 |
+
* Fix: Document titles for credit notes and proforma (Pro)
|
397 |
+
* Fix: Discount including tax
|
398 |
+
* Fix: Special characters on item meta (requires WooCommerce 2.3.6)
|
399 |
+
* Translations: Missing text domain on several strings
|
400 |
+
* Translations: Updated POT & Dutch
|
401 |
+
|
402 |
+
= 1.5.5 =
|
403 |
+
* Fix: Check for incomplete line tax data (Subscriptions compatibility)
|
404 |
+
* Fix: More precise template path instructions
|
405 |
+
* Fix: duplicate stylesheet filter
|
406 |
+
* Fix: Always prefer original order's billing address for refunds (WooCommerce EU VAT Number compatibility)
|
407 |
+
* Translations: Updated German (MwSt. instead of formal Ust.)
|
408 |
+
* Translations: Updated Dutch
|
409 |
+
|
410 |
+
= 1.5.4 =
|
411 |
+
* Tweak: include plugin version in style/script includes
|
412 |
+
* Tweak: upload code cleanup
|
413 |
+
* Fix: Parent invoice number (for Credit Notes in professional extension)
|
414 |
+
|
415 |
+
= 1.5.3 =
|
416 |
+
* Feature: add original order date value to order date filter
|
417 |
+
* Feature: Work with line_tax_data when available
|
418 |
+
* Feature: pass item_id to items
|
419 |
+
* Tweak: later check for woocommerce active
|
420 |
+
* Fix: do not try to validate empty settings (Status page settings)
|
421 |
+
* Translations: Fixed Dutch typo
|
422 |
+
|
423 |
+
= 1.5.2 =
|
424 |
+
* Fix: fatal error when trying to activate with WooCommerce not installed yet.
|
425 |
+
* Tweak: indentation fix on the Simple template
|
426 |
+
|
427 |
+
= 1.5.1 =
|
428 |
+
* Fix: prevent errors when upgrading
|
429 |
+
|
430 |
+
= 1.5.0 =
|
431 |
+
* Feature: All temporary files are now stored centrally in the WP uploads folder.
|
432 |
+
* Feature: Debug settings in status panel (output errors & output to HTML)
|
433 |
+
* Feature: Compatibility filter for WooCommerce Subscriptions (prevents duplicate invoice numbers)
|
434 |
+
* Tweak: Pass order to totals filters
|
435 |
+
* Translations: Updated POT
|
436 |
+
* Translations: Updated Italian (Thanks Astrid!)
|
437 |
+
* Translations: Updated Dutch
|
438 |
+
* FAQ: instructions for placing a link on the thank you page
|
439 |
+
|
440 |
+
= 1.4.14 =
|
441 |
+
* Fix: fatal error when user registers at checkout (applies to credit notes only)
|
442 |
+
* Translations: Updated German (Thanks Dietmar!)
|
443 |
+
* Translations: Place your custom translations in wp-content/languages/woocommerce-pdf-invoices-packing-slips/wpo_wcpdf-LOCALE.mo to protect them from being overwritten by plugin updates.
|
444 |
+
|
445 |
+
= 1.4.13 =
|
446 |
+
* Feature: use separate file for all your template specific functions (template-functions.php)
|
447 |
+
* Translations: Added Slovenian (thanks gregy1403!)
|
448 |
+
* Translations: Updated Norwegian & Dutch.
|
449 |
+
* Translations: Added Japanese - needs custom font!
|
450 |
+
* FAQ: instructions on how to use custom fonts
|
451 |
+
|
452 |
+
= 1.4.12 =
|
453 |
+
* Fix: issues with post parent objects (WC2.1 and older)
|
454 |
+
|
455 |
+
= 1.4.11 =
|
456 |
+
* Small fix: bulk actions for specific i18n configurations
|
457 |
+
* Tweak: total row key used as class in Simple template
|
458 |
+
|
459 |
+
= 1.4.10 =
|
460 |
+
* Fix: Invoice not attaching
|
461 |
+
* Translations: Updated POT file
|
462 |
+
* Translations: Updated Dutch, Norwegian, Polish, Brazilian Portugese, Romanian, Russian, Slovak, Spanish & Ukrainian (Many thanks to all the translators!)
|
463 |
+
* Templates: added action hooks for easier customizations (`wpo_wcpdf_before_order_details`, `wpo_wcpdf_after_order_details`, `wpo_wcpdf_invoice_title` & `wpo_wcpdf_packing_slip_title`)
|
464 |
+
|
465 |
+
= 1.4.9 =
|
466 |
+
* Feature: Order number and date are now displayed by default in the Simple template (invoice number and date still optional)
|
467 |
+
* Feature: Display Customer/Order notes with a simple shorthand (see FAQ)
|
468 |
+
* Translations: Added Brazilian Portugese (thanks Victor Debone!)
|
469 |
+
* Tweak: Fail more gracefully when there are errors during PDF generation
|
470 |
+
* Tweak: added template type class to template output body
|
471 |
+
* Tweak: cleaned up Simple template style.css
|
472 |
+
|
473 |
+
= 1.4.8 =
|
474 |
+
* Translations: Added Finnish (Thanks Sami Mäkelä/Contrast.fi!)
|
475 |
+
|
476 |
+
= 1.4.7 =
|
477 |
+
* Fix: check if image file exists locally, fallback to url if not (CDN compatibility)
|
478 |
+
* Fix: make deleting invoice date possible
|
479 |
+
* Fix: correct tmp folder check on status page
|
480 |
+
* Translations: updated po/mo files
|
481 |
+
* Tweak: changed settings capability requirement to `manage_woocommerce` (was: `manage_options`)
|
482 |
+
* Tweak: better email attachment function
|
483 |
+
* Tweak: prevent footer overlap (Simple template)
|
484 |
+
* Tweak: fallback if `glob()` is not allowed on the server
|
485 |
+
* Tweak: better custom template instructions (reflects path to actual (child-)theme)
|
486 |
+
|
487 |
+
= 1.4.6 =
|
488 |
+
* HOTFIX: WooCommerce 2.2 compatibility fix
|
489 |
+
* Filter for PDF temp folder (wpo_wcpdf_tmp_path)
|
490 |
+
|
491 |
+
= 1.4.5 =
|
492 |
+
* Fix: Double date conversion for order date on invoice number filter (to avoid i18n date issues)
|
493 |
+
* Fix: Template selector reset after update
|
494 |
+
* Translations: added Norwegian (Thanks Aleksander!)
|
495 |
+
|
496 |
+
= 1.4.4 =
|
497 |
+
* Feature: Editable invoice date per order/invoice.
|
498 |
+
* Feature: HTML is now allowed in footer and other settings fields.
|
499 |
+
* Translations: Updated German (Thanks Nadine!)
|
500 |
+
* Fix: template paths are now saved relative to the site base path (ABSPATH) to prevent errors when moving to another server
|
501 |
+
* Tweak: Changed bulk action hook for better theme compatibility
|
502 |
+
* Tweak: Newlines in custom checkout fields
|
503 |
+
|
504 |
+
= 1.4.3 =
|
505 |
+
* Feature: Added function to call custom fields more easily (see FAQ)
|
506 |
+
* Feature: Change the my account button text via a filter (wpo_wcpdf_myaccount_button_text)
|
507 |
+
* Translations: Added Danish (Thanks Mads!)
|
508 |
+
* Tweak: only load PDF engine if it's not already loaded by another plugin
|
509 |
+
|
510 |
+
= 1.4.2 =
|
511 |
+
* Fix: Don't create invoice number when exporting packing slips
|
512 |
+
* Fix: Division by zero for 0 quantity items
|
513 |
+
|
514 |
+
= 1.4.1 =
|
515 |
+
* Translations: Added Polish (Thanks Mike!)
|
516 |
+
* Fix: Invoice number formatting notices in debug mode
|
517 |
+
|
518 |
+
= 1.4.0 =
|
519 |
+
* Feature: Invoice numbers can now be given a prefix, suffix or padding on the settings page!
|
520 |
+
* Filter: `wpo_wcpdf_email_allowed_statuses` to attach pdf to custom order status emails
|
521 |
+
* Tweak: Sequential Order Numbers Pro compatibility
|
522 |
+
* Tweak: Filenames are now automatically sanitized to prevent issues with illegal characters
|
523 |
+
|
524 |
+
= 1.3.2 =
|
525 |
+
* Fix: error on wpo_wcpdf_email_attachment filter when $pdf_path not set
|
526 |
+
|
527 |
+
= 1.3.1 =
|
528 |
+
* Fix: invoice number was cleared when Order Actions were being used when an invoice number was not set
|
529 |
+
* Translations: Updated Slovak (Thanks Jozef!)
|
530 |
+
* Translations: Added Czech (Thanks CubiQ!)
|
531 |
+
|
532 |
+
= 1.3.0 =
|
533 |
+
* Feature: Added 'status' panel for better problem diagnosis
|
534 |
+
* Tweak: split create & get invoice number calls to prevent slow database calls from causing number skipping
|
535 |
+
* Translations: Added Romanian (Thanks Leonardo!)
|
536 |
+
* Translations: Added Slovak (Thanks Oleg!)
|
537 |
+
|
538 |
+
= 1.2.13 =
|
539 |
+
* Feature: added filter for custom email attachment condition (wpo_wcpdf_custom_email_condition)
|
540 |
+
* Fix: warning for tax implode
|
541 |
+
|
542 |
+
= 1.2.12 =
|
543 |
+
* Fix: hyperlink underline (was more like a strikethrough)
|
544 |
+
|
545 |
+
= 1.2.11 =
|
546 |
+
* Translations: Fixed German spelling error
|
547 |
+
* Translations: Updated Swedish (Thanks Fredrik!)
|
548 |
+
|
549 |
+
= 1.2.10 =
|
550 |
+
* Translations: Added Swedish (Thanks Jonathan!)
|
551 |
+
* Fix: Line-height issue (on some systems, the space between lines was very high)
|
552 |
+
|
553 |
+
= 1.2.9 =
|
554 |
+
* Fix: bug where 'standard' tax class would not display in some cases
|
555 |
+
* Fix: bug that caused the totals to jump for some font sizes
|
556 |
+
* Fix: WC2.1 deprecated totals function
|
557 |
+
* Fix: If multiple taxes were set up with the same name, only one would display (Simple template was not affected)
|
558 |
+
|
559 |
+
= 1.2.8 =
|
560 |
+
* Template: Body line-height defined to prevent character jumping with italic texts
|
561 |
+
* Fix: Open Sans now included in plugin package (fixes font issues for servers with allow_url_fopen disabled)
|
562 |
+
|
563 |
+
= 1.2.7 =
|
564 |
+
* Translations: POT, DE & NL updated
|
565 |
+
* Fix: Removed stray span tag in totals table
|
566 |
+
|
567 |
+
= 1.2.6 =
|
568 |
+
* Translations: Spanish update (thanks prepu!)
|
569 |
+
* Fix: More advanced checks to determine if a customer can download the invoice (including a status filter)
|
570 |
+
|
571 |
+
= 1.2.5 =
|
572 |
+
* Feature: Optional Invoice Number column for the orders listing
|
573 |
+
* Feature: Better support for international characters
|
574 |
+
* Translations: Added Russian & Ukrainian translation (thanks Oleg!)
|
575 |
+
* Translations: Updated Spanish (Thanks Manuel!) and Dutch translations & POT file
|
576 |
+
* Tweak: Memory limit notice
|
577 |
+
* Tweak: Filename name now includes invoice number (when configured in the settings)
|
578 |
+
|
579 |
+
= 1.2.4 =
|
580 |
+
* Feature: Set which type of emails you want to attach the invoice to
|
581 |
+
|
582 |
+
= 1.2.3 =
|
583 |
+
* Feature: Manually edit invoice number on the edit order screen
|
584 |
+
* Feature: Set the first (/next) invoice number on the settings screen
|
585 |
+
* Fix: Bug where invoice number would be generated twice due to slow database calls
|
586 |
+
* Fix: php strict warnings
|
587 |
+
|
588 |
+
= 1.2.2 =
|
589 |
+
* Feature: Simple template now uses Open Sans to include more international special characters
|
590 |
+
* Feature: Implemented filters for paper size & orientation ([read here](http://wordpress.org/support/topic/select-a5-paper-size-for-packing-slips?replies=5#post-5211129))
|
591 |
+
* Tweak: PDF engine updated (dompdf 0.6.0)
|
592 |
+
* Tweak: Download PDF link on the my account page is now only shown when an invoice is already created by the admin or automatically, to prevent unwanted invoice created (creating problems with european laws).
|
593 |
+
|
594 |
+
= 1.2.1 =
|
595 |
+
* Fix: shipping & fees functions didn't output correctly with the tax set to 'incl'
|
596 |
+
|
597 |
+
= 1.2.0 =
|
598 |
+
* Feature: Sequential invoice numbers (set upon invoice creation).
|
599 |
+
* Feature: Invoice date (set upon invoice creation).
|
600 |
+
|
601 |
+
= 1.1.6 =
|
602 |
+
* Feature: Hungarian translations added - thanks Joseph!
|
603 |
+
* Tweak: Better debug code.
|
604 |
+
* Tweak: Error reporting when templates not found.
|
605 |
+
* Fix: tax rate calculation for free items.
|
606 |
+
|
607 |
+
= 1.1.5 =
|
608 |
+
* Feature: German translations added - thanks Christian!
|
609 |
+
* Fix: dompdf 0.6.0 proved to be less stable, so switching back to beta3 for now.
|
610 |
+
|
611 |
+
= 1.1.4 =
|
612 |
+
* Fix: Template paths on windows servers were not properly saved (stripslashes), resulting in an empty output.
|
613 |
+
|
614 |
+
= 1.1.3 =
|
615 |
+
* Feature: PDF engine (dompdf) updated to 0.6.0 for better stability and utf-8 support.
|
616 |
+
* Tweak: Local server path is used for header image for better compatibility with server settings.
|
617 |
+
* Fix: several small bugs.
|
618 |
+
|
619 |
+
= 1.1.2 =
|
620 |
+
* Feature: Totals can now be called with simpler template functions
|
621 |
+
* Feature: Italian translations - thanks max66max!
|
622 |
+
* Tweak: improved memory performance
|
623 |
+
|
624 |
+
= 1.1.1 =
|
625 |
+
* Feature: French translations - thanks Guillaume!
|
626 |
+
|
627 |
+
= 1.1.0 =
|
628 |
+
* Feature: Fees can now also be called ex. VAT
|
629 |
+
* Feature: Invoices can now be downloaded from the My Account page
|
630 |
+
* Feature: Spanish translation & POT file included
|
631 |
+
* Fix: ternary statements that caused an error
|
632 |
+
|
633 |
+
= 1.0.1 =
|
634 |
+
* Tweak: Packing slip now displays shipping address instead of billing address
|
635 |
+
* Tweak: Variation data is now displayed by default
|
636 |
+
|
637 |
+
= 1.0.0 =
|
638 |
+
* First release
|
639 |
+
|
640 |
+
== Upgrade Notice ==
|
641 |
+
|
642 |
+
= 1.5 =
|
643 |
+
Version 1.5 changes where temporary files are stored - everything is now stored centrally in the WP uploads folder. For backwards compatibility, this feature is turned off by default, but we recommend to use the new folders. Check the plugin Status panel for more information!
|
woocommerce-pdf-invoices-packingslips.php
CHANGED
@@ -1,994 +1,994 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Plugin Name: WooCommerce PDF Invoices & Packing Slips
|
4 |
-
* Plugin URI: http://www.wpovernight.com
|
5 |
-
* Description: Create, print & email PDF invoices & packing slips for WooCommerce orders.
|
6 |
-
* Version: 1.5.
|
7 |
-
* Author: Ewout Fernhout
|
8 |
-
* Author URI: http://www.wpovernight.com
|
9 |
-
* License: GPLv2 or later
|
10 |
-
* License URI: http://www.opensource.org/licenses/gpl-license.php
|
11 |
-
* Text Domain: wpo_wcpdf
|
12 |
-
*/
|
13 |
-
|
14 |
-
if ( !class_exists( 'WooCommerce_PDF_Invoices' ) ) {
|
15 |
-
|
16 |
-
class WooCommerce_PDF_Invoices {
|
17 |
-
|
18 |
-
public static $plugin_prefix;
|
19 |
-
public static $plugin_url;
|
20 |
-
public static $plugin_path;
|
21 |
-
public static $plugin_basename;
|
22 |
-
public static $version;
|
23 |
-
|
24 |
-
public $writepanels;
|
25 |
-
public $settings;
|
26 |
-
public $export;
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Constructor
|
30 |
-
*/
|
31 |
-
public function __construct() {
|
32 |
-
self::$plugin_prefix = 'wpo_wcpdf_';
|
33 |
-
self::$plugin_basename = plugin_basename(__FILE__);
|
34 |
-
self::$plugin_url = plugin_dir_url(self::$plugin_basename);
|
35 |
-
self::$plugin_path = trailingslashit(dirname(__FILE__));
|
36 |
-
self::$version = '1.5.
|
37 |
-
|
38 |
-
// load the localisation & classes
|
39 |
-
add_action( 'plugins_loaded', array( $this, 'translations' ) ); // or use init?
|
40 |
-
add_action( 'init', array( $this, 'load_classes' ) );
|
41 |
-
|
42 |
-
// run lifecycle methods
|
43 |
-
if ( is_admin() && ! defined( 'DOING_AJAX' ) ) {
|
44 |
-
// check if upgrading from versionless (1.4.14 and older)
|
45 |
-
if ( get_option('wpo_wcpdf_general_settings') && get_option('wpo_wcpdf_version') === false ) {
|
46 |
-
// tag 'versionless', so that we can apply necessary upgrade settings
|
47 |
-
add_option( 'wpo_wcpdf_version', 'versionless' );
|
48 |
-
}
|
49 |
-
|
50 |
-
add_action( 'wp_loaded', array( $this, 'do_install' ) );
|
51 |
-
}
|
52 |
-
}
|
53 |
-
|
54 |
-
/**
|
55 |
-
* Load the translation / textdomain files
|
56 |
-
*
|
57 |
-
* Note: the first-loaded translation file overrides any following ones if the same translation is present
|
58 |
-
*/
|
59 |
-
public function translations() {
|
60 |
-
$locale = apply_filters( 'plugin_locale', get_locale(), 'wpo_wcpdf' );
|
61 |
-
$dir = trailingslashit( WP_LANG_DIR );
|
62 |
-
|
63 |
-
/**
|
64 |
-
* Frontend/global Locale. Looks in:
|
65 |
-
*
|
66 |
-
* - WP_LANG_DIR/woocommerce-pdf-invoices-packing-slips/wpo_wcpdf-LOCALE.mo
|
67 |
-
* - WP_LANG_DIR/plugins/wpo_wcpdf-LOCALE.mo
|
68 |
-
* - woocommerce-pdf-invoices-packing-slips/languages/wpo_wcpdf-LOCALE.mo (which if not found falls back to:)
|
69 |
-
* - WP_LANG_DIR/plugins/wpo_wcpdf-LOCALE.mo
|
70 |
-
*/
|
71 |
-
load_textdomain( 'wpo_wcpdf', $dir . 'woocommerce-pdf-invoices-packing-slips/wpo_wcpdf-' . $locale . '.mo' );
|
72 |
-
load_textdomain( 'wpo_wcpdf', $dir . 'plugins/wpo_wcpdf-' . $locale . '.mo' );
|
73 |
-
load_plugin_textdomain( 'wpo_wcpdf', false, dirname( self::$plugin_basename ) . '/languages' );
|
74 |
-
}
|
75 |
-
|
76 |
-
/**
|
77 |
-
* Load the main plugin classes and functions
|
78 |
-
*/
|
79 |
-
public function includes() {
|
80 |
-
include_once( 'includes/class-wcpdf-settings.php' );
|
81 |
-
include_once( 'includes/class-wcpdf-writepanels.php' );
|
82 |
-
include_once( 'includes/class-wcpdf-export.php' );
|
83 |
-
}
|
84 |
-
|
85 |
-
|
86 |
-
/**
|
87 |
-
* Instantiate classes when woocommerce is activated
|
88 |
-
*/
|
89 |
-
public function load_classes() {
|
90 |
-
if ( $this->is_woocommerce_activated() ) {
|
91 |
-
$this->includes();
|
92 |
-
$this->settings = new WooCommerce_PDF_Invoices_Settings();
|
93 |
-
$this->writepanels = new WooCommerce_PDF_Invoices_Writepanels();
|
94 |
-
$this->export = new WooCommerce_PDF_Invoices_Export();
|
95 |
-
} else {
|
96 |
-
// display notice instead
|
97 |
-
add_action( 'admin_notices', array ( $this, 'need_woocommerce' ) );
|
98 |
-
}
|
99 |
-
|
100 |
-
}
|
101 |
-
|
102 |
-
/**
|
103 |
-
* Check if woocommerce is activated
|
104 |
-
*/
|
105 |
-
public function is_woocommerce_activated() {
|
106 |
-
$blog_plugins = get_option( 'active_plugins', array() );
|
107 |
-
$site_plugins = is_multisite() ? (array) maybe_unserialize( get_site_option('active_sitewide_plugins' ) ) : array();
|
108 |
-
|
109 |
-
if ( in_array( 'woocommerce/woocommerce.php', $blog_plugins ) || isset( $site_plugins['woocommerce/woocommerce.php'] ) ) {
|
110 |
-
return true;
|
111 |
-
} else {
|
112 |
-
return false;
|
113 |
-
}
|
114 |
-
}
|
115 |
-
|
116 |
-
/**
|
117 |
-
* WooCommerce not active notice.
|
118 |
-
*
|
119 |
-
* @return string Fallack notice.
|
120 |
-
*/
|
121 |
-
|
122 |
-
public function need_woocommerce() {
|
123 |
-
$error = sprintf( __( 'WooCommerce PDF Invoices & Packing Slips requires %sWooCommerce%s to be installed & activated!' , 'wpo_wcpdf' ), '<a href="http://wordpress.org/extend/plugins/woocommerce/">', '</a>' );
|
124 |
-
|
125 |
-
$message = '<div class="error"><p>' . $error . '</p></div>';
|
126 |
-
|
127 |
-
echo $message;
|
128 |
-
}
|
129 |
-
|
130 |
-
/** Lifecycle methods *******************************************************
|
131 |
-
* Because register_activation_hook only runs when the plugin is manually
|
132 |
-
* activated by the user, we're checking the current version against the
|
133 |
-
* version stored in the database
|
134 |
-
****************************************************************************/
|
135 |
-
|
136 |
-
/**
|
137 |
-
* Handles version checking
|
138 |
-
*/
|
139 |
-
public function do_install() {
|
140 |
-
// only install when woocommerce is active
|
141 |
-
if ( !$this->is_woocommerce_activated() ) {
|
142 |
-
return;
|
143 |
-
}
|
144 |
-
|
145 |
-
$version_setting = 'wpo_wcpdf_version';
|
146 |
-
$installed_version = get_option( $version_setting );
|
147 |
-
|
148 |
-
// installed version lower than plugin version?
|
149 |
-
if ( version_compare( $installed_version, self::$version, '<' ) ) {
|
150 |
-
|
151 |
-
if ( ! $installed_version ) {
|
152 |
-
$this->install();
|
153 |
-
} else {
|
154 |
-
$this->upgrade( $installed_version );
|
155 |
-
}
|
156 |
-
|
157 |
-
// new version number
|
158 |
-
update_option( $version_setting, self::$version );
|
159 |
-
}
|
160 |
-
}
|
161 |
-
|
162 |
-
|
163 |
-
/**
|
164 |
-
* Plugin install method. Perform any installation tasks here
|
165 |
-
*/
|
166 |
-
protected function install() {
|
167 |
-
// Create temp folders
|
168 |
-
$tmp_base = $this->export->get_tmp_base();
|
169 |
-
|
170 |
-
// check if tmp folder exists => if not, initialize
|
171 |
-
if ( !@is_dir( $tmp_base ) ) {
|
172 |
-
$this->export->init_tmp( $tmp_base );
|
173 |
-
}
|
174 |
-
|
175 |
-
}
|
176 |
-
|
177 |
-
|
178 |
-
/**
|
179 |
-
* Plugin upgrade method. Perform any required upgrades here
|
180 |
-
*
|
181 |
-
* @param string $installed_version the currently installed version
|
182 |
-
*/
|
183 |
-
protected function upgrade( $installed_version ) {
|
184 |
-
if ( $installed_version == 'versionless') { // versionless = 1.4.14 and older
|
185 |
-
// We're upgrading from an old version, so we're enabling the option to use the plugin tmp folder.
|
186 |
-
// This is not per se the 'best' solution, but the good thing is that nothing is changed
|
187 |
-
// and nothing will be broken (that wasn't broken before)
|
188 |
-
$default = array( 'old_tmp' => 1 );
|
189 |
-
update_option( 'wpo_wcpdf_debug_settings', $default );
|
190 |
-
}
|
191 |
-
|
192 |
-
// sync fonts on every upgrade!
|
193 |
-
$debug_settings = get_option( 'wpo_wcpdf_debug_settings' ); // get temp setting
|
194 |
-
|
195 |
-
// do not copy if old_tmp function active! (double check for slow databases)
|
196 |
-
if ( !( isset($debug_settings['old_tmp']) || $installed_version == 'versionless' ) ) {
|
197 |
-
$tmp_base = $this->export->get_tmp_base();
|
198 |
-
|
199 |
-
// check if tmp folder exists => if not, initialize
|
200 |
-
if ( !@is_dir( $tmp_base ) ) {
|
201 |
-
$this->export->init_tmp( $tmp_base );
|
202 |
-
}
|
203 |
-
|
204 |
-
$font_path = $tmp_base . 'fonts/';
|
205 |
-
$this->export->copy_fonts( $font_path );
|
206 |
-
}
|
207 |
-
|
208 |
-
// 1.5.28 update: copy next invoice number to separate setting
|
209 |
-
if ( $installed_version == 'versionless' || version_compare( $installed_version, '1.5.28', '<' ) ) {
|
210 |
-
$template_settings = get_option( 'wpo_wcpdf_template_settings' );
|
211 |
-
$next_invoice_number = isset($template_settings['next_invoice_number'])?$template_settings['next_invoice_number']:'';
|
212 |
-
update_option( 'wpo_wcpdf_next_invoice_number', $next_invoice_number );
|
213 |
-
}
|
214 |
-
}
|
215 |
-
|
216 |
-
/***********************************************************************/
|
217 |
-
/********************** GENERAL TEMPLATE FUNCTIONS *********************/
|
218 |
-
/***********************************************************************/
|
219 |
-
|
220 |
-
/**
|
221 |
-
* Get template name from slug
|
222 |
-
*/
|
223 |
-
public function get_template_name ( $template_type ) {
|
224 |
-
switch ( $template_type ) {
|
225 |
-
case 'invoice':
|
226 |
-
$template_name = apply_filters( 'wpo_wcpdf_invoice_title', __( 'Invoice', 'wpo_wcpdf' ) );
|
227 |
-
break;
|
228 |
-
case 'packing-slip':
|
229 |
-
$template_name = apply_filters( 'wpo_wcpdf_packing_slip_title', __( 'Packing Slip', 'wpo_wcpdf' ) );
|
230 |
-
break;
|
231 |
-
default:
|
232 |
-
// try to 'unslug' the name
|
233 |
-
$template_name = ucwords( str_replace( array( '_', '-' ), ' ', $template_type ) );
|
234 |
-
break;
|
235 |
-
}
|
236 |
-
|
237 |
-
return apply_filters( 'wpo_wcpdf_template_name', $template_name, $template_type );
|
238 |
-
}
|
239 |
-
|
240 |
-
/**
|
241 |
-
* Output template styles
|
242 |
-
*/
|
243 |
-
public function template_styles() {
|
244 |
-
$css = apply_filters( 'wpo_wcpdf_template_styles_file', $this->export->template_path. '/' .'style.css' );
|
245 |
-
|
246 |
-
ob_start();
|
247 |
-
if (file_exists($css)) {
|
248 |
-
include($css);
|
249 |
-
}
|
250 |
-
$html = ob_get_clean();
|
251 |
-
$html = apply_filters( 'wpo_wcpdf_template_styles', $html );
|
252 |
-
|
253 |
-
echo $html;
|
254 |
-
}
|
255 |
-
|
256 |
-
/**
|
257 |
-
* Return logo id
|
258 |
-
*/
|
259 |
-
public function get_header_logo_id() {
|
260 |
-
if (isset($this->settings->template_settings['header_logo'])) {
|
261 |
-
return apply_filters( 'wpo_wcpdf_header_logo_id', $this->settings->template_settings['header_logo'] );
|
262 |
-
}
|
263 |
-
}
|
264 |
-
|
265 |
-
/**
|
266 |
-
* Show logo html
|
267 |
-
*/
|
268 |
-
public function header_logo() {
|
269 |
-
if ($this->get_header_logo_id()) {
|
270 |
-
$attachment_id = $this->get_header_logo_id();
|
271 |
-
$company = isset($this->settings->template_settings['shop_name'])? $this->settings->template_settings['shop_name'] : '';
|
272 |
-
if( $attachment_id ) {
|
273 |
-
$attachment = wp_get_attachment_image_src( $attachment_id, 'full', false );
|
274 |
-
|
275 |
-
$attachment_src = $attachment[0];
|
276 |
-
$attachment_width = $attachment[1];
|
277 |
-
$attachment_height = $attachment[2];
|
278 |
-
|
279 |
-
$attachment_path = get_attached_file( $attachment_id );
|
280 |
-
|
281 |
-
if ( apply_filters('wpo_wcpdf_use_path', true) && file_exists($attachment_path) ) {
|
282 |
-
$src = $attachment_path;
|
283 |
-
} else {
|
284 |
-
$src = $attachment_src;
|
285 |
-
}
|
286 |
-
|
287 |
-
printf('<img src="%1$s" width="%2$d" height="%3$d" alt="%4$s" />', $src, $attachment_width, $attachment_height, esc_attr( $company ) );
|
288 |
-
}
|
289 |
-
}
|
290 |
-
}
|
291 |
-
|
292 |
-
/**
|
293 |
-
* Return/Show custom company name or default to blog name
|
294 |
-
*/
|
295 |
-
public function get_shop_name() {
|
296 |
-
if (!empty($this->settings->template_settings['shop_name'])) {
|
297 |
-
$name = trim( $this->settings->template_settings['shop_name'] );
|
298 |
-
return apply_filters( 'wpo_wcpdf_shop_name', wptexturize( $name ) );
|
299 |
-
} else {
|
300 |
-
return apply_filters( 'wpo_wcpdf_shop_name', get_bloginfo( 'name' ) );
|
301 |
-
}
|
302 |
-
}
|
303 |
-
public function shop_name() {
|
304 |
-
echo $this->get_shop_name();
|
305 |
-
}
|
306 |
-
|
307 |
-
/**
|
308 |
-
* Return/Show shop/company address if provided
|
309 |
-
*/
|
310 |
-
public function get_shop_address() {
|
311 |
-
$shop_address = apply_filters( 'wpo_wcpdf_shop_address', wpautop( wptexturize( $this->settings->template_settings['shop_address'] ) ) );
|
312 |
-
if (!empty($shop_address)) {
|
313 |
-
return $shop_address;
|
314 |
-
} else {
|
315 |
-
return false;
|
316 |
-
}
|
317 |
-
}
|
318 |
-
public function shop_address() {
|
319 |
-
echo $this->get_shop_address();
|
320 |
-
}
|
321 |
-
|
322 |
-
/**
|
323 |
-
* Check if billing address and shipping address are equal
|
324 |
-
*/
|
325 |
-
public function ships_to_different_address() {
|
326 |
-
// always prefer parent address for refunds
|
327 |
-
if ( get_post_type( $this->export->order->id ) == 'shop_order_refund' && $parent_order_id = wp_get_post_parent_id( $this->export->order->id ) ) {
|
328 |
-
// temporarily switch order to make all filters / order calls work correctly
|
329 |
-
$order_meta = get_post_meta( $parent_order_id );
|
330 |
-
} else {
|
331 |
-
$order_meta = get_post_meta( $this->export->order->id );
|
332 |
-
}
|
333 |
-
|
334 |
-
$address_comparison_fields = apply_filters( 'wpo_wcpdf_address_comparison_fields', array(
|
335 |
-
'first_name',
|
336 |
-
'last_name',
|
337 |
-
'company',
|
338 |
-
'address_1',
|
339 |
-
'address_2',
|
340 |
-
'city',
|
341 |
-
'state',
|
342 |
-
'postcode',
|
343 |
-
'country'
|
344 |
-
) );
|
345 |
-
|
346 |
-
foreach ($address_comparison_fields as $address_field) {
|
347 |
-
$billing_field = isset( $order_meta['_billing_'.$address_field] ) ? $order_meta['_billing_'.$address_field] : '';
|
348 |
-
$shipping_field = isset( $order_meta['_shipping_'.$address_field] ) ? $order_meta['_shipping_'.$address_field] : '';
|
349 |
-
if ( $shipping_field != $billing_field ) {
|
350 |
-
// this address field is different -> ships to different address!
|
351 |
-
return true;
|
352 |
-
}
|
353 |
-
}
|
354 |
-
|
355 |
-
//if we got here, it means the addresses are equal -> doesn't ship to different address!
|
356 |
-
return apply_filters( 'wpo_wcpdf_ships_to_different_address', false, $order_meta );
|
357 |
-
}
|
358 |
-
|
359 |
-
/**
|
360 |
-
* Return/Show billing address
|
361 |
-
*/
|
362 |
-
public function get_billing_address() {
|
363 |
-
// always prefer parent billing address for refunds
|
364 |
-
if ( get_post_type( $this->export->order->id ) == 'shop_order_refund' && $parent_order_id = wp_get_post_parent_id( $this->export->order->id ) ) {
|
365 |
-
// temporarily switch order to make all filters / order calls work correctly
|
366 |
-
$current_order = $this->export->order;
|
367 |
-
$this->export->order = new WC_Order( $parent_order_id );
|
368 |
-
$address = apply_filters( 'wpo_wcpdf_billing_address', $this->export->order->get_formatted_billing_address() );
|
369 |
-
// switch back & unset
|
370 |
-
$this->export->order = $current_order;
|
371 |
-
unset($current_order);
|
372 |
-
} elseif ( $address = $this->export->order->get_formatted_billing_address() ) {
|
373 |
-
// regular shop_order
|
374 |
-
$address = apply_filters( 'wpo_wcpdf_billing_address', $address );
|
375 |
-
} else {
|
376 |
-
// no address
|
377 |
-
$address = apply_filters( 'wpo_wcpdf_billing_address', __('N/A', 'wpo_wcpdf') );
|
378 |
-
}
|
379 |
-
|
380 |
-
return $address;
|
381 |
-
}
|
382 |
-
public function billing_address() {
|
383 |
-
echo $this->get_billing_address();
|
384 |
-
}
|
385 |
-
|
386 |
-
/**
|
387 |
-
* Return/Show billing email
|
388 |
-
*/
|
389 |
-
public function get_billing_email() {
|
390 |
-
$billing_email = $this->export->order->billing_email;
|
391 |
-
|
392 |
-
if ( !$billing_email && $parent_order_id = wp_get_post_parent_id( $this->export->order->id ) ) {
|
393 |
-
// try parent
|
394 |
-
$billing_email = get_post_meta( $parent_order_id, '_billing_email', true );
|
395 |
-
}
|
396 |
-
|
397 |
-
return apply_filters( 'wpo_wcpdf_billing_email', $billing_email );
|
398 |
-
}
|
399 |
-
public function billing_email() {
|
400 |
-
echo $this->get_billing_email();
|
401 |
-
}
|
402 |
-
|
403 |
-
/**
|
404 |
-
* Return/Show billing phone
|
405 |
-
*/
|
406 |
-
public function get_billing_phone() {
|
407 |
-
$billing_phone = $this->export->order->billing_phone;
|
408 |
-
|
409 |
-
if ( !$billing_phone && $parent_order_id = wp_get_post_parent_id( $this->export->order->id ) ) {
|
410 |
-
// try parent
|
411 |
-
$billing_phone = get_post_meta( $parent_order_id, '_billing_phone', true );
|
412 |
-
}
|
413 |
-
|
414 |
-
return apply_filters( 'wpo_wcpdf_billing_phone', $billing_phone );
|
415 |
-
}
|
416 |
-
public function billing_phone() {
|
417 |
-
echo $this->get_billing_phone();
|
418 |
-
}
|
419 |
-
|
420 |
-
/**
|
421 |
-
* Return/Show shipping address
|
422 |
-
*/
|
423 |
-
public function get_shipping_address() {
|
424 |
-
// always prefer parent shipping address for refunds
|
425 |
-
if ( get_post_type( $this->export->order->id ) == 'shop_order_refund' && $parent_order_id = wp_get_post_parent_id( $this->export->order->id ) ) {
|
426 |
-
// temporarily switch order to make all filters / order calls work correctly
|
427 |
-
$current_order = $this->export->order;
|
428 |
-
$this->export->order = new WC_Order( $parent_order_id );
|
429 |
-
$address = apply_filters( 'wpo_wcpdf_shipping_address', $this->export->order->get_formatted_shipping_address() );
|
430 |
-
// switch back & unset
|
431 |
-
$this->export->order = $current_order;
|
432 |
-
unset($current_order);
|
433 |
-
} elseif ( $address = $this->export->order->get_formatted_shipping_address() ) {
|
434 |
-
// regular shop_order
|
435 |
-
$address = apply_filters( 'wpo_wcpdf_shipping_address', $address );
|
436 |
-
} else {
|
437 |
-
// no address
|
438 |
-
$address = apply_filters( 'wpo_wcpdf_shipping_address', __('N/A', 'wpo_wcpdf') );
|
439 |
-
}
|
440 |
-
|
441 |
-
return $address;
|
442 |
-
}
|
443 |
-
public function shipping_address() {
|
444 |
-
echo $this->get_shipping_address();
|
445 |
-
}
|
446 |
-
|
447 |
-
/**
|
448 |
-
* Return/Show a custom field
|
449 |
-
*/
|
450 |
-
public function get_custom_field( $field_name ) {
|
451 |
-
$custom_field = get_post_meta($this->export->order->id,$field_name,true);
|
452 |
-
|
453 |
-
if ( !$custom_field && $parent_order_id = wp_get_post_parent_id( $this->export->order->id ) ) {
|
454 |
-
// try parent
|
455 |
-
$custom_field = get_post_meta( $parent_order_id, $field_name, true );
|
456 |
-
}
|
457 |
-
|
458 |
-
return apply_filters( 'wpo_wcpdf_billing_custom_field', $custom_field );
|
459 |
-
}
|
460 |
-
public function custom_field( $field_name, $field_label = '', $display_empty = false ) {
|
461 |
-
$custom_field = $this->get_custom_field( $field_name );
|
462 |
-
if (!empty($field_label)){
|
463 |
-
// add a a trailing space to the label
|
464 |
-
$field_label .= ' ';
|
465 |
-
}
|
466 |
-
|
467 |
-
if (!empty($custom_field) || $display_empty) {
|
468 |
-
echo $field_label . nl2br ($custom_field);
|
469 |
-
}
|
470 |
-
}
|
471 |
-
|
472 |
-
/**
|
473 |
-
* Return/Show order notes
|
474 |
-
*/
|
475 |
-
public function get_order_notes( $filter = 'customer' ) {
|
476 |
-
if ( get_post_type( $this->export->order->id ) == 'shop_order_refund' && $parent_order_id = wp_get_post_parent_id( $this->export->order->id ) ) {
|
477 |
-
$post_id = $parent_order_id;
|
478 |
-
} else {
|
479 |
-
$post_id = $this->export->order->id;
|
480 |
-
}
|
481 |
-
|
482 |
-
$args = array(
|
483 |
-
'post_id' => $post_id,
|
484 |
-
'approve' => 'approve',
|
485 |
-
'type' => 'order_note'
|
486 |
-
);
|
487 |
-
|
488 |
-
remove_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ), 10, 1 );
|
489 |
-
|
490 |
-
$notes = get_comments( $args );
|
491 |
-
|
492 |
-
add_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ), 10, 1 );
|
493 |
-
|
494 |
-
if ( $notes ) {
|
495 |
-
foreach( $notes as $key => $note ) {
|
496 |
-
if ( $filter == 'customer' && !get_comment_meta( $note->comment_ID, 'is_customer_note', true ) ) {
|
497 |
-
unset($notes[$key]);
|
498 |
-
}
|
499 |
-
if ( $filter == 'private' && get_comment_meta( $note->comment_ID, 'is_customer_note', true ) ) {
|
500 |
-
unset($notes[$key]);
|
501 |
-
}
|
502 |
-
}
|
503 |
-
return $notes;
|
504 |
-
}
|
505 |
-
}
|
506 |
-
public function order_notes( $filter = 'customer' ) {
|
507 |
-
$notes = $this->get_order_notes( $filter );
|
508 |
-
if ( $notes ) {
|
509 |
-
foreach( $notes as $note ) {
|
510 |
-
?>
|
511 |
-
<div class="note_content">
|
512 |
-
<?php echo wpautop( wptexturize( wp_kses_post( $note->comment_content ) ) ); ?>
|
513 |
-
</div>
|
514 |
-
<?php
|
515 |
-
}
|
516 |
-
}
|
517 |
-
}
|
518 |
-
|
519 |
-
/**
|
520 |
-
* Return/Show the current date
|
521 |
-
*/
|
522 |
-
public function get_current_date() {
|
523 |
-
return apply_filters( 'wpo_wcpdf_date', date_i18n( get_option( 'date_format' ) ) );
|
524 |
-
}
|
525 |
-
public function current_date() {
|
526 |
-
echo $this->get_current_date();
|
527 |
-
}
|
528 |
-
|
529 |
-
/**
|
530 |
-
* Return/Show payment method
|
531 |
-
*/
|
532 |
-
public function get_payment_method() {
|
533 |
-
$payment_method_label = __( 'Payment method', 'wpo_wcpdf' );
|
534 |
-
|
535 |
-
$payment_method = __( $this->export->order->payment_method_title, 'woocommerce' );
|
536 |
-
if ( !$payment_method && $parent_order_id = wp_get_post_parent_id( $this->export->order->id ) ) {
|
537 |
-
// try parent
|
538 |
-
$payment_method = get_post_meta( $parent_order_id, '_payment_method_title', true );
|
539 |
-
$payment_method = __( $payment_method, 'woocommerce' );
|
540 |
-
}
|
541 |
-
|
542 |
-
return apply_filters( 'wpo_wcpdf_payment_method', $payment_method );
|
543 |
-
}
|
544 |
-
public function payment_method() {
|
545 |
-
echo $this->get_payment_method();
|
546 |
-
}
|
547 |
-
|
548 |
-
/**
|
549 |
-
* Return/Show shipping method
|
550 |
-
*/
|
551 |
-
public function get_shipping_method() {
|
552 |
-
$shipping_method_label = __( 'Shipping method', 'wpo_wcpdf' );
|
553 |
-
return apply_filters( 'wpo_wcpdf_shipping_method', __( $this->export->order->get_shipping_method(), 'woocommerce' ) );
|
554 |
-
}
|
555 |
-
public function shipping_method() {
|
556 |
-
echo $this->get_shipping_method();
|
557 |
-
}
|
558 |
-
|
559 |
-
/**
|
560 |
-
* Return/Show order number
|
561 |
-
*/
|
562 |
-
public function get_order_number() {
|
563 |
-
// try parent first
|
564 |
-
if ( get_post_type( $this->export->order->id ) == 'shop_order_refund' && $parent_order_id = wp_get_post_parent_id( $this->export->order->id ) ) {
|
565 |
-
$parent_order = new WC_Order( $parent_order_id );
|
566 |
-
$order_number = $parent_order->get_order_number();
|
567 |
-
} else {
|
568 |
-
$order_number = $this->export->order->get_order_number();
|
569 |
-
}
|
570 |
-
|
571 |
-
// Trim the hash to have a clean number but still
|
572 |
-
// support any filters that were applied before.
|
573 |
-
$order_number = ltrim($order_number, '#');
|
574 |
-
return apply_filters( 'wpo_wcpdf_order_number', $order_number);
|
575 |
-
}
|
576 |
-
public function order_number() {
|
577 |
-
echo $this->get_order_number();
|
578 |
-
}
|
579 |
-
|
580 |
-
/**
|
581 |
-
* Return/Show invoice number
|
582 |
-
*/
|
583 |
-
public function get_invoice_number() {
|
584 |
-
// try parent first
|
585 |
-
if ( get_post_type( $this->export->order->id ) == 'shop_order_refund' && $parent_order_id = wp_get_post_parent_id( $this->export->order->id ) ) {
|
586 |
-
$invoice_number = $this->export->get_invoice_number( $parent_order_id );
|
587 |
-
} else {
|
588 |
-
$invoice_number = $this->export->get_invoice_number( $this->export->order->id );
|
589 |
-
}
|
590 |
-
|
591 |
-
return $invoice_number;
|
592 |
-
}
|
593 |
-
public function invoice_number() {
|
594 |
-
echo $this->get_invoice_number();
|
595 |
-
}
|
596 |
-
|
597 |
-
/**
|
598 |
-
* Return/Show the order date
|
599 |
-
*/
|
600 |
-
public function get_order_date() {
|
601 |
-
if ( get_post_type( $this->export->order->id ) == 'shop_order_refund' && $parent_order_id = wp_get_post_parent_id( $this->export->order->id ) ) {
|
602 |
-
$parent_order = new WC_Order( $parent_order_id );
|
603 |
-
$order_date = $parent_order->order_date;
|
604 |
-
} else {
|
605 |
-
$order_date = $this->export->order->order_date;
|
606 |
-
}
|
607 |
-
|
608 |
-
$date = date_i18n( get_option( 'date_format' ), strtotime( $order_date ) );
|
609 |
-
return apply_filters( 'wpo_wcpdf_order_date', $date, $order_date );
|
610 |
-
}
|
611 |
-
public function order_date() {
|
612 |
-
echo $this->get_order_date();
|
613 |
-
}
|
614 |
-
|
615 |
-
/**
|
616 |
-
* Return/Show the invoice date
|
617 |
-
*/
|
618 |
-
public function get_invoice_date() {
|
619 |
-
$invoice_date = get_post_meta($this->export->order->id,'_wcpdf_invoice_date',true);
|
620 |
-
|
621 |
-
// add invoice date if it doesn't exist
|
622 |
-
if ( empty($invoice_date) || !isset($invoice_date) ) {
|
623 |
-
$invoice_date = current_time('mysql');
|
624 |
-
update_post_meta( $this->export->order->id, '_wcpdf_invoice_date', $invoice_date );
|
625 |
-
}
|
626 |
-
|
627 |
-
$formatted_invoice_date = date_i18n( get_option( 'date_format' ), strtotime( $invoice_date ) );
|
628 |
-
|
629 |
-
return apply_filters( 'wpo_wcpdf_invoice_date', $formatted_invoice_date, $invoice_date );
|
630 |
-
}
|
631 |
-
public function invoice_date() {
|
632 |
-
echo $this->get_invoice_date();
|
633 |
-
}
|
634 |
-
|
635 |
-
/**
|
636 |
-
* Return the order items
|
637 |
-
*/
|
638 |
-
public function get_order_items() {
|
639 |
-
return apply_filters( 'wpo_wcpdf_order_items', $this->export->get_order_items() );
|
640 |
-
}
|
641 |
-
|
642 |
-
/**
|
643 |
-
* Return/show product attribute
|
644 |
-
*/
|
645 |
-
public function get_product_attribute( $attribute_name, $product ) {
|
646 |
-
// first, check the text attributes
|
647 |
-
$attributes = $product->get_attributes();
|
648 |
-
$attribute_key = @wc_attribute_taxonomy_name( $attribute_name );
|
649 |
-
if (array_key_exists( sanitize_title( $attribute_name ), $attributes) ) {
|
650 |
-
$attribute = $product->get_attribute ( $attribute_name );
|
651 |
-
return $attribute;
|
652 |
-
} elseif (array_key_exists( sanitize_title( $attribute_key ), $attributes) ) {
|
653 |
-
$attribute = $product->get_attribute ( $attribute_key );
|
654 |
-
return $attribute;
|
655 |
-
}
|
656 |
-
|
657 |
-
// not a text attribute, try attribute taxonomy
|
658 |
-
$attribute_key = @wc_attribute_taxonomy_name( $attribute_name );
|
659 |
-
$product_terms = @wc_get_product_terms( $product->id, $attribute_key, array( 'fields' => 'names' ) );
|
660 |
-
// check if not empty, then display
|
661 |
-
if ( !empty($product_terms) ) {
|
662 |
-
$attribute = array_shift( $product_terms );
|
663 |
-
return $attribute;
|
664 |
-
} else {
|
665 |
-
// no attribute under this name
|
666 |
-
return false;
|
667 |
-
}
|
668 |
-
}
|
669 |
-
public function product_attribute( $attribute_name, $product ) {
|
670 |
-
echo $this->get_product_attribute( $attribute_name, $product );
|
671 |
-
}
|
672 |
-
|
673 |
-
|
674 |
-
/**
|
675 |
-
* Return the order totals listing
|
676 |
-
*/
|
677 |
-
public function get_woocommerce_totals() {
|
678 |
-
// get totals and remove the semicolon
|
679 |
-
$totals = apply_filters( 'wpo_wcpdf_raw_order_totals', $this->export->order->get_order_item_totals(), $this->export->order );
|
680 |
-
|
681 |
-
// remove the colon for every label
|
682 |
-
foreach ( $totals as $key => $total ) {
|
683 |
-
$label = $total['label'];
|
684 |
-
$colon = strrpos( $label, ':' );
|
685 |
-
if( $colon !== false ) {
|
686 |
-
$label = substr_replace( $label, '', $colon, 1 );
|
687 |
-
}
|
688 |
-
$totals[$key]['label'] = $label;
|
689 |
-
}
|
690 |
-
|
691 |
-
// WC2.4 fix order_total for refunded orders
|
692 |
-
if ( version_compare( WOOCOMMERCE_VERSION, '2.4', '>=' ) && isset($totals['order_total']) ) {
|
693 |
-
$tax_display = $this->export->order->tax_display_cart;
|
694 |
-
$totals['order_total']['value'] = wc_price( $this->export->order->get_total(), array( 'currency' => $this->export->order->get_order_currency() ) );
|
695 |
-
$order_total = $this->export->order->get_total();
|
696 |
-
$tax_string = '';
|
697 |
-
|
698 |
-
// Tax for inclusive prices
|
699 |
-
if ( wc_tax_enabled() && 'incl' == $tax_display ) {
|
700 |
-
$tax_string_array = array();
|
701 |
-
|
702 |
-
if ( 'itemized' == get_option( 'woocommerce_tax_total_display' ) ) {
|
703 |
-
foreach ( $this->export->order->get_tax_totals() as $code => $tax ) {
|
704 |
-
$tax_amount = $tax->formatted_amount;
|
705 |
-
$tax_string_array[] = sprintf( '%s %s', $tax_amount, $tax->label );
|
706 |
-
}
|
707 |
-
} else {
|
708 |
-
$tax_string_array[] = sprintf( '%s %s', wc_price( $this->export->order->get_total_tax() - $this->export->order->get_total_tax_refunded(), array( 'currency' => $this->export->order->get_order_currency() ) ), WC()->countries->tax_or_vat() );
|
709 |
-
}
|
710 |
-
if ( ! empty( $tax_string_array ) ) {
|
711 |
-
if ( version_compare( WOOCOMMERCE_VERSION, '2.6', '>=' ) ) {
|
712 |
-
$tax_string = ' ' . sprintf( __( '(includes %s)', 'woocommerce' ), implode( ', ', $tax_string_array ) );
|
713 |
-
} else {
|
714 |
-
// use old capitalized string
|
715 |
-
$tax_string = ' ' . sprintf( __( '(Includes %s)', 'woocommerce' ), implode( ', ', $tax_string_array ) );
|
716 |
-
}
|
717 |
-
}
|
718 |
-
}
|
719 |
-
|
720 |
-
$totals['order_total']['value'] .= $tax_string;
|
721 |
-
}
|
722 |
-
|
723 |
-
// remove refund lines (shouldn't be in invoice)
|
724 |
-
foreach ( $totals as $key => $total ) {
|
725 |
-
if ( strpos($key, 'refund_') !== false ) {
|
726 |
-
unset( $totals[$key] );
|
727 |
-
}
|
728 |
-
}
|
729 |
-
|
730 |
-
return apply_filters( 'wpo_wcpdf_woocommerce_totals', $totals, $this->export->order );
|
731 |
-
}
|
732 |
-
|
733 |
-
/**
|
734 |
-
* Return/show the order subtotal
|
735 |
-
*/
|
736 |
-
public function get_order_subtotal( $tax = 'excl', $discount = 'incl' ) { // set $tax to 'incl' to include tax, same for $discount
|
737 |
-
//$compound = ($discount == 'incl')?true:false;
|
738 |
-
|
739 |
-
$subtotal = $this->export->order->get_subtotal_to_display( false, $tax );
|
740 |
-
|
741 |
-
$subtotal = ($pos = strpos($subtotal, ' <small')) ? substr($subtotal, 0, $pos) : $subtotal; //removing the 'excluding tax' text
|
742 |
-
|
743 |
-
$subtotal = array (
|
744 |
-
'label' => __('Subtotal', 'wpo_wcpdf'),
|
745 |
-
'value' => $subtotal,
|
746 |
-
);
|
747 |
-
|
748 |
-
return apply_filters( 'wpo_wcpdf_order_subtotal', $subtotal, $tax, $discount );
|
749 |
-
}
|
750 |
-
public function order_subtotal( $tax = 'excl', $discount = 'incl' ) {
|
751 |
-
$subtotal = $this->get_order_subtotal( $tax, $discount );
|
752 |
-
echo $subtotal['value'];
|
753 |
-
}
|
754 |
-
|
755 |
-
/**
|
756 |
-
* Return/show the order shipping costs
|
757 |
-
*/
|
758 |
-
public function get_order_shipping( $tax = 'excl' ) { // set $tax to 'incl' to include tax
|
759 |
-
if ($tax == 'excl' ) {
|
760 |
-
$shipping_costs = $this->export->wc_price( $this->export->order->order_shipping );
|
761 |
-
} else {
|
762 |
-
$shipping_costs = $this->export->wc_price( $this->export->order->order_shipping + $this->export->order->order_shipping_tax );
|
763 |
-
}
|
764 |
-
|
765 |
-
$shipping = array (
|
766 |
-
'label' => __('Shipping', 'wpo_wcpdf'),
|
767 |
-
'value' => $shipping_costs,
|
768 |
-
'tax' => $this->export->wc_price( $this->export->order->order_shipping_tax ),
|
769 |
-
);
|
770 |
-
return apply_filters( 'wpo_wcpdf_order_shipping', $shipping, $tax );
|
771 |
-
}
|
772 |
-
public function order_shipping( $tax = 'excl' ) {
|
773 |
-
$shipping = $this->get_order_shipping( $tax );
|
774 |
-
echo $shipping['value'];
|
775 |
-
}
|
776 |
-
|
777 |
-
/**
|
778 |
-
* Return/show the total discount
|
779 |
-
*/
|
780 |
-
public function get_order_discount( $type = 'total', $tax = 'incl' ) {
|
781 |
-
if ( $tax == 'incl' ) {
|
782 |
-
switch ($type) {
|
783 |
-
case 'cart':
|
784 |
-
// Cart Discount - pre-tax discounts. (deprecated in WC2.3)
|
785 |
-
$discount_value = $this->export->order->get_cart_discount();
|
786 |
-
break;
|
787 |
-
case 'order':
|
788 |
-
// Order Discount - post-tax discounts. (deprecated in WC2.3)
|
789 |
-
$discount_value = $this->export->order->get_order_discount();
|
790 |
-
break;
|
791 |
-
case 'total':
|
792 |
-
// Total Discount
|
793 |
-
if ( version_compare( WOOCOMMERCE_VERSION, '2.3' ) >= 0 ) {
|
794 |
-
$discount_value = $this->export->order->get_total_discount( false ); // $ex_tax = false
|
795 |
-
} else {
|
796 |
-
// WC2.2 and older: recalculate to include tax
|
797 |
-
$discount_value = 0;
|
798 |
-
$items = $this->export->order->get_items();;
|
799 |
-
if( sizeof( $items ) > 0 ) {
|
800 |
-
foreach( $items as $item ) {
|
801 |
-
$discount_value += ($item['line_subtotal'] + $item['line_subtotal_tax']) - ($item['line_total'] + $item['line_tax']);
|
802 |
-
}
|
803 |
-
}
|
804 |
-
}
|
805 |
-
|
806 |
-
break;
|
807 |
-
default:
|
808 |
-
// Total Discount - Cart & Order Discounts combined
|
809 |
-
$discount_value = $this->export->order->get_total_discount();
|
810 |
-
break;
|
811 |
-
}
|
812 |
-
} else { // calculate discount excluding tax
|
813 |
-
if ( version_compare( WOOCOMMERCE_VERSION, '2.3' ) >= 0 ) {
|
814 |
-
$discount_value = $this->export->order->get_total_discount( true ); // $ex_tax = true
|
815 |
-
} else {
|
816 |
-
// WC2.2 and older: recalculate to exclude tax
|
817 |
-
$discount_value = 0;
|
818 |
-
|
819 |
-
$items = $this->export->order->get_items();;
|
820 |
-
if( sizeof( $items ) > 0 ) {
|
821 |
-
foreach( $items as $item ) {
|
822 |
-
$discount_value += ($item['line_subtotal'] - $item['line_total']);
|
823 |
-
}
|
824 |
-
}
|
825 |
-
}
|
826 |
-
}
|
827 |
-
|
828 |
-
$discount = array (
|
829 |
-
'label' => __('Discount', 'wpo_wcpdf'),
|
830 |
-
'value' => $this->export->wc_price($discount_value),
|
831 |
-
'raw_value' => $discount_value,
|
832 |
-
);
|
833 |
-
|
834 |
-
if ( round( $discount_value, 3 ) != 0 ) {
|
835 |
-
return apply_filters( 'wpo_wcpdf_order_discount', $discount, $type, $tax );
|
836 |
-
}
|
837 |
-
}
|
838 |
-
public function order_discount( $type = 'total', $tax = 'incl' ) {
|
839 |
-
$discount = $this->get_order_discount( $type, $tax );
|
840 |
-
echo $discount['value'];
|
841 |
-
}
|
842 |
-
|
843 |
-
/**
|
844 |
-
* Return the order fees
|
845 |
-
*/
|
846 |
-
public function get_order_fees( $tax = 'excl' ) {
|
847 |
-
if ( $wcfees = $this->export->order->get_fees() ) {
|
848 |
-
foreach( $wcfees as $id => $fee ) {
|
849 |
-
if ($tax == 'excl' ) {
|
850 |
-
$fee_price = $this->export->wc_price( $fee['line_total'] );
|
851 |
-
} else {
|
852 |
-
$fee_price = $this->export->wc_price( $fee['line_total'] + $fee['line_tax'] );
|
853 |
-
}
|
854 |
-
|
855 |
-
$fees[ $id ] = array(
|
856 |
-
'label' => $fee['name'],
|
857 |
-
'value' => $fee_price,
|
858 |
-
'line_total' => $this->export->wc_price($fee['line_total']),
|
859 |
-
'line_tax' => $this->export->wc_price($fee['line_tax'])
|
860 |
-
);
|
861 |
-
}
|
862 |
-
return $fees;
|
863 |
-
}
|
864 |
-
}
|
865 |
-
|
866 |
-
/**
|
867 |
-
* Return the order taxes
|
868 |
-
*/
|
869 |
-
public function get_order_taxes() {
|
870 |
-
$tax_label = __( 'VAT', 'wpo_wcpdf' ); // register alternate label translation
|
871 |
-
$tax_label = __( 'Tax rate', 'wpo_wcpdf' );
|
872 |
-
$tax_rate_ids = $this->export->get_tax_rate_ids();
|
873 |
-
if ($this->export->order->get_taxes()) {
|
874 |
-
foreach ( $this->export->order->get_taxes() as $key => $tax ) {
|
875 |
-
$taxes[ $key ] = array(
|
876 |
-
'label' => isset( $tax[ 'label' ] ) ? $tax[ 'label' ] : $tax[ 'name' ],
|
877 |
-
'value' => $this->export->wc_price( ( $tax[ 'tax_amount' ] + $tax[ 'shipping_tax_amount' ] ) ),
|
878 |
-
'rate_id' => $tax['rate_id'],
|
879 |
-
'tax_amount' => $tax['tax_amount'],
|
880 |
-
'shipping_tax_amount' => $tax['shipping_tax_amount'],
|
881 |
-
'rate' => isset( $tax_rate_ids[ $tax['rate_id'] ] ) ? ( (float) $tax_rate_ids[$tax['rate_id']]['tax_rate'] ) . ' %': '',
|
882 |
-
);
|
883 |
-
}
|
884 |
-
|
885 |
-
return apply_filters( 'wpo_wcpdf_order_taxes', $taxes );
|
886 |
-
}
|
887 |
-
}
|
888 |
-
|
889 |
-
/**
|
890 |
-
* Return/show the order grand total
|
891 |
-
*/
|
892 |
-
public function get_order_grand_total( $tax = 'incl' ) {
|
893 |
-
if ( version_compare( WOOCOMMERCE_VERSION, '2.1' ) >= 0 ) {
|
894 |
-
// WC 2.1 or newer is used
|
895 |
-
$total_unformatted = $this->export->order->get_total();
|
896 |
-
} else {
|
897 |
-
// Backwards compatibility
|
898 |
-
$total_unformatted = $this->export->order->get_order_total();
|
899 |
-
}
|
900 |
-
|
901 |
-
if ($tax == 'excl' ) {
|
902 |
-
$total_tax = 0;
|
903 |
-
foreach ( $this->export->order->get_taxes() as $tax ) {
|
904 |
-
$total_tax += ( $tax[ 'tax_amount' ] + $tax[ 'shipping_tax_amount' ] );
|
905 |
-
}
|
906 |
-
|
907 |
-
$total = $this->export->wc_price( ( $total_unformatted - $total_tax ) );
|
908 |
-
$label = __( 'Total ex. VAT', 'wpo_wcpdf' );
|
909 |
-
} else {
|
910 |
-
$total = $this->export->wc_price( ( $total_unformatted ) );
|
911 |
-
$label = __( 'Total', 'wpo_wcpdf' );
|
912 |
-
}
|
913 |
-
|
914 |
-
$grand_total = array(
|
915 |
-
'label' => $label,
|
916 |
-
'value' => $total,
|
917 |
-
);
|
918 |
-
|
919 |
-
return apply_filters( 'wpo_wcpdf_order_grand_total', $grand_total, $tax );
|
920 |
-
}
|
921 |
-
public function order_grand_total( $tax = 'incl' ) {
|
922 |
-
$grand_total = $this->get_order_grand_total( $tax );
|
923 |
-
echo $grand_total['value'];
|
924 |
-
}
|
925 |
-
|
926 |
-
|
927 |
-
/**
|
928 |
-
* Return/Show shipping notes
|
929 |
-
*/
|
930 |
-
public function get_shipping_notes() {
|
931 |
-
$shipping_notes = wpautop( wptexturize( $this->export->order->customer_note ) );
|
932 |
-
return apply_filters( 'wpo_wcpdf_shipping_notes', $shipping_notes );
|
933 |
-
}
|
934 |
-
public function shipping_notes() {
|
935 |
-
echo $this->get_shipping_notes();
|
936 |
-
}
|
937 |
-
|
938 |
-
|
939 |
-
/**
|
940 |
-
* Return/Show shop/company footer imprint, copyright etc.
|
941 |
-
*/
|
942 |
-
public function get_footer() {
|
943 |
-
if (isset($this->settings->template_settings['footer'])) {
|
944 |
-
$footer = wpautop( wptexturize( $this->settings->template_settings[ 'footer' ] ) );
|
945 |
-
return apply_filters( 'wpo_wcpdf_footer', $footer );
|
946 |
-
}
|
947 |
-
}
|
948 |
-
public function footer() {
|
949 |
-
echo $this->get_footer();
|
950 |
-
}
|
951 |
-
|
952 |
-
/**
|
953 |
-
* Return/Show Extra field 1
|
954 |
-
*/
|
955 |
-
public function get_extra_1() {
|
956 |
-
if (isset($this->settings->template_settings['extra_1'])) {
|
957 |
-
$extra_1 = nl2br( wptexturize( $this->settings->template_settings[ 'extra_1' ] ) );
|
958 |
-
return apply_filters( 'wpo_wcpdf_extra_1', $extra_1 );
|
959 |
-
}
|
960 |
-
}
|
961 |
-
public function extra_1() {
|
962 |
-
echo $this->get_extra_1();
|
963 |
-
}
|
964 |
-
|
965 |
-
/**
|
966 |
-
* Return/Show Extra field 2
|
967 |
-
*/
|
968 |
-
public function get_extra_2() {
|
969 |
-
if (isset($this->settings->template_settings['extra_2'])) {
|
970 |
-
$extra_2 = nl2br( wptexturize( $this->settings->template_settings[ 'extra_2' ] ) );
|
971 |
-
return apply_filters( 'wpo_wcpdf_extra_2', $extra_2 );
|
972 |
-
}
|
973 |
-
}
|
974 |
-
public function extra_2() {
|
975 |
-
echo $this->get_extra_2();
|
976 |
-
}
|
977 |
-
|
978 |
-
/**
|
979 |
-
* Return/Show Extra field 3
|
980 |
-
*/
|
981 |
-
public function get_extra_3() {
|
982 |
-
if (isset($this->settings->template_settings['extra_3'])) {
|
983 |
-
$extra_3 = nl2br( wptexturize( $this->settings->template_settings[ 'extra_3' ] ) );
|
984 |
-
return apply_filters( 'wpo_wcpdf_extra_3', $extra_3 );
|
985 |
-
}
|
986 |
-
}
|
987 |
-
public function extra_3() {
|
988 |
-
echo $this->get_extra_3();
|
989 |
-
}
|
990 |
-
}
|
991 |
-
}
|
992 |
-
|
993 |
-
// Load main plugin class
|
994 |
-
$wpo_wcpdf = new WooCommerce_PDF_Invoices();
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Plugin Name: WooCommerce PDF Invoices & Packing Slips
|
4 |
+
* Plugin URI: http://www.wpovernight.com
|
5 |
+
* Description: Create, print & email PDF invoices & packing slips for WooCommerce orders.
|
6 |
+
* Version: 1.5.38
|
7 |
+
* Author: Ewout Fernhout
|
8 |
+
* Author URI: http://www.wpovernight.com
|
9 |
+
* License: GPLv2 or later
|
10 |
+
* License URI: http://www.opensource.org/licenses/gpl-license.php
|
11 |
+
* Text Domain: wpo_wcpdf
|
12 |
+
*/
|
13 |
+
|
14 |
+
if ( !class_exists( 'WooCommerce_PDF_Invoices' ) ) {
|
15 |
+
|
16 |
+
class WooCommerce_PDF_Invoices {
|
17 |
+
|
18 |
+
public static $plugin_prefix;
|
19 |
+
public static $plugin_url;
|
20 |
+
public static $plugin_path;
|
21 |
+
public static $plugin_basename;
|
22 |
+
public static $version;
|
23 |
+
|
24 |
+
public $writepanels;
|
25 |
+
public $settings;
|
26 |
+
public $export;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Constructor
|
30 |
+
*/
|
31 |
+
public function __construct() {
|
32 |
+
self::$plugin_prefix = 'wpo_wcpdf_';
|
33 |
+
self::$plugin_basename = plugin_basename(__FILE__);
|
34 |
+
self::$plugin_url = plugin_dir_url(self::$plugin_basename);
|
35 |
+
self::$plugin_path = trailingslashit(dirname(__FILE__));
|
36 |
+
self::$version = '1.5.38';
|
37 |
+
|
38 |
+
// load the localisation & classes
|
39 |
+
add_action( 'plugins_loaded', array( $this, 'translations' ) ); // or use init?
|
40 |
+
add_action( 'init', array( $this, 'load_classes' ) );
|
41 |
+
|
42 |
+
// run lifecycle methods
|
43 |
+
if ( is_admin() && ! defined( 'DOING_AJAX' ) ) {
|
44 |
+
// check if upgrading from versionless (1.4.14 and older)
|
45 |
+
if ( get_option('wpo_wcpdf_general_settings') && get_option('wpo_wcpdf_version') === false ) {
|
46 |
+
// tag 'versionless', so that we can apply necessary upgrade settings
|
47 |
+
add_option( 'wpo_wcpdf_version', 'versionless' );
|
48 |
+
}
|
49 |
+
|
50 |
+
add_action( 'wp_loaded', array( $this, 'do_install' ) );
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Load the translation / textdomain files
|
56 |
+
*
|
57 |
+
* Note: the first-loaded translation file overrides any following ones if the same translation is present
|
58 |
+
*/
|
59 |
+
public function translations() {
|
60 |
+
$locale = apply_filters( 'plugin_locale', get_locale(), 'wpo_wcpdf' );
|
61 |
+
$dir = trailingslashit( WP_LANG_DIR );
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Frontend/global Locale. Looks in:
|
65 |
+
*
|
66 |
+
* - WP_LANG_DIR/woocommerce-pdf-invoices-packing-slips/wpo_wcpdf-LOCALE.mo
|
67 |
+
* - WP_LANG_DIR/plugins/wpo_wcpdf-LOCALE.mo
|
68 |
+
* - woocommerce-pdf-invoices-packing-slips/languages/wpo_wcpdf-LOCALE.mo (which if not found falls back to:)
|
69 |
+
* - WP_LANG_DIR/plugins/wpo_wcpdf-LOCALE.mo
|
70 |
+
*/
|
71 |
+
load_textdomain( 'wpo_wcpdf', $dir . 'woocommerce-pdf-invoices-packing-slips/wpo_wcpdf-' . $locale . '.mo' );
|
72 |
+
load_textdomain( 'wpo_wcpdf', $dir . 'plugins/wpo_wcpdf-' . $locale . '.mo' );
|
73 |
+
load_plugin_textdomain( 'wpo_wcpdf', false, dirname( self::$plugin_basename ) . '/languages' );
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Load the main plugin classes and functions
|
78 |
+
*/
|
79 |
+
public function includes() {
|
80 |
+
include_once( 'includes/class-wcpdf-settings.php' );
|
81 |
+
include_once( 'includes/class-wcpdf-writepanels.php' );
|
82 |
+
include_once( 'includes/class-wcpdf-export.php' );
|
83 |
+
}
|
84 |
+
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Instantiate classes when woocommerce is activated
|
88 |
+
*/
|
89 |
+
public function load_classes() {
|
90 |
+
if ( $this->is_woocommerce_activated() ) {
|
91 |
+
$this->includes();
|
92 |
+
$this->settings = new WooCommerce_PDF_Invoices_Settings();
|
93 |
+
$this->writepanels = new WooCommerce_PDF_Invoices_Writepanels();
|
94 |
+
$this->export = new WooCommerce_PDF_Invoices_Export();
|
95 |
+
} else {
|
96 |
+
// display notice instead
|
97 |
+
add_action( 'admin_notices', array ( $this, 'need_woocommerce' ) );
|
98 |
+
}
|
99 |
+
|
100 |
+
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* Check if woocommerce is activated
|
104 |
+
*/
|
105 |
+
public function is_woocommerce_activated() {
|
106 |
+
$blog_plugins = get_option( 'active_plugins', array() );
|
107 |
+
$site_plugins = is_multisite() ? (array) maybe_unserialize( get_site_option('active_sitewide_plugins' ) ) : array();
|
108 |
+
|
109 |
+
if ( in_array( 'woocommerce/woocommerce.php', $blog_plugins ) || isset( $site_plugins['woocommerce/woocommerce.php'] ) ) {
|
110 |
+
return true;
|
111 |
+
} else {
|
112 |
+
return false;
|
113 |
+
}
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* WooCommerce not active notice.
|
118 |
+
*
|
119 |
+
* @return string Fallack notice.
|
120 |
+
*/
|
121 |
+
|
122 |
+
public function need_woocommerce() {
|
123 |
+
$error = sprintf( __( 'WooCommerce PDF Invoices & Packing Slips requires %sWooCommerce%s to be installed & activated!' , 'wpo_wcpdf' ), '<a href="http://wordpress.org/extend/plugins/woocommerce/">', '</a>' );
|
124 |
+
|
125 |
+
$message = '<div class="error"><p>' . $error . '</p></div>';
|
126 |
+
|
127 |
+
echo $message;
|
128 |
+
}
|
129 |
+
|
130 |
+
/** Lifecycle methods *******************************************************
|
131 |
+
* Because register_activation_hook only runs when the plugin is manually
|
132 |
+
* activated by the user, we're checking the current version against the
|
133 |
+
* version stored in the database
|
134 |
+
****************************************************************************/
|
135 |
+
|
136 |
+
/**
|
137 |
+
* Handles version checking
|
138 |
+
*/
|
139 |
+
public function do_install() {
|
140 |
+
// only install when woocommerce is active
|
141 |
+
if ( !$this->is_woocommerce_activated() ) {
|
142 |
+
return;
|
143 |
+
}
|
144 |
+
|
145 |
+
$version_setting = 'wpo_wcpdf_version';
|
146 |
+
$installed_version = get_option( $version_setting );
|
147 |
+
|
148 |
+
// installed version lower than plugin version?
|
149 |
+
if ( version_compare( $installed_version, self::$version, '<' ) ) {
|
150 |
+
|
151 |
+
if ( ! $installed_version ) {
|
152 |
+
$this->install();
|
153 |
+
} else {
|
154 |
+
$this->upgrade( $installed_version );
|
155 |
+
}
|
156 |
+
|
157 |
+
// new version number
|
158 |
+
update_option( $version_setting, self::$version );
|
159 |
+
}
|
160 |
+
}
|
161 |
+
|
162 |
+
|
163 |
+
/**
|
164 |
+
* Plugin install method. Perform any installation tasks here
|
165 |
+
*/
|
166 |
+
protected function install() {
|
167 |
+
// Create temp folders
|
168 |
+
$tmp_base = $this->export->get_tmp_base();
|
169 |
+
|
170 |
+
// check if tmp folder exists => if not, initialize
|
171 |
+
if ( !@is_dir( $tmp_base ) ) {
|
172 |
+
$this->export->init_tmp( $tmp_base );
|
173 |
+
}
|
174 |
+
|
175 |
+
}
|
176 |
+
|
177 |
+
|
178 |
+
/**
|
179 |
+
* Plugin upgrade method. Perform any required upgrades here
|
180 |
+
*
|
181 |
+
* @param string $installed_version the currently installed version
|
182 |
+
*/
|
183 |
+
protected function upgrade( $installed_version ) {
|
184 |
+
if ( $installed_version == 'versionless') { // versionless = 1.4.14 and older
|
185 |
+
// We're upgrading from an old version, so we're enabling the option to use the plugin tmp folder.
|
186 |
+
// This is not per se the 'best' solution, but the good thing is that nothing is changed
|
187 |
+
// and nothing will be broken (that wasn't broken before)
|
188 |
+
$default = array( 'old_tmp' => 1 );
|
189 |
+
update_option( 'wpo_wcpdf_debug_settings', $default );
|
190 |
+
}
|
191 |
+
|
192 |
+
// sync fonts on every upgrade!
|
193 |
+
$debug_settings = get_option( 'wpo_wcpdf_debug_settings' ); // get temp setting
|
194 |
+
|
195 |
+
// do not copy if old_tmp function active! (double check for slow databases)
|
196 |
+
if ( !( isset($debug_settings['old_tmp']) || $installed_version == 'versionless' ) ) {
|
197 |
+
$tmp_base = $this->export->get_tmp_base();
|
198 |
+
|
199 |
+
// check if tmp folder exists => if not, initialize
|
200 |
+
if ( !@is_dir( $tmp_base ) ) {
|
201 |
+
$this->export->init_tmp( $tmp_base );
|
202 |
+
}
|
203 |
+
|
204 |
+
$font_path = $tmp_base . 'fonts/';
|
205 |
+
$this->export->copy_fonts( $font_path );
|
206 |
+
}
|
207 |
+
|
208 |
+
// 1.5.28 update: copy next invoice number to separate setting
|
209 |
+
if ( $installed_version == 'versionless' || version_compare( $installed_version, '1.5.28', '<' ) ) {
|
210 |
+
$template_settings = get_option( 'wpo_wcpdf_template_settings' );
|
211 |
+
$next_invoice_number = isset($template_settings['next_invoice_number'])?$template_settings['next_invoice_number']:'';
|
212 |
+
update_option( 'wpo_wcpdf_next_invoice_number', $next_invoice_number );
|
213 |
+
}
|
214 |
+
}
|
215 |
+
|
216 |
+
/***********************************************************************/
|
217 |
+
/********************** GENERAL TEMPLATE FUNCTIONS *********************/
|
218 |
+
/***********************************************************************/
|
219 |
+
|
220 |
+
/**
|
221 |
+
* Get template name from slug
|
222 |
+
*/
|
223 |
+
public function get_template_name ( $template_type ) {
|
224 |
+
switch ( $template_type ) {
|
225 |
+
case 'invoice':
|
226 |
+
$template_name = apply_filters( 'wpo_wcpdf_invoice_title', __( 'Invoice', 'wpo_wcpdf' ) );
|
227 |
+
break;
|
228 |
+
case 'packing-slip':
|
229 |
+
$template_name = apply_filters( 'wpo_wcpdf_packing_slip_title', __( 'Packing Slip', 'wpo_wcpdf' ) );
|
230 |
+
break;
|
231 |
+
default:
|
232 |
+
// try to 'unslug' the name
|
233 |
+
$template_name = ucwords( str_replace( array( '_', '-' ), ' ', $template_type ) );
|
234 |
+
break;
|
235 |
+
}
|
236 |
+
|
237 |
+
return apply_filters( 'wpo_wcpdf_template_name', $template_name, $template_type );
|
238 |
+
}
|
239 |
+
|
240 |
+
/**
|
241 |
+
* Output template styles
|
242 |
+
*/
|
243 |
+
public function template_styles() {
|
244 |
+
$css = apply_filters( 'wpo_wcpdf_template_styles_file', $this->export->template_path. '/' .'style.css' );
|
245 |
+
|
246 |
+
ob_start();
|
247 |
+
if (file_exists($css)) {
|
248 |
+
include($css);
|
249 |
+
}
|
250 |
+
$html = ob_get_clean();
|
251 |
+
$html = apply_filters( 'wpo_wcpdf_template_styles', $html );
|
252 |
+
|
253 |
+
echo $html;
|
254 |
+
}
|
255 |
+
|
256 |
+
/**
|
257 |
+
* Return logo id
|
258 |
+
*/
|
259 |
+
public function get_header_logo_id() {
|
260 |
+
if (isset($this->settings->template_settings['header_logo'])) {
|
261 |
+
return apply_filters( 'wpo_wcpdf_header_logo_id', $this->settings->template_settings['header_logo'] );
|
262 |
+
}
|
263 |
+
}
|
264 |
+
|
265 |
+
/**
|
266 |
+
* Show logo html
|
267 |
+
*/
|
268 |
+
public function header_logo() {
|
269 |
+
if ($this->get_header_logo_id()) {
|
270 |
+
$attachment_id = $this->get_header_logo_id();
|
271 |
+
$company = isset($this->settings->template_settings['shop_name'])? $this->settings->template_settings['shop_name'] : '';
|
272 |
+
if( $attachment_id ) {
|
273 |
+
$attachment = wp_get_attachment_image_src( $attachment_id, 'full', false );
|
274 |
+
|
275 |
+
$attachment_src = $attachment[0];
|
276 |
+
$attachment_width = $attachment[1];
|
277 |
+
$attachment_height = $attachment[2];
|
278 |
+
|
279 |
+
$attachment_path = get_attached_file( $attachment_id );
|
280 |
+
|
281 |
+
if ( apply_filters('wpo_wcpdf_use_path', true) && file_exists($attachment_path) ) {
|
282 |
+
$src = $attachment_path;
|
283 |
+
} else {
|
284 |
+
$src = $attachment_src;
|
285 |
+
}
|
286 |
+
|
287 |
+
printf('<img src="%1$s" width="%2$d" height="%3$d" alt="%4$s" />', $src, $attachment_width, $attachment_height, esc_attr( $company ) );
|
288 |
+
}
|
289 |
+
}
|
290 |
+
}
|
291 |
+
|
292 |
+
/**
|
293 |
+
* Return/Show custom company name or default to blog name
|
294 |
+
*/
|
295 |
+
public function get_shop_name() {
|
296 |
+
if (!empty($this->settings->template_settings['shop_name'])) {
|
297 |
+
$name = trim( $this->settings->template_settings['shop_name'] );
|
298 |
+
return apply_filters( 'wpo_wcpdf_shop_name', wptexturize( $name ) );
|
299 |
+
} else {
|
300 |
+
return apply_filters( 'wpo_wcpdf_shop_name', get_bloginfo( 'name' ) );
|
301 |
+
}
|
302 |
+
}
|
303 |
+
public function shop_name() {
|
304 |
+
echo $this->get_shop_name();
|
305 |
+
}
|
306 |
+
|
307 |
+
/**
|
308 |
+
* Return/Show shop/company address if provided
|
309 |
+
*/
|
310 |
+
public function get_shop_address() {
|
311 |
+
$shop_address = apply_filters( 'wpo_wcpdf_shop_address', wpautop( wptexturize( $this->settings->template_settings['shop_address'] ) ) );
|
312 |
+
if (!empty($shop_address)) {
|
313 |
+
return $shop_address;
|
314 |
+
} else {
|
315 |
+
return false;
|
316 |
+
}
|
317 |
+
}
|
318 |
+
public function shop_address() {
|
319 |
+
echo $this->get_shop_address();
|
320 |
+
}
|
321 |
+
|
322 |
+
/**
|
323 |
+
* Check if billing address and shipping address are equal
|
324 |
+
*/
|
325 |
+
public function ships_to_different_address() {
|
326 |
+
// always prefer parent address for refunds
|
327 |
+
if ( get_post_type( $this->export->order->id ) == 'shop_order_refund' && $parent_order_id = wp_get_post_parent_id( $this->export->order->id ) ) {
|
328 |
+
// temporarily switch order to make all filters / order calls work correctly
|
329 |
+
$order_meta = get_post_meta( $parent_order_id );
|
330 |
+
} else {
|
331 |
+
$order_meta = get_post_meta( $this->export->order->id );
|
332 |
+
}
|
333 |
+
|
334 |
+
$address_comparison_fields = apply_filters( 'wpo_wcpdf_address_comparison_fields', array(
|
335 |
+
'first_name',
|
336 |
+
'last_name',
|
337 |
+
'company',
|
338 |
+
'address_1',
|
339 |
+
'address_2',
|
340 |
+
'city',
|
341 |
+
'state',
|
342 |
+
'postcode',
|
343 |
+
'country'
|
344 |
+
) );
|
345 |
+
|
346 |
+
foreach ($address_comparison_fields as $address_field) {
|
347 |
+
$billing_field = isset( $order_meta['_billing_'.$address_field] ) ? $order_meta['_billing_'.$address_field] : '';
|
348 |
+
$shipping_field = isset( $order_meta['_shipping_'.$address_field] ) ? $order_meta['_shipping_'.$address_field] : '';
|
349 |
+
if ( $shipping_field != $billing_field ) {
|
350 |
+
// this address field is different -> ships to different address!
|
351 |
+
return true;
|
352 |
+
}
|
353 |
+
}
|
354 |
+
|
355 |
+
//if we got here, it means the addresses are equal -> doesn't ship to different address!
|
356 |
+
return apply_filters( 'wpo_wcpdf_ships_to_different_address', false, $order_meta );
|
357 |
+
}
|
358 |
+
|
359 |
+
/**
|
360 |
+
* Return/Show billing address
|
361 |
+
*/
|
362 |
+
public function get_billing_address() {
|
363 |
+
// always prefer parent billing address for refunds
|
364 |
+
if ( get_post_type( $this->export->order->id ) == 'shop_order_refund' && $parent_order_id = wp_get_post_parent_id( $this->export->order->id ) ) {
|
365 |
+
// temporarily switch order to make all filters / order calls work correctly
|
366 |
+
$current_order = $this->export->order;
|
367 |
+
$this->export->order = new WC_Order( $parent_order_id );
|
368 |
+
$address = apply_filters( 'wpo_wcpdf_billing_address', $this->export->order->get_formatted_billing_address() );
|
369 |
+
// switch back & unset
|
370 |
+
$this->export->order = $current_order;
|
371 |
+
unset($current_order);
|
372 |
+
} elseif ( $address = $this->export->order->get_formatted_billing_address() ) {
|
373 |
+
// regular shop_order
|
374 |
+
$address = apply_filters( 'wpo_wcpdf_billing_address', $address );
|
375 |
+
} else {
|
376 |
+
// no address
|
377 |
+
$address = apply_filters( 'wpo_wcpdf_billing_address', __('N/A', 'wpo_wcpdf') );
|
378 |
+
}
|
379 |
+
|
380 |
+
return $address;
|
381 |
+
}
|
382 |
+
public function billing_address() {
|
383 |
+
echo $this->get_billing_address();
|
384 |
+
}
|
385 |
+
|
386 |
+
/**
|
387 |
+
* Return/Show billing email
|
388 |
+
*/
|
389 |
+
public function get_billing_email() {
|
390 |
+
$billing_email = $this->export->order->billing_email;
|
391 |
+
|
392 |
+
if ( !$billing_email && $parent_order_id = wp_get_post_parent_id( $this->export->order->id ) ) {
|
393 |
+
// try parent
|
394 |
+
$billing_email = get_post_meta( $parent_order_id, '_billing_email', true );
|
395 |
+
}
|
396 |
+
|
397 |
+
return apply_filters( 'wpo_wcpdf_billing_email', $billing_email );
|
398 |
+
}
|
399 |
+
public function billing_email() {
|
400 |
+
echo $this->get_billing_email();
|
401 |
+
}
|
402 |
+
|
403 |
+
/**
|
404 |
+
* Return/Show billing phone
|
405 |
+
*/
|
406 |
+
public function get_billing_phone() {
|
407 |
+
$billing_phone = $this->export->order->billing_phone;
|
408 |
+
|
409 |
+
if ( !$billing_phone && $parent_order_id = wp_get_post_parent_id( $this->export->order->id ) ) {
|
410 |
+
// try parent
|
411 |
+
$billing_phone = get_post_meta( $parent_order_id, '_billing_phone', true );
|
412 |
+
}
|
413 |
+
|
414 |
+
return apply_filters( 'wpo_wcpdf_billing_phone', $billing_phone );
|
415 |
+
}
|
416 |
+
public function billing_phone() {
|
417 |
+
echo $this->get_billing_phone();
|
418 |
+
}
|
419 |
+
|
420 |
+
/**
|
421 |
+
* Return/Show shipping address
|
422 |
+
*/
|
423 |
+
public function get_shipping_address() {
|
424 |
+
// always prefer parent shipping address for refunds
|
425 |
+
if ( get_post_type( $this->export->order->id ) == 'shop_order_refund' && $parent_order_id = wp_get_post_parent_id( $this->export->order->id ) ) {
|
426 |
+
// temporarily switch order to make all filters / order calls work correctly
|
427 |
+
$current_order = $this->export->order;
|
428 |
+
$this->export->order = new WC_Order( $parent_order_id );
|
429 |
+
$address = apply_filters( 'wpo_wcpdf_shipping_address', $this->export->order->get_formatted_shipping_address() );
|
430 |
+
// switch back & unset
|
431 |
+
$this->export->order = $current_order;
|
432 |
+
unset($current_order);
|
433 |
+
} elseif ( $address = $this->export->order->get_formatted_shipping_address() ) {
|
434 |
+
// regular shop_order
|
435 |
+
$address = apply_filters( 'wpo_wcpdf_shipping_address', $address );
|
436 |
+
} else {
|
437 |
+
// no address
|
438 |
+
$address = apply_filters( 'wpo_wcpdf_shipping_address', __('N/A', 'wpo_wcpdf') );
|
439 |
+
}
|
440 |
+
|
441 |
+
return $address;
|
442 |
+
}
|
443 |
+
public function shipping_address() {
|
444 |
+
echo $this->get_shipping_address();
|
445 |
+
}
|
446 |
+
|
447 |
+
/**
|
448 |
+
* Return/Show a custom field
|
449 |
+
*/
|
450 |
+
public function get_custom_field( $field_name ) {
|
451 |
+
$custom_field = get_post_meta($this->export->order->id,$field_name,true);
|
452 |
+
|
453 |
+
if ( !$custom_field && $parent_order_id = wp_get_post_parent_id( $this->export->order->id ) ) {
|
454 |
+
// try parent
|
455 |
+
$custom_field = get_post_meta( $parent_order_id, $field_name, true );
|
456 |
+
}
|
457 |
+
|
458 |
+
return apply_filters( 'wpo_wcpdf_billing_custom_field', $custom_field );
|
459 |
+
}
|
460 |
+
public function custom_field( $field_name, $field_label = '', $display_empty = false ) {
|
461 |
+
$custom_field = $this->get_custom_field( $field_name );
|
462 |
+
if (!empty($field_label)){
|
463 |
+
// add a a trailing space to the label
|
464 |
+
$field_label .= ' ';
|
465 |
+
}
|
466 |
+
|
467 |
+
if (!empty($custom_field) || $display_empty) {
|
468 |
+
echo $field_label . nl2br ($custom_field);
|
469 |
+
}
|
470 |
+
}
|
471 |
+
|
472 |
+
/**
|
473 |
+
* Return/Show order notes
|
474 |
+
*/
|
475 |
+
public function get_order_notes( $filter = 'customer' ) {
|
476 |
+
if ( get_post_type( $this->export->order->id ) == 'shop_order_refund' && $parent_order_id = wp_get_post_parent_id( $this->export->order->id ) ) {
|
477 |
+
$post_id = $parent_order_id;
|
478 |
+
} else {
|
479 |
+
$post_id = $this->export->order->id;
|
480 |
+
}
|
481 |
+
|
482 |
+
$args = array(
|
483 |
+
'post_id' => $post_id,
|
484 |
+
'approve' => 'approve',
|
485 |
+
'type' => 'order_note'
|
486 |
+
);
|
487 |
+
|
488 |
+
remove_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ), 10, 1 );
|
489 |
+
|
490 |
+
$notes = get_comments( $args );
|
491 |
+
|
492 |
+
add_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ), 10, 1 );
|
493 |
+
|
494 |
+
if ( $notes ) {
|
495 |
+
foreach( $notes as $key => $note ) {
|
496 |
+
if ( $filter == 'customer' && !get_comment_meta( $note->comment_ID, 'is_customer_note', true ) ) {
|
497 |
+
unset($notes[$key]);
|
498 |
+
}
|
499 |
+
if ( $filter == 'private' && get_comment_meta( $note->comment_ID, 'is_customer_note', true ) ) {
|
500 |
+
unset($notes[$key]);
|
501 |
+
}
|
502 |
+
}
|
503 |
+
return $notes;
|
504 |
+
}
|
505 |
+
}
|
506 |
+
public function order_notes( $filter = 'customer' ) {
|
507 |
+
$notes = $this->get_order_notes( $filter );
|
508 |
+
if ( $notes ) {
|
509 |
+
foreach( $notes as $note ) {
|
510 |
+
?>
|
511 |
+
<div class="note_content">
|
512 |
+
<?php echo wpautop( wptexturize( wp_kses_post( $note->comment_content ) ) ); ?>
|
513 |
+
</div>
|
514 |
+
<?php
|
515 |
+
}
|
516 |
+
}
|
517 |
+
}
|
518 |
+
|
519 |
+
/**
|
520 |
+
* Return/Show the current date
|
521 |
+
*/
|
522 |
+
public function get_current_date() {
|
523 |
+
return apply_filters( 'wpo_wcpdf_date', date_i18n( get_option( 'date_format' ) ) );
|
524 |
+
}
|
525 |
+
public function current_date() {
|
526 |
+
echo $this->get_current_date();
|
527 |
+
}
|
528 |
+
|
529 |
+
/**
|
530 |
+
* Return/Show payment method
|
531 |
+
*/
|
532 |
+
public function get_payment_method() {
|
533 |
+
$payment_method_label = __( 'Payment method', 'wpo_wcpdf' );
|
534 |
+
|
535 |
+
$payment_method = __( $this->export->order->payment_method_title, 'woocommerce' );
|
536 |
+
if ( !$payment_method && $parent_order_id = wp_get_post_parent_id( $this->export->order->id ) ) {
|
537 |
+
// try parent
|
538 |
+
$payment_method = get_post_meta( $parent_order_id, '_payment_method_title', true );
|
539 |
+
$payment_method = __( $payment_method, 'woocommerce' );
|
540 |
+
}
|
541 |
+
|
542 |
+
return apply_filters( 'wpo_wcpdf_payment_method', $payment_method );
|
543 |
+
}
|
544 |
+
public function payment_method() {
|
545 |
+
echo $this->get_payment_method();
|
546 |
+
}
|
547 |
+
|
548 |
+
/**
|
549 |
+
* Return/Show shipping method
|
550 |
+
*/
|
551 |
+
public function get_shipping_method() {
|
552 |
+
$shipping_method_label = __( 'Shipping method', 'wpo_wcpdf' );
|
553 |
+
return apply_filters( 'wpo_wcpdf_shipping_method', __( $this->export->order->get_shipping_method(), 'woocommerce' ) );
|
554 |
+
}
|
555 |
+
public function shipping_method() {
|
556 |
+
echo $this->get_shipping_method();
|
557 |
+
}
|
558 |
+
|
559 |
+
/**
|
560 |
+
* Return/Show order number
|
561 |
+
*/
|
562 |
+
public function get_order_number() {
|
563 |
+
// try parent first
|
564 |
+
if ( get_post_type( $this->export->order->id ) == 'shop_order_refund' && $parent_order_id = wp_get_post_parent_id( $this->export->order->id ) ) {
|
565 |
+
$parent_order = new WC_Order( $parent_order_id );
|
566 |
+
$order_number = $parent_order->get_order_number();
|
567 |
+
} else {
|
568 |
+
$order_number = $this->export->order->get_order_number();
|
569 |
+
}
|
570 |
+
|
571 |
+
// Trim the hash to have a clean number but still
|
572 |
+
// support any filters that were applied before.
|
573 |
+
$order_number = ltrim($order_number, '#');
|
574 |
+
return apply_filters( 'wpo_wcpdf_order_number', $order_number);
|
575 |
+
}
|
576 |
+
public function order_number() {
|
577 |
+
echo $this->get_order_number();
|
578 |
+
}
|
579 |
+
|
580 |
+
/**
|
581 |
+
* Return/Show invoice number
|
582 |
+
*/
|
583 |
+
public function get_invoice_number() {
|
584 |
+
// try parent first
|
585 |
+
if ( get_post_type( $this->export->order->id ) == 'shop_order_refund' && $parent_order_id = wp_get_post_parent_id( $this->export->order->id ) ) {
|
586 |
+
$invoice_number = $this->export->get_invoice_number( $parent_order_id );
|
587 |
+
} else {
|
588 |
+
$invoice_number = $this->export->get_invoice_number( $this->export->order->id );
|
589 |
+
}
|
590 |
+
|
591 |
+
return $invoice_number;
|
592 |
+
}
|
593 |
+
public function invoice_number() {
|
594 |
+
echo $this->get_invoice_number();
|
595 |
+
}
|
596 |
+
|
597 |
+
/**
|
598 |
+
* Return/Show the order date
|
599 |
+
*/
|
600 |
+
public function get_order_date() {
|
601 |
+
if ( get_post_type( $this->export->order->id ) == 'shop_order_refund' && $parent_order_id = wp_get_post_parent_id( $this->export->order->id ) ) {
|
602 |
+
$parent_order = new WC_Order( $parent_order_id );
|
603 |
+
$order_date = $parent_order->order_date;
|
604 |
+
} else {
|
605 |
+
$order_date = $this->export->order->order_date;
|
606 |
+
}
|
607 |
+
|
608 |
+
$date = date_i18n( get_option( 'date_format' ), strtotime( $order_date ) );
|
609 |
+
return apply_filters( 'wpo_wcpdf_order_date', $date, $order_date );
|
610 |
+
}
|
611 |
+
public function order_date() {
|
612 |
+
echo $this->get_order_date();
|
613 |
+
}
|
614 |
+
|
615 |
+
/**
|
616 |
+
* Return/Show the invoice date
|
617 |
+
*/
|
618 |
+
public function get_invoice_date() {
|
619 |
+
$invoice_date = get_post_meta($this->export->order->id,'_wcpdf_invoice_date',true);
|
620 |
+
|
621 |
+
// add invoice date if it doesn't exist
|
622 |
+
if ( empty($invoice_date) || !isset($invoice_date) ) {
|
623 |
+
$invoice_date = current_time('mysql');
|
624 |
+
update_post_meta( $this->export->order->id, '_wcpdf_invoice_date', $invoice_date );
|
625 |
+
}
|
626 |
+
|
627 |
+
$formatted_invoice_date = date_i18n( get_option( 'date_format' ), strtotime( $invoice_date ) );
|
628 |
+
|
629 |
+
return apply_filters( 'wpo_wcpdf_invoice_date', $formatted_invoice_date, $invoice_date );
|
630 |
+
}
|
631 |
+
public function invoice_date() {
|
632 |
+
echo $this->get_invoice_date();
|
633 |
+
}
|
634 |
+
|
635 |
+
/**
|
636 |
+
* Return the order items
|
637 |
+
*/
|
638 |
+
public function get_order_items() {
|
639 |
+
return apply_filters( 'wpo_wcpdf_order_items', $this->export->get_order_items() );
|
640 |
+
}
|
641 |
+
|
642 |
+
/**
|
643 |
+
* Return/show product attribute
|
644 |
+
*/
|
645 |
+
public function get_product_attribute( $attribute_name, $product ) {
|
646 |
+
// first, check the text attributes
|
647 |
+
$attributes = $product->get_attributes();
|
648 |
+
$attribute_key = @wc_attribute_taxonomy_name( $attribute_name );
|
649 |
+
if (array_key_exists( sanitize_title( $attribute_name ), $attributes) ) {
|
650 |
+
$attribute = $product->get_attribute ( $attribute_name );
|
651 |
+
return $attribute;
|
652 |
+
} elseif (array_key_exists( sanitize_title( $attribute_key ), $attributes) ) {
|
653 |
+
$attribute = $product->get_attribute ( $attribute_key );
|
654 |
+
return $attribute;
|
655 |
+
}
|
656 |
+
|
657 |
+
// not a text attribute, try attribute taxonomy
|
658 |
+
$attribute_key = @wc_attribute_taxonomy_name( $attribute_name );
|
659 |
+
$product_terms = @wc_get_product_terms( $product->id, $attribute_key, array( 'fields' => 'names' ) );
|
660 |
+
// check if not empty, then display
|
661 |
+
if ( !empty($product_terms) ) {
|
662 |
+
$attribute = array_shift( $product_terms );
|
663 |
+
return $attribute;
|
664 |
+
} else {
|
665 |
+
// no attribute under this name
|
666 |
+
return false;
|
667 |
+
}
|
668 |
+
}
|
669 |
+
public function product_attribute( $attribute_name, $product ) {
|
670 |
+
echo $this->get_product_attribute( $attribute_name, $product );
|
671 |
+
}
|
672 |
+
|
673 |
+
|
674 |
+
/**
|
675 |
+
* Return the order totals listing
|
676 |
+
*/
|
677 |
+
public function get_woocommerce_totals() {
|
678 |
+
// get totals and remove the semicolon
|
679 |
+
$totals = apply_filters( 'wpo_wcpdf_raw_order_totals', $this->export->order->get_order_item_totals(), $this->export->order );
|
680 |
+
|
681 |
+
// remove the colon for every label
|
682 |
+
foreach ( $totals as $key => $total ) {
|
683 |
+
$label = $total['label'];
|
684 |
+
$colon = strrpos( $label, ':' );
|
685 |
+
if( $colon !== false ) {
|
686 |
+
$label = substr_replace( $label, '', $colon, 1 );
|
687 |
+
}
|
688 |
+
$totals[$key]['label'] = $label;
|
689 |
+
}
|
690 |
+
|
691 |
+
// WC2.4 fix order_total for refunded orders
|
692 |
+
if ( version_compare( WOOCOMMERCE_VERSION, '2.4', '>=' ) && isset($totals['order_total']) ) {
|
693 |
+
$tax_display = $this->export->order->tax_display_cart;
|
694 |
+
$totals['order_total']['value'] = wc_price( $this->export->order->get_total(), array( 'currency' => $this->export->order->get_order_currency() ) );
|
695 |
+
$order_total = $this->export->order->get_total();
|
696 |
+
$tax_string = '';
|
697 |
+
|
698 |
+
// Tax for inclusive prices
|
699 |
+
if ( wc_tax_enabled() && 'incl' == $tax_display ) {
|
700 |
+
$tax_string_array = array();
|
701 |
+
|
702 |
+
if ( 'itemized' == get_option( 'woocommerce_tax_total_display' ) ) {
|
703 |
+
foreach ( $this->export->order->get_tax_totals() as $code => $tax ) {
|
704 |
+
$tax_amount = $tax->formatted_amount;
|
705 |
+
$tax_string_array[] = sprintf( '%s %s', $tax_amount, $tax->label );
|
706 |
+
}
|
707 |
+
} else {
|
708 |
+
$tax_string_array[] = sprintf( '%s %s', wc_price( $this->export->order->get_total_tax() - $this->export->order->get_total_tax_refunded(), array( 'currency' => $this->export->order->get_order_currency() ) ), WC()->countries->tax_or_vat() );
|
709 |
+
}
|
710 |
+
if ( ! empty( $tax_string_array ) ) {
|
711 |
+
if ( version_compare( WOOCOMMERCE_VERSION, '2.6', '>=' ) ) {
|
712 |
+
$tax_string = ' ' . sprintf( __( '(includes %s)', 'woocommerce' ), implode( ', ', $tax_string_array ) );
|
713 |
+
} else {
|
714 |
+
// use old capitalized string
|
715 |
+
$tax_string = ' ' . sprintf( __( '(Includes %s)', 'woocommerce' ), implode( ', ', $tax_string_array ) );
|
716 |
+
}
|
717 |
+
}
|
718 |
+
}
|
719 |
+
|
720 |
+
$totals['order_total']['value'] .= $tax_string;
|
721 |
+
}
|
722 |
+
|
723 |
+
// remove refund lines (shouldn't be in invoice)
|
724 |
+
foreach ( $totals as $key => $total ) {
|
725 |
+
if ( strpos($key, 'refund_') !== false ) {
|
726 |
+
unset( $totals[$key] );
|
727 |
+
}
|
728 |
+
}
|
729 |
+
|
730 |
+
return apply_filters( 'wpo_wcpdf_woocommerce_totals', $totals, $this->export->order );
|
731 |
+
}
|
732 |
+
|
733 |
+
/**
|
734 |
+
* Return/show the order subtotal
|
735 |
+
*/
|
736 |
+
public function get_order_subtotal( $tax = 'excl', $discount = 'incl' ) { // set $tax to 'incl' to include tax, same for $discount
|
737 |
+
//$compound = ($discount == 'incl')?true:false;
|
738 |
+
|
739 |
+
$subtotal = $this->export->order->get_subtotal_to_display( false, $tax );
|
740 |
+
|
741 |
+
$subtotal = ($pos = strpos($subtotal, ' <small')) ? substr($subtotal, 0, $pos) : $subtotal; //removing the 'excluding tax' text
|
742 |
+
|
743 |
+
$subtotal = array (
|
744 |
+
'label' => __('Subtotal', 'wpo_wcpdf'),
|
745 |
+
'value' => $subtotal,
|
746 |
+
);
|
747 |
+
|
748 |
+
return apply_filters( 'wpo_wcpdf_order_subtotal', $subtotal, $tax, $discount );
|
749 |
+
}
|
750 |
+
public function order_subtotal( $tax = 'excl', $discount = 'incl' ) {
|
751 |
+
$subtotal = $this->get_order_subtotal( $tax, $discount );
|
752 |
+
echo $subtotal['value'];
|
753 |
+
}
|
754 |
+
|
755 |
+
/**
|
756 |
+
* Return/show the order shipping costs
|
757 |
+
*/
|
758 |
+
public function get_order_shipping( $tax = 'excl' ) { // set $tax to 'incl' to include tax
|
759 |
+
if ($tax == 'excl' ) {
|
760 |
+
$shipping_costs = $this->export->wc_price( $this->export->order->order_shipping );
|
761 |
+
} else {
|
762 |
+
$shipping_costs = $this->export->wc_price( $this->export->order->order_shipping + $this->export->order->order_shipping_tax );
|
763 |
+
}
|
764 |
+
|
765 |
+
$shipping = array (
|
766 |
+
'label' => __('Shipping', 'wpo_wcpdf'),
|
767 |
+
'value' => $shipping_costs,
|
768 |
+
'tax' => $this->export->wc_price( $this->export->order->order_shipping_tax ),
|
769 |
+
);
|
770 |
+
return apply_filters( 'wpo_wcpdf_order_shipping', $shipping, $tax );
|
771 |
+
}
|
772 |
+
public function order_shipping( $tax = 'excl' ) {
|
773 |
+
$shipping = $this->get_order_shipping( $tax );
|
774 |
+
echo $shipping['value'];
|
775 |
+
}
|
776 |
+
|
777 |
+
/**
|
778 |
+
* Return/show the total discount
|
779 |
+
*/
|
780 |
+
public function get_order_discount( $type = 'total', $tax = 'incl' ) {
|
781 |
+
if ( $tax == 'incl' ) {
|
782 |
+
switch ($type) {
|
783 |
+
case 'cart':
|
784 |
+
// Cart Discount - pre-tax discounts. (deprecated in WC2.3)
|
785 |
+
$discount_value = $this->export->order->get_cart_discount();
|
786 |
+
break;
|
787 |
+
case 'order':
|
788 |
+
// Order Discount - post-tax discounts. (deprecated in WC2.3)
|
789 |
+
$discount_value = $this->export->order->get_order_discount();
|
790 |
+
break;
|
791 |
+
case 'total':
|
792 |
+
// Total Discount
|
793 |
+
if ( version_compare( WOOCOMMERCE_VERSION, '2.3' ) >= 0 ) {
|
794 |
+
$discount_value = $this->export->order->get_total_discount( false ); // $ex_tax = false
|
795 |
+
} else {
|
796 |
+
// WC2.2 and older: recalculate to include tax
|
797 |
+
$discount_value = 0;
|
798 |
+
$items = $this->export->order->get_items();;
|
799 |
+
if( sizeof( $items ) > 0 ) {
|
800 |
+
foreach( $items as $item ) {
|
801 |
+
$discount_value += ($item['line_subtotal'] + $item['line_subtotal_tax']) - ($item['line_total'] + $item['line_tax']);
|
802 |
+
}
|
803 |
+
}
|
804 |
+
}
|
805 |
+
|
806 |
+
break;
|
807 |
+
default:
|
808 |
+
// Total Discount - Cart & Order Discounts combined
|
809 |
+
$discount_value = $this->export->order->get_total_discount();
|
810 |
+
break;
|
811 |
+
}
|
812 |
+
} else { // calculate discount excluding tax
|
813 |
+
if ( version_compare( WOOCOMMERCE_VERSION, '2.3' ) >= 0 ) {
|
814 |
+
$discount_value = $this->export->order->get_total_discount( true ); // $ex_tax = true
|
815 |
+
} else {
|
816 |
+
// WC2.2 and older: recalculate to exclude tax
|
817 |
+
$discount_value = 0;
|
818 |
+
|
819 |
+
$items = $this->export->order->get_items();;
|
820 |
+
if( sizeof( $items ) > 0 ) {
|
821 |
+
foreach( $items as $item ) {
|
822 |
+
$discount_value += ($item['line_subtotal'] - $item['line_total']);
|
823 |
+
}
|
824 |
+
}
|
825 |
+
}
|
826 |
+
}
|
827 |
+
|
828 |
+
$discount = array (
|
829 |
+
'label' => __('Discount', 'wpo_wcpdf'),
|
830 |
+
'value' => $this->export->wc_price($discount_value),
|
831 |
+
'raw_value' => $discount_value,
|
832 |
+
);
|
833 |
+
|
834 |
+
if ( round( $discount_value, 3 ) != 0 ) {
|
835 |
+
return apply_filters( 'wpo_wcpdf_order_discount', $discount, $type, $tax );
|
836 |
+
}
|
837 |
+
}
|
838 |
+
public function order_discount( $type = 'total', $tax = 'incl' ) {
|
839 |
+
$discount = $this->get_order_discount( $type, $tax );
|
840 |
+
echo $discount['value'];
|
841 |
+
}
|
842 |
+
|
843 |
+
/**
|
844 |
+
* Return the order fees
|
845 |
+
*/
|
846 |
+
public function get_order_fees( $tax = 'excl' ) {
|
847 |
+
if ( $wcfees = $this->export->order->get_fees() ) {
|
848 |
+
foreach( $wcfees as $id => $fee ) {
|
849 |
+
if ($tax == 'excl' ) {
|
850 |
+
$fee_price = $this->export->wc_price( $fee['line_total'] );
|
851 |
+
} else {
|
852 |
+
$fee_price = $this->export->wc_price( $fee['line_total'] + $fee['line_tax'] );
|
853 |
+
}
|
854 |
+
|
855 |
+
$fees[ $id ] = array(
|
856 |
+
'label' => $fee['name'],
|
857 |
+
'value' => $fee_price,
|
858 |
+
'line_total' => $this->export->wc_price($fee['line_total']),
|
859 |
+
'line_tax' => $this->export->wc_price($fee['line_tax'])
|
860 |
+
);
|
861 |
+
}
|
862 |
+
return $fees;
|
863 |
+
}
|
864 |
+
}
|
865 |
+
|
866 |
+
/**
|
867 |
+
* Return the order taxes
|
868 |
+
*/
|
869 |
+
public function get_order_taxes() {
|
870 |
+
$tax_label = __( 'VAT', 'wpo_wcpdf' ); // register alternate label translation
|
871 |
+
$tax_label = __( 'Tax rate', 'wpo_wcpdf' );
|
872 |
+
$tax_rate_ids = $this->export->get_tax_rate_ids();
|
873 |
+
if ($this->export->order->get_taxes()) {
|
874 |
+
foreach ( $this->export->order->get_taxes() as $key => $tax ) {
|
875 |
+
$taxes[ $key ] = array(
|
876 |
+
'label' => isset( $tax[ 'label' ] ) ? $tax[ 'label' ] : $tax[ 'name' ],
|
877 |
+
'value' => $this->export->wc_price( ( $tax[ 'tax_amount' ] + $tax[ 'shipping_tax_amount' ] ) ),
|
878 |
+
'rate_id' => $tax['rate_id'],
|
879 |
+
'tax_amount' => $tax['tax_amount'],
|
880 |
+
'shipping_tax_amount' => $tax['shipping_tax_amount'],
|
881 |
+
'rate' => isset( $tax_rate_ids[ $tax['rate_id'] ] ) ? ( (float) $tax_rate_ids[$tax['rate_id']]['tax_rate'] ) . ' %': '',
|
882 |
+
);
|
883 |
+
}
|
884 |
+
|
885 |
+
return apply_filters( 'wpo_wcpdf_order_taxes', $taxes );
|
886 |
+
}
|
887 |
+
}
|
888 |
+
|
889 |
+
/**
|
890 |
+
* Return/show the order grand total
|
891 |
+
*/
|
892 |
+
public function get_order_grand_total( $tax = 'incl' ) {
|
893 |
+
if ( version_compare( WOOCOMMERCE_VERSION, '2.1' ) >= 0 ) {
|
894 |
+
// WC 2.1 or newer is used
|
895 |
+
$total_unformatted = $this->export->order->get_total();
|
896 |
+
} else {
|
897 |
+
// Backwards compatibility
|
898 |
+
$total_unformatted = $this->export->order->get_order_total();
|
899 |
+
}
|
900 |
+
|
901 |
+
if ($tax == 'excl' ) {
|
902 |
+
$total_tax = 0;
|
903 |
+
foreach ( $this->export->order->get_taxes() as $tax ) {
|
904 |
+
$total_tax += ( $tax[ 'tax_amount' ] + $tax[ 'shipping_tax_amount' ] );
|
905 |
+
}
|
906 |
+
|
907 |
+
$total = $this->export->wc_price( ( $total_unformatted - $total_tax ) );
|
908 |
+
$label = __( 'Total ex. VAT', 'wpo_wcpdf' );
|
909 |
+
} else {
|
910 |
+
$total = $this->export->wc_price( ( $total_unformatted ) );
|
911 |
+
$label = __( 'Total', 'wpo_wcpdf' );
|
912 |
+
}
|
913 |
+
|
914 |
+
$grand_total = array(
|
915 |
+
'label' => $label,
|
916 |
+
'value' => $total,
|
917 |
+
);
|
918 |
+
|
919 |
+
return apply_filters( 'wpo_wcpdf_order_grand_total', $grand_total, $tax );
|
920 |
+
}
|
921 |
+
public function order_grand_total( $tax = 'incl' ) {
|
922 |
+
$grand_total = $this->get_order_grand_total( $tax );
|
923 |
+
echo $grand_total['value'];
|
924 |
+
}
|
925 |
+
|
926 |
+
|
927 |
+
/**
|
928 |
+
* Return/Show shipping notes
|
929 |
+
*/
|
930 |
+
public function get_shipping_notes() {
|
931 |
+
$shipping_notes = wpautop( wptexturize( $this->export->order->customer_note ) );
|
932 |
+
return apply_filters( 'wpo_wcpdf_shipping_notes', $shipping_notes );
|
933 |
+
}
|
934 |
+
public function shipping_notes() {
|
935 |
+
echo $this->get_shipping_notes();
|
936 |
+
}
|
937 |
+
|
938 |
+
|
939 |
+
/**
|
940 |
+
* Return/Show shop/company footer imprint, copyright etc.
|
941 |
+
*/
|
942 |
+
public function get_footer() {
|
943 |
+
if (isset($this->settings->template_settings['footer'])) {
|
944 |
+
$footer = wpautop( wptexturize( $this->settings->template_settings[ 'footer' ] ) );
|
945 |
+
return apply_filters( 'wpo_wcpdf_footer', $footer );
|
946 |
+
}
|
947 |
+
}
|
948 |
+
public function footer() {
|
949 |
+
echo $this->get_footer();
|
950 |
+
}
|
951 |
+
|
952 |
+
/**
|
953 |
+
* Return/Show Extra field 1
|
954 |
+
*/
|
955 |
+
public function get_extra_1() {
|
956 |
+
if (isset($this->settings->template_settings['extra_1'])) {
|
957 |
+
$extra_1 = nl2br( wptexturize( $this->settings->template_settings[ 'extra_1' ] ) );
|
958 |
+
return apply_filters( 'wpo_wcpdf_extra_1', $extra_1 );
|
959 |
+
}
|
960 |
+
}
|
961 |
+
public function extra_1() {
|
962 |
+
echo $this->get_extra_1();
|
963 |
+
}
|
964 |
+
|
965 |
+
/**
|
966 |
+
* Return/Show Extra field 2
|
967 |
+
*/
|
968 |
+
public function get_extra_2() {
|
969 |
+
if (isset($this->settings->template_settings['extra_2'])) {
|
970 |
+
$extra_2 = nl2br( wptexturize( $this->settings->template_settings[ 'extra_2' ] ) );
|
971 |
+
return apply_filters( 'wpo_wcpdf_extra_2', $extra_2 );
|
972 |
+
}
|
973 |
+
}
|
974 |
+
public function extra_2() {
|
975 |
+
echo $this->get_extra_2();
|
976 |
+
}
|
977 |
+
|
978 |
+
/**
|
979 |
+
* Return/Show Extra field 3
|
980 |
+
*/
|
981 |
+
public function get_extra_3() {
|
982 |
+
if (isset($this->settings->template_settings['extra_3'])) {
|
983 |
+
$extra_3 = nl2br( wptexturize( $this->settings->template_settings[ 'extra_3' ] ) );
|
984 |
+
return apply_filters( 'wpo_wcpdf_extra_3', $extra_3 );
|
985 |
+
}
|
986 |
+
}
|
987 |
+
public function extra_3() {
|
988 |
+
echo $this->get_extra_3();
|
989 |
+
}
|
990 |
+
}
|
991 |
+
}
|
992 |
+
|
993 |
+
// Load main plugin class
|
994 |
+
$wpo_wcpdf = new WooCommerce_PDF_Invoices();
|