Patch level : 2.0 470

Files correlati     : cg6.exe
Ricompilazione Demo : [ ]
Commento            :

EP20043
Effettuati tutti i passaggi per ricevere movimenti fino a lista controllo
movimenti tutto ok clicco su ricezione movimenti errore dell'applicazione CG6


git-svn-id: svn://10.65.10.50/trunk@11136 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2003-05-15 10:14:08 +00:00
parent cc9fb00ff9
commit 6a5a6d1d30

View File

@ -117,10 +117,10 @@ public:
virtual print_action postprocess_page(int,int); virtual print_action postprocess_page(int,int);
virtual print_action postprocess_print(int file, int counter); virtual print_action postprocess_print(int file, int counter);
virtual void postclose_print(); virtual void postclose_print();
const char* look_sdt(); char look_sdt();
const char* get_codiva_des(const char*); const char* get_codiva_des(const char*);
bool DescrConto(int,int,long); bool DescrConto(int,int,long);
bool check_archivi(TProgind*); bool check_archivi();
bool look_pag(); bool look_pag();
bool errori_partita(int,int,long); bool errori_partita(int,int,long);
bool controlla_mov(); bool controlla_mov();
@ -182,10 +182,10 @@ _ric_auto(toupper(ric_auto)), _tipo_lista(toupper(tipo_lista)), _err(80)
{} {}
const char* TRic_ListaMov::look_sdt() char TRic_ListaMov::look_sdt()
{ {
TConfig conf(CONFIG_DITTA); TConfig conf(CONFIG_DITTA);
return conf.get("FlStTra"); return conf.get("FlStTra")[0];
} }
bool TRic_ListaMov::look_pag() bool TRic_ListaMov::look_pag()
@ -307,39 +307,28 @@ bool TRic_ListaMov::user_create()
if (_ric_auto != 'A') if (_ric_auto != 'A')
{ {
TProgind* pnd = NULL; TIndwin pnd(0,TR("Controllo archivi..."),FALSE, FALSE);
pnd = new TProgind (3,TR("Controllo archivi\nPrego attendere"),FALSE, TRUE, 30); if (!check_archivi())
if (pnd) pnd->addstatus(1);
if (!check_archivi(pnd))
{
delete pnd;
return FALSE; return FALSE;
}
if (pnd) pnd->addstatus(1);
delete pnd;
} }
TString80 tmpmov = "%"; TFilename tmpmov = "%";
tmpmov << get_firm_dir(); tmpmov << get_firm_dir();
tmpmov << "\\" << TEMP_MOV; tmpmov << SLASH << TEMP_MOV;
TString80 tmprmov = "%"; TFilename tmprmov = "%";
tmprmov << get_firm_dir(); tmprmov << get_firm_dir();
tmprmov << "\\" << TEMP_RMOV; tmprmov << SLASH << TEMP_RMOV;
TString80 tmprmoviva = "%"; TFilename tmprmoviva = "%";
tmprmoviva << get_firm_dir(); tmprmoviva << get_firm_dir();
tmprmoviva << "\\" << TEMP_RMOVIVA; tmprmoviva << SLASH << TEMP_RMOVIVA;
_tmov = new TIsamtempfile(LF_MOV, tmpmov, 0); _tmov = new TIsamtempfile(LF_MOV, tmpmov, 0);
_trmov = new TIsamtempfile(LF_RMOV, tmprmov, 0); _trmov = new TIsamtempfile(LF_RMOV, tmprmov, 0);
_is_iva = FALSE; _is_iva = FALSE;
TString tmp = tmprmoviva.mid(1); TFilename tmp = tmprmoviva.mid(1);
tmp << ".dbf"; tmp << ".dbf";
if (fexist(tmp)) if (tmp.exist())
{ {
_tiva = new TIsamtempfile(LF_RMOVIVA, tmprmoviva, 0); _tiva = new TIsamtempfile(LF_RMOVIVA, tmprmoviva, 0);
_is_iva = TRUE; _is_iva = TRUE;
@ -354,17 +343,13 @@ bool TRic_ListaMov::user_create()
// ************************************************* // *************************************************
// *** Parte riguardante il Saldaconto se esiste *** // *** Parte riguardante il Saldaconto se esiste ***
// ************************************************* // *************************************************
TString80 tmppart = "%"; TFilename tmppart = "%";
tmppart << get_firm_dir(); tmppart << get_firm_dir();
tmppart << "\\" << TEMP_PART; tmppart << SLASH << TEMP_PART;
_is_salda = FALSE;
tmp = tmppart.mid(1); tmp = tmppart.mid(1);
tmp << ".dbf"; tmp << ".dbf";
if (fexist(tmp)) _is_salda = tmp.exist();
{
_is_salda = TRUE;
}
_giornale = new TLibro_giornale(); _giornale = new TLibro_giornale();
@ -392,24 +377,24 @@ void TRic_ListaMov::apri_file_SC()
{ {
TToken_string exp; TToken_string exp;
TToken_string exp1; TToken_string exp1;
TString tmp; TFilename tmp;
// ************************************************* // *************************************************
// *** Parte riguardante il Saldaconto se esiste *** // *** Parte riguardante il Saldaconto se esiste ***
// ************************************************* // *************************************************
TString80 tmppart = "%"; TFilename tmppart = "%";
tmppart << get_firm_dir(); tmppart << get_firm_dir();
tmppart << "\\" << TEMP_PART; tmppart << "\\" << TEMP_PART;
TString80 tmpscad = "%"; TFilename tmpscad = "%";
tmpscad << get_firm_dir(); tmpscad << get_firm_dir();
tmpscad << "\\" << TEMP_SCAD; tmpscad << "\\" << TEMP_SCAD;
TString80 tmppagsca = "%"; TFilename tmppagsca = "%";
tmppagsca << get_firm_dir(); tmppagsca << get_firm_dir();
tmppagsca << "\\" << TEMP_PAGSCA; tmppagsca << "\\" << TEMP_PAGSCA;
_is_salda = FALSE;
tmp = tmppart.mid(1); tmp = tmppart.mid(1);
tmp << ".dbf"; tmp << ".dbf";
if (fexist(tmp)) _is_salda = tmp.exist();
if (_is_salda)
{ {
_part = new TLocalisamfile (LF_PARTITE); _part = new TLocalisamfile (LF_PARTITE);
_scad = new TLocalisamfile (LF_SCADENZE); _scad = new TLocalisamfile (LF_SCADENZE);
@ -418,7 +403,6 @@ void TRic_ListaMov::apri_file_SC()
_tpart = new TIsamtempfile(LF_PARTITE, tmppart, 0); _tpart = new TIsamtempfile(LF_PARTITE, tmppart, 0);
_tscad = new TIsamtempfile(LF_SCADENZE, tmpscad, 0); _tscad = new TIsamtempfile(LF_SCADENZE, tmpscad, 0);
_tpagsca = new TIsamtempfile(LF_PAGSCA,tmppagsca, 0); _tpagsca = new TIsamtempfile(LF_PAGSCA,tmppagsca, 0);
_is_salda = TRUE;
_relSC = new TRelation(_tpart); _relSC = new TRelation(_tpart);
exp.add("TIPOC=TIPOC"); exp.add("TIPOC=TIPOC");
@ -440,9 +424,8 @@ void TRic_ListaMov::apri_file_SC()
} }
} }
bool TRic_ListaMov::check_archivi(TProgind* pnd) bool TRic_ListaMov::check_archivi()
{ {
TString80 nome;
long ditta_ric = get_firm(); long ditta_ric = get_firm();
if (!prefix().exist(ditta_ric)) if (!prefix().exist(ditta_ric))
@ -462,12 +445,11 @@ bool TRic_ListaMov::check_archivi(TProgind* pnd)
else else
_record = tr.record(); _record = tr.record();
TString16 sd = look_sdt(); const char sd = look_sdt();
if (sd <= ' ')
if (sd.not_empty()) return error_box(TR("Ricezione tabelle non effettuata: richiamare il programma relativo"));
_sdt = sd[0];
else return error_box(TR("Ricezione tabelle non effettuata: richiamare il programma relativo")); _sdt = sd;
if (_sdt == 'T') if (_sdt == 'T')
return error_box(TR("Ricezione tabelle non effettuata: richiamare il programma relativo")); return error_box(TR("Ricezione tabelle non effettuata: richiamare il programma relativo"));
@ -493,8 +475,6 @@ bool TRic_ListaMov::check_archivi(TProgind* pnd)
return warning_box(TR("Trasferimento interamente completato: proseguire per cancellare i file")); return warning_box(TR("Trasferimento interamente completato: proseguire per cancellare i file"));
} }
if (pnd) pnd->addstatus(1);
return TRUE; return TRUE;
} }
@ -2432,8 +2412,10 @@ print_action TRic_ListaMov::postprocess_page(int file,int count)
{ {
reset_print(); reset_print();
_err.reset(); _err.reset();
int n = 1; int n = 1;
if (_tot_dare != _tot_avere)
const TCurrency sbil(real(_tot_dare - _tot_avere));
if (!sbil.is_zero())
{ {
_errore_grave = TRUE; _errore_grave = TRUE;
set_row(n++, FR("@8g*** Il movimento risulta sbilanciato. Totali rilevati:@99g%r@116g%r"), set_row(n++, FR("@8g*** Il movimento risulta sbilanciato. Totali rilevati:@99g%r@116g%r"),
@ -2478,52 +2460,52 @@ void TRic_ListaMov::postclose_print()
if (esegui) if (esegui)
{ {
if (_errore_grave_totale) if (_errore_grave_totale)
{ {
if (_ric_auto == 'A') if (_ric_auto == 'A')
{ {
_risposta = TRUE; _risposta = TRUE;
_continua = yesno_box(TR("Rilevati ERRORI GRAVI durante il controllo movimenti: \n Controllare gli errori sulla lista dei movimenti stampata per eseguire le correzioni. \n Continuare ugualmente?")); _continua = yesno_box(TR("Rilevati ERRORI GRAVI durante il controllo movimenti: \n Controllare gli errori sulla lista dei movimenti stampata per eseguire le correzioni. \n Continuare ugualmente?"));
TTransfer_file& tr = trasfer(); TTransfer_file& tr = trasfer();
if (!_continua) if (!_continua)
_record.overwrite(" ",240); //_record e' letto nella read_control_rec() _record.overwrite(" ",240); //_record e' letto nella read_control_rec()
else
{
TConfig conf (CONFIG_DITTA);
conf.set("FlStTra", "M");
_record.overwrite("Z",240);
}
const int size = 1024;
tr.write_control_rec(_record, size);
tr.read_control_rec();
}
else else
{ {
TConfig conf (CONFIG_DITTA); message_box(TR("Rilevati errori gravi durante il controllo movimenti:\n trasferimento interrotto"));
conf.set("FlStTra", "M"); TTransfer_file& tr = trasfer();
_record.overwrite("Z",240); _record.overwrite(" ",240); //_record e' letto nella read_control_rec()
const int size = 1024;
tr.write_control_rec(_record, size);
tr.read_control_rec();
chiudi_file_SC();
} }
const int size = 1024; }
tr.write_control_rec(_record, size); else
tr.read_control_rec(); {
} if (_ric_auto == 'A')
else _risposta = TRUE;
{ else
message_box(TR("Rilevati errori gravi durante il controllo movimenti: \n trasferimento interrotto")); message_box(TR("CONTROLLO MOVIMENTI terminato: \n proseguire con RICEZIONE movimenti"));
TTransfer_file& tr = trasfer(); TConfig conf (CONFIG_DITTA);
_record.overwrite(" ",240); //_record e' letto nella read_control_rec() conf.set("FlStTra", "M");
const int size = 1024;
tr.write_control_rec(_record, size);
tr.read_control_rec();
chiudi_file_SC();
}
}
else
{
if (_ric_auto == 'A')
_risposta = TRUE;
else
message_box(TR("CONTROLLO MOVIMENTI terminato: \n proseguire con RICEZIONE movimenti"));
TConfig conf (CONFIG_DITTA);
conf.set("FlStTra", "M");
TTransfer_file& tr = trasfer(); TTransfer_file& tr = trasfer();
_record.overwrite("Z",240); //_record e' letto nella read_control_rec() _record.overwrite("Z",240); //_record e' letto nella read_control_rec()
const int size = 1024; const int size = 1024;
tr.write_control_rec(_record, size); tr.write_control_rec(_record, size);
tr.read_control_rec(); tr.read_control_rec();
chiudi_file_SC(); chiudi_file_SC();
} }
} // if (esegui) } // if (esegui)
} }
@ -3039,8 +3021,6 @@ bool TRic_ListaMov::user_destroy()
delete _giornale; delete _giornale;
delete _trasfer; delete _trasfer;
delete _rel; delete _rel;
// delete _relSC;
// delete _cur;
delete _tmov; delete _tmov;
delete _trmov; delete _trmov;
if (_is_iva) if (_is_iva)
@ -3070,9 +3050,10 @@ void TRic_ListaMov::chiudi_file_SC()
if (_is_salda) if (_is_salda)
{ {
delete _relSC; _relSC = NULL; delete _relSC; _relSC = NULL;
delete _tpart; _tpart = NULL; // Non cancellare: Gia' contenuti in _relSC
delete _tscad; _tscad = NULL; // delete _tpart; _tpart = NULL;
delete _tpagsca; _tpagsca = NULL; // delete _tscad; _tscad = NULL;
// delete _tpagsca; _tpagsca = NULL;
delete _part; _part = NULL; delete _part; _part = NULL;
delete _scad; _scad = NULL; delete _scad; _scad = NULL;
@ -3190,7 +3171,8 @@ bool TRic_ListaMov::set_print(int m)
msk.set(F_NUMERO, tr.nultras()); msk.set(F_NUMERO, tr.nultras());
msk.set(F_DATALIMITE, tr.dataultras()); msk.set(F_DATALIMITE, tr.dataultras());
msk.set(F_SDT, look_sdt()); const char sdt[2] = { look_sdt(), '\0' };
msk.set(F_SDT, sdt);
msk.set(F_SIGLA, tr.ult_file()); msk.set(F_SIGLA, tr.ult_file());
msk.set(F_CHIAVE, tr.key()); msk.set(F_CHIAVE, tr.key());