Changeset 1505274
- Timestamp:
- 09/29/2016 04:24:43 PM (9 years ago)
- Location:
- woocommerce-superfaktura/trunk
- Files:
-
- 3 edited
-
README.txt (modified) (2 diffs)
-
class-wc-superfaktura.php (modified) (9 diffs)
-
wc-superfaktura.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
woocommerce-superfaktura/trunk/README.txt
r1476611 r1505274 4 4 Tags: superfaktura, invoice, faktura, proforma, woocommerce 5 5 Requires at least: 4.0 6 Tested up to: 4.6. 07 Stable tag: 1.5. 86 Tested up to: 4.6.1 7 Stable tag: 1.5.12 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 64 64 == Changelog == 65 65 66 = 1.5.7 = 66 = 1.5.12 = 67 * Pridaná možnosť filtrovať vo faktúrach výber SuperFaktúra číselníka 68 69 = 1.5.11 = 70 * Pridané nastavenie zobrazovania čísla objednávky vo faktúre 71 * Pridaná možnosť nastavenia jazyka faktúry 72 73 = 1.5.10 = 74 * Pridaný odkaz na proformu a faktúru do zoznamu objednávok, ktorý zákazník vidí na stránke „Môj účet“ 75 76 = 1.5.9 = 77 * Pridaná podpora pre Sequential Order Numbers Pro 78 79 = 1.5.8 = 67 80 * Opravená kompatibilita s WordPress 4.6 68 81 -
woocommerce-superfaktura/trunk/class-wc-superfaktura.php
r1472995 r1505274 24 24 * @var string 25 25 */ 26 protected $version = '1.5. 6';26 protected $version = '1.5.12'; 27 27 28 28 /** … … 185 185 186 186 if ( is_plugin_active( 'woocommerce-sequential-order-numbers/woocommerce-sequential-order-numbers.php' ) ) { 187 return; 188 } 189 190 if ( is_plugin_active( 'woocommerce-sequential-order-numbers-pro/woocommerce-sequential-order-numbers.php' ) ) { 187 191 return; 188 192 } … … 221 225 // metabox hook 222 226 add_action('add_meta_boxes', array($this, 'add_meta_boxes')); 227 228 // customer order list actions filter 229 add_filter( 'woocommerce_my_account_my_orders_actions', array( $this, 'my_orders_actions' ), 10, 2 ); 223 230 224 231 $wc_get_order_statuses = $this->get_order_statuses(); … … 412 419 if ( get_option('woocommerce_sf_comments') == 'yes' ) 413 420 { 414 $set_invoice_data['header_comment'] = 'Číslo objednávky: '.$order->get_order_number(); 421 if ( 'no' !== get_option( 'woocommerce_sf_order_number_visibility' ) ) { 422 $set_invoice_data['header_comment'] = 'Číslo objednávky: '.$order->get_order_number(); 423 } 415 424 416 425 if ( WC()->countries->get_base_country() != $order->billing_country ) … … 572 581 else 573 582 { 574 $invoice_id = apply_filters( 'wc_sf_invoice_id', false, $type, $order ); 575 576 if ( ! $invoice_id ) { 577 $invoice_id = get_option('woocommerce_sf_invoice_custom_num')=='yes' ? $this->generate_invoice_id($order,$type) : ''; 578 } 579 580 $api->setInvoice(array( 583 $args = array( 581 584 'type' => $type, 582 'invoice_no_formatted' => $invoice_id, 583 )); 585 ); 586 587 $sequence_id = apply_filters( 'wc_sf_sequence_id', false, $type, $order ); 588 589 if ( ! $sequence_id ) { 590 $sequence_id = ''; 591 } 592 593 if ( $sequence_id ) { 594 $args['sequence_id'] = $sequence_id; 595 } else { 596 $invoice_id = apply_filters( 'wc_sf_invoice_id', false, $type, $order ); 597 598 if ( ! $invoice_id ) { 599 $invoice_id = get_option('woocommerce_sf_invoice_custom_num')=='yes' ? $this->generate_invoice_id($order,$type) : ''; 600 } 601 602 $args['invoice_no_formatted'] = $invoice_id; 603 } 604 605 $api->setInvoice( $args ); 584 606 585 607 $response = $api->save(); … … 592 614 update_post_meta($order->id, 'wc_sf_internal_' . $type . '_id', $internal_id); 593 615 594 $pdf = $api::SFAPI_URL.'/invoices/pdf/'.$internal_id.'/token:'.$response->data->Invoice->token; 616 $locale_map = array( 617 'sk' => 'slo', 618 'cs' => 'cze', 619 'en' => 'eng', 620 'de' => 'deu', 621 'ru' => 'rus', 622 'uk' => 'ukr', 623 'hu' => 'hun', 624 'pl' => 'pol', 625 ); 626 $language = get_option( 'woocommerce_sf_invoice_language' ); 627 switch ( $language ) { 628 case 'locale': 629 $locale = substr( get_locale(), 0, 2 ); 630 if ( isset( $locale_map[ $locale ] ) ) { 631 $language = $locale_map[ $locale ]; 632 break; 633 } 634 // break omitted intentionally 635 default: 636 if ( ! in_array( $language, $locale_map ) ) { 637 $language = 'cz' === get_option( 'woocommerce_sf_lang' ) ? 'cze' : 'slo'; 638 } 639 break; 640 } 641 642 $pdf = $api::SFAPI_URL . '/' . $language . '/invoices/pdf/' . $internal_id . '/token:' . $response->data->Invoice->token; 595 643 596 644 update_post_meta($order->id, 'wc_sf_invoice_'.$type, $pdf); … … 801 849 ), 802 850 array( 851 'title' => __( 'Invoice language', 'wc-superfaktura' ), 852 'id' => 'woocommerce_sf_invoice_language', 853 'default' => 'endpoint', 854 'type' => 'select', 855 'options' => array( 856 'endpoint' => __( 'Default endpoint language', 'wc-superfaktura' ), 857 'locale' => __( 'Site locale (fallback to endpoint)', 'wc-superfaktura' ), 858 'slo' => __( 'Slovak', 'wc-superfaktura' ), 859 'cze' => __( 'Czech', 'wc-superfaktura' ), 860 'eng' => __( 'Εnglish', 'wc-superfaktura' ), 861 'deu' => __( 'German', 'wc-superfaktura' ), 862 'rus' => __( 'Russian', 'wc-superfaktura' ), 863 'ukr' => __( 'Ukrainian', 'wc-superfaktura' ), 864 'hun' => __( 'Hungarian', 'wc-superfaktura' ), 865 'pol' => __( 'Polish', 'wc-superfaktura' ), 866 ), 867 ), 868 array( 803 869 'type' => 'sectionend', 804 870 'id' => 'woocommerce_wi_invoice_title2' … … 816 882 'type' => 'checkbox', 817 883 'desc' => 'Override default comments options in SuperFaktúra. It adds information about order number, custom comment and tax liability if needed.' 884 ), 885 array( 886 'title' => __('Order number', 'wc-superfaktura'), 887 'id' => 'woocommerce_sf_order_number_visibility', 888 'type' => 'checkbox', 889 'desc' => __( 'Display an order number if comments are enabled.', 'wc-superfaktura' ), 890 'default' => 'yes', 818 891 ), 819 892 array( … … 1096 1169 } 1097 1170 1171 function my_orders_actions( $actions, $order ) 1172 { 1173 $pdf = get_post_meta( $order->id, 'wc_sf_invoice_proforma', true ); 1174 if ( $pdf ) { 1175 $actions['wc_sf_invoice_proforma'] = array( 1176 'url' => $pdf, 1177 'name' => __( 'Proforma', 'wc-superfaktura' ), 1178 ); 1179 } 1180 $pdf = get_post_meta( $order->id, 'wc_sf_invoice_regular', true ); 1181 if ( $pdf ) { 1182 $actions['wc_sf_invoice_regular'] = array( 1183 'url' => $pdf, 1184 'name' => __( 'Invoice', 'wc-superfaktura' ), 1185 ); 1186 } 1187 1188 return $actions; 1189 } 1190 1098 1191 function sf_can_regenerate($order) 1099 1192 { -
woocommerce-superfaktura/trunk/wc-superfaktura.php
r1476611 r1505274 11 11 * Plugin URI: http://www.platobnebrany.sk/ 12 12 * Description: WooCommerce integrácia služby <a href="http://www.superfaktura.sk/api/">SuperFaktúra.sk</a> Máte s modulom technický problém? Napíšte nám na <a href="mailto:[email protected]">[email protected]</a> 13 * Version: 1.5. 813 * Version: 1.5.12 14 14 * Author: Webikon (Ján Bočínec) 15 15 * Author URI: http://www.webikon.sk
Note: See TracChangeset
for help on using the changeset viewer.