Code Duplication    Length = 9-9 lines in 2 locations

includes/class-wpinv-reports.php 2 locations

@@ 414-422 (lines=9) @@
411
            $args['status'] = array_keys( wpinv_get_invoice_statuses( true ) );
412
        }
413
414
        if ( !empty( $this->from_date ) || !empty( $this->to_date ) ) {
415
            $args['date_query'] = array(
416
                array(
417
                    'after'     => date( 'Y-n-d 00:00:00', strtotime( $this->from_date ) ),
418
                    'before'    => date( 'Y-n-d 23:59:59', strtotime( $this->to_date ) ),
419
                    'inclusive' => true
420
                )
421
            );
422
        }
423
424
        $invoices = wpinv_get_invoices( $args );
425
        
@@ 484-492 (lines=9) @@
481
            $args['status'] = array_keys( wpinv_get_invoice_statuses( true ) );
482
        }
483
484
        if ( !empty( $this->from_date ) || !empty( $this->to_date ) ) {
485
            $args['date_query'] = array(
486
                array(
487
                    'after'     => date( 'Y-n-d 00:00:00', strtotime( $this->from_date ) ),
488
                    'before'    => date( 'Y-n-d 23:59:59', strtotime( $this->to_date ) ),
489
                    'inclusive' => true
490
                )
491
            );
492
        }
493
494
        $invoices   = wpinv_get_invoices( $args );
495
        $total      = !empty( $invoices ) ? count( $invoices ) : 0;