Patch level : 2.2 csa

Files correlati     : cg7.exe proforma.ini
Ricompilazione Demo : [ ]
Commento            : corretto voce di spesa


git-svn-id: svn://10.65.10.50/trunk@13503 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
cris 2005-11-18 10:40:20 +00:00
parent 1985ae8986
commit e16e3c656d
2 changed files with 35 additions and 14 deletions

View File

@ -24,11 +24,6 @@
#include "../ca/movana.h"
#include "../ca/rmovana.h"
#define ALIAS_PCON1 100
#define ALIAS_PCON2 200
#define ALIAS_ABPCON1 300
#define ALIAS_ABPCON2 400
class TInvioP_file: public TFile_text
{
protected:
@ -101,6 +96,7 @@ 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);
TInvioP_file* apri_file(const char* nome);
void chiudi_file(TInvioP_file* trasfile);
@ -135,11 +131,12 @@ void TInvioP_file::validate(TCursor& cur,TRecord_text &rec, TToken_string &s, TS
valore << str;
valore.trim();
}
else if (code == "_CODCBL")
else if (code == "_VOCESPESA")
{
valore = str;
int i = valore.find("$");
valore = valore.left(i);
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")
{
@ -189,6 +186,32 @@ void TInvioP::chiudi_file(TInvioP_file* trasfile)
delete trasfile;
}
const char* TInvioP::get_vocespesa(const int gruppo,const int conto, const long sottoc)
{
TFilename configname = "cg7200a.ini"; //file configurazione della maschera
configname.custom_path();
TConfig configfile(configname);
TString80 confstringa = configfile.get("CONFSTRINGA");
confstringa.trim();
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());
for (panapdc.read(); !panapdc.eof(); panapdc.next())
{
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);
}
return "";
}
bool TInvioP::i_proforma_conti()
{
TInvioP_file* trasfile = apri_file("pianocon");

View File

@ -221,8 +221,7 @@ NAME(14) = VOCE DI SPESA
TYPE(14) = STRINGA
POSITION(14) = 145
LENGTH(14) = 10
//MESSAGE(14) = _CODCBL
//FIELD(14) = 300@->DESCRIZ
MESSAGE(14) = _VOCESPESA
[RECORD I]
@ -303,8 +302,7 @@ NAME(14) = VOCE DI SPESA
TYPE(14) = STRINGA
POSITION(14) = 145
LENGTH(14) = 10
//MESSAGE(14) = _CODCBL
//FIELD(14) = 400@->DESCRIZ
MESSAGE(14) = _VOCESPESA
[RECORD C]
@ -372,7 +370,7 @@ POSITION(0) = 0
LENGTH(0) = 5
FIELD(0)=19->GRUPPO
NAME(1) = CODICE MCONTO
NAME(1) = CODICE CONTO
TYPE(1) = STRINGA
POSITION(1) = 5
B LENGTH(1) = 5