mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-10-28 19:18:58 -04:00
Add a new detailed item sales report that shows all items sold per row in an exportable format, including sale transaction information. The existing detailed transaction sales report lacked per-item row display and export support, and the items summary report did not classify by sale. - Wire sale and discount filters for the report - Validate detailed item sales route filters - Add English fallback translations for other languages - Use blank quotes for other language translations - Normalize language key placement - Use PSR-style names throughout the report
111 lines
4.3 KiB
PHP
111 lines
4.3 KiB
PHP
<?php
|
|
/**
|
|
* @var int $person_id
|
|
* @var array $permission_ids
|
|
* @var array $grants
|
|
*/
|
|
|
|
$detailed_reports = [
|
|
'reports_sales' => 'detailed',
|
|
'reports_receivings' => 'detailed',
|
|
'reports_customers' => 'specific',
|
|
'reports_discounts' => 'specific',
|
|
'reports_employees' => 'specific',
|
|
'reports_suppliers' => 'specific',
|
|
];
|
|
?>
|
|
|
|
<?= view('partial/header') ?>
|
|
|
|
<script type="text/javascript">
|
|
dialog_support.init("a.modal-dlg");
|
|
</script>
|
|
|
|
<?php
|
|
if (isset($error)) {
|
|
echo '<div class="alert alert-dismissible alert-danger">' . esc($error) . '</div>';
|
|
}
|
|
?>
|
|
|
|
<div class="row">
|
|
<div class="col-md-4">
|
|
<div class="panel panel-primary">
|
|
<div class="panel-heading">
|
|
<h3 class="panel-title"><span class="glyphicon glyphicon-stats"> </span><?= lang('Reports.graphical_reports') ?></h3>
|
|
</div>
|
|
<div class="list-group">
|
|
<?php foreach ($permission_ids as $permission_id) {
|
|
if (can_show_report($permission_id, ['inventory', 'receiving'])) {
|
|
$link = get_report_link($permission_id, 'graphical_summary');
|
|
?>
|
|
<a class="list-group-item" href="<?= $link['path'] ?>"><?= esc($link['label']) ?></a>
|
|
<?php
|
|
}
|
|
}
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-4">
|
|
<div class="panel panel-primary">
|
|
<div class="panel-heading">
|
|
<h3 class="panel-title"><span class="glyphicon glyphicon-list"> </span><?= lang('Reports.summary_reports') ?></h3>
|
|
</div>
|
|
<div class="list-group">
|
|
<?php foreach ($permission_ids as $permission_id) {
|
|
if (can_show_report($permission_id, ['inventory', 'receiving'])) {
|
|
$link = get_report_link($permission_id, 'summary');
|
|
?>
|
|
<a class="list-group-item" href="<?= $link['path'] ?>"><?= esc($link['label']) ?></a>
|
|
<?php
|
|
}
|
|
}
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-4">
|
|
<div class="panel panel-primary">
|
|
<div class="panel-heading">
|
|
<h3 class="panel-title"><span class="glyphicon glyphicon-list-alt"> </span><?= lang('Reports.detailed_reports') ?></h3>
|
|
</div>
|
|
<div class="list-group">
|
|
<?php foreach ($detailed_reports as $report_name => $prefix) {
|
|
if (in_array($report_name, $permission_ids, true)) {
|
|
$link = get_report_link($report_name, $prefix);
|
|
?>
|
|
<a class="list-group-item" href="<?= $link['path'] ?>"><?= esc($link['label']) ?></a>
|
|
<?php if ($report_name === 'reports_sales') {
|
|
$item_sales_link = get_report_link('reports_item_sales', 'detailed', 'Reports.detailed_item_sales_report');
|
|
?>
|
|
<a class="list-group-item" href="<?= $item_sales_link['path'] ?>"><?= esc($item_sales_link['label']) ?></a>
|
|
<?php } ?>
|
|
<?php
|
|
}
|
|
}
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
<?php if (in_array('reports_inventory', $permission_ids, true)) { ?>
|
|
<div class="panel panel-primary">
|
|
<div class="panel-heading">
|
|
<h3 class="panel-title"><span class="glyphicon glyphicon-book"> </span><?= lang('Reports.inventory_reports') ?></h3>
|
|
</div>
|
|
<div class="list-group">
|
|
<?php
|
|
$inventory_low_report = get_report_link('reports_inventory_low');
|
|
$inventory_summary_report = get_report_link('reports_inventory_summary');
|
|
?>
|
|
<a class="list-group-item" href="<?= $inventory_low_report['path'] ?>"><?= esc($inventory_low_report['label']) ?></a>
|
|
<a class="list-group-item" href="<?= $inventory_summary_report['path'] ?>"><?= esc($inventory_summary_report['label']) ?></a>
|
|
</div>
|
|
</div>
|
|
<?php } ?>
|
|
</div>
|
|
</div>
|
|
|
|
<?= view('partial/footer') ?>
|