Inital commit
This commit is contained in:
@@ -0,0 +1,228 @@
|
||||
{extends file="admin-layout.tpl"}
|
||||
|
||||
{block name="no-return-functions"}
|
||||
{$admin_current_location = 'tools'}
|
||||
|
||||
{loop name="currency" type="currency" default_only=1}
|
||||
{$currency=$SYMBOL}
|
||||
{/loop}
|
||||
{/block}
|
||||
|
||||
{block name="page-title"}{intl d='monthlystats.bo.default' l='Statistiques mensuelles de Chiffre d\'Affaire'}{/block}
|
||||
|
||||
{block name="check-resource"}admin.order{/block}
|
||||
{block name="check-access"}view{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
{$graphData = ''}
|
||||
|
||||
<div id="wrapper" class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="general-block-decorator">
|
||||
<div class="jqplot-content" style="margin-bottom: 20px">
|
||||
<div id="jqplot"></div>
|
||||
</div>
|
||||
|
||||
<table class="table table-bordered table-condensed table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{intl d='monthlystats.bo.default' l="Mois"}</th>
|
||||
<th class="text-right text-nowrap">{intl d='monthlystats.bo.default' l="Total HT"}</th>
|
||||
<th class="text-right text-nowrap">{intl d='monthlystats.bo.default' l="Total TVA"}</th>
|
||||
<th class="text-right text-nowrap">{intl d='monthlystats.bo.default' l="Total TTC"}</th>
|
||||
<th class="text-right">{intl d='monthlystats.bo.default' l="Total port TTC"}</th>
|
||||
<th class="text-right">{intl d='monthlystats.bo.default' l="Total TVA port"}</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{$total_ht = 0}
|
||||
{$total_ttc = 0}
|
||||
{$total_tva = 0}
|
||||
{$total_postage = 0}
|
||||
{$total_postage_tax = 0}
|
||||
{$virg = ''}
|
||||
|
||||
{foreach $data as $annee => $monthData}
|
||||
<tr class="info">
|
||||
<th colspan="99">
|
||||
Année {$annee}
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th class="text-center">{intl d='monthlystats.bo.default' l="Mois"}</th>
|
||||
<th class="text-right">{intl d='monthlystats.bo.default' l="CA HT"}</th>
|
||||
<th class="text-right">{intl d='monthlystats.bo.default' l="TVA"}</th>
|
||||
<th class="text-right">{intl d='monthlystats.bo.default' l="CA TTC"}</th>
|
||||
<th class="text-right">{intl d='monthlystats.bo.default' l="Port TTC"}</th>
|
||||
<th class="text-right">{intl d='monthlystats.bo.default' l="TVA port"}</th>
|
||||
</tr>
|
||||
|
||||
{$total_ht_an = 0}
|
||||
{$total_ttc_an = 0}
|
||||
{$total_tva_an = 0}
|
||||
{$total_postage_an = 0}
|
||||
{$total_postage_tax_an = 0}
|
||||
|
||||
{foreach $monthData as $mois => $value}
|
||||
{$strMois = $mois|string_format:"%02d"}
|
||||
|
||||
<tr>
|
||||
<td class="text-center">{$strMois}/{$annee|string_format:"%04d"}</td>
|
||||
<td class="text-right">{format_money number=$value.total_ht symbol=$currency}</td>
|
||||
<td class="text-right">{format_money number=$value.total_tva symbol=$currency}</td>
|
||||
<td class="text-right">{format_money number=$value.total_ttc symbol=$currency}</td>
|
||||
<td class="text-right">{format_money number=$value.postage symbol=$currency}</td>
|
||||
<td class="text-right">{format_money number=$value.postage_tax symbol=$currency}</td>
|
||||
</tr>
|
||||
|
||||
{$total_ht_an = $total_ht_an + $value.total_ht}
|
||||
{$total_ttc_an = $total_ttc_an + $value.total_ttc}
|
||||
{$total_tva_an = $total_tva_an + $value.total_tva}
|
||||
{$total_postage_an = $total_postage_an + $value.postage}
|
||||
{$total_postage_tax_an = $total_postage_tax_an + $value.postage_tax}
|
||||
|
||||
{$total_ht = $total_ht + $value.total_ht}
|
||||
{$total_ttc = $total_ttc + $value.total_ttc}
|
||||
{$total_tva = $total_tva + $value.total_tva}
|
||||
{$total_postage = $total_postage + $value.postage}
|
||||
{$total_postage_tax = $total_postage_tax + $value.postage_tax}
|
||||
|
||||
{$graphData = "[ '$annee-$strMois-01', {$value.total_ht|round:2} ]$virg$graphData"}
|
||||
{$virg = ','}
|
||||
{/foreach}
|
||||
|
||||
<tr>
|
||||
<th class="text-center">{intl d='monthlystats.bo.default' l="TOTAL %total" total=$annee}</th>
|
||||
<th class="text-right text-nowrap">{format_money number=$total_ht_an}</th>
|
||||
<th class="text-right text-nowrap">{format_money number=$total_tva_an}</th>
|
||||
<th class="text-right text-nowrap">{format_money number=$total_ttc_an}</th>
|
||||
<th class="text-right text-nowrap">{format_money number=$total_postage_an}</th>
|
||||
<th class="text-right text-nowrap">{format_money number=$total_postage_tax_an}</th>
|
||||
</tr>
|
||||
{/foreach}
|
||||
|
||||
{if empty($data)}
|
||||
<tr>
|
||||
<td colspan="99">
|
||||
<div class="alert alert-info">{intl d='monthlystats.bo.default' l="Aucune commande pour cette période"}</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</tbody>
|
||||
|
||||
<tr class="success">
|
||||
<th class="text-center">{intl d='monthlystats.bo.default' l="TOTAL GENERAL"}</th>
|
||||
<th class="text-right text-nowrap">{format_money number=$total_ht}</th>
|
||||
<th class="text-right text-nowrap">{format_money number=$total_tva}</th>
|
||||
<th class="text-right text-nowrap">{format_money number=$total_ttc}</th>
|
||||
<th class="text-right text-nowrap">{format_money number=$total_postage}</th>
|
||||
<th class="text-right text-nowrap">{format_money number=$total_postage_tax}</th>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/block}
|
||||
|
||||
{block name="javascript-initialization"}
|
||||
<script src="{javascript file='assets/js/jqplot/jquery.jqplot.min.js'}"></script>
|
||||
<script src="{javascript file='assets/js/jqplot/plugins/jqplot.highlighter.min.js'}"></script>
|
||||
<script src="{javascript file='assets/js/jqplot/plugins/jqplot.pointLabels.min.js'}"></script>
|
||||
<script src="{javascript file='assets/js/jqplot/plugins/jqplot.dateAxisRenderer.min.js'}"></script>
|
||||
<script src="{javascript file='assets/js/jqplot/plugins/jqplot.canvasTextRenderer.min.js'}"></script>
|
||||
<script src="{javascript file='assets/js/jqplot/plugins/jqplot.canvasAxisTickRenderer.min.js'}"></script>
|
||||
<script src="{javascript file='assets/js/jqplot/plugins/jqplot.canvasAxisTickRenderer.min.js'}"></script>
|
||||
<script src="{javascript file='assets/js/jqplot/plugins/jqplot.canvasOverlay.min.js'}"></script>
|
||||
|
||||
<script>
|
||||
var graphData = [ {$graphData nofilter} ];
|
||||
|
||||
$.jqplot.config.enablePlugins = true;
|
||||
|
||||
var jQPlotsOptions = {
|
||||
animate: false,
|
||||
axesDefaults: {
|
||||
tickOptions: {
|
||||
showMark: true,
|
||||
showGridline: true,
|
||||
}
|
||||
},
|
||||
seriesDefaults: {
|
||||
pointLabels: { show:false },
|
||||
lineWidth: 2,
|
||||
shadow: false,
|
||||
markerOptions: {
|
||||
shadow: false,
|
||||
style: 'filledCircle',
|
||||
size: 6
|
||||
}
|
||||
},
|
||||
seriesColors: ['orange'],
|
||||
axes: {
|
||||
xaxis: {
|
||||
renderer:$.jqplot.DateAxisRenderer,
|
||||
rendererOptions:{
|
||||
tickRenderer:$.jqplot.CanvasAxisTickRenderer
|
||||
},
|
||||
borderColor: '#ccc',
|
||||
ticks: [],
|
||||
tickInterval:'6 month',
|
||||
tickOptions: {
|
||||
showGridline: true,
|
||||
formatString: '%m/%Y',
|
||||
angle:-40
|
||||
}
|
||||
},
|
||||
yaxis: {
|
||||
min: 0,
|
||||
tickOptions: {
|
||||
showGridline: true,
|
||||
showMark: false,
|
||||
showLabel: true,
|
||||
shadow: false
|
||||
}
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
background: '#FFF',
|
||||
shadow: false,
|
||||
borderColor: '#FFF'
|
||||
},
|
||||
highlighter: {
|
||||
show: true,
|
||||
sizeAdjust: 7,
|
||||
tooltipLocation: 'n',
|
||||
tooltipContentEditor: function (str, seriesIndex, pointIndex, plot) {
|
||||
var date = new Date(plot.data[seriesIndex][pointIndex][0]);
|
||||
|
||||
return $.jqplot.sprintf(
|
||||
"%d/%d - %.2f {currency attr="symbol"}",
|
||||
1 + date.getMonth(),
|
||||
date.getFullYear(),
|
||||
plot.data[seriesIndex][pointIndex][1]
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$(function() {
|
||||
jQPlotInstance = $.jqplot(
|
||||
"jqplot",
|
||||
[ graphData ],
|
||||
jQPlotsOptions
|
||||
);
|
||||
|
||||
$(window).bind('resize', function (event, ui) {
|
||||
jQPlotInstance.replot({
|
||||
resetAxes: true
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{$total_ht|print_r}
|
||||
{/block}
|
||||
@@ -0,0 +1,173 @@
|
||||
lo{extends file="admin-layout.tpl"}
|
||||
|
||||
{block name="no-return-functions"}
|
||||
{$admin_current_location = 'tools'}
|
||||
|
||||
{loop name="currency" type="currency" default_only=1}
|
||||
{$currency=$SYMBOL}
|
||||
{/loop}
|
||||
{/block}
|
||||
|
||||
{block name="page-title"}{intl d='monthlystats.bo.default' l='Chiffre d\'affaire par catégorie'}{/block}
|
||||
|
||||
{block name="check-resource"}admin.order{/block}
|
||||
{block name="check-access"}view{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
|
||||
{$mois = [ "Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Aout", "Septembre", "Octobre", "Novembre", "Décembre" ]}
|
||||
|
||||
{$annee = $smarty.now|date_format:"%Y"}
|
||||
|
||||
<div id="wrapper" class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="general-block-decorator">
|
||||
<form class="form-inline" action="{url path="/admin/ca-par-rubrique"}" method="POST">
|
||||
<div class="form-group">
|
||||
<label>{intl d='monthlystats.bo.default' l='Visualiser de : '}</label>
|
||||
<select name="mois_debut" class="form-control">
|
||||
{for $idx = 0; $idx < 12; $idx++}
|
||||
<option value="{$idx+1}"{if $mois_debut == $idx+1} selected{/if}>{$mois[$idx]}</option>
|
||||
{/for}
|
||||
</select>
|
||||
<select name="annee_debut" class="form-control">
|
||||
{for $idx = 2009; $idx <= $annee; $idx++}
|
||||
<option value="{$idx}"{if $annee_debut == $idx} selected{/if}>{$idx}</option>
|
||||
{/for}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>{intl d='monthlystats.bo.default' l='à : '}</label>
|
||||
<select name="mois_fin" class="form-control">
|
||||
{for $idx = 0; $idx < 12; $idx++}
|
||||
<option value="{$idx+1}"{if $mois_fin == $idx+1} selected{/if}>{$mois[$idx]}</option>
|
||||
{/for}
|
||||
</select>
|
||||
<select name="annee_fin" class="form-control">
|
||||
{for $idx = 2009; $idx <= $annee; $idx++}
|
||||
<option value="{$idx}"{if $annee_fin == $idx} selected{/if}>{$idx}</option>
|
||||
{/for}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary">{intl d='monthlystats.bo.default' l='OK'}</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="general-block-decorator">
|
||||
<div class="row">
|
||||
<div class="col-md-12 title title-without-tabs">
|
||||
{intl d='monthlystats.bo.default' l="TOTAL PAR CATÉGORIE"}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{$total_ht = 0}
|
||||
{$total_ttc = 0}
|
||||
{$total_tva = 0}
|
||||
|
||||
<table class="table table-bordered table-condensed table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{intl d='monthlystats.bo.default' l="Categorie"}</th>
|
||||
<th class="text-right text-nowrap">{intl d='monthlystats.bo.default' l="Total HT"}</th>
|
||||
<th class="text-right text-nowrap">{intl d='monthlystats.bo.default' l="Total TVA"}</th>
|
||||
<th class="text-right text-nowrap">{intl d='monthlystats.bo.default' l="Total TTC"}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach $catData as $data}
|
||||
{$total_ht = $total_ht + $data.total_ht}
|
||||
{$total_ttc = $total_ttc + $data.total_ttc}
|
||||
{$total_tva = $total_tva + $data.total_tva}
|
||||
<tr>
|
||||
<td>{$data.cat_label nofilter}</td>
|
||||
<td class="text-right text-nowrap">{format_money number=$data.total_ht}</td>
|
||||
<td class="text-right text-nowrap">{format_money number=$data.total_tva}</td>
|
||||
<td class="text-right text-nowrap">{format_money number=$data.total_ttc}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{if empty($catData)}
|
||||
<tr>
|
||||
<td colspan="99">
|
||||
<div class="alert alert-info">Aucune commande pour cette période</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</tbody>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th class="text-right">{intl d='monthlystats.bo.default' l="Total"}</th>
|
||||
<th class="text-right text-nowrap">{format_money number=$total_ht}</th>
|
||||
<th class="text-right text-nowrap">{format_money number=$total_tva}</th>
|
||||
<th class="text-right text-nowrap">{format_money number=$total_ttc}</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="general-block-decorator">
|
||||
<div class="row">
|
||||
<div class="col-md-12 title title-without-tabs">
|
||||
{intl d='monthlystats.bo.default' l="TOTAL PAR GRANDE CATÉGORIE"}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="table table-bordered table-condensed table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{intl d='monthlystats.bo.default' l="Categorie"}</th>
|
||||
<th class="text-right text-nowrap">{intl d='monthlystats.bo.default' l="Total HT"}</th>
|
||||
<th class="text-right text-nowrap">{intl d='monthlystats.bo.default' l="Total TVA"}</th>
|
||||
<th class="text-right text-nowrap">{intl d='monthlystats.bo.default' l="Total TTC"}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{$total_ht = 0}
|
||||
{$total_ttc = 0}
|
||||
{$total_tva = 0}
|
||||
|
||||
{foreach $topLevelData as $label => $data}
|
||||
{$total_ht = $total_ht + $data.total_ht}
|
||||
{$total_ttc = $total_ttc + $data.total_ttc}
|
||||
{$total_tva = $total_tva + $data.total_tva}
|
||||
<tr>
|
||||
<td>{$label nofilter}</td>
|
||||
<td class="text-right text-nowrap">{format_money number=$data.total_ht}</td>
|
||||
<td class="text-right text-nowrap">{format_money number=$data.total_tva}</td>
|
||||
<td class="text-right text-nowrap">{format_money number=$data.total_ttc}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
|
||||
{if empty($topLevelData)}
|
||||
<tr>
|
||||
<td colspan="99">
|
||||
<div class="alert alert-info">{intl d='monthlystats.bo.default' l='Aucune commande pour cette période'}</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</tbody>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th class="text-right">{intl d='monthlystats.bo.default' l="Total"}</th>
|
||||
<th class="text-right text-nowrap">{format_money number=$total_ht}</th>
|
||||
<th class="text-right text-nowrap">{format_money number=$total_tva}</th>
|
||||
<th class="text-right text-nowrap">{format_money number=$total_ttc}</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
Reference in New Issue
Block a user