protected function query2Sources(array $args, $invoiceSourceType, $sort = true)
    {
        $this->getLog()->info('WooCommerce\InvoiceManager::query2Sources: args = %s', str_replace(array(' ', "\r", "\n", "\t"), '', var_export($args, true)));
        // Add default arguments.
        $args = $args + array(
                'fields' => 'ids',
                'posts_per_page' => -1,
                'post_type' => $this->sourceTypeToShopType($invoiceSourceType),
                'post_status' => array_keys(wc_get_order_statuses()),
            );
        $query = new WP_Query($args);
        $ids = $query->get_posts();
        if ($sort) {
            sort($ids);
        }
        return $this->getSourcesByIdsOrSources($invoiceSourceType, $ids);
    }