cg6.url Tolti menu inutili

cg6900.*     Tolti 30 include inutili
cglib03.cpp  Trasformate alcune TString
cgpagame.cpp Corretto uso dei bool per 32 bit


git-svn-id: svn://10.65.10.50/trunk@6325 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1998-03-09 10:29:06 +00:00
parent b02fcc96a1
commit 62d433fd2b
6 changed files with 102 additions and 176 deletions

View File

@ -1,54 +1,2 @@
#include <default.url> #include <default.url>
MENU TASK_MENUBAR
SUBMENU MENU_FILE "~File"
MENUBAR MENU_BAR(1)
MENU MENU_BAR(1)
SUBMENU MENU_FILE "~File"
MENUBAR MENU_BAR(2)
MENU MENU_BAR(2)
SUBMENU MENU_FILE "~File"
MENUBAR MENU_BAR(3)
MENU MENU_BAR(3)
SUBMENU MENU_FILE "~File"
MENUBAR MENU_BAR(4)
MENU MENU_BAR(4)
SUBMENU MENU_FILE "~File"
MENUBAR MENU_BAR(5)
MENU MENU_BAR(5)
SUBMENU MENU_FILE "~File"
MENUBAR MENU_BAR(6)
MENU MENU_BAR(6)
SUBMENU MENU_FILE "~File"
MENUBAR MENU_BAR(7)
MENU MENU_BAR(7)
SUBMENU MENU_FILE "~File"
MENUBAR MENU_BAR(8)
MENU MENU_BAR(8)
SUBMENU MENU_FILE "~File"
MENUBAR MENU_BAR(9)
MENU MENU_BAR(9)
SUBMENU MENU_FILE "~File"
MENUBAR MENU_BAR(10)
MENU MENU_BAR(10)
SUBMENU MENU_FILE "~File"

View File

