cg6400.cpp Corretto errore MI 3685
cg6700.cpp Corretto errore MI 3697 cg6700a.uml Aggiunto titolo alla maschera cg6900.cpp Corretta chiusura file temporanei cg6902.cpp Aggiunto test del valore di ritorno di una fcopy git-svn-id: svn://10.65.10.50/trunk@6364 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
d68ee462e9
commit
69a6fa10f6
138
cg/cg6400.cpp
138
cg/cg6400.cpp
@ -18,7 +18,7 @@
|
||||
#include "cglib04.h"
|
||||
#include "cgsaldac.h"
|
||||
|
||||
class TRic_archivi : public TApplication
|
||||
class TRic_archivi : public TSkeleton_application
|
||||
{
|
||||
// TTable* _tab_tra;
|
||||
TTransfer_file* _tras_file;
|
||||
@ -54,8 +54,7 @@ public:
|
||||
|
||||
virtual bool create();
|
||||
virtual bool destroy();
|
||||
virtual bool menu(MENU_TAG m);
|
||||
bool main_loop();
|
||||
virtual void main_loop();
|
||||
bool leggi_marker();
|
||||
bool leggi_marker_rep();
|
||||
void leggi_trasfer(const char* nome);
|
||||
@ -82,9 +81,11 @@ _scelta(toupper(ric_trasfer)), _ric_auto(toupper(ric_auto))
|
||||
{
|
||||
if (_scelta == 'S')
|
||||
_titolo = "Ricezione archivi da sistema";
|
||||
|
||||
if (_scelta == 'P')
|
||||
else
|
||||
{
|
||||
_scelta = 'P';
|
||||
_titolo = "Ricezione archivi da PC";
|
||||
}
|
||||
}
|
||||
|
||||
bool TRic_archivi::create()
|
||||
@ -148,10 +149,12 @@ void TRic_archivi::componi_path(TMask* msk)
|
||||
drive = msk->get(F_DRIVE);
|
||||
pos = path.find(':');
|
||||
|
||||
if (drive == "A:" || drive == "B:" || drive == "D:" || drive == "E:")
|
||||
// Inizio cazzata - da sostituire con _disketto = ::os_is_removable_drive(drive)
|
||||
if (drive == "A:" || drive == "B:")
|
||||
_disketto = TRUE;
|
||||
else
|
||||
_disketto = FALSE;
|
||||
// Fine cazzata
|
||||
|
||||
if (pos)
|
||||
path = path.mid(pos+1);
|
||||
@ -331,7 +334,7 @@ bool TRic_archivi::leggi_marker_rep()
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool TRic_archivi::main_loop()
|
||||
void TRic_archivi::main_loop()
|
||||
{
|
||||
if (_ric_auto == 'A')
|
||||
{
|
||||
@ -365,11 +368,10 @@ bool TRic_archivi::main_loop()
|
||||
{
|
||||
if (_scelta == 'S')
|
||||
{
|
||||
TMask* msk = new TMask("cg6400b");
|
||||
KEY tasto;
|
||||
|
||||
tasto = msk->run();
|
||||
|
||||
TMask maskera("cg6400b");
|
||||
TMask* msk = &maskera;
|
||||
|
||||
KEY tasto = msk->run();
|
||||
if (tasto == K_ENTER)
|
||||
{
|
||||
componi_path(msk);
|
||||
@ -382,55 +384,35 @@ bool TRic_archivi::main_loop()
|
||||
if (yesno_box("Inserire il dischetto %d nell' unita' %c", _numdisk,drive))
|
||||
{
|
||||
if (!leggi_marker())
|
||||
{
|
||||
delete msk;
|
||||
return FALSE;
|
||||
}
|
||||
return;
|
||||
|
||||
if (_sequenza)
|
||||
{
|
||||
if (video_ripartenza())
|
||||
ripristina_trasfer();
|
||||
else
|
||||
{
|
||||
delete msk;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return;
|
||||
_numdisk++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
delete msk;
|
||||
return FALSE;
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!leggi_marker())
|
||||
{
|
||||
delete msk;
|
||||
return FALSE;
|
||||
}
|
||||
return;
|
||||
|
||||
if (_sequenza)
|
||||
{
|
||||
if (video_ripartenza())
|
||||
ripristina_trasfer();
|
||||
else
|
||||
{
|
||||
delete msk;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return;
|
||||
_numdisk++;
|
||||
}
|
||||
else
|
||||
{
|
||||
delete msk;
|
||||
return FALSE;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
while (_numdisk <= _numtotdisk);
|
||||
@ -448,15 +430,14 @@ bool TRic_archivi::main_loop()
|
||||
::remove(tabcdx);
|
||||
::remove(tabdbf);
|
||||
}
|
||||
delete msk;
|
||||
}
|
||||
else
|
||||
if (_scelta == 'P')
|
||||
{
|
||||
TMask* msk = new TMask("cg6400b");
|
||||
KEY tasto;
|
||||
TMask maskera("cg6400b");
|
||||
TMask* msk = &maskera;
|
||||
|
||||
tasto = msk->run();
|
||||
KEY tasto = msk->run();
|
||||
|
||||
if (tasto == K_ENTER)
|
||||
{
|
||||
@ -470,55 +451,35 @@ bool TRic_archivi::main_loop()
|
||||
if (yesno_box("Inserire il dischetto %d nell' unita' %c", _numdisk,drive))
|
||||
{
|
||||
if (!leggi_marker_rep())
|
||||
{
|
||||
delete msk;
|
||||
return FALSE;
|
||||
}
|
||||
return;
|
||||
|
||||
if (_sequenza)
|
||||
{
|
||||
if (video_ripartenza())
|
||||
ripristina_trasfer();
|
||||
else
|
||||
{
|
||||
delete msk;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return;
|
||||
_numdisk++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
delete msk;
|
||||
return FALSE;
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!leggi_marker_rep())
|
||||
{
|
||||
delete msk;
|
||||
return FALSE;
|
||||
}
|
||||
return;
|
||||
|
||||
if (_sequenza)
|
||||
{
|
||||
if (video_ripartenza())
|
||||
ripristina_trasfer();
|
||||
else
|
||||
{
|
||||
delete msk;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return;
|
||||
_numdisk++;
|
||||
}
|
||||
else
|
||||
{
|
||||
delete msk;
|
||||
return FALSE;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
while (_numdisk <= _numtotdisk);
|
||||
@ -529,11 +490,8 @@ bool TRic_archivi::main_loop()
|
||||
_tras_file->close(); // Chiude il trasfer letto dalla directory della ditta
|
||||
::remove(_trasf);
|
||||
}
|
||||
delete msk;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TRic_archivi::leggi_trasfer(const char* nome)
|
||||
@ -633,7 +591,10 @@ bool TRic_archivi::video_ripartenza()
|
||||
leggi_trasfer("\\trasfer");
|
||||
|
||||
_prima_volta = FALSE;
|
||||
TMask* msk = new TMask("cg6400a");
|
||||
|
||||
TMask maskera("cg6400a");
|
||||
TMask* msk = &maskera;
|
||||
|
||||
KEY tasto;
|
||||
|
||||
ditta_ricevente();
|
||||
@ -660,11 +621,10 @@ bool TRic_archivi::video_ripartenza()
|
||||
msk->set(F_DATAULTRASTAB, data2);
|
||||
}
|
||||
|
||||
if (_stato_ripartenza == 1 || _stato_ripartenza == 2 )
|
||||
msk->set(F_STATO, "NON COMPLETO");
|
||||
if (_stato_ripartenza == 0)
|
||||
msk->set(F_STATO, "COMPLETO");
|
||||
else
|
||||
if (_stato_ripartenza == 0)
|
||||
msk->set(F_STATO, "COMPLETO");
|
||||
msk->set(F_STATO, "NON COMPLETO");
|
||||
|
||||
if (_numdisk == 1) // Va fatto solo per il primo disco
|
||||
{
|
||||
@ -675,37 +635,26 @@ bool TRic_archivi::video_ripartenza()
|
||||
tasto = msk->run();
|
||||
|
||||
if (tasto != K_ENTER)
|
||||
{
|
||||
delete msk;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (_baipassa)
|
||||
{
|
||||
delete msk;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (!ripartenza())
|
||||
{
|
||||
delete msk;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (_numinv > (_nultras_tab + 1))
|
||||
warning_box("Trasferimento FUORI SEQUENZA: manca un trasferimento intermedio");
|
||||
warning_box("Trasferimento FUORI SEQUENZA: manca un trasferimento intermedio.\n"
|
||||
"Numero invio n. %d, ultimo trasferimento n. %d.", _numinv, _nultras_tab);
|
||||
else
|
||||
if (_numinv < (_nultras_tab +1))
|
||||
warning_box("I dischetti risultano GIA' TRASFERITI");
|
||||
warning_box("I dischetti risultano GIA' TRASFERITI.\n"
|
||||
"Numero invio n. %d, ultimo trasferimento n. %d.", _numinv, _nultras_tab);
|
||||
else
|
||||
{
|
||||
delete msk;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
while (tasto == K_ENTER);
|
||||
}
|
||||
delete msk;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@ -934,13 +883,6 @@ void TRic_archivi::aggiorna_tabella()
|
||||
}
|
||||
}
|
||||
|
||||
bool TRic_archivi::menu(MENU_TAG m)
|
||||
{
|
||||
if (m == BAR_ITEM(1))
|
||||
return main_loop();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int cg6400 (int argc, char* argv[])
|
||||
{
|
||||
char p3 = '\0';
|
||||
|
122
cg/cg6700.cpp
122
cg/cg6700.cpp
@ -83,7 +83,8 @@ class TRic_ListaMov : public TPrintapp
|
||||
TEsercizi_contabili _ec;
|
||||
char _ric_auto,_tipo_lista;
|
||||
|
||||
TString80 _pathfile, _descr_causale, _descr_conto;
|
||||
TFilename _pathfile;
|
||||
TString _descr_causale, _descr_conto;
|
||||
TString16 _causale, _registro, _numdoc, _tipodoc, _codval;
|
||||
TString16 _codpag, _codiva, _tipo_conto;
|
||||
TString _record, _numpart, _descr_anag, _descr_pag, _tipom_cau, _codval_part, _codpag_scad,_reg;
|
||||
@ -282,6 +283,7 @@ bool TRic_ListaMov::user_create()
|
||||
_tab_pag = new TTable ("%CPG");
|
||||
_tab_iva = new TTable ("%IVA");
|
||||
_tab_ese = new TTable ("ESC");
|
||||
|
||||
_caus = new TLocalisamfile (LF_CAUSALI);
|
||||
_ditte = new TLocalisamfile (LF_NDITTE);
|
||||
_clifo = new TLocalisamfile (LF_CLIFO);
|
||||
@ -289,6 +291,10 @@ bool TRic_ListaMov::user_create()
|
||||
_mov = new TLocalisamfile (LF_MOV);
|
||||
_rmov = new TLocalisamfile (LF_RMOV);
|
||||
_rmoviva = new TLocalisamfile (LF_RMOVIVA);
|
||||
|
||||
// _part = new TLocalisamfile (LF_PARTITE);
|
||||
// _scad = new TLocalisamfile (LF_SCADENZE);
|
||||
// _pagsca = new TLocalisamfile (LF_PAGSCA);
|
||||
|
||||
if (_ric_auto != 'A')
|
||||
{
|
||||
@ -431,7 +437,7 @@ void TRic_ListaMov::apri_file_SC()
|
||||
_part = new TLocalisamfile (LF_PARTITE);
|
||||
_scad = new TLocalisamfile (LF_SCADENZE);
|
||||
_pagsca = new TLocalisamfile (LF_PAGSCA);
|
||||
|
||||
|
||||
_tpart = new TIsamtempfile(LF_PARTITE, tmppart, 0);
|
||||
_tscad = new TIsamtempfile(LF_SCADENZE, tmpscad, 0);
|
||||
_tpagsca = new TIsamtempfile(LF_PAGSCA,tmppagsca, 0);
|
||||
@ -1778,50 +1784,50 @@ void TRic_ListaMov::stampa_errori_scadenze(int riga)
|
||||
}
|
||||
|
||||
bool TRic_ListaMov::record_partite(int nriga)
|
||||
{
|
||||
TRecnotype nrec = _tpart->recno();
|
||||
TIsamtempfile& part = *_tpart;
|
||||
|
||||
part.zero();
|
||||
part.put(PART_TIPOCF, _tipocf);
|
||||
part.put(PART_GRUPPO, _gruppo);
|
||||
part.put(PART_CONTO, _conto);
|
||||
part.put(PART_SOTTOCONTO, _codcf);
|
||||
part.put(PART_ANNO, _anno);
|
||||
part.put(PART_NUMPART, _numpart);
|
||||
part.put(PART_NRIGA, nriga);
|
||||
if (part.read() == NOERR)
|
||||
{
|
||||
_tpart->readat(nrec);
|
||||
return TRUE;
|
||||
}
|
||||
_tpart->readat(nrec);
|
||||
|
||||
return FALSE;
|
||||
{
|
||||
bool ok = FALSE;
|
||||
for (int p = 0; p < 2 && !ok; p++)
|
||||
{
|
||||
TLocalisamfile* fpart = p == 0 ? _tpart : _part;
|
||||
TLocalisamfile& part = *fpart;
|
||||
const TRecnotype nrec = part.recno();
|
||||
part.zero();
|
||||
part.put(PART_TIPOCF, _tipocf);
|
||||
part.put(PART_GRUPPO, _gruppo);
|
||||
part.put(PART_CONTO, _conto);
|
||||
part.put(PART_SOTTOCONTO, _codcf);
|
||||
part.put(PART_ANNO, _anno);
|
||||
part.put(PART_NUMPART, _numpart);
|
||||
part.put(PART_NRIGA, nriga);
|
||||
ok = part.read() == NOERR;
|
||||
part.readat(nrec);
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool TRic_ListaMov::record_scadenze(int nrigp,int nrata)
|
||||
{
|
||||
TRecnotype nrec = _tscad->recno();
|
||||
TIsamtempfile& scad = *_tscad;
|
||||
bool ok = FALSE;
|
||||
for (int p = 0; p < 2 && !ok; p++)
|
||||
{
|
||||
TLocalisamfile* fscad = p == 0 ? _tscad : _scad;
|
||||
TLocalisamfile& scad = *fscad;
|
||||
|
||||
const TRecnotype nrec = scad.recno();
|
||||
|
||||
scad.zero();
|
||||
scad.put(SCAD_TIPOCF, _tipocf);
|
||||
scad.put(SCAD_GRUPPO, _gruppo);
|
||||
scad.put(SCAD_CONTO, _conto);
|
||||
scad.put(SCAD_SOTTOCONTO, _codcf);
|
||||
scad.put(SCAD_ANNO, _anno);
|
||||
scad.put(SCAD_NUMPART, _numpart);
|
||||
scad.put(SCAD_NRIGA, nrigp);
|
||||
scad.put(SCAD_NRATA, nrata);
|
||||
if (scad.read() == NOERR)
|
||||
{
|
||||
_tscad->readat(nrec);
|
||||
return TRUE;
|
||||
scad.zero();
|
||||
scad.put(SCAD_TIPOCF, _tipocf);
|
||||
scad.put(SCAD_GRUPPO, _gruppo);
|
||||
scad.put(SCAD_CONTO, _conto);
|
||||
scad.put(SCAD_SOTTOCONTO, _codcf);
|
||||
scad.put(SCAD_ANNO, _anno);
|
||||
scad.put(SCAD_NUMPART, _numpart);
|
||||
scad.put(SCAD_NRIGA, nrigp);
|
||||
scad.put(SCAD_NRATA, nrata);
|
||||
ok = scad.read() == NOERR;
|
||||
scad.readat(nrec);
|
||||
}
|
||||
_tscad->readat(nrec);
|
||||
|
||||
return FALSE;
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool TRic_ListaMov::controlla_pagsca()
|
||||
@ -1852,7 +1858,7 @@ bool TRic_ListaMov::controlla_pagsca()
|
||||
pagsca.put(PAGSCA_SOTTOCONTO, _codcf);
|
||||
pagsca.put(PAGSCA_ANNO, _anno);
|
||||
pagsca.put(PAGSCA_NUMPART, _numpart);
|
||||
//pagsca.put(PAGSCA_NRIGA, _nriga);
|
||||
|
||||
TRectype recc (pagsca.curr());
|
||||
for (pagsca.read(_isgteq); !pagsca.eof() ;pagsca.next())
|
||||
{
|
||||
@ -2051,7 +2057,7 @@ void TRic_ListaMov::stampa_errori_pagsca(int riga)
|
||||
if (!record_partite(nriga))
|
||||
{
|
||||
_errore_grave_SC = TRUE;
|
||||
set_row(++riga, "@30g%s", (const char*) err_msg[32]);
|
||||
set_row(++riga, "@30g%s", (const char*)err_msg[32]);
|
||||
}
|
||||
}
|
||||
if (nrata != 9999)
|
||||
@ -2059,7 +2065,7 @@ void TRic_ListaMov::stampa_errori_pagsca(int riga)
|
||||
if (!record_scadenze(nriga,nrata))
|
||||
{
|
||||
_errore_grave_SC = TRUE;
|
||||
set_row(++riga, "@30g%s", (const char*) err_msg[33]);
|
||||
set_row(++riga, "@30g%s", (const char*)err_msg[33]);
|
||||
}
|
||||
}
|
||||
if (accsaldo != 'A' && accsaldo != 'S')
|
||||
@ -3068,12 +3074,6 @@ bool TRic_ListaMov::user_destroy()
|
||||
delete _trmov;
|
||||
if (_is_iva)
|
||||
delete _tiva;
|
||||
/* if (_is_salda)
|
||||
{
|
||||
delete _tpart;
|
||||
delete _tscad;
|
||||
delete _tpagsca;
|
||||
} */
|
||||
delete _caus;
|
||||
delete _ditte;
|
||||
delete _clifo;
|
||||
@ -3081,14 +3081,15 @@ bool TRic_ListaMov::user_destroy()
|
||||
delete _mov;
|
||||
delete _rmov;
|
||||
delete _rmoviva;
|
||||
/* delete _part;
|
||||
delete _part;
|
||||
delete _scad;
|
||||
delete _pagsca; */
|
||||
delete _tab_tra;
|
||||
delete _pagsca;
|
||||
|
||||
delete _tab_pag;
|
||||
delete _tab_tpd;
|
||||
delete _tab_iva;
|
||||
delete _tab_ese;
|
||||
delete _tab_tra;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -3097,16 +3098,17 @@ void TRic_ListaMov::chiudi_file_SC()
|
||||
{
|
||||
if (_is_salda)
|
||||
{
|
||||
delete _relSC;
|
||||
delete _tpart;
|
||||
delete _tscad;
|
||||
delete _tpagsca;
|
||||
delete _part;
|
||||
delete _scad;
|
||||
delete _pagsca;
|
||||
delete _relSC; _relSC = NULL;
|
||||
delete _tpart; _tpart = NULL;
|
||||
delete _tscad; _tscad = NULL;
|
||||
delete _tpagsca; _tpagsca = NULL;
|
||||
|
||||
delete _part; _part = NULL;
|
||||
delete _scad; _scad = NULL;
|
||||
delete _pagsca; _pagsca = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool TRic_ListaMov::set_print(int m)
|
||||
{
|
||||
if (_ric_auto == 'A')
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "cg6700.h"
|
||||
|
||||
PAGE "" -1 -1 78 17
|
||||
PAGE "Controllo movimenti" -1 -1 78 17
|
||||
|
||||
NUMBER F_CODDITTA 5
|
||||
BEGIN
|
||||
@ -79,4 +79,4 @@ END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
ENDMASK
|
||||
ENDMASK
|
||||
|
@ -301,6 +301,7 @@ void TInv_cont::main_loop()
|
||||
_tras_file.open(_trasf,TRUE);
|
||||
|
||||
invio_contabilita_PC(); //Costruisce il trasfer nella directory comune
|
||||
chiudi_file_temp();
|
||||
|
||||
TMask* mask = new TMask("cg6900b");
|
||||
KEY k;
|
||||
@ -363,7 +364,7 @@ void TInv_cont::main_loop()
|
||||
TProgind w(_dim_tot, message, TRUE, TRUE, 60);
|
||||
|
||||
bool continua = TRUE;
|
||||
for (int j = 0; j < num_disk; j++)
|
||||
for (int j = 0; j < num_disk && continua; j++)
|
||||
{
|
||||
continua = scrivi_disco(floppy,j+1,work,i,w);
|
||||
}
|
||||
@ -383,7 +384,7 @@ void TInv_cont::main_loop()
|
||||
_control_rec.overwrite(record,0);
|
||||
_tras_file.write_control_rec(_control_rec,1024);
|
||||
|
||||
chiudi_file_temp();
|
||||
// chiudi_file_temp();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -67,7 +67,8 @@ bool TInv_cont::scrivi_disco(TString& floppy, int disk, const char* work,
|
||||
path_t << floppy << "\\trasfer";
|
||||
}
|
||||
|
||||
fcopy(_marker,path_m); // Copia il marker su disco
|
||||
if (!fcopy(_marker,path_m)) // Copia il marker su disco
|
||||
return FALSE;
|
||||
|
||||
FILE* o = fopen(path_t, "wb");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user