Patch level : aga 1.7 566
Files correlati : Ricompilazione Demo : [ ] Commento : Corretto errore GF20089 RICEZIONE ANAGRAFICA CLIENTI FORNITORI: Se nellla località c'é COLZATE viene trasferito nel campo Comune come COLERE vedere cli 00031 E così anche per queste località: MORNICO viene trasferito come MORENGO VILA D'OGNA viene trasferito come VILLA DI SERIO git-svn-id: svn://10.65.10.50/trunk@11417 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
b6cd17add9
commit
c65c101060
@ -5,6 +5,7 @@
|
||||
#include <extcdecl.h>
|
||||
#include <prefix.h>
|
||||
#include <progind.h>
|
||||
#include <relation.h>
|
||||
#include <scanner.h>
|
||||
#include <tabutil.h>
|
||||
#include <utility.h>
|
||||
@ -1026,46 +1027,38 @@ const char* TTransfer_file::numero_civico(TString& indirizzo)
|
||||
|
||||
const char* TTransfer_file::cerca_comune_cap(const TString& field, const TString& localita)
|
||||
{
|
||||
const TString80 dencom = localita;
|
||||
TString16 cap = field;
|
||||
|
||||
bool trovato = FALSE;
|
||||
bool prima_volta = TRUE;
|
||||
TEMP.cut(0);
|
||||
|
||||
const TString80 dencom(localita);
|
||||
TString16 cap(field);
|
||||
|
||||
TEMP.cut(0);
|
||||
if (cap[2] == '1')
|
||||
{
|
||||
cap.cut(3);
|
||||
cap << "00";
|
||||
}
|
||||
|
||||
TLocalisamfile comuni (LF_COMUNI);
|
||||
comuni.setkey(3);
|
||||
comuni.zero();
|
||||
comuni.put(COM_CAPCOM, cap);
|
||||
const TRectype com(comuni.curr());
|
||||
TRelation relcom(LF_COMUNI);
|
||||
TRectype & comrec = relcom.curr();
|
||||
|
||||
comrec.put(COM_CAPCOM, cap);
|
||||
|
||||
int maxlen = 0;
|
||||
TCursor comuni (&relcom, "", 3, &comrec, &comrec);
|
||||
const TRecnotype items = comuni.items();
|
||||
|
||||
for (comuni.read(_isgteq); !comuni.eof(); comuni.next())
|
||||
comuni.freeze();
|
||||
for (comuni = 0L; comuni.pos() < items; ++comuni)
|
||||
{
|
||||
if (comuni.curr() != com) break;
|
||||
|
||||
TString80 denominazione = comuni.get(COM_DENCOM);
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
if (dencom[i] == denominazione[i])
|
||||
trovato = TRUE;
|
||||
else
|
||||
{
|
||||
trovato = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!trovato)
|
||||
continue;
|
||||
else
|
||||
{
|
||||
TEMP = comuni.get(COM_COM);
|
||||
break;
|
||||
const TString & denominazione = comrec.get(COM_DENCOM);
|
||||
int i = 0;
|
||||
|
||||
for (i = 0; dencom[i] && dencom[i] == denominazione[i]; i++);
|
||||
|
||||
if (maxlen < i)
|
||||
{
|
||||
maxlen = i;
|
||||
if (maxlen > 2)
|
||||
TEMP = comrec.get(COM_COM);
|
||||
}
|
||||
}
|
||||
return TEMP;
|
||||
|
Loading…
x
Reference in New Issue
Block a user