Skip to content

Commit

Permalink
Issue #443: Visualizzazione dei dati di contabilità nel dettaglio del…
Browse files Browse the repository at this point in the history
…la pendenza e gestione codice entrata
  • Loading branch information
atatarelli committed Jan 25, 2022
1 parent 283f7b9 commit 02c62c2
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { ModalBehavior } from '../../../../classes/modal-behavior';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { CronoCode } from '../../../../classes/view/crono-code';
import { StandardCollapse } from '../../../../classes/view/standard-collapse';
import { NewStandardCollapse } from '../../../../classes/view/new-standard-collapse';
import { TwoColsCollapse } from '../../../../classes/view/two-cols-collapse';
import { HttpResponse } from '@angular/common/http';

Expand Down Expand Up @@ -159,7 +160,7 @@ export class PendenzeViewComponent implements IModalDialog, IExport, OnInit {
//Dettaglio importi
this._paymentsSum = 0;
this.importi = _json.voci.map(function(item) {
let _std = new StandardCollapse();
let _std = new NewStandardCollapse();
_std.titolo = new Dato({ value: item.descrizione });
_std.elenco = [];
const lbls: string[] = [];
Expand All @@ -185,9 +186,11 @@ export class PendenzeViewComponent implements IModalDialog, IExport, OnInit {
_std.stato = item.stato;
this._paymentsSum += UtilService.defaultDisplay({ value: item.importo, text: 0 });
let p = new Parameters();
_std.item = item;
_std.item.idDominio = this.json.dominio.idDominio;
p.jsonP = item;
p.model = _std;
p.type = UtilService.STANDARD_COLLAPSE;
p.type = UtilService.NEW_STANDARD_COLLAPSE;
return p;
}, this);
//Note
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { Input, Component, OnInit, AfterViewInit } from '@angular/core';
import { trigger, transition, style, animate } from '@angular/animations';
import { GovpayService } from '../../../../services/govpay.service';
import { UtilService } from '../../../../services/util.service';
import { NewStandardCollapse } from '../../../../classes/view/new-standard-collapse';
import { Voce } from '../../../../services/voce.service';
import { Dato } from '../../../../classes/view/dato';

@Component({
selector: 'link-new-standard-collapse-view',
Expand All @@ -25,7 +27,7 @@ export class NewStandardCollapseViewComponent implements OnInit, AfterViewInit {

_elenco: any[] = [];

constructor(public us: UtilService) {
constructor(public gps: GovpayService, public us: UtilService) {
}

ngOnInit() {
Expand All @@ -38,13 +40,58 @@ export class NewStandardCollapseViewComponent implements OnInit, AfterViewInit {
}

createElenco() {
const vocePendenza = this.info.item.vocePendenza;
const pendenza = vocePendenza.pendenza;
this._elenco.push({ label: Voce.ENTE_CREDITORE, value: `${pendenza.dominio.ragioneSociale} (${pendenza.dominio.idDominio})`, type: 'string' });
this._elenco.push({ label: Voce.DEBITORE, value: `${pendenza.soggettoPagatore.anagrafica} (${pendenza.soggettoPagatore.identificativo})`, type: 'string' });
this._elenco.push({ label: Voce.TIPI_PENDENZA, value: `${pendenza.causale}`, type: 'string' });
this._elenco.push({ label: Voce.QUOTE, value: vocePendenza.contabilita.quote, type: 'quote' });
this._elenco.push({ label: Voce.CONTENUTO_ALLEGATO, value: pendenza.datiAllegati, type: 'allegati' });
const item = this.info.item;
if (item) {
if (item.vocePendenza) { // Riconciliazioni/Pagamenti
const vocePendenza = item.vocePendenza;
const pendenza = vocePendenza.pendenza;
this._elenco.push({ label: Voce.ENTE_CREDITORE, value: `${pendenza.dominio.ragioneSociale} (${pendenza.dominio.idDominio})`, type: 'string' });
this._elenco.push({ label: Voce.DEBITORE, value: `${pendenza.soggettoPagatore.anagrafica} (${pendenza.soggettoPagatore.identificativo})`, type: 'string' });
this._elenco.push({ label: Voce.TIPI_PENDENZA, value: `${pendenza.causale}`, type: 'string' });
if (vocePendenza.contabilita.quote) {
this._elenco.push({ label: Voce.QUOTE, value: vocePendenza.contabilita.quote, type: 'quote' });
}
if (pendenza.datiAllegati) {
this._elenco.push({ label: Voce.CONTENUTO_ALLEGATO, value: pendenza.datiAllegati, type: 'allegati' });
}
} else { // Pendenze/Dettaglio/Importi
if (!item.tipoBollo) {
if (item.codEntrata) {
this._elenco.push({ label: Voce.CODICE_ENTRATA, value: item.codEntrata, type: 'string' });
if (item.idDominio) {
this.getEntrata(item.idDominio, item.codEntrata);
}
} else {
this._elenco.push({ label: Voce.CONTABILITA, value: Dato.concatStrings([item.tipoContabilita, item.codiceContabilita], ', '), type: 'string' });
this._elenco.push({ label: Voce.CONTO_ACCREDITO, value: item.ibanAccredito, type: 'string' });
if (item.contabilita && item.contabilita.quote) {
this._elenco.push({ label: Voce.QUOTE, value: item.contabilita.quote, type: 'quote' });
}
}
}
}
}
}

protected getEntrata(idDominio, ideEntrata) {
// /domini/idDominio/entrate/idEntrata
const _url = UtilService.URL_DOMINI + '/' + UtilService.EncodeURIComponent(idDominio) + '/' + UtilService.ENTRATE + '/' + ideEntrata;
this.gps.getDataService(_url).subscribe(
function (_response) {
this.gps.updateSpinner(false);
if (_response.body) {
const entrata = _response.body;
this._elenco.push({ label: Voce.CONTABILITA, value: Dato.concatStrings([entrata.tipoContabilita, entrata.codiceContabilita], ', '), type: 'string' });
this._elenco.push({ label: Voce.CONTO_ACCREDITO, value: entrata.ibanAccredito, type: 'string' });
if (this.info.item.contabilita && this.info.item.contabilita.quote) {
this._elenco.push({ label: Voce.QUOTE, value: this.info.item.contabilita.quote, type: 'quote' });
}
}
}.bind(this),
(error) => {
this.gps.updateSpinner(false);
this.us.onError(error);
});
}

// protected _hasStato(): boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,15 @@ export class SideListComponent implements OnInit, OnDestroy, IExport {
*/
loadMetadati(service: string = '', query: string = '') {
service = (service || this.rsc.fullPath); // ROUTING - fullPath
this.__waitForMeta();
// this.__waitForMeta();
let _query: string = this.__setupQueryForMeta(service, query);
if(!this._isLoadingMeta) {
this._isLoadingMeta = true;
this.gps.getDataServiceBkg(service, _query).subscribe(
(_response) => {
this._lastMetaResponse = _response.body;
this._isLoadingMeta = false;
this.__waitForMeta(true);
// this.__waitForMeta(true);
},
(error) => {
this._isLoadingMeta = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export class Voce {
public static CODICE_INTERBANCARIO: string = 'Codice interbancario';
public static CODICE_IPA: string = 'Codice IPA';
public static CODICE_CLIENTE: string = 'Codice cliente';
public static CODICE_ENTRATA: string = 'Codice entrata';
public static CODICE_ISTITUTO: string = 'Codice istituto';
public static COMMISSIONI: string = 'Commissioni';
public static CONFIGURAZIONE_SSL: string = 'Configurazione SSL';
Expand Down Expand Up @@ -216,7 +217,7 @@ export class Voce {
public static PROMEMORIA_SCADENZA_PAGAMENTO: string = 'Promemoria scadenza pagamento';
public static PROVINCIA: string = 'Provincia';
public static PSP: string = 'Psp';

public static QUOTE: string = 'Quote';

public static RAGIONE_SOCIALE: string = 'Ragione sociale';
Expand Down

0 comments on commit 02c62c2

Please sign in to comment.