Patch level :
Files correlati : Ricompilazione Demo : [ ] Commento : git-svn-id: svn://10.65.10.50/branches/R_10_00@21318 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
8c78f4fb87
commit
1e1fcb0345
@ -986,7 +986,8 @@ bool THardy_contratti::trasferisci()
|
|||||||
TString query =
|
TString query =
|
||||||
"SELECT * "
|
"SELECT * "
|
||||||
"FROM dbo.ContrattiT, dbo.ContrattiR "
|
"FROM dbo.ContrattiT, dbo.ContrattiR "
|
||||||
"WHERE ContrattiT.KContrattoT=ContrattiR.KContrattoT";
|
"WHERE dbo.ContrattiT.KContrattoT=dbo.ContrattiR.KContrattoT "
|
||||||
|
"ORDER BY dbo.ContrattiR.IdConto ";
|
||||||
|
|
||||||
TRecordset& recset = create_recordset(query);
|
TRecordset& recset = create_recordset(query);
|
||||||
TConfig& ini = config();
|
TConfig& ini = config();
|
||||||
@ -997,21 +998,27 @@ bool THardy_contratti::trasferisci()
|
|||||||
TRectype& rec = condv.curr();
|
TRectype& rec = condv.curr();
|
||||||
THardy_iterator hi(this);
|
THardy_iterator hi(this);
|
||||||
|
|
||||||
// array per la conversione tra IdContratto e kContrattoT
|
// array per la conversione tra kContrattoT e nostra chiave assegnata al contratto
|
||||||
TAssoc_array listini, clienti;
|
TAssoc_array contratti;
|
||||||
|
|
||||||
TString8 idlistino;
|
TString8 idcontratto;
|
||||||
|
|
||||||
|
long curr_cliente = 0;
|
||||||
|
int curr_contratto = 0;
|
||||||
|
|
||||||
while (++hi)
|
while (++hi)
|
||||||
{
|
{
|
||||||
const TString8 klistino = get_str("KContrattoT");
|
const TString8 kcontrattot = get_str("KContrattoT");
|
||||||
idlistino = get_str("IdContratto");
|
idcontratto = get_str("IdContratto");
|
||||||
const TString& key = get_str("ContrattiR.IdConto");
|
const TString& key = get_str("IdConto");
|
||||||
const long codcf = hd_key2cli(key);
|
const long codcf = hd_key2cli(key);
|
||||||
listini.add(klistino, idlistino);
|
if (curr_cliente != codcf)
|
||||||
clienti.add(klistino, key);
|
curr_contratto=0;
|
||||||
|
curr_contratto++;
|
||||||
aggiorna_record(rec, lista_campi);
|
aggiorna_record(rec, lista_campi);
|
||||||
rec.put(CONDV_CODCF, codcf);
|
rec.put(CONDV_CODCF, codcf);
|
||||||
|
rec.put(CONDV_COD, curr_contratto);
|
||||||
|
contratti.add(kcontrattot, rec);
|
||||||
test_write(condv);
|
test_write(condv);
|
||||||
}
|
}
|
||||||
condv.close();
|
condv.close();
|
||||||
@ -1032,13 +1039,11 @@ bool THardy_contratti::trasferisci()
|
|||||||
while (++hi)
|
while (++hi)
|
||||||
{
|
{
|
||||||
const char* key = get_str("KContrattoT");
|
const char* key = get_str("KContrattoT");
|
||||||
if (listini.is_key(key))
|
if (contratti.is_key(key))
|
||||||
{
|
{
|
||||||
TString8& idlistino = (TString8&) listini[key];
|
TRectype& rec_condv = (TRectype&) contratti[key];
|
||||||
TString8& scodcf = (TString8&) clienti[key];
|
rec.put(RCONDV_COD, rec_condv.get(CONDV_COD));
|
||||||
const long codcf = hd_key2cli(scodcf);
|
rec.put(RCONDV_CODCF, rec_condv.get(CONDV_CODCF));
|
||||||
rec.put(RCONDV_COD, idlistino);
|
|
||||||
rec.put(RCONDV_CODCF, codcf);
|
|
||||||
aggiorna_record(rec, lista_campi);
|
aggiorna_record(rec, lista_campi);
|
||||||
test_write(rcondv);
|
test_write(rcondv);
|
||||||
}
|
}
|
||||||
|
@ -373,8 +373,8 @@ TIPO = _FISSO,C
|
|||||||
CATVEN =
|
CATVEN =
|
||||||
TIPOCF = _FISSO,C
|
TIPOCF = _FISSO,C
|
||||||
CODCF =
|
CODCF =
|
||||||
COD = IdContratto
|
COD =
|
||||||
DESCR = DsContratto
|
DESCR = _STREXPR,LEFT(IdContratto+" "+DsContratto; 50)
|
||||||
CODVAL = _TRADUCI,IdDivisa
|
CODVAL = _TRADUCI,IdDivisa
|
||||||
CAMBIO =
|
CAMBIO =
|
||||||
CONTROEURO =
|
CONTROEURO =
|
||||||
@ -422,7 +422,7 @@ DATAPRZSTO =
|
|||||||
|
|
||||||
[MOV]
|
[MOV]
|
||||||
ANNOES = Esercizio
|
ANNOES = Esercizio
|
||||||
NUMREG = KMovconT
|
NUMREG =
|
||||||
DATAREG = DataMovimento
|
DATAREG = DataMovimento
|
||||||
DATACOMP = DataCompetenza
|
DATACOMP = DataCompetenza
|
||||||
DATADOC = DataDocumento
|
DATADOC = DataDocumento
|
||||||
@ -471,7 +471,7 @@ LIQDIFF =
|
|||||||
|
|
||||||
[RMOV]
|
[RMOV]
|
||||||
ANNOES = Esercizio
|
ANNOES = Esercizio
|
||||||
NUMREG = KMovconT
|
NUMREG =
|
||||||
NUMRIG =
|
NUMRIG =
|
||||||
SEZIONE =
|
SEZIONE =
|
||||||
DATAREG = DataMovimento
|
DATAREG = DataMovimento
|
||||||
|
@ -72,12 +72,12 @@ bool THardy_movimenti::trasferisci_righe()
|
|||||||
|
|
||||||
// calcolo dei campi non importabili direttamente
|
// calcolo dei campi non importabili direttamente
|
||||||
TString4 sezione = "D";
|
TString4 sezione = "D";
|
||||||
real imp_dare = recset_righe.get("Dare").as_real();
|
TImporto imp_dare(sezione[0], recset_righe.get("Dare").as_real());
|
||||||
real imp_avere = recset_righe.get("Avere").as_real();
|
TImporto imp_avere(sezione[0], recset_righe.get("Avere").as_real());
|
||||||
if (imp_avere> ZERO)
|
if (imp_dare.is_zero())
|
||||||
sezione = "A";
|
sezione = "A";
|
||||||
_conf->set(RMV_SEZIONE, sezione);
|
_conf->set(RMV_SEZIONE, sezione);
|
||||||
_conf->set(RMV_IMPORTO, (imp_dare > ZERO ? imp_dare.string() : imp_avere.string()));
|
_conf->set(RMV_IMPORTO, (imp_avere.is_zero() ? imp_dare.valore().string() : imp_avere.valore().string()));
|
||||||
const TString& key = recset_righe.get("IdConto").as_string();
|
const TString& key = recset_righe.get("IdConto").as_string();
|
||||||
TString4 tipoc = recset_righe.get("IdContoTp").as_string();
|
TString4 tipoc = recset_righe.get("IdContoTp").as_string();
|
||||||
const char tipocc = tipoc[0];
|
const char tipocc = tipoc[0];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user