Patch level : 10 ha

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :


git-svn-id: svn://10.65.10.50/branches/R_10_00@21254 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2010-12-07 14:53:18 +00:00
parent e900e73807
commit 94827f4e23
4 changed files with 122 additions and 9 deletions

View File

@ -1014,6 +1014,7 @@ bool THardy_contratti::trasferisci()
test_write(condv);
}
condv.close();
rcondv.close();
return write_enabled();
}

View File

@ -331,7 +331,7 @@ GESTSCAGL =
GESTSCO =
OBBLIG =
CODLISSUCC =
SEQRIC = A---
SEQRIC = _FISSO,A---
DECIMALI =
FATHCATVEN =
FATHCOD =
@ -387,7 +387,7 @@ GESTSCAGL =
GESTSCO =
OBBLIG =
CODLISSUCC =
SEQRIC =
SEQRIC = _FISSO,A---
DECIMALI =
FATHCATVEN =
FATHCOD =

View File

@ -12,6 +12,117 @@
const char* const APPNAME = TR("Conversione movimenti");
///////////////////////////////////////////////////////////
// Movimenti
///////////////////////////////////////////////////////////
class THardy_movimenti : public THardy_transfer
{
int _anno;
public:
virtual bool trasferisci();
THardy_movimenti(int anno);
};
THardy_movimenti::THardy_movimenti(int anno) : _anno(anno)
{
}
bool THardy_movimenti::trasferisci()
{
TString query =
"SELECT * "
"FROM dbo.MovContabiliT "
"WHERE Esercizio=";
query << _anno;
TRecordset& recset = create_recordset(query);
TConfig& ini = config();
TString_array lista_campi;
ini.list_variables(lista_campi, true, "MOV", true);
TFilename outdir("C:");
TConfig* conf = NULL;
int nrigac = 1;
int nrigai = 1;
long ntran = 1L;
THardy_iterator hi(this);
while (++hi)
{
if (conf != NULL)
delete conf;
conf = NULL;
TFilename temp(outdir);
temp.format("%05ld", ntran++);
temp.ext("ini");
if (temp.exist())
temp.fremove();
conf = new TConfig(temp);
conf->set_paragraph("Transaction");
conf->set("Action","INSERT");
conf->set("Mode", "AUTO");
conf->set_paragraph("23"); // testata movimento
/*
const TString& key = get_str("IdConto");
const long codcf = 0;//key2forn(key);
if (codcf > 0)
{
rec.zero();
rec.put(CLI_TIPOCF, "F");
rec.put(CLI_CODCF, codcf);
// contropartita
const TString16 key = get_str("IdContropartita");
const int gr = atoi(key.mid(1,2));
const int co = atoi(key.mid(3,2));
const int so = atoi(key.mid(5,3));
rec.put(CLI_GRUPPORIC, gr);
rec.put(CLI_CONTORIC, co);
rec.put(CLI_SOTTOCRIC, so);
// ricerca comune
const TString8 cap = get_str("IdCap"); //cap
TString80 loc = get_str("Localita"); //località
const TString4 com = cap2comune(cap,loc); //codice comune
const TString4 stato = get_str("IdNazione"); //stato
rec.put(CLI_CAPCF, cap);
if (com.full())
{
rec.put(CLI_COMCF, com); //se riesce la CAP2COMUNE, inserisco il codice comune
loc = "";
rec.put(CLI_LOCCF, loc);
}
else
{
rec.put(CLI_COMCF, com);
if (stato != "IT" && !stato.blank()) //altrimenti metto tutto nella località, eventualmente concatenando lo stato
loc << " - " << stato;
rec.put(CLI_LOCCF, loc);
}
aggiorna_record(rec, lista_campi);
test_write(clienti);
}
else
{
TString msg;
msg << TR("Impossibile determinare il codice del fornitore") << " '" << key << '\'';
log(msg);
}
*/
}
return write_enabled();
}
///////////////////////////////////////////////////////////
// TConvMovimentiHardy_mask
///////////////////////////////////////////////////////////
@ -62,13 +173,14 @@ void TConvMovimentiHardy_mask::trasferisci()
bool rep_to_print = false;
bool go_on = true;
if (go_on && (get_int(F_ANNO)!=0))
const int anno = get_int(F_ANNO);
if (go_on && (anno!=0))
{
//THardy_movcont pc;
//pc.init(TR("Movimenti contabili"), query_header, log);
//go_on = pc.trasferisci();
//book.add(log);
//rep_to_print = true;
THardy_movimenti pc(anno);
pc.init(TR("Movimenti contabili"), query_header, log);
go_on = pc.trasferisci();
book.add(log);
rep_to_print = true;
}
if (rep_to_print && book.pages() > 0)

View File

@ -36,7 +36,7 @@ END
NUMBER F_ANNO 4
BEGIN
PROMPT 1 5 "Esercizio da convertire "
PROMPT 2 5 "Esercizio "
END
ENDPAGE