Changeset 3730776
- Timestamp:
- 10/06/2026 12:24:51 PM (3 weeks ago)
- Location:
- woocommerce-superfaktura
- Files:
-
- 8 added
- 26 edited
- 1 copied
-
tags/1.56.0 (copied) (copied from woocommerce-superfaktura/trunk )
-
tags/1.56.0/README.txt (modified) (2 diffs)
-
tags/1.56.0/assets/css/admin-notices.css (added)
-
tags/1.56.0/assets/images/efaktura-badge.png (added)
-
tags/1.56.0/assets/js/admin-notices.js (added)
-
tags/1.56.0/assets/js/admin.js (modified) (1 diff)
-
tags/1.56.0/changelog.txt (modified) (1 diff)
-
tags/1.56.0/includes/class-wc-sf-admin.php (modified) (3 diffs)
-
tags/1.56.0/includes/class-wc-sf-notices.php (added)
-
tags/1.56.0/includes/class-wc-sf-settings.php (modified) (1 diff)
-
tags/1.56.0/includes/class-wc-superfaktura.php (modified) (9 diffs)
-
tags/1.56.0/languages/woocommerce-superfaktura-cs_CZ.mo (modified) ( previous)
-
tags/1.56.0/languages/woocommerce-superfaktura-cs_CZ.po (modified) (2 diffs)
-
tags/1.56.0/languages/woocommerce-superfaktura-sk_SK.mo (modified) ( previous)
-
tags/1.56.0/languages/woocommerce-superfaktura-sk_SK.po (modified) (2 diffs)
-
tags/1.56.0/languages/woocommerce-superfaktura.pot (modified) (2 diffs)
-
tags/1.56.0/uninstall.php (modified) (1 diff)
-
tags/1.56.0/woocommerce-superfaktura.php (modified) (2 diffs)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/assets/css/admin-notices.css (added)
-
trunk/assets/images/efaktura-badge.png (added)
-
trunk/assets/js/admin-notices.js (added)
-
trunk/assets/js/admin.js (modified) (1 diff)
-
trunk/changelog.txt (modified) (1 diff)
-
trunk/includes/class-wc-sf-admin.php (modified) (3 diffs)
-
trunk/includes/class-wc-sf-notices.php (added)
-
trunk/includes/class-wc-sf-settings.php (modified) (1 diff)
-
trunk/includes/class-wc-superfaktura.php (modified) (9 diffs)
-
trunk/languages/woocommerce-superfaktura-cs_CZ.mo (modified) ( previous)
-
trunk/languages/woocommerce-superfaktura-cs_CZ.po (modified) (2 diffs)
-
trunk/languages/woocommerce-superfaktura-sk_SK.mo (modified) ( previous)
-
trunk/languages/woocommerce-superfaktura-sk_SK.po (modified) (2 diffs)
-
trunk/languages/woocommerce-superfaktura.pot (modified) (2 diffs)
-
trunk/uninstall.php (modified) (1 diff)
-
trunk/woocommerce-superfaktura.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woocommerce-superfaktura/tags/1.56.0/README.txt
r3719169 r3730776 5 5 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 1.5 5.37 Stable tag: 1.56.0 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 65 65 66 66 == Changelog == 67 68 = 1.56.0 = 69 * Informácia o eFaktúre, ktorá bude pre platiteľov DPH povinná od 1. 1. 2027, a o tom, ako sa na ňu pripraviť so SuperFaktúrou. Nový filter sf_show_efaktura_banner. 70 * Upozornenie v administrácii, keď sa doklad nepodarilo vytvoriť alebo aktualizovať v SuperFaktúre, s odkazmi na objednávky a API log. Nový filter sf_admin_document_errors. 71 * Jazyk faktúry podľa krajiny zákazníka, s nastaviteľným jazykom pre krajiny, ktorých jazyk SuperFaktúra nepodporuje. Nový filter sf_invoice_language_country_map. 67 72 68 73 = 1.55.3 = -
woocommerce-superfaktura/tags/1.56.0/assets/js/admin.js
r3694932 r3730776 25 25 $items.hide(); 26 26 } 27 } 28 29 // Invoice language: the fallback language applies only to the customer country option. 30 var $invoiceLanguage = $('#woocommerce_sf_invoice_language'); 31 if ($invoiceLanguage.length) { 32 var wc_sf_toggle_language_fallback = function() { 33 wc_sf_toggle_settings('#woocommerce_sf_invoice_language_fallback', 'country' === $invoiceLanguage.val()); 34 }; 35 $invoiceLanguage.on('change', wc_sf_toggle_language_fallback); 36 wc_sf_toggle_language_fallback(); 27 37 } 28 38 -
woocommerce-superfaktura/tags/1.56.0/changelog.txt
r3719169 r3730776 1 1 === SuperFaktura WooCommerce – Changelog === 2 3 = 1.56.0 = 4 * Informácia o eFaktúre, ktorá bude pre platiteľov DPH povinná od 1. 1. 2027, a o tom, ako sa na ňu pripraviť so SuperFaktúrou. Nový filter sf_show_efaktura_banner. 5 * Upozornenie v administrácii, keď sa doklad nepodarilo vytvoriť alebo aktualizovať v SuperFaktúre, s odkazmi na objednávky a API log. Nový filter sf_admin_document_errors. 6 * Jazyk faktúry podľa krajiny zákazníka, s nastaviteľným jazykom pre krajiny, ktorých jazyk SuperFaktúra nepodporuje. Nový filter sf_invoice_language_country_map. 2 7 3 8 = 1.55.3 = -
woocommerce-superfaktura/tags/1.56.0/includes/class-wc-sf-admin.php
r3551029 r3730776 40 40 add_action( 'admin_notices', array( $this, 'admin_notices' ) ); 41 41 add_action( 'admin_notices', array( __CLASS__, 'order_number_notice_all' ) ); 42 add_action( 'woocommerce_settings_ wc_superfaktura', array( __CLASS__, 'order_number_notice' ) );42 add_action( 'woocommerce_settings_superfaktura', array( __CLASS__, 'order_number_notice' ) ); 43 43 add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) ); 44 44 add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) ); … … 97 97 update_option( 'wc_sf_order_number_notice_hidden', 1 ); 98 98 wp_safe_redirect( remove_query_arg( 'sf_hide_order_number_notice' ) ); 99 exit; 99 100 } 100 101 } … … 181 182 */ 182 183 public static function order_number_notice_all() { 183 if ( isset( $_GET['page'], $_GET['tab'] ) && 'wc-settings' === $_GET['page'] && ' wc_superfaktura' === $_GET['tab'] ) {184 if ( isset( $_GET['page'], $_GET['tab'] ) && 'wc-settings' === $_GET['page'] && 'superfaktura' === $_GET['tab'] ) { 184 185 return; 185 186 } -
woocommerce-superfaktura/tags/1.56.0/includes/class-wc-sf-settings.php
r3694932 r3730776 423 423 'locale' => __( 'Site locale (fallback to endpoint)', 'woocommerce-superfaktura' ), 424 424 'wpml' => __( 'WPML', 'woocommerce-superfaktura' ), 425 'country' => __( 'Customer country', 'woocommerce-superfaktura' ), 425 426 'slo' => __( 'Slovak', 'woocommerce-superfaktura' ), 426 427 'cze' => __( 'Czech', 'woocommerce-superfaktura' ), 427 'eng' => __( 'Εnglish', 'woocommerce-superfaktura' ), 428 'eng' => __( 'English', 'woocommerce-superfaktura' ), 429 'deu' => __( 'German', 'woocommerce-superfaktura' ), 430 'nld' => __( 'Dutch', 'woocommerce-superfaktura' ), 431 'hrv' => __( 'Croatian', 'woocommerce-superfaktura' ), 432 'hun' => __( 'Hungarian', 'woocommerce-superfaktura' ), 433 'pol' => __( 'Polish', 'woocommerce-superfaktura' ), 434 'rom' => __( 'Romanian', 'woocommerce-superfaktura' ), 435 'rus' => __( 'Russian', 'woocommerce-superfaktura' ), 436 'slv' => __( 'Slovenian', 'woocommerce-superfaktura' ), 437 'spa' => __( 'Spanish', 'woocommerce-superfaktura' ), 438 'ita' => __( 'Italian', 'woocommerce-superfaktura' ), 439 'ukr' => __( 'Ukrainian', 'woocommerce-superfaktura' ), 440 ), 441 ), 442 array( 443 'title' => __( 'Fallback invoice language', 'woocommerce-superfaktura' ), 444 'id' => 'woocommerce_sf_invoice_language_fallback', 445 'default' => 'endpoint', 446 'type' => 'select', 447 'class' => 'wc-enhanced-select', 448 'desc' => __( 'Used with the customer country option when SuperFaktúra does not support the language of the customer\'s country.', 'woocommerce-superfaktura' ), 449 'options' => array( 450 'endpoint' => __( 'Default endpoint language', 'woocommerce-superfaktura' ), 451 'eng' => __( 'English', 'woocommerce-superfaktura' ), 452 'slo' => __( 'Slovak', 'woocommerce-superfaktura' ), 453 'cze' => __( 'Czech', 'woocommerce-superfaktura' ), 428 454 'deu' => __( 'German', 'woocommerce-superfaktura' ), 429 455 'nld' => __( 'Dutch', 'woocommerce-superfaktura' ), -
woocommerce-superfaktura/tags/1.56.0/includes/class-wc-superfaktura.php
r3719141 r3730776 30 30 * @var string 31 31 */ 32 public $version = '1.5 5.3';32 public $version = '1.56.0'; 33 33 34 34 /** … … 145 145 */ 146 146 public $subscriptions; 147 148 /** 149 * Admin notices (eFaktúra announcement, failed documents). 150 * 151 * @var WC_SF_Notices 152 */ 153 public $notices; 147 154 148 155 … … 233 240 $this->tools = new WC_SF_Tools($this); 234 241 $this->subscriptions = new WC_SF_Subscriptions($this); 242 $this->notices = new WC_SF_Notices($this); 235 243 } 236 244 … … 404 412 $this->checkout_block->init(); 405 413 $this->bulk->init(); 414 $this->notices->init(); 406 415 } 407 416 … … 696 705 $order->save(); 697 706 707 // The invoice is attached without a log entry, so refresh the failed documents warning. 708 WC_SF_Notices::flush_errors(); 709 698 710 return true; 699 711 } … … 808 820 809 821 $order->save(); 822 823 // The document is attached without a log entry, so refresh the failed documents warning. 824 WC_SF_Notices::flush_errors(); 810 825 811 826 return true; … … 1008 1023 $log_data['time'] = current_time( 'mysql' ); 1009 1024 $wpdb->insert( $wpdb->prefix . 'wc_sf_log', $log_data ); 1025 1026 if ( isset( $log_data['request_type'] ) && in_array( $log_data['request_type'], array( 'create', 'edit' ), true ) ) { 1027 WC_SF_Notices::flush_errors(); 1028 } 1010 1029 } 1011 1030 … … 1135 1154 $result = __( 'Coupons', 'woocommerce-superfaktura' ) . ': ' . implode( ', ', $coupons ); 1136 1155 return $result; 1156 } 1157 1158 1159 1160 /** 1161 * Map of customer countries to the SuperFaktúra invoice language of that country. 1162 * 1163 * Only countries whose language SuperFaktúra supports; other countries use the fallback language from the settings. 1164 * 1165 * @return array Country code => SuperFaktúra language code. 1166 */ 1167 public function get_language_country_map() { 1168 $country_map = array( 1169 'SK' => 'slo', 1170 'CZ' => 'cze', 1171 'DE' => 'deu', 1172 'AT' => 'deu', 1173 'LI' => 'deu', 1174 'NL' => 'nld', 1175 'HR' => 'hrv', 1176 'HU' => 'hun', 1177 'PL' => 'pol', 1178 'RO' => 'rom', 1179 'RU' => 'rus', 1180 'SI' => 'slv', 1181 'ES' => 'spa', 1182 'MX' => 'spa', 1183 'AR' => 'spa', 1184 'CO' => 'spa', 1185 'CL' => 'spa', 1186 'PE' => 'spa', 1187 'VE' => 'spa', 1188 'EC' => 'spa', 1189 'GT' => 'spa', 1190 'CU' => 'spa', 1191 'BO' => 'spa', 1192 'DO' => 'spa', 1193 'HN' => 'spa', 1194 'PY' => 'spa', 1195 'SV' => 'spa', 1196 'NI' => 'spa', 1197 'CR' => 'spa', 1198 'PA' => 'spa', 1199 'UY' => 'spa', 1200 'IT' => 'ita', 1201 'SM' => 'ita', 1202 'UA' => 'ukr', 1203 'GB' => 'eng', 1204 'IE' => 'eng', 1205 'US' => 'eng', 1206 'AU' => 'eng', 1207 'NZ' => 'eng', 1208 ); 1209 1210 /** 1211 * Filter the map of customer countries to invoice languages used by the "Customer country" invoice language. 1212 * 1213 * @since 1.56.0 1214 * 1215 * @param array $country_map Country code => SuperFaktúra language code (slo, cze, eng, deu, nld, hrv, hun, pol, rom, rus, slv, spa, ita, ukr). 1216 */ 1217 return apply_filters( 'sf_invoice_language_country_map', $country_map ); 1137 1218 } 1138 1219 … … 1186 1267 break; 1187 1268 1269 case 'country': 1270 $order = wc_get_order( $order_id ); 1271 $country = ''; 1272 if ( $order ) { 1273 $country = $order->get_billing_country() ? $order->get_billing_country() : $order->get_shipping_country(); 1274 } 1275 1276 $country_map = $this->get_language_country_map(); 1277 if ( isset( $country_map[ $country ] ) ) { 1278 $language = $country_map[ $country ]; 1279 } else { 1280 // SuperFaktúra has no language for this country. 1281 $language = get_option( 'woocommerce_sf_invoice_language_fallback', 'endpoint' ); 1282 } 1283 break; 1284 1188 1285 case 'endpoint': 1189 1286 default: -
woocommerce-superfaktura/tags/1.56.0/languages/woocommerce-superfaktura-cs_CZ.po
r3694932 r3730776 464 464 465 465 #: includes/class-wc-sf-settings.php:352 466 msgid " Εnglish"466 msgid "English" 467 467 msgstr "Angličtina" 468 468 … … 1602 1602 msgid "Include references to the SuperFaktúra account (number sequences, bank account, cash registers, logo, country overrides)" 1603 1603 msgstr "Zahrnout odkazy na účet SuperFaktury (číselníky, bankovní účet, pokladny, logo, nastavení pro země)" 1604 1605 #: includes/class-wc-sf-settings.php 1606 msgid "Customer country" 1607 msgstr "Země zákazníka" 1608 1609 #: includes/class-wc-sf-settings.php 1610 msgid "Fallback invoice language" 1611 msgstr "Náhradní jazyk faktury" 1612 1613 #: includes/class-wc-sf-settings.php 1614 msgid "Used with the customer country option when SuperFaktúra does not support the language of the customer's country." 1615 msgstr "Použije se při volbě Země zákazníka, pokud SuperFaktura nepodporuje jazyk země zákazníka." 1616 1617 #: includes/class-wc-sf-notices.php 1618 msgid "%d document could not be created or updated in SuperFaktúra in the last 30 days." 1619 msgid_plural "%d documents could not be created or updated in SuperFaktúra in the last 30 days." 1620 msgstr[0] "%d doklad se za posledních 30 dní nepodařilo vytvořit nebo aktualizovat v SuperFaktuře." 1621 msgstr[1] "%d doklady se za posledních 30 dní nepodařilo vytvořit nebo aktualizovat v SuperFaktuře." 1622 msgstr[2] "%d dokladů se za posledních 30 dní nepodařilo vytvořit nebo aktualizovat v SuperFaktuře." 1623 1624 #: includes/class-wc-sf-notices.php 1625 msgid "Order #%s" 1626 msgstr "Objednávka #%s" 1627 1628 #: includes/class-wc-sf-notices.php 1629 msgid "and %d more" 1630 msgid_plural "and %d more" 1631 msgstr[0] "a další %d" 1632 msgstr[1] "a další %d" 1633 msgstr[2] "a dalších %d" 1634 1635 #: includes/class-wc-sf-notices.php 1636 msgid "Open API log" 1637 msgstr "Otevřít API log" 1638 1639 #: includes/class-wc-sf-notices.php 1640 msgid "More than %d documents could not be created or updated in SuperFaktúra in the last 30 days." 1641 msgstr "Více než %d dokladů se za posledních 30 dní nepodařilo vytvořit nebo aktualizovat v SuperFaktuře." 1642 1643 #: includes/class-wc-sf-notices.php 1644 msgid "and more" 1645 msgstr "a další" -
woocommerce-superfaktura/tags/1.56.0/languages/woocommerce-superfaktura-sk_SK.po
r3694932 r3730776 464 464 465 465 #: includes/class-wc-sf-settings.php:352 466 msgid " Εnglish"466 msgid "English" 467 467 msgstr "Angličtina" 468 468 … … 1606 1606 msgid "Include references to the SuperFaktúra account (number sequences, bank account, cash registers, logo, country overrides)" 1607 1607 msgstr "Zahrnúť odkazy na účet SuperFaktúry (číselníky, bankový účet, pokladne, logo, nastavenia pre krajiny)" 1608 1609 #: includes/class-wc-sf-settings.php 1610 msgid "Customer country" 1611 msgstr "Krajina zákazníka" 1612 1613 #: includes/class-wc-sf-settings.php 1614 msgid "Fallback invoice language" 1615 msgstr "Náhradný jazyk faktúry" 1616 1617 #: includes/class-wc-sf-settings.php 1618 msgid "Used with the customer country option when SuperFaktúra does not support the language of the customer's country." 1619 msgstr "Použije sa pri voľbe Krajina zákazníka, ak SuperFaktúra nepodporuje jazyk krajiny zákazníka." 1620 1621 #: includes/class-wc-sf-notices.php 1622 msgid "%d document could not be created or updated in SuperFaktúra in the last 30 days." 1623 msgid_plural "%d documents could not be created or updated in SuperFaktúra in the last 30 days." 1624 msgstr[0] "%d doklad sa za posledných 30 dní nepodarilo vytvoriť alebo aktualizovať v SuperFaktúre." 1625 msgstr[1] "%d doklady sa za posledných 30 dní nepodarilo vytvoriť alebo aktualizovať v SuperFaktúre." 1626 msgstr[2] "%d dokladov sa za posledných 30 dní nepodarilo vytvoriť alebo aktualizovať v SuperFaktúre." 1627 1628 #: includes/class-wc-sf-notices.php 1629 msgid "Order #%s" 1630 msgstr "Objednávka #%s" 1631 1632 #: includes/class-wc-sf-notices.php 1633 msgid "and %d more" 1634 msgid_plural "and %d more" 1635 msgstr[0] "a ďalší %d" 1636 msgstr[1] "a ďalšie %d" 1637 msgstr[2] "a ďalších %d" 1638 1639 #: includes/class-wc-sf-notices.php 1640 msgid "Open API log" 1641 msgstr "Otvoriť API log" 1642 1643 #: includes/class-wc-sf-notices.php 1644 msgid "More than %d documents could not be created or updated in SuperFaktúra in the last 30 days." 1645 msgstr "Viac ako %d dokladov sa za posledných 30 dní nepodarilo vytvoriť alebo aktualizovať v SuperFaktúre." 1646 1647 #: includes/class-wc-sf-notices.php 1648 msgid "and more" 1649 msgstr "a ďalšie" -
woocommerce-superfaktura/tags/1.56.0/languages/woocommerce-superfaktura.pot
r3694932 r3730776 466 466 467 467 #: includes/class-wc-sf-settings.php:352 468 msgid " Εnglish"468 msgid "English" 469 469 msgstr "" 470 470 … … 1545 1545 msgid "Include references to the SuperFaktúra account (number sequences, bank account, cash registers, logo, country overrides)" 1546 1546 msgstr "" 1547 1548 #: includes/class-wc-sf-settings.php 1549 msgid "Customer country" 1550 msgstr "" 1551 1552 #: includes/class-wc-sf-settings.php 1553 msgid "Fallback invoice language" 1554 msgstr "" 1555 1556 #: includes/class-wc-sf-settings.php 1557 msgid "Used with the customer country option when SuperFaktúra does not support the language of the customer's country." 1558 msgstr "" 1559 1560 #: includes/class-wc-sf-notices.php 1561 msgid "%d document could not be created or updated in SuperFaktúra in the last 30 days." 1562 msgid_plural "%d documents could not be created or updated in SuperFaktúra in the last 30 days." 1563 msgstr[0] "" 1564 msgstr[1] "" 1565 1566 #: includes/class-wc-sf-notices.php 1567 msgid "Order #%s" 1568 msgstr "" 1569 1570 #: includes/class-wc-sf-notices.php 1571 msgid "and %d more" 1572 msgid_plural "and %d more" 1573 msgstr[0] "" 1574 msgstr[1] "" 1575 1576 #: includes/class-wc-sf-notices.php 1577 msgid "Open API log" 1578 msgstr "" 1579 1580 #: includes/class-wc-sf-notices.php 1581 msgid "More than %d documents could not be created or updated in SuperFaktúra in the last 30 days." 1582 msgstr "" 1583 1584 #: includes/class-wc-sf-notices.php 1585 msgid "and more" 1586 msgstr "" -
woocommerce-superfaktura/tags/1.56.0/uninstall.php
r2794434 r3730776 16 16 17 17 // TODO: Define uninstall functionality here. 18 19 // Notices closed by users (eFaktúra announcement, failed documents). 20 global $wpdb; 21 $wc_sf_site_ids = ( is_multisite() && function_exists( 'get_sites' ) ) ? get_sites( array( 'fields' => 'ids', 'number' => 0 ) ) : array( get_current_blog_id() ); 22 foreach ( $wc_sf_site_ids as $wc_sf_site_id ) { 23 delete_metadata( 'user', 0, $wpdb->get_blog_prefix( $wc_sf_site_id ) . 'wc_sf_dismissed_notices', '', true ); 24 if ( is_multisite() ) { 25 switch_to_blog( $wc_sf_site_id ); 26 } 27 delete_transient( 'wc_sf_document_errors' ); 28 if ( is_multisite() ) { 29 restore_current_blog(); 30 } 31 } -
woocommerce-superfaktura/tags/1.56.0/woocommerce-superfaktura.php
r3719141 r3730776 13 13 * Plugin URI: https://www.superfaktura.sk/integracia/ 14 14 * Description: Integrácia služby <a href="http://www.superfaktura.sk/api/">SuperFaktúra.sk</a> pre WooCommerce. Máte s modulom technický problém? Napíšte nám na <a href="mailto:superfaktura@2day.sk">superfaktura@2day.sk</a> 15 * Version: 1.5 5.315 * Version: 1.56.0 16 16 * Author: 2day.sk 17 17 * Author URI: https://www.superfaktura.sk/integracia/ … … 38 38 require_once plugin_dir_path( WC_SF_FILE_PATH ) . 'includes/class-wc-sf-helper.php'; 39 39 require_once plugin_dir_path( WC_SF_FILE_PATH ) . 'includes/class-wc-sf-invoice.php'; 40 require_once plugin_dir_path( WC_SF_FILE_PATH ) . 'includes/class-wc-sf-notices.php'; 40 41 require_once plugin_dir_path( WC_SF_FILE_PATH ) . 'includes/class-wc-sf-subscriptions.php'; 41 42 require_once plugin_dir_path( WC_SF_FILE_PATH ) . 'includes/class-wc-sf-tools.php'; -
woocommerce-superfaktura/trunk/README.txt
r3719169 r3730776 5 5 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 1.5 5.37 Stable tag: 1.56.0 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 65 65 66 66 == Changelog == 67 68 = 1.56.0 = 69 * Informácia o eFaktúre, ktorá bude pre platiteľov DPH povinná od 1. 1. 2027, a o tom, ako sa na ňu pripraviť so SuperFaktúrou. Nový filter sf_show_efaktura_banner. 70 * Upozornenie v administrácii, keď sa doklad nepodarilo vytvoriť alebo aktualizovať v SuperFaktúre, s odkazmi na objednávky a API log. Nový filter sf_admin_document_errors. 71 * Jazyk faktúry podľa krajiny zákazníka, s nastaviteľným jazykom pre krajiny, ktorých jazyk SuperFaktúra nepodporuje. Nový filter sf_invoice_language_country_map. 67 72 68 73 = 1.55.3 = -
woocommerce-superfaktura/trunk/assets/js/admin.js
r3694932 r3730776 25 25 $items.hide(); 26 26 } 27 } 28 29 // Invoice language: the fallback language applies only to the customer country option. 30 var $invoiceLanguage = $('#woocommerce_sf_invoice_language'); 31 if ($invoiceLanguage.length) { 32 var wc_sf_toggle_language_fallback = function() { 33 wc_sf_toggle_settings('#woocommerce_sf_invoice_language_fallback', 'country' === $invoiceLanguage.val()); 34 }; 35 $invoiceLanguage.on('change', wc_sf_toggle_language_fallback); 36 wc_sf_toggle_language_fallback(); 27 37 } 28 38 -
woocommerce-superfaktura/trunk/changelog.txt
r3719169 r3730776 1 1 === SuperFaktura WooCommerce – Changelog === 2 3 = 1.56.0 = 4 * Informácia o eFaktúre, ktorá bude pre platiteľov DPH povinná od 1. 1. 2027, a o tom, ako sa na ňu pripraviť so SuperFaktúrou. Nový filter sf_show_efaktura_banner. 5 * Upozornenie v administrácii, keď sa doklad nepodarilo vytvoriť alebo aktualizovať v SuperFaktúre, s odkazmi na objednávky a API log. Nový filter sf_admin_document_errors. 6 * Jazyk faktúry podľa krajiny zákazníka, s nastaviteľným jazykom pre krajiny, ktorých jazyk SuperFaktúra nepodporuje. Nový filter sf_invoice_language_country_map. 2 7 3 8 = 1.55.3 = -
woocommerce-superfaktura/trunk/includes/class-wc-sf-admin.php
r3551029 r3730776 40 40 add_action( 'admin_notices', array( $this, 'admin_notices' ) ); 41 41 add_action( 'admin_notices', array( __CLASS__, 'order_number_notice_all' ) ); 42 add_action( 'woocommerce_settings_ wc_superfaktura', array( __CLASS__, 'order_number_notice' ) );42 add_action( 'woocommerce_settings_superfaktura', array( __CLASS__, 'order_number_notice' ) ); 43 43 add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) ); 44 44 add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) ); … … 97 97 update_option( 'wc_sf_order_number_notice_hidden', 1 ); 98 98 wp_safe_redirect( remove_query_arg( 'sf_hide_order_number_notice' ) ); 99 exit; 99 100 } 100 101 } … … 181 182 */ 182 183 public static function order_number_notice_all() { 183 if ( isset( $_GET['page'], $_GET['tab'] ) && 'wc-settings' === $_GET['page'] && ' wc_superfaktura' === $_GET['tab'] ) {184 if ( isset( $_GET['page'], $_GET['tab'] ) && 'wc-settings' === $_GET['page'] && 'superfaktura' === $_GET['tab'] ) { 184 185 return; 185 186 } -
woocommerce-superfaktura/trunk/includes/class-wc-sf-settings.php
r3694932 r3730776 423 423 'locale' => __( 'Site locale (fallback to endpoint)', 'woocommerce-superfaktura' ), 424 424 'wpml' => __( 'WPML', 'woocommerce-superfaktura' ), 425 'country' => __( 'Customer country', 'woocommerce-superfaktura' ), 425 426 'slo' => __( 'Slovak', 'woocommerce-superfaktura' ), 426 427 'cze' => __( 'Czech', 'woocommerce-superfaktura' ), 427 'eng' => __( 'Εnglish', 'woocommerce-superfaktura' ), 428 'eng' => __( 'English', 'woocommerce-superfaktura' ), 429 'deu' => __( 'German', 'woocommerce-superfaktura' ), 430 'nld' => __( 'Dutch', 'woocommerce-superfaktura' ), 431 'hrv' => __( 'Croatian', 'woocommerce-superfaktura' ), 432 'hun' => __( 'Hungarian', 'woocommerce-superfaktura' ), 433 'pol' => __( 'Polish', 'woocommerce-superfaktura' ), 434 'rom' => __( 'Romanian', 'woocommerce-superfaktura' ), 435 'rus' => __( 'Russian', 'woocommerce-superfaktura' ), 436 'slv' => __( 'Slovenian', 'woocommerce-superfaktura' ), 437 'spa' => __( 'Spanish', 'woocommerce-superfaktura' ), 438 'ita' => __( 'Italian', 'woocommerce-superfaktura' ), 439 'ukr' => __( 'Ukrainian', 'woocommerce-superfaktura' ), 440 ), 441 ), 442 array( 443 'title' => __( 'Fallback invoice language', 'woocommerce-superfaktura' ), 444 'id' => 'woocommerce_sf_invoice_language_fallback', 445 'default' => 'endpoint', 446 'type' => 'select', 447 'class' => 'wc-enhanced-select', 448 'desc' => __( 'Used with the customer country option when SuperFaktúra does not support the language of the customer\'s country.', 'woocommerce-superfaktura' ), 449 'options' => array( 450 'endpoint' => __( 'Default endpoint language', 'woocommerce-superfaktura' ), 451 'eng' => __( 'English', 'woocommerce-superfaktura' ), 452 'slo' => __( 'Slovak', 'woocommerce-superfaktura' ), 453 'cze' => __( 'Czech', 'woocommerce-superfaktura' ), 428 454 'deu' => __( 'German', 'woocommerce-superfaktura' ), 429 455 'nld' => __( 'Dutch', 'woocommerce-superfaktura' ), -
woocommerce-superfaktura/trunk/includes/class-wc-superfaktura.php
r3719141 r3730776 30 30 * @var string 31 31 */ 32 public $version = '1.5 5.3';32 public $version = '1.56.0'; 33 33 34 34 /** … … 145 145 */ 146 146 public $subscriptions; 147 148 /** 149 * Admin notices (eFaktúra announcement, failed documents). 150 * 151 * @var WC_SF_Notices 152 */ 153 public $notices; 147 154 148 155 … … 233 240 $this->tools = new WC_SF_Tools($this); 234 241 $this->subscriptions = new WC_SF_Subscriptions($this); 242 $this->notices = new WC_SF_Notices($this); 235 243 } 236 244 … … 404 412 $this->checkout_block->init(); 405 413 $this->bulk->init(); 414 $this->notices->init(); 406 415 } 407 416 … … 696 705 $order->save(); 697 706 707 // The invoice is attached without a log entry, so refresh the failed documents warning. 708 WC_SF_Notices::flush_errors(); 709 698 710 return true; 699 711 } … … 808 820 809 821 $order->save(); 822 823 // The document is attached without a log entry, so refresh the failed documents warning. 824 WC_SF_Notices::flush_errors(); 810 825 811 826 return true; … … 1008 1023 $log_data['time'] = current_time( 'mysql' ); 1009 1024 $wpdb->insert( $wpdb->prefix . 'wc_sf_log', $log_data ); 1025 1026 if ( isset( $log_data['request_type'] ) && in_array( $log_data['request_type'], array( 'create', 'edit' ), true ) ) { 1027 WC_SF_Notices::flush_errors(); 1028 } 1010 1029 } 1011 1030 … … 1135 1154 $result = __( 'Coupons', 'woocommerce-superfaktura' ) . ': ' . implode( ', ', $coupons ); 1136 1155 return $result; 1156 } 1157 1158 1159 1160 /** 1161 * Map of customer countries to the SuperFaktúra invoice language of that country. 1162 * 1163 * Only countries whose language SuperFaktúra supports; other countries use the fallback language from the settings. 1164 * 1165 * @return array Country code => SuperFaktúra language code. 1166 */ 1167 public function get_language_country_map() { 1168 $country_map = array( 1169 'SK' => 'slo', 1170 'CZ' => 'cze', 1171 'DE' => 'deu', 1172 'AT' => 'deu', 1173 'LI' => 'deu', 1174 'NL' => 'nld', 1175 'HR' => 'hrv', 1176 'HU' => 'hun', 1177 'PL' => 'pol', 1178 'RO' => 'rom', 1179 'RU' => 'rus', 1180 'SI' => 'slv', 1181 'ES' => 'spa', 1182 'MX' => 'spa', 1183 'AR' => 'spa', 1184 'CO' => 'spa', 1185 'CL' => 'spa', 1186 'PE' => 'spa', 1187 'VE' => 'spa', 1188 'EC' => 'spa', 1189 'GT' => 'spa', 1190 'CU' => 'spa', 1191 'BO' => 'spa', 1192 'DO' => 'spa', 1193 'HN' => 'spa', 1194 'PY' => 'spa', 1195 'SV' => 'spa', 1196 'NI' => 'spa', 1197 'CR' => 'spa', 1198 'PA' => 'spa', 1199 'UY' => 'spa', 1200 'IT' => 'ita', 1201 'SM' => 'ita', 1202 'UA' => 'ukr', 1203 'GB' => 'eng', 1204 'IE' => 'eng', 1205 'US' => 'eng', 1206 'AU' => 'eng', 1207 'NZ' => 'eng', 1208 ); 1209 1210 /** 1211 * Filter the map of customer countries to invoice languages used by the "Customer country" invoice language. 1212 * 1213 * @since 1.56.0 1214 * 1215 * @param array $country_map Country code => SuperFaktúra language code (slo, cze, eng, deu, nld, hrv, hun, pol, rom, rus, slv, spa, ita, ukr). 1216 */ 1217 return apply_filters( 'sf_invoice_language_country_map', $country_map ); 1137 1218 } 1138 1219 … … 1186 1267 break; 1187 1268 1269 case 'country': 1270 $order = wc_get_order( $order_id ); 1271 $country = ''; 1272 if ( $order ) { 1273 $country = $order->get_billing_country() ? $order->get_billing_country() : $order->get_shipping_country(); 1274 } 1275 1276 $country_map = $this->get_language_country_map(); 1277 if ( isset( $country_map[ $country ] ) ) { 1278 $language = $country_map[ $country ]; 1279 } else { 1280 // SuperFaktúra has no language for this country. 1281 $language = get_option( 'woocommerce_sf_invoice_language_fallback', 'endpoint' ); 1282 } 1283 break; 1284 1188 1285 case 'endpoint': 1189 1286 default: -
woocommerce-superfaktura/trunk/languages/woocommerce-superfaktura-cs_CZ.po
r3694932 r3730776 464 464 465 465 #: includes/class-wc-sf-settings.php:352 466 msgid " Εnglish"466 msgid "English" 467 467 msgstr "Angličtina" 468 468 … … 1602 1602 msgid "Include references to the SuperFaktúra account (number sequences, bank account, cash registers, logo, country overrides)" 1603 1603 msgstr "Zahrnout odkazy na účet SuperFaktury (číselníky, bankovní účet, pokladny, logo, nastavení pro země)" 1604 1605 #: includes/class-wc-sf-settings.php 1606 msgid "Customer country" 1607 msgstr "Země zákazníka" 1608 1609 #: includes/class-wc-sf-settings.php 1610 msgid "Fallback invoice language" 1611 msgstr "Náhradní jazyk faktury" 1612 1613 #: includes/class-wc-sf-settings.php 1614 msgid "Used with the customer country option when SuperFaktúra does not support the language of the customer's country." 1615 msgstr "Použije se při volbě Země zákazníka, pokud SuperFaktura nepodporuje jazyk země zákazníka." 1616 1617 #: includes/class-wc-sf-notices.php 1618 msgid "%d document could not be created or updated in SuperFaktúra in the last 30 days." 1619 msgid_plural "%d documents could not be created or updated in SuperFaktúra in the last 30 days." 1620 msgstr[0] "%d doklad se za posledních 30 dní nepodařilo vytvořit nebo aktualizovat v SuperFaktuře." 1621 msgstr[1] "%d doklady se za posledních 30 dní nepodařilo vytvořit nebo aktualizovat v SuperFaktuře." 1622 msgstr[2] "%d dokladů se za posledních 30 dní nepodařilo vytvořit nebo aktualizovat v SuperFaktuře." 1623 1624 #: includes/class-wc-sf-notices.php 1625 msgid "Order #%s" 1626 msgstr "Objednávka #%s" 1627 1628 #: includes/class-wc-sf-notices.php 1629 msgid "and %d more" 1630 msgid_plural "and %d more" 1631 msgstr[0] "a další %d" 1632 msgstr[1] "a další %d" 1633 msgstr[2] "a dalších %d" 1634 1635 #: includes/class-wc-sf-notices.php 1636 msgid "Open API log" 1637 msgstr "Otevřít API log" 1638 1639 #: includes/class-wc-sf-notices.php 1640 msgid "More than %d documents could not be created or updated in SuperFaktúra in the last 30 days." 1641 msgstr "Více než %d dokladů se za posledních 30 dní nepodařilo vytvořit nebo aktualizovat v SuperFaktuře." 1642 1643 #: includes/class-wc-sf-notices.php 1644 msgid "and more" 1645 msgstr "a další" -
woocommerce-superfaktura/trunk/languages/woocommerce-superfaktura-sk_SK.po
r3694932 r3730776 464 464 465 465 #: includes/class-wc-sf-settings.php:352 466 msgid " Εnglish"466 msgid "English" 467 467 msgstr "Angličtina" 468 468 … … 1606 1606 msgid "Include references to the SuperFaktúra account (number sequences, bank account, cash registers, logo, country overrides)" 1607 1607 msgstr "Zahrnúť odkazy na účet SuperFaktúry (číselníky, bankový účet, pokladne, logo, nastavenia pre krajiny)" 1608 1609 #: includes/class-wc-sf-settings.php 1610 msgid "Customer country" 1611 msgstr "Krajina zákazníka" 1612 1613 #: includes/class-wc-sf-settings.php 1614 msgid "Fallback invoice language" 1615 msgstr "Náhradný jazyk faktúry" 1616 1617 #: includes/class-wc-sf-settings.php 1618 msgid "Used with the customer country option when SuperFaktúra does not support the language of the customer's country." 1619 msgstr "Použije sa pri voľbe Krajina zákazníka, ak SuperFaktúra nepodporuje jazyk krajiny zákazníka." 1620 1621 #: includes/class-wc-sf-notices.php 1622 msgid "%d document could not be created or updated in SuperFaktúra in the last 30 days." 1623 msgid_plural "%d documents could not be created or updated in SuperFaktúra in the last 30 days." 1624 msgstr[0] "%d doklad sa za posledných 30 dní nepodarilo vytvoriť alebo aktualizovať v SuperFaktúre." 1625 msgstr[1] "%d doklady sa za posledných 30 dní nepodarilo vytvoriť alebo aktualizovať v SuperFaktúre." 1626 msgstr[2] "%d dokladov sa za posledných 30 dní nepodarilo vytvoriť alebo aktualizovať v SuperFaktúre." 1627 1628 #: includes/class-wc-sf-notices.php 1629 msgid "Order #%s" 1630 msgstr "Objednávka #%s" 1631 1632 #: includes/class-wc-sf-notices.php 1633 msgid "and %d more" 1634 msgid_plural "and %d more" 1635 msgstr[0] "a ďalší %d" 1636 msgstr[1] "a ďalšie %d" 1637 msgstr[2] "a ďalších %d" 1638 1639 #: includes/class-wc-sf-notices.php 1640 msgid "Open API log" 1641 msgstr "Otvoriť API log" 1642 1643 #: includes/class-wc-sf-notices.php 1644 msgid "More than %d documents could not be created or updated in SuperFaktúra in the last 30 days." 1645 msgstr "Viac ako %d dokladov sa za posledných 30 dní nepodarilo vytvoriť alebo aktualizovať v SuperFaktúre." 1646 1647 #: includes/class-wc-sf-notices.php 1648 msgid "and more" 1649 msgstr "a ďalšie" -
woocommerce-superfaktura/trunk/languages/woocommerce-superfaktura.pot
r3694932 r3730776 466 466 467 467 #: includes/class-wc-sf-settings.php:352 468 msgid " Εnglish"468 msgid "English" 469 469 msgstr "" 470 470 … … 1545 1545 msgid "Include references to the SuperFaktúra account (number sequences, bank account, cash registers, logo, country overrides)" 1546 1546 msgstr "" 1547 1548 #: includes/class-wc-sf-settings.php 1549 msgid "Customer country" 1550 msgstr "" 1551 1552 #: includes/class-wc-sf-settings.php 1553 msgid "Fallback invoice language" 1554 msgstr "" 1555 1556 #: includes/class-wc-sf-settings.php 1557 msgid "Used with the customer country option when SuperFaktúra does not support the language of the customer's country." 1558 msgstr "" 1559 1560 #: includes/class-wc-sf-notices.php 1561 msgid "%d document could not be created or updated in SuperFaktúra in the last 30 days." 1562 msgid_plural "%d documents could not be created or updated in SuperFaktúra in the last 30 days." 1563 msgstr[0] "" 1564 msgstr[1] "" 1565 1566 #: includes/class-wc-sf-notices.php 1567 msgid "Order #%s" 1568 msgstr "" 1569 1570 #: includes/class-wc-sf-notices.php 1571 msgid "and %d more" 1572 msgid_plural "and %d more" 1573 msgstr[0] "" 1574 msgstr[1] "" 1575 1576 #: includes/class-wc-sf-notices.php 1577 msgid "Open API log" 1578 msgstr "" 1579 1580 #: includes/class-wc-sf-notices.php 1581 msgid "More than %d documents could not be created or updated in SuperFaktúra in the last 30 days." 1582 msgstr "" 1583 1584 #: includes/class-wc-sf-notices.php 1585 msgid "and more" 1586 msgstr "" -
woocommerce-superfaktura/trunk/uninstall.php
r2794434 r3730776 16 16 17 17 // TODO: Define uninstall functionality here. 18 19 // Notices closed by users (eFaktúra announcement, failed documents). 20 global $wpdb; 21 $wc_sf_site_ids = ( is_multisite() && function_exists( 'get_sites' ) ) ? get_sites( array( 'fields' => 'ids', 'number' => 0 ) ) : array( get_current_blog_id() ); 22 foreach ( $wc_sf_site_ids as $wc_sf_site_id ) { 23 delete_metadata( 'user', 0, $wpdb->get_blog_prefix( $wc_sf_site_id ) . 'wc_sf_dismissed_notices', '', true ); 24 if ( is_multisite() ) { 25 switch_to_blog( $wc_sf_site_id ); 26 } 27 delete_transient( 'wc_sf_document_errors' ); 28 if ( is_multisite() ) { 29 restore_current_blog(); 30 } 31 } -
woocommerce-superfaktura/trunk/woocommerce-superfaktura.php
r3719141 r3730776 13 13 * Plugin URI: https://www.superfaktura.sk/integracia/ 14 14 * Description: Integrácia služby <a href="http://www.superfaktura.sk/api/">SuperFaktúra.sk</a> pre WooCommerce. Máte s modulom technický problém? Napíšte nám na <a href="mailto:superfaktura@2day.sk">superfaktura@2day.sk</a> 15 * Version: 1.5 5.315 * Version: 1.56.0 16 16 * Author: 2day.sk 17 17 * Author URI: https://www.superfaktura.sk/integracia/ … … 38 38 require_once plugin_dir_path( WC_SF_FILE_PATH ) . 'includes/class-wc-sf-helper.php'; 39 39 require_once plugin_dir_path( WC_SF_FILE_PATH ) . 'includes/class-wc-sf-invoice.php'; 40 require_once plugin_dir_path( WC_SF_FILE_PATH ) . 'includes/class-wc-sf-notices.php'; 40 41 require_once plugin_dir_path( WC_SF_FILE_PATH ) . 'includes/class-wc-sf-subscriptions.php'; 41 42 require_once plugin_dir_path( WC_SF_FILE_PATH ) . 'includes/class-wc-sf-tools.php';
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)