Migliorata risoluzione conflitti persone F/G su distinte

git-svn-id: svn://10.65.10.50/branches/R_10_00@23086 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2015-05-15 08:43:54 +00:00
parent 5f9e60b3d7
commit 6fa29e77d4
2 changed files with 19 additions and 9 deletions

View File

@ -954,6 +954,7 @@ bool TVariazione_distinte::impdist_handler(TMask_field& f, KEY key)
if (sf.items() > 1)
{
char tipoa = ' ';
int autodel = -1;
TString8 key;
TLocalisamfile eff(LF_EFFETTI);
FOR_EACH_SHEET_ROW(sf, r, riga) if (riga->get_char(0) != 'X') // riga valida (NON da eliminare)
@ -965,14 +966,25 @@ bool TVariazione_distinte::impdist_handler(TMask_field& f, KEY key)
const long codcf = eff.get_long(EFF_CODCF);
key.format("%c|%ld", tipocf, codcf);
char ta = cache().get(LF_CLIFO, key, CLI_TIPOAPER)[0];
if (ta != 'G') ta = 'F'; // Fisica o giuridica
if (tipoa < 'F') tipoa = ta;
if (ta != 'G') ta = 'F'; // Fisica o giuridica
if (tipoa < 'F') tipoa = ta; // Imposta tipo standard, se ignoto
if (tipoa != ta)
ok = error_box(FR("Tipo anagrafica non valido alla riga %d:\n"
"Non possono coesistere RID relativi a persone Fisiche e Giuridiche"),
r+1);
{
if (autodel != 1)
{
ok = error_box(FR("Tipo anagrafica non valido alla riga %d:\n"
"Non possono coesistere RID relativi a persone Fisiche e Giuridiche"),
r+1);
if (autodel < 0)
autodel = yesno_box("Si desidera impostare l'eliminazione delle righe incompatibili?");
}
if (autodel == 1)
riga->add('X', 0);
}
}
}
if (!ok && autodel)
sf.force_update();
}
}
return ok;
@ -980,9 +992,7 @@ bool TVariazione_distinte::impdist_handler(TMask_field& f, KEY key)
bool TVariazione_distinte::imp_notify(TSheet_field& s, int r, KEY key)
{
if (key == K_DEL || key == K_INS)
return false;
return true;
return !(key == K_DEL || key == K_INS);
}
int ef0300(int argc, char* argv[])

View File

@ -37,7 +37,7 @@ END
ENDPAGE
PAGE "Aggiungi Effetti alla Distinta" -1 -1 78 20
PAGE "Aggiunta Effetti" -1 -1 78 20
DATE F_DADATA
BEGIN