Commit e0c328e3 authored by Karamel's avatar Karamel
Browse files

Fix session details (payments display and CS on session list)

parent 1dee4031
......@@ -63,9 +63,10 @@ echo \Pasteque\row(\Pasteque\standardTable($content));
unset($content);
$currSrv = new \Pasteque\CurrenciesService();
$content = [];
$content[0][] = \i18n("Payments", PLUGIN_NAME);
$content[0][] = \i18n("Amount", PLUGIN_NAME);
$i = 0;
$i = 1;
foreach ($zticket->payments as $payment) {
$currency = $currSrv->get($payment->currencyId);
if ($currency->isMain) {
......
......@@ -27,13 +27,17 @@ $error = null;
$srv = new \Pasteque\CashesService();
$sessions = $srv->getAll();
$crSrv = new \Pasteque\CashRegistersService();
$ztickets = [];
foreach ($sessions as $session) {
$session->zticket = \Pasteque\CashesService::getZTicket($session->id);
}
//Title
echo \Pasteque\row(\Pasteque\mainTitle(\i18n("Active sessions", PLUGIN_NAME)));
$content[0][] = \i18n("CashRegister.label");
$content[0][] = \i18n("Session.openDate");
$content[0][] = \i18n("Session.tickets");
$content[0][] = \i18n("Session.total");
$content[0][] = \i18n("Consolidated sales", PLUGIN_NAME);
$i = 1;
foreach ($sessions as $session) {
$cashRegister = $crSrv->get($session->cashRegisterId);
......@@ -41,7 +45,7 @@ foreach ($sessions as $session) {
$content[$i][0] = $cashRegister->label;
$content[$i][1] = \i18nDatetime($session->openDate);
$content[$i][2] = $session->tickets;
$content[$i][3] = \i18nCurr($session->total);
$content[$i][3] = \i18nCurr($session->zticket->cs);
$content[$i][4] = \Pasteque\editButton(\i18n("Edit"), \Pasteque\get_module_url_action(PLUGIN_NAME, 'session_details', array('id' => $session->id)));
$i++;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment