Patch level : 10.0

Files correlati     : fe0.exe fetbcon.msk
Ricompilazione Demo : [ ]
Commento            :
Aggiunto controllo per evitare loop nella gerarchia dei contratti


git-svn-id: svn://10.65.10.50/branches/R_10_00@22547 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2012-01-13 12:09:16 +00:00
parent e2adc60990
commit b9356d7447
2 changed files with 16 additions and 14 deletions

View File

@ -201,15 +201,20 @@ int TContratto::modalita_pagamento() const
const TString& TContratto::codice_base() const const TString& TContratto::codice_base() const
{ {
TString80 c = codice(); TString80 c = codice(), p = codice_padre();
TString80 p = codice_padre(); if (p.full())
while (p.full()) {
TAssoc_array antiloop;
antiloop.add(c);
while (p.full() && !antiloop.is_key(p)) // Verifico loop assurdo
{ {
c = p; c = p;
antiloop.add(c);
TString80 key = chiave().left(7); TString80 key = chiave().left(7);
key << p; key << p;
p = cache().get("&CON", key, "S1"); p = cache().get("&CON", key, "S1");
} }
}
return get_tmp_string() = c; return get_tmp_string() = c;
} }
@ -398,11 +403,6 @@ TExclusion_mode TDati_rilevanti_array::add(const TRectype& alleg, bool send_all,
if (!send_all && ignora != em_incluso) if (!send_all && ignora != em_incluso)
return ignora; return ignora;
#ifdef DBG
if (alleg.get_long(ALL_CODCF) == 36)
int cazzone = 1;
#endif
// Creo un nuovo record // Creo un nuovo record
_data.add(alleg); _data.add(alleg);
return em_incluso; return em_incluso;
@ -468,13 +468,13 @@ void TDati_rilevanti_array::add(TArray& fatture, TArray& note, bool send_all, TL
} }
// Aggiunge fatture // Aggiunge fatture
FOR_EACH_ARRAY_ITEM(fatture, f, pfatt) FOR_EACH_ARRAY_ITEM(fatture, nf, pfatt)
{ {
const TRectype& fatt = *(const TRectype*)pfatt; const TRectype& fatt = *(const TRectype*)pfatt;
add(fatt, send_all, log); add(fatt, send_all, log);
} }
// Aggiunge note // Aggiunge note
FOR_EACH_ARRAY_ITEM(note, n, pnot) FOR_EACH_ARRAY_ITEM(note, nn, pnot)
{ {
const TRectype& nota = *(const TRectype*)pnot; const TRectype& nota = *(const TRectype*)pnot;
add(nota, send_all, log); add(nota, send_all, log);

View File

@ -101,6 +101,8 @@ BEGIN
OUTPUT F_CON_PADRE CODTAB[8,] OUTPUT F_CON_PADRE CODTAB[8,]
//OUTPUT F_CON_DESPADRE S0 //OUTPUT F_CON_DESPADRE S0
CHECKTYPE NORMAL CHECKTYPE NORMAL
STR_EXPR #F_CON_PADRE!=#F_CON_CONTRATTO
WARNING "Il codice del contratto principale deve essere diverso!"
END END
GROUPBOX DLG_NULL 78 3 GROUPBOX DLG_NULL 78 3