Patch level : 10 hardy

Files correlati     :
Ricompilazione Demo : [ ]
Commento            : avanzamento conversione dati (tabelle/archivi ok)


git-svn-id: svn://10.65.10.50/branches/R_10_00@21225 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2010-12-02 14:36:48 +00:00
parent 12dc19e4fa
commit 3ac00ea3e6
5 changed files with 111 additions and 69 deletions

View File

@ -1103,6 +1103,16 @@ bool THardy_fornitori::trasferisci()
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à
@ -1198,14 +1208,7 @@ bool THardy_agenti::trasferisci()
bool THardy_listini::trasferisci()
{
if (trasferisci_listini())
return trasferisci_listinid();
return false;
}
// trasferisce tabella Listini (condv L)
bool THardy_listini::trasferisci_listini()
{
// trasferisce tabella Listini (condv L)
TString query =
"SELECT * "
"FROM dbo.Listini ";
@ -1217,35 +1220,55 @@ bool THardy_listini::trasferisci_listini()
condv.open(_lock);
TRectype& rec = condv.curr();
THardy_iterator hi(this);
// array per la conversione tra IdListino e kListino
TAssoc_array listini;
TToken_string key;
TString8 idlistino;
while (++hi)
{
const TString8 klistino = get_str("KListino");
idlistino = get_str("IdListino");
listini.add(klistino, idlistino);
aggiorna_record(rec, lista_campi);
test_write(condv);
}
condv.close();
return write_enabled();
}
// trasferisce tabella ListiniD (rcondv L)
bool THardy_listini::trasferisci_listinid()
{
TString query =
"SELECT * "
"FROM dbo.ListiniD ";
TRecordset& recset = create_recordset(query);
TConfig& ini = config();
TString_array lista_campi;
ini.list_variables(lista_campi, true, "LISTINID", true);
TSystemisamfile rcondv(LF_RCONDV);
rcondv.open(_lock);
TRectype& rec = rcondv.curr();
THardy_iterator hi(this);
while (++hi)
// trasferisce tabella ListiniD (RCONDV)
if (write_enabled())
{
aggiorna_record(rec, lista_campi);
test_write(rcondv);
TString query =
"SELECT * "
"FROM dbo.ListiniD ";
TRecordset& recset = create_recordset(query);
TConfig& ini = config();
TString_array lista_campi;
ini.list_variables(lista_campi, true, "LISTINID", true);
TSystemisamfile rcondv(LF_RCONDV);
rcondv.open(_lock);
TRectype& rec = rcondv.curr();
THardy_iterator hi(this);
while (++hi)
{
const char* key = get_str("KListino");
if (listini.is_key(key))
{
TString8& idlistino = (TString8&) listini[key];
rec.put(RCONDV_COD, idlistino);
aggiorna_record(rec, lista_campi);
test_write(rcondv);
}
else
{
TString msg;
msg << TR("Impossibile stabilire codice del listino ") << " '" << key << '\'';
log(msg);
}
}
rcondv.close();
}
rcondv.close();
return write_enabled();
}
@ -1276,8 +1299,7 @@ bool THardy_contratti::trasferisci()
int oldconto = -1;
int codcontratto = 0;
while (++hi)
{
{
aggiorna_record(rec_condv, lista_campi);
test_write(condv);
}
@ -1285,6 +1307,15 @@ bool THardy_contratti::trasferisci()
return write_enabled();
}
bool THardy_movcont::trasferisci()
{
return true;
}
bool THardy_moviva::trasferisci()
{
return true;
}
///////////////////////////////////////////////////////////
// TImportazioneHardy_mask
@ -1456,6 +1487,22 @@ void TImportazioneHardy_mask::trasferisci()
book.add(log);
rep_to_print = true;
}
if (go_on && get_bool(F_MOVCONT))
{
THardy_movcont pc;
pc.init(TR("Movimenti contabili"), query_header, log);
go_on = pc.trasferisci();
book.add(log);
rep_to_print = true;
}
if (go_on && get_bool(F_MOVIVA))
{
THardy_moviva pc;
pc.init(TR("Movimenti iva"), query_header, log);
go_on = pc.trasferisci();
book.add(log);
rep_to_print = true;
}
if (rep_to_print && book.pages() > 0)
book.preview();

