Plugin Directory

Changeset 3386889


Ignore:
Timestamp:
10/30/2025 08:02:43 AM (4 months ago)
Author:
primersoftware
Message:

Update

Location:
primer-mydata
Files:
2137 added
8 edited

Legend:

Unmodified
Added
Removed
  • primer-mydata/trunk/README.txt

    r3383134 r3386889  
    55Tested up to: 6.8.2
    66Requires PHP: 7.4
    7 Stable tag: 4.2.7
     7Stable tag: 4.2.8
    88License: GPLv2
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    7373
    7474== Changelog ==
     75= 4.2.8 - 2025-10-29 =
     76* Minor bug fixes.
     77* Added Sim ISP support in Company Activation for enhanced contract management.
    7578= 4.2.7 - 2025-10-20 =
    7679* Added HPOS compatibility integration with WooCommerce High-Performance Order Storage (HPOS) for improved order management and performance.
  • primer-mydata/trunk/admin/includes/my_data_json.php

    r3383134 r3386889  
    1414                                   &$response_data, &$receipt_log_value, &$receipt_log_value_array, &$receipt_log_id, &$invoice_term, $gr_time,$invoice_time,
    1515                                   &$order_total_price, &$order_invoice_type, &$order_vatNumber, &$user_order_email, &$order_country, &$user_full_name, &$primer_smtp,
    16                                    &$log_ids, $callingFunction, &$invoiceType, &$classificationType, $is_credit = false, $receipt_id = ''): array | string {
     16                                   &$log_ids, $callingFunction, &$invoiceType, &$classificationType, $is_credit = false, $receipt_id = '') {
    1717        $primer_smtp             = PrimerSMTP::get_instance();
    1818        $licenses                = get_option('primer_licenses');
     
    227227            $address         = $order->get_shipping_address_1() ?? $order->get_billing_address_1();
    228228            $billing_street  = trim(preg_replace('/[^a-zA-ZΑ-Ωα-ωΆ-Ώά-ώ\s]/u', '', $billing_address));
     229            if($billing_street == '') {
     230                $billing_street = $order->get_billing_city();
     231            }
    229232            $billing_number  = trim(preg_replace('/\D/', '', $billing_address)) != "" ? trim(preg_replace('/\D/', '', $billing_address)) : "0";
    230233            $address_street  = trim(preg_replace('/[^a-zA-ZΑ-Ωα-ωΆ-Ώά-ώ\s]/u', '', $address));
     
    858861                'Services'        => ['amount' => $category_amounts['Services'], 'category_type' => $classificationType, 'category_code' => 'category1_3'],
    859862                'ShippingAndFees' => ['amount' => max(0, $fee_total) + max(0, $shipping_total), 'category_type' => 'E3_562', 'category_code' => 'category1_5'],
    860                 'OutsideVAT'      => ['amount' => $outside_vat_total, 'type' => null, 'code' => 'category1_95']
     863                'OutsideVAT'      => ['amount' => $outside_vat_total, 'category_type' => null, 'category_code' => 'category1_95']
    861864            ];
    862865
     
    10581061        $popup_messages = [
    10591062            'allow_url_fopen'      => __('Php option allow_url_fopen is disabled! Please communicate with your hosting provider in order to activate it.', 'primer'),
     1063            'bcmath'               => __('Php module "bcmath" is disabled! Please communicate with your hosting provider in order to activate it.', 'primer'),
    10601064            'orders_converted'     => __('Orders converted', 'primer'),
    10611065            'something_went_wrong' => __('Something went wrong. Please try again!', 'primer'),
     
    10731077                    $response_data     .= sprintf($popup_messages['error_popup_template'], $popup_messages['allow_url_fopen']);
    10741078                    $receipt_log_value .= $popup_messages['allow_url_fopen'];
    1075 
     1079                    return "break";
     1080                }
     1081                if (!extension_loaded('bcmath')) {
     1082                    $response_data     .= sprintf($popup_messages['error_popup_template'], $popup_messages['bcmath']);
     1083                    $receipt_log_value .= $popup_messages['bcmath'];
    10761084                    return "break";
    10771085                }
  • primer-mydata/trunk/admin/includes/primer-admin-options.php

    r3383134 r3386889  
    35313531                    break;
    35323532                }
     3533                if (!extension_loaded('bcmath')) {
     3534                    $response_data .= '<div class="primer_popup popup_error"><div><h3>'.__('Php module "bcmath" is disabled! Please communicate with your hosting provider in order to activate it.', 'primer') .'</h3><br><br><br><br><br></div>';
     3535                    $response_data .= '<button class="popup_ok button button-primary">OK</button></div>';
     3536                    $receipt_log_value .= __('Php module "bcmath" is disabled! Please communicate with your hosting provider in order to activate it.', 'primer');
     3537                    break;
     3538                }
    35333539
    35343540                $order_paid_date = null;
     
    41034109
    41044110    public function primer_system_settings() {
    4105         $response              = $cron_status_text = $version_status_text = $file_permission_text = $folder_permission_text = '';
    41064111        $permission_of_files   = $this->primer_get_file_permissions();
    41074112        $permission_of_folders = $this->primer_get_folder_permissions();
    4108 
    41094113        $folder_permission_values = array_values($permission_of_folders);
    41104114        $folder_permission_value  = array_unique($folder_permission_values);
     
    41314135        }
    41324136
    4133         $cron_status = $this->check_wp_cron_enabled();
    4134         $pos         = stripos($cron_status, 'ENABLED');
    4135 
    4136         if ($pos !== false) {
     4137        $cron_status = wp_next_scheduled('primer_cron_process_failed') || wp_next_scheduled('primer_cron_process_credit_failed') || wp_next_scheduled('primer_cron_primer_license_remaining');
     4138        if ($cron_status !== false) {
    41374139            $cron_status_text = '<p><span class="info_success">' . __('Pass', 'primer') . '</span></p>';
    41384140        } else {
     
    43494351        $sim_contract_id   = isset($_POST['contract_id']) ? sanitize_text_field($_POST['contract_id']) : '';
    43504352        $sim_contract_date = isset($_POST['contract_date']) ? sanitize_text_field($_POST['contract_date']) : '';
     4353        $sim_provider      = isset($_POST['sim_provider']) ? sanitize_text_field($_POST['sim_provider']) : '';
    43514354
    43524355        if (!empty($sim_contract_date)) {
     
    43594362        $sim_contract_date = (string) sanitize_text_field($sim_contract_date);
    43604363        $sim_contract_id   = (string) sanitize_text_field($sim_contract_id);
     4364        $sim_provider      = (string) sanitize_text_field($sim_provider);
    43614365
    43624366        $subsidiaries = $subsidiaries_json;
     
    44074411                "subsidiaries": ' . $subsidiaries . ',
    44084412                "simContractId": "' . $sim_contract_id . '",
    4409                 "simContractDate": "' . $sim_contract_date . '"
     4413                "simContractDate": "' . $sim_contract_date . '",
     4414                "simProvider": "' . $sim_provider . '"
    44104415                }';
    44114416        } else {
     
    44274432                "domain": "' . $domain_name . '",
    44284433                "simContractId": "' . $sim_contract_id . '",
    4429                 "simContractDate": "' . $sim_contract_date . '"
     4434                "simContractDate": "' . $sim_contract_date . '",
     4435                "simProvider": "' . $sim_provider . '"
    44304436            }';
    44314437        }
    4432 
    44334438
    44344439        $response         = wp_remote_request($api_url, $curl_args);
  • primer-mydata/trunk/admin/includes/primer-admin-table.php

    r3383134 r3386889  
    584584                break ;
    585585            }
     586            if (!extension_loaded('bcmath')) {
     587                $response_data .= '<div class="primer_popup popup_error"><div><h3>'.__('Php module "bcmath" is disabled! Please communicate with your hosting provider in order to activate it.', 'primer') .'</h3><br><br><br><br><br></div>';
     588                $response_data .= '<button class="popup_ok button button-primary">OK</button></div>';
     589                $receipt_log_value_array[] = __('Php module "bcmath" is disabled! Please communicate with your hosting provider in order to activate it.', 'primer');
     590                $receipt_log_value .= __('Php module "bcmath" is disabled! Please communicate with your hosting provider in order to activate it.', 'primer');
     591                break ;
     592            }
    586593            if ($order->get_meta('receipt_status') == 'issued' && $order->get_meta('transmission_failure_check') == null || $order->get_meta('transmission_failure_check') == 2) {
    587594                $response_data .= '<div class="primer_popup popup_error"><div><h3>'.__('This order has already been issued. Please refresh the page.', 'primer') .'</h3><br><br><br><br><br></div>';
  • primer-mydata/trunk/admin/js/primer-admin.js

    r3383134 r3386889  
    21772177                                const formRow1 = document.createElement("div");
    21782178                                formRow1.setAttribute("class", "left_detail");
     2179                                const simISPLabel       = document.createElement("label");
     2180                                simISPLabel.textContent = "Όνομα Παρόχου ISP:";
     2181                                simISPLabel.setAttribute("class", "company_activity");
     2182                                simISPLabel.style.paddingRight  = "46px";
     2183                                simISPLabel.style.verticalAlign = "initial";
     2184                                const simISPLabelInput = document.createElement("select");
     2185                                simISPLabelInput.setAttribute("name", "extra-field-1");
     2186                                simISPLabelInput.setAttribute("class", "cmb2-text-medium");
     2187                                simISPLabelInput.setAttribute("id", "simISPLabelInput");
     2188                                simISPLabelInput.style.padding = "1px 62px 0px 8px";
     2189                                simISPLabelInput.style.borderRadius = "4px";
     2190                                simISPLabelInput.required = true;
     2191                                const options = [
     2192                                    { value: 'Vodafone', text: 'Vodafone' },
     2193                                    { value: 'Cosmote', text: 'Cosmote' },
     2194                                    { value: 'Nova', text: 'Nova' },
     2195                                    { value: 'Q-Telecom', text: 'Q‑Telecom' },
     2196                                    { value: 'other', text: 'Άλλο' }
     2197                                ];
     2198
     2199                                const defaultOption       = document.createElement('option');
     2200                                defaultOption.value       = '';
     2201                                defaultOption.textContent = '-- Επιλέξτε ISP --';
     2202                                defaultOption.selected    = true;
     2203                                defaultOption.disabled    = true;
     2204                                simISPLabelInput.appendChild(defaultOption);
     2205                                options.forEach(option => {
     2206                                    const optionElement = document.createElement('option');
     2207                                    optionElement.value = option.value;
     2208                                    optionElement.textContent = option.text;
     2209                                    simISPLabelInput.setAttribute("class", "cmb2-text-medium");
     2210                                    simISPLabelInput.appendChild(optionElement);
     2211                                });
     2212                                const otherInput = document.createElement('input');
     2213                                otherInput.setAttribute('type', 'text');
     2214                                otherInput.setAttribute('class', 'cmb2-text-medium');
     2215                                otherInput.setAttribute('name', 'other_isp_input');
     2216                                otherInput.setAttribute('id', 'otherIspInput');
     2217                                otherInput.setAttribute('placeholder', 'Εισαγάγετε το όνομα');
     2218                                otherInput.style.display = 'none';
     2219                                simISPLabelInput.addEventListener('change', function() {
     2220                                    const nextSibling = simISPLabelInput.nextSibling;
     2221                                    const existingBr = nextSibling && nextSibling.nodeName === 'BR' ? nextSibling : null;
     2222                                    if (this.value === 'other') {
     2223                                        otherInput.style.display = 'inline-block';
     2224                                        otherInput.style.marginLeft = "196px";
     2225                                        otherInput.required = true;
     2226                                        if (!existingBr) {
     2227                                            const lineBr3 = document.createElement("br");
     2228                                            otherInput.parentNode.insertBefore(lineBr3, nextSibling);
     2229                                        }
     2230                                    } else {
     2231                                        otherInput.style.display = 'none';
     2232                                        otherInput.required = false;
     2233                                        if (existingBr) {
     2234                                            existingBr.remove();
     2235                                        }
     2236                                    }
     2237                                });
     2238                                formRow1.appendChild(simISPLabel);
     2239                                formRow1.appendChild(simISPLabelInput);
     2240                                formRow1.appendChild(otherInput);
     2241                                const lineBr1 = document.createElement("br");
     2242                                otherInput.parentNode.insertBefore(lineBr1, otherInput.nextSibling);
    21792243                                const contractIdLabel       = document.createElement("label");
    21802244                                contractIdLabel.textContent = "Αριθμός Συμβολαίου:";
     
    22812345                                detail_contractDateLabel.setAttribute("class", "detail_cp");
    22822346                                detail_contractDateLabel.innerHTML = "<br>Ημερομηνία Συμβολαίου:";
     2347                                const detail_simISPLabel = document.createElement("span");
     2348                                detail_simISPLabel.setAttribute("class", "detail_cp");
     2349                                detail_simISPLabel.innerHTML = "<br>Όνομα Παρόχου ISP:";
    22832350                                const detail_cp_name_value           = document.createElement("span");
    22842351                                detail_cp_name_value.innerHTML       = "";
     
    23132380                                const detail_cp_contractDate     = document.createElement("span");
    23142381                                detail_cp_contractDate.innerHTML = "";
     2382                                const detail_cp_simISP     = document.createElement("span");
     2383                                detail_cp_simISP.innerHTML = "";
    23152384                                const detail_message     = document.createElement("span");
    23162385                                detail_message.innerHTML = "<br><br>Είστε σίγουρος/η οτι θέλετε να συνεχίσετε την ενεργοποίηση; Η ενεργοποίηση θα πραγματοποιηθεί για την τωρινή ip διεύθυνση της ιστοσελίδας.<br>";
     
    23722441                                step_2.appendChild(detail_contractDateLabel);
    23732442                                step_2.appendChild(detail_cp_contractDate);
     2443                                step_2.appendChild(detail_simISPLabel);
     2444                                step_2.appendChild(detail_cp_simISP);
    23742445                                step_2.appendChild(detail_message);
    23752446                                step_2.appendChild(cp_activation);
     
    24092480                                                detail_cp_tk.innerHTML               = $('#cptk').val();
    24102481                                                detail_cp_doy.innerHTML              = $('#doy').val();
    2411                                                 detail_cp_contractId.innerHTML   = $('#contractInputId').val();
    2412                                                 detail_cp_contractDate.innerHTML = $('#contractInputDate').val();
     2482                                                detail_cp_contractId.innerHTML       = $('#contractInputId').val();
     2483                                                detail_cp_contractDate.innerHTML     = $('#contractInputDate').val();
     2484                                                detail_cp_simISP.innerHTML           = $('#simISPLabelInput').val() === "other" ? $('#otherIspInput').val() : $('#simISPLabelInput').val();
    24132485                                                btnclo.style.display   = 'none';
    24142486                                                cp_form.style.display  = 'none';
     
    24292501                                                        gemh = "empty";
    24302502                                                    }
    2431                                                     var cp_adress = $('#adress').val();
    2432                                                     var cp_city   = $('#city').val();
    2433                                                     var cp_email  = $('#email').val();
    2434                                                     var cp_tk     = $('#cptk').val();
    2435                                                     var rname     = $('#rname').val();
    2436                                                     var rsname    = $('#rsname').val();
    2437                                                     var rvat      = $('#rvat').val();
    2438                                                     var doy       = $('#doy').val();
     2503                                                    var cp_adress     = $('#adress').val();
     2504                                                    var cp_city       = $('#city').val();
     2505                                                    var cp_email      = $('#email').val();
     2506                                                    var cp_tk         = $('#cptk').val();
     2507                                                    var rname         = $('#rname').val();
     2508                                                    var rsname        = $('#rsname').val();
     2509                                                    var rvat          = $('#rvat').val();
     2510                                                    var doy           = $('#doy').val();
    24392511                                                    var contract_id   = $('#contractInputId').val();
    24402512                                                    var contract_date = $('#contractInputDate').val();
    2441                                                     var username = $('#primer_licenses #license_user').val();
    2442                                                     var password = $('#primer_licenses #license_password').val();
     2513                                                    var sim_provider  = $('#simISPLabelInput').val() === "other" ? $('#otherIspInput').val() : $('#simISPLabelInput').val();
     2514                                                    var username      = $('#primer_licenses #license_user').val();
     2515                                                    var password      = $('#primer_licenses #license_password').val();
    24432516                                                    var data = {
    2444                                                         'username'    : username,
    2445                                                         'password'    : password,
    2446                                                         'company_name': company_name,
    2447                                                         'small_name'  : small_name,
    2448                                                         'activity'    : activity,
    2449                                                         'c_phone'     : c_phone,
    2450                                                         'c_vat'       : c_vat,
    2451                                                         'gemh'        : gemh,
    2452                                                         'cp_adress'   : cp_adress,
    2453                                                         'r_name'      : rname,
    2454                                                         'r_sname'     : rsname,
    2455                                                         'r_vat'       : rvat,
    2456                                                         'cp_city'     : cp_city,
    2457                                                         'cp_email'    : cp_email,
    2458                                                         'cp_tk'       : cp_tk,
    2459                                                         'doy'         : doy,
     2517                                                        'username'     : username,
     2518                                                        'password'     : password,
     2519                                                        'company_name' : company_name,
     2520                                                        'small_name'   : small_name,
     2521                                                        'activity'     : activity,
     2522                                                        'c_phone'      : c_phone,
     2523                                                        'c_vat'        : c_vat,
     2524                                                        'gemh'         : gemh,
     2525                                                        'cp_adress'    : cp_adress,
     2526                                                        'r_name'       : rname,
     2527                                                        'r_sname'      : rsname,
     2528                                                        'r_vat'        : rvat,
     2529                                                        'cp_city'      : cp_city,
     2530                                                        'cp_email'     : cp_email,
     2531                                                        'cp_tk'        : cp_tk,
     2532                                                        'doy'          : doy,
    24602533                                                        'contract_id'  : contract_id,
    24612534                                                        'contract_date': contract_date,
    2462                                                         'action': 'company_activation_call'
     2535                                                        'sim_provider'  : sim_provider,
     2536                                                        'action'       : 'company_activation_call'
    24632537                                                    }
    24642538                                                    $.ajax({
  • primer-mydata/trunk/includes/class-primer-cron.php

    r3383134 r3386889  
    189189        $error_messages = [
    190190            'allow_url_fopen'                => __('Php option allow_url_fopen is disabled! Please communicate with your hosting provider in order to activate it.', 'primer'),
     191            'bcmath'                         => __('Php module "bcmath" is disabled! Please communicate with your hosting provider in order to activate it.', 'primer'),
    191192            'transmission_failure_aade'      => __('Could not connect to AADE. Please check your general settings if you want to enable transmission failure option or contact Primer Software if the problem persists.', 'primer'),
    192193            'no_remaining'                   => __('You have no other monthly invoices left.Please go to MyData settings and press "Get Remaining" button if you are sure that the month is passed and you have remaining invoices.', 'primer'),
     
    253254                            $receipt_log_value_array[]  = $error_messages['allow_url_fopen'];
    254255                            update_post_meta($receipt_log_id, 'receipt_log_automation_error', $error_messages['allow_url_fopen']);
     256                            break;
     257                        }
     258                        if (!extension_loaded('bcmath')) {
     259                            $response_data             .= sprintf($error_messages['error_popup_template'], $error_messages['bcmath']);
     260                            $receipt_log_value_array[]  = $error_messages['bcmath'];
     261                            update_post_meta($receipt_log_id, 'receipt_log_automation_error', $error_messages['bcmath']);
    255262                            break;
    256263                        }
     
    848855        $error_messages = [
    849856            'allow_url_fopen'         => __('Php option allow_url_fopen is disabled! Please communicate with your hosting provider in order to activate it.', 'primer'),
     857            'bcmath'                  => __('Php module "bcmath" is disabled! Please communicate with your hosting provider in order to activate it.', 'primer'),
    850858            'no_remaining_invoices'   => __('You have no other monthly invoices left.Please go to MyData settings and press "Get Remaining" button if you are sure that the month is passed and you have remaining invoices.', 'primer'),
    851859            'orders_converted'        => __('Orders converted', 'primer'),
     
    919927                    $response_data     .= sprintf($error_messages['error_popup_template'], $error_messages['allow_url_fopen']);
    920928                    $receipt_log_value .= $error_messages['allow_url_fopen'];
     929                    break;
     930                }
     931                if (!extension_loaded('bcmath')) {
     932                    $response_data     .= sprintf($error_messages['error_popup_template'], $error_messages['bcmath']);
     933                    $receipt_log_value .= $error_messages['bcmath'];
    921934                    break;
    922935                }
     
    14001413        $error_messages = [
    14011414            'allow_url_fopen'                => __('Php option allow_url_fopen is disabled! Please communicate with your hosting provider in order to activate it.', 'primer'),
     1415            'bcmath'                         => __('Php module "bcmath" is disabled! Please communicate with your hosting provider in order to activate it.', 'primer'),
    14021416            'transmission_failure_aade'      => __('Could not connect to AADE. Please check your general settings if you want to enable transmission failure option or contact Primer Software if the problem persists.', 'primer'),
    14031417            'no_remaining'                   => __('You have no other monthly invoices left.Please go to MyData settings and press "Get Remaining" button if you are sure that the month is passed and you have remaining invoices.', 'primer'),
     
    14551469                        $response_data     .= sprintf($error_messages['error_popup_template'], $error_messages['allow_url_fopen']);
    14561470                        $receipt_log_value .= $error_messages['allow_url_fopen'];
     1471                        break;
     1472                    }
     1473                    if (!extension_loaded('bcmath')) {
     1474                        $response_data             .= sprintf($error_messages['error_popup_template'], $error_messages['bcmath']);
     1475                        $receipt_log_value .= $error_messages['bcmath'];
    14571476                        break;
    14581477                    }
  • primer-mydata/trunk/primer.php

    r3383134 r3386889  
    1818 * Plugin URI:        primer.gr/plugin/
    1919 * Description:       Issue receipts and invoices with woocommerce.
    20  * Version:           4.2.7
     20 * Version:           4.2.8
    2121 * Author:            Primer Software
    2222 * Author URI:        primer.gr
     
    3434 * Rename this for your plugin and update it as you release new versions.
    3535 */
    36 define( 'PRIMER_VERSION', '4.2.7');
     36define( 'PRIMER_VERSION', '4.2.8');
    3737define( 'PRIMER_NAME', 'Primer MyData' );
    3838
  • primer-mydata/trunk/public/partials/primer-receipt-display.php

    r3259822 r3386889  
    692692            </table>
    693693            <p class="link_sign"> <span class="sender_sign">https://primer.gr/searchinvoice Provided by Primer Software P.C.</span></p>
     694            <p class="link_sign"> <span class="sender_sign">Άδεια ΥΠΑΗΕΣ: 2021_01_107Primer Software ΙΚΕ_001_ Primer MyData_V1_21012021</span></p>
    694695            <p class="link_sign mydata_sign">
    695696                <span class="uid_sign"> <?php  get_failure_message() ?></span>
Note: See TracChangeset for help on using the changeset viewer.