Patch level : 4.0 642

Ricompilazione Demo : [ ]
Commento            :

Applicata la trasfromazione del conto per le fatture da fatt. da ric. o emettere anche incontabilizzazione analitica


git-svn-id: svn://10.65.10.50/trunk@14975 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2007-03-01 15:25:54 +00:00
parent cee65844db
commit dde4ad4034

View File

@ -288,7 +288,41 @@ bool TContabilizzazione_analitica::search_costo_ricavo(const TRiga_documento& r,
default :
break;
} // end of switch
if (conto.ok())
{
const TRectype * rdoc = r.find_original_rdoc();
if (rdoc != NULL && rdoc->get(RDOC_PROVV).not_empty())
{
TString80 key(rdoc->get(RDOC_CODNUM));
const TCodice_numerazione& num = TDocumento::codice_numerazione(key);
if (num.fattura_emettere_ricevere())
{
key.format("%3d%3d%6ld", conto.gruppo(), conto.conto(), conto.sottoconto());
const TRectype* rs = &cache().get("MRE", key);
if (rs->empty())
{
key.cut(6);
rs = &cache().get("MRE", key);
if (rs->empty())
{
key.cut(3);
rs = &cache().get("MRE", key);
}
}
if (!rs->empty())
{
const int gr = rs->get_int("I0");
const int co = rs->get_int("I1");
const long so = rs->get_int("I2");
const char tipo = rs->get_char("S6");
conto.set(gr, co, so, tipo);
}
}
}
}
return conto.ok() && conto.find();
}