View File

@ -226,9 +226,6 @@ public:
class THardy_listini : public THardy_transfer
{
protected:
bool trasferisci_listini();
bool trasferisci_listinid();
public:
virtual bool trasferisci();
};
@ -239,34 +236,16 @@ public:
virtual bool trasferisci();
};
class TCache_art;
class TCache_umart;
class TDocumento;
//////////////////////////////////////////////////////////
// Cache articoli
///////////////////////////////////////////////////////////
class TArticolo_hardy : public TRectype
class THardy_movcont : public THardy_transfer
{
TString _cust_code, _paper_comp;
TString4 _conai_scat[CONAI_CLASSES];
real _conai_peso[CONAI_CLASSES];
public:
void set_customer_code(const TString& cc) { _cust_code = cc; }
const TString& customer_code() const { return _cust_code; }
void set_paper_composition(const TString& pc) { _paper_comp = pc; }
const TString& paper_composition() const { return _paper_comp; }
virtual bool trasferisci();
};
const TString& conai_subclass(TCONAI_class cc) const { CHECK_CONAI(cc); return _conai_scat[cc]; }
const real& conai_weight(TCONAI_class cc) const { CHECK_CONAI(cc); return _conai_peso[cc]; }
bool set_conai(TCONAI_class cc, const TString& scat, const real& weight);
TArticolo_hardy(const TRectype& anamag);
TArticolo_hardy();
class THardy_moviva : public THardy_transfer
{
public:
virtual bool trasferisci();
};
#endif

View File

@ -20,6 +20,8 @@
#define F_LISTINI 155
#define F_CONTRATTI 156
#define F_AGENTI 157
#define F_MOVCONT 158
#define F_MOVIVA 160
#define F_DSN 201
#define F_USR 202

View File

@ -143,7 +143,7 @@ ALLEG =
CODALLEG =
GRUPPO =
CONTO =
GRUPPORIC =
GRUPPORIC =
CONTORIC =
SOTTOCRIC =
TIPOAPER =
@ -163,8 +163,8 @@ DATANASC =
STATONASC =
COMNASC =
CODSTAT =
CODABI =
CODCAB =
CODABI = IdBanca
CODCAB = IdAgenzia
NUMCC =
IBAN =
OCCAS =
@ -172,7 +172,7 @@ STATO =
CODVAL =
CODLIN =
FIDO =
CODPAG =
CODPAG = IdPagamento
RICALT =
OGGETTI =
SOSPESO =
@ -217,8 +217,8 @@ DATANASC =
STATONASC =
COMNASC =
CODSTAT =
CODABI =
CODCAB =
CODABI = IdBanca
CODCAB = IdAgenzia
NUMCC =
IBAN =
OCCAS =
@ -317,8 +317,8 @@ TIPO = _FISSO,L
CATVEN =
TIPOCF =
CODCF =
COD = KListino
DESCR = IdListino
COD = IdListino
DESCR = KListino
CODVAL = _TRADUCI,IdDivisa
CAMBIO =
CONTROEURO =
@ -331,7 +331,7 @@ GESTSCAGL =
GESTSCO =
OBBLIG =
CODLISSUCC =
SEQRIC =
SEQRIC = A---
DECIMALI =
FATHCATVEN =
FATHCOD =
@ -342,7 +342,6 @@ TIPO = _FISSO,L
CATVEN =
TIPOCF =
CODCF =
COD = KListino
TIPORIGA = _FISSO,A
CODRIGA = IdProdotto
UM =

View File

@ -119,6 +119,21 @@ BEGIN
PROMPT 32 14 "Agenti"
END
GROUPBOX DLG_NULL 78 3
BEGIN
PROMPT 1 17 "@bStorico"
END
BOOLEAN F_MOVCONT
BEGIN
PROMPT 2 18 "Mov. contabili"
END
BOOLEAN F_MOVIVA
BEGIN
PROMPT 32 18 "Mov. IVA"
END
ENDPAGE
PAGE "Configurazione" -1 -1 78 18