feat: update message while globalInvoicing
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Vicent Llopis 2022-10-11 10:04:13 +02:00
parent 4f5abb709a
commit 53f78a98d2
3 changed files with 11 additions and 14 deletions

View File

@ -19,9 +19,7 @@
ng-if="$ctrl.isInvoicing">
<vn-horizontal>
<vn-icon vn-none icon="warning"></vn-icon>
<span vn-none translate>Adding invoices to queue...</span>
{{$ctrl.lastClientId}}
<span translate>{{::$ctrl.lastClientId || 'Vacío'}}</span>
{{$ctrl.currentClientId}} {{$ctrl.$t('of')}} {{$ctrl.lastClientId}}
</vn-horizontal>
</div>
<vn-horizontal>

View File

@ -57,19 +57,17 @@ class Controller extends Dialog {
if (!this.invoice.fromClientId)
throw new Error('Choose a valid clients range');
this.isInvoicing = true;
return this.$http.post(`InvoiceOuts/clientToInvoice`, this.invoice)
.then(res => {
.then(async res => {
this.lastClientId = res.data[res.data.length - 1];
console.log(this.lastClientId);
this.isInvoicing = true;
for (let clientId of res.data) {
this.currentClientId = clientId;
const params = {clientId: clientId};
await this.$http.post(`InvoiceOuts/globalInvoicing`, params);
}
})
// .then(() => {
// for (let clientId of res.data) {
// const params = {clientId: clientId};
// this.$http.post(`InvoiceOuts/globalInvoicing`, params);
// }
// })
// .then(() => super.responseHandler(response))
.then(() => super.responseHandler(response))
.then(() => this.vnApp.showSuccess(this.$t('Data saved!')))
.finally(() => this.isInvoicing = false);
} catch (e) {

View File

@ -6,4 +6,5 @@ Invoice date: Fecha de factura
From client: Desde el cliente
To client: Hasta el cliente
Invoice date and the max date should be filled: La fecha de factura y la fecha límite deben rellenarse
Choose a valid clients range: Selecciona un rango válido de clientes
Choose a valid clients range: Selecciona un rango válido de clientes
of: de