feat: all clients just with global series
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Javi Gallego 2024-10-02 16:37:58 +02:00
parent 6d08875809
commit 789e70b7a8
4 changed files with 13 additions and 2 deletions

View File

@ -607,6 +607,7 @@ invoiceOut:
invoiceWithFutureDate: Exists an invoice with a future date invoiceWithFutureDate: Exists an invoice with a future date
noTicketsToInvoice: There are not tickets to invoice noTicketsToInvoice: There are not tickets to invoice
criticalInvoiceError: 'Critical invoicing error, process stopped' criticalInvoiceError: 'Critical invoicing error, process stopped'
invalidSerialTypeForAll: The serial type must be global when invoicing all clients
table: table:
client: Client client: Client
addressId: Address id addressId: Address id

View File

@ -616,6 +616,7 @@ invoiceOut:
invoiceWithFutureDate: Existe una factura con una fecha futura invoiceWithFutureDate: Existe una factura con una fecha futura
noTicketsToInvoice: No existen tickets para facturar noTicketsToInvoice: No existen tickets para facturar
criticalInvoiceError: Error crítico en la facturación proceso detenido criticalInvoiceError: Error crítico en la facturación proceso detenido
invalidSerialTypeForAll: El tipo de serie debe ser global cuando se facturan todos los clientes
table: table:
client: Cliente client: Cliente
addressId: Id dirección addressId: Id dirección

View File

@ -184,7 +184,7 @@ onMounted(async () => {
<i18n> <i18n>
en: en:
invoiceDate: Invoice date invoiceDate: Invoice date
maxShipped: Max date maxShipped: Max date ticket
allClients: All clients allClients: All clients
oneClient: One client oneClient: One client
company: Company company: Company
@ -196,7 +196,7 @@ en:
es: es:
invoiceDate: Fecha de factura invoiceDate: Fecha de factura
maxShipped: Fecha límite maxShipped: Fecha límite ticket
allClients: Todos los clientes allClients: Todos los clientes
oneClient: Un solo cliente oneClient: Un solo cliente
company: Empresa company: Empresa

View File

@ -161,6 +161,15 @@ export const useInvoiceOutGlobalStore = defineStore({
); );
throw new Error('Invalid Serial Type'); throw new Error('Invalid Serial Type');
} }
if (clientsToInvoice === 'all' && params.serialType !== 'global') {
notify(
'invoiceOut.globalInvoices.errors.invalidSerialTypeForAll',
'negative'
);
throw new Error('For "all" clients, the serialType must be "global"');
}
if (!params.companyFk) { if (!params.companyFk) {
notify('invoiceOut.globalInvoices.errors.chooseValidCompany', 'negative'); notify('invoiceOut.globalInvoices.errors.chooseValidCompany', 'negative');
throw new Error('Invalid company'); throw new Error('Invalid company');