Plugin Directory

Changeset 3156677


Ignore:
Timestamp:
09/24/2024 08:09:33 AM (19 months ago)
Author:
molonies
Message:

Updating readme/assets from GitHub

Location:
moloni-es/trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • moloni-es/trunk/README.md

    r3115730 r3156677  
    1616**Tested up to:**      6.5.5 
    1717**WC tested up to**    9.0.2 
    18 **Stable tag:**        2.1.0 
     18**Stable tag:**        2.1.1 
    1919**License:**           GPLv2 or later 
    2020**License URI:**       [https://www.gnu.org/licenses/gpl-2.0.html](https://www.gnu.org/licenses/gpl-2.0.html)
     
    7474
    7575## Changelog
     76### 2.1.1
     77* Security fixes
     78
    7679### 2.1.0
    7780* Security fixes
  • moloni-es/trunk/languages/moloni_es.pot

    r3068345 r3156677  
    44"Project-Id-Version: Moloni ES\n"
    55"Report-Msgid-Bugs-To: \n"
    6 "POT-Creation-Date: 2024-03-14 14:47+0000\n"
     6"POT-Creation-Date: 2024-09-23 13:17+0000\n"
    77"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    88"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    5353msgstr ""
    5454
    55 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Templates/Containers/Settings.php:471
     55#: bitnami/wordpress/wp-content/plugins/moloni-es/src/Templates/Containers/Settings.php:498
    5656msgid "Advanced"
    5757msgstr ""
     
    6262msgstr ""
    6363
    64 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Templates/Containers/Settings.php:479
     64#: bitnami/wordpress/wp-content/plugins/moloni-es/src/Templates/Containers/Settings.php:506
    6565msgid "Alert e-mail"
    6666msgstr ""
     
    299299msgstr ""
    300300
    301 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Controllers/OrderCustomer.php:175
     301#: bitnami/wordpress/wp-content/plugins/moloni-es/src/Controllers/OrderCustomer.php:177
    302302msgid "Customer has invalid VAT for Spain."
    303303msgstr ""
     
    529529msgstr ""
    530530
    531 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Controllers/OrderCustomer.php:90
     531#: bitnami/wordpress/wp-content/plugins/moloni-es/src/Controllers/OrderCustomer.php:91
    532532msgid "Error creating customer."
    533533msgstr ""
     
    562562msgstr ""
    563563
    564 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Controllers/OrderCustomer.php:280
     564#: bitnami/wordpress/wp-content/plugins/moloni-es/src/Controllers/OrderCustomer.php:285
    565565msgid "Error fetching countries"
    566566msgstr ""
     
    570570msgstr ""
    571571
    572 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Controllers/OrderCustomer.php:372
     572#: bitnami/wordpress/wp-content/plugins/moloni-es/src/Controllers/OrderCustomer.php:377
    573573msgid "Error fetching customers."
    574574msgstr ""
     
    671671msgstr ""
    672672
    673 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Controllers/OrderCustomer.php:106
     673#: bitnami/wordpress/wp-content/plugins/moloni-es/src/Controllers/OrderCustomer.php:107
    674674msgid "Error updating customer."
    675675msgstr ""
    676676
    677677#: 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:506
     678#: bitnami/wordpress/wp-content/plugins/moloni-es/src/Templates/Containers/Settings.php:533
    679679msgid "Example"
    680680msgstr ""
     
    778778"If the authentication has expired, please proceed with the authentication "
    779779"process again, which you can consult <a href=\"%s\">here</a>."
     780msgstr ""
     781
     782#: bitnami/wordpress/wp-content/plugins/moloni-es/src/Templates/Containers/Settings.php:488
     783msgid ""
     784"If the VAT number is invalid, the document will be issued to the \"final "
     785"consumer\""
    780786msgstr ""
    781787
     
    10031009#: bitnami/wordpress/wp-content/plugins/moloni-es/src/Templates/Containers/Settings.php:229
    10041010#: 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
    10051012msgid "No"
    10061013msgstr ""
     
    13521359msgstr ""
    13531360
    1354 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Templates/Containers/Settings.php:486
     1361#: bitnami/wordpress/wp-content/plugins/moloni-es/src/Templates/Containers/Settings.php:513
    13551362msgid ""
    13561363"Receive alerts for when an error occurs (document creation/authentication "
     
    14091416
    14101417#: 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:494
     1418#: bitnami/wordpress/wp-content/plugins/moloni-es/src/Templates/Containers/Settings.php:521
    14121419msgid "Save changes"
    14131420msgstr ""
     
    16321639msgstr ""
    16331640
    1634 #: bitnami/wordpress/wp-content/plugins/moloni-es/src/Controllers/OrderCustomer.php:120
     1641#: bitnami/wordpress/wp-content/plugins/moloni-es/src/Controllers/OrderCustomer.php:121
    16351642msgid "There was an error saving the customer."
    16361643msgstr ""
     
    17301737#: bitnami/wordpress/wp-content/plugins/moloni-es/src/Services/MoloniProduct/Abstracts/MoloniProductSyncAbstract.php:470
    17311738msgid "updating"
     1739msgstr ""
     1740
     1741#: bitnami/wordpress/wp-content/plugins/moloni-es/src/Templates/Containers/Settings.php:468
     1742msgid "Validate VAT"
    17321743msgstr ""
    17331744
     
    18851896#: bitnami/wordpress/wp-content/plugins/moloni-es/src/Templates/Containers/Settings.php:231
    18861897#: 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
    18871899msgid "Yes"
    18881900msgstr ""
  • moloni-es/trunk/moloni_es.php

    r3115730 r3156677  
    44 *   Plugin Name:  Moloni España
    55 *   Description:  Simple invoicing integration with Moloni ES
    6  *   Version:      2.1.0
     6 *   Version:      2.1.1
    77 *   Tested up to: 6.5.5
    88 *   WC tested up to: 9.0.2
  • moloni-es/trunk/readme.txt

    r3115730 r3156677  
    33Contributors: Moloni
    44Tags: Invoicing, Orders
    5 Stable tag: 2.1.0
     5Stable tag: 2.1.1
    66Tested up to: 6.5.5
    77WC tested up to: 9.0.2
     
    7171
    7272== Changelog ==
     73= 2.1.1 =
     74* Security fixes
     75
    7376= 2.1.0 =
    7477* Security fixes
  • moloni-es/trunk/src/Activators/Install.php

    r3041220 r3156677  
    3535
    3636                self::createTables($prefix);
    37                 self::insertSettings($prefix);
    3837            }
    3938        } else {
     
    4140
    4241            self::createTables($prefix);
    43             self::insertSettings($prefix);
    4442        }
    4543    }
     
    5957
    6058        self::createTables($prefix);
    61         self::insertSettings($prefix);
    6259    }
    6360
     
    124121        );
    125122    }
    126 
    127     /**
    128      * Create Moloni account settings
    129      */
    130     private static function insertSettings(string $prefix): void
    131     {
    132         global $wpdb;
    133 
    134         $wpdb->query("
    135             INSERT INTO `" . $prefix . "moloni_api_config`(config, description)
    136             VALUES
    137                 ('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     }
    155123}
  • moloni-es/trunk/src/Activators/Updater.php

    r3041220 r3156677  
    3535                    $prefix = $wpdb->get_blog_prefix($site->id);
    3636
    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");
    4140                }
    4241            } else {
    4342                $prefix = $wpdb->get_blog_prefix();
    4443
    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");
    4947            }
    5048        }
     
    7573
    7674    //          Auxiliary          //
    77 
    78     /**
    79      * Alters old table name
    80      *
    81      * @param string $oldName Old table name
    82      * @param string $newName New table name
    83      *
    84      * @return Updater
    85      */
    86     private function runModification(string $oldName, string $newName): Updater
    87     {
    88         global $wpdb;
    89 
    90         $wpdb->query(sprintf('RENAME TABLE %s TO %s ;', $oldName, $newName));
    91 
    92         return $this;
    93     }
    9475
    9576    /**
  • moloni-es/trunk/src/Controllers/OrderCustomer.php

    r3041220 r3156677  
    66use MoloniES\Exceptions\DocumentError;
    77use MoloniES\API\Customers;
     8use MoloniES\Enums\Boolean;
    89use MoloniES\Enums\Countries;
    910use MoloniES\Exceptions\APIExeption;
     
    173174
    174175                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;
    176181                }
    177182            }
  • moloni-es/trunk/src/Templates/Containers/Settings.php

    r3041220 r3156677  
    464464            </tr>
    465465
     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
    466493            </tbody>
    467494        </table>
  • moloni-es/trunk/src/Tools/SyncLogs.php

    r3041220 r3156677  
    7676        global $wpdb;
    7777
    78         $query = 'SELECT COUNT(*) FROM ' . $wpdb->get_blog_prefix() . 'moloni_es_sync_logs
    79             WHERE `entity_id` = ' . $entityId . ' AND';
     78        $query = "SELECT COUNT(*) FROM {$wpdb->get_blog_prefix()}moloni_es_sync_logs
     79            WHERE `entity_id` = {$entityId} AND";
    8080
    8181        if (is_array($typeId)) {
     
    106106        global $wpdb;
    107107
    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);
    109114    }
    110115}
Note: See TracChangeset for help on using the changeset viewer.