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 =
|
||||
"SELECT * "
|
||||
"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);
|
||||
TConfig& ini = config();
|
||||
@ -997,21 +998,27 @@ bool THardy_contratti::trasferisci()
|
||||
TRectype& rec = condv.curr();
|
||||
THardy_iterator hi(this);
|
||||
|
||||
// array per la conversione tra IdContratto e kContrattoT
|
||||
TAssoc_array listini, clienti;
|
||||
// array per la conversione tra kContrattoT e nostra chiave assegnata al contratto
|
||||
TAssoc_array contratti;
|
||||
|
||||
TString8 idlistino;
|
||||
TString8 idcontratto;
|
||||
|
||||
long curr_cliente = 0;
|
||||
int curr_contratto = 0;
|
||||
|
||||
while (++hi)
|
||||
{
|
||||
const TString8 klistino = get_str("KContrattoT");
|
||||
idlistino = get_str("IdContratto");
|
||||
const TString& key = get_str("ContrattiR.IdConto");
|
||||
const TString8 kcontrattot = get_str("KContrattoT");
|
||||
idcontratto = get_str("IdContratto");
|
||||
const TString& key = get_str("IdConto");
|
||||
const long codcf = hd_key2cli(key);
|
||||
listini.add(klistino, idlistino);
|
||||
clienti.add(klistino, key);
|
||||
if (curr_cliente != codcf)
|
||||
curr_contratto=0;
|
||||
curr_contratto++;
|
||||
aggiorna_record(rec, lista_campi);
|
||||
rec.put(CONDV_CODCF, codcf);
|
||||
rec.put(CONDV_COD, curr_contratto);
|
||||
contratti.add(kcontrattot, rec);
|
||||
test_write(condv);
|
||||
}
|
||||
condv.close();
|
||||
@ -1032,13 +1039,11 @@ bool THardy_contratti::trasferisci()
|
||||
while (++hi)
|
||||
{
|
||||
const char* key = get_str("KContrattoT");
|
||||
if (listini.is_key(key))
|
||||
if (contratti.is_key(key))
|
||||
{
|
||||
TString8& idlistino = (TString8&) listini[key];
|
||||
TString8& scodcf = (TString8&) clienti[key];
|
||||
const long codcf = hd_key2cli(scodcf);
|
||||
rec.put(RCONDV_COD, idlistino);
|
||||
rec.put(RCONDV_CODCF, codcf);
|
||||
TRectype& rec_condv = (TRectype&) contratti[key];
|
||||
rec.put(RCONDV_COD, rec_condv.get(CONDV_COD));
|
||||
rec.put(RCONDV_CODCF, rec_condv.get(CONDV_CODCF));
|
||||
aggiorna_record(rec, lista_campi);
|
||||
test_write(rcondv);
|
||||
}
|
||||
|
@ -373,8 +373,8 @@ TIPO = _FISSO,C
|
||||
CATVEN =
|
||||
TIPOCF = _FISSO,C
|
||||
CODCF =
|
||||
COD = IdContratto
|
||||
DESCR = DsContratto
|
||||
COD =
|
||||
DESCR = _STREXPR,LEFT(IdContratto+" "+DsContratto; 50)
|
||||
CODVAL = _TRADUCI,IdDivisa
|
||||
CAMBIO =
|
||||
CONTROEURO =
|
||||
@ -422,7 +422,7 @@ DATAPRZSTO =
|
||||
|
||||
[MOV]
|
||||
ANNOES = Esercizio
|
||||
NUMREG = KMovconT
|
||||
NUMREG =
|
||||
DATAREG = DataMovimento
|
||||
DATACOMP = DataCompetenza
|
||||
DATADOC = DataDocumento
|
||||
@ -471,7 +471,7 @@ LIQDIFF =
|
||||
|
||||
[RMOV]
|
||||
ANNOES = Esercizio
|
||||
NUMREG = KMovconT
|
||||
NUMREG =
|
||||
NUMRIG =
|
||||
SEZIONE =
|
||||
DATAREG = DataMovimento
|
||||
|
@ -72,12 +72,12 @@ bool THardy_movimenti::trasferisci_righe()
|
||||
|
||||
// calcolo dei campi non importabili direttamente
|
||||
TString4 sezione = "D";
|
||||
real imp_dare = recset_righe.get("Dare").as_real();
|
||||
real imp_avere = recset_righe.get("Avere").as_real();
|
||||
if (imp_avere> ZERO)
|
||||
TImporto imp_dare(sezione[0], recset_righe.get("Dare").as_real());
|
||||
TImporto imp_avere(sezione[0], recset_righe.get("Avere").as_real());
|
||||
if (imp_dare.is_zero())
|
||||
sezione = "A";
|
||||
_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();
|
||||
TString4 tipoc = recset_righe.get("IdContoTp").as_string();
|
||||
const char tipocc = tipoc[0];
|
||||
|
Loading…
x
Reference in New Issue
Block a user