Plugin Directory

Changeset 3233895


Ignore:
Timestamp:
02/03/2025 11:32:05 AM (14 months ago)
Author:
primersoftware
Message:

Update

Location:
primer-mydata
Files:
2138 added
7 edited

Legend:

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

    r3205727 r3233895  
    55Tested up to: 6.7.1
    66Requires PHP: 7.4
    7 Stable tag: 4.2.2
     7Stable tag: 4.2.3
    88License: GPLv2
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
  • primer-mydata/trunk/admin/includes/my_data_json.php

    r3205727 r3233895  
    400400        $sum = 0;
    401401        $item_count = 0;
    402         $tax_classes = WC_Tax::get_tax_classes(); // Retrieve all tax classes.
    403         if (!in_array('', $tax_classes)) { // Make sure "Standard rate" (empty class name) is present.
    404             array_unshift($tax_classes, '');
    405         }
    406402        $inside_tax_rate = '';
    407403        $general_settings = get_option('primer_generals');
     
    441437            $outside_vat_total = 0;
    442438            foreach ($order->get_items() as $item_id => $item_data) {
    443                 $quantity     = $item_data->get_quantity() + $refunded_product_quantity[$item_id];
     439                $quantity = $item_data->get_quantity() + (isset($refunded_product_quantity[$item_id]) ? $refunded_product_quantity[$item_id] : 0);
    444440                $product_name = $item_data->get_name();
    445441                if ($general_settings['display_attr_var'] == 'on') {
     
    534530                    }
    535531                }
    536                 $order_vat_exemption_category = '';
     532                $order_vat_exemption_category = '27';
    537533                $order_vat_exemption_name = $classes_names[$product_tax_class];
    538534                $order_vat_exemption_name = str_replace(' ', '_', $order_vat_exemption_name);
     
    571567                $mydataOptionReset = array_change_key_case($mydata_options, CASE_LOWER);
    572568
    573                 if (!isset($mydataOptionReset[$classProduct]) && !empty($classProduct) || $mydataOptionReset[$classProduct] == 0 && !empty($classProduct)) {
     569               /* if (!isset($mydataOptionReset[$classProduct]) && !empty($classProduct) || $mydataOptionReset[$classProduct] == 0 && !empty($classProduct)) {
    574570                    $receipt_log_value .= sprintf(__('Error! Please enter a VAT exemption reason for the %s rate by going to the MyData settings of the add-on', 'primer'), $classMessage);
    575571                    $receipt_log_value_array[] = sprintf(__('Error! Please enter a VAT exemption reason for the %s rate by going to the MyData settings of the add-on', 'primer'), $classMessage);
     
    583579                    }
    584580                    return "break";
    585                 }
     581                } */
    586582
    587583                if ($order_country != 'GR' && ($order_vat_exemption_category == '' || empty($order_vat_exemption_category) || $order_vat_exemption_category == 0)) {
     
    732728                        $invoice_data['invoice'][0]['invoiceDetails'][$item_count]['measurementUnit'] = 1;
    733729                    }
    734                     $total_sub_shipping = $subtotal;
    735730                    $subtotal = $subtotal + $shipping_total;
    736731                    if ($shipping_tax > 0) {
     
    790785                        $invoice_data['invoice'][0]['invoiceDetails'][$item_count]['vatExemptionCategory'] = 8;
    791786                    }
    792                     $total_sub_shipping = $subtotal;
    793787                    $subtotal = $subtotal + $shipping_total;
    794788                }
     
    910904                        $invoice_data['invoice'][0]['invoiceDetails'][$item_count]['measurementUnit'] = 1;
    911905                    }
    912                     $total_sub_shipping = $subtotal;
    913906                    $subtotal = $subtotal + $shipping_total;
    914907                    if ($fee_total_tax > 0) {
     
    962955            $order_total_price  = number_format((float)$order_total_price, 2, '.', '');
    963956            $shipping_total     = number_format((float)$shipping_total, 2, '.', '');
    964             $total_sub_shipping = number_format((float)$total_sub_shipping, 2, '.', '');
    965957            $total_vat_value    = number_format(wc_round_discount($total_vat_value, 2), 2, '.', '');
    966958            $total_net_value    = number_format(wc_round_discount($total_net_value, 2), 2, '.', '');
     
    10361028        }
    10371029        $length_notes = strlen( (string)$primer_invoice_notes );
    1038         if ($length_notes > 750) {
    1039             $primer_invoice_notes = substr($primer_invoice_notes, 0, 750);
     1030        if ($length_notes > 1750) {
     1031            $primer_invoice_notes = substr($primer_invoice_notes, 0, 1750);
    10401032        }
    10411033        $customer_name     = $order->get_billing_first_name() . ' ' . $order->get_billing_last_name();
  • primer-mydata/trunk/admin/includes/primer-admin-options.php

    r3205727 r3233895  
    48184818    public function primer_export_receipt_to_html() {
    48194819        $primer_license_data = get_option('primer_licenses');
    4820         $receipt_ids = isset($_POST['page_id']) ? sanitize_text_field($_POST['page_id']) : "";
     4820        $receipt_ids = isset($_POST['receipts']) ? sanitize_text_field($_POST['receipts']) : "";
    48214821        $receipt_ids = explode(', ', $receipt_ids);
    48224822        $files = array();
  • primer-mydata/trunk/admin/includes/primer-admin-receipt-table.php

    r3205727 r3233895  
    8383                    '11.4' => 'Πιστωτικό Στοιχείο Λιανικής',
    8484                    '1.1'  => 'Τιμολόγιο Πώλησης',
     85                    '1.2' =>  'Τιμολόγιο Ενδοκοινοτικών Παραδόσεων',
     86                    '1.3' => 'Τιμολόγιο Παραδόσεων Τρίτων Χωρών',
    8587                    '2.1'  => 'Τιμολόγιο Παροχής Υπηρεσιών',
     88                    '2.2' => 'Τιμολόγιο Παροχής - Ενδοκοινοτική Παροχή Υπηρεσιών',
     89                    '2.3' => 'Τιμολόγιο Παροχής - Παροχή Υπηρεσιών σε λήπτη Τρίτης Χώρας',
    8690                    '5.1'  => 'Πιστωτικό Τιμολόγιο Συσχετιζόμενο'
    8791                ],
    8892                'NOT_GR' => [
    89                     '11.1' => 'RETAIL RECEIPT',
    90                     '11.2' => 'PROOF OF SERVICE',
    91                     '11.4' => 'CREDIT RETAIL RECEIPT',
    92                     '1.1'  => 'SALE INVOICE',
    93                     '2.1'  => 'INVOICE',
    94                     '5.1'  => 'CREDIT INVOICE RELATED'
     93                    '11.1' => 'Retail Receipt',
     94                    '11.2' => 'Service Provision Receipt',
     95                    '11.4' => 'Retail Credit Note',
     96                    '1.1'  => 'Sales Invoice',
     97                    '1.2' =>  'EU-Community Supply Invoice',
     98                    '1.3' => 'Third Country Supply Invoice',
     99                    '2.1'  => 'Service Provision Invoice',
     100                    '2.2' => 'Service Provision - EU-Community Service Supply Invoice',
     101                    '2.3' => 'Service Provision - Service Supply to Third Country Recipient Invoice',
     102                    '5.1'  => 'Related Credit Invoice'
    95103                ]
    96104            ];
     
    601609                        var datas = {
    602610                            'action': 'primer_export_receipt_to_html',
    603                             'page_id': dataObj.join(', '),
     611                            'receipts': dataObj.join(', '),
    604612                        }
    605613                        $('.download-btn').addClass('hide');
  • primer-mydata/trunk/includes/class-primer-cron.php

    r3188823 r3233895  
    221221                        if (get_post_meta($id_of_order, 'receipt_status', true) == 'issued') {
    222222                            continue ;
     223                        }
     224                        $general_settings = get_option('primer_generals');
     225                        if ($general_settings['accept_zero_value_orders'] == 'on' && $order->get_total() == 0) {
     226                            continue;
    223227                        }
    224228                        $order_country = $order->get_billing_country();
     
    290294                        }
    291295                        if ($invoice_data == "break") {
    292                             break;
     296                            continue;
    293297                        }
    294298                        if ($send_api_invoice) {
     
    25202524
    25212525                        if ( (in_array($header_value, $emptySumHeaders)) )  {
    2522                             $sheet->setCellValue($header_key . $last_row + 1, '');
     2526                            $new_row = $last_row + 1;
     2527                            if (empty($header_key) || !preg_match('/^[A-Z]+$/', $header_key)) {
     2528                                $header_key = 'A';
     2529                            }
     2530                            $sheet->setCellValue($header_key . $new_row, '');
    25232531                        } else {
    25242532                            $sheet->setCellValue($header_key . $i, '=SUM(' . $header_key . ''.$sum_start.':' . $header_key . $last_row . ')');
  • primer-mydata/trunk/includes/template-tags/primer-tags-display-modules.php

    r3205727 r3233895  
    822822            '11.4' => 'Πιστωτικό Στοιχείο Λιανικής',
    823823            '1.1'  => 'Τιμολόγιο Πώλησης',
     824            '1.2' =>  'Τιμολόγιο Ενδοκοινοτικών Παραδόσεων',
     825            '1.3' => 'Τιμολόγιο Παραδόσεων Τρίτων Χωρών',
    824826            '2.1'  => 'Τιμολόγιο Παροχής Υπηρεσιών',
     827            '2.2' => 'Τιμολόγιο Παροχής - Ενδοκοινοτική Παροχή Υπηρεσιών',
     828            '2.3' => 'Τιμολόγιο Παροχής - Παροχή Υπηρεσιών σε λήπτη Τρίτης Χώρας',
    825829            '5.1'  => 'Πιστωτικό Τιμολόγιο Συσχετιζόμενο'
    826830        ],
    827831        'NOT_GR' => [
    828             '11.1' => 'RETAIL RECEIPT',
    829             '11.2' => 'PROOF OF SERVICE',
    830             '11.4' => 'CREDIT RETAIL RECEIPT',
    831             '1.1'  => 'SALE INVOICE',
    832             '2.1'  => 'INVOICE',
    833             '5.1'  => 'CREDIT INVOICE RELATED'
     832            '11.1' => 'Retail Receipt',
     833            '11.2' => 'Service Provision Receipt',
     834            '11.4' => 'Retail Credit Note',
     835            '1.1'  => 'Sales Invoice',
     836            '1.2' =>  'EU-Community Supply Invoice',
     837            '1.3' => 'Third Country Supply Invoice',
     838            '2.1'  => 'Service Provision Invoice',
     839            '2.2' => 'Service Provision - EU-Community Service Supply Invoice',
     840            '2.3' => 'Service Provision - Service Supply to Third Country Recipient Invoice',
     841            '5.1'  => 'Related Credit Invoice'
    834842        ]
    835843    ];
  • primer-mydata/trunk/primer.php

    r3205727 r3233895  
    1818 * Plugin URI:        primer.gr/plugin/
    1919 * Description:       Issue receipts and invoices with woocommerce.
    20  * Version:           4.2.2
     20 * Version:           4.2.3
    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.2');
     36define( 'PRIMER_VERSION', '4.2.3');
    3737define( 'PRIMER_NAME', 'Primer MyData' );
    3838
Note: See TracChangeset for help on using the changeset viewer.