Verkaufte Produkte in Durchführungen anzeigen
This commit is contained in:
1 parent
b2cb88e4ff
commit
b1fd16cf06
2 files changed
+12
-1
No files matched your search
@@ -554,7 +554,16 @@ function market_management_search_occurrences(PDO $pdo, array $input): array
|
|||||||
}
|
}
|
||||||
$stmt = $pdo->prepare(
|
$stmt = $pdo->prepare(
|
||||||
'SELECT o.*, m.name AS market_name, m.category_id, c.code AS category_code, c.name AS category_name,
|
'SELECT o.*, m.name AS market_name, m.category_id, c.code AS category_code, c.name AS category_name,
|
||||||
MIN(d.date) AS earliest_date, MAX(d.date) AS latest_date, COUNT(d.id) AS day_count
|
MIN(d.date) AS earliest_date, MAX(d.date) AS latest_date, COUNT(d.id) AS day_count,
|
||||||
|
COALESCE((
|
||||||
|
SELECT SUM(CASE WHEN line.line_status = \'cancelled\' THEN 0 ELSE GREATEST(line.qty - line.qty_cancelled, 0) END)
|
||||||
|
FROM sales_order sale
|
||||||
|
INNER JOIN sales_order_line line ON line.sales_order_id = sale.id
|
||||||
|
WHERE sale.market_occurrence_id = o.id
|
||||||
|
AND sale.market_occurrence_day_id IS NOT NULL
|
||||||
|
AND sale.order_source = \'direct\'
|
||||||
|
AND sale.order_status <> \'cancelled\'
|
||||||
|
), 0) AS sold_item_count
|
||||||
FROM market_occurrence o
|
FROM market_occurrence o
|
||||||
INNER JOIN market_definition m ON m.id = o.market_definition_id
|
INNER JOIN market_definition m ON m.id = o.market_definition_id
|
||||||
INNER JOIN market_category c ON c.id = m.category_id
|
INNER JOIN market_category c ON c.id = m.category_id
|
||||||
|
|||||||
@@ -126,6 +126,7 @@ function auth_render_markets_large_table(array $marketTable): string
|
|||||||
$html[] = '<div class="sg-large-table__cell sg-large-table__cell--header" role="columnheader" aria-sort="' . $headerDirection . '" data-sort-key="' . $headerIndex . '"><button class="sg-large-table__sort-button" type="button" aria-label="' . auth_escape_html($ariaLabel) . '" data-markets-sort-button="true" data-markets-sort-column="' . auth_escape_html($column) . '" data-markets-sort-direction="' . auth_escape_html($targetDirection) . '"><span class="sg-large-table__sort-label">' . auth_escape_html($label) . '</span><span class="sg-large-table__sort-icon" aria-hidden="true" data-direction="' . auth_escape_html($iconDirection) . '"></span></button></div>';
|
$html[] = '<div class="sg-large-table__cell sg-large-table__cell--header" role="columnheader" aria-sort="' . $headerDirection . '" data-sort-key="' . $headerIndex . '"><button class="sg-large-table__sort-button" type="button" aria-label="' . auth_escape_html($ariaLabel) . '" data-markets-sort-button="true" data-markets-sort-column="' . auth_escape_html($column) . '" data-markets-sort-direction="' . auth_escape_html($targetDirection) . '"><span class="sg-large-table__sort-label">' . auth_escape_html($label) . '</span><span class="sg-large-table__sort-icon" aria-hidden="true" data-direction="' . auth_escape_html($iconDirection) . '"></span></button></div>';
|
||||||
$headerIndex++;
|
$headerIndex++;
|
||||||
}
|
}
|
||||||
|
$html[] = '<div class="sg-large-table__cell sg-large-table__cell--header" role="columnheader">Verkaufte Produkte</div>';
|
||||||
$html[] = '</div>';
|
$html[] = '</div>';
|
||||||
|
|
||||||
foreach ($rows as $index => $row) {
|
foreach ($rows as $index => $row) {
|
||||||
@@ -151,6 +152,7 @@ function auth_render_markets_large_table(array $marketTable): string
|
|||||||
$statusSignalClass = trim(auth_market_status_signal_class($status));
|
$statusSignalClass = trim(auth_market_status_signal_class($status));
|
||||||
$statusValue = '<span' . ($statusSignalClass !== '' ? ' class="' . auth_escape_html($statusSignalClass) . '"' : '') . '>' . auth_escape_html(auth_market_status_label($status)) . '</span>';
|
$statusValue = '<span' . ($statusSignalClass !== '' ? ' class="' . auth_escape_html($statusSignalClass) . '"' : '') . '>' . auth_escape_html(auth_market_status_label($status)) . '</span>';
|
||||||
$html[] = '<div class="sg-large-table__cell" role="cell">' . $statusValue . '</div>';
|
$html[] = '<div class="sg-large-table__cell" role="cell">' . $statusValue . '</div>';
|
||||||
|
$html[] = '<div class="sg-large-table__cell" role="cell">' . auth_escape_html((string) ($row['sold_item_count'] ?? 0)) . '</div>';
|
||||||
$html[] = '</div>';
|
$html[] = '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user