Patch level : 2.2 crpa

Files correlati     : crpa0.exe crpa.ini
Ricompilazione Demo : [ ]
Commento            : piglio i movimenti di analitica anziche i mov. contabili (da provare  e riprovare!)


git-svn-id: svn://10.65.10.50/trunk@13483 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
cris 2005-11-10 13:56:52 +00:00
parent ee3db6820c
commit d9222468ef
2 changed files with 29 additions and 19 deletions

View File

@ -4,7 +4,7 @@ Password=pmc
Connect=zen1 Connect=zen1
Run= Run=
[23] [107]
TABLE=AGA_PRJDOC_T146_P TABLE=AGA_PRJDOC_T146_P
UNICO= UNICO=
ARCH=!_FIRM,_MOV ARCH=!_FIRM,_MOV
@ -18,11 +18,11 @@ NUMDOCFIS=NUMDOC
DTADOCFIS=!_D,DATADOC DTADOCFIS=!_D,DATADOC
DTAPERT=!_D,DATACOMP DTAPERT=!_D,DATACOMP
AZIENDA=!_FIRM AZIENDA=!_FIRM
TIPANA=TIPOCF TIPANA=23->TIPOCF
CODCF=CODCF CODCF=23->CODCF
CODVAL=!_CODVAL CODVAL=!_CODVAL
[24] [108]
TABLE=AGA_PRJDET_T147_P TABLE=AGA_PRJDET_T147_P
UNICO= UNICO=
ARCH=!_FIRM,_MOV ARCH=!_FIRM,_MOV
@ -37,7 +37,7 @@ IMPVAL=IMPORTO
NUMCOMM=CODCMS NUMCOMM=CODCMS
CODATTCM= CODATTCM=
ELSPESA=!_ELSPESAMOV ELSPESA=!_ELSPESAMOV
CENTCOST=FASCMS CENTCOST=CODFASE
DTACONS= DTACONS=
RIFRICH= RIFRICH=
RIFORD= RIFORD=

View File

