Patch level :2.2 282
Files correlati :cg7.exe Ricompilazione Demo : [ ] Commento :sistemata la procedura di trasferimento della voce di spesa git-svn-id: svn://10.65.10.50/trunk@13642 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
d832dfd5f9
commit
5488f6c06a
@ -291,9 +291,9 @@ protected:
|
||||
|
||||
public:
|
||||
const real get_importo() {return _importo;};
|
||||
const char* get_nregcosto() {return format("%d", _nregcosto);};
|
||||
const char* get_nregpag() {return format("%d", _nregpag);};
|
||||
const char* get_vocespesa(const int gruppo, const int conto, const long sottoc);
|
||||
const char* get_nregcosto() const {return format("%d", _nregcosto);};
|
||||
const char* get_nregpag() const {return format("%d", _nregpag);};
|
||||
const TString& get_vocespesa(const TString& zio) const;
|
||||
TInvioP_file* apri_file(const char* nome);
|
||||
void chiudi_file(TInvioP_file* trasfile);
|
||||
|
||||
@ -328,13 +328,6 @@ void TInvioP_file::validate(TCursor& cur,TRecord_text &rec, TToken_string &s, TS
|
||||
valore << str;
|
||||
valore.trim();
|
||||
}
|
||||
else if (code == "_VOCESPESA")
|
||||
{
|
||||
const int gruppo = atoi(rec.get(3));
|
||||
const int conto = atoi(rec.get(4));
|
||||
const long sottoc = atol(rec.get(5));
|
||||
valore = app().get_vocespesa(gruppo, conto, sottoc);
|
||||
}
|
||||
else if (code == "_RAGSOC")
|
||||
{
|
||||
valore = str;
|
||||
@ -358,11 +351,6 @@ void TInvioP_file::validate(TCursor& cur,TRecord_text &rec, TToken_string &s, TS
|
||||
{
|
||||
valore = app().get_importo().string();
|
||||
}
|
||||
/* else if (code == "_GRUPPO")
|
||||
{
|
||||
const int gruppo = atoi(rec.get(3));
|
||||
valore = gruppo;
|
||||
}*/
|
||||
|
||||
else NFCHECK("Macro non definita: %s", (const char *)code);
|
||||
str = valore;
|
||||
@ -388,30 +376,29 @@ void TInvioP::chiudi_file(TInvioP_file* trasfile)
|
||||
delete trasfile;
|
||||
}
|
||||
|
||||
const char* TInvioP::get_vocespesa(const int gruppo,const int conto, const long sottoc)
|
||||
const TString& TInvioP::get_vocespesa(const TString& zio) const
|
||||
{
|
||||
TFilename configname = "cg7200a.ini"; //file configurazione della maschera
|
||||
configname.custom_path();
|
||||
TConfig configfile(configname);
|
||||
TString80 confstringa = configfile.get("CONFSTRINGA");
|
||||
confstringa.trim();
|
||||
TConfig configfile("cg7200a.ini", "OPZIONI");
|
||||
const TString16 confstringa = configfile.get("CONFSTRINGA");
|
||||
const int len = confstringa.len();
|
||||
|
||||
TLocalisamfile panapdc(LF_PANAPDC);
|
||||
panapdc.zero();
|
||||
panapdc.setkey(2);
|
||||
panapdc.put("GRUPPO", gruppo);
|
||||
panapdc.put("CONTO", conto);
|
||||
panapdc.put("SOTTOCONTO", sottoc);
|
||||
TRectype r(panapdc.curr());
|
||||
panapdc.put("GRUPPO", atoi(zio.mid(0,3)));
|
||||
panapdc.put("CONTO", atoi(zio.mid(3,3)));
|
||||
panapdc.put("SOTTOCONTO", atol(zio.mid(6,6)));
|
||||
const TRectype r(panapdc.curr());
|
||||
|
||||
for (panapdc.read(); !panapdc.eof(); panapdc.next())
|
||||
{
|
||||
if (panapdc.curr() != r) break;
|
||||
if (panapdc.curr() != r)
|
||||
break;
|
||||
const TString& codconto = panapdc.get("CODCONTO");
|
||||
const TString& prefisso = codconto.sub(0,len-1);
|
||||
if (prefisso == confstringa)
|
||||
return codconto.sub(len-1);
|
||||
if (codconto.starts_with(confstringa))
|
||||
return codconto.mid(len);
|
||||
}
|
||||
return "";
|
||||
return EMPTY_STRING;
|
||||
}
|
||||
|
||||
bool TInvioP::i_proforma_conti()
|
||||
@ -530,9 +517,13 @@ bool TInvioP::i_proforma_righe(TCursor& cur, TInvioP_file* trasfilerighe)
|
||||
conti_importi.sottrai(riga);
|
||||
|
||||
//procedura orrenda per eliminare gli zeri dai gr/co/sot e passarli come stringhe!
|
||||
const TString zio = cur_rmovana.curr().get(RMOVANA_CODCONTO);
|
||||
const TString16 zio = cur_rmovana.curr().get(RMOVANA_CODCONTO);
|
||||
stringa_grcosot(recrighe, zio);
|
||||
|
||||
//procedura per ricavare la voce di spesa
|
||||
const TString& vocespesa = get_vocespesa(zio);
|
||||
recrighe.add(vocespesa, 14);
|
||||
|
||||
//scrive sul file di trasferimento (alla faccia della semplicita'!)
|
||||
trasfilerighe->write(recrighe);
|
||||
}
|
||||
@ -578,6 +569,10 @@ bool TInvioP::i_proforma_righe(TCursor& cur, TInvioP_file* trasfilerighe)
|
||||
recrighe.add(pn.curr().get(RMV_DESCR), 8); //descrizione
|
||||
recrighe.add(imp.valore().string(), 9); //importo
|
||||
|
||||
//procedura per ricavare la voce di spesa
|
||||
const TString& vocespesa = get_vocespesa(zio);
|
||||
recrighe.add(vocespesa, 14);
|
||||
|
||||
//e finalmente scrive le righe avanzate...
|
||||
trasfilerighe->write(recrighe);
|
||||
}
|
||||
@ -694,6 +689,12 @@ bool TInvioP::i_proforma_righe(TCursor& cur, TInvioP_file* trasfilerighe)
|
||||
|
||||
recrigheiva.add(riga.get(RMOVANA_DESCR).left(40), 8); //descrizione riga iva = riga anale corrente
|
||||
recrigheiva.add(riga.get(RMOVANA_CODCMS), 13); //commessa presa dalla riga analitica corrente
|
||||
|
||||
//procedura per ricavare la voce di spesa
|
||||
TString uncle = zio.string(0x8);
|
||||
const TString& vocespesa = get_vocespesa(uncle);
|
||||
recrighe.add(vocespesa, 14);
|
||||
|
||||
trasfilerighe->write(recrigheiva);
|
||||
}
|
||||
} //if(codivae!=..
|
||||
@ -713,6 +714,10 @@ bool TInvioP::i_proforma_righe(TCursor& cur, TInvioP_file* trasfilerighe)
|
||||
trasfilerighe->autoload(recrigheiva, cur_rmoviva);
|
||||
recrigheiva.add(uncle.tipo(), 6); //tipocf
|
||||
recrigheiva.add(uncle.descrizione().left(40), 8); //descrizione della riga iva = descrizione conto
|
||||
//procedura per ricavare la voce di spesa
|
||||
TString zio = uncle.string(0x8);
|
||||
const TString& vocespesa = get_vocespesa(zio);
|
||||
recrighe.add(vocespesa, 14);
|
||||
trasfilerighe->write(recrigheiva);
|
||||
}
|
||||
}
|
||||
|
@ -216,7 +216,6 @@ NAME(14) = VOCE DI SPESA
|
||||
TYPE(14) = STRINGA
|
||||
POSITION(14) = 145
|
||||
LENGTH(14) = 10
|
||||
MESSAGE(14) = _VOCESPESA
|
||||
|
||||
[RECORD I]
|
||||
|
||||
@ -295,7 +294,6 @@ NAME(14) = VOCE DI SPESA
|
||||
TYPE(14) = STRINGA
|
||||
POSITION(14) = 145
|
||||
LENGTH(14) = 10
|
||||
MESSAGE(14) = _VOCESPESA
|
||||
|
||||
[RECORD C]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user