Patch level : 12.0 no patch
Files correlati : Commento : corretta la get_coddest dei documenti estesi, quando esiste un indirizzo di spedizione.
This commit is contained in:
parent
4c024d3cd6
commit
b73823580b
@ -303,29 +303,31 @@ bool TDocumentoEsteso::get_coddest(TString& coddest, TString& pec) const
|
||||
{
|
||||
const TCli_for & clifo = clifor();
|
||||
|
||||
coddest = clifo.vendite().get(CFV_PADESTIN);
|
||||
pec = clifo.get("PEC");
|
||||
if (coddest.empty())
|
||||
{
|
||||
if (pec.full() || ini_get_bool(CONFIG_DITTA, "fp", "esppri"))
|
||||
coddest = "0000000";
|
||||
// Controllo se è straniero
|
||||
else
|
||||
{
|
||||
const TAnagrafica & anag = clifor().anagrafica_cliente();
|
||||
|
||||
if (anag.estero() && anag.stato_partita_IVA() != "IT")
|
||||
coddest = ini_get_bool(CONFIG_DITTA, "fp", "espest") ? ini_get_string(CONFIG_DITTA, "fp", "espestcod", "XXXXXXX") : "";
|
||||
}
|
||||
}
|
||||
else
|
||||
pec = "";
|
||||
|
||||
const int codindsp = get_int(DOC_CODINDSP);
|
||||
|
||||
if (codindsp > 0)
|
||||
coddest = clifo.indsp(codindsp).get(IND_PADESTIN);
|
||||
|
||||
if (coddest.blank())
|
||||
{
|
||||
coddest = clifo.vendite().get(CFV_PADESTIN);
|
||||
pec = clifo.get("PEC");
|
||||
if (coddest.empty())
|
||||
{
|
||||
if (pec.full() || ini_get_bool(CONFIG_DITTA, "fp", "esppri"))
|
||||
coddest = "0000000";
|
||||
// Controllo se è straniero
|
||||
else
|
||||
{
|
||||
const TAnagrafica & anag = clifor().anagrafica_cliente();
|
||||
|
||||
if (anag.estero() && anag.stato_partita_IVA() != "IT")
|
||||
coddest = ini_get_bool(CONFIG_DITTA, "fp", "espest") ? ini_get_string(CONFIG_DITTA, "fp", "espestcod", "XXXXXXX") : "";
|
||||
}
|
||||
}
|
||||
else
|
||||
pec = "";
|
||||
}
|
||||
|
||||
return coddest.full();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user