<?php

use KupShop\KupShopBundle\Util\Compat\ServiceContainer;

function smarty_function_get_invoicing_data($params, &$smarty)
{
    $invoicingUtil = ServiceContainer::getService(\KupShop\OrderingBundle\Util\Invoice\InvoicingUtil::class);
    $data = $invoicingUtil->getInvoicingData();

    if (!empty($params['assign'])) {
        $smarty->assign($params['assign'], $data);
    } else {
        return $data;
    }
}
