|
|
@@ -704,6 +704,12 @@ class Istat extends Component
|
|
|
$v_data['cittadinanza_conducente'] .= str_pad($country->istat_code, 3, ' ', STR_PAD_RIGHT);
|
|
|
$v_data['cittadinanza_conducente'] .= str_pad(preg_replace('[^A-Z ]', '', strtoupper($country->name)), 30, ' ', STR_PAD_RIGHT);
|
|
|
}
|
|
|
+
|
|
|
+ $countryDataLen = strlen($v_data['cittadinanza_conducente']);
|
|
|
+ $expectedCountryDataLen = 34;
|
|
|
+ if ($countryDataLen < $expectedCountryDataLen) {
|
|
|
+ $v_data['cittadinanza_conducente'] .= str_repeat(' ', $expectedCountryDataLen - $countryDataLen);
|
|
|
+ }
|
|
|
} else {
|
|
|
$v_data['tipo'] .= str_repeat(' ', 2);
|
|
|
$v_data['veicolo'] .= str_repeat(' ', 18);
|
|
|
@@ -902,7 +908,8 @@ class Istat extends Component
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
|
- $txt_data = implode("\n", $txt);
|
|
|
+ $txt_data = implode("\r\n", $txt);
|
|
|
+
|
|
|
return response()->streamDownload(function () use ($txt_data) {
|
|
|
echo $txt_data;
|
|
|
}, 'istat_' . $this->from . "_" . $this->to . '.txt');
|