From dde4ad40347b422957b390879b1a94a64796274a Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 1 Mar 2007 15:25:54 +0000 Subject: [PATCH] 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 --- ve/velib04f.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/ve/velib04f.cpp b/ve/velib04f.cpp index df529005a..d10a066af 100755 --- a/ve/velib04f.cpp +++ b/ve/velib04f.cpp @@ -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(); }