From a3f4671cc318b18e3e1b7f1ffec05e772a537bc6 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 9 Mar 2012 15:51:40 +0000 Subject: [PATCH] Patch level : 10.0 Files correlati : fe0 Ricompilazione Demo : [ ] Commento : Migliorato riconoscimento note di variazione git-svn-id: svn://10.65.10.50/branches/R_10_00@22609 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- fe/felib.cpp | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/fe/felib.cpp b/fe/felib.cpp index ee50dab0f..e645ada71 100644 --- a/fe/felib.cpp +++ b/fe/felib.cpp @@ -39,22 +39,35 @@ bool fe_is_nota_variazione(const TRectype& mov) const int tipomov = mov.get_int(MOV_TIPOMOV); if (tipomov == 2) // Nota di credito/debito per saldaconto - return true; + return true; - const TString& tipodoc = mov.get(MOV_TIPODOC); - if (tipodoc == "NC" || tipodoc == "ND") // Nota di credito/debito senza saldaconto - return true; + if (tipomov <= 1) + { + const TString& tipodoc = mov.get(MOV_TIPODOC); + if (tipodoc == "NC" || tipodoc == "ND") // Nota di credito/debito senza saldaconto + return true; + } } else if (logicnum == LF_ALLEG) { - const TString& numrett = mov.get(ALL_NUMRETT); - if (numrett.full()) + if (mov.get_int(ALL_MODPAG) > 1) + return false; + + if (mov.get(ALL_NUMRETT).full() || mov.get(ALL_DATARETT).full()) return true; const real importo = mov.get_real(ALL_IMPORTO); const real imposta = mov.get_real(ALL_IMPOSTA); if (importo < ZERO || imposta < ZERO) return true; + + const long numreg = mov.get_long(ALL_PROGR); + if (numreg < 900000L) + { + const TRectype& pn = cache().get(LF_MOV, numreg); + if (!pn.empty()) + return fe_is_nota_variazione(pn); + } } else if (logicnum == LF_DOC) {