Patch level : 12.0 782

Files correlati     : fplib
Commento            : Corretta esportazione banca appoggio/presentazione per fe
This commit is contained in:
Simone Palacino 2019-05-03 10:38:00 +02:00
parent bdd8dedadd
commit 058567f8e3

View File

@ -720,29 +720,7 @@ bool TDoc_fp::get_bank_presentazione(const TDocumento& doc, TString& iban, TStri
found = abi.full() && cab.full();
if (found)
get_bnp_iban(abi, cab, prg, iban);
if (!found) // Se non trovo banca su CFBAN la cerco su CFVEN
{
const TRectype& cfven = doc.clifor().vendite();
abi = cfven.get(CFV_CODABIPR);
cab = cfven.get(CFV_CODCABPR);
found = abi.full() && cab.full();
if (found)
get_bnp_iban(abi, cab, 0, iban);
}
if (found)
istituto = cache().get("%BAN", abi, "S0");
return found;
}
bool TDoc_fp::get_bank_appoggio(const TDocumento& doc, TString& iban, TString& abi, TString& cab,
TString& istituto) const
{
bool found = false;
abi = doc.get(DOC_CODABIA);
cab = doc.get(DOC_CODCABA);
iban = doc.get(DOC_IBAN);
found = iban.full();
if (!found) // Se non trovo banca sul DOC la cerco su CFBAN
else // Se non trovo banca sul DOC la cerco su CFBAN
{
TToken_string key;
key.add("C");
@ -760,11 +738,50 @@ bool TDoc_fp::get_bank_appoggio(const TDocumento& doc, TString& iban, TString& a
get_bnp_iban(abi, cab, -1, iban);
}
}
if(!found) // Se non trovo banca su CFBAN la cerco su CFVEN
{
const TRectype& cfven = doc.clifor().vendite();
abi = cfven.get(CFV_CODABIPR);
cab = cfven.get(CFV_CODCABPR);
found = abi.full() && cab.full();
if (found)
get_bnp_iban(abi, cab, 0, iban);
}
if (found)
istituto = cache().get("%BAN", abi, "S0");
return found;
}
bool TDoc_fp::get_bank_appoggio(const TDocumento& doc, TString& iban, TString& abi, TString& cab,
TString& istituto) const
{
abi = doc.get(DOC_CODABIA);
cab = doc.get(DOC_CODCABA);
iban = doc.get(DOC_IBAN);
bool found = abi.full() && cab.full();
if (found)
istituto = cache().get("%BAN", abi, "S0");
if(iban.empty())
{
TToken_string key;
key.add("C");
key.add(doc.codcf());
key.add("V");
key.add(1);
const TRectype& cfban = cache().get(LF_CFBAN, key);
if (!cfban.empty())
{
const TString& abi_cf = cfban.get(CFBAN_ABI);
const TString& cab_cf = cfban.get(CFBAN_CAB);
const bool found_cf = abi_cf.full() && cab_cf.full();
iban = cfban.get(CFBAN_IBAN);
if (found_cf && iban.blank())
get_bnp_iban(abi_cf, cab_cf, -1, iban);
}
}
return found;
}
const TString& TDoc_fp::descrizione(const TRiga_documento& rdoc)
{
if (rdoc.get_bool(RDOC_DESCLUNGA))