== addJs('assets/js/dataTablesSetup.js'); /* $this['ids'] = Db::select(' SELECT DISTINCT(t.ticket_id) FROM custom_technician_ticket_hours AS t WHERE MONTH(t.date)="'.$this->month.'" AND YEAR(t.date)="'.$this->year.'"'); */ $this['cost'] = Db::select(' SELECT r.code AS resCode, ANY_VALUE(r.name) AS resName, ANY_VALUE(b.description) AS brand, SUM(h.time/3600 * u.hourlyRate) As cost FROM custom_technician_ticket_hours AS h INNER JOIN custom_tickets AS t ON t.id = h.ticket_id INNER JOIN custom_restaurants AS r ON r.id = t.restaurant_id INNER JOIN custom_brands AS b ON b.code = r.brandCode INNER JOIN custom_users AS u ON u.id = t.responsible_user_id WHERE MONTH(h.date)="'.$this->month.'" AND YEAR(h.date)="'.$this->year.'" GROUP BY resCode '); // return($this['cost']); } ?> == {% for c in cost %} {% endfor %}
Brand Store Cost
Brand Store Cost
{{ c.brand }} {{ c.resCode ~ "-" ~ c.resName }} {{ c.cost|round(2) ~ '€' }}