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 <extcdecl.h>
|
||||||
#include <prefix.h>
|
#include <prefix.h>
|
||||||
#include <progind.h>
|
#include <progind.h>
|
||||||
|
#include <relation.h>
|
||||||
#include <scanner.h>
|
#include <scanner.h>
|
||||||
#include <tabutil.h>
|
#include <tabutil.h>
|
||||||
#include <utility.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 char* TTransfer_file::cerca_comune_cap(const TString& field, const TString& localita)
|
||||||
{
|
{
|
||||||
const TString80 dencom = localita;
|
const TString80 dencom(localita);
|
||||||
TString16 cap = field;
|
TString16 cap(field);
|
||||||
|
|
||||||
bool trovato = FALSE;
|
TEMP.cut(0);
|
||||||
bool prima_volta = TRUE;
|
|
||||||
TEMP.cut(0);
|
|
||||||
|
|
||||||
if (cap[2] == '1')
|
if (cap[2] == '1')
|
||||||
{
|
{
|
||||||
cap.cut(3);
|
cap.cut(3);
|
||||||
cap << "00";
|
cap << "00";
|
||||||
}
|
}
|
||||||
|
|
||||||
TLocalisamfile comuni (LF_COMUNI);
|
TRelation relcom(LF_COMUNI);
|
||||||
comuni.setkey(3);
|
TRectype & comrec = relcom.curr();
|
||||||
comuni.zero();
|
|
||||||
comuni.put(COM_CAPCOM, cap);
|
comrec.put(COM_CAPCOM, cap);
|
||||||
const TRectype com(comuni.curr());
|
|
||||||
|
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;
|
const TString & denominazione = comrec.get(COM_DENCOM);
|
||||||
|
int i = 0;
|
||||||
TString80 denominazione = comuni.get(COM_DENCOM);
|
|
||||||
for (int i = 0; i < 3; i++)
|
for (i = 0; dencom[i] && dencom[i] == denominazione[i]; i++);
|
||||||
{
|
|
||||||
if (dencom[i] == denominazione[i])
|
if (maxlen < i)
|
||||||
trovato = TRUE;
|
{
|
||||||
else
|
maxlen = i;
|
||||||
{
|
if (maxlen > 2)
|
||||||
trovato = FALSE;
|
TEMP = comrec.get(COM_COM);
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!trovato)
|
|
||||||
continue;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
TEMP = comuni.get(COM_COM);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TEMP;
|
return TEMP;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user