Patch level : 12.0

Files correlati     : fplib01.cpp
Commento:

Aggiunte:
-Gestione Esigibilità IVA (Immediata, differita). Il flag è nella maschera di prima nota

Corretto:
-Sistemati i dati di riepilogo iva che in caso di invio provvisorio venivano riportati doppi
-Sistemato il campo PW_UPAG del PAFW0300. Non veniva valorizzato al valore di default
This commit is contained in:
smen 2022-07-19 12:17:56 +02:00
parent 8f32812816
commit 10e9a762d8

View File

@ -2889,6 +2889,7 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
else else
pafw300f.set("PW_RAGSOC", cliente.ragione_sociale().left(35)); pafw300f.set("PW_RAGSOC", cliente.ragione_sociale().left(35));
pafw300f.set("PW_IMPO", converti_prezzo(doc.totale_doc())); pafw300f.set("PW_IMPO", converti_prezzo(doc.totale_doc()));
pafw300f.set("PW_UPAG", "");
ok &= insert(pafw300f); ok &= insert(pafw300f);
return _to_commit = (ok && save_paf()); return _to_commit = (ok && save_paf());
} }
@ -3244,6 +3245,7 @@ bool TReg_fp::add_riepilogo_iva(const TMovimento_contabile & mov, int n_riga)
const TString16 cod_aliquota = rec_iva.get(RMI_CODIVA); const TString16 cod_aliquota = rec_iva.get(RMI_CODIVA);
const TCodiceIVA& cod_iva= cached_codIVA(cod_aliquota); const TCodiceIVA& cod_iva= cached_codIVA(cod_aliquota);
const real aliquota = cod_iva.percentuale(); const real aliquota = cod_iva.percentuale();
const char * eiva = get_esigibilita_iva(mov);
// Aliquota // Aliquota
paf2200f.set("PL_ALIQUOTAIVA", aliquota); paf2200f.set("PL_ALIQUOTAIVA", aliquota);
@ -3255,13 +3257,12 @@ bool TReg_fp::add_riepilogo_iva(const TMovimento_contabile & mov, int n_riga)
// Imposta // Imposta
paf2200f.set("PL_IMPOSTA", rec_iva.get(RMI_IMPOSTA)); paf2200f.set("PL_IMPOSTA", rec_iva.get(RMI_IMPOSTA));
// Esigibilit IVA // Esigibilit IVA
paf2200f.set("PL_ESIGIVA", ""); // TODO va compilato ??? paf2200f.set("PL_ESIGIVA", eiva);
paf2200f.set("PL_RIFNORMATIVO", cod_iva.descrizione()); paf2200f.set("PL_RIFNORMATIVO", cod_iva.descrizione());
paf2200f.set("PL_GESTIONE", stato_paf());
// Inserisco // Inserisco
return insert(paf2200f, true); return insert(paf2200f);
} }
bool TReg_fp::export_paf0100f() bool TReg_fp::export_paf0100f()
@ -3359,7 +3360,7 @@ bool TReg_fp::reg_to_paf(const TMovimento_contabile& mov)
paf0200f.set("P2_FISCIVAPAESE", fornitore.stato_partita_IVA()); paf0200f.set("P2_FISCIVAPAESE", fornitore.stato_partita_IVA());
paf0200f.set("P2_FISCIVACOD", fornitore.partita_IVA()); paf0200f.set("P2_FISCIVACOD", fornitore.partita_IVA());
} }
paf0200f.set("P2_CODFISCALE", fornitore.codice_fiscale()); // paf0200f.set("P2_CODFISCALE", fornitore.codice_fiscale());
const bool df = _ditta.fisica(); const bool df = _ditta.fisica();
@ -3368,32 +3369,31 @@ bool TReg_fp::reg_to_paf(const TMovimento_contabile& mov)
TString forn_n = fornitore.nome(); TString forn_n = fornitore.nome();
TString forn_c = fornitore.cognome(); TString forn_c = fornitore.cognome();
paf0200f.set("P2_ANANOME", fornitore.nome()); // paf0200f.set("P2_ANANOME", fornitore.nome());
paf0200f.set("P2_ANACOGNOME", fornitore.cognome()); // paf0200f.set("P2_ANACOGNOME", fornitore.cognome());
} }
else else
{ {
paf0200f.set("P2_ANADENOMIN", fornitore.ragione_sociale()); // paf0200f.set("P2_ANADENOMIN", fornitore.ragione_sociale());
} }
paf0200f.set("P2_ANACODEORI", fornitore.cod_EORI()); paf0200f.set("P2_ANACODEORI", fornitore.cod_EORI());
paf0200f.set("P2_REGFISCALE", _regfisc); //TODO DA RF01 A RF09 paf0200f.set("P2_REGFISCALE", _regfisc); //TODO DA RF01 A RF09
// DatiSede // DatiSede
paf0200f.set("P2_SEDEIND", fornitore.via_residenza()); // paf0200f.set("P2_SEDEIND", fornitore.via_residenza());
paf0200f.set("P2_SEDENRCIVICO", fornitore.civico_residenza().left(8)); // paf0200f.set("P2_SEDENRCIVICO", fornitore.civico_residenza().left(8));
paf0200f.set("P2_SEDECOMUNE", fornitore.comune_residenza()); // paf0200f.set("P2_SEDECOMUNE", fornitore.comune_residenza());
paf0200f.set("P2_SEDENAZ", fornitore.stato_residenza_ISO()); // paf0200f.set("P2_SEDENAZ", fornitore.stato_residenza_ISO());
//paf0200f.set("P2_GESTIONE", stato_paf());
// I clienti esteri possono avere CAP alfanumerici, li tolgo // I clienti esteri possono avere CAP alfanumerici, li tolgo
if (fornitore.stato_residenza_ISO() != "IT") if (fornitore.stato_residenza_ISO() != "IT")
{ {
paf0200f.set("P2_SEDECAP", "00000");// paf0200f.set("P2_SEDECAP", "00000");
} }
else else
{ {
paf0200f.set("P2_SEDECAP", fornitore.CAP_residenza()); // paf0200f.set("P2_SEDECAP", fornitore.CAP_residenza());
paf0200f.set("P2_SEDEPROV", fornitore.provincia_residenza()); // paf0200f.set("P2_SEDEPROV", fornitore.provincia_residenza());
} }
} }
@ -3427,11 +3427,11 @@ bool TReg_fp::reg_to_paf(const TMovimento_contabile& mov)
if (piva.full()) if (piva.full())
{ {
paf0400f.set("P4_FISCIVAPAESE", stato); // paf0400f.set("P4_FISCIVAPAESE", stato);
paf0400f.set("P4_FISCIVACOD", piva); // paf0400f.set("P4_FISCIVACOD", piva);
} }
if (fisc.full()) if (fisc.full())
paf0400f.set("P4_CODFISC", fisc); // paf0400f.set("P4_CODFISC", fisc);
} }
else // Cliente EXTRA-EU sempre nel campo della partita iva sui paf else // Cliente EXTRA-EU sempre nel campo della partita iva sui paf
{ {
@ -3444,12 +3444,12 @@ bool TReg_fp::reg_to_paf(const TMovimento_contabile& mov)
if (_ditta.fisica() && _ditta.nome().full()) if (_ditta.fisica() && _ditta.nome().full())
{ {
paf0400f.set("P4_ANANOME", _ditta.nome()); // paf0400f.set("P4_ANANOME", _ditta.nome());
paf0400f.set("P4_ANACOGNOME", _ditta.cognome()); // paf0400f.set("P4_ANACOGNOME", _ditta.cognome());
} }
else else
{ {
paf0400f.set("P4_ANADENOM", _ditta.ragione_sociale()); // paf0400f.set("P4_ANADENOM", _ditta.ragione_sociale());
} }
// DatiSede // DatiSede
paf0400f.set("P4_SEDEIND", _ditta.via_residenza()); paf0400f.set("P4_SEDEIND", _ditta.via_residenza());
@ -3613,6 +3613,7 @@ bool TReg_fp::reg_to_paf(const TMovimento_contabile& mov)
else else
pafw300f.set("PW_RAGSOC", fornitore.ragione_sociale().left(35)); pafw300f.set("PW_RAGSOC", fornitore.ragione_sociale().left(35));
pafw300f.set("PW_IMPO", mov.get_real(MOV_TOTDOC)); //TODO controllare ????? pafw300f.set("PW_IMPO", mov.get_real(MOV_TOTDOC)); //TODO controllare ?????
pafw300f.set("PW_UPAG", "");
ok &= insert(pafw300f); ok &= insert(pafw300f);
return _to_commit = (ok && save_paf()); return _to_commit = (ok && save_paf());
} }