Corretto passaggio da fisiche a giuridiche tramite bottone.
git-svn-id: svn://10.65.10.50/trunk@248 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
3d2dbf1fe6
commit
113424a344
@ -23,6 +23,7 @@ class BA4200_application : public TRelation_application
|
||||
TLocalisamfile* _comuni;
|
||||
TLocalisamfile* _tabcom;
|
||||
|
||||
protected:
|
||||
virtual bool user_create() ;
|
||||
virtual bool user_destroy() ;
|
||||
virtual int read(TMask& m);
|
||||
@ -35,6 +36,8 @@ class BA4200_application : public TRelation_application
|
||||
virtual TMask* get_mask(int mode) ;
|
||||
virtual void write_enable(const bool on = TRUE);
|
||||
|
||||
static bool ba4200_handler(TMask& m, KEY k);
|
||||
|
||||
public:
|
||||
virtual int write(const TMask& m);
|
||||
virtual TRelation* get_relation() const { return _rel[tip_msk()];}
|
||||
@ -52,15 +55,14 @@ public:
|
||||
virtual ~BA4200_application() {}
|
||||
};
|
||||
|
||||
bool ba4200_handler(TMask& m, KEY k)
|
||||
|
||||
bool BA4200_application::ba4200_handler(TMask& m, KEY k)
|
||||
{
|
||||
BA4200_application* app = (BA4200_application*) MainApp();
|
||||
BA4200_application& app = (BA4200_application&)main_app();
|
||||
|
||||
if (k == K_F10)
|
||||
{
|
||||
if (app->ana_fis()) app->set_tip_ana(TGIU);
|
||||
else app->set_tip_ana(TFIS);
|
||||
if (app.ana_fis()) app.set_tip_ana(TGIU);
|
||||
else app.set_tip_ana(TFIS);
|
||||
m.stop_run(K_ESC);
|
||||
return FALSE;
|
||||
}
|
||||
@ -68,29 +70,29 @@ bool ba4200_handler(TMask& m, KEY k)
|
||||
TToken_string body(16);
|
||||
|
||||
body.add(format("%d", FLD_GD1_CODDITTAH));
|
||||
if ( app->tip_ana() == TFIS )
|
||||
if ( app.tip_ana() == TFIS )
|
||||
{
|
||||
body.add(format("%d=F", FLD_GD1_TIPOA));
|
||||
body.add(format("%d=%s", FLD_GD1_CODANAGR, (const char*) app->cod_ana()));
|
||||
body.add(format("%d=%s", FLD_GD1_CODANAGR, (const char*) app.cod_ana()));
|
||||
}
|
||||
else
|
||||
{
|
||||
body.add(format("%d=G", FLD_GD1_TIPOA));
|
||||
body.add(format("%d=%s", FLD_GD1_CODANAGR, (const char*) app->cod_ana()));
|
||||
body.add(format("%d=%s", FLD_GD1_CODANAGR, (const char*) app.cod_ana()));
|
||||
}
|
||||
#if XVT_OS == XVT_OS_WIN
|
||||
TString cmd("ba4b -2");
|
||||
TString16 cmd("ba4b -2");
|
||||
#else
|
||||
TString cmd("ba4 -2");
|
||||
TString16 cmd("ba4 -2");
|
||||
#endif
|
||||
TMessage msg(cmd2name(cmd), MSG_FS, (const char*) body);
|
||||
TMailbox mb;
|
||||
mb.send(msg);
|
||||
TLocalisamfile* d = app->get_relation()->lfile();
|
||||
TLocalisamfile* d = app.get_relation()->lfile();
|
||||
|
||||
d->setkey(1);
|
||||
d->zero();
|
||||
d->put(N_TIPOA, app->ana_fis() ? "F" : "G");
|
||||
d->put(N_TIPOA, app.ana_fis() ? "F" : "G");
|
||||
d->put(N_CODANAGR, m.get(FLD_CODANAGR));
|
||||
d->read(_isequal, _unlock) ;
|
||||
TExternal_app a(cmd);
|
||||
|
589
ba/ba4300.cpp
589
ba/ba4300.cpp
@ -7,7 +7,6 @@
|
||||
#include <files.h>
|
||||
|
||||
#if XVT_OS == XVT_OS_SCOUNIX
|
||||
// extern "C" int mkdir(char*, int);
|
||||
#include <sys/stat.h>
|
||||
#else
|
||||
#include <direct.h>
|
||||
@ -52,219 +51,219 @@ const char* COMTRIB = "COMTRIB";
|
||||
|
||||
#define TABATT "%ais"
|
||||
#define CODTAB "CODTAB"
|
||||
#define S0 "S0"
|
||||
#define DESCR "DESCR"
|
||||
#define S0 "S0"
|
||||
#define DESCR "DESCR"
|
||||
|
||||
class BA4300_application : public TRelation_application
|
||||
{
|
||||
TMask* _msk;
|
||||
TRelation *_rel;
|
||||
TLocalisamfile* _anag;
|
||||
TLocalisamfile* _unloc;
|
||||
TLocalisamfile* _attiv;
|
||||
TLocalisamfile* _tabcom;
|
||||
TMask* _msk;
|
||||
TRelation *_rel;
|
||||
TLocalisamfile* _anag;
|
||||
TLocalisamfile* _unloc;
|
||||
TLocalisamfile* _attiv;
|
||||
TLocalisamfile* _tabcom;
|
||||
|
||||
protected:
|
||||
bool user_create() ;
|
||||
bool user_destroy() ;
|
||||
virtual TMask* get_mask(int) { return _msk;}
|
||||
virtual bool changing_mask(int) { return FALSE;}
|
||||
virtual void init_query_mode(TMask& m) ;
|
||||
virtual void init_insert_mode(TMask& m) ;
|
||||
virtual void init_modify_mode(TMask& m) ;
|
||||
bool user_create() ;
|
||||
bool user_destroy() ;
|
||||
virtual TMask* get_mask(int) { return _msk;}
|
||||
virtual bool changing_mask(int) { return FALSE;}
|
||||
virtual void init_query_mode(TMask& m) ;
|
||||
virtual void init_insert_mode(TMask& m) ;
|
||||
virtual void init_modify_mode(TMask& m) ;
|
||||
|
||||
bool build_firm_data(long cod, bool flagcom);
|
||||
bool build_firm_data(long cod, bool flagcom);
|
||||
|
||||
public:
|
||||
BA4300_application();
|
||||
virtual TRelation* get_relation() const { return _rel;}
|
||||
virtual int write(const TMask& m);
|
||||
virtual ~BA4300_application() {}
|
||||
BA4300_application();
|
||||
virtual TRelation* get_relation() const { return _rel;}
|
||||
virtual int write(const TMask& m);
|
||||
virtual ~BA4300_application() {}
|
||||
};
|
||||
|
||||
bool ba4300_handler(TMask& m, KEY k)
|
||||
|
||||
{
|
||||
if (k != K_F5 && k != K_F6 && k != K_F7 && k != K_F8)
|
||||
return TRUE;
|
||||
if (m.mode() == MODE_MOD || m.mode() == MODE_INS)
|
||||
{
|
||||
BA4300_application* app = (BA4300_application*) MainApp();
|
||||
if (m.mode() == MODE_INS)
|
||||
{
|
||||
if (!m.check_fields()) return FALSE;
|
||||
if (app->write(m) != NOERR) return TRUE;
|
||||
m.stop_run(K_ESC);
|
||||
}
|
||||
TString appname;
|
||||
int fld = 0, fld1 = 0, fldbrowse = 0;
|
||||
{
|
||||
if (k != K_F5 && k != K_F6 && k != K_F7 && k != K_F8)
|
||||
return TRUE;
|
||||
if (m.mode() == MODE_MOD || m.mode() == MODE_INS)
|
||||
{
|
||||
BA4300_application* app = (BA4300_application*) MainApp();
|
||||
if (m.mode() == MODE_INS)
|
||||
{
|
||||
if (!m.check_fields()) return FALSE;
|
||||
if (app->write(m) != NOERR) return TRUE;
|
||||
m.stop_run(K_ESC);
|
||||
}
|
||||
TString appname;
|
||||
int fld = 0, fld1 = 0, fldbrowse = 0;
|
||||
|
||||
if (k == K_F5)
|
||||
{
|
||||
appname = "ba4 -3";
|
||||
fld = FLD_UL1_CODDITTA;
|
||||
fld1 = FLD_UL1_CODDITTA_NDITTE_RAGSOC;
|
||||
fldbrowse = FLD_UL1_CODULC;
|
||||
}
|
||||
if (k == K_F6)
|
||||
{
|
||||
appname = "ba4 -4";
|
||||
fld = FLD_AT1_CODDITTA;
|
||||
fld1 = FLD_AT1_PROGD_NDITTE_RAGSOC;
|
||||
fldbrowse = FLD_AT1_CODDITTAH;
|
||||
}
|
||||
if (k == K_F7)
|
||||
{
|
||||
appname = "ba4 -5";
|
||||
fld = FLD_SC1_CODDITTA;
|
||||
fld1 = FLD_SC1_CODDITTA_NDITTE_RAGSOC;
|
||||
fldbrowse = FLD_SC1_CODANAGRSOH;
|
||||
}
|
||||
if (k == K_F8) { appname = "ba3 -0 reg"; fld = 0;fldbrowse = 0;}
|
||||
if (appname.not_empty())
|
||||
{
|
||||
TString body(16);
|
||||
TLocalisamfile* d = app->get_relation()->lfile();
|
||||
if (k == K_F5)
|
||||
{
|
||||
appname = "ba4 -3";
|
||||
fld = FLD_UL1_CODDITTA;
|
||||
fld1 = FLD_UL1_CODDITTA_NDITTE_RAGSOC;
|
||||
fldbrowse = FLD_UL1_CODULC;
|
||||
}
|
||||
if (k == K_F6)
|
||||
{
|
||||
appname = "ba4 -4";
|
||||
fld = FLD_AT1_CODDITTA;
|
||||
fld1 = FLD_AT1_PROGD_NDITTE_RAGSOC;
|
||||
fldbrowse = FLD_AT1_CODDITTAH;
|
||||
}
|
||||
if (k == K_F7)
|
||||
{
|
||||
appname = "ba4 -5";
|
||||
fld = FLD_SC1_CODDITTA;
|
||||
fld1 = FLD_SC1_CODDITTA_NDITTE_RAGSOC;
|
||||
fldbrowse = FLD_SC1_CODANAGRSOH;
|
||||
}
|
||||
if (k == K_F8) { appname = "ba3 -0 reg"; fld = 0;fldbrowse = 0;}
|
||||
if (appname.not_empty())
|
||||
{
|
||||
TString body(16);
|
||||
TLocalisamfile* d = app->get_relation()->lfile();
|
||||
|
||||
#if XVT_OS == XVT_OS_WIN
|
||||
if (k != K_F8) appname.insert("a", 3);
|
||||
if (k != K_F8) appname.insert("a", 3);
|
||||
#endif
|
||||
if (fldbrowse)
|
||||
body << fldbrowse << "|";
|
||||
if (fld)
|
||||
body << fld << "=" << m.get(FLD_GD1_CODDITTA) ;
|
||||
if (fld1)
|
||||
body << "|" << fld1 << "=" ;
|
||||
if (fldbrowse || fld)
|
||||
{
|
||||
TMessage msg(cmd2name(appname), MSG_FS, (const char*) body);
|
||||
if (fldbrowse)
|
||||
body << fldbrowse << "|";
|
||||
if (fld)
|
||||
body << fld << "=" << m.get(FLD_GD1_CODDITTA) ;
|
||||
if (fld1)
|
||||
body << "|" << fld1 << "=" ;
|
||||
if (fldbrowse || fld)
|
||||
{
|
||||
TMessage msg(cmd2name(appname), MSG_FS, (const char*) body);
|
||||
|
||||
TMailbox mb;
|
||||
mb.send(msg);
|
||||
}
|
||||
d->setkey(1);
|
||||
d->zero();
|
||||
d->put("CODDITTA", m.get(FLD_GD1_CODDITTA));
|
||||
d->read(_isequal, _unlock) ;
|
||||
TExternal_app a(appname);
|
||||
long oldditta = prefhndl->get_codditta();
|
||||
if (k == K_F8) prefhndl->set_codditta(atol(m.get(FLD_GD1_CODDITTA)), TRUE);
|
||||
a.run();
|
||||
if (k == K_F8) prefhndl->set_codditta(oldditta, TRUE);
|
||||
d->read(_iscurr, _lock) ;
|
||||
m.set_focus();
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
TMailbox mb;
|
||||
mb.send(msg);
|
||||
}
|
||||
d->setkey(1);
|
||||
d->zero();
|
||||
d->put("CODDITTA", m.get(FLD_GD1_CODDITTA));
|
||||
d->read(_isequal, _unlock) ;
|
||||
TExternal_app a(appname);
|
||||
long oldditta = prefhndl->get_codditta();
|
||||
if (k == K_F8) prefhndl->set_codditta(atol(m.get(FLD_GD1_CODDITTA)), TRUE);
|
||||
a.run();
|
||||
if (k == K_F8) prefhndl->set_codditta(oldditta, TRUE);
|
||||
d->read(_iscurr, _lock) ;
|
||||
m.set_focus();
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
bool BA4300_application::build_firm_data(long codditta, bool flagcom)
|
||||
|
||||
{
|
||||
const TString ndir(firm2dir(codditta));
|
||||
const char* ntrrec = "trc.gen";
|
||||
const TFilename s1(format("%s/%s", (const char*) ndir, ntrrec));
|
||||
const char* nd = "dir.gen";
|
||||
const TFilename s2(format("%s/%s", (const char*) ndir, nd));
|
||||
const TString ndir(firm2dir(codditta));
|
||||
const char* ntrrec = "trc.gen";
|
||||
const TFilename s1(format("%s/%s", (const char*) ndir, ntrrec));
|
||||
const char* nd = "dir.gen";
|
||||
const TFilename s2(format("%s/%s", (const char*) ndir, nd));
|
||||
|
||||
if (fexist(s1) && fexist(s2))
|
||||
return TRUE;
|
||||
if (fexist(ndir))
|
||||
{
|
||||
const bool ok = yesno_box("Direttorio %s esistente, lo ricostruisco", (const char*) ndir);
|
||||
if (!ok) return TRUE;
|
||||
}
|
||||
else
|
||||
if (fexist(s1) && fexist(s2))
|
||||
return TRUE;
|
||||
if (fexist(ndir))
|
||||
{
|
||||
const bool ok = yesno_box("Direttorio %s esistente, lo ricostruisco", (const char*) ndir);
|
||||
if (!ok) return TRUE;
|
||||
}
|
||||
else
|
||||
#if XVT_OS == XVT_OS_SCOUNIX
|
||||
if (mkdir(ndir, 0777) == -1)
|
||||
if (mkdir(ndir, 0777) == -1)
|
||||
#else
|
||||
if (mkdir(ndir) == -1)
|
||||
if (mkdir(ndir) == -1)
|
||||
#endif
|
||||
return error_box("non posso creare il direttorio della ditta %ld (%s)",
|
||||
codditta, (const char*) ndir);
|
||||
if (!fexist(s1))
|
||||
if (!fcopy(ntrrec, s1))
|
||||
return error_box("non posso copiare il file %s della ditta %ld",
|
||||
ntrrec, codditta);
|
||||
if (!fexist(s2))
|
||||
if (!fcopy(nd, s2))
|
||||
return error_box("non posso copiare il file %s della ditta %ld",
|
||||
nd, codditta);
|
||||
return error_box("non posso creare il direttorio della ditta %ld (%s)",
|
||||
codditta, (const char*) ndir);
|
||||
if (!fexist(s1))
|
||||
if (!fcopy(ntrrec, s1))
|
||||
return error_box("non posso copiare il file %s della ditta %ld",
|
||||
ntrrec, codditta);
|
||||
if (!fexist(s2))
|
||||
if (!fcopy(nd, s2))
|
||||
return error_box("non posso copiare il file %s della ditta %ld",
|
||||
nd, codditta);
|
||||
|
||||
set_cursor(TASK_WIN, CURSOR_WAIT);
|
||||
const long old_firm = get_firm();
|
||||
TDir dir, dir1;
|
||||
TTrec rec;
|
||||
set_cursor(TASK_WIN, CURSOR_WAIT);
|
||||
const long old_firm = get_firm();
|
||||
TDir dir, dir1;
|
||||
TTrec rec;
|
||||
|
||||
prefhndl->set("");
|
||||
dir1.get(LF_DIR, _nolock, _nordir, _sysdirop);
|
||||
const long maxeod0 = dir1.eod();
|
||||
prefhndl->set("");
|
||||
dir1.get(LF_DIR, _nolock, _nordir, _sysdirop);
|
||||
const long maxeod0 = dir1.eod();
|
||||
|
||||
prefhndl->set_codditta(codditta);
|
||||
dir.get(LF_DIR, _nolock, _nordir, _sysdirop);
|
||||
if (dir.eod() == 0)
|
||||
{
|
||||
dir1.eod() = 1L;
|
||||
dir1.put(LF_DIR, _nordir, _sysdirop);
|
||||
dir.get(LF_DIR, _nolock, _nordir, _sysdirop);
|
||||
}
|
||||
const long maxeod1 = dir.eod();
|
||||
prefhndl->set_codditta(codditta);
|
||||
dir.get(LF_DIR, _nolock, _nordir, _sysdirop);
|
||||
if (dir.eod() == 0)
|
||||
{
|
||||
dir1.eod() = 1L;
|
||||
dir1.put(LF_DIR, _nordir, _sysdirop);
|
||||
dir.get(LF_DIR, _nolock, _nordir, _sysdirop);
|
||||
}
|
||||
const long maxeod1 = dir.eod();
|
||||
|
||||
if (maxeod0 > maxeod1)
|
||||
{
|
||||
dir.get(LF_DIR, _nolock, _nordir, _sysdirop);
|
||||
dir.eod() = maxeod0;
|
||||
dir.put(LF_DIR, _nordir, _sysdirop);
|
||||
rec.zero();
|
||||
}
|
||||
for (int i = LF_DIR + 1; i <= maxeod0; i++)
|
||||
{
|
||||
dir.get(i, _nolock, _nordir, _sysdirop);
|
||||
if (dir.eod() == 0L && dir.eox() == 0L)
|
||||
{
|
||||
prefhndl->set("");
|
||||
dir.get(i, _nolock, _nordir, _sysdirop);
|
||||
rec.get(i);
|
||||
prefhndl->set_codditta(codditta);
|
||||
const char* name = dir.name();
|
||||
dir.flags() = 0L;
|
||||
const bool valid_file = *name && dir.len() > 0;
|
||||
const bool create_now = flagcom ? *name == '%' : *name != '%';
|
||||
if (valid_file && create_now)
|
||||
{
|
||||
dir.put(i, _nordir, _sysdirop);
|
||||
rec.put(i);
|
||||
TSystemisamfile f(i);
|
||||
if (maxeod0 > maxeod1)
|
||||
{
|
||||
dir.get(LF_DIR, _nolock, _nordir, _sysdirop);
|
||||
dir.eod() = maxeod0;
|
||||
dir.put(LF_DIR, _nordir, _sysdirop);
|
||||
rec.zero();
|
||||
}
|
||||
for (int i = LF_DIR + 1; i <= maxeod0; i++)
|
||||
{
|
||||
dir.get(i, _nolock, _nordir, _sysdirop);
|
||||
if (dir.eod() == 0L && dir.eox() == 0L)
|
||||
{
|
||||
prefhndl->set("");
|
||||
dir.get(i, _nolock, _nordir, _sysdirop);
|
||||
rec.get(i);
|
||||
prefhndl->set_codditta(codditta);
|
||||
const char* name = dir.name();
|
||||
dir.flags() = 0L;
|
||||
const bool valid_file = *name && dir.len() > 0;
|
||||
const bool create_now = flagcom ? *name == '%' : *name != '%';
|
||||
if (valid_file && create_now)
|
||||
{
|
||||
dir.put(i, _nordir, _sysdirop);
|
||||
rec.put(i);
|
||||
TSystemisamfile f(i);
|
||||
|
||||
f.build(30); // cambiare
|
||||
BA4300_application* app = (BA4300_application*) MainApp();
|
||||
for (int j = 0 ; j < 99 ; j++)
|
||||
{
|
||||
if (app->has_module(j))
|
||||
{
|
||||
const TString s(format("std/f%04d%02d.txt", i, j));
|
||||
if (fexist(s)) f.load(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!flagcom)
|
||||
{
|
||||
dir.len() = 0;
|
||||
rec.zero();
|
||||
}
|
||||
dir.put(i, _nordir, _sysdirop);
|
||||
rec.put(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
f.build(30); // cambiare
|
||||
BA4300_application* app = (BA4300_application*) MainApp();
|
||||
for (int j = 0 ; j < 99 ; j++)
|
||||
{
|
||||
if (app->has_module(j))
|
||||
{
|
||||
const TString s(format("std/f%04d%02d.txt", i, j));
|
||||
if (fexist(s)) f.load(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!flagcom)
|
||||
{
|
||||
dir.len() = 0;
|
||||
rec.zero();
|
||||
}
|
||||
dir.put(i, _nordir, _sysdirop);
|
||||
rec.put(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set_firm(old_firm);
|
||||
set_cursor(TASK_WIN, CURSOR_ARROW);
|
||||
return TRUE;
|
||||
set_firm(old_firm);
|
||||
set_cursor(TASK_WIN, CURSOR_ARROW);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
@ -274,152 +273,152 @@ BA4300_application::BA4300_application()
|
||||
|
||||
bool BA4300_application::user_create() // initvar e arrmask
|
||||
{
|
||||
_msk = new TMask("ba4300a") ;
|
||||
_msk->set_handler(ba4300_handler);
|
||||
_rel = new TRelation(LF_NDITTE);
|
||||
_anag = new TLocalisamfile(LF_ANAG);
|
||||
_unloc = new TLocalisamfile(LF_UNLOC);
|
||||
_attiv = new TLocalisamfile(LF_ATTIV);
|
||||
_tabcom = new TLocalisamfile(LF_TABCOM);
|
||||
set_search_field(FLD_GD1_CODDITTA);
|
||||
return TRUE;
|
||||
_msk = new TMask("ba4300a") ;
|
||||
_msk->set_handler(ba4300_handler);
|
||||
_rel = new TRelation(LF_NDITTE);
|
||||
_anag = new TLocalisamfile(LF_ANAG);
|
||||
_unloc = new TLocalisamfile(LF_UNLOC);
|
||||
_attiv = new TLocalisamfile(LF_ATTIV);
|
||||
_tabcom = new TLocalisamfile(LF_TABCOM);
|
||||
set_search_field(FLD_GD1_CODDITTA);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
bool BA4300_application::user_destroy() // releasev e arrmask
|
||||
{
|
||||
delete _msk;
|
||||
delete _rel;
|
||||
delete _anag;
|
||||
delete _unloc;
|
||||
delete _attiv;
|
||||
delete _tabcom;
|
||||
return TRUE;
|
||||
delete _msk;
|
||||
delete _rel;
|
||||
delete _anag;
|
||||
delete _unloc;
|
||||
delete _attiv;
|
||||
delete _tabcom;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
int BA4300_application::write(const TMask& m)
|
||||
{
|
||||
_rel->zero();
|
||||
m.autosave();
|
||||
_rel->write();
|
||||
if (_rel->bad())
|
||||
return _rel->status();
|
||||
_rel->zero();
|
||||
m.autosave();
|
||||
_rel->write();
|
||||
if (_rel->bad())
|
||||
return _rel->status();
|
||||
|
||||
TRectype& ditte=_rel->curr();
|
||||
TRectype& ditte=_rel->curr();
|
||||
|
||||
TString codditta(ditte.get(CODDITTA)) ;
|
||||
TString codditta(ditte.get(CODDITTA)) ;
|
||||
|
||||
_attiv->zero() ;
|
||||
_attiv->put(CODDITTA, (const char*) codditta) ;
|
||||
_attiv->put(CODATT, ditte.get(CODATTPREV)) ;
|
||||
_attiv->zero() ;
|
||||
_attiv->put(CODDITTA, (const char*) codditta) ;
|
||||
_attiv->put(CODATT, ditte.get(CODATTPREV)) ;
|
||||
|
||||
TTable* tabatt = new TTable(TABATT);
|
||||
tabatt->zero();
|
||||
tabatt->put(CODTAB, ditte.get(CODATTPREV)) ;
|
||||
tabatt->read();
|
||||
if (tabatt->good()) _attiv->put(DESCR, tabatt->curr().get(S0)) ;
|
||||
delete tabatt;
|
||||
TTable* tabatt = new TTable(TABATT);
|
||||
tabatt->zero();
|
||||
tabatt->put(CODTAB, ditte.get(CODATTPREV)) ;
|
||||
tabatt->read();
|
||||
if (tabatt->good()) _attiv->put(DESCR, tabatt->curr().get(S0)) ;
|
||||
delete tabatt;
|
||||
|
||||
_attiv->write();
|
||||
_attiv->write();
|
||||
|
||||
_anag->zero() ;
|
||||
_anag->put(TIPOA, ditte.get(TIPOA));
|
||||
_anag->put(CODANAGR, ditte.get(CODANAGR));
|
||||
_anag->read();
|
||||
if (_anag->good())
|
||||
{
|
||||
_unloc->zero() ;
|
||||
_unloc->put(CODDITTA, (const char*) codditta) ;
|
||||
_unloc->put(CODULC, (int) 1) ;
|
||||
TString s(_anag->get(COMRF));
|
||||
if (s.empty())
|
||||
{
|
||||
_unloc->put(COMULC, _anag->get(COMRES));
|
||||
_unloc->put(INDULC, _anag->get(INDRES));
|
||||
_unloc->put(CIVULC, _anag->get(CIVRES));
|
||||
_unloc->put(CAPULC, _anag->get(CAPRES));
|
||||
_unloc->put(COMCCIAA, _anag->get(COMRES));
|
||||
_unloc->put(COMTRIB, _anag->get(COMRES));
|
||||
}
|
||||
else
|
||||
{
|
||||
_unloc->put(COMULC, (const char*) s);
|
||||
_unloc->put(INDULC, _anag->get(INDRF));
|
||||
_unloc->put(CIVULC, _anag->get(CIVRF));
|
||||
_unloc->put(CAPULC, _anag->get(CAPRF));
|
||||
_unloc->put(COMCCIAA, (const char*) s);
|
||||
_unloc->put(COMTRIB, (const char*) s);
|
||||
}
|
||||
_unloc->write();
|
||||
}
|
||||
build_firm_data(atol(codditta), FALSE);
|
||||
return NOERR;
|
||||
_anag->zero() ;
|
||||
_anag->put(TIPOA, ditte.get(TIPOA));
|
||||
_anag->put(CODANAGR, ditte.get(CODANAGR));
|
||||
_anag->read();
|
||||
if (_anag->good())
|
||||
{
|
||||
_unloc->zero() ;
|
||||
_unloc->put(CODDITTA, (const char*) codditta) ;
|
||||
_unloc->put(CODULC, (int) 1) ;
|
||||
TString s(_anag->get(COMRF));
|
||||
if (s.empty())
|
||||
{
|
||||
_unloc->put(COMULC, _anag->get(COMRES));
|
||||
_unloc->put(INDULC, _anag->get(INDRES));
|
||||
_unloc->put(CIVULC, _anag->get(CIVRES));
|
||||
_unloc->put(CAPULC, _anag->get(CAPRES));
|
||||
_unloc->put(COMCCIAA, _anag->get(COMRES));
|
||||
_unloc->put(COMTRIB, _anag->get(COMRES));
|
||||
}
|
||||
else
|
||||
{
|
||||
_unloc->put(COMULC, (const char*) s);
|
||||
_unloc->put(INDULC, _anag->get(INDRF));
|
||||
_unloc->put(CIVULC, _anag->get(CIVRF));
|
||||
_unloc->put(CAPULC, _anag->get(CAPRF));
|
||||
_unloc->put(COMCCIAA, (const char*) s);
|
||||
_unloc->put(COMTRIB, (const char*) s);
|
||||
}
|
||||
_unloc->write();
|
||||
}
|
||||
build_firm_data(atol(codditta), FALSE);
|
||||
return NOERR;
|
||||
}
|
||||
|
||||
|
||||
void BA4300_application::init_query_mode(TMask& m)
|
||||
{
|
||||
if (filtered())
|
||||
{
|
||||
m.show(FLD_GD1_CODDITTAH);
|
||||
m.hide(FLD_GD1_CODDITTA);
|
||||
}
|
||||
else
|
||||
{
|
||||
m.show(FLD_GD1_CODDITTA);
|
||||
m.hide(FLD_GD1_CODDITTAH);
|
||||
}
|
||||
init_insert_mode(m);
|
||||
if (filtered())
|
||||
{
|
||||
m.show(FLD_GD1_CODDITTAH);
|
||||
m.hide(FLD_GD1_CODDITTA);
|
||||
}
|
||||
else
|
||||
{
|
||||
m.show(FLD_GD1_CODDITTA);
|
||||
m.hide(FLD_GD1_CODDITTAH);
|
||||
}
|
||||
init_insert_mode(m);
|
||||
}
|
||||
|
||||
void BA4300_application::init_insert_mode(TMask& m)
|
||||
{
|
||||
if (!filtered())
|
||||
{
|
||||
m.enable(FLD_GD1_TIPOA);
|
||||
m.enable(FLD_GD1_CODANAGR);
|
||||
m.enable(FLD_GD1_CODANAGR_ANAGR_RAGSOC);
|
||||
m.show(FLD_GD1_CODDITTA);
|
||||
m.hide(FLD_GD1_CODDITTAH);
|
||||
}
|
||||
else
|
||||
{
|
||||
m.show(FLD_GD1_CODDITTAH);
|
||||
m.hide(FLD_GD1_CODDITTA);
|
||||
}
|
||||
m.disable(DLG_ATT);
|
||||
m.disable(DLG_ULC);
|
||||
m.disable(DLG_SOC);
|
||||
m.disable(DLG_REG);
|
||||
if (!filtered())
|
||||
{
|
||||
m.enable(FLD_GD1_TIPOA);
|
||||
m.enable(FLD_GD1_CODANAGR);
|
||||
m.enable(FLD_GD1_CODANAGR_ANAGR_RAGSOC);
|
||||
m.show(FLD_GD1_CODDITTA);
|
||||
m.hide(FLD_GD1_CODDITTAH);
|
||||
}
|
||||
else
|
||||
{
|
||||
m.show(FLD_GD1_CODDITTAH);
|
||||
m.hide(FLD_GD1_CODDITTA);
|
||||
}
|
||||
m.disable(DLG_ATT);
|
||||
m.disable(DLG_ULC);
|
||||
m.disable(DLG_SOC);
|
||||
m.disable(DLG_REG);
|
||||
}
|
||||
|
||||
void BA4300_application::init_modify_mode(TMask& m)
|
||||
{
|
||||
m.disable(FLD_GD1_TIPOA);
|
||||
m.disable(FLD_GD1_CODANAGR);
|
||||
m.disable(FLD_GD1_CODANAGR_ANAGR_RAGSOC);
|
||||
if (filtered())
|
||||
{
|
||||
m.show(FLD_GD1_CODDITTAH);
|
||||
m.hide(FLD_GD1_CODDITTA);
|
||||
}
|
||||
else
|
||||
{
|
||||
m.show(FLD_GD1_CODDITTA);
|
||||
m.hide(FLD_GD1_CODDITTAH);
|
||||
}
|
||||
m.enable(DLG_ATT);
|
||||
m.enable(DLG_ULC);
|
||||
m.enable(DLG_SOC);
|
||||
m.enable(DLG_REG);
|
||||
m.disable(FLD_GD1_TIPOA);
|
||||
m.disable(FLD_GD1_CODANAGR);
|
||||
m.disable(FLD_GD1_CODANAGR_ANAGR_RAGSOC);
|
||||
if (filtered())
|
||||
{
|
||||
m.show(FLD_GD1_CODDITTAH);
|
||||
m.hide(FLD_GD1_CODDITTA);
|
||||
}
|
||||
else
|
||||
{
|
||||
m.show(FLD_GD1_CODDITTA);
|
||||
m.hide(FLD_GD1_CODDITTAH);
|
||||
}
|
||||
m.enable(DLG_ATT);
|
||||
m.enable(DLG_ULC);
|
||||
m.enable(DLG_SOC);
|
||||
m.enable(DLG_REG);
|
||||
}
|
||||
|
||||
int ba4300(int argc, char* argv[])
|
||||
{
|
||||
|
||||
BA4300_application a ;
|
||||
a.run(argc, argv, "Anagrafica Ditta");
|
||||
return 0;
|
||||
BA4300_application a ;
|
||||
a.run(argc, argv, "Anagrafica Ditta");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user