Changeset 3156677
- Timestamp:
- 09/24/2024 08:09:33 AM (19 months ago)
- Location:
- moloni-es/trunk
- Files:
-
- 11 edited
-
README.md (modified) (2 diffs)
-
languages/moloni_es-es_ES.mo (modified) (previous)
-
languages/moloni_es-pt_PT.mo (modified) (previous)
-
languages/moloni_es.pot (modified) (15 diffs)
-
moloni_es.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
src/Activators/Install.php (modified) (4 diffs)
-
src/Activators/Updater.php (modified) (2 diffs)
-
src/Controllers/OrderCustomer.php (modified) (2 diffs)
-
src/Templates/Containers/Settings.php (modified) (1 diff)
-
src/Tools/SyncLogs.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
moloni-es/trunk/README.md
r3115730 r3156677 16 16 **Tested up to:** 6.5.5 17 17 **WC tested up to** 9.0.2 18 **Stable tag:** 2.1. 018 **Stable tag:** 2.1.1 19 19 **License:** GPLv2 or later 20 20 **License URI:** [https://www.gnu.org/licenses/gpl-2.0.html](https://www.gnu.org/licenses/gpl-2.0.html) … … 74 74 75 75 ## Changelog 76 ### 2.1.1 77 * Security fixes 78 76 79 ### 2.1.0 77 80 * Security fixes -
moloni-es/trunk/languages/moloni_es.pot
r3068345 r3156677 4 4 "Project-Id-Version: Moloni ES\n" 5 5 "Report-Msgid-Bugs-To: \n" 6 "POT-Creation-Date: 2024-0 3-14 14:47+0000\n"6 "POT-Creation-Date: 2024-09-23 13:17+0000\n" 7 7 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 8 8 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 53 53 msgstr "" 54 54 55 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Templates/Containers/Settings.php:4 7155 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Templates/Containers/Settings.php:498 56 56 msgid "Advanced" 57 57 msgstr "" … … 62 62 msgstr "" 63 63 64 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Templates/Containers/Settings.php: 47964 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Templates/Containers/Settings.php:506 65 65 msgid "Alert e-mail" 66 66 msgstr "" … … 299 299 msgstr "" 300 300 301 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Controllers/OrderCustomer.php:17 5301 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Controllers/OrderCustomer.php:177 302 302 msgid "Customer has invalid VAT for Spain." 303 303 msgstr "" … … 529 529 msgstr "" 530 530 531 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Controllers/OrderCustomer.php:9 0531 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Controllers/OrderCustomer.php:91 532 532 msgid "Error creating customer." 533 533 msgstr "" … … 562 562 msgstr "" 563 563 564 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Controllers/OrderCustomer.php:28 0564 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Controllers/OrderCustomer.php:285 565 565 msgid "Error fetching countries" 566 566 msgstr "" … … 570 570 msgstr "" 571 571 572 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Controllers/OrderCustomer.php:37 2572 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Controllers/OrderCustomer.php:377 573 573 msgid "Error fetching customers." 574 574 msgstr "" … … 671 671 msgstr "" 672 672 673 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Controllers/OrderCustomer.php:10 6673 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Controllers/OrderCustomer.php:107 674 674 msgid "Error updating customer." 675 675 msgstr "" 676 676 677 677 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Templates/Containers/Settings.php:392 678 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Templates/Containers/Settings.php:5 06678 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Templates/Containers/Settings.php:533 679 679 msgid "Example" 680 680 msgstr "" … … 778 778 "If the authentication has expired, please proceed with the authentication " 779 779 "process again, which you can consult <a href=\"%s\">here</a>." 780 msgstr "" 781 782 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Templates/Containers/Settings.php:488 783 msgid "" 784 "If the VAT number is invalid, the document will be issued to the \"final " 785 "consumer\"" 780 786 msgstr "" 781 787 … … 1003 1009 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Templates/Containers/Settings.php:229 1004 1010 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Templates/Containers/Settings.php:247 1011 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Templates/Containers/Settings.php:481 1005 1012 msgid "No" 1006 1013 msgstr "" … … 1352 1359 msgstr "" 1353 1360 1354 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Templates/Containers/Settings.php: 4861361 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Templates/Containers/Settings.php:513 1355 1362 msgid "" 1356 1363 "Receive alerts for when an error occurs (document creation/authentication " … … 1409 1416 1410 1417 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Templates/Containers/Automation.php:291 1411 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Templates/Containers/Settings.php: 4941418 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Templates/Containers/Settings.php:521 1412 1419 msgid "Save changes" 1413 1420 msgstr "" … … 1632 1639 msgstr "" 1633 1640 1634 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Controllers/OrderCustomer.php:12 01641 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Controllers/OrderCustomer.php:121 1635 1642 msgid "There was an error saving the customer." 1636 1643 msgstr "" … … 1730 1737 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Services/MoloniProduct/Abstracts/MoloniProductSyncAbstract.php:470 1731 1738 msgid "updating" 1739 msgstr "" 1740 1741 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Templates/Containers/Settings.php:468 1742 msgid "Validate VAT" 1732 1743 msgstr "" 1733 1744 … … 1885 1896 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Templates/Containers/Settings.php:231 1886 1897 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Templates/Containers/Settings.php:250 1898 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Templates/Containers/Settings.php:484 1887 1899 msgid "Yes" 1888 1900 msgstr "" -
moloni-es/trunk/moloni_es.php
r3115730 r3156677 4 4 * Plugin Name: Moloni España 5 5 * Description: Simple invoicing integration with Moloni ES 6 * Version: 2.1. 06 * Version: 2.1.1 7 7 * Tested up to: 6.5.5 8 8 * WC tested up to: 9.0.2 -
moloni-es/trunk/readme.txt
r3115730 r3156677 3 3 Contributors: Moloni 4 4 Tags: Invoicing, Orders 5 Stable tag: 2.1. 05 Stable tag: 2.1.1 6 6 Tested up to: 6.5.5 7 7 WC tested up to: 9.0.2 … … 71 71 72 72 == Changelog == 73 = 2.1.1 = 74 * Security fixes 75 73 76 = 2.1.0 = 74 77 * Security fixes -
moloni-es/trunk/src/Activators/Install.php
r3041220 r3156677 35 35 36 36 self::createTables($prefix); 37 self::insertSettings($prefix);38 37 } 39 38 } else { … … 41 40 42 41 self::createTables($prefix); 43 self::insertSettings($prefix);44 42 } 45 43 } … … 59 57 60 58 self::createTables($prefix); 61 self::insertSettings($prefix);62 59 } 63 60 … … 124 121 ); 125 122 } 126 127 /**128 * Create Moloni account settings129 */130 private static function insertSettings(string $prefix): void131 {132 global $wpdb;133 134 $wpdb->query("135 INSERT INTO `" . $prefix . "moloni_api_config`(config, description)136 VALUES137 ('document_set_id', 'Choose a Document Set for better organization'),138 ('exemption_reason', 'Choose a Tax Exemption for products that do not have taxes'),139 ('exemption_reason_shipping', 'Choose a Tax Exemption for shipping that does not have taxes'),140 ('payment_method', 'Choose a default payment method'),141 ('measure_unit', 'Choose the unit of measurement to use'),142 ('maturity_date', 'Maturity date'),143 ('document_status', 'Choose the status of the document (closed or in draft)'),144 ('document_type', 'Choose the type of documents you want to issue'),145 ('client_prefix', 'WC', 'Customer reference prefix'),146 ('product_prefix', 'Product reference prefix'),147 ('update_final_consumer', 'Update customer'),148 ('shipping_info', 'Shipping info'),149 ('vat_field', 'VAT'),150 ('email_send', 'Send e-mail'),151 ('moloni_stock_sync', 'Sync Stocks'),152 ('moloni_product_sync', 'Sync products')153 ");154 }155 123 } -
moloni-es/trunk/src/Activators/Updater.php
r3041220 r3156677 35 35 $prefix = $wpdb->get_blog_prefix($site->id); 36 36 37 $this 38 ->runModification('moloni_es_api', $prefix . 'moloni_es_api') 39 ->runModification('moloni_es_api_config', $prefix . 'moloni_es_api_config') 40 ->runModification('moloni_sync_logs', $prefix . 'moloni_es_sync_logs'); 37 $wpdb->query("RENAME TABLE moloni_es_api TO {$prefix}moloni_es_api"); 38 $wpdb->query("RENAME TABLE moloni_es_api_config TO {$prefix}moloni_es_api_config"); 39 $wpdb->query("RENAME TABLE moloni_sync_logs TO {$prefix}moloni_es_sync_logs"); 41 40 } 42 41 } else { 43 42 $prefix = $wpdb->get_blog_prefix(); 44 43 45 $this 46 ->runModification('moloni_es_api', $prefix . 'moloni_es_api') 47 ->runModification('moloni_es_api_config', $prefix . 'moloni_es_api_config') 48 ->runModification('moloni_sync_logs', $prefix . 'moloni_es_sync_logs'); 44 $wpdb->query("RENAME TABLE moloni_es_api TO {$prefix}moloni_es_api"); 45 $wpdb->query("RENAME TABLE moloni_es_api_config TO {$prefix}moloni_es_api_config"); 46 $wpdb->query("RENAME TABLE moloni_sync_logs TO {$prefix}moloni_es_sync_logs"); 49 47 } 50 48 } … … 75 73 76 74 // Auxiliary // 77 78 /**79 * Alters old table name80 *81 * @param string $oldName Old table name82 * @param string $newName New table name83 *84 * @return Updater85 */86 private function runModification(string $oldName, string $newName): Updater87 {88 global $wpdb;89 90 $wpdb->query(sprintf('RENAME TABLE %s TO %s ;', $oldName, $newName));91 92 return $this;93 }94 75 95 76 /** -
moloni-es/trunk/src/Controllers/OrderCustomer.php
r3041220 r3156677 6 6 use MoloniES\Exceptions\DocumentError; 7 7 use MoloniES\API\Customers; 8 use MoloniES\Enums\Boolean; 8 9 use MoloniES\Enums\Countries; 9 10 use MoloniES\Exceptions\APIExeption; … … 173 174 174 175 if (!empty($vat) && !Customer::isVatEsValid($vat)) { 175 throw new DocumentError(__('Customer has invalid VAT for Spain.','moloni_es')); 176 if (!defined('VAT_VALIDATE') || (int)VAT_VALIDATE === Boolean::NO) { 177 throw new DocumentError(__('Customer has invalid VAT for Spain.','moloni_es')); 178 } 179 180 $vat = null; 176 181 } 177 182 } -
moloni-es/trunk/src/Templates/Containers/Settings.php
r3041220 r3156677 464 464 </tr> 465 465 466 <tr> 467 <th> 468 <label for="vat_validate"><?= __('Validate VAT', 'moloni_es') ?></label> 469 </th> 470 <td> 471 <?php 472 $vatValidate = 0; 473 474 if (defined('VAT_VALIDATE')) { 475 $vatValidate = (int)VAT_VALIDATE; 476 } 477 ?> 478 479 <select id="vat_validate" name='opt[vat_validate]' class='inputOut'> 480 <option value='0' <?= ($vatValidate === 0 ? 'selected' : '') ?>> 481 <?= __('No', 'moloni_es') ?> 482 </option> 483 <option value='1' <?= ($vatValidate === 1 ? 'selected' : '') ?>> 484 <?= __('Yes', 'moloni_es') ?> 485 </option> 486 </select> 487 <p class='description'> 488 <?= __('If the VAT number is invalid, the document will be issued to the "final consumer"', 'moloni_es') ?> 489 </p> 490 </td> 491 </tr> 492 466 493 </tbody> 467 494 </table> -
moloni-es/trunk/src/Tools/SyncLogs.php
r3041220 r3156677 76 76 global $wpdb; 77 77 78 $query = 'SELECT COUNT(*) FROM ' . $wpdb->get_blog_prefix() . 'moloni_es_sync_logs79 WHERE `entity_id` = ' . $entityId . ' AND';78 $query = "SELECT COUNT(*) FROM {$wpdb->get_blog_prefix()}moloni_es_sync_logs 79 WHERE `entity_id` = {$entityId} AND"; 80 80 81 81 if (is_array($typeId)) { … … 106 106 global $wpdb; 107 107 108 $wpdb->query('DELETE FROM ' . $wpdb->get_blog_prefix() . 'moloni_es_sync_logs WHERE sync_date < ' . time()); 108 $query = $wpdb->prepare( 109 "DELETE FROM `{$wpdb->get_blog_prefix()}moloni_es_sync_logs` WHERE sync_date < %d", 110 time() 111 ); 112 113 $wpdb->query($query); 109 114 } 110 115 }
Note: See TracChangeset
for help on using the changeset viewer.