<commit_before><?php 
use_helper('BivcStatistique');

$csv = "Appellation;Catégorie;Stock initial;Stock actuel;TOTAL mvt\n";
foreach ($result['agg_page']['buckets'] as $appellation) {
	$appellationKey = str_replace('\\', '', $appellation['key']);
	$appellationLibelle = preg_replace('/AOC */', '', ConfigurationClient::getCurrent()->get($appellationKey)->getLibelleFormat());
	$globalLibelle = preg_replace('/AOC */', '', ConfigurationClient::getCurrent()->get($appellationKey)->getAppellation()->getLibelleFormat());
	$totalStockInitial = (formatNumber($appellation['total_stock_initial']['value']) != 0)? formatNumber($appellation['total_stock_initial']['value']) : null;
	$totalStockFinal = (formatNumber($appellation['total_stock_final']['value']) != 0)? formatNumber($appellation['total_stock_final']['value']) : null;
	$totalTotal = (formatNumber($appellation['total_total']['value']) != 0)? formatNumber($appellation['total_total']['value']) : null;
	foreach ($appellation['agg_line']['buckets'] as $categorie) {
		$categorieLibelle = getFamilleLibelle($categorie['key']);
		$stockInitial = (formatNumber($categorie['stock_initial']['agg_column']['value']) != 0)? formatNumber($categorie['stock_initial']['agg_column']['value']) : null;
		$stockFinal = (formatNumber($categorie['stock_final']['agg_column']['value']) != 0)? formatNumber($categorie['stock_final']['agg_column']['value']) : null;
		$totalMvt = (formatNumber($categorie['total']['value']) != 0)? formatNumber($categorie['total']['value']) : null;
		$csv .= $globalLibelle.';'.$appellationLibelle.';'.$categorieLibelle.';'.$stockInitial.';'.$stockFinal.';'.$totalMvt."\n";
	}
	$csv .= $globalLibelle.';'.$appellationLibelle.';TOTAL;'.$totalStockInitial.';'.$totalStockFinal.';'.$totalTotal."\n";
}
#$csv .= 'TOTAL;TOTAL;TOTAL;'.formatNumber($result['totaux_stock_initial']['value']).';'.formatNumber($result['totaux_stock_final']['value']).';'.formatNumber($result['totaux_total']['value'])."\n";
echo $csv;
<commit_msg>décalage colonne sur les stocks<commit_after><?php
use_helper('BivcStatistique');

$csv = "Appellation;Catégorie;Stock initial;Stock actuel;TOTAL mvt\n";
foreach ($result['agg_page']['buckets'] as $appellation) {
	$appellationKey = str_replace('\\', '', $appellation['key']);
	$appellationLibelle = preg_replace('/AOC */', '', ConfigurationClient::getCurrent()->get($appellationKey)->getLibelleFormat());
	$globalLibelle = preg_replace('/AOC */', '', ConfigurationClient::getCurrent()->get($appellationKey)->getAppellation()->getLibelleFormat());
	$totalStockInitial = (formatNumber($appellation['total_stock_initial']['value']) != 0)? formatNumber($appellation['total_stock_initial']['value']) : null;
	$totalStockFinal = (formatNumber($appellation['total_stock_final']['value']) != 0)? formatNumber($appellation['total_stock_final']['value']) : null;
	$totalTotal = (formatNumber($appellation['total_total']['value']) != 0)? formatNumber($appellation['total_total']['value']) : null;
	foreach ($appellation['agg_line']['buckets'] as $categorie) {
		$categorieLibelle = getFamilleLibelle($categorie['key']);
		$stockInitial = (formatNumber($categorie['stock_initial']['agg_column']['value']) != 0)? formatNumber($categorie['stock_initial']['agg_column']['value']) : null;
		$stockFinal = (formatNumber($categorie['stock_final']['agg_column']['value']) != 0)? formatNumber($categorie['stock_final']['agg_column']['value']) : null;
		$totalMvt = (formatNumber($categorie['total']['value']) != 0)? formatNumber($categorie['total']['value']) : null;
		$csv .= $globalLibelle.';'.$appellationLibelle.';'.$categorieLibelle.';'.$stockInitial.';'.$stockFinal.';'.$totalMvt."\n";
	}
	$csv .= $appellationLibelle.';TOTAL;'.$totalStockInitial.';'.$totalStockFinal.';'.$totalTotal."\n";
}
#$csv .= 'TOTAL;TOTAL;TOTAL;'.formatNumber($result['totaux_stock_initial']['value']).';'.formatNumber($result['totaux_stock_final']['value']).';'.formatNumber($result['totaux_total']['value'])."\n";
echo $csv;

{'fraction_non_alphanumeric': 0.2342885872297637, 'fraction_numerical': 0.0030165912518853697, 'mean_word_length': 11.057575757575757, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4228037', 'n_tokens_mistral': 1308, 'n_tokens_neox': 1248, 'n_words': 132}