Plugin Directory

Changeset 1512910


Ignore:
Timestamp:
10/11/2016 08:00:12 PM (9 years ago)
Author:
bseddon
Message:

Completed the implementation of the ability to set the rate type on EDD payments

Location:
vat-moss/trunk/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • vat-moss/trunk/includes/integrations/class-edd.php

    r1105174 r1512910  
    147147                    // Look up the correct set of class rates for this item
    148148                    $rate_type = VAT_GROUP_CLASS_REDUCED;
    149                     if (VAT_STANDARD_CLASS !== $class)
     149                    if ( VAT_STANDARD_CLASS == $class )
     150                    {
     151                        if ( function_exists( '\\lyquidity\\vat_moss\\vat_rate_type_to_use' ) )
     152                            $rate_type = vat_rate_type_to_use( $item[ 'id' ] );
     153                    }
     154                    else
     155                    if ( function_exists('\lyquidity\edd_vat\get_vat_rates') )
    150156                    {
    151157                        $class_rates = \lyquidity\edd_vat\get_vat_rates($class);
     
    323329                // Look up the correct set of class rates for this item
    324330                $rate_type = VAT_GROUP_CLASS_REDUCED;
    325                 if ( VAT_STANDARD_CLASS !== $class && function_exists('\lyquidity\edd_vat\get_vat_rates') )
     331                if ( VAT_STANDARD_CLASS == $class )
     332                {
     333                    if ( function_exists( '\\lyquidity\\vat_moss\\vat_rate_type_to_use' ) )
     334                        $rate_type = vat_rate_type_to_use( $item[ 'id' ] );
     335                }
     336                else
     337                if ( function_exists('\lyquidity\edd_vat\get_vat_rates') )
    326338                {
    327339                    $class_rates = \lyquidity\edd_vat\get_vat_rates($class);
  • vat-moss/trunk/includes/meta-box.php

    r1105174 r1512910  
    2323{
    2424    $rate_type = get_post_meta( $postID, '_moss_rate_type', true );
    25     if ( empty($rate_type) || ($rate_type !== 'reduced' && $rate_type != 'standard') )
    26         $rate_type = 'reduced';
     25    if ( empty($rate_type) || ($rate_type !== VAT_GROUP_CLASS_REDUCED && $rate_type != VAT_GROUP_CLASS_STANDARD) )
     26        $rate_type = VAT_GROUP_CLASS_REDUCED;
    2727    return $rate_type;
    2828}
Note: See TracChangeset for help on using the changeset viewer.