Correzioni agli invii e ricezioni
git-svn-id: svn://10.65.10.50/trunk@1421 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
4b76c80d5f
commit
9241f8a5fa
1193
cg/cg2400.cpp
1193
cg/cg2400.cpp
File diff suppressed because it is too large
Load Diff
369
cg/cg2600.cpp
369
cg/cg2600.cpp
@ -19,6 +19,7 @@
|
||||
#include <rmoviva.h>
|
||||
#include <pconti.h>
|
||||
#include <comuni.h>
|
||||
#include <clifo.h>
|
||||
|
||||
#include "cglib04.h"
|
||||
#include "cglib.h"
|
||||
@ -35,6 +36,7 @@ class TRic_tab : public TApplication
|
||||
{
|
||||
|
||||
TTable* _tab_tra;
|
||||
TLocalisamfile* _mov, *_rmov, *_rmoviva;
|
||||
TTransfer_file _tras_file;
|
||||
TArray _aggiorna;
|
||||
char _scelta;
|
||||
@ -67,24 +69,29 @@ public:
|
||||
|
||||
void setta_parametri_record(const TString& sigla,const TString& flag);
|
||||
|
||||
const char* numero_civico(TString& field);
|
||||
const char* cerca_comune_cap(TString& field);
|
||||
const char* cerca_comune_den(TString& field);
|
||||
|
||||
void trasferimento();
|
||||
|
||||
void scrivi_record_tab(TString& record,long rec);
|
||||
int trasfer_data_tab(TLocalisamfile& file, TRectype& dep, const TString& sigla);
|
||||
int trasfer_data_conto(TLocalisamfile& file, TRectype& dep);
|
||||
int trasfer_data_sottoc(TLocalisamfile& file, TRectype& dep);
|
||||
void decimali(TString& campo, int dec);
|
||||
|
||||
void scrivi_record_mov(TString& record,long rec);
|
||||
int trasfer_data_mov(TLocalisamfile& file, TRectype& dep);
|
||||
long esiste_numreg(long nreg);
|
||||
void num_protocollo(TString& record);
|
||||
void controlli_prima_nota(TString& record);
|
||||
long ulnumprot_reg(int anno,char codreg);
|
||||
void controlli_prima_nota(TString& record,TString& codreg);
|
||||
long ulnumprot_reg(int anno,TString& codreg);
|
||||
long ultima_registrazione();
|
||||
void aggiorna_reg(int anno,char codreg,long ulnum);
|
||||
void aggiorna_reg(int anno,TString& codreg,long ulnum);
|
||||
int annoes_datacomp(const TString& record,TDate& datacomp);
|
||||
void datafine_esprec(const int annop,TDate& datacomp);
|
||||
char ricerca_causale(const TString& field);
|
||||
char ricerca_causale(TString& field);
|
||||
void prepara_saldi(const TString& fname,const TString& field);
|
||||
|
||||
void scrivi_record_moviva(TString& record,long rec);
|
||||
@ -121,6 +128,9 @@ bool TRic_tab::create()
|
||||
TApplication::create();
|
||||
|
||||
_tab_tra = new TTable ("%TRA");
|
||||
_mov = new TLocalisamfile (LF_MOV);
|
||||
_rmov = new TLocalisamfile (LF_RMOV);
|
||||
_rmoviva = new TLocalisamfile (LF_RMOVIVA);
|
||||
|
||||
_numrec = 1;
|
||||
_prima_volta = TRUE;
|
||||
@ -137,7 +147,10 @@ bool TRic_tab::create()
|
||||
|
||||
bool TRic_tab::destroy()
|
||||
{
|
||||
delete _tab_tra;
|
||||
delete _tab_tra;
|
||||
delete _mov;
|
||||
delete _rmov;
|
||||
delete _rmoviva;
|
||||
|
||||
return TApplication::destroy();
|
||||
}
|
||||
@ -180,6 +193,60 @@ const char* TRic_tab::riconverti (TString& data_PC)
|
||||
return TEMP;
|
||||
}
|
||||
|
||||
const char* TRic_tab::numero_civico(TString& indirizzo)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = indirizzo.len(); (indirizzo[i] != ' ' && indirizzo[i] != ',' && i > 0); i--);
|
||||
|
||||
if (i > 0)
|
||||
{
|
||||
TEMP = indirizzo.mid(i+1);
|
||||
indirizzo = indirizzo.sub(0,i);
|
||||
}
|
||||
else
|
||||
TEMP = "";
|
||||
|
||||
return TEMP;
|
||||
}
|
||||
|
||||
const char* TRic_tab::cerca_comune_cap(TString& field)
|
||||
{
|
||||
TLocalisamfile comuni (LF_COMUNI);
|
||||
TString cap = field;
|
||||
|
||||
if (cap.sub(2,3) == "1")
|
||||
{
|
||||
cap = cap.sub(0,3);
|
||||
cap << "00";
|
||||
}
|
||||
|
||||
comuni.setkey(3);
|
||||
comuni.zero();
|
||||
comuni.put(COM_CAPCOM, cap);
|
||||
if (comuni.read() == NOERR)
|
||||
TEMP = comuni.get(COM_COM);
|
||||
else
|
||||
TEMP = "";
|
||||
|
||||
return TEMP;
|
||||
}
|
||||
|
||||
const char* TRic_tab::cerca_comune_den(TString& field)
|
||||
{
|
||||
TLocalisamfile comuni (LF_COMUNI);
|
||||
|
||||
comuni.setkey(2);
|
||||
comuni.zero();
|
||||
comuni.put(COM_DENCOM, field);
|
||||
if (comuni.read() == NOERR)
|
||||
TEMP = comuni.get(COM_COM);
|
||||
else
|
||||
TEMP = "";
|
||||
|
||||
return TEMP;
|
||||
}
|
||||
|
||||
bool TRic_tab::main_loop()
|
||||
{
|
||||
int posiz;
|
||||
@ -187,7 +254,7 @@ bool TRic_tab::main_loop()
|
||||
_dittaric = get_firm();
|
||||
|
||||
if (_scelta == 'T')
|
||||
{
|
||||
{
|
||||
if (video())
|
||||
{
|
||||
if (_std == "")
|
||||
@ -307,7 +374,7 @@ void TRic_tab::trasferimento()
|
||||
|
||||
void TRic_tab::scrivi_record_tab(TString& record,long rec)
|
||||
{
|
||||
TString sigla,key,str;
|
||||
TString sigla,key,str,numero,comune;
|
||||
int numfield = 2; //Per le tabelle il primo campo della mappa non e' significativo
|
||||
//ai fini del trasferimento (flag di record gia trasferito).
|
||||
TMappa_trc& trc = _tras_file.mappa();
|
||||
@ -318,6 +385,7 @@ void TRic_tab::scrivi_record_tab(TString& record,long rec)
|
||||
int campi_righe = 0;
|
||||
int num_riga = 1;
|
||||
TToken_string data;
|
||||
TString cap = "";
|
||||
|
||||
sigla = record.mid(0,2);
|
||||
gia_trasf = record.mid(255,1)[0];
|
||||
@ -342,8 +410,11 @@ void TRic_tab::scrivi_record_tab(TString& record,long rec)
|
||||
trasfer_data_tab(*file, *dep, sigla);
|
||||
delete file;
|
||||
delete dep;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ( (logicnum == LF_RCAUSALI) && (_tras_file.flg_agg() == 'D') )
|
||||
break;
|
||||
|
||||
file = new TLocalisamfile(logicnum);
|
||||
dep = new TRectype (logicnum);
|
||||
dep->zero();
|
||||
@ -368,7 +439,10 @@ void TRic_tab::scrivi_record_tab(TString& record,long rec)
|
||||
dep->put("NRIGA", num_riga++);
|
||||
|
||||
trasfer_data_tab(*file, *dep, sigla);
|
||||
}
|
||||
}
|
||||
else
|
||||
num_riga++;
|
||||
|
||||
campi_righe = 1;
|
||||
}
|
||||
}
|
||||
@ -381,13 +455,33 @@ void TRic_tab::scrivi_record_tab(TString& record,long rec)
|
||||
|
||||
//Il nostro codice registro IVA e' lungo 3: se il loro registro (lungo 1) e' alfanumerico
|
||||
//devo allinearlo a sinistra, mentre se e' numerico devo allinearlo a destra riempendolo con degli zero.
|
||||
if (logicnum == LF_CAUSALI && fname == "REG")
|
||||
{
|
||||
char f = field[0];
|
||||
if (isdigit(f))
|
||||
field.format("%03c", f);
|
||||
else
|
||||
field.format("%-3c", f);
|
||||
if (logicnum == LF_CAUSALI)
|
||||
{
|
||||
if (fname == "REG")
|
||||
{
|
||||
char f = field[0];
|
||||
if (isdigit(f))
|
||||
field.format("%03c", f);
|
||||
else
|
||||
field.format("%-3c", f);
|
||||
}
|
||||
|
||||
if (fname == "M770")
|
||||
if (field == "0")
|
||||
field = " ";
|
||||
|
||||
if (fname == "NUMDOC" || fname == "DATADOC")
|
||||
{
|
||||
if (field == "0")
|
||||
field = " ";
|
||||
else
|
||||
if (field == "1")
|
||||
field = "X";
|
||||
}
|
||||
|
||||
if (fname == "CODCAUSIM")
|
||||
if (field == "000")
|
||||
field = " ";
|
||||
}
|
||||
|
||||
//Il tipo cliente/fornitore presente su AS400 puo' assumere come valori 1 o 2
|
||||
@ -424,22 +518,90 @@ void TRic_tab::scrivi_record_tab(TString& record,long rec)
|
||||
else
|
||||
field.format("%-4s", (const char*) f);
|
||||
}
|
||||
|
||||
if (fname == "INDCF")
|
||||
{
|
||||
field = field.rtrim();
|
||||
if (field != "")
|
||||
{
|
||||
numero = numero_civico(field);
|
||||
dep->put(CLI_CIVCF, (const char*)numero);
|
||||
}
|
||||
}
|
||||
|
||||
if (fname == "CAPCF")
|
||||
{
|
||||
if (field == "00000")
|
||||
field = " ";
|
||||
else
|
||||
cap = field;
|
||||
}
|
||||
|
||||
if (fname == "LOCALITACF")
|
||||
{
|
||||
comune = "";
|
||||
|
||||
if (cap.not_empty())
|
||||
comune = cerca_comune_cap(cap);
|
||||
if (comune.empty())
|
||||
comune = cerca_comune_den(field);
|
||||
if (comune.not_empty())
|
||||
{
|
||||
dep->put(CLI_COMCF, comune);
|
||||
field = "";
|
||||
}
|
||||
}
|
||||
|
||||
if (fname == "ALLEG")
|
||||
if (field == "0")
|
||||
field = " ";
|
||||
|
||||
if (fname == "PAIV")
|
||||
if (field == "00000000000")
|
||||
field = " ";
|
||||
}
|
||||
|
||||
if (flag)
|
||||
if (flag && (_tras_file.flg_agg() == 'D') )
|
||||
{
|
||||
data = "";
|
||||
data.add(fname);
|
||||
data.add(field);
|
||||
|
||||
_aggiorna.add(data);
|
||||
|
||||
if (sigla == "A1" && fname == "INDCF")
|
||||
{
|
||||
data = "";
|
||||
data.add("CIVCF");
|
||||
data.add(numero);
|
||||
|
||||
_aggiorna.add(data);
|
||||
}
|
||||
|
||||
if (sigla == "A1" && fname == "LOCALITACF")
|
||||
{
|
||||
data = "";
|
||||
data.add("COMCF");
|
||||
data.add(comune);
|
||||
|
||||
_aggiorna.add(data);
|
||||
}
|
||||
}
|
||||
|
||||
//Quando ricevo la IV direttiva del piano dei conti per evitare che nell'archivio,
|
||||
//in caso di numero romano vuoto, venga memorizzato la stringa letta sul trasfer ("000"),
|
||||
//vuoto la stringa prima di fare la put.
|
||||
if (sigla == "P2" || sigla == "P3")
|
||||
{
|
||||
{
|
||||
if (fname == "STSOTTBIL")
|
||||
{
|
||||
if (field == "0")
|
||||
field = "X";
|
||||
else
|
||||
if (field == "1")
|
||||
field = " ";
|
||||
}
|
||||
|
||||
if (fname == "NUMRIVD" || fname == "NUMRIVDOPP")
|
||||
{
|
||||
if (field == "000")
|
||||
@ -450,7 +612,8 @@ void TRic_tab::scrivi_record_tab(TString& record,long rec)
|
||||
if (field == " ")
|
||||
field = "0";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dep->put(fname, (const char*)field);
|
||||
|
||||
numfield++;
|
||||
@ -459,23 +622,29 @@ void TRic_tab::scrivi_record_tab(TString& record,long rec)
|
||||
while (trc.is_key((const char*) key));
|
||||
|
||||
if (logicnum == LF_RCAUSALI)
|
||||
{
|
||||
campi_righe++;
|
||||
|
||||
if (campi_righe == CAMPI_RCAUS)
|
||||
{
|
||||
if (_tras_file.flg_agg() != 'D')
|
||||
{
|
||||
TString16 gruppo(dep->get("GRUPPO"));
|
||||
//
|
||||
// scarta le righe non significative
|
||||
// -------------------- NB -----------------------
|
||||
// supponiamo il GRUPPO INDISPENSABILE !!!!!!!!!!!!!
|
||||
//
|
||||
if (gruppo.not_empty())
|
||||
campi_righe++;
|
||||
|
||||
if (campi_righe == CAMPI_RCAUS)
|
||||
{
|
||||
dep->put("NRIGA", num_riga++);
|
||||
trasfer_data_tab(*file, *dep, sigla);
|
||||
}
|
||||
campi_righe = 1;
|
||||
TString16 gruppo(dep->get("GRUPPO"));
|
||||
//
|
||||
// scarta le righe non significative
|
||||
// -------------------- NB -----------------------
|
||||
// supponiamo il GRUPPO INDISPENSABILE !!!!!!!!!!!!!
|
||||
//
|
||||
if (gruppo.not_empty())
|
||||
{
|
||||
dep->put("NRIGA", num_riga++);
|
||||
trasfer_data_tab(*file, *dep, sigla);
|
||||
}
|
||||
else
|
||||
num_riga++;
|
||||
|
||||
campi_righe = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -528,15 +697,19 @@ int TRic_tab::trasfer_data_tab(TLocalisamfile& file, TRectype& dep, const TStrin
|
||||
file.rewrite();
|
||||
}
|
||||
if (flag == 'D')
|
||||
{
|
||||
for (int i = 0; i < _aggiorna.items(); i++)
|
||||
{
|
||||
if (file.num() != LF_RCAUSALI)
|
||||
{
|
||||
TToken_string& data = (TToken_string&)_aggiorna[i];
|
||||
TString fname = data.get(0);
|
||||
TString field = data.get(1);
|
||||
file.put(fname,field);
|
||||
for (int i = 0; i < _aggiorna.items(); i++)
|
||||
{
|
||||
TToken_string& data = (TToken_string&)_aggiorna[i];
|
||||
TString fname = data.get(0);
|
||||
TString field = data.get(1);
|
||||
file.put(fname,field);
|
||||
}
|
||||
file.rewrite();
|
||||
_aggiorna.destroy();
|
||||
}
|
||||
file.rewrite();
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -755,35 +928,23 @@ void TRic_tab::num_protocollo(TString& record)
|
||||
_nuprotiva = _uprotiva;
|
||||
}
|
||||
|
||||
long TRic_tab::ulnumprot_reg(int anno,char codreg)
|
||||
long TRic_tab::ulnumprot_reg(int anno,TString& cr)
|
||||
{
|
||||
/*
|
||||
TTable reg ("REG");
|
||||
TString16 dep;
|
||||
long num = 0;
|
||||
|
||||
dep.format("%04d%s", anno,(const char*) codreg);
|
||||
|
||||
reg.zero();
|
||||
reg.put("CODTAB", (const char*) dep);
|
||||
if (reg.read() == NOERR)
|
||||
num = reg.get_long("I5");
|
||||
*/
|
||||
TString cr = format("%c", codreg);
|
||||
//TString cr = format("%c", codreg);
|
||||
TRegistro rg (cr, anno);
|
||||
|
||||
return rg.protocol();
|
||||
}
|
||||
|
||||
void TRic_tab::aggiorna_reg(int anno,char codreg,long ulnum)
|
||||
void TRic_tab::aggiorna_reg(int anno,TString& codreg,long ulnum)
|
||||
{
|
||||
TTable reg ("REG");
|
||||
TString16 dep;
|
||||
|
||||
if (isdigit(codreg))
|
||||
dep.format("%04d%03c", anno,codreg);
|
||||
if (real::is_natural(codreg))
|
||||
dep.format("%04d%03s", anno,(const char*) codreg);
|
||||
else
|
||||
dep.format("%04d%-3c", anno,codreg);
|
||||
dep.format("%04d%-3s", anno,(const char*) codreg);
|
||||
|
||||
reg.zero();
|
||||
reg.put("CODTAB", (const char*) dep);
|
||||
@ -799,20 +960,16 @@ void TRic_tab::aggiorna_reg(int anno,char codreg,long ulnum)
|
||||
}
|
||||
}
|
||||
|
||||
void TRic_tab::controlli_prima_nota(TString& record)
|
||||
void TRic_tab::controlli_prima_nota(TString& record,TString& codreg)
|
||||
{
|
||||
TTable tpd ("%TPD");
|
||||
bool corrisp;
|
||||
TDate datareg;
|
||||
int anno;
|
||||
long ulnum;
|
||||
long ulnum = 0;
|
||||
TString16 tmp;
|
||||
char codreg;
|
||||
TString tipodoc;
|
||||
|
||||
// char codreg = record.sub(35,36)[0];
|
||||
// TString tipodoc = record.sub(220,222);
|
||||
|
||||
int tiporeg = atoi(record.sub(222,223));
|
||||
|
||||
TString80 tmpmov = "%";
|
||||
@ -825,8 +982,8 @@ void TRic_tab::controlli_prima_nota(TString& record)
|
||||
tmp_mov.put(MOV_NUMREG, _numreg);
|
||||
if (tmp_mov.read() == NOERR)
|
||||
{
|
||||
codreg = tmp_mov.get_char(MOV_REG);
|
||||
tipodoc = tmp_mov.get (MOV_TIPODOC);
|
||||
codreg = tmp_mov.get(MOV_REG);
|
||||
tipodoc = tmp_mov.get(MOV_TIPODOC);
|
||||
}
|
||||
|
||||
tmp = record.sub(15,21);
|
||||
@ -842,7 +999,7 @@ void TRic_tab::controlli_prima_nota(TString& record)
|
||||
if (tpd.read() == NOERR)
|
||||
corrisp = tpd.get_bool("B0");
|
||||
|
||||
if (codreg != ' ' && !corrisp)
|
||||
if (codreg != "" && !corrisp)
|
||||
{
|
||||
if ( ( (tiporeg == 1 && (numprot_att || _protiva == 0) ) )
|
||||
|| ( (tiporeg == 2 && (numprot_pas || _protiva == 0) ) ) )
|
||||
@ -904,18 +1061,19 @@ long TRic_tab::ultima_registrazione()
|
||||
return _nreg;
|
||||
}
|
||||
|
||||
char TRic_tab::ricerca_causale(const TString& causale)
|
||||
char TRic_tab::ricerca_causale(TString& causale)
|
||||
{
|
||||
TLocalisamfile cau (LF_CAUSALI);
|
||||
TString codcau;
|
||||
char movap = ' ';
|
||||
|
||||
long caus = atol(causale);
|
||||
codcau.format("%03d", caus);
|
||||
if (real::is_natural(causale))
|
||||
causale.format("%03s", (const char*) causale);
|
||||
else
|
||||
causale.format("%-3s", (const char*) causale);
|
||||
|
||||
cau.setkey(1);
|
||||
cau.zero();
|
||||
cau.put("CODCAUS", codcau);
|
||||
cau.put("CODCAUS", causale);
|
||||
if (cau.read() == NOERR)
|
||||
movap = cau.get_char("MOVAP");
|
||||
|
||||
@ -946,7 +1104,7 @@ void TRic_tab::prepara_saldi(const TString& fname,const TString& field)
|
||||
|
||||
void TRic_tab::scrivi_record_mov(TString& record,long rec)
|
||||
{
|
||||
TString sigla,key,str;
|
||||
TString sigla,key,str,codreg;
|
||||
int numfield = 3; //Per i movimenti i primi due campi della mappa non sono significativi
|
||||
//ai fini del trasferimento (flag record gia trasferito e nuovo ultimo numero di registrazione).
|
||||
TMappa_trc& trc = _tras_file.mappa();
|
||||
@ -987,7 +1145,7 @@ void TRic_tab::scrivi_record_mov(TString& record,long rec)
|
||||
numulreg = ultima_registrazione(); //reperisco il numero ultima registrazione
|
||||
_nreg = esiste_numreg(numulreg);
|
||||
num_protocollo(record);
|
||||
controlli_prima_nota(record);
|
||||
controlli_prima_nota(record,codreg);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1043,18 +1201,25 @@ void TRic_tab::scrivi_record_mov(TString& record,long rec)
|
||||
TString fname = trc.field_name(key);
|
||||
TString field = record.sub(from-1,to);
|
||||
int flag = trc.flag(key);
|
||||
|
||||
//Il nostro codice registro IVA e' lungo 3: se il loro registro (lungo 1) e' alfanumerico
|
||||
//devo allinearlo a sinistra, mentre se e' numerico devo allinearlo a destra riempendolo con degli zero.
|
||||
int dec = trc.flag_bis(key);
|
||||
|
||||
if (flag == 3)
|
||||
{
|
||||
if (dec > 0)
|
||||
decimali(field,dec);
|
||||
|
||||
real appoggio (field);
|
||||
field = appoggio.string();
|
||||
}
|
||||
|
||||
if (logicnum == LF_MOV)
|
||||
{
|
||||
if (fname == "REG")
|
||||
{
|
||||
char f = field[0];
|
||||
if (isdigit(f))
|
||||
field.format("%03c", f);
|
||||
if (real::is_natural(codreg))
|
||||
field.format("%03s", (const char*) codreg);
|
||||
else
|
||||
field.format("%-3c", f);
|
||||
field.format("%-3s", (const char*) codreg);
|
||||
}
|
||||
|
||||
//Il codice pagamento su AS400 e' un alfanumerico di due, mentre su PC e' un
|
||||
@ -1098,7 +1263,7 @@ void TRic_tab::scrivi_record_mov(TString& record,long rec)
|
||||
_sld.set_movap(TRUE);
|
||||
}
|
||||
|
||||
if (logicnum == LF_MOV && (fname == "NUMREG" || flag == 1) )
|
||||
if (logicnum == LF_MOV && (fname == "NUMREG" || flag == 2) )
|
||||
{
|
||||
if (fname == "NUMREG")
|
||||
{
|
||||
@ -1107,7 +1272,7 @@ void TRic_tab::scrivi_record_mov(TString& record,long rec)
|
||||
dep->put(MOV_DATAREG, _datareg);
|
||||
dep->put(MOV_DATACOMP, datacomp);
|
||||
}
|
||||
if (flag == 1)
|
||||
if (flag == 2)
|
||||
{
|
||||
TString f = converti(field);
|
||||
dep->put(fname,f);
|
||||
@ -1129,7 +1294,7 @@ void TRic_tab::scrivi_record_mov(TString& record,long rec)
|
||||
}
|
||||
}
|
||||
else
|
||||
dep->put(fname, (const char*)field);
|
||||
dep->put(fname, field);
|
||||
|
||||
numfield++;
|
||||
key.format("%2s%d", (const char*) sigla,numfield);
|
||||
@ -1393,6 +1558,13 @@ void TRic_tab::salva_dati_testata()
|
||||
_tras_file.write(numrec);
|
||||
}
|
||||
|
||||
void TRic_tab::decimali(TString& campo, int dec)
|
||||
{
|
||||
int l = campo.len();
|
||||
int p = l - dec;
|
||||
campo.insert(".",p);
|
||||
}
|
||||
|
||||
void TRic_tab::scrivi_record_moviva(TString& record,long rec)
|
||||
{
|
||||
TString sigla,key,str;
|
||||
@ -1476,20 +1648,23 @@ void TRic_tab::scrivi_record_moviva(TString& record,long rec)
|
||||
TString fname = trc.field_name(key);
|
||||
TString field = record.sub(from-1,to);
|
||||
int flag = trc.flag(key);
|
||||
int dec = trc.flag_bis(key);
|
||||
|
||||
if (logicnum == LF_MOV && fname == "CAMBIOI" && flag == 5)
|
||||
if (logicnum == LF_MOV && fname == "TOTDOC")
|
||||
{
|
||||
int l = field.len();
|
||||
int p = l - flag;
|
||||
field.insert(".",p);
|
||||
numfield++;
|
||||
key.format("%2s%d", (const char*) sigla,numfield);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (logicnum == LF_MOV && fname == "CORRVALUTA" && flag == 5)
|
||||
if (flag == 3)
|
||||
{
|
||||
int l = field.len();
|
||||
int p = l -flag;
|
||||
field.insert(".",p);
|
||||
}
|
||||
if (dec > 0)
|
||||
decimali(field,dec);
|
||||
|
||||
real appoggio (field);
|
||||
field = appoggio.string();
|
||||
}
|
||||
|
||||
if (logicnum == LF_MOV && ( fname == "NUMREG" || flag == 1 ) )
|
||||
{
|
||||
@ -1510,7 +1685,7 @@ void TRic_tab::scrivi_record_moviva(TString& record,long rec)
|
||||
dep->put("NUMREG", _nreg);
|
||||
}
|
||||
else
|
||||
dep->put(fname, (const char*)field);
|
||||
dep->put(fname, field);
|
||||
|
||||
numfield++;
|
||||
key.format("%2s%d", (const char*) sigla,numfield);
|
||||
@ -1551,7 +1726,6 @@ int TRic_tab::trasfer_data_moviva(TLocalisamfile& file, TRectype& dep, int ln)
|
||||
TDate data74ter (dep.get_date(MOV_DATA74TER));
|
||||
TString codval (dep.get (MOV_CODVAL));
|
||||
long codcf = dep.get_long(MOV_CODCF);
|
||||
real totdoc (dep.get_real(MOV_TOTDOC));
|
||||
real cambioi (dep.get_real(MOV_CAMBIOI));
|
||||
real corrlire (dep.get_real(MOV_CORRLIRE));
|
||||
real corrvaluta(dep.get_real(MOV_CORRVALUTA));
|
||||
@ -1559,7 +1733,6 @@ int TRic_tab::trasfer_data_moviva(TLocalisamfile& file, TRectype& dep, int ln)
|
||||
file.put(MOV_DATA74TER, data74ter);
|
||||
file.put(MOV_CODVAL, codval);
|
||||
file.put(MOV_CODCF, codcf);
|
||||
file.put(MOV_TOTDOC, totdoc);
|
||||
file.put(MOV_CAMBIOI, cambioi);
|
||||
file.put(MOV_CORRLIRE, corrlire);
|
||||
file.put(MOV_CORRVALUTA,corrvaluta);
|
||||
|
2299
cg/cg2700.cpp
2299
cg/cg2700.cpp
File diff suppressed because it is too large
Load Diff
2974
cg/cg2800.cpp
2974
cg/cg2800.cpp
File diff suppressed because it is too large
Load Diff
@ -131,11 +131,14 @@ BEGIN
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
LIST F_SEZIONE 7
|
||||
LIST F_SEZIONE 9
|
||||
BEGIN
|
||||
PROMPT 1 13 "Sezione "
|
||||
ITEM " |Nessuna"
|
||||
ITEM "D|Dare"
|
||||
ITEM "A|Avere"
|
||||
ITEM "A|Avere"
|
||||
CHECKTYPE REQUIRED
|
||||
WARNING "Valore non valido per sezione"
|
||||
END
|
||||
|
||||
STRING F_DESCR 30
|
||||
|
@ -24,16 +24,23 @@ bool TDitta_ric::set()
|
||||
TMask msk ("cg2801a");
|
||||
KEY tasto;
|
||||
|
||||
_old_ditta = get_firm();
|
||||
|
||||
tasto = msk.run();
|
||||
|
||||
if (tasto != K_ENTER) return FALSE;
|
||||
|
||||
_dittaric = msk.get_int(F_CODDITTA);
|
||||
|
||||
if (!esegui_controlli()) return FALSE;
|
||||
|
||||
set_firm(_dittaric);
|
||||
|
||||
if (!esegui_controlli())
|
||||
{
|
||||
set_firm(_old_ditta);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//set_firm(_dittaric);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -79,12 +86,16 @@ bool TDitta_ric::esegui_controlli()
|
||||
|
||||
if (_uselab != " ")
|
||||
return error_box("Ultimo trasferimento NON COMPLETATO: completarlo");
|
||||
|
||||
if (!controlli())
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
return error_box("Ultimo trasferimento NON COMPLETATO: completarlo");
|
||||
|
||||
TConfig cfd (CONFIG_DITTA);
|
||||
|
||||
if (!controlli())
|
||||
return FALSE;
|
||||
TString std = cfd.get("FlStTra");
|
||||
if (std == "")
|
||||
return error_box ("Non risultano TRASFERIMENTI ATTIVI sulla ditta richiesta");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -200,12 +211,6 @@ bool TDitta_ric::controlli()
|
||||
|
||||
if (!_tras_file.write_control_rec(_control_rec, size))
|
||||
return FALSE;
|
||||
|
||||
TConfig cfd (CONFIG_DITTA);
|
||||
|
||||
TString std = cfd.get("FlStTra");
|
||||
if (std == "")
|
||||
return error_box ("Non risultano TRASFERIMENTI ATTIVI sulla ditta richiesta");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ class TDitta_ric : public TApplication
|
||||
TTransfer_file _tras_file;
|
||||
|
||||
TString _trasf,_std,_uselab,_record,_nrec_file,_sigle_file,_key;
|
||||
long _dittaric;
|
||||
long _dittaric, _old_ditta;
|
||||
TString _control_rec;
|
||||
|
||||
public:
|
||||
|
@ -23,6 +23,7 @@ bool TAnn_mov::create()
|
||||
|
||||
_pcon = new TLocalisamfile (LF_PCON);
|
||||
_clifo = new TLocalisamfile (LF_CLIFO);
|
||||
_mov = new TLocalisamfile (LF_MOV);
|
||||
|
||||
TString80 tmpmov = "%";
|
||||
tmpmov << get_firm_dir();
|
||||
@ -49,6 +50,7 @@ bool TAnn_mov::destroy()
|
||||
{
|
||||
delete _pcon;
|
||||
delete _clifo;
|
||||
delete _mov;
|
||||
|
||||
delete _tmov;
|
||||
delete _trmov;
|
||||
|
@ -19,7 +19,7 @@ HIDDEN int date2esc(const TDate& d, int* prevesc = NULL);
|
||||
class TAnn_mov : public TApplication
|
||||
{
|
||||
TIsamtempfile* _tmov,* _trmov,* _tiva;
|
||||
TLocalisamfile* _pcon,* _clifo;
|
||||
TLocalisamfile* _pcon,* _clifo, *_mov;
|
||||
TRectype* _rec_mov;
|
||||
TTransfer_file _tras_file;
|
||||
|
||||
|
@ -62,9 +62,9 @@ bool TVis_ric::stato_hnd (TMask_field& f, KEY k)
|
||||
TString uselab = f.mask().get(F_USELAB);
|
||||
TString chiave = f.mask().get(F_STATO);
|
||||
|
||||
if (!app()._ftrasfer)
|
||||
if (!app()._ftrasfer) //_ftrasfer dice se esiste il file trasfer o il suo record di controllo
|
||||
{
|
||||
if (std != "")
|
||||
if (std != "" && std != "*")
|
||||
return warning_box("Valore non valido per stato ultima ricezione");
|
||||
}
|
||||
else
|
||||
@ -108,7 +108,7 @@ bool TVis_ric::chiave_hnd (TMask_field& f, KEY k)
|
||||
return warning_box("Lo stato ultima ricezione non e' significativo: la chiave ultimo file elaborato non puo' essere significativa");
|
||||
|
||||
if (uselab == "" && chiave != "")
|
||||
return warning_box("La sigla ultimo file elaborato non e' significativo: la chiave ultimo file elaborato non puo' essere significativa");
|
||||
return warning_box("La sigla ultimo file elaborato non e' significativa: la chiave ultimo file elaborato non puo' essere significativa");
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@ -209,6 +209,9 @@ void TVis_ric::registra(TMask& m)
|
||||
flags[6] = '\0';
|
||||
|
||||
TString uselab = m.get(F_USELAB);
|
||||
if (uselab == "")
|
||||
uselab = " ";
|
||||
|
||||
str = m.get(F_STATO);
|
||||
TString chiave = format("%-15s", (const char*) str);
|
||||
|
||||
|
4278
cg/cg2900.cpp
4278
cg/cg2900.cpp
File diff suppressed because it is too large
Load Diff
@ -184,7 +184,7 @@ long TTransfer_file::start(char sigla)
|
||||
long TTransfer_file::start(int i)
|
||||
{
|
||||
if (i == 0)
|
||||
return 0;
|
||||
return 1;
|
||||
else
|
||||
{
|
||||
TToken_string data = (TToken_string&)_index[i-1];
|
||||
@ -780,7 +780,9 @@ void TMappa_trc::leggi_modulo()
|
||||
|
||||
while (s.ok())
|
||||
{
|
||||
record = s.line();
|
||||
record = s.line();
|
||||
|
||||
if (record.mid(0,1) == "#") continue; //Perche' e' un commento
|
||||
|
||||
TString sigla = record.get(0);
|
||||
long numrec = record.get_long(1);
|
||||
@ -820,3 +822,9 @@ int TMappa_trc::flag(const char* key)
|
||||
TToken_string * data = (TToken_string *) objptr(key);
|
||||
return data->get_int(6);
|
||||
}
|
||||
|
||||
int TMappa_trc::flag_bis(const char* key)
|
||||
{
|
||||
TToken_string * data = (TToken_string *) objptr(key);
|
||||
return data->get_int(7);
|
||||
}
|
||||
|
@ -38,6 +38,7 @@ class TMappa_trc : public TAssoc_array
|
||||
int logicnum (const char* key);
|
||||
const char* field_name (const char* key);
|
||||
int flag (const char* key);
|
||||
int flag_bis (const char* key);
|
||||
|
||||
TMappa_trc() {};
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user