7 Commits
2.3.1 ... 2.3.2

Author SHA1 Message Date
mchev
af9d672574 Bump version from 2.3.1 to 2.3.2 2026-04-06 11:02:23 +02:00
mchev
7606f8ece8 Merge pull request #585 from InvoiceShelf/translations
New Crowdin updates
2026-04-06 11:00:58 +02:00
mchev
9b0498a2e5 Merge pull request #583 from sirlupusdev/fix-setup-wizard
Fix: Set Slug when creating/updating first company
2026-04-06 10:54:57 +02:00
mchev
04c7682e73 Merge pull request #584 from sirlupusdev/feat-auto-due-date
Feat: Automatically set due date when invoice date is changed
2026-04-06 10:50:05 +02:00
Darko Gjorgjijoski
0f933b6217 New translations en.json (Hindi) 2026-03-26 19:47:36 +01:00
lupus0802
241ec09220 Feat: Automatically set due date when invoice date is changed 2026-03-25 13:06:39 +01:00
lupus0802
ed7af3fc3c Fix: Set Slug when creating/updating first company 2026-03-25 13:05:23 +01:00
4 changed files with 66 additions and 2 deletions

View File

@@ -35,7 +35,7 @@
"yes": "हां",
"no": "नहीं",
"sort_by": "इसके अनुसार क्रमबद्ध करें",
"ascending": "आरोही",
"ascending": "बढ़ते क्रम में",
"descending": "उतरते",
"subject": "विषय",
"body": "बॉडी",

View File

@@ -164,6 +164,7 @@
<script setup>
import { ref, computed, onMounted, reactive } from 'vue'
import { useI18n } from 'vue-i18n'
import { deburr } from 'lodash'
import { required, maxLength, helpers } from '@vuelidate/validators'
import { useVuelidate } from '@vuelidate/core'
import { useGlobalStore } from '@/scripts/admin/stores/global'
@@ -180,6 +181,7 @@ let logoFileName = ref(null)
const companyForm = reactive({
name: null,
slug: null,
tax_id: null,
vat_id: null,
address: {
@@ -251,6 +253,18 @@ async function next() {
}
isSaving.value = true
// Generate slug from company name (imitate Laravel's Str::slug)
if (companyForm.name) {
companyForm.slug = deburr(companyForm.name) // Remove accents etc.
.toLowerCase()
.trim()
.replace(/_/g, '-')
.replace(/[^a-z0-9\s-]/g, '') // Remove all non-alphanumeric chars
.replace(/[\s-]+/g, '-')
.replace(/^-+|-+$/g, '') // Trim dashes
}
let res = companyStore.updateCompany(companyForm)
if (res) {
if (logoFileBlob.value) {

View File

@@ -139,6 +139,7 @@
import { computed, onMounted, ref, watch } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { useI18n } from 'vue-i18n'
import moment from 'moment'
import {
required,
maxLength,
@@ -179,6 +180,9 @@ let router = useRouter()
const invoiceValidationScope = 'newInvoice'
let isSaving = ref(false)
const isMarkAsDefault = ref(false)
const dueDateManuallyChanged = ref(false)
let isAutoUpdatingDueDate = false
let expectedAutoDueDate = ref(null)
const invoiceNoteFieldList = ref([
'customer',
@@ -261,6 +265,52 @@ watch(
{immediate: true}
)
// Watch for manual changes to due_date
watch(() => invoiceStore.newInvoice.due_date, (newDueDate, oldDueDate) => {
if (!isAutoUpdatingDueDate && newDueDate !== oldDueDate && oldDueDate !== undefined && newDueDate !== expectedAutoDueDate.value) {
dueDateManuallyChanged.value = true
}
});
// Watch invoice_date and automatically update due_date when it changes
watch(() => invoiceStore.newInvoice.invoice_date, (newInvoiceDate, oldInvoiceDate) => {
if (
companyStore.selectedCompanySettings?.invoice_set_due_date_automatically === 'YES' &&
newInvoiceDate &&
newInvoiceDate !== oldInvoiceDate &&
oldInvoiceDate !== undefined
) {
const dueDateDays = parseInt(companyStore.selectedCompanySettings.invoice_due_date_days || 0);
const invoiceDate = moment(newInvoiceDate)
if (invoiceDate.isValid()) {
const calculatedDueDate = invoiceDate.clone().add(dueDateDays, 'days').format('YYYY-MM-DD')
expectedAutoDueDate.value = calculatedDueDate
if (dueDateManuallyChanged.value) {
const currentDueDate = invoiceStore.newInvoice.due_date
if (currentDueDate) {
const dueDateMoment = moment(currentDueDate)
if (dueDateMoment.isValid() && dueDateMoment.isSameOrAfter(invoiceDate, 'day')) {
return // Manual due date still valid/in the future
}
}
// Manual due date is in the past/invalid
dueDateManuallyChanged.value = false
}
// Set the calculated due date
isAutoUpdatingDueDate = true
invoiceStore.newInvoice.due_date = calculatedDueDate
isAutoUpdatingDueDate = false
}
}
})
async function submitForm() {
v$.value.$touch()

View File

@@ -1 +1 @@
2.3.1
2.3.2