mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 19:51:09 -04:00
fix validation and translation issues
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import BaseButton from './BaseButton.vue'
|
||||
import ItemModal from './modal/ItemModal.vue'
|
||||
import BaseModal from './modal/BaseModal.vue'
|
||||
import BaseDatePicker from './base-date-picker/BaseDatepicker.vue'
|
||||
import BaseDatePicker from './base-date-picker/BaseDatePicker.vue'
|
||||
import BaseInput from './BaseInput.vue'
|
||||
import BaseSwitch from './BaseSwitch.vue'
|
||||
import BaseTextArea from './BaseTextArea.vue'
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<div class="card-body">
|
||||
<!-- tab-1 -->
|
||||
<tabs :options="{defaultTabHash: 'basic-home' }" class="tabs-simple">
|
||||
<tab id="basic-home" name="Basic Info">
|
||||
<tab id="basic-home" :name="$t('customers.basic_info')">
|
||||
<div class="basic-info">
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4 col-form-label">{{ $t('customers.display_name') }} <span class="required">*</span></label>
|
||||
@ -97,7 +97,7 @@
|
||||
</tab>
|
||||
|
||||
<!-- tab-2 -->
|
||||
<tab id="basic-profile" name="Billing Address">
|
||||
<tab id="basic-profile" :name="$t('customers.billing_address')">
|
||||
<div class="basic-info">
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4 col-form-label">{{ $t('customers.name') }}</label>
|
||||
@ -226,7 +226,7 @@
|
||||
</tab>
|
||||
|
||||
<!-- tab-3 -->
|
||||
<tab id="basic-message" name="Shipping Address">
|
||||
<tab id="basic-message" :name="$t('customers.shipping_address')">
|
||||
<div class="basic-info">
|
||||
<div class="form-group row ">
|
||||
<div class="col-sm-12 copy-address-button">
|
||||
@ -266,9 +266,9 @@
|
||||
<div class="col-sm-7">
|
||||
<base-text-area
|
||||
v-model="shipping.address_street_1"
|
||||
:placeholder="$t('general.street_1')"
|
||||
rows="2"
|
||||
cols="50"
|
||||
placeholder="Street 1"
|
||||
class="mb-1"
|
||||
@input="$v.shipping.address_street_1.$touch()"
|
||||
/>
|
||||
@ -278,9 +278,9 @@
|
||||
|
||||
<base-text-area
|
||||
v-model="shipping.address_street_2"
|
||||
:placeholder="$t('general.street_2')"
|
||||
rows="2"
|
||||
cols="50"
|
||||
placeholder="Street 2"
|
||||
@input="$v.shipping.address_street_2.$touch()"
|
||||
/>
|
||||
<div v-if="$v.shipping.address_street_2.$error">
|
||||
@ -299,9 +299,9 @@
|
||||
:searchable="true"
|
||||
:show-labels="false"
|
||||
:allow-empty="false"
|
||||
:placeholder="$t('general.select_country')"
|
||||
track-by="id"
|
||||
label="name"
|
||||
placeholder="select country"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -103,7 +103,7 @@ export default {
|
||||
},
|
||||
openCustomerModal () {
|
||||
this.openModal({
|
||||
title: 'Add Customer',
|
||||
title: this.$t('customers.add_customer'),
|
||||
componentName: 'CustomerModal',
|
||||
size: 'lg'
|
||||
})
|
||||
|
||||
@ -56,11 +56,11 @@ export default {
|
||||
select_a_status: 'Select a status',
|
||||
select_a_tax: 'Select a tax',
|
||||
search: 'Search',
|
||||
are_you_sure: '?',
|
||||
are_you_sure: 'Are you sure?',
|
||||
list_is_empty: 'List is empty.',
|
||||
no_tax_found: 'No tax found!',
|
||||
four_zero_four: '404',
|
||||
yot_got_lost: 'Whoops! You got Lost!',
|
||||
you_got_lost: 'Whoops! You got Lost!',
|
||||
go_home: 'Go Home',
|
||||
|
||||
setting_updated: 'Setting updated successfully',
|
||||
@ -117,6 +117,7 @@ export default {
|
||||
},
|
||||
customers: {
|
||||
title: 'Customers',
|
||||
add_customer: 'Add Customer',
|
||||
contacts_list: 'Customer List',
|
||||
name: 'Name',
|
||||
display_name: 'Display Name',
|
||||
@ -744,7 +745,7 @@ export default {
|
||||
qty_must_greater_than_zero: 'Quantity must be greater than zero.',
|
||||
price_greater_than_zero: 'Price must be greater than zero.',
|
||||
payment_greater_than_zero: 'Payment must be greater than zero.',
|
||||
payment_grater_than_due_amount: 'Entered Payment is more than due amount of this invoice.',
|
||||
payment_greater_than_due_amount: 'Entered Payment is more than due amount of this invoice.',
|
||||
quantity_maxlength: 'Quantity should not be greater than 10 characters.',
|
||||
price_maxlength: 'Price should not be greater than 10 characters.',
|
||||
amount_maxlength: 'Amount should not be greater than 10 characters.',
|
||||
|
||||
@ -56,7 +56,20 @@ export default {
|
||||
select_a_status: 'Selecciona un estado',
|
||||
select_a_tax: 'Selecciona un impuesto',
|
||||
search: 'Buscar',
|
||||
are_you_sure: '¿Estás seguro?'
|
||||
are_you_sure: '¿Estás seguro?',
|
||||
list_is_empty: 'La lista esta vacía.',
|
||||
no_tax_found: '¡No se encontraron impuestos!',
|
||||
four_zero_four: '404',
|
||||
you_got_lost: 'Whoops! ¡Te perdiste!',
|
||||
go_home: 'Vete a casa',
|
||||
|
||||
setting_updated: 'Configuración actualizada con éxito',
|
||||
select_state: 'Seleccione estado',
|
||||
select_country: 'Seleccionar país',
|
||||
select_city: 'Ciudad selecta',
|
||||
street_1: 'Calle 1',
|
||||
street_2: 'Calle # 2',
|
||||
action_failed: 'Accion: Fallida'
|
||||
},
|
||||
dashboard: {
|
||||
select_year: 'Seleccione año',
|
||||
@ -104,6 +117,7 @@ export default {
|
||||
},
|
||||
customers: {
|
||||
title: 'Clientes',
|
||||
add_customer: 'Agregar cliente',
|
||||
contacts_list: 'Lista de clientes',
|
||||
name: 'Nombre',
|
||||
display_name: 'Nombre para mostrar',
|
||||
@ -134,6 +148,7 @@ export default {
|
||||
shipping_address: 'Dirección de Envío',
|
||||
copy_billing_address: 'Copia de facturación',
|
||||
no_customers: '¡Aún no hay clientes!',
|
||||
no_customers_found: 'No se encontraron clientes!',
|
||||
list_of_customers: 'Esta sección contendrá la lista de clientes.',
|
||||
primary_display_name: 'Nombre de visualización principal',
|
||||
select_state: 'Seleccione estado',
|
||||
@ -143,6 +158,7 @@ export default {
|
||||
street_1: 'Calle 1',
|
||||
street_2: 'Calle 2',
|
||||
select_a_customer: 'Selecciona un cliente',
|
||||
type_or_click: 'Escriba o haga clic para seleccionar',
|
||||
|
||||
confirm_delete: 'No podrá recuperar este cliente | No podrá recuperar estos clientes',
|
||||
created_message: 'Cliente creado con éxito',
|
||||
@ -205,6 +221,7 @@ export default {
|
||||
amount: 'Cantidad',
|
||||
action: 'Acción',
|
||||
notes: 'Notas',
|
||||
tax: 'Impuesto',
|
||||
estimate_template: 'Plantilla de estimación',
|
||||
convert_to_invoice: 'Convertir a factura',
|
||||
mark_as_sent: 'Marcar como enviado',
|
||||
@ -578,8 +595,8 @@ export default {
|
||||
estimate_viewed_message: 'Estimación vista',
|
||||
please_enter_email: 'Por favor, introduzca su correo electrónico'
|
||||
},
|
||||
sales_taxes: {
|
||||
title: 'Impuestos de ventas',
|
||||
tax_types: {
|
||||
title: 'Tipos de impuestos',
|
||||
description: 'Puede agregar o eliminar impuestos a su gusto. Crater admite impuestos sobre artículos individuales, así como sobre la factura.',
|
||||
add_new_tax: 'Agregar nuevo impuesto',
|
||||
tax_settings: 'Configuraciones de impuestos',
|
||||
@ -659,7 +676,10 @@ export default {
|
||||
copyright_crater: 'Copyright @ Crater - 2019',
|
||||
super_simple_invoicing: 'Facturación super simple',
|
||||
for_freelancer: 'para autónomos y',
|
||||
small_businesses: 'Pequeñas empresas '
|
||||
small_businesses: 'Pequeñas empresas',
|
||||
crater_help: 'Crater te ayuda a rastrear gastos, registrar pagos y generar hermosos',
|
||||
invoices_and_estimates: 'facturas y presupuestos con capacidad para elegir múltiples plantillas.'
|
||||
|
||||
},
|
||||
validation: {
|
||||
invalid_url: 'URL no válida (por ejemplo, http://www.crater.com)',
|
||||
@ -678,6 +698,14 @@ export default {
|
||||
qty_must_greater_than_zero: 'La cantidad debe ser mayor que cero.',
|
||||
price_greater_than_zero: 'El precio debe ser mayor que cero.',
|
||||
payment_greater_than_zero: 'El pago debe ser mayor que cero.',
|
||||
payment_grater_than_due_amount: 'El pago ingresado es mayor al monto adeudado de esta factura.'
|
||||
payment_greater_than_due_amount: 'El pago ingresado es mayor al monto adeudado de esta factura.',
|
||||
quantity_maxlength: 'La cantidad no debe ser mayor de 10 caracteres.',
|
||||
price_maxlength: 'El precio no debe tener más de 10 caracteres.',
|
||||
amount_maxlength: 'La cantidad no debe ser mayor de 10 caracteres.',
|
||||
description_maxlength: 'La descripción no debe tener más de 255 caracteres.',
|
||||
maximum_options_error: 'Máximo de {max} opciones seleccionadas. Primero elimine una opción seleccionada para seleccionar otra.',
|
||||
notes_maxlength: 'Las notas no deben tener más de 255 caracteres.',
|
||||
address_maxlength: 'La dirección no debe tener más de 255 caracteres.',
|
||||
ref_number_maxlength: 'El número de referencia no debe tener más de 10 caracteres.'
|
||||
}
|
||||
}
|
||||
|
||||
@ -56,7 +56,20 @@ export default {
|
||||
select_a_status: 'Sélectionnez un statut',
|
||||
select_a_tax: 'Sélectionnez une taxe',
|
||||
search: 'Chercher',
|
||||
are_you_sure: 'Êtes-vous sûr?'
|
||||
are_you_sure: 'Êtes-vous sûr?',
|
||||
list_is_empty: 'La liste est vide',
|
||||
no_tax_found: 'Aucune taxe trouvée!',
|
||||
four_zero_four: '404',
|
||||
you_got_lost: 'Oups! Vous vous êtes perdus!',
|
||||
go_home: 'Rentrer chez soi',
|
||||
|
||||
setting_updated: 'Réglage mis à jour avec succès',
|
||||
select_state: "Sélectionnez l'état",
|
||||
select_country: 'Choisissez le pays',
|
||||
select_city: 'Sélectionnez une ville',
|
||||
street_1: 'Rue 1',
|
||||
street_2: 'Rue # 2',
|
||||
action_failed: 'Action: échoué'
|
||||
},
|
||||
dashboard: {
|
||||
select_year: 'Sélectionnez lannée',
|
||||
@ -104,6 +117,7 @@ export default {
|
||||
},
|
||||
customers: {
|
||||
title: 'Les clients',
|
||||
add_customer: 'Ajouter un client',
|
||||
contacts_list: 'Liste de clients',
|
||||
name: 'Nom',
|
||||
display_name: 'Afficher un nom',
|
||||
@ -134,6 +148,7 @@ export default {
|
||||
shipping_address: 'Adresse de livraison',
|
||||
copy_billing_address: 'Copier de la facturation',
|
||||
no_customers: 'Pas encore de clients!',
|
||||
no_customers_found: 'Aucun client trouvé!',
|
||||
list_of_customers: 'Cette section contiendra la liste des clients.',
|
||||
primary_display_name: 'Nom daffichage principal',
|
||||
select_state: 'Sélectionnez létat',
|
||||
@ -143,6 +158,7 @@ export default {
|
||||
street_1: 'Rue 1',
|
||||
street_2: 'Rue 2',
|
||||
select_a_customer: 'Sélectionnez un client',
|
||||
type_or_click: 'Tapez ou cliquez pour sélectionner',
|
||||
|
||||
confirm_delete: 'Vous ne pourrez pas récupérer ce client | Vous ne pourrez pas récupérer ces clients',
|
||||
created_message: 'Client créé avec succès',
|
||||
@ -205,6 +221,7 @@ export default {
|
||||
amount: 'Montante',
|
||||
action: 'action',
|
||||
notes: 'Remarques',
|
||||
tax: 'Impôt',
|
||||
estimate_template: 'Modèle destimation',
|
||||
convert_to_invoice: 'Convertir en facture',
|
||||
mark_as_sent: 'Marquer comme envoyé',
|
||||
@ -501,7 +518,7 @@ export default {
|
||||
company_information: 'Informations sur la société',
|
||||
preferences: 'Préférences',
|
||||
notifications: 'Les notifications',
|
||||
sales_taxes: 'Taxes de vente',
|
||||
tax_types: 'Types de taxe',
|
||||
expense_category: 'Catégories de dépenses'
|
||||
},
|
||||
title: 'Paramètres',
|
||||
@ -578,8 +595,8 @@ export default {
|
||||
estimate_viewed_message: 'Estimation vue',
|
||||
please_enter_email: 'S il vous plaît entrer email'
|
||||
},
|
||||
sales_taxes: {
|
||||
title: 'Taxes de vente',
|
||||
tax_types: {
|
||||
title: 'Types de taxe',
|
||||
description: 'Vous pouvez ajouter ou supprimer des taxes à votre guise. Crater prend en charge les taxes sur les articles individuels ainsi que sur la facture.',
|
||||
add_new_tax: 'Ajouter une nouvelle taxe',
|
||||
tax_settings: 'Paramètres de taxe',
|
||||
@ -659,7 +676,10 @@ export default {
|
||||
copyright_crater: 'Copyright @ Crater - 2019',
|
||||
super_simple_invoicing: 'Super Simple Facturation',
|
||||
for_freelancer: 'pour les pigistes et',
|
||||
small_businesses: 'Petites entreprises '
|
||||
small_businesses: 'Petites entreprises ',
|
||||
crater_help: 'Crater vous aide à suivre vos dépenses, à enregistrer vos paiements et à générer de belles',
|
||||
invoices_and_estimates: 'factures et devis avec possibilité de choisir plusieurs modèles.'
|
||||
|
||||
},
|
||||
validation: {
|
||||
invalid_url: 'URL invalide (ex: http://www.crater.com)',
|
||||
@ -678,6 +698,14 @@ export default {
|
||||
qty_must_greater_than_zero: 'La quantité doit être supérieure à zéro.',
|
||||
price_greater_than_zero: 'Le prix doit être supérieur à zéro.',
|
||||
payment_greater_than_zero: 'Le paiement doit être supérieur à zéro.',
|
||||
payment_grater_than_due_amount: 'Le paiement entré est plus que le montant dû de cette facture.'
|
||||
payment_greater_than_due_amount: 'Le paiement entré est plus que le montant dû de cette facture.',
|
||||
quantity_maxlength: 'La quantité ne doit pas dépasser 10 caractères.',
|
||||
price_maxlength: 'Le prix ne doit pas dépasser 10 caractères.',
|
||||
amount_maxlength: 'Le montant ne doit pas dépasser 10 caractères.',
|
||||
description_maxlength: 'La description ne doit pas dépasser 255 caractères.',
|
||||
maximum_options_error: 'Maximum de {max} options sélectionnées. Commencez par supprimer une option sélectionnée pour en sélectionner une autre.',
|
||||
notes_maxlength: 'Les notes ne doivent pas dépasser 255 caractères.',
|
||||
address_maxlength: "L'adresse ne doit pas dépasser 255 caractères.",
|
||||
ref_number_maxlength: 'Le numéro de référence ne doit pas dépasser 10 caractères'
|
||||
}
|
||||
}
|
||||
|
||||
@ -78,8 +78,12 @@ export const addInvoice = ({ commit, dispatch, state }, data) => {
|
||||
export const deleteInvoice = ({ commit, dispatch, state }, id) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
window.axios.delete(`/api/invoices/${id}`).then((response) => {
|
||||
commit(types.DELETE_INVOICE, id)
|
||||
resolve(response)
|
||||
if (response.data.error) {
|
||||
resolve(response)
|
||||
} else {
|
||||
commit(types.DELETE_INVOICE, id)
|
||||
resolve(response)
|
||||
}
|
||||
}).catch((err) => {
|
||||
reject(err)
|
||||
})
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<div class="row">
|
||||
<div class="col-sm-12 text-sm-center">
|
||||
<h1>{{ $t('general.four_zero_four') }}</h1>
|
||||
<h5>{{ $t('general.yot_got_lost') }}</h5>
|
||||
<h5>{{ $t('general.you_got_lost') }}</h5>
|
||||
<router-link
|
||||
class="btn btn-lg bg-yellow text-white"
|
||||
to="/">
|
||||
|
||||
@ -103,7 +103,7 @@
|
||||
<span v-if="!$v.formData.amount.required" class="text-danger">{{ $t('validation.required') }}</span>
|
||||
<span v-if="!$v.formData.amount.numeric" class="text-danger">{{ $t('validation.numbers_only') }}</span>
|
||||
<span v-if="!$v.formData.amount.between && $v.formData.amount.numeric && amount <= 0" class="text-danger">{{ $t('validation.payment_greater_than_zero') }}</span>
|
||||
<span v-if="!$v.formData.amount.between && amount > 0" class="text-danger">{{ $t('validation.payment_grater_than_due_amount') }}</span>
|
||||
<span v-if="!$v.formData.amount.between && amount > 0" class="text-danger">{{ $t('validation.payment_greater_than_due_amount') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -116,13 +116,23 @@
|
||||
<base-text-area
|
||||
v-model="formData.address_street_1"
|
||||
:placeholder="$tc('general.street_1')"
|
||||
:class="{'invalid': $v.formData.address_street_1.$error }"
|
||||
rows="2"
|
||||
@input="$v.formData.address_street_1.$touch()"
|
||||
/>
|
||||
<div v-if="$v.formData.address_street_1.$error">
|
||||
<span v-if="!$v.formData.address_street_1.maxLength" class="text-danger">{{ $tc('validation.address_maxlength') }}</span>
|
||||
</div>
|
||||
<base-text-area
|
||||
v-model="formData.address_street_2"
|
||||
:placeholder="$tc('general.street_1')"
|
||||
:placeholder="$tc('general.street_2')"
|
||||
:class="{'invalid': $v.formData.address_street_2.$error }"
|
||||
rows="2"
|
||||
@input="$v.formData.address_street_2.$touch()"
|
||||
/>
|
||||
<div v-if="$v.formData.address_street_2.$error">
|
||||
<span v-if="!$v.formData.address_street_2.maxLength" class="text-danger">{{ $tc('validation.address_maxlength') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@ -148,7 +158,7 @@ import ImageBox from '../components/ImageBox.vue'
|
||||
import AvatarCropper from 'vue-avatar-cropper'
|
||||
import { validationMixin } from 'vuelidate'
|
||||
import { mapActions } from 'vuex'
|
||||
const { required, email, numeric } = require('vuelidate/lib/validators')
|
||||
const { required, email, numeric, maxLength } = require('vuelidate/lib/validators')
|
||||
|
||||
export default {
|
||||
components: { AvatarCropper, IconUpload, ImageBox },
|
||||
@ -251,6 +261,12 @@ export default {
|
||||
},
|
||||
phone: {
|
||||
numeric
|
||||
},
|
||||
address_street_1: {
|
||||
maxLength: maxLength(255)
|
||||
},
|
||||
address_street_2: {
|
||||
maxLength: maxLength(255)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user