public function getStatisticListQueryBuilder($order,
$partnerId,
$summary,
$fromDate,
$toDate,
$userCurrencyFactor = 1
) { /** @var QueryBuilder $builder */
$builder =
$this->
getEntityManager()->
createQueryBuilder();
$expr =
$this->
getEntityManager()->
getExpressionBuilder();
$builder->
select([ 'o.orderTime as orderTime',
'o.id as id',
'o.number as number',
'SUM((o.invoiceAmountNet - o.invoiceShippingNet) / (o.currencyFactor / :userCurrencyFactor)) as netTurnOver',
'SUM((o.invoiceAmountNet - o.invoiceShippingNet) / (o.currencyFactor / :userCurrencyFactor) / 100 * partner.percent) as provision',
'customer.email as customerEmail',
'billing.company as customerCompany',
'customer.firstname as customerFirstName',
'customer.lastname as customerLastName',