feat(BillingService, BillingView): enhance locale handling for billing PDF generation
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 42s

- Added methods to normalize and format numbers based on locale in BillingService, improving internationalization support.
- Updated _fillSessionRows and _renderBillingPdfFromTemplate methods to accept locale as a parameter for consistent number formatting.
- Modified BillingView to pass the current locale when generating billing PDFs, ensuring accurate representation of numerical values.
This commit is contained in:
Torsten Schulz (local)
2026-04-25 10:07:45 +02:00
parent 2339e12410
commit 725ede8dbf
2 changed files with 43 additions and 15 deletions

View File

@@ -1041,7 +1041,8 @@ export default {
});
const runId = createResponse.data?.run?.id;
if (runId) {
const generateResponse = await apiClient.post(`/billing/runs/${runId}/generate`, {});
const locale = this.$i18n?.locale || 'de-DE';
const generateResponse = await apiClient.post(`/billing/runs/${runId}/generate`, { locale });
if (!generateResponse.data?.success) {
throw new Error(generateResponse.data?.error || 'PDF-Erzeugung fehlgeschlagen');
}
@@ -1061,7 +1062,8 @@ export default {
this.generatingRunIds.push(runId);
this.feedback = { message: '', type: 'info' };
try {
const response = await apiClient.post(`/billing/runs/${runId}/generate`, {});
const locale = this.$i18n?.locale || 'de-DE';
const response = await apiClient.post(`/billing/runs/${runId}/generate`, { locale });
if (!response.data?.success) {
throw new Error(response.data?.error || 'PDF-Erzeugung fehlgeschlagen');
}
@@ -1078,7 +1080,8 @@ export default {
this.generatingRunIds.push(runId);
this.feedback = { message: '', type: 'info' };
try {
const response = await apiClient.post(`/billing/runs/${runId}/generate`, {});
const locale = this.$i18n?.locale || 'de-DE';
const response = await apiClient.post(`/billing/runs/${runId}/generate`, { locale });
if (!response.data?.success) {
throw new Error(response.data?.error || 'PDF-Erzeugung fehlgeschlagen');
}