Changeset 1904660
- Timestamp:
- 07/05/2018 05:22:20 PM (8 years ago)
- Location:
- vat-moss/trunk
- Files:
-
- 5 edited
-
includes/class-integrations.php (modified) (1 diff)
-
includes/integrations/class-edd.php (modified) (7 diffs)
-
includes/submissions.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
vat-moss.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
vat-moss/trunk/includes/class-integrations.php
r1691761 r1904660 483 483 484 484 // $fetched = wp_remote_get("http://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml"); 485 global $wp_version; 485 486 $fetched = wp_remote_get( "http://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml", array( 'user-agent' => 'WordPress-' . $wp_version . '; ' . home_url() . ';' ) ); 486 487 -
vat-moss/trunk/includes/integrations/class-edd.php
r1512910 r1904660 172 172 173 173 $vat_payment = array(); 174 175 // error_log( print_r( $item, true ) ); 174 176 175 177 /* … … 186 188 "subtotal" => 7.5 187 189 "tax" => 0.6 188 "fees" => {} 190 "fees" => { 191 [amount] => -8.85 192 [label] => 15% Bundle Discount - StereoDelta 193 [no_tax] => 1 194 [type] => fee 195 [download_id] => 74 196 [price_id] => 197 } 189 198 "price" => 6.6 190 199 "vat_rate" => 0.1 … … 205 214 */ 206 215 216 $totalfees = array_reduce( $item['fees'], function( $carry, $fee ) 217 { 218 $carry += $fee['amount']; 219 return $carry; 220 }, 0 ); 221 222 // error_log( "Total fees: {$item['price']} - {$item['tax']} + $totalfees" ); 223 207 224 $vat_payment['id'] = $payment_id; 208 225 $vat_payment['item_id'] = $item['id']; … … 211 228 $vat_payment['date'] = $date; 212 229 $vat_payment['submission_id'] = $submission_id; 213 $vat_payment['net'] = round( apply_filters( 'moss_get_net_transaction_amount', $item['price'] - $item['tax'] , $payment_id), 2);230 $vat_payment['net'] = round( apply_filters( 'moss_get_net_transaction_amount', $item['price'] - $item['tax'] + $totalfees, $payment_id), 2); 214 231 $vat_payment['tax'] = round( $item['tax'], 2 ); 215 232 $vat_payment['vat_rate'] = round( isset( $item['vat_rate'] ) ? $item['vat_rate'] : $payment_rate, 3 ); … … 368 385 "subtotal" => 7.5 369 386 "tax" => 0.6 370 "fees" => {} 387 "fees" => { 388 [amount] => -8.85 389 [label] => 15% Bundle Discount - StereoDelta 390 [no_tax] => 1 391 [type] => fee 392 [download_id] => 74 393 [price_id] => 394 } 371 395 "price" => 6.6 372 396 "vat_rate" => 0.1 … … 388 412 */ 389 413 414 $totalfees = array_reduce( $item['fees'], function( $carry, $fee ) 415 { 416 $carry += $fee['amount']; 417 return $carry; 418 }, 0 ); 419 420 // error_log( "Total fees: {$item['price']} - {$item['tax']} + $totalfees" ); 421 390 422 $vat_payment['id'] = $payment_id; 391 423 $vat_payment['item_id'] = $item['id']; … … 394 426 $vat_payment['date'] = $date; 395 427 $vat_payment['submission_id'] = $submission_id; 396 $vat_payment['net'] = round( apply_filters( 'moss_get_net_transaction_amount', $item['price'] - $item['tax'] , $payment_id), 2);428 $vat_payment['net'] = round( apply_filters( 'moss_get_net_transaction_amount', $item['price'] - $item['tax'] + $totalfees, $payment_id), 2); 397 429 $vat_payment['tax'] = round( $item['tax'], 2 ); 398 430 $vat_payment['vat_rate'] = round( isset( $item['vat_rate'] ) ? $item['vat_rate'] : $payment_rate, 3 ); -
vat-moss/trunk/includes/submissions.php
r1513665 r1904660 43 43 : 'en_GB' 44 44 ); 45 // On some Linux distrubutions the locale can be > 255 characters which is no allowed and raised a warning 46 // Instead, look for the LC_ALL value but if not found pass an array of the values. 47 if ( strlen( $locale ) > 255 ) 48 { 49 $locale = explode(";", $locale ); 50 $loc = array(); 51 foreach( $locale as $bit ) 52 { 53 $value = explode("=",$bit); 54 $loc[ $value[0] ] = $value[1]; 55 } 56 $locale = isset( $loc['LC_ALL'] ) 57 ? $loc['LC_ALL'] 58 : $loc; 59 } 45 60 setlocale( LC_ALL, $locale ); 46 61 -
vat-moss/trunk/readme.txt
r1761163 r1904660 6 6 Requires at least: 3.9.2 7 7 Tested up to: 4.9 8 Stable Tag: 1.0.2 58 Stable Tag: 1.0.27 9 9 License: GNU Version 2 or Any Later Version 10 10 … … 181 181 182 182 Fixed a problem that prevented the plugin accessing Euro exchange from the ECB web site. 183 184 = 1.0.26 = 185 186 Updated submissions.php to allow for locale strings > 255 which the setlocale function does not allow. 187 188 = 1.0.27 189 190 Added support for EDD fees which are used by the EDD 'pro' discount plugin to implement discounts. 183 191 184 192 == Upgrade Notice == -
vat-moss/trunk/vat-moss.php
r1691761 r1904660 5 5 Plugin URI: http://www.wproute.com/downloads/vat-moss/ 6 6 Description: Management and submission of VAT sales to EU consumers. 7 Version: 1.0.2 58 Tested up to: 4. 7.37 Version: 1.0.27 8 Tested up to: 4.9.6 9 9 Author: Lyquidity Solutions 10 10 Author URI: http://www.wproute.com/ … … 431 431 432 432 if ( ! defined( 'VAT_MOSS_VERSION' ) ) 433 define( 'VAT_MOSS_VERSION', '1.0.2 5' );433 define( 'VAT_MOSS_VERSION', '1.0.27' ); 434 434 435 435 if ( ! defined( 'VAT_MOSS_WORDPRESS_COMPATIBILITY' ) ) 436 define( 'VAT_MOSS_WORDPRESS_COMPATIBILITY', '4. 7.3' );436 define( 'VAT_MOSS_WORDPRESS_COMPATIBILITY', '4.9.6' ); 437 437 438 438 if ( ! defined( 'VAT_MOSS_STORE_API_URL' ) ) … … 524 524 require_once VAT_MOSS_INCLUDES_DIR . 'class-settings.php'; 525 525 require_once VAT_MOSS_INCLUDES_DIR . 'class-integrations.php'; 526 require_once VAT_MOSS_INCLUDES_DIR . 'settings.php';527 526 require_once VAT_MOSS_INCLUDES_DIR . 'vatidvalidator.php'; 528 527 require_once(VAT_MOSS_INCLUDES_DIR . 'class-html-elements.php');
Note: See TracChangeset
for help on using the changeset viewer.