Title: Bug in the code
Last modified: March 25, 2021

---

# Bug in the code

 *  Resolved [vitruviman](https://wordpress.org/support/users/vitruviman/)
 * (@vitruviman)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/bug-in-the-code-4/)
 * Hi,
 * I just wanted to let you know that there is a bug in the latest version of the
   plugin.
 * In the `edd_quaderno_create_invoice()` function in `/includes/invoices.php`, 
   the order fees are added to the invoice with this for loop:
 *     ```
       foreach ( $payment->fees as $fee ) {
           $item = array(
               'description' => $fee['label'],
               'quantity' => 1,
               'amount' => $fee['amount'] * (1 + $tax->rate / 100.0),
               'tax' => $tax
           );
   
           array_push( $transaction_items, $new_item );
       }
       ```
   
 * Instead it should read:
 *     ```
       foreach ( $payment->fees as $fee ) {
           $new_item = array(
               'description' => $fee['label'],
               'quantity' => 1,
               'amount' => $fee['amount'] * (1 + $tax->rate / 100.0),
               'tax' => $tax
           );
   
           array_push( $transaction_items, $new_item );
       }
       ```
   
 * Otherwise the Quaderno invoice will show a duplicate of the last regular cart
   item rather than the additional fee.
 * On a related note, unfortunately the plugin does not work correctly with the 
   EDD Discounts Pro extension ([https://easydigitaldownloads.com/downloads/discounts-pro/](https://easydigitaldownloads.com/downloads/discounts-pro/)).
 * Unlike the normal EDD discount coupons, the Discounts Pro extension applies the
   discounts as additional order fees. The problem then is that when the products
   are added to the Quaderno invoice, they are added with the discounted price applied
   and then the discounts (fees) are also added to the invoice as additional items.
   This essentially results in a double discount and an incorrect total invoice 
   amount in Quaderno. It would be great if this could be resolved in a future version
   of the plugin.
 * Thanks very much in advance.

Viewing 1 replies (of 1 total)

 *  Plugin Author [polimorfico](https://wordpress.org/support/users/polimorfico/)
 * (@polimorfico)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/bug-in-the-code-4/#post-14628009)
 * Sorry for delay. The bug was fixed in version 1.27.1. Thanks for letting us know.
 * We take note of your suggestion about supporting EDD Discounts Pro.
 * Cheers!

Viewing 1 replies (of 1 total)

The topic ‘Bug in the code’ is closed to new replies.

 * ![](https://ps.w.org/edd-quaderno/assets/icon.svg?rev=2950964)
 * [Quaderno for EDD](https://wordpress.org/plugins/edd-quaderno/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/edd-quaderno/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/edd-quaderno/)
 * [Active Topics](https://wordpress.org/support/plugin/edd-quaderno/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/edd-quaderno/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/edd-quaderno/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [polimorfico](https://wordpress.org/support/users/polimorfico/)
 * Last activity: [4 years, 11 months ago](https://wordpress.org/support/topic/bug-in-the-code-4/#post-14628009)
 * Status: resolved