|
@@ -388,7 +388,7 @@
|
|
|
:class="['tab-btn', { active: activeTab === 'attachments' }]"
|
|
:class="['tab-btn', { active: activeTab === 'attachments' }]"
|
|
|
@click="activeTab = 'attachments'"
|
|
@click="activeTab = 'attachments'"
|
|
|
>
|
|
>
|
|
|
- Liitteet
|
|
|
|
|
|
|
+ Tiedostot
|
|
|
</button>
|
|
</button>
|
|
|
<button
|
|
<button
|
|
|
:class="['tab-btn', { active: activeTab === 'contacts' }]"
|
|
:class="['tab-btn', { active: activeTab === 'contacts' }]"
|
|
@@ -510,7 +510,7 @@
|
|
|
<span class="attachment-size">({{ formatFileSize(attachment.file_size) }})</span>
|
|
<span class="attachment-size">({{ formatFileSize(attachment.file_size) }})</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="attachment-actions">
|
|
<div class="attachment-actions">
|
|
|
- <a :href="attachment.file_path" target="_blank" class="btn btn-primary">View</a>
|
|
|
|
|
|
|
+ <a :href="`/uploads/${attachment.file_path}`" target="_blank" class="btn btn-primary">View</a>
|
|
|
<button class="btn btn-danger" @click="deleteAttachment(attachment.id)">Delete</button>
|
|
<button class="btn btn-danger" @click="deleteAttachment(attachment.id)">Delete</button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -613,8 +613,8 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <!-- Accounting Section -->
|
|
|
|
|
- <AccountingSection
|
|
|
|
|
|
|
+ <!-- Accounting Section (Hidden - ExcelAccounting is in use) -->
|
|
|
|
|
+ <!-- <AccountingSection
|
|
|
:active-section="activeSection"
|
|
:active-section="activeSection"
|
|
|
:invoices="invoices"
|
|
:invoices="invoices"
|
|
|
:invoices-loading="invoicesLoading"
|
|
:invoices-loading="invoicesLoading"
|
|
@@ -633,7 +633,7 @@
|
|
|
@edit-journal-entry="editJournalEntry"
|
|
@edit-journal-entry="editJournalEntry"
|
|
|
@delete-journal-entry="deleteJournalEntry"
|
|
@delete-journal-entry="deleteJournalEntry"
|
|
|
@search="searchAccounting"
|
|
@search="searchAccounting"
|
|
|
- />
|
|
|
|
|
|
|
+ /> -->
|
|
|
|
|
|
|
|
<!-- Add/Edit Client Modal -->
|
|
<!-- Add/Edit Client Modal -->
|
|
|
<div v-if="showClientModal" class="modal" @click.self="closeClientModal">
|
|
<div v-if="showClientModal" class="modal" @click.self="closeClientModal">
|
|
@@ -1869,7 +1869,7 @@ export default {
|
|
|
|
|
|
|
|
async fetchRentalPrices(itemId) {
|
|
async fetchRentalPrices(itemId) {
|
|
|
try {
|
|
try {
|
|
|
- const response = await api.get(`/api/rental_prices.php?item_id=${itemId}`)
|
|
|
|
|
|
|
+ const response = await api.get(`/rental_prices.php?item_id=${itemId}`)
|
|
|
this.rentalPrices = response.data.records || []
|
|
this.rentalPrices = response.data.records || []
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
this.showMessage('Error fetching rental prices: ' + error.message, 'error')
|
|
this.showMessage('Error fetching rental prices: ' + error.message, 'error')
|
|
@@ -1878,7 +1878,7 @@ export default {
|
|
|
|
|
|
|
|
async fetchAttachments(itemId) {
|
|
async fetchAttachments(itemId) {
|
|
|
try {
|
|
try {
|
|
|
- const response = await api.get(`/api/attachments.php?item_id=${itemId}`)
|
|
|
|
|
|
|
+ const response = await api.get(`/attachments.php?item_id=${itemId}`)
|
|
|
this.attachments = response.data.records || []
|
|
this.attachments = response.data.records || []
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
this.showMessage('Error fetching attachments: ' + error.message, 'error')
|
|
this.showMessage('Error fetching attachments: ' + error.message, 'error')
|
|
@@ -1909,7 +1909,7 @@ export default {
|
|
|
|
|
|
|
|
async saveRentalPrice() {
|
|
async saveRentalPrice() {
|
|
|
try {
|
|
try {
|
|
|
- await api.post('/api/rental_prices.php', this.rentalForm)
|
|
|
|
|
|
|
+ await api.post('/rental_prices.php', this.rentalForm)
|
|
|
this.showMessage('Rental price added successfully!', 'success')
|
|
this.showMessage('Rental price added successfully!', 'success')
|
|
|
this.closeRentalModal()
|
|
this.closeRentalModal()
|
|
|
await this.fetchRentalPrices(this.selectedItem.id)
|
|
await this.fetchRentalPrices(this.selectedItem.id)
|
|
@@ -1924,7 +1924,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
- await api.delete(`/api/rental_prices.php?id=${id}`)
|
|
|
|
|
|
|
+ await api.delete(`/rental_prices.php?id=${id}`)
|
|
|
this.showMessage('Rental price deleted successfully!', 'success')
|
|
this.showMessage('Rental price deleted successfully!', 'success')
|
|
|
await this.fetchRentalPrices(this.selectedItem.id)
|
|
await this.fetchRentalPrices(this.selectedItem.id)
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
@@ -1966,7 +1966,7 @@ export default {
|
|
|
formData.append('item_id', this.attachmentForm.item_id)
|
|
formData.append('item_id', this.attachmentForm.item_id)
|
|
|
formData.append('file_type', this.attachmentForm.file_type)
|
|
formData.append('file_type', this.attachmentForm.file_type)
|
|
|
|
|
|
|
|
- await api.post('/api/attachments.php', formData, {
|
|
|
|
|
|
|
+ await api.post('/attachments.php', formData, {
|
|
|
headers: {
|
|
headers: {
|
|
|
'Content-Type': 'multipart/form-data'
|
|
'Content-Type': 'multipart/form-data'
|
|
|
}
|
|
}
|
|
@@ -1986,7 +1986,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
- await api.delete(`/api/attachments.php?id=${id}`)
|
|
|
|
|
|
|
+ await api.delete(`/attachments.php?id=${id}`)
|
|
|
this.showMessage('Attachment deleted successfully!', 'success')
|
|
this.showMessage('Attachment deleted successfully!', 'success')
|
|
|
await this.fetchAttachments(this.selectedItem.id)
|
|
await this.fetchAttachments(this.selectedItem.id)
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
@@ -2228,7 +2228,7 @@ export default {
|
|
|
async fetchInvoices() {
|
|
async fetchInvoices() {
|
|
|
this.invoicesLoading = true
|
|
this.invoicesLoading = true
|
|
|
try {
|
|
try {
|
|
|
- const response = await api.get('/api/invoices.php')
|
|
|
|
|
|
|
+ const response = await api.get('/invoices.php')
|
|
|
this.invoices = response.data.records || []
|
|
this.invoices = response.data.records || []
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
this.showMessage('Error fetching invoices: ' + error.message, 'error')
|
|
this.showMessage('Error fetching invoices: ' + error.message, 'error')
|
|
@@ -2245,7 +2245,7 @@ export default {
|
|
|
|
|
|
|
|
this.invoicesLoading = true
|
|
this.invoicesLoading = true
|
|
|
try {
|
|
try {
|
|
|
- const response = await api.get(`/api/invoices.php?search=${this.invoiceSearch}`)
|
|
|
|
|
|
|
+ const response = await api.get(`/invoices.php?search=${this.invoiceSearch}`)
|
|
|
this.invoices = response.data.records || []
|
|
this.invoices = response.data.records || []
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
this.showMessage('Error searching invoices: ' + error.message, 'error')
|
|
this.showMessage('Error searching invoices: ' + error.message, 'error')
|
|
@@ -2307,10 +2307,10 @@ export default {
|
|
|
async saveInvoice() {
|
|
async saveInvoice() {
|
|
|
try {
|
|
try {
|
|
|
if (this.isEditingInvoice) {
|
|
if (this.isEditingInvoice) {
|
|
|
- await api.put('/api/invoices.php', this.invoiceForm)
|
|
|
|
|
|
|
+ await api.put('/invoices.php', this.invoiceForm)
|
|
|
this.showMessage('Invoice updated successfully!', 'success')
|
|
this.showMessage('Invoice updated successfully!', 'success')
|
|
|
} else {
|
|
} else {
|
|
|
- await api.post('/api/invoices.php', this.invoiceForm)
|
|
|
|
|
|
|
+ await api.post('/invoices.php', this.invoiceForm)
|
|
|
this.showMessage('Invoice created successfully!', 'success')
|
|
this.showMessage('Invoice created successfully!', 'success')
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -2327,7 +2327,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
- await api.delete(`/api/invoices.php?id=${id}`)
|
|
|
|
|
|
|
+ await api.delete(`/invoices.php?id=${id}`)
|
|
|
this.showMessage('Invoice deleted successfully!', 'success')
|
|
this.showMessage('Invoice deleted successfully!', 'success')
|
|
|
await this.fetchInvoices()
|
|
await this.fetchInvoices()
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
@@ -2845,7 +2845,7 @@ export default {
|
|
|
async fetchAccounts() {
|
|
async fetchAccounts() {
|
|
|
this.accountsLoading = true
|
|
this.accountsLoading = true
|
|
|
try {
|
|
try {
|
|
|
- const response = await api.get('/api/chart_of_accounts.php')
|
|
|
|
|
|
|
+ const response = await api.get('/chart_of_accounts.php')
|
|
|
this.accounts = response.data.records || []
|
|
this.accounts = response.data.records || []
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
this.showMessage('Error fetching accounts: ' + error.message, 'error')
|
|
this.showMessage('Error fetching accounts: ' + error.message, 'error')
|
|
@@ -2858,7 +2858,7 @@ export default {
|
|
|
this.accountSearch = searchTerm
|
|
this.accountSearch = searchTerm
|
|
|
this.accountsLoading = true
|
|
this.accountsLoading = true
|
|
|
try {
|
|
try {
|
|
|
- const response = await api.get(`/api/chart_of_accounts.php?search=${this.accountSearch}`)
|
|
|
|
|
|
|
+ const response = await api.get(`/chart_of_accounts.php?search=${this.accountSearch}`)
|
|
|
this.accounts = response.data.records || []
|
|
this.accounts = response.data.records || []
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
this.showMessage('Error searching accounts: ' + error.message, 'error')
|
|
this.showMessage('Error searching accounts: ' + error.message, 'error')
|
|
@@ -2899,7 +2899,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
- await api.delete(`/api/chart_of_accounts.php?id=${id}`)
|
|
|
|
|
|
|
+ await api.delete(`/chart_of_accounts.php?id=${id}`)
|
|
|
this.showMessage('Account deleted successfully!', 'success')
|
|
this.showMessage('Account deleted successfully!', 'success')
|
|
|
this.fetchAccounts()
|
|
this.fetchAccounts()
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
@@ -2911,7 +2911,7 @@ export default {
|
|
|
async fetchJournalEntries() {
|
|
async fetchJournalEntries() {
|
|
|
this.journalEntriesLoading = true
|
|
this.journalEntriesLoading = true
|
|
|
try {
|
|
try {
|
|
|
- const response = await api.get('/api/journal_entries.php')
|
|
|
|
|
|
|
+ const response = await api.get('/journal_entries.php')
|
|
|
this.journalEntries = response.data.records || []
|
|
this.journalEntries = response.data.records || []
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
this.showMessage('Error fetching journal entries: ' + error.message, 'error')
|
|
this.showMessage('Error fetching journal entries: ' + error.message, 'error')
|
|
@@ -2957,7 +2957,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
- await api.delete(`/api/journal_entries.php?id=${id}`)
|
|
|
|
|
|
|
+ await api.delete(`/journal_entries.php?id=${id}`)
|
|
|
this.showMessage('Journal entry deleted successfully!', 'success')
|
|
this.showMessage('Journal entry deleted successfully!', 'success')
|
|
|
this.fetchJournalEntries()
|
|
this.fetchJournalEntries()
|
|
|
} catch (error) {
|
|
} catch (error) {
|