#2480 Sales Reports

This commit is contained in:
diashalabi 2021-09-30 15:33:09 +03:00
parent 15b4177b52
commit a6ca1a6eb1
4 changed files with 78 additions and 1 deletions

View File

@ -0,0 +1,28 @@
$(document).ready( function () {
$('#metaCategoryReport').DataTable({
ajax: {
url: '/admin/api/cats/report/category',
dataSrc( json ) {
json.recordsTotal = json.total;
json.recordsFiltered = json.total;
return json.data;
}
},
processing: true,
serverSide: true,
columns: [
{
data: 'name',
render: function ( data, type, row, meta ) {
return `
<a href="/admin/cats/edit/${row.id}" class="text-info">
${data ? data : categoryReportTrans.undefined_category}
</a>
`;
}
},
],
});
} );

View File

@ -37,5 +37,10 @@ return [
'please_wait' => 'Please wait.Deleting Sub Categories',
'category_selection' => 'Category Selection',
'go_to_parent' => 'Go To Parent',
'preview' => 'Preview'
'preview' => 'Preview',
// Report
'undefined_category' => 'Undefined Category',
'categories_with_no_meta_report' => 'Categories with No Meta Report',
'category' => 'Category',
];

View File

@ -0,0 +1,41 @@
<div class="row">
{% set reports = [
{
'title': trans('visiosoft.module.cats::field.categories_with_no_meta_report'),
'id': 'metaCategoryReport',
'columns': [
trans('visiosoft.module.cats::field.category'),
],
},
] %}
{% for report in reports %}
<div class="col-md-12">
<div class="card">
<div class="card-header bg-danger">
<h5 class="card-title text-white">{{ report.title }}</h5>
</div>
<div class="card-block">
<table id="{{ report.id }}" class="display">
<thead>
<tr>
{% for column in report.columns %}
<th>{{ column }}</th>
{% endfor %}
</tr>
</thead>
</table>
</div>
</div>
</div>
{% endfor %}
</div>
<script>
const categoryReportTrans = {
undefined_category: `{{ trans('visiosoft.module.cats::field.undefined_category') }}`,
};
</script>
{{ asset_add('scripts.js', 'visiosoft.module.cats::js/admin/dashboard/report.js') }}

View File

@ -49,6 +49,9 @@ class CatsModuleServiceProvider extends AddonServiceProvider
'uses' => 'Visiosoft\CatsModule\Http\Controller\Admin\CategoryController@all',
],
// Admin ReportController
'admin/api/cats/report/category' => 'Visiosoft\CatsModule\Http\Controller\Admin\ReportController@category',
// Sitemap
'sitemap.xml' => 'Visiosoft\CatsModule\Http\Controller\SitemapController@index',
'sitemap.xml/categories' => 'Visiosoft\CatsModule\Http\Controller\SitemapController@categories',