@ -87,7 +87,7 @@ bool TIni2Sql::create()
_inputfilename.ltrim(2); _inputfilename.ltrim(2);
if (_inputfilename.exist()) if (_inputfilename.exist())
{ {
open_files(LF_MOV, LF_RMOV, LF_RMOVIVA, LF_DOC, LF_RIGHEDOC, LF_CLIFO, LF_PCON, LF_ABPCON, LF_CFVEN, LF_TABCOM, LF_TAB, 0); open_files(LF_MOV, LF_RMOV, LF_RMOVIVA, LF_DOC, LF_RIGHEDOC, LF_MOVANA, LF_RMOVANA, LF_CLIFO, LF_PCON, LF_ABPCON, LF_CFVEN, LF_TABCOM, LF_TAB, 0);
_inputfile = new TConfig(_inputfilename); _inputfile = new TConfig(_inputfilename);
_configfile = new TConfig("crpa.ini"); _configfile = new TConfig("crpa.ini");
_sqlfile = NULL; _sqlfile = NULL;
@ -260,7 +260,7 @@ bool TIni2Sql::search_costo_ricavo(TBill& conto, const TRiga_documento& r)
const char t = r.tipo().tipo(); const char t = r.tipo().tipo();
// Istanzia la causale del documento corrente... // Istanzia la causale del documento corrente...
const TTipo_documento& tipo = _doc->tipo(); const TTipo_documento& tipo = _doc->tipo(); // deve diventare tipo_riclassificato()
TString16 codcaus(tipo.causale()); TString16 codcaus(tipo.causale());
TToken_string key; TToken_string key;
@ -535,7 +535,7 @@ void TIni2Sql::validate(const TString& elabfield, TString& str)
str.format("%02ld%s", _firm, (const char*) tmpstr); str.format("%02ld%s", _firm, (const char*) tmpstr);
} }
else if (code == "_UNICMOV") // campo UNICARCH nel caso di movimenti else if (code == "_UNICMOV") // campo UNICARCH nel caso di movimenti
str.format("%s-%s-%ld", (const char*) _inputfile->get("CODCAUS","23"), (const char*) _inputfile->get("ANNOES", "23"), _inputfile->get_long("NUMREG", "23")); str.format("%s-%s-%ld", (const char*) _inputfile->get("CODCAUS","107"), (const char*) _inputfile->get("ANNOES", "107"), _inputfile->get_long("NUMREG", "107"));
else if (code == "_UNICDOC") // campo UNICARCH nel caso di documenti else if (code == "_UNICDOC") // campo UNICARCH nel caso di documenti
str.format("%s-%s-%s", (const char*) _inputfile->get("CODNUM", "33"), (const char*) _inputfile->get("ANNO", "33"), (const char*) _inputfile->get("NDOC", "33")); str.format("%s-%s-%s", (const char*) _inputfile->get("CODNUM", "33"), (const char*) _inputfile->get("ANNO", "33"), (const char*) _inputfile->get("NDOC", "33"));
else if (code == "_CODVAL") // campo codice valuta else if (code == "_CODVAL") // campo codice valuta
@ -553,9 +553,10 @@ void TIni2Sql::validate(const TString& elabfield, TString& str)
TToken_string key; TToken_string key;
if (code == "_ELSPESAMOV") // per righe movimenti if (code == "_ELSPESAMOV") // per righe movimenti
{ {
key = _inputfile->get("GRUPPO"); key = _inputfile->get("CODCOSTO", "108");
key.add(_inputfile->get("CONTO")); //key = _inputfile->get("GRUPPO");
key.add(_inputfile->get("SOTTOCONTO")); //key.add(_inputfile->get("CONTO"));
//key.add(_inputfile->get("SOTTOCONTO"));
} }
else // per righe documenti else // per righe documenti
key.format("%d|%d|%ld", _conto.gruppo(), _conto.conto(), _conto.sottoconto()); key.format("%d|%d|%ld", _conto.gruppo(), _conto.conto(), _conto.sottoconto());
@ -571,7 +572,7 @@ void TIni2Sql::validate(const TString& elabfield, TString& str)
else if (code == "_DESRMOV") // campo DESART per righe movimenti else if (code == "_DESRMOV") // campo DESART per righe movimenti
{ {
process_field("DESCR", tmpstr, -1, FALSE); process_field("DESCR", tmpstr, -1, FALSE);
str.format("%s-%s", (const char*) _inputfile->get("CODCAUS","23"), (const char*) tmpstr); str.format("%s-%s", (const char*) _inputfile->get("CODCAUS","107"), (const char*) tmpstr);
} }
else if (code == "_DESMOV") // campo DESART per movimenti else if (code == "_DESMOV") // campo DESART per movimenti
{ {
@ -579,12 +580,17 @@ void TIni2Sql::validate(const TString& elabfield, TString& str)
str.format("%s (%s)", (const char*) tmpstr, (const char*) _inputfile->get("PROTIVA")); str.format("%s (%s)", (const char*) tmpstr, (const char*) _inputfile->get("PROTIVA"));
} }
else if (code == "_CODART") // campo CODART per movimenti else if (code == "_CODART") // campo CODART per movimenti
str.format("%s-%s-%s", (const char*) _inputfile->get("GRUPPO"), (const char*) _inputfile->get("CONTO"), (const char*) _inputfile->get("SOTTOCONTO")); str = _inputfile->get("CODCOSTO", "108");
//str.format("%s-%s-%s", (const char*) _inputfile->get("GRUPPO"), (const char*) _inputfile->get("CONTO"), (const char*) _inputfile->get("SOTTOCONTO"));
else if (code == "_IMPORTORMOV") // campo importo per righe movimenti else if (code == "_IMPORTORMOV") // campo importo per righe movimenti
{ {
real importo(_inputfile->get("IMPORTO")); real importo(_inputfile->get("IMPORTO"));
const int gruppo = atoi(_inputfile->get("GRUPPO")); //const int gruppo = atoi(_inputfile->get("GRUPPO"));
const int conto = atoi(_inputfile->get("CONTO")); //const int conto = atoi(_inputfile->get("CONTO"));
TString80 codcosto;
codcosto = _inputfile->get("CODCOSTO");
const int gruppo = atoi(codcosto.sub(0,3));
const int conto = atoi(codcosto.sub(3,3));
str = _inputfile->get("SEZIONE"); str = _inputfile->get("SEZIONE");
const char sezione = str[0]; const char sezione = str[0];
if (test_swap_conto(gruppo, conto, sezione)) if (test_swap_conto(gruppo, conto, sezione))
@ -593,8 +599,12 @@ void TIni2Sql::validate(const TString& elabfield, TString& str)
} }
else if (code == "_SEZIONERMOV") // campo sezione per righe movimenti else if (code == "_SEZIONERMOV") // campo sezione per righe movimenti
{ {
const int gruppo = atoi(_inputfile->get("GRUPPO")); //const int gruppo = atoi(_inputfile->get("GRUPPO"));
const int conto = atoi(_inputfile->get("CONTO")); //const int conto = atoi(_inputfile->get("CONTO"));
TString80 codcosto;
codcosto = _inputfile->get("CODCOSTO");
const int gruppo = atoi(codcosto.sub(0,3));
const int conto = atoi(codcosto.sub(3,3));
str = _inputfile->get("SEZIONE"); str = _inputfile->get("SEZIONE");
const char sezione = str[0]; const char sezione = str[0];
if (test_swap_conto(gruppo, conto, sezione)) if (test_swap_conto(gruppo, conto, sezione))
@ -1024,8 +1034,8 @@ void TIni2Sql::write_sqldelete()
condizione.cut(0); condizione.cut(0);
if ( if (
(numpar == 23 || numpar == 33) || // Inizialmente era richiesto di cancellare solo le testate ... (numpar == 107 || numpar == 33) || // Inizialmente era richiesto di cancellare solo le testate ...
((numpar == 24 || numpar == 34) && numrig == 1) // ... ovviamente ora non più ((numpar == 108 || numpar == 34) && numrig == 1) // ... ovviamente ora non più
) )
{ {
cancella.format("DELETE FROM %s", (const char*) _configfile->get("TABLE", strpar)); cancella.format("DELETE FROM %s", (const char*) _configfile->get("TABLE", strpar));