Changeset 2974072
- Timestamp:
- 10/03/2023 06:39:12 AM (2 years ago)
- Location:
- billingo
- Files:
-
- 26 added
- 7 edited
-
tags/3.4.6 (added)
-
tags/3.4.6/admin (added)
-
tags/3.4.6/admin/class-billingo-admin.php (added)
-
tags/3.4.6/admin/css (added)
-
tags/3.4.6/admin/css/global.css (added)
-
tags/3.4.6/admin/images (added)
-
tags/3.4.6/admin/images/ajax-loader.gif (added)
-
tags/3.4.6/admin/images/invoice.png (added)
-
tags/3.4.6/admin/images/payment_request.png (added)
-
tags/3.4.6/admin/index.php (added)
-
tags/3.4.6/admin/js (added)
-
tags/3.4.6/admin/js/global.js (added)
-
tags/3.4.6/assets (added)
-
tags/3.4.6/assets/screenshot-1.jpg (added)
-
tags/3.4.6/assets/screenshot-2.jpg (added)
-
tags/3.4.6/assets/screenshot-3.jpg (added)
-
tags/3.4.6/assets/screenshot-4.jpg (added)
-
tags/3.4.6/changelog.md (added)
-
tags/3.4.6/includes (added)
-
tags/3.4.6/includes/PWSBillingo.php (added)
-
tags/3.4.6/includes/class-billingo-order.php (added)
-
tags/3.4.6/includes/class-billingo.php (added)
-
tags/3.4.6/includes/index.php (added)
-
tags/3.4.6/index.php (added)
-
tags/3.4.6/readme.txt (added)
-
tags/3.4.6/uninstall.php (added)
-
trunk/admin/class-billingo-admin.php (modified) (3 diffs)
-
trunk/admin/js/global.js (modified) (18 diffs)
-
trunk/changelog.md (modified) (1 diff)
-
trunk/includes/PWSBillingo.php (modified) (2 diffs)
-
trunk/includes/class-billingo.php (modified) (7 diffs)
-
trunk/index.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
billingo/trunk/admin/class-billingo-admin.php
r2790343 r2974072 236 236 'type' => 'checkbox', 237 237 'desc' => __('Fizetettnek jelölt számlákon a "A számla pénzügyi teljesítést nem igényel." jelölés bekapcsolása.'), 238 ], 239 [ 240 'title' => __('Manuális számlakészítés típus', 'billingo'), 241 'id' => 'wc_billingo_manual_type', 242 'type' => 'select', 243 'options' => [ 244 'invoice' => __('Számla', 'billingo'), 245 'proforma' => __('Proforma', 'billingo'), 246 'draft' => __('Piszkozat', 'billingo'), 247 ], 248 'desc' => __('Manuális számlakészítés esetén ez a típus lesz kiválasztva.', 'billingo'), 238 249 ], 239 250 [ … … 799 810 </div> 800 811 <?php else: ?> 812 <?php $default_type = get_option('wc_billingo_manual_type', 'invoice'); ?> 801 813 <div style="text-align:center;<?php if (get_post_meta($post->ID, '_wc_billingo_own', true)): ?>display:none;<?php endif; ?>" id="wc-billingo-generate-button"> 802 814 <p> 803 815 <a href="#" id="wc_billingo_generate" data-order="<?php echo(esc_attr($post->ID)); ?>" data-nonce="<?php echo(esc_attr(wp_create_nonce('wc_generate_invoice'))); ?>" class="button button-primary"><?php esc_html_e('Számlakészítés', 'billingo'); ?></a> 804 <br> 816 817 <br /> 818 <small>Alapértelmezett típus: <?php esc_html_e($default_type == 'draft' ? 'Piszkozat' : ($default_type == 'invoice' ? 'Számla' : 'Proforma'), 'billingo'); ?></small> 819 820 <br /> 805 821 <a href="#" id="wc_billingo_options"><?php esc_html_e('Opciók', 'billingo'); ?></a> 806 822 </p> … … 823 839 824 840 <h4><?php esc_html_e('Számla típusa', 'billingo'); ?></h4> 841 825 842 <select name="wc_billingo_invoice_type" id="wc_billingo_invoice_type"> 826 <option value="invoice" ><?php esc_html_e('Számla', 'billingo'); ?></option>827 <option value="proforma" ><?php esc_html_e('Díjbekérő', 'billingo'); ?></option>828 <option value="draft" ><?php esc_html_e('Piszkozat', 'billingo'); ?></option>843 <option value="invoice" <?php selected($default_type, 'invoice') ?>><?php esc_html_e('Számla', 'billingo'); ?></option> 844 <option value="proforma" <?php selected($default_type, 'proforma') ?>><?php esc_html_e('Díjbekérő', 'billingo'); ?></option> 845 <option value="draft" <?php selected($default_type, 'draft') ?>><?php esc_html_e('Piszkozat', 'billingo'); ?></option> 829 846 </select> 830 847 </div> -
billingo/trunk/admin/js/global.js
r2676188 r2974072 1 1 jQuery(document).ready(function ($) { 2 // https://support.billingo.hu/content/2826240193 2 let entitlements = [ 4 3 { 5 value: 'AAM',4 value: "AAM", 6 5 text: "Alanyi adómentesség" 7 6 }, 8 7 { 9 value: 'ANTIQUES',8 value: "ANTIQUES", 10 9 text: "Különbözet szerinti szabályozás - gyűjteménydarabok és régiségek" 11 10 }, 12 11 { 13 value: 'ARTWORK',12 value: "ARTWORK", 14 13 text: "Különbözet szerinti szabályozás - műalkotások" 15 14 }, 16 15 { 17 value: 'ATK',16 value: "ATK", 18 17 text: "Áfa tv. tárgyi hatályán kívüli ügylet" 19 18 }, 20 19 { 21 value: 'EAM',20 value: "EAM", 22 21 text: "Áfamentes termékexport, azzal egy tekintet alá eső értékesítések, nemzetközi közlekedéshez kapcsolódó áfamentes ügyletek (Áfa tv. 98-109. §)" 23 22 }, 24 23 { 25 value: 'EUE',24 value: "EUE", 26 25 text: "EU más tagállamában áfaköteles (áfa fizetésére az értékesítő köteles)" 27 26 }, 28 27 { 29 value: 'EUFAD37',28 value: "EUFAD37", 30 29 text: "Áfa tv. 37. § (1) bekezdése alapján a szolgáltatás teljesítése helye az EU más tagállama (áfa fizetésére a vevő köteles)" 31 30 }, 32 31 { 33 value: 'EUFADE',32 value: "EUFADE", 34 33 text: "Áfa tv. szerint egyéb rendelkezése szerint a teljesítés helye EU más tagállama (áfa fizetésére a vevő köteles)" 35 34 }, 36 35 { 37 value: 'HO',36 value: "HO", 38 37 text: "Áfa tv. szerint EU-n kívül teljesített ügylet" 39 38 }, 40 39 { 41 value: 'KBAET',40 value: "KBAET", 42 41 text: "Más tagállamba irányuló áfamentes termékértékesítés (Áfa tv. 89. §)" 43 42 }, 44 43 { 45 value: 'NAM_1',44 value: "NAM_1", 46 45 text: "Áfamentes közvetítői tevékenység (Áfa tv. 110. §)" 47 46 }, 48 47 { 49 value: 'NAM_2',48 value: "NAM_2", 50 49 text: "Termékek nemzetközi forgalmához kapcsolódó áfamentes ügylet (Áfa tv. 111-118. §)" 51 50 }, 52 51 { 53 value: 'SECOND_HAND',52 value: "SECOND_HAND", 54 53 text: "Különbözet szerinti szabályozás - használt cikkek" 55 54 }, 56 55 { 57 value: 'TAM',56 value: "TAM", 58 57 text: "Tevékenység közérdekű jellegére vagy egyéb sajátos jellegére tekintettel áfamentes (Áfa tv. 85-87.§)" 59 58 }, 60 59 { 61 value: 'TRAVEL_AGENCY',60 value: "TRAVEL_AGENCY", 62 61 text: "Különbözet szerinti szabályozás - utazási irodák" 63 62 } … … 65 64 66 65 let taxEntitlements = { 67 AAM: ['AAM'],68 TAM: ['TAM'],69 EU: ['KBAET'],70 EUK: ['EAM'],71 ÁKK: ['ATK'],72 '0%': ['AAM', 'EAM', 'KBAET', 'NAM_1', 'NAM_2', 'TAM'],73 AM: ['AAM', 'EAM', 'KBAET', 'NAM_1', 'NAM_2', 'TAM'],74 MAA: ['AAM', 'EAM', 'KBAET', 'NAM_1', 'NAM_2', 'TAM'],75 ÁTHK: ['EUE', 'EUFAD37', 'EUFADE', 'HO'],76 'K.AFA': ['ANTIQUES', 'ARTWORK', 'SECOND_HAND', 'TRAVEL_AGENCY'],66 "AAM": ["AAM"], 67 "TAM": ["TAM"], 68 "EU": ["KBAET"], 69 "EUK": ["EAM"], 70 "ÁKK": ["ATK"], 71 "0%": ["AAM", "EAM", "KBAET", "NAM_1", "NAM_2", "TAM"], 72 "AM": ["AAM", "EAM", "KBAET", "NAM_1", "NAM_2", "TAM"], 73 "MAA": ["AAM", "EAM", "KBAET", "NAM_1", "NAM_2", "TAM"], 74 "ÁTHK": ["EUE", "EUFAD37", "EUFADE", "HO"], 75 "K.AFA": ["ANTIQUES", "ARTWORK", "SECOND_HAND", "TRAVEL_AGENCY"], 77 76 }; 78 77 79 78 let setTaxOverrideEntitlementsFor = function (id) { 80 let selectedTaxOverride = $('#'+ id).val();79 let selectedTaxOverride = jQuery("#" + id).val(); 81 80 let possibleEntitlements = taxEntitlements[selectedTaxOverride]; 82 let selectedEntitlement = $('#' + id + '_entitlement').val();81 let selectedEntitlement = jQuery("#" + id + "_entitlement").val(); 83 82 84 83 if (possibleEntitlements) { 85 84 // If there is an entitlement given for the selected tax override 86 $('#' + id + '_entitlement').prop("disabled", false);87 $('#' + id + '_entitlement').next().text('A választott ÁFA kulcshoz kötelező a megadott jogcímekből választani.')85 jQuery("#" + id + "_entitlement").prop("disabled", false); 86 jQuery("#" + id + "_entitlement").next().text("A választott ÁFA kulcshoz kötelező a megadott jogcímekből választani."); 88 87 89 88 // Remove all entitlement options for a fresh start 90 $('#' + id + '_entitlement option').each(function () {91 $(this).remove();89 jQuery("#" + id + "_entitlement option").each(function () { 90 jQuery(this).remove(); 92 91 }); 93 92 … … 96 95 entitlements.forEach(function (entitlement) { 97 96 if (possibleEntitlements.indexOf(entitlement.value) > -1) { 98 $('#' + id + '_entitlement').append(new Option(entitlement.text, entitlement.value));97 jQuery("#" + id + "_entitlement").append(new Option(entitlement.text, entitlement.value)); 99 98 validEntitlements.push(entitlement.value); 100 99 } … … 104 103 if (validEntitlements.indexOf(selectedEntitlement) == -1) { 105 104 switch (selectedTaxOverride) { 106 case '0%': $('#'+ id + '_entitlement option[value="TAM"]').prop("selected", true); break;107 case 'AM': $('#'+ id + '_entitlement option[value="NAM_1"]').prop("selected", true); break;108 case 'MAA': $('#'+ id + '_entitlement option[value="NAM_1"]').prop("selected", true); break;109 case 'ÁTHK': $('#'+ id + '_entitlement option[value="EUFAD37"]').prop("selected", true); break;110 case 'K.AFA': $('#'+ id + '_entitlement option[value="SECOND_HAND"]').prop("selected", true); break;111 default: $('#'+ id + '_entitlement option:eq(0)').prop("selected", true);105 case "0%": jQuery("#" + id + '_entitlement option[value="TAM"]').prop("selected", true); break; 106 case "AM": jQuery("#" + id + '_entitlement option[value="NAM_1"]').prop("selected", true); break; 107 case "MAA": jQuery("#" + id + '_entitlement option[value="NAM_1"]').prop("selected", true); break; 108 case "ÁTHK": jQuery("#" + id + '_entitlement option[value="EUFAD37"]').prop("selected", true); break; 109 case "K.AFA": jQuery("#" + id + '_entitlement option[value="SECOND_HAND"]').prop("selected", true); break; 110 default: jQuery("#" + id + '_entitlement option:eq(0)').prop("selected", true); 112 111 } 113 112 } else { 114 $('#'+ id + '_entitlement option[value="' + selectedEntitlement + '"]').prop("selected", true);113 jQuery("#" + id + '_entitlement option[value="' + selectedEntitlement + '"]').prop("selected", true); 115 114 } 116 115 } else { 117 116 // No entitlement for the selected tax override 118 $('#' + id + '_entitlement').prop("disabled", true);119 $('#' + id + '_entitlement').next().text('A választott ÁFA kulcshoz nem tartozik jogcím.')117 jQuery("#" + id + "_entitlement").prop("disabled", true); 118 jQuery("#" + id + "_entitlement").next().text("A választott ÁFA kulcshoz nem tartozik jogcím."); 120 119 121 120 // Remove all entitlement options 122 $('#' + id + '_entitlement option').each(function () {123 $(this).remove();121 jQuery("#" + id + "_entitlement option").each(function () { 122 jQuery(this).remove(); 124 123 }); 125 124 } 126 125 }; 127 126 128 setTaxOverrideEntitlementsFor( 'wc_billingo_tax_override');129 $('#wc_billingo_tax_override').change(function (e) {130 setTaxOverrideEntitlementsFor( 'wc_billingo_tax_override');131 }); 132 133 setTaxOverrideEntitlementsFor( 'wc_billingo_tax_override_zero');134 $('#wc_billingo_tax_override_zero').change(function (e) {135 setTaxOverrideEntitlementsFor( 'wc_billingo_tax_override_zero');136 }); 137 138 $('#wc_billingo_generate').click(function (e) {127 setTaxOverrideEntitlementsFor("wc_billingo_tax_override"); 128 jQuery("#wc_billingo_tax_override").change(function (e) { 129 setTaxOverrideEntitlementsFor("wc_billingo_tax_override"); 130 }); 131 132 setTaxOverrideEntitlementsFor("wc_billingo_tax_override_zero"); 133 jQuery("#wc_billingo_tax_override_zero").change(function (e) { 134 setTaxOverrideEntitlementsFor("wc_billingo_tax_override_zero"); 135 }); 136 137 jQuery("#wc_billingo_generate").click(function (e) { 139 138 e.preventDefault(); 140 139 let r = confirm("Biztosan létrehozod a számlát?"); … … 142 141 return false; 143 142 } 144 let nonce = $(this).data('nonce');145 let order = $(this).data('order');146 let button = $('#wc_billingo_generate');147 let note = $('#wc_billingo_invoice_note').val();148 let deadline = $('#wc_billingo_invoice_deadline').val();149 let ignore_proforma = $('#wc_billingo_ignore_proforma').val();150 let completed = $('#wc_billingo_invoice_completed').val();151 let invoice_type = $('#wc_billingo_invoice_type').val();143 let nonce = jQuery(this).data("nonce"); 144 let order = jQuery(this).data("order"); 145 let button = jQuery("#wc_billingo_generate"); 146 let note = jQuery("#wc_billingo_invoice_note").val(); 147 let deadline = jQuery("#wc_billingo_invoice_deadline").val(); 148 let ignore_proforma = jQuery("#wc_billingo_ignore_proforma").val(); 149 let completed = jQuery("#wc_billingo_invoice_completed").val(); 150 let invoice_type = jQuery("#wc_billingo_invoice_type").val(); 152 151 153 152 let data = { 154 action: 'wc_billingo_generate_invoice',153 action: "wc_billingo_generate_invoice", 155 154 nonce: nonce, 156 155 order: order, … … 165 164 message: null, 166 165 overlayCSS: { 167 background: '#fff url(' + wc_billingo_params.loading + ') no-repeat center',168 backgroundSize: '16px 16px',166 background: "#fff url(" + wc_billingo_params.loading + ") no-repeat center", 167 backgroundSize: "16px 16px", 169 168 opacity: 0.6 170 169 } 171 170 }); 172 171 173 $.post(ajaxurl, data, function (response) {172 jQuery.post(ajaxurl, data, function (response) { 174 173 //Remove old messages 175 $('.wc-billingo-message').remove();174 jQuery(".wc-billingo-message").remove(); 176 175 177 176 //Generate the error/success messages … … 183 182 184 183 //Get the error messages 185 let ul = $('<ul>');186 $.each(response.data.messages, function (i, value) {187 let li = $('<li>')184 let ul = jQuery("<ul>"); 185 jQuery.each(response.data.messages, function (i, value) { 186 let li = jQuery("<li>"); 188 187 li.append(value); 189 188 ul.append(li); 190 189 }); 191 $('.wc-billingo-message').append(ul);190 jQuery(".wc-billingo-message").append(ul); 192 191 193 192 //If success, hide the button … … 201 200 }); 202 201 203 $('#wc_billingo_options').click(function () {204 $('#wc_billingo_options_form').slideToggle();202 jQuery("#wc_billingo_options").click(function () { 203 jQuery("#wc_billingo_options_form").slideToggle(); 205 204 return false; 206 205 }); 207 206 208 $('#wc_billingo_already').click(function (e) {207 jQuery("#wc_billingo_already").click(function (e) { 209 208 e.preventDefault(); 210 209 let note = prompt("Számlakészítés kikapcsolása. Mi az indok?", "Ehhez a rendeléshez nem kell számla."); … … 213 212 } 214 213 215 let nonce = $(this).data('nonce');216 let order = $(this).data('order');217 let button = $('#wc_billingo_already');214 let nonce = jQuery(this).data("nonce"); 215 let order = jQuery(this).data("order"); 216 let button = jQuery("#wc_billingo_already"); 218 217 219 218 let data = { 220 action: 'wc_billingo_already',219 action: "wc_billingo_already", 221 220 nonce: nonce, 222 221 order: order, … … 227 226 message: null, 228 227 overlayCSS: { 229 background: '#fff url(' + wc_billingo_params.loading + ') no-repeat center',230 backgroundSize: '16px 16px',228 background: "#fff url(" + wc_billingo_params.loading + ") no-repeat center", 229 backgroundSize: "16px 16px", 231 230 opacity: 0.6 232 231 } 233 232 }); 234 233 235 $.post(ajaxurl, data, function (response) {234 jQuery.post(ajaxurl, data, function (response) { 236 235 //Remove old messages 237 $('.wc-billingo-message').remove();236 jQuery(".wc-billingo-message").remove(); 238 237 239 238 //Generate the error/success messages … … 245 244 246 245 //Get the error messages 247 let ul = $('<ul>');248 $.each(response.data.messages, function (i, value) {249 let li = $('<li>')246 let ul = jQuery("<ul>"); 247 jQuery.each(response.data.messages, function (i, value) { 248 let li = jQuery("<li>"); 250 249 li.append(value); 251 250 ul.append(li); 252 251 }); 253 $('.wc-billingo-message').append(ul);252 jQuery(".wc-billingo-message").append(ul); 254 253 255 254 //If success, hide the button … … 263 262 }); 264 263 265 $('#wc_billingo_already_back').click(function (e) {264 jQuery("#wc_billingo_already_back").click(function (e) { 266 265 e.preventDefault(); 267 266 let r = confirm("Biztosan visszakapcsolod a számlakészítés ennél a rendelésnél?"); … … 270 269 } 271 270 272 let nonce = $(this).data('nonce');273 let order = $(this).data('order');274 let button = $('#wc_billingo_already_back');271 let nonce = jQuery(this).data("nonce"); 272 let order = jQuery(this).data("order"); 273 let button = jQuery("#wc_billingo_already_back"); 275 274 276 275 let data = { 277 action: 'wc_billingo_already_back',276 action: "wc_billingo_already_back", 278 277 nonce: nonce, 279 278 order: order 280 279 }; 281 280 282 $('#billingo_already_div').block({281 jQuery("#billingo_already_div").block({ 283 282 message: null, 284 283 overlayCSS: { 285 background: '#fff url(' + wc_billingo_params.loading + ') no-repeat center',286 backgroundSize: '16px 16px',284 background: "#fff url(" + wc_billingo_params.loading + ") no-repeat center", 285 backgroundSize: "16px 16px", 287 286 opacity: 0.6 288 287 } 289 288 }); 290 289 291 $.post(ajaxurl, data, function (response) {290 jQuery.post(ajaxurl, data, function (response) { 292 291 //Remove old messages 293 $('.wc-billingo-message').remove();292 jQuery(".wc-billingo-message").remove(); 294 293 295 294 //Generate the error/success messages … … 301 300 302 301 //Get the error messages 303 let ul = $('<ul>');304 $.each(response.data.messages, function (i, value) {305 let li = $('<li>')302 let ul = jQuery("<ul>"); 303 jQuery.each(response.data.messages, function (i, value) { 304 let li = jQuery("<li>"); 306 305 li.append(value); 307 306 ul.append(li); 308 307 }); 309 $('.wc-billingo-message').append(ul);308 jQuery(".wc-billingo-message").append(ul); 310 309 311 310 //If success, show the button … … 314 313 } 315 314 316 $('#billingo_already_div').unblock().slideUp();317 }); 318 }); 319 320 321 $('#wc_billingo_storno').click(function (e) {315 jQuery("#billingo_already_div").unblock().slideUp(); 316 }); 317 }); 318 319 320 jQuery("#wc_billingo_storno").click(function (e) { 322 321 e.preventDefault(); 323 322 let r = confirm("Biztosan sztornózod a számlát?"); … … 325 324 return false; 326 325 } 327 let nonce = $(this).data('nonce');328 let order = $(this).data('order');329 let button = $('#wc_billingo_storno');326 let nonce = jQuery(this).data("nonce"); 327 let order = jQuery(this).data("order"); 328 let button = jQuery("#wc_billingo_storno"); 330 329 331 330 let data = { 332 action: 'wc_billingo_storno_invoice',331 action: "wc_billingo_storno_invoice", 333 332 nonce: nonce, 334 333 order: order … … 338 337 message: null, 339 338 overlayCSS: { 340 background: '#fff url(' + wc_billingo_params.loading + ') no-repeat center',341 backgroundSize: '16px 16px',339 background: "#fff url(" + wc_billingo_params.loading + ") no-repeat center", 340 backgroundSize: "16px 16px", 342 341 opacity: 0.6 343 342 } 344 343 }); 345 344 346 $.post(ajaxurl, data, function (response) {345 jQuery.post(ajaxurl, data, function (response) { 347 346 //Remove old messages 348 $('.wc-billingo-message').remove();347 jQuery(".wc-billingo-message").remove(); 349 348 350 349 //Generate the error/success messages … … 356 355 357 356 //Get the error messages 358 let ul = $('<ul>');359 $.each(response.data.messages, function (i, value) {360 let li = $('<li>')357 let ul = jQuery("<ul>"); 358 jQuery.each(response.data.messages, function (i, value) { 359 let li = jQuery("<li>"); 361 360 li.append(value); 362 361 ul.append(li); 363 362 }); 364 $('.wc-billingo-message').append(ul);363 jQuery(".wc-billingo-message").append(ul); 365 364 366 365 //If success, hide the button -
billingo/trunk/changelog.md
r2787040 r2974072 1 1 # Changelog 2 3 - **3.4.6** - 2023-06-26 4 - Improved tax number retrieval (prioritiy order meta, ignore guest user) 5 6 - **3.4.5** - 2023-05-04 7 - Option to change default behaviour of manual invoice generation to make draft or proforma 8 9 - **3.4.4** - 2023-04-24 10 - Fix tax entitlement getting stuck 11 12 - **3.4.3** - 3024-04-04 13 - Fix shipping tax compatibility issue where there was an empty entry with the wrong tax type. (Encountered with FoxPost plugin.) 14 15 - **3.4.2** - 2023-03-22 16 - Fix line tax issue where it's below 0.5 (woocommerce rounds it down to 0) 17 18 - **3.4.1** - 2023-01-10 19 - PHP version compatibility fix 2 20 3 21 - **3.4.0** - 2022-09-16 -
billingo/trunk/includes/PWSBillingo.php
r2794100 r2974072 21 21 class PWSBillingo 22 22 { 23 const VERSION = 'WP3.2. 1';23 const VERSION = 'WP3.2.2'; 24 24 25 25 const REMOTE_HOST = 'https://api.billingo.hu/v3/'; … … 37 37 const EU_COUNTRIES = ['AT', 'BE', 'HR', 'BG', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR', 'DE', 'GR', 'HU', 'IE', 'IT', 'LV', 'LT', 'LU', 'MT', 'NL', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE']; 38 38 const ALL_CURRENCIES = ['AUD', 'BGN', 'BRL', 'CAD', 'CHF', 'CNY', 'CZK', 'DKK', 'EUR', 'GBP', 'HKD', 'HRK', 'HUF', 'IDR', 'ILS', 'INR', 'ISK', 'JPY', 'KRW', 'MXN', 'MYR', 'NOK', 'NZD', 'PHP', 'PLN', 'RON', 'RSD', 'RUB', 'SEK', 'SGD', 'THB', 'TRY', 'UAH', 'USD', 'ZAR']; 39 const ALL_ENTITLEMENTS = [' AAM', 'ANTIQUES', 'ARTWORK', 'ATK', 'EAM', 'EUE', 'EUFAD37', 'EUFADE', 'HO', 'KBAET', 'NAM_1', 'NAM_2', 'SECOND_HAND', 'TAM', 'TRAVEL_AGENCY'];39 const ALL_ENTITLEMENTS = ['', 'AAM', 'ANTIQUES', 'ARTWORK', 'ATK', 'EAM', 'EUE', 'EUFAD37', 'EUFADE', 'HO', 'KBAET', 'NAM_1', 'NAM_2', 'SECOND_HAND', 'TAM', 'TRAVEL_AGENCY']; 40 40 const DEFAULT_PAYMENT = 'cash'; 41 41 const ALL_PAYMENTS = [ -
billingo/trunk/includes/class-billingo.php
r2790343 r2974072 57 57 static::install(); 58 58 update_option('wc_billingo_db_status', 32); 59 } 60 61 if ($db_status < 33) { 62 update_option('wc_billingo_manual_type', 'invoice'); 63 update_option('wc_billingo_db_status', 33); 59 64 } 60 65 … … 174 179 { 175 180 $id_order = $order->get_id(); 176 177 $userdatas = get_user_by('email', $order->get_billing_email()); 181 $id_user = $order->get_user_id(); 182 178 183 $tax_number = ''; 179 184 if (get_option('wc_billingo_vat_number_form_checkbox_custom') == 'yes' && ($taxfield = get_option('wc_billingo_vat_number_form_custom'))) { // custom tax number field by other plugins 180 if ($adoszam = get_ user_meta($userdatas->ID, $taxfield, true)) {185 if ($adoszam = get_post_meta($id_order, $taxfield, true)) { 181 186 $tax_number = $adoszam; 182 } elseif ($ adoszam = get_post_meta($id_order, $taxfield, true)) {187 } elseif ($id_user && ($adoszam = get_user_meta($id_user, $taxfield, true))) { 183 188 $tax_number = $adoszam; 184 189 } … … 187 192 } elseif ($adoszam = get_post_meta($id_order, '_billing_tax_number', true)) { // HuCommerce plugin's tax number field in order 188 193 $tax_number = $adoszam; 189 } elseif ($ adoszam = get_user_meta($userdatas->ID, 'billing_tax_number', true)) { // HuCommerce plugin's tax number field in customer194 } elseif ($id_user && ($adoszam = get_user_meta($id_user, 'billing_tax_number', true))) { // HuCommerce plugin's tax number field in customer 190 195 $tax_number = $adoszam; 191 196 } … … 715 720 716 721 foreach ($order->get_items() as $item) { 717 // can't use line_tax directly because of the rounding issues 718 if ($item['line_tax']) { // should solve is_vat_exempt issue, bypass the normal tax class if no tax was used 722 // Can't use line_tax directly because of the rounding issue, this should solve it. (product with gross 10 huf and 5% tax shows 0 in line_tax, should be 0.476.) 723 $line_tax = 0.0; 724 foreach ($item['line_tax_data']['total'] as $tax_id => $tax_amount) { 725 $line_tax += $tax_amount; 726 } 727 728 if ($line_tax) { // should solve is_vat_exempt issue, bypass the normal tax class if no tax was used 719 729 $tax_rate = 0; 720 730 $tax_rates = static::get_rates($item->get_tax_class(), $order_tax_location); … … 773 783 if (isset($item['taxes']) && ($taxes = $item->get_taxes())) { 774 784 if (array_key_exists('total', $taxes)) { 775 $tax_ids = array_keys($taxes['total']); 785 $tax_list = $taxes['total']; 786 if (count($tax_list) > 1) { // fix for foxpost module having an empty 5% tax entry for 27% shipping 787 foreach ($tax_list as $k => $v) { 788 if (!$v) { 789 unset($tax_list[$k]); 790 } 791 } 792 } 793 $tax_ids = array_keys($tax_list); 776 794 $tax_rate_id = reset($tax_ids); 777 795 if ($tax_rate_id) { … … 782 800 783 801 if (!$tax_rate) { 784 $tax_rates = self::get_shipping_tax_rates($ item->get_tax_class(), $order_tax_location);802 $tax_rates = self::get_shipping_tax_rates($order_tax_location, $item->get_tax_class()); 785 803 if (!empty($tax_rates)) { 786 804 $tax_rate = reset($tax_rates); … … 883 901 884 902 // part of WC_Tax::get_shipping_tax_rates 885 public static function get_shipping_tax_rates($ tax_class = null, $location)903 public static function get_shipping_tax_rates($location, $tax_class = null) 886 904 { 887 905 // See if we have an explicitly set shipping tax class -
billingo/trunk/index.php
r2790343 r2974072 2 2 /** 3 3 * Plugin Name: Integration for Billingo & WooCommerce 4 * Version: 3.4. 04 * Version: 3.4.6 5 5 * Requires at least: 5.3 6 6 * Requires PHP: 5.6 -
billingo/trunk/readme.txt
r2787651 r2974072 2 2 Tags: billingo.hu, billingo, woocommerce, szamlazas, magyar 3 3 Requires at least: 5.3 4 Tested up to: 6. 0.25 Stable tag: 3.4. 04 Tested up to: 6.3.0 5 Stable tag: 3.4.6 6 6 License: GPLv2 or later 7 7 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 77 77 == Changelog == 78 78 79 = 3.4.6 80 * Fejlesztés: Adószám kinyerés optimalizálása, vendég vásárlónál felhasználó figyelmen kívül hagyása 81 82 = 3.4.5 83 * Fejlesztés: Opció a manuális számlakészítésnél használt típus alapértelmezett beállítására 84 85 = 3.4.4 86 * Javítás: ÁFA Jogcím speciális esetben beragadt 87 88 = 3.4.3 89 * Fejlesztés: Szállítási adóknál az extra üres ÁFA kulcsok kihagyása. 90 91 = 3.4.2 92 * Fejlesztés: <0.5 sor adó számítás javítás 93 94 = 3.4.1 95 * Fejlesztés: PHP verzió kompatibilitás javítása 96 79 97 = 3.4.0 80 98 * Fejlesztés: Biztonsági frissítés
Note: See TracChangeset
for help on using the changeset viewer.