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

View File

@ -1,47 +1,12 @@
// 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 <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"
class TInv_cont : public TApplication
class TInv_cont : public TSkeleton_application
{
enum { BUFSIZE = 4096 };
@ -94,9 +59,7 @@ public:
virtual bool create();
virtual bool destroy();
virtual bool menu(MENU_TAG m);
bool main_loop();
virtual void main_loop();
bool esiste_tabella_studio();
bool record_controllo();

View File

@ -1,6 +1,9 @@
#include <os_dep.h>
#include <tabutil.h>
#include <utility.h>
#include "cg6900.h"
#include "cg6900a.h"
#include <math.h>
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
{
struct _diskfree_t drive;
_dos_getdiskfree(0,&drive);
long bytes = drive.bytes_per_sector;
long settori = drive.sectors_per_cluster;
long cluster = drive.avail_clusters;
_dim_disk = bytes * settori * cluster;
{
_dim_disk = 16L*1024L*1024L; // 16 mega
for (; _dim_disk > 0; _dim_disk -= 1024L*1024L)
{
if (os_test_disk_free_space("", _dim_disk))
break;
}
}
return numdisc;

View File

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

View File

@ -1601,11 +1601,12 @@ void TPagamento::set_rate_auto()
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);
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);
if (!_rdiff)
{