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.zero();
rec.put(CLI_TIPOCF, "F"); rec.put(CLI_TIPOCF, "F");
rec.put(CLI_CODCF, codcf); 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 // ricerca comune
const TString8 cap = get_str("IdCap"); //cap const TString8 cap = get_str("IdCap"); //cap
TString80 loc = get_str("Localita"); //località TString80 loc = get_str("Localita"); //località
@ -1198,14 +1208,7 @@ bool THardy_agenti::trasferisci()
bool THardy_listini::trasferisci() bool THardy_listini::trasferisci()
{ {
if (trasferisci_listini()) // trasferisce tabella Listini (condv L)
return trasferisci_listinid();
return false;
}
// trasferisce tabella Listini (condv L)
bool THardy_listini::trasferisci_listini()
{
TString query = TString query =
"SELECT * " "SELECT * "
"FROM dbo.Listini "; "FROM dbo.Listini ";
@ -1217,35 +1220,55 @@ bool THardy_listini::trasferisci_listini()
condv.open(_lock); condv.open(_lock);
TRectype& rec = condv.curr(); TRectype& rec = condv.curr();
THardy_iterator hi(this); THardy_iterator hi(this);
// array per la conversione tra IdListino e kListino
TAssoc_array listini;
TToken_string key;
TString8 idlistino;
while (++hi) while (++hi)
{ {
const TString8 klistino = get_str("KListino");
idlistino = get_str("IdListino");
listini.add(klistino, idlistino);
aggiorna_record(rec, lista_campi); aggiorna_record(rec, lista_campi);
test_write(condv); test_write(condv);
} }
condv.close(); condv.close();
return write_enabled(); // trasferisce tabella ListiniD (RCONDV)
} if (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)
{ {
aggiorna_record(rec, lista_campi); TString query =
test_write(rcondv); "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(); return write_enabled();
} }
@ -1276,8 +1299,7 @@ bool THardy_contratti::trasferisci()
int oldconto = -1; int oldconto = -1;
int codcontratto = 0; int codcontratto = 0;
while (++hi) while (++hi)
{ {
aggiorna_record(rec_condv, lista_campi); aggiorna_record(rec_condv, lista_campi);
test_write(condv); test_write(condv);
} }
@ -1285,6 +1307,15 @@ bool THardy_contratti::trasferisci()
return write_enabled(); return write_enabled();
} }
bool THardy_movcont::trasferisci()
{
return true;
}
bool THardy_moviva::trasferisci()
{
return true;
}
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
// TImportazioneHardy_mask // TImportazioneHardy_mask
@ -1456,6 +1487,22 @@ void TImportazioneHardy_mask::trasferisci()
book.add(log); book.add(log);
rep_to_print = true; 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) if (rep_to_print && book.pages() > 0)
book.preview(); book.preview();

View File

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

View File

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

View File

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

View File

@ -119,6 +119,21 @@ BEGIN
PROMPT 32 14 "Agenti" PROMPT 32 14 "Agenti"
END 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 ENDPAGE
PAGE "Configurazione" -1 -1 78 18 PAGE "Configurazione" -1 -1 78 18