Plugin Directory

Changeset 1954775


Ignore:
Timestamp:
10/10/2018 09:20:28 PM (7 years ago)
Author:
stephenharris
Message:

Committing 1.0.6 to trunk

Location:
event-organiser-vat/trunk
Files:
1 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • event-organiser-vat/trunk/assets/js/vat.js

    r1219529 r1954775  
    55     */
    66    var eoVatToFixed = function( number, precision ) {
    7        
     7
    88        precision = ( typeof precision == 'undefined' ? 0 : precision );
    9        
     9
    1010        //Lets ensure the part we want to keep is the (rounded) integer
    1111        var roundedInt   = Math.round( number * Math.pow( 10, precision ) );
    1212        var roundedFloat = roundedInt /  Math.pow( 10, precision );
    13        
     13
    1414        //Ensure the appropriate number of decimal points are returned
    1515        return roundedFloat.toPrecision( roundedInt.toString().length );
    16        
    1716    };
    18        
     17
    1918    /**
    2019     * Listens for a change in the checkout total and
    2120     * adds the appropriate about of VAT. If VAT amount
    22      * is above 0, show VAT row, otherwise hide it. 
     21     * is above 0, show VAT row, otherwise hide it.
    2322     */
    2423    wp.hooks.addFilter( 'eventorganiser.checkout_cart', function( cart ){
     
    2625        var vat = eo_pro_vat.vat_percent;
    2726        var vat_amount = cart.total*(vat/100);
     27
    2828        cart.total = cart.total + vat_amount;
    2929
     
    3333            $('#eo-booking-vat').parents('tr').show();
    3434        }
    35        
     35
    3636        $('#eo-booking-vat').text( eoVatToFixed( parseFloat( vat_amount, 2 ), 2 ) );
    3737
    3838        return cart;
    39                
     39
    4040    }, 100 );
    4141
  • event-organiser-vat/trunk/assets/js/vat.min.js

    r1219529 r1954775  
    1 /*! Event Organiser VAT - v1.0.5
     1/*! Event Organiser VAT - v1.0.6
    22 * http://wp-event-organiser.com
    33 */
    4 jQuery(document).ready(function(t){var o=function(t,o){o=o===void 0?0:o;var e=Math.round(t*Math.pow(10,o)),a=e/Math.pow(10,o);return a.toPrecision((""+e).length)};wp.hooks.addFilter("eventorganiser.checkout_cart",function(e){var a=eo_pro_vat.vat_percent,r=e.total*(a/100);return e.total=e.total+r,0===r?t("#eo-booking-vat").parents("tr").hide():t("#eo-booking-vat").parents("tr").show(),t("#eo-booking-vat").text(o(parseFloat(r,2),2)),e},100)});
     4jQuery(document).ready(function(a){var b=function(a,b){b="undefined"==typeof b?0:b;var c=Math.round(a*Math.pow(10,b)),d=c/Math.pow(10,b);return d.toPrecision(c.toString().length)};wp.hooks.addFilter("eventorganiser.checkout_cart",function(c){var d=eo_pro_vat.vat_percent,e=c.total*(d/100);return c.total=c.total+e,0===e?a("#eo-booking-vat").parents("tr").hide():a("#eo-booking-vat").parents("tr").show(),a("#eo-booking-vat").text(b(parseFloat(e,2),2)),c},100)});
  • event-organiser-vat/trunk/event-organiser-vat.php

    r1219529 r1954775  
    44 * Plugin URI:  http://wp-event-organiser.com
    55 * Description: Adds VAT to Event Organiser Pro
    6  * Version:     1.0.5
     6 * Version:     1.0.6
    77 * Author:      Stephen Harris
    88 * Author URI:  http://wp-event-organiser.com
     
    3131
    3232// Useful global constants
    33 define( 'EVENTORGANISERVAT_VERSION', '1.0.5' );
     33define( 'EVENTORGANISERVAT_VERSION', '1.0.6' );
    3434define( 'EVENTORGANISERVAT_URL', plugin_dir_url( __FILE__ ) );
    3535define( 'EVENTORGANISERVAT_DIR', plugin_dir_path( __FILE__ ) );
     
    4343 */
    4444function eventorganiservat_init() {
    45    
     45
    4646    load_plugin_textdomain( 'event-organiser-vat', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
    4747
    4848    $version = defined( 'EVENTORGANISERVAT_VERSION' ) ? EVENTORGANISERVAT_VERSION : false;
    4949    $ext = (defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG) ? '' : '.min';
    50    
     50
    5151    //Register scripts
    5252    wp_register_script( 'eo_pro_vat', EVENTORGANISERVAT_URL . "assets/js/vat{$ext}.js", array( 'eo-wp-js-hooks' ), $version );
    53    
     53
    5454    wp_localize_script( 'eo_pro_vat', 'eo_pro_vat', array(
    5555        'vat_percent' => eventorganiservat_get_vat_percent(),
  • event-organiser-vat/trunk/includes/vat.php

    r1212022 r1954775  
    9090    $amount = floatval( eo_get_booking_meta( $booking_id, 'booking_amount', true )  );
    9191    $vat = eventorganiservat_get_vat_percent();
    92     $vat_amount = number_format( ($vat * $amount )/100, 2 );
     92    $vat_amount = round( ($vat * $amount )/100, 2 );
    9393   
    9494    update_post_meta( $booking_id, '_eo_booking_vat_percent', $vat );
  • event-organiser-vat/trunk/languages/event-organiser-vat.pot

    r1219529 r1954775  
    11# SOME DESCRIPTIVE TITLE.
    22# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
    3 # This file is distributed under the same license as the PACKAGE package.
     3# This file is distributed under the same license as the event-organiser-vat package.
    44# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
    55#
     
    77msgid ""
    88msgstr ""
    9 "Project-Id-Version: event-organiser-vat 1.0.5\n"
     9"Project-Id-Version: event-organiser-vat 1.0.6\n"
    1010"Report-Msgid-Bugs-To: \n"
    11 "POT-Creation-Date: 2015-08-12 21:46+0100\n"
     11"POT-Creation-Date: 2018-10-10 22:17+0100\n"
    1212"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1313"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  • event-organiser-vat/trunk/readme.md

    r1219529 r1954775  
    33**Donate link:** http://wp-event-organiser.com 
    44**Requires at least:** 3.3 
    5 **Tested up to:** 4.3.0 
    6 **Stable tag:** 1.0.5 
     5**Tested up to:** 4.9.8 
     6**Stable tag:** 1.0.6 
    77**License:** GPLv2 or later 
    88
     
    3636## Changelog ##
    3737
     38### 1.0.6 ###
     39* Fixes bug with total calcation when VAT amount exceeds 1,000
     40
    3841### 1.0.5 ###
    3942* Fixes rounding errors
     
    4346
    4447### 1.0.3 ###
    45 * Added option for "VAT" label 
     48* Added option for "VAT" label
    4649
    4750### 1.0.2 ###
  • event-organiser-vat/trunk/readme.txt

    r1219529 r1954775  
    33Donate link: http://wp-event-organiser.com
    44Requires at least: 3.3
    5 Tested up to: 4.3.0
    6 Stable tag: 1.0.5
     5Tested up to: 4.9.8
     6Stable tag: 1.0.6
    77License: GPLv2 or later
    88
     
    3434== Changelog ==
    3535
     36= 1.0.6 =
     37* Fixes bug with total calcation when VAT amount exceeds 1,000
     38
    3639= 1.0.5 =
    3740* Fixes rounding errors
     
    4144
    4245= 1.0.3 =
    43 * Added option for "VAT" label 
     46* Added option for "VAT" label
    4447
    4548= 1.0.2 =
Note: See TracChangeset for help on using the changeset viewer.