feat: Add currency selection and conversion support in PDF generation, enhance expense processing with target currency handling
This commit is contained in:
@@ -291,6 +291,36 @@
|
||||
v-model="showCreateModal"
|
||||
@created="handleExpenseCreated"
|
||||
/>
|
||||
|
||||
<!-- PDF Generation Loading Overlay -->
|
||||
<v-overlay
|
||||
:model-value="generatingPDF"
|
||||
persistent
|
||||
class="align-center justify-center"
|
||||
>
|
||||
<v-card
|
||||
color="surface"
|
||||
class="pa-8"
|
||||
width="400"
|
||||
>
|
||||
<div class="text-center">
|
||||
<v-progress-circular
|
||||
:size="70"
|
||||
:width="7"
|
||||
color="primary"
|
||||
indeterminate
|
||||
/>
|
||||
|
||||
<h3 class="text-h6 mt-4 mb-2">Generating PDF...</h3>
|
||||
<p class="text-body-2 text-grey-darken-1">
|
||||
Your expense report is being generated with receipt images
|
||||
</p>
|
||||
<p class="text-caption text-grey-darken-1 mt-2">
|
||||
This may take a moment for large reports
|
||||
</p>
|
||||
</div>
|
||||
</v-card>
|
||||
</v-overlay>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -324,6 +354,7 @@ const showDetailsModal = ref(false);
|
||||
const showCreateModal = ref(false);
|
||||
const selectedExpense = ref<Expense | null>(null);
|
||||
const activeTab = ref<string>('');
|
||||
const generatingPDF = ref(false);
|
||||
|
||||
// Filters
|
||||
const filters = ref({
|
||||
@@ -494,6 +525,9 @@ const exportCSV = async () => {
|
||||
};
|
||||
|
||||
const generatePDF = async (options: any) => {
|
||||
generatingPDF.value = true;
|
||||
showPDFModal.value = false; // Close the modal immediately
|
||||
|
||||
try {
|
||||
console.log('[expenses] Generating PDF with options:', options);
|
||||
|
||||
@@ -536,11 +570,11 @@ const generatePDF = async (options: any) => {
|
||||
console.log('[expenses] PDF downloaded successfully:', response.data.filename);
|
||||
}
|
||||
|
||||
showPDFModal.value = false;
|
||||
|
||||
} catch (err: any) {
|
||||
console.error('[expenses] Error generating PDF:', err);
|
||||
error.value = err.message || 'Failed to generate PDF';
|
||||
} finally {
|
||||
generatingPDF.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user