git-svn-id: svn://10.65.10.50/branches/R_10_00@23715 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
ecac771d7f
commit
4617a61978
@ -858,6 +858,9 @@ void TImportaEricsoft::upload_mov(const TFilename& file, TLog_report& log)
|
|||||||
if (!pi.addstatus(1))
|
if (!pi.addstatus(1))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
if (s.get(1).as_int() == 0L)
|
||||||
|
continue;
|
||||||
|
|
||||||
const TDate datareg = s.get(0).as_date();
|
const TDate datareg = s.get(0).as_date();
|
||||||
const long numreg_eric = s.get(1).as_int();
|
const long numreg_eric = s.get(1).as_int();
|
||||||
const char sezione = s.get(2).as_int() == 0 ? 'D' : 'A';
|
const char sezione = s.get(2).as_int() == 0 ? 'D' : 'A';
|
||||||
@ -876,19 +879,19 @@ void TImportaEricsoft::upload_mov(const TFilename& file, TLog_report& log)
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (codcf != 0L)
|
if (codcf != 0L)
|
||||||
{
|
{
|
||||||
TString16 key; key.format("E%ld", codcf);
|
TString16 key; key.format("E%ld", codcf);
|
||||||
|
|
||||||
clifo.setkey(6);
|
clifo.setkey(6);
|
||||||
clifo.zero();
|
clifo.zero();
|
||||||
clifo.put(CLI_TIPOCF, "C");
|
clifo.put(CLI_TIPOCF, "C");
|
||||||
clifo.put(CLI_RICALT, key);
|
clifo.put(CLI_RICALT, key);
|
||||||
if (clifo.read() == NOERR)
|
if (clifo.read() == NOERR)
|
||||||
codcf = clifo.get_long(CLI_CODCF);
|
codcf = clifo.get_long(CLI_CODCF);
|
||||||
else
|
else
|
||||||
log.log(3, format(FR("Codice cliente Ericsoft %ld assente"), codcf));
|
log.log(3, format(FR("Codice cliente Ericsoft %ld assente"), codcf));
|
||||||
}
|
}
|
||||||
|
|
||||||
const TDate datacomp = s.get(6).as_date();
|
const TDate datacomp = s.get(6).as_date();
|
||||||
const int tiporeg = s.get(7).as_int();
|
const int tiporeg = s.get(7).as_int();
|
||||||
@ -936,7 +939,7 @@ void TImportaEricsoft::upload_mov(const TFilename& file, TLog_report& log)
|
|||||||
cods_iva.destroy();
|
cods_iva.destroy();
|
||||||
numreg = numreg_eric;
|
numreg = numreg_eric;
|
||||||
nriga = 0;
|
nriga = 0;
|
||||||
nrigaIVA = 0;
|
nrigaIVA = 0L;
|
||||||
ini_file.temp("eric", "ini");
|
ini_file.temp("eric", "ini");
|
||||||
ini = new TConfig(ini_file, "Transaction");
|
ini = new TConfig(ini_file, "Transaction");
|
||||||
|
|
||||||
@ -944,18 +947,18 @@ void TImportaEricsoft::upload_mov(const TFilename& file, TLog_report& log)
|
|||||||
long nreg = 0;
|
long nreg = 0;
|
||||||
|
|
||||||
daily_movs.set_var("#DATE", datareg.stringa());
|
daily_movs.set_var("#DATE", datareg.stringa());
|
||||||
for (bool ok = daily_movs.move_first(); ok; ok = daily_movs.move_next())
|
for (bool ok = daily_movs.move_first(); ok && nreg == 0L; ok = daily_movs.move_next())
|
||||||
if (numreg == daily_movs.get(MOV_TNUMREG).as_int())
|
if (numreg == daily_movs.get(MOV_TNUMREG).as_int())
|
||||||
nreg = daily_movs.get(MOV_NUMREG).as_int();
|
nreg = daily_movs.get(MOV_NUMREG).as_int();
|
||||||
|
|
||||||
if (nreg == 0L)
|
if (nreg == 0L)
|
||||||
ini->set("Action", TRANSACTION_INSERT);
|
ini->set("Action", TRANSACTION_INSERT);
|
||||||
else
|
else
|
||||||
{
|
|
||||||
ini->set("Action", TRANSACTION_MODIFY);
|
ini->set("Action", TRANSACTION_MODIFY);
|
||||||
ini->set(MOV_NUMREG, nreg);
|
|
||||||
}
|
|
||||||
ini->set("Mode", mode);
|
ini->set("Mode", mode);
|
||||||
ini->set_paragraph(LF_MOV);
|
ini->set_paragraph(LF_MOV);
|
||||||
|
if (nreg != 0L)
|
||||||
|
ini->set(MOV_NUMREG, nreg);
|
||||||
ini->set(MOV_DATAREG, datareg);
|
ini->set(MOV_DATAREG, datareg);
|
||||||
ini->set(MOV_ANNOIVA, datareg.year());
|
ini->set(MOV_ANNOIVA, datareg.year());
|
||||||
ini->set(MOV_ANNOES, _esc.esercizio(datacomp).codice());
|
ini->set(MOV_ANNOES, _esc.esercizio(datacomp).codice());
|
||||||
@ -1036,6 +1039,13 @@ void TImportaEricsoft::upload_mov(const TFilename& file, TLog_report& log)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (numreg > 0L)
|
||||||
|
{
|
||||||
|
delete ini;
|
||||||
|
ini = NULL;
|
||||||
|
skip |= (nriga == 0) && (nrigaIVA == 0);
|
||||||
|
save_mov(log, ini_file, skip);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TImportaEricsoft::transfer()
|
bool TImportaEricsoft::transfer()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user