Code Duplication    Length = 10-12 lines in 2 locations

templates/emails/wpinv-email-invoice-items.php 1 location

@@ 123-134 (lines=12) @@
120
                </tr>
121
            <?php } ?>
122
            
123
            <?php if ( wpinv_discount( $invoice_id, false ) > 0 ) { ?>
124
                <tr class="wpinv_cart_footer_row wpinv_cart_discount_row">
125
                    <?php do_action( 'wpinv_receipt_items_table_discount_first', $cart_items, $invoice ); ?>
126
                    <td colspan="<?php echo ( $cart_columns - 1 ); ?>" class="wpinv_cart_discount_label text-right">
127
                        <strong><?php wpinv_get_discount_label( wpinv_discount_code( $invoice_id ) ); ?>:</strong>
128
                    </td>
129
                    <td class="wpinv_cart_discount text-right">
130
                        <span class="wpinv_cart_discount_amount"><?php echo wpinv_discount( $invoice_id, true, true ); ?></span>
131
                    </td>
132
                    <?php do_action( 'wpinv_receipt_items_table_discount_last', $cart_items, $invoice ); ?>
133
                </tr>
134
            <?php } ?>
135
136
            <?php if ( !$zero_tax && $use_taxes && wpinv_is_cart_taxed() ) { ?>
137
                <tr class="wpinv_cart_footer_row wpinv_cart_tax_row">

includes/wpinv-template-functions.php 1 location

@@ 1090-1099 (lines=10) @@
1087
                <?php
1088
                do_action( 'wpinv_display_after_subtotal', $invoice, $cols );
1089
                
1090
                if ( wpinv_discount( $invoice_id, false ) > 0 ) {
1091
                    do_action( 'wpinv_display_before_discount', $invoice, $cols );
1092
                    ?>
1093
                        <tr class="row-discount">
1094
                            <td class="rate" colspan="<?php echo ( $cols - 1 ); ?>"><?php wpinv_get_discount_label( wpinv_discount_code( $invoice_id ) ); ?>:</td>
1095
                            <td class="total"><?php echo wpinv_discount( $invoice_id, true, true ); ?></td>
1096
                        </tr>
1097
                    <?php
1098
                    do_action( 'wpinv_display_after_discount', $invoice, $cols );
1099
                }
1100
1101
                if ( $use_taxes ) {
1102
                    do_action( 'wpinv_display_before_tax', $invoice, $cols );