@ -1,8 +1,19 @@
// Invio contabilita' // Invio contabilita'
#include <execp.h>
#include <mailbox.h>
#include <prefix.h>
#include <tabutil.h>
#include "cg6900.h" #include "cg6900.h"
#include "cg6900a.h" #include "cg6900a.h"
#include "cg6901.h"
#include "cg6903.h"
#include "cg6905.h"
#include <nditte.h>
TInv_cont::TInv_cont(char mov) : _scelta(toupper(mov)) TInv_cont::TInv_cont(char mov) : _scelta(toupper(mov))
{ {
switch (_scelta) switch (_scelta)
@ -26,14 +37,16 @@ bool TInv_cont::messaggio_hnd(TMask_field& f, KEY k)
return TRUE; return TRUE;
} }
bool TInv_cont::main_loop() void TInv_cont::main_loop()
{ {
TString str; TString str;
bool ripartenza = FALSE; bool ripartenza = FALSE;
if (!esiste_tabella_studio()) return FALSE; if (!esiste_tabella_studio())
return;
if (!esegui_controlli()) return FALSE; if (!esegui_controlli())
return;
TMask* msk = new TMask("cg6900a"); TMask* msk = new TMask("cg6900a");
KEY tasto; KEY tasto;
@ -83,7 +96,7 @@ bool TInv_cont::main_loop()
if (tasto != K_ENTER) if (tasto != K_ENTER)
{ {
delete msk; delete msk;
return FALSE; return;
} }
_dittaAS = msk->get_long(F_DITTAAS); //Se la ditta per l'invio ad AS non viene compilata perche' trattasi di invio a PC _dittaAS = msk->get_long(F_DITTAAS); //Se la ditta per l'invio ad AS non viene compilata perche' trattasi di invio a PC
@ -126,7 +139,7 @@ bool TInv_cont::main_loop()
if (subj) if (subj)
{ {
delete msk; delete msk;
return FALSE; return;
} }
} }
} }
@ -167,7 +180,7 @@ bool TInv_cont::main_loop()
if (!invio_tempfile(*msk)) if (!invio_tempfile(*msk))
{ {
delete msk; delete msk;
return FALSE; return;
} }
// calcola_totale_record(); // calcola_totale_record();
@ -188,7 +201,7 @@ bool TInv_cont::main_loop()
TMask* mask = new TMask("cg6900b"); TMask* mask = new TMask("cg6900b");
KEY k; KEY k;
TString floppy,percorso; TFilename floppy,percorso;
int num_disk; int num_disk;
bool ok = FALSE; bool ok = FALSE;
@ -208,7 +221,7 @@ bool TInv_cont::main_loop()
if (percorso.not_empty()) if (percorso.not_empty())
{ {
floppy << ":/" << percorso; floppy << ":/" << percorso;
if (fexist(floppy)) if (floppy.exist())
ok = TRUE; ok = TRUE;
else else
message_box("Il percorso indicato non e' corretto"); message_box("Il percorso indicato non e' corretto");
@ -233,7 +246,11 @@ bool TInv_cont::main_loop()
FILE* i = fopen(from, "rb"); FILE* i = fopen(from, "rb");
if (i == NULL) return error_box("Impossibile aprire il file '%s'", from); if (i == NULL)
{
error_box("Impossibile aprire il file '%s'", from);
return;
}
const char* message; const char* message;
if (floppy == "A" || floppy == "B") if (floppy == "A" || floppy == "B")
@ -250,7 +267,8 @@ bool TInv_cont::main_loop()
} }
fclose(i); fclose(i);
if (!continua) return FALSE; // Nel caso in cui l'utente decida di annulla re l'operazione if (!continua)
return; // Nel caso in cui l'utente decida di annulla re l'operazione
setta_tabella_studio(*msk,FALSE); //Aggiorna la tabella studio per invio setta_tabella_studio(*msk,FALSE); //Aggiorna la tabella studio per invio
setta_tabella_ditta(*msk," ",FALSE); //Aggiorna la tabella ditta per invio setta_tabella_ditta(*msk," ",FALSE); //Aggiorna la tabella ditta per invio
@ -269,7 +287,7 @@ bool TInv_cont::main_loop()
{ {
delete msk; delete msk;
delete mask; delete mask;
return FALSE; return;
} }
delete mask; delete mask;
} }
@ -286,7 +304,7 @@ bool TInv_cont::main_loop()
TMask* mask = new TMask("cg6900b"); TMask* mask = new TMask("cg6900b");
KEY k; KEY k;
TString floppy,percorso; TFilename floppy,percorso;
int num_disk; int num_disk;
bool ok = FALSE; bool ok = FALSE;
@ -306,7 +324,7 @@ bool TInv_cont::main_loop()
if (percorso.not_empty()) if (percorso.not_empty())
{ {
floppy << ":/" << percorso; floppy << ":/" << percorso;
if (fexist(floppy)) if (floppy.exist())
ok = TRUE; ok = TRUE;
else else
message_box("Il percorso indicato non e' corretto"); message_box("Il percorso indicato non e' corretto");
@ -331,8 +349,11 @@ bool TInv_cont::main_loop()
FILE* i = fopen(from, "rb"); FILE* i = fopen(from, "rb");
if (i == NULL) return error_box("Impossibile aprire il file '%s'", from); if (i == NULL)
{
error_box("Impossibile aprire il file '%s'", from);
return;
}
const char* message; const char* message;
if (floppy == "A" || floppy == "B") if (floppy == "A" || floppy == "B")
message = "Trasferimento su dischetti in corso... Prego attendere"; message = "Trasferimento su dischetti in corso... Prego attendere";
@ -348,7 +369,8 @@ bool TInv_cont::main_loop()
} }
fclose(i); fclose(i);
if (!continua) return FALSE; // Nel caso in cui l'utente decida di annullare l'operazione if (!continua)
return; // Nel caso in cui l'utente decida di annullare l'operazione
setta_tabella_studio(*msk,FALSE); //Aggiorna la tabella studio per invio setta_tabella_studio(*msk,FALSE); //Aggiorna la tabella studio per invio
setta_tabella_ditta(*msk," ",FALSE); //Aggiorna la tabella ditta per invio setta_tabella_ditta(*msk," ",FALSE); //Aggiorna la tabella ditta per invio
@ -367,7 +389,7 @@ bool TInv_cont::main_loop()
{ {
delete msk; delete msk;
delete mask; delete mask;
return FALSE; return;
} }
delete mask; delete mask;
} }
@ -380,13 +402,10 @@ bool TInv_cont::main_loop()
::remove(_trasf); ::remove(_trasf);
delete msk; delete msk;
return FALSE;
} }
bool TInv_cont::create() bool TInv_cont::create()
{ {
TApplication::create();
_caus = new TLocalisamfile (LF_CAUSALI); _caus = new TLocalisamfile (LF_CAUSALI);
_rcaus = new TLocalisamfile (LF_RCAUSALI); _rcaus = new TLocalisamfile (LF_RCAUSALI);
_clifo = new TLocalisamfile (LF_CLIFO); _clifo = new TLocalisamfile (LF_CLIFO);
@ -400,9 +419,7 @@ bool TInv_cont::create()
_pagsca = new TLocalisamfile (LF_PAGSCA); _pagsca = new TLocalisamfile (LF_PAGSCA);
_comuni = new TLocalisamfile (LF_COMUNI); _comuni = new TLocalisamfile (LF_COMUNI);
dispatch_e_menu (BAR_ITEM(1)); return TSkeleton_application::create();
return TRUE;
} }
bool TInv_cont::destroy() bool TInv_cont::destroy()
@ -432,83 +449,83 @@ void TInv_cont::apri_file_temp()
for (int i = 0; i < _sigle.len(); i++) for (int i = 0; i < _sigle.len(); i++)
{ {
TString80 tmp; TFilename tmp;
char sigla = _sigle[i]; char sigla = _sigle[i];
if (sigla == 'W') if (sigla == 'W')
{ {
TString80 tmpcaus = "%"; TFilename tmpcaus = "%";
tmpcaus << firm2dir(0); tmpcaus << firm2dir(0);
tmpcaus << "\\" << TEMP_CAUS; tmpcaus << "\\" << TEMP_CAUS;
tmp = tmpcaus.mid(1); tmp = tmpcaus.mid(1);
tmp << ".dbf"; tmp << ".dbf";
if (fexist(tmp)) if (tmp.exist())
_tcaus = new TIsamtempfile(LF_CAUSALI, tmpcaus, FALSE); _tcaus = new TIsamtempfile(LF_CAUSALI, tmpcaus, FALSE);
else else
_tcaus = new TIsamtempfile(LF_CAUSALI, tmpcaus, TRUE); _tcaus = new TIsamtempfile(LF_CAUSALI, tmpcaus, TRUE);
TString80 tmprcaus = "%"; TFilename tmprcaus = "%";
tmprcaus << firm2dir(0); tmprcaus << firm2dir(0);
tmprcaus << "\\" << TEMP_RCAUS; tmprcaus << "\\" << TEMP_RCAUS;
tmp = tmprcaus.mid(1); tmp = tmprcaus.mid(1);
tmp << ".dbf"; tmp << ".dbf";
if (fexist(tmp)) if (tmp.exist())
_trcaus = new TIsamtempfile(LF_RCAUSALI, tmprcaus, FALSE); _trcaus = new TIsamtempfile(LF_RCAUSALI, tmprcaus, FALSE);
else else
_trcaus = new TIsamtempfile(LF_RCAUSALI, tmprcaus, TRUE); _trcaus = new TIsamtempfile(LF_RCAUSALI, tmprcaus, TRUE);
} }
if (sigla == 'A') if (sigla == 'A')
{ {
TString80 tmpclifo = "%"; TFilename tmpclifo = "%";
tmpclifo << firm2dir(0); tmpclifo << firm2dir(0);
tmpclifo << "\\" << TEMP_CLIFO; tmpclifo << "\\" << TEMP_CLIFO;
tmp = tmpclifo.mid(1); tmp = tmpclifo.mid(1);
tmp << ".dbf"; tmp << ".dbf";
if (fexist(tmp)) if (tmp.exist())
_tclifo = new TIsamtempfile(LF_CLIFO, tmpclifo, FALSE); _tclifo = new TIsamtempfile(LF_CLIFO, tmpclifo, FALSE);
else else
_tclifo = new TIsamtempfile(LF_CLIFO, tmpclifo, TRUE); _tclifo = new TIsamtempfile(LF_CLIFO, tmpclifo, TRUE);
} }
if (sigla == 'P') if (sigla == 'P')
{ {
TString80 tmppcon = "%"; TFilename tmppcon = "%";
tmppcon << firm2dir(0); tmppcon << firm2dir(0);
tmppcon << "\\" << TEMP_PCON; tmppcon << "\\" << TEMP_PCON;
tmp = tmppcon.mid(1); tmp = tmppcon.mid(1);
tmp << ".dbf"; tmp << ".dbf";
if (fexist(tmp)) if (tmp.exist())
_tpcon = new TIsamtempfile(LF_PCON, tmppcon, FALSE); _tpcon = new TIsamtempfile(LF_PCON, tmppcon, FALSE);
else else
_tpcon = new TIsamtempfile(LF_PCON, tmppcon, TRUE); _tpcon = new TIsamtempfile(LF_PCON, tmppcon, TRUE);
} }
if (sigla == 'Z') if (sigla == 'Z')
{ {
TString80 tmpmov = "%"; TFilename tmpmov = "%";
tmpmov << firm2dir(0); tmpmov << firm2dir(0);
tmpmov << "\\" << TEMP_MOV; tmpmov << "\\" << TEMP_MOV;
tmp = tmpmov.mid(1); tmp = tmpmov.mid(1);
tmp << ".dbf"; tmp << ".dbf";
if (fexist(tmp)) if (tmp.exist())
_tmov = new TIsamtempfile(LF_MOV, tmpmov, FALSE); _tmov = new TIsamtempfile(LF_MOV, tmpmov, FALSE);
else else
_tmov = new TIsamtempfile(LF_MOV, tmpmov, TRUE); _tmov = new TIsamtempfile(LF_MOV, tmpmov, TRUE);
TString80 tmprmov = "%"; TFilename tmprmov = "%";
tmprmov << firm2dir(0); tmprmov << firm2dir(0);
tmprmov << "\\" << TEMP_RMOV; tmprmov << "\\" << TEMP_RMOV;
tmp = tmprmov.mid(1); tmp = tmprmov.mid(1);
tmp << ".dbf"; tmp << ".dbf";
if (fexist(tmp)) if (tmp.exist())
_trmov = new TIsamtempfile(LF_RMOV, tmprmov, FALSE); _trmov = new TIsamtempfile(LF_RMOV, tmprmov, FALSE);
else else
_trmov = new TIsamtempfile(LF_RMOV, tmprmov, TRUE); _trmov = new TIsamtempfile(LF_RMOV, tmprmov, TRUE);
} }
if (sigla == 'U') if (sigla == 'U')
{ {
TString80 tmpriva = "%"; TFilename tmpriva = "%";
tmpriva << firm2dir(0); tmpriva << firm2dir(0);
tmpriva << "\\" << TEMP_RMOVIVA; tmpriva << "\\" << TEMP_RMOVIVA;
tmp = tmpriva.mid(1); tmp = tmpriva.mid(1);
tmp << ".dbf"; tmp << ".dbf";
if (fexist(tmp)) if (tmp.exist())
_triva = new TIsamtempfile(LF_RMOVIVA, tmpriva, FALSE); _triva = new TIsamtempfile(LF_RMOVIVA, tmpriva, FALSE);
else else
_triva = new TIsamtempfile(LF_RMOVIVA, tmpriva, TRUE); _triva = new TIsamtempfile(LF_RMOVIVA, tmpriva, TRUE);
@ -517,28 +534,28 @@ void TInv_cont::apri_file_temp()
tmpoccas << "\\" << TEMP_OCC; tmpoccas << "\\" << TEMP_OCC;
tmp = tmpoccas.mid(1); tmp = tmpoccas.mid(1);
tmp << ".dbf"; tmp << ".dbf";
if (fexist(tmp)) if (tmp.exist())
_toccas = new TIsamtempfile(LF_OCCAS, tmpoccas, FALSE); _toccas = new TIsamtempfile(LF_OCCAS, tmpoccas, FALSE);
else else
_toccas = new TIsamtempfile(LF_OCCAS, tmpoccas, TRUE); _toccas = new TIsamtempfile(LF_OCCAS, tmpoccas, TRUE);
} }
if (sigla == 'B') if (sigla == 'B')
{ {
TString80 tmppart = "%"; TFilename tmppart = "%";
tmppart << firm2dir(0); tmppart << firm2dir(0);
tmppart << "\\" << TEMP_PART; tmppart << "\\" << TEMP_PART;
tmp = tmppart.mid(1); tmp = tmppart.mid(1);
tmp << ".dbf"; tmp << ".dbf";
if (fexist(tmp)) if (tmp.exist())
_tpart = new TIsamtempfile(LF_PARTITE, tmppart, FALSE); _tpart = new TIsamtempfile(LF_PARTITE, tmppart, FALSE);
else else
_tpart = new TIsamtempfile(LF_PARTITE, tmppart, TRUE); _tpart = new TIsamtempfile(LF_PARTITE, tmppart, TRUE);
TString80 tmpscad = "%"; TFilename tmpscad = "%";
tmpscad << firm2dir(0); tmpscad << firm2dir(0);
tmpscad << "\\" << TEMP_SCAD; tmpscad << "\\" << TEMP_SCAD;
tmp = tmpscad.mid(1); tmp = tmpscad.mid(1);
tmp << ".dbf"; tmp << ".dbf";
if (fexist(tmp)) if (tmp.exist())
_tscad = new TIsamtempfile(LF_SCADENZE, tmpscad, FALSE); _tscad = new TIsamtempfile(LF_SCADENZE, tmpscad, FALSE);
else else
_tscad = new TIsamtempfile(LF_SCADENZE, tmpscad, TRUE); _tscad = new TIsamtempfile(LF_SCADENZE, tmpscad, TRUE);
@ -547,7 +564,7 @@ void TInv_cont::apri_file_temp()
tmppagsca << "\\" << TEMP_PAGSCA; tmppagsca << "\\" << TEMP_PAGSCA;
tmp = tmppagsca.mid(1); tmp = tmppagsca.mid(1);
tmp << ".dbf"; tmp << ".dbf";
if (fexist(tmp)) if (tmp.exist())
_tpagsca = new TIsamtempfile(LF_PAGSCA, tmppagsca, FALSE); _tpagsca = new TIsamtempfile(LF_PAGSCA, tmppagsca, FALSE);
else else
_tpagsca = new TIsamtempfile(LF_PAGSCA, tmppagsca, TRUE); _tpagsca = new TIsamtempfile(LF_PAGSCA, tmppagsca, TRUE);
@ -819,7 +836,7 @@ void TInv_cont::codifica_ditta(TMask& m)
ditte.put(NDT_CODDITTA, ditta); ditte.put(NDT_CODDITTA, ditta);
if (ditte.read() == NOERR) if (ditte.read() == NOERR)
{ {
TString ragsoc = ditte.get(NDT_RAGSOC); const TString& ragsoc = ditte.get(NDT_RAGSOC);
m.set(F_RAGSOC, ragsoc); m.set(F_RAGSOC, ragsoc);
} }
} }
@ -880,11 +897,11 @@ void TInv_cont::crea_marker(TMask& m)
long ditta = m.get_long(F_DITTAINV); long ditta = m.get_long(F_DITTAINV);
if (ditta > 9999) if (ditta > 9999)
ditta = _dittaAS; ditta = _dittaAS;
str = format("%04d", ditta); str.format("%04d", ditta);
buffer.overwrite(str,10); buffer.overwrite(str,10);
int num = m.get_int(F_NUMULINV); int num = m.get_int(F_NUMULINV);
num++; num++;
str = format("%03d", num); str.format("%03d", num);
buffer.overwrite(str,14); buffer.overwrite(str,14);
TString data (m.get(F_DATALIM)); TString data (m.get(F_DATALIM));
str = riconverti(data,FALSE); str = riconverti(data,FALSE);
@ -893,14 +910,14 @@ void TInv_cont::crea_marker(TMask& m)
else else
if (_scelta == 'P') if (_scelta == 'P')
{ {
str = format("%-10s", (const char*) _nome_simbolico); str.format("%-10s", (const char*) _nome_simbolico);
buffer.overwrite(str,0); buffer.overwrite(str,0);
long ditta = m.get_long(F_DITTAINV); long ditta = m.get_long(F_DITTAINV);
str = format("%05ld", ditta); str.format("%05ld", ditta);
buffer.overwrite(str,10); buffer.overwrite(str,10);
int num = m.get_int(F_NUMULINV); int num = m.get_int(F_NUMULINV);
num++; num++;
str = format("%03d", num); str.format("%03d", num);
buffer.overwrite(str,15); buffer.overwrite(str,15);
TString data (m.get(F_DATALIM)); TString data (m.get(F_DATALIM));
str = riconverti(data,TRUE); str = riconverti(data,TRUE);
@ -1029,23 +1046,23 @@ void TInv_cont::crea_record_controllo(TMask& m)
buffer.spaces(); buffer.spaces();
buffer.overwrite(" 1",0); //Tipo record buffer.overwrite(" 1",0); //Tipo record
str = format("%-10s", (const char*) _nome_simbolico); str.format("%-10s", (const char*) _nome_simbolico);
buffer.overwrite(str,60); //Nome studio buffer.overwrite(str,60); //Nome studio
long ditta = m.get_long(F_DITTAINV); long ditta = m.get_long(F_DITTAINV);
str = format("%05ld", ditta); str.format("%05ld", ditta);
buffer.overwrite(str,70); //Ditta inviante buffer.overwrite(str,70); //Ditta inviante
int num = m.get_int(F_NUMULINV); int num = m.get_int(F_NUMULINV);
num++; num++;
str = format("%03d", num); str.format("%03d", num);
buffer.overwrite(str,75); //Numero progr. invio buffer.overwrite(str,75); //Numero progr. invio
TString data (m.get(F_DATALIM)); TString data (m.get(F_DATALIM));
str = riconverti(data,TRUE); str = riconverti(data,TRUE);
buffer.overwrite(str,78); //Data limite invio buffer.overwrite(str,78); //Data limite invio
str = format("%-9s", (const char*) _files); str.format("%-9s", (const char*) _files);
buffer.overwrite(str,86); buffer.overwrite(str,86);
str = _files.sub(0,1); str = _files.sub(0,1);
@ -1271,7 +1288,8 @@ void TInv_cont::scrivi_righe_causali(TString& codcaus, char uselab)
leggi_record_controllo(); leggi_record_controllo();
TString chiave; TString chiave;
chiave.format("%3s",(const char*) codcaus); chiave.format("%3s",(const char*) codcaus);
TString sigla (format("%c", uselab)); TString sigla;
sigla.format("%c", uselab);
_control_rec.overwrite(sigla,240); _control_rec.overwrite(sigla,240);
_control_rec.overwrite(chiave,241); _control_rec.overwrite(chiave,241);
_tras_file.write_control_rec(_control_rec,1024); _tras_file.write_control_rec(_control_rec,1024);
@ -1326,7 +1344,8 @@ void TInv_cont::clifo2tempfile(TString& key, TMask& m)
leggi_record_controllo(); leggi_record_controllo();
TString chiave; TString chiave;
chiave.format("%c%06ld", tipocf, codcf); chiave.format("%c%06ld", tipocf, codcf);
TString sigla (format("%c", 'A')); TString sigla;
sigla.format("%c", 'A');
_control_rec.overwrite(sigla,240); _control_rec.overwrite(sigla,240);
_control_rec.overwrite(chiave,241); _control_rec.overwrite(chiave,241);
@ -1412,7 +1431,8 @@ void TInv_cont::pcon2tempfile(TString& key, TMask& m)
leggi_record_controllo(); leggi_record_controllo();
TString16 chiave; TString16 chiave;
chiave.format("%3d%3d%6ld", g, c, s); chiave.format("%3d%3d%6ld", g, c, s);
TString sigla (format("%c", 'P')); TString sigla;
sigla.format("%c", 'P');
_control_rec.overwrite(sigla,240); _control_rec.overwrite(sigla,240);
_control_rec.overwrite(chiave,241); _control_rec.overwrite(chiave,241);
@ -1540,7 +1560,8 @@ void TInv_cont::movPN2tempfile(TString& key, TMask& m)
leggi_record_controllo(); leggi_record_controllo();
TString chiave; TString chiave;
chiave.format("%07ld", nreg); chiave.format("%07ld", nreg);
TString sigla (format("%c", 'Z')); TString sigla;
sigla.format("%c", 'Z');
_control_rec.overwrite(sigla,240); _control_rec.overwrite(sigla,240);
_control_rec.overwrite(chiave,241); _control_rec.overwrite(chiave,241);
_tras_file.write_control_rec(_control_rec,size); _tras_file.write_control_rec(_control_rec,size);
@ -1695,7 +1716,7 @@ void TInv_cont::movIVA2tempfile(TString& key, TMask& m)
leggi_record_controllo(); leggi_record_controllo();
TString chiave; TString chiave;
chiave.format("%07ld", nreg); chiave.format("%07ld", nreg);
TString sigla (format("%c", 'U')); TString sigla("U");
_control_rec.overwrite(sigla,240); _control_rec.overwrite(sigla,240);
_control_rec.overwrite(chiave,241); _control_rec.overwrite(chiave,241);
@ -1826,7 +1847,7 @@ void TInv_cont::movSC2tempfile(TString& key, TMask& m)
leggi_record_controllo(); leggi_record_controllo();
TString chiave; TString chiave;
chiave.format("%c%03d%03d%06ld%04d%7s%04d", tipo,gruppo,conto,sottoc,anno,(const char*)numpart,nriga); chiave.format("%c%03d%03d%06ld%04d%7s%04d", tipo,gruppo,conto,sottoc,anno,(const char*)numpart,nriga);
TString sigla (format("%c", 'B')); TString sigla("B");
_control_rec.overwrite(sigla,240); _control_rec.overwrite(sigla,240);
_control_rec.overwrite(chiave,241); _control_rec.overwrite(chiave,241);
_tras_file.write_control_rec(_control_rec,size); _tras_file.write_control_rec(_control_rec,size);
@ -1940,13 +1961,6 @@ void TInv_cont::scrivi_righePAGSCA(char tipocf,int gruppo,int conto,long sottoc,
} }
} }
bool TInv_cont::menu(MENU_TAG m)
{
if (m == BAR_ITEM(1))
return main_loop();
return FALSE;
}
int cg6900 (int argc, char* argv[]) int cg6900 (int argc, char* argv[])
{ {
switch (*argv[2]) switch (*argv[2])

View File

@ -1,47 +1,12 @@
// Invio contabilita' // Invio contabilita'
#define STRICT
#include <windows.h>
#include <direct.h>
#include <colors.h>
#include <isam.h>
#include <math.h>
#include <dos.h>
#include <archives.h>
#include <applicat.h> #include <applicat.h>
#include <mask.h> #include <mask.h>
#include <relation.h>
#include <tabutil.h>
#include <utility.h>
#include <config.h>
#include <urldefid.h>
#include <prefix.h>
#include <lffiles.h>
#include <progind.h>
#include <execp.h>
#include <mailbox.h>
#include <archives.h>
#include <nditte.h>
#include <mov.h>
#include <rmov.h>
#include <rmoviva.h>
#include <causali.h>
#include <rcausali.h>
#include <clifo.h>
#include <pconti.h>
#include <comuni.h>
#include <occas.h>
#include <partite.h>
#include <scadenze.h>
#include <pagsca.h>
#include "cg6901.h"
#include "cg6903.h"
#include "cg6905.h"
#include "cglib04.h" #include "cglib04.h"
class TInv_cont : public TApplication class TInv_cont : public TSkeleton_application
{ {
enum { BUFSIZE = 4096 }; enum { BUFSIZE = 4096 };
@ -94,9 +59,7 @@ public:
virtual bool create(); virtual bool create();
virtual bool destroy(); virtual bool destroy();
virtual bool menu(MENU_TAG m); virtual void main_loop();
bool main_loop();
bool esiste_tabella_studio(); bool esiste_tabella_studio();
bool record_controllo(); bool record_controllo();

View File

@ -1,6 +1,9 @@
#include <os_dep.h>
#include <tabutil.h>
#include <utility.h>
#include "cg6900.h" #include "cg6900.h"
#include "cg6900a.h" #include "cg6900a.h"
#include <math.h>
FILE* TInv_cont::chiedi_disco(const char* name, int disk, TString& floppy, bool lettura) FILE* TInv_cont::chiedi_disco(const char* name, int disk, TString& floppy, bool lettura)
{ {
@ -146,16 +149,13 @@ int TInv_cont::calcola_numero_dischi(TMask& msk,TString& floppy)
} }
} }
else else
{ {
struct _diskfree_t drive; _dim_disk = 16L*1024L*1024L; // 16 mega
for (; _dim_disk > 0; _dim_disk -= 1024L*1024L)
_dos_getdiskfree(0,&drive); {
if (os_test_disk_free_space("", _dim_disk))
long bytes = drive.bytes_per_sector; break;
long settori = drive.sectors_per_cluster; }
long cluster = drive.avail_clusters;
_dim_disk = bytes * settori * cluster;
} }
return numdisc; return numdisc;

View File

@ -20,12 +20,12 @@ TInteressi_IVA_table::~TInteressi_IVA_table()
int TInteressi_IVA_table::read(int anno, int mese) int TInteressi_IVA_table::read(int anno, int mese)
{ {
TString k; TString16 k;
k.format("%d%02d",anno,mese); k.format("%d%02d",anno,mese);
_ver->zero();_ver->put("CODTAB",k); _ver->zero();_ver->put("CODTAB",k);
if (_ver->read(_isgteq) == NOERR) if (_ver->read(_isgteq) == NOERR)
{ {
TString cod = _ver->get("CODTAB"); const TString& cod = _ver->get("CODTAB");
if (cod > k) if (cod > k)
if (_ver->prev() != NOERR) if (_ver->prev() != NOERR)
@ -39,7 +39,7 @@ int TInteressi_IVA_table::read(int anno, int mese)
real TInteressi_IVA_table::get(int what) real TInteressi_IVA_table::get(int what)
{ {
TString fieldname; TString16 fieldname;
fieldname.format("R%d",what); fieldname.format("R%d",what);
return _ver->get_real(fieldname); return _ver->get_real(fieldname);
} }

View File

@ -1601,11 +1601,12 @@ void TPagamento::set_rate_auto()
set_inizio(_datadoc); set_inizio(_datadoc);
for (int v = 0; v < (in_valuta() ? 2 : 1); v++) for (int iv = 0; iv < (in_valuta() ? 2 : 1); iv++)
{ {
const bool v = iv ? TRUE : FALSE;
real toslice = importo_da_dividere(v); real toslice = importo_da_dividere(v);
if (_tpr > 3) set_imprata(0, importo_da_non_dividere(v), v); if (_tpr > 3)
set_imprata(0, importo_da_non_dividere(v), v);
real r1(0.0), ro(0.0); real r1(0.0), ro(0.0);
if (!_rdiff) if (!_rdiff)
{ {