Patch level :
Files correlati : Ricompilazione Demo : [ ] Commento : git-svn-id: svn://10.65.10.50/trunk@19905 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
ecf707ab57
commit
a90db8a598
@ -150,6 +150,7 @@ void TImporta_cesp::transfer(const TFilename& file)
|
|||||||
int lastesc = esc.last();
|
int lastesc = esc.last();
|
||||||
long ntran = 1;
|
long ntran = 1;
|
||||||
TLog_report log(caption);
|
TLog_report log(caption);
|
||||||
|
TLocalisamfile cespi(LF_CESPI);
|
||||||
|
|
||||||
for (bool ok = recset.move_to(1); ok ; ok = recset.move_next())
|
for (bool ok = recset.move_to(1); ok ; ok = recset.move_next())
|
||||||
{
|
{
|
||||||
@ -161,23 +162,25 @@ void TImporta_cesp::transfer(const TFilename& file)
|
|||||||
if (ditta != dt)
|
if (ditta != dt)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const long codces = recset.get(CGC_NPROGR).as_int();
|
TString16 codces = recset.get(CGC_NPROGR).as_string();
|
||||||
|
codces.right_just(10, '0');
|
||||||
// verifico il codice cespite padre
|
// verifico il codice cespite padre
|
||||||
const long codpadre = recset.get(CGC_CODPADRE);
|
TString16 codpadre = recset.get(CGC_CODPADRE).as_string();
|
||||||
if (codpadre == ZERO) // nuovo cespite
|
codpadre.right_just(10, '0');
|
||||||
|
|
||||||
|
if (real::is_null(codpadre)) // nuovo cespite
|
||||||
{
|
{
|
||||||
// creo record anagrafica cespi
|
// creo record anagrafica cespi
|
||||||
TLocalisamfile cespi(LF_CESPI);
|
cespi.put(CESPI_IDCESPITE, codces);
|
||||||
cespi.put(CESPI_IDCESPITE, format("%010ld", codces));
|
|
||||||
const int gr = recset.get(CGC_GRUPPO).as_int();
|
const int gr = recset.get(CGC_GRUPPO).as_int();
|
||||||
const char* sp = recset.get(CGC_SPECIE).as_string();
|
const TString4 sp = recset.get(CGC_SPECIE).as_string();
|
||||||
const int ca = recset.get(CGC_CESPITE).as_int();
|
const int ca = recset.get(CGC_CESPITE).as_int();
|
||||||
|
|
||||||
if (search_gr_sp_ca(gr, sp, ca))
|
if (search_gr_sp_ca(gr, sp, ca))
|
||||||
{
|
{
|
||||||
cespi.put(CESPI_CODCGR, recset.get(CGC_GRUPPO).as_string());
|
cespi.put(CESPI_CODCGR, gr);
|
||||||
cespi.put(CESPI_CODSP, recset.get(CGC_SPECIE).as_string());
|
cespi.put(CESPI_CODSP, sp);
|
||||||
cespi.put(CESPI_CODCAT, recset.get(CGC_CESPITE).as_string());
|
cespi.put(CESPI_CODCAT, ca);
|
||||||
cespi.put(CESPI_DESC, recset.get(CGC_DESCR).as_string());
|
cespi.put(CESPI_DESC, recset.get(CGC_DESCR).as_string());
|
||||||
TDate data(recset.get(CGC_DATAINIZAMM).as_string());
|
TDate data(recset.get(CGC_DATAINIZAMM).as_string());
|
||||||
if (data.ok())
|
if (data.ok())
|
||||||
@ -193,7 +196,7 @@ void TImporta_cesp::transfer(const TFilename& file)
|
|||||||
salce.put(SALCE_CODES, lastesc); // verificare se ultimo esercizio va bene (2010?)
|
salce.put(SALCE_CODES, lastesc); // verificare se ultimo esercizio va bene (2010?)
|
||||||
salce.put(SALCE_TPSALDO, 1); // verificare se saldo iniziale (1) va bene
|
salce.put(SALCE_TPSALDO, 1); // verificare se saldo iniziale (1) va bene
|
||||||
salce.put(SALCE_NUMELE, 1);
|
salce.put(SALCE_NUMELE, 1);
|
||||||
salce.put(SALCE_CSTO, recset.get(CGC_COSTOACQ).as_string());
|
salce.put(SALCE_CSTO, recset.get(CGC_COSTOACQ).as_real());
|
||||||
|
|
||||||
// creo record ammce
|
// creo record ammce
|
||||||
TLocalisamfile ammce(LF_AMMCE);
|
TLocalisamfile ammce(LF_AMMCE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user