• Hi Joseph,

    I would like to display the tax value on the receipt (or tickets). I implemented a workaround for this, but it would be great, if it was in the original code.

    What I did:

    in mt-notifications.php:

    function mt_format_purchase
    ...
    
    $total       = ( $discount !== $price ) ? $total + $discount * $ticket['count'] : $total + $price * $ticket['count'];
    						
    // Added by me
    $tax		 = 0.19; // for 19 % tax
    $net		 = round($total / (1 + $tax), 2);
    $vat		 = $total - $net;
    // End of my addition						
    
    $display_app = '';
    ...
    if ( $is_html ) {
      $output = wpautop( $output . __( 'Ticket Total', 'my-tickets' ) . ': ' . strip_tags( 
      apply_filters( 'mt_money_format', $total ) ) . "\n";
    
      // Modified and added by me
      
      $output .= ($tax > 0 ? 
          __( 'Net value', 'my-tickets' ) . ': ' . strip_tags( apply_filters( 'mt_money_format', $net ) ) . "\n"
          . __( 'Vat', 'my-tickets' ) . ' ' . round(100 * $tax, 0) . '%: ' . strip_tags( apply_filters( 'mt_money_format', $vat ) ) 
        : '')
      );
    } else {
      $output .= $sep . __( 'Ticket Total', 'my-tickets' ) . ': ' . strip_tags( apply_filters( 'mt_money_format', $total ) ) . $sep;
      $output .= $sep . __( 'Net value', 'my-tickets' ) . ': ' . strip_tags( apply_filters( 'mt_money_format', $net ) ) . $sep;
      $output .= $sep . __( 'Vat', 'my-tickets' ) . ' ' . round(100 * $tax, 0) . '%: ' . strip_tags( apply_filters( 'mt_money_format', $vat ) ) . $sep;
    }
    
    // End modification by me
    

    For me this was fine (except the hard coded value for the tax).

    But it would be also great, if there was the possibility the assign different tax values to the tickets. For example:

    We sell regular tickets (for the admission) with a lower tax, but also “vouchers” for merchandise wich have an higher tax.

    Best regards

    Michael

    • This topic was modified 2 years, 11 months ago by Jaegers.Net.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Feature request: tax’ is closed to new replies.