43 lines
1.1 KiB
PHP
43 lines
1.1 KiB
PHP
<?php
|
|
|
|
class DatabaseCommunicationClass
|
|
{
|
|
use DatabaseCommunication;
|
|
}
|
|
|
|
$smarty = createSmarty(true, true);
|
|
|
|
$start_date = getVal('date_from', null, date('d.m.Y', time()));
|
|
|
|
$end_date = getVal('date_to');
|
|
|
|
$Pos = new \Pos();
|
|
|
|
$specific_pos = getVal('specific_pos');
|
|
|
|
if ($specific_pos) {
|
|
$Pos->setSpecificPos($specific_pos);
|
|
$vars['admin_name'] = returnSQLResult('SELECT login FROM admins WHERE id=:id', ['id' => $specific_pos]);
|
|
} else {
|
|
global $adminName;
|
|
if (!empty($adminName)) {
|
|
$vars['admin_name'] = 'Nedefinováno';
|
|
}
|
|
}
|
|
|
|
$Pos->setStartDatetime($start_date.' '.date(Settings::getTimeFormat(), mktime(0, 0, 0)));
|
|
$Pos->setEndDatetime($end_date.' '.date(Settings::getTimeFormat(), mktime(23, 59, 59)));
|
|
|
|
$vars['stats'] = $Pos->getPayments();
|
|
|
|
$vars['actually_in_pos'] = $Pos->getActuallyCashInPOS();
|
|
|
|
$vars['today_sales'] = $Pos->getSales();
|
|
$vars['discounts'] = $Pos->getDiscounts();
|
|
|
|
$vars['now_time'] = getVal('date_to') ? prepareDate(str_replace('.', '-', getVal('date_to'))).' 18:00:00' : date('Y-m-d H:i:s', time());
|
|
|
|
$smarty->assign($vars);
|
|
|
|
$smarty->display('printCenter/POSClosure.tpl');
|