Patch level : 12.0 672

Files correlati     : fp
Commento            : Sistemato controllo codice sdi con aggiunta per stranieri con P.IVA italiana
This commit is contained in:
Mattia Tollari 2019-01-14 14:41:52 +01:00
parent c41e7d9d8b
commit fda14eeddd

View File

@ -177,16 +177,19 @@ bool get_coddest(const char tipocf, const long codcf, TString& coddest, TString&
TCli_for clifo(tipocf, codcf); TCli_for clifo(tipocf, codcf);
coddest = clifo.vendite().get("PADESTIN"); coddest = clifo.vendite().get("PADESTIN");
pec = clifo.get("PEC"); pec = clifo.get("PEC");
TAnagrafica anag(LF_CLIFO, tipocf, codcf);
if (coddest.empty()) if (coddest.empty())
{ {
if(pec.full() || fp_settings().get_esp_pri_empty()) if (pec.full() || fp_settings().get_esp_pri_empty())
coddest = "0000000"; coddest = "0000000";
// Controllo se è straniero // Controllo se è straniero
else if (TAnagrafica(LF_CLIFO, tipocf, codcf).estero() && fp_settings().get_esp_est()) else if (anag.estero() && anag.stato_partita_IVA() != "IT")
{ {
coddest = fp_settings().get_esp_est_cod(); coddest = fp_settings().get_esp_est() ? fp_settings().get_esp_est_cod() : "";
} }
} }
else
pec = "";
// Dopo la versione 1.2 torna sempre true // Dopo la versione 1.2 torna sempre true
return coddest.full(); return coddest.full();
} }