ba*.cpp Tolti include inutili

ba3500.cpp Corretta creazione della prima unita' locale
ba610?.cpp Corretti vari errori segnalati sul fax dalla Cecilia


git-svn-id: svn://10.65.10.50/trunk@5668 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1997-11-27 11:14:52 +00:00
parent 185fb663f3
commit dcd9df026d
13 changed files with 147 additions and 151 deletions

View File

@ -1,7 +1,6 @@
#include <config.h> #include <config.h>
#include <printer.h> #include <printer.h>
#include <tabapp.h> #include <tabapp.h>
#include <tabutil.h>
#include "../cg/cglib03.h" #include "../cg/cglib03.h"
#include "batbreg.h" #include "batbreg.h"

View File

@ -331,7 +331,7 @@ int BA3500_application::cancella(long items)
for (long i = 0; i < items; i++) for (long i = 0; i < items; i++)
{ {
tab_inl.zero(); tab_inl.zero();
dep = format ("%04d", anno); dep.format("%04d", anno);
dep << format ("%-3s" , (const char*) codlib); dep << format ("%-3s" , (const char*) codlib);
dep << format ("%6d" , i); dep << format ("%6d" , i);
tab_inl.put("CODTAB", dep); tab_inl.put("CODTAB", dep);

View File

@ -1,6 +1,5 @@
#include <relapp.h> #include <relapp.h>
#include <msksheet.h>
#include <stdtypes.h>
#include "ba4.h" #include "ba4.h"
#include "ba4100.h" #include "ba4100.h"

View File

@ -1,12 +1,10 @@
#include <config.h>
#include <defmask.h>
#include <execp.h> #include <execp.h>
#include <golem.h> #include <golem.h>
#include <mask.h>
#include <mailbox.h> #include <mailbox.h>
#include <relapp.h> #include <relapp.h>
#include <tabutil.h> #include <tabutil.h>
#include <utility.h> #include <utility.h>
#include <urldefid.h>
#include <validate.h> #include <validate.h>
#include "ba4.h" #include "ba4.h"
@ -81,20 +79,16 @@ bool TPersone_app::ba4200_handler(TMask& m, KEY k)
if (k != K_F5 || m.mode() != MODE_MOD) return TRUE; if (k != K_F5 || m.mode() != MODE_MOD) return TRUE;
TToken_string body(16); TToken_string body(16);
body.add(format("%d", FLD_GD1_CODDITTAH)); body.add(FLD_GD1_CODDITTAH);
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()));
}
else
{
body.add(format("%d=G", FLD_GD1_TIPOA));
body.add(format("%d=%s", FLD_GD1_CODANAGR, (const char*) app.cod_ana()));
}
TString16 cmd("ba4 -2");
TMessage msg(cmd2name(cmd), MSG_FS, (const char*) body);
body.add(FLD_GD1_TIPOA);
body << '=' << app.tip_ana();
body.add(FLD_GD1_CODANAGR);
body << '=' << app.cod_ana();
const TString16 cmd("ba4 -2");
TMessage msg(cmd, MSG_FS, body);
msg.send(); msg.send();
TExternal_app a(cmd); TExternal_app a(cmd);
a.run(); a.run();
@ -107,10 +101,6 @@ bool TPersone_app::fax_handler(TMask_field& f, KEY k)
bool ok = TRUE; bool ok = TRUE;
if (k == K_SPACE) if (k == K_SPACE)
{ {
// TConfig ini(CONFIG_USER, "Link");
// TFilename editor = ini.get("Editor", NULL, -1, "notepad");
// TExternal_app app(editor);
// ok = app.run(TRUE, FALSE) == 0;
TFilename msg; msg.temp(NULL, "txt"); TFilename msg; msg.temp(NULL, "txt");
ofstream msgf(msg); ofstream msgf(msg);
msgf.close(); msgf.close();
@ -165,7 +155,6 @@ void TPersone_app::init_query_mode(TMask& m)
} }
const char* TPersone_app::get_next_key() const char* TPersone_app::get_next_key()
{ {
TLocalisamfile& anag = get_relation()->lfile() ; TLocalisamfile& anag = get_relation()->lfile() ;
long cod_anagr = 1; long cod_anagr = 1;

View File

@ -1,13 +1,11 @@
#include <config.h>
#include <defmask.h>
#include <execp.h> #include <execp.h>
#include <golem.h> #include <golem.h>
#include <mailbox.h> #include <mailbox.h>
#include <prefix.h> #include <prefix.h>
#include <relapp.h> #include <relapp.h>
#include <tabutil.h> #include <tabutil.h>
#include <utility.h>
#include <modaut.h> #include <modaut.h>
#include <urldefid.h>
#include "ba4.h" #include "ba4.h"
#include "ba4300.h" #include "ba4300.h"
@ -148,7 +146,7 @@ bool ba4300_handler(TMask& m, KEY k)
body << "|" << fld1 << "=" ; body << "|" << fld1 << "=" ;
if (fldbrowse || fld) if (fldbrowse || fld)
{ {
TMessage msg(cmd2name(appname), MSG_FS, (const char*) body); TMessage msg(appname, MSG_FS, body);
TMailbox mb; TMailbox mb;
mb.send(msg); mb.send(msg);
@ -174,10 +172,11 @@ bool TDitte_application::fax_handler(TMask_field& f, KEY k)
bool ok = TRUE; bool ok = TRUE;
if (k == K_SPACE) if (k == K_SPACE)
{ {
TConfig ini(CONFIG_USER, "Link"); TFilename msg; msg.temp(NULL, "txt");
TFilename editor = ini.get("Editor", NULL, -1, "notepad"); ofstream msgf(msg);
TExternal_app app(editor); msgf.close();
ok = app.run(TRUE, FALSE) == 0; ok = goto_url(msg);
if (ok) if (ok)
{ {
const TDitte_application& app = (const TDitte_application&)main_app(); const TDitte_application& app = (const TDitte_application&)main_app();
@ -286,40 +285,24 @@ int TDitte_application::write(const TMask& m)
const int err = TRelation_application::write(m); const int err = TRelation_application::write(m);
if (err == NOERR) if (err == NOERR)
{ {
TRectype& ditte=_rel->curr();
TString codditta(ditte.get(CODDITTA)) ;
set_att_prev(m); set_att_prev(m);
const TRectype& ditte = _rel->curr();
_anag->zero() ; _anag->zero() ;
_anag->put(TIPOA, ditte.get(TIPOA)); _anag->put(TIPOA, ditte.get(TIPOA));
_anag->put(CODANAGR, ditte.get(CODANAGR)); _anag->put(CODANAGR, ditte.get(CODANAGR));
_anag->read(); _anag->read();
if (_anag->good()) if (_anag->read() == NOERR)
{ {
_unloc->zero() ; _unloc->zero() ;
_unloc->put(CODDITTA, (const char*) codditta) ; _unloc->put(CODDITTA, ditte.get(CODDITTA)) ;
_unloc->put(CODULC, (int) 1) ; _unloc->put(CODULC, 1);
TString s(_anag->get(COMRF)); _unloc->put(COMULC, _anag->get(COMRES));
if (s.empty()) _unloc->put(INDULC, _anag->get(INDRES));
{ _unloc->put(CIVULC, _anag->get(CIVRES));
_unloc->put(COMULC, _anag->get(COMRES)); _unloc->put(CAPULC, _anag->get(CAPRES));
_unloc->put(INDULC, _anag->get(INDRES)); _unloc->put(COMCCIAA, _anag->get(COMRES));
_unloc->put(CIVULC, _anag->get(CIVRES)); _unloc->put(COMTRIB, _anag->get(COMRES));
_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(); _unloc->write();
} }
} }

View File

@ -1,6 +1,5 @@
#include <relapp.h> #include <relapp.h>
#include <stdtypes.h>
#include <lffiles.h>
#include "ba4.h" #include "ba4.h"
#include "ba4400.h" #include "ba4400.h"

View File

@ -1,6 +1,4 @@
#include <relapp.h> #include <relapp.h>
#include <stdtypes.h>
#include <lffiles.h>
#include "ba4.h" #include "ba4.h"
#include "ba4500.h" #include "ba4500.h"

View File

@ -1,6 +1,4 @@
#include <relapp.h> #include <relapp.h>
#include <stdtypes.h>
#include <utility.h>
#include "ba4.h" #include "ba4.h"
#include "ba4600.h" #include "ba4600.h"
@ -12,8 +10,8 @@ class TSoci_application : public TRelation_application
TLocalisamfile* _anag; TLocalisamfile* _anag;
TLocalisamfile* _ditte; TLocalisamfile* _ditte;
bool user_create() ; virtual bool user_create() ;
bool user_destroy() ; virtual bool user_destroy() ;
virtual TMask* get_mask(int mode) { return _msk;} virtual TMask* get_mask(int mode) { return _msk;}
virtual bool changing_mask(int mode) { return FALSE;} virtual bool changing_mask(int mode) { return FALSE;}
virtual TRelation* get_relation() const { return _rel;} virtual TRelation* get_relation() const { return _rel;}
@ -32,7 +30,6 @@ public:
}; };
void TSoci_application::init_query_mode(TMask& m) void TSoci_application::init_query_mode(TMask& m)
{ {
m.show(FLD_SC1_CODANAGRSOH); m.show(FLD_SC1_CODANAGRSOH);
m.hide(FLD_SC1_CODANAGRSO); m.hide(FLD_SC1_CODANAGRSO);
@ -43,7 +40,6 @@ void TSoci_application::init_query_mode(TMask& m)
void TSoci_application::init_query_insert_mode(TMask& m) void TSoci_application::init_query_insert_mode(TMask& m)
{ {
m.show(FLD_SC1_CODANAGRSO); m.show(FLD_SC1_CODANAGRSO);
m.hide(FLD_SC1_CODANAGRSOH); m.hide(FLD_SC1_CODANAGRSOH);
@ -52,7 +48,6 @@ void TSoci_application::init_query_insert_mode(TMask& m)
} }
void TSoci_application::init_modify_mode(TMask& m) void TSoci_application::init_modify_mode(TMask& m)
{ {
m.disable(FLD_SC1_CODANAGR_ANAGR_RAGSOC); m.disable(FLD_SC1_CODANAGR_ANAGR_RAGSOC);
} }
@ -62,7 +57,7 @@ void TSoci_application::update_ap_socio(const TMask& m)
int err = NOERR; int err = NOERR;
const char ap = (m.get(FLD_SC1_ANNO)[0] == 'A') ? 'P' : 'A'; const char ap = (m.get(FLD_SC1_ANNO)[0] == 'A') ? 'P' : 'A';
if (yesno_box(format("Aggiornare il socio anche per l' anno %s?", ap == 'A' ? "in corso" : "precedente"))) if (yesno_box("Aggiornare il socio anche per l' anno %s?", ap == 'A' ? "in corso" : "precedente"))
{ {
_rel->save_status(); _rel->save_status();
m.autosave(*_rel); m.autosave(*_rel);
@ -98,7 +93,7 @@ bool TSoci_application::remove()
{ {
const char ap = (curr_mask().get(FLD_SC1_ANNO)[0] == 'A') ? 'P' : 'A'; const char ap = (curr_mask().get(FLD_SC1_ANNO)[0] == 'A') ? 'P' : 'A';
if (yesno_box(format("Cancellare il socio anche per l' anno %s?", ap == 'A' ? "in corso" : "precedente"))) if (yesno_box("Cancellare il socio anche per l' anno %s?", ap == 'A' ? "in corso" : "precedente"))
{ {
_rel->save_status(); _rel->save_status();
_rel->lfile().put("ATTPREC", ap); _rel->lfile().put("ATTPREC", ap);
@ -134,7 +129,7 @@ bool TSoci_application::user_destroy()
int ba4600(int argc, char* argv[]) int ba4600(int argc, char* argv[])
{ {
TSoci_application a ; TSoci_application a;
a.run(argc, argv, "Anagrafica Soci"); a.run(argc, argv, "Anagrafica Soci");
return 0; return 0;
} }

View File

@ -1,6 +1,5 @@
#include <applicat.h> #include <applicat.h>
#include <mask.h> #include <mask.h>
#include <isam.h>
#include <relation.h> #include <relation.h>
#include <sheet.h> #include <sheet.h>
#include <utility.h> #include <utility.h>

View File

@ -1,7 +1,6 @@
#include <config.h> #include <config.h>
#include <printer.h> #include <printer.h>
#include <relapp.h> #include <relapp.h>
#include <tabutil.h>
#include "batbreg.h" #include "batbreg.h"
#include "tabreg.h" #include "tabreg.h"

View File

@ -11,13 +11,15 @@
// ------- utils -------------------------------------------- // ------- utils --------------------------------------------
TRectype& TAnaprint_app::look_com(const char* cod) const TRectype& TAnaprint_app::look_com(const char* cod, const char* sta)
{ {
TRectype& com = _comuni->curr(); TRectype& com = _comuni->curr();
com.zero(); com.zero();
if (cod && *cod) if (cod && *cod)
{ {
com.put("COM",cod); com.put("COM",cod);
if (sta && *sta)
com.put("STATO",sta);
if (_comuni->read() != NOERR) if (_comuni->read() != NOERR)
com.zero(); com.zero();
} }
@ -126,7 +128,7 @@ bool TAnaprint_app::preprocess_page(int file, int counter)
if (!_phone.empty()) _phone << '/'; if (!_phone.empty()) _phone << '/';
_phone << current_cursor()->curr(LF_ANAG).get("TELRF"); _phone << current_cursor()->curr(LF_ANAG).get("TELRF");
TRectype& cc = look_com(_com); const TRectype& cc = look_com(_com);
_com = cc.get("DENCOM"); _com = cc.get("DENCOM");
_cap = cc.get("CAPCOM"); _cap = cc.get("CAPCOM");
_prov = cc.get("PROVCOM"); _prov = cc.get("PROVCOM");
@ -172,7 +174,7 @@ void TAnaprint_app::preprocess_etichette()
_name = get_field(LF_ANAG,"RAGSOC"); _name = get_field(LF_ANAG,"RAGSOC");
_cod = get_field(LF_ANAG,"CODANAGR"); _cod = get_field(LF_ANAG,"CODANAGR");
_cofi = get_field(LF_ANAG,"COFI"); _cofi = get_field(LF_ANAG,"COFI");
TRectype& cc = look_com(get_field(LF_ANAG,"COMCORR")); const TRectype& cc = look_com(get_field(LF_ANAG,"COMCORR"));
if (_cofi.empty()) if (_cofi.empty())
_cofi = get_field(LF_ANAG,"PAIV"); _cofi = get_field(LF_ANAG,"PAIV");
@ -202,7 +204,7 @@ void TAnaprint_app::preprocess_etichette()
_civ = get_field(LF_ANAG,"CIVRF"); _civ = get_field(LF_ANAG,"CIVRF");
_stato = "" ; // look_tab("%STA",get_field(LF_ANAG,"STATORF")); _stato = "" ; // look_tab("%STA",get_field(LF_ANAG,"STATORF"));
_cap = get_field(LF_ANAG,"CAPRF"); _cap = get_field(LF_ANAG,"CAPRF");
cc = look_com(get_field(LF_ANAG,"COMRF")); look_com(get_field(LF_ANAG,"COMRF"));
_loc = ""; _loc = "";
_com = cc.get("DENCOM"); _com = cc.get("DENCOM");
_prov = cc.get("PROVCOM"); _prov = cc.get("PROVCOM");
@ -214,9 +216,9 @@ void TAnaprint_app::preprocess_etichette()
case residenza: case residenza:
_address = get_field(LF_ANAG,"INDRES"); _address = get_field(LF_ANAG,"INDRES");
_civ = get_field(LF_ANAG,"CIVRES"); _civ = get_field(LF_ANAG,"CIVRES");
_stato = ""; //look_tab("%STA",get_field(LF_ANAG,"STATORES")); _stato = get_field(LF_ANAG,"STATORES");
_cap = get_field(LF_ANAG,"CAPRES"); _cap = get_field(LF_ANAG,"CAPRES");
cc = look_com(get_field(LF_ANAG,"COMRES")); look_com(get_field(LF_ANAG,"COMRES"), _stato);
_loc = ""; _loc = "";
_com = cc.get("DENCOM"); _com = cc.get("DENCOM");
_prov = cc.get("PROVCOM"); _prov = cc.get("PROVCOM");

View File

@ -66,7 +66,7 @@ public:
int cgiu() { return _sort == 1 ? _cgiu1 : _cgiu2; } int cgiu() { return _sort == 1 ? _cgiu1 : _cgiu2; }
int cdit() { return _sort == 1 ? _cdit1 : _cdit2; } int cdit() { return _sort == 1 ? _cdit1 : _cdit2; }
TRectype& look_com(const char* cod); const TRectype& look_com(const char* cod, const char* sta = NULL);
const char* look_tab(const char* tabname, const char* cod, const char* look_tab(const char* tabname, const char* cod,
const char* fld = "S0"); const char* fld = "S0");

View File

@ -33,14 +33,17 @@ void TAnaprint_app::set_scheda_anagiu()
FLD(LF_ANAG,"INDRES"), FLD(LF_ANAG,"INDRES"),
FLD(LF_ANAG,"CIVRES")); FLD(LF_ANAG,"CIVRES"));
TString com = current_cursor()->curr(LF_ANAG).get("COMRES"); TString com = get_field(LF_ANAG, "COMRES");
TRectype& cc = look_com(com); TString sta = get_field(LF_ANAG, "STATORES");
const TRectype& cc = look_com(com, sta);
TString a = cc.get("DENCOM"); TString a = cc.get("DENCOM");
TString b = cc.get("CAPCOM"); TString b = cc.get("CAPCOM");
TString c = cc.get("PROVCOM"); TString c = cc.get("PROVCOM");
set_row(row++,"@20gComune %s %-24s@58gProv. %2s@68gCAP %5s", set_row(row++,"@20gComune %s %-24s@58gProv. %2s@68gCAP %5s",
(const char*)com, (const char*)a, (const char*)c, (const char*)b); (const char*)com, (const char*)a, (const char*)c, (const char*)b);
a = sta.empty() ? "Italia" : look_tab("%STA",sta);
set_row(row++,"@20gStato %s",(const char*)a);
set_row(row++,"@20gTelefono @u@10s@r/@u@30s@r", set_row(row++,"@20gTelefono @u@10s@r/@u@30s@r",
FLD(LF_ANAG,"PTELRF"), FLD(LF_ANAG,"PTELRF"),
@ -52,7 +55,7 @@ void TAnaprint_app::set_scheda_anagiu()
FLD(LF_ANAG,"CIVRF")); FLD(LF_ANAG,"CIVRF"));
com = current_cursor()->curr(LF_ANAG).get("COMRF"); com = current_cursor()->curr(LF_ANAG).get("COMRF");
cc = look_com(com); look_com(com);
a = cc.get("DENCOM"); a = cc.get("DENCOM");
b = cc.get("CAPCOM"); b = cc.get("CAPCOM");
c = cc.get("PROVCOM"); c = cc.get("PROVCOM");
@ -65,8 +68,9 @@ void TAnaprint_app::set_scheda_anagiu()
FLD(LF_ANAG,"CIVCORR"), FLD(LF_ANAG,"CIVCORR"),
FLD(LF_ANAG,"LOCCORR")); FLD(LF_ANAG,"LOCCORR"));
com = current_cursor()->curr(LF_ANAG).get("COMCORR"); com = get_field(LF_ANAG, "COMCORR");
cc = look_com(com); sta = get_field(LF_ANAG, "STATOCORR");
look_com(com, sta);
a = cc.get("DENCOM"); a = cc.get("DENCOM");
b = cc.get("CAPCOM"); b = cc.get("CAPCOM");
c = cc.get("PROVCOM"); c = cc.get("PROVCOM");
@ -74,12 +78,9 @@ void TAnaprint_app::set_scheda_anagiu()
set_row(row++,"@20gComune %s %-24s@58gProv. %2s@68gCAP %5s", set_row(row++,"@20gComune %s %-24s@58gProv. %2s@68gCAP %5s",
(const char*)com, (const char*)a, (const char*)c, (const char*)b); (const char*)com, (const char*)a, (const char*)c, (const char*)b);
com = current_cursor()->curr(LF_ANAG).get("STATOCORR"); a = sta.empty() ? "Italia" : look_tab("%STA",sta);
if (com.empty())
a = "Italia";
else { a = look_tab("%STA",com,"S0"); }
set_row(row++,"@20gStato %s",(const char*)a); set_row(row++,"@20gStato %s",(const char*)a);
set_row(row++,""); set_row(row++,"");
set_row(row++,"Telex@20g@u@10s@r/@u@30s@r", set_row(row++,"Telex@20g@u@10s@r/@u@30s@r",
FLD(LF_ANAG,"PTLEXRF"), FLD(LF_ANAG,"PTLEXRF"),
@ -93,7 +94,7 @@ void TAnaprint_app::set_scheda_anagiu()
FLD(LF_ANAG,"UFFIIDD","@@@")); FLD(LF_ANAG,"UFFIIDD","@@@"));
com = look_tab("%UID",get_field(LF_ANAG, "UFFIIDD"),"S6"); // Comune imposte dirette com = look_tab("%UID",get_field(LF_ANAG, "UFFIIDD"),"S6"); // Comune imposte dirette
c = look_tab("%UID",get_field(LF_ANAG, "UFFIIDD"),"S4"); // c.c. Esattoria c = look_tab("%UID",get_field(LF_ANAG, "UFFIIDD"),"S4"); // c.c. Esattoria
cc = look_com(com); look_com(com);
a = cc.get("DENCOM"); a = cc.get("DENCOM");
b = cc.get("PROVCOM"); b = cc.get("PROVCOM");
set_row(row++,"@20gComune %s %-24s@58gProv. %s", set_row(row++,"@20gComune %s %-24s@58gProv. %s",
@ -102,21 +103,16 @@ void TAnaprint_app::set_scheda_anagiu()
set_row(row++,"Ufficio IVA@20gNumero @pn", set_row(row++,"Ufficio IVA@20gNumero @pn",
FLD(LF_ANAG,"UFFIVA","@@@")); FLD(LF_ANAG,"UFFIVA","@@@"));
com = look_tab("%UIV",get_field(LF_ANAG, "UFFIVA"),"S6"); com = look_tab("%UIV",get_field(LF_ANAG, "UFFIVA"),"S6");
cc = look_com(com); look_com(com);
a = cc.get("DENCOM"); a = cc.get("DENCOM");
b = cc.get("PROVCOM"); b = cc.get("PROVCOM");
set_row(row++,"@20gComune %s %-24s@58gProv. %s", set_row(row++,"@20gComune %s %-24s@58gProv. %s",
(const char*)com, (const char*)a, (const char*)b); (const char*)com, (const char*)a, (const char*)b);
set_row(row++,"Esattoria@20gComunale @02s Provinciale @03s C.C. %s", set_row(row++,"Esattoria@20gComunale @02s Provinciale @03s C.C. %s",
FLD(LF_ANAG,"CODCONTR",1,2), FLD(LF_ANAG,"CODCONTR",3,5), (const char*)c); FLD(LF_ANAG,"CODCONTR",0,2), FLD(LF_ANAG,"CODCONTR",2,5), (const char*)c);
set_row(row++,"@20gCodice contribuente @8s @2s",
set_row(row++,"@20gComune %-24s@58gProv. %s", FLD(LF_ANAG,"CODCONTR", 5, 13), FLD(LF_ANAG,"CODCONTR", 13, 15));
(const char*)a,
(const char*)b);
set_row(row++,"@20gCodice contribuente @pn",
FLD(LF_ANAG,"CODCONTR", "@@ @@@ @@@@@@@@ @@"));
set_row(row++,"");
//Qui la stampa dei dati conto fiscale //Qui la stampa dei dati conto fiscale
TString16 tipo_stampa; TString16 tipo_stampa;
@ -126,24 +122,39 @@ void TAnaprint_app::set_scheda_anagiu()
else tipo_stampa = "Distinta"; else tipo_stampa = "Distinta";
set_row(row++,"Dati conto fiscale @20gTitolare conto fiscale @54g@f @60gTipo stampa %s", set_row(row++,"Dati conto fiscale @20gTitolare conto fiscale @54g@f @60gTipo stampa %s",
FLD(LF_ANAG,"TITCF"), (const char*) tipo_stampa); FLD(LF_ANAG,"TITCF"), (const char*) tipo_stampa);
set_row(row++,"@20gCodice ABI @pn @60gCAB @pn",
FLD(LF_ANAG,"CODABI","@@@@@"), FLD(LF_ANAG,"CODCAB","@@@@@"));
tipo_stampa = current_cursor()->curr(LF_ANAG).get("UFFCONC"); tipo_stampa = current_cursor()->curr(LF_ANAG).get("UFFCONC");
if (tipo_stampa.empty()) if (tipo_stampa.empty())
{ {
TString cod = current_cursor()->curr(LF_ANAG).get("COMRF"); TString cod = get_field(LF_ANAG, "COMRF");
TString sta;
if (cod.empty()) if (cod.empty())
cod = current_cursor()->curr(LF_ANAG).get("COMRES"); {
cod = get_field(LF_ANAG, "COMRES");
sta = get_field(LF_ANAG, "STATORES");
}
if (cod.not_empty()) if (cod.not_empty())
{ {
cc = look_com(cod); look_com(cod, sta);
tipo_stampa = cc.get("UFFCONC"); tipo_stampa = cc.get("UFFCONC");
} }
} }
set_row(row++,"@20gConto fiscale %s @s", set_row(row++,"@20gConto fiscale %s @s",
(const char*)tipo_stampa, FLD(LF_ANAG,"COFI")); (const char*)tipo_stampa, FLD(LF_ANAG,"COFI"));
TString16 abicab = get_field(LF_ANAG, "CODABI");
if (abicab.not_empty() && abicab != "00000")
{
set_row(row++,"@20gABI %s@30g%s", (const char*)abicab, look_tab("%BAN", abicab));
const TString16 cab = get_field(LF_ANAG, "CODCAB");
if (cab.not_empty() && cab != "00000")
{
abicab << cab;
set_row(row++,"@20gCAB %s@30g%s",
(const char*)cab, look_tab("%BAN", abicab));
}
}
set_row(row++,""); set_row(row++,"");
// dati atto costitutivo etc // dati atto costitutivo etc
set_row(row++,"Dati atto costitutivo e statuto"); set_row(row++,"Dati atto costitutivo e statuto");
@ -156,12 +167,11 @@ void TAnaprint_app::set_scheda_anagiu()
FLD(LF_ANAGGIU,"DATASCAD")); FLD(LF_ANAGGIU,"DATASCAD"));
TString cod = get_field(LF_ANAGGIU,"COMCOST"); TString cod = get_field(LF_ANAGGIU,"COMCOST");
cc = look_com(cod); look_com(cod);
set_row(row++,"Luogo costituzione@20g%s %s", (const char*)cod, (const char*)cc.get("DENCOM")); set_row(row++,"Luogo costituzione@20g%s %s", (const char*)cod, (const char*)cc.get("DENCOM"));
set_row(row++,"Termine appr. bilancio@25g@d@41gApprovazione bilancio@70g@d", set_row(row++,"Termine appr. bilancio@25g@d@41gApprovazione bilancio@70g@d",
FLD(LF_ANAGGIU,"DATATAPPBI"), FLD(LF_ANAGGIU,"DATATAPPBI"), FLD(LF_ANAGGIU,"DATAAPPBIL"));
FLD(LF_ANAGGIU,"DATAAPPBIL"));
set_row(row++,"Scad.org.amministrativo@25g@d@41gScadenza collegio " set_row(row++,"Scad.org.amministrativo@25g@d@41gScadenza collegio "
"sindacale@70g@d", "sindacale@70g@d",
FLD(LF_ANAGGIU,"DATASORAMM"), FLD(LF_ANAGGIU,"DATASCSIND")); FLD(LF_ANAGGIU,"DATASORAMM"), FLD(LF_ANAGGIU,"DATASCSIND"));
@ -237,7 +247,7 @@ void TAnaprint_app::set_scheda_anafis()
FLD(LF_ANAGFIS,"DATANASC"), FLD(LF_ANAGFIS,"SESSO"), FLD(LF_ANAGFIS,"NAZION")); FLD(LF_ANAGFIS,"DATANASC"), FLD(LF_ANAGFIS,"SESSO"), FLD(LF_ANAGFIS,"NAZION"));
TString com = get_field(LF_ANAGFIS, "COMNASC"); TString com = get_field(LF_ANAGFIS, "COMNASC");
TRectype& cc = look_com(com); const TRectype& cc = look_com(com);
TString a = cc.get("DENCOM"); TString a = cc.get("DENCOM");
TString b; // CAPCOM TString b; // CAPCOM
TString c = cc.get("PROVCOM"); TString c = cc.get("PROVCOM");
@ -248,14 +258,17 @@ void TAnaprint_app::set_scheda_anafis()
set_row(row++,"Residenza@20gIndirizzo @s N. @s", set_row(row++,"Residenza@20gIndirizzo @s N. @s",
FLD(LF_ANAG,"INDRES"), FLD(LF_ANAG,"CIVRES")); FLD(LF_ANAG,"INDRES"), FLD(LF_ANAG,"CIVRES"));
com = current_cursor()->curr(LF_ANAG).get("COMRES"); com = get_field(LF_ANAG, "COMRES");
cc = look_com(com); TString sta = get_field(LF_ANAG, "STATORES");
look_com(com, sta);
a = cc.get("DENCOM"); a = cc.get("DENCOM");
b = cc.get("CAPCOM"); b = cc.get("CAPCOM");
c = cc.get("PROVCOM"); c = cc.get("PROVCOM");
set_row(row++,"@20gComune %s %s@58gProv. %s@68gCAP %s", set_row(row++,"@20gComune %s %s@58gProv. %s@68gCAP %s",
(const char*)com, (const char*)a, (const char*)c, (const char*)b); (const char*)com, (const char*)a, (const char*)c, (const char*)b);
a = sta.empty() ? "Italia" : look_tab("%STA",sta);
set_row(row++,"@20gStato %s",(const char*)a);
set_row(row++,"@20gTelefono @u@s@r/@u@s@r", set_row(row++,"@20gTelefono @u@s@r/@u@s@r",
FLD(LF_ANAG,"PTELRF"), FLD(LF_ANAG,"TELRF")); FLD(LF_ANAG,"PTELRF"), FLD(LF_ANAG,"TELRF"));
@ -267,8 +280,9 @@ void TAnaprint_app::set_scheda_anafis()
set_row(row++,"Domicilio fiscale@20gIndirizzo @s N. @s", set_row(row++,"Domicilio fiscale@20gIndirizzo @s N. @s",
FLD(LF_ANAG,"INDRF"), FLD(LF_ANAG,"CIVRF")); FLD(LF_ANAG,"INDRF"), FLD(LF_ANAG,"CIVRF"));
com = current_cursor()->curr(LF_ANAG).get("COMRF"); com = get_field(LF_ANAG, "COMRF");
cc = look_com(com);
look_com(com);
a = cc.get("DENCOM"); a = cc.get("DENCOM");
b = cc.get("CAPCOM"); b = cc.get("CAPCOM");
c = cc.get("PROVCOM"); c = cc.get("PROVCOM");
@ -292,8 +306,9 @@ void TAnaprint_app::set_scheda_anafis()
set_row(row++, ""); set_row(row++, "");
set_row(row++,"Corrispondenza@20gIndirizzo @s N. @s @s", set_row(row++,"Corrispondenza@20gIndirizzo @s N. @s @s",
FLD(LF_ANAG,"INDCORR"), FLD(LF_ANAG,"CIVCORR"), FLD(LF_ANAG, "LOCCORR")); FLD(LF_ANAG,"INDCORR"), FLD(LF_ANAG,"CIVCORR"), FLD(LF_ANAG, "LOCCORR"));
com = current_cursor()->curr(LF_ANAG).get("COMCORR"); com = get_field(LF_ANAG, "COMCORR");
cc = look_com(com); sta = get_field(LF_ANAG, "STATOCORR");
look_com(com, sta);
a = cc.get("DENCOM"); a = cc.get("DENCOM");
b = cc.get("CAPCOM"); b = cc.get("CAPCOM");
c = cc.get("PROVCOM"); c = cc.get("PROVCOM");
@ -301,8 +316,7 @@ void TAnaprint_app::set_scheda_anafis()
set_row(row++,"@20gComune %s %s@58gProv. %s@68gCAP %s", set_row(row++,"@20gComune %s %s@58gProv. %s@68gCAP %s",
(const char*)com, (const char*)a, (const char*)c, (const char*)b); (const char*)com, (const char*)a, (const char*)c, (const char*)b);
com = current_cursor()->curr(LF_ANAG).get("STATOCORR"); a = sta.empty() ? "Italia" : look_tab("%STA",sta);
a = com.empty() ? "Italia" : look_tab("%STA",com,"S0");
set_row(row++,"@20gStato %s",(const char*)a); set_row(row++,"@20gStato %s",(const char*)a);
row++; row++;
@ -315,26 +329,31 @@ void TAnaprint_app::set_scheda_anafis()
set_row(row++,""); set_row(row++,"");
set_row(row++,"Ufficio imposte@20gNumero @pn", set_row(row++,"Ufficio imposte@20gNumero @pn",
FLD(LF_ANAG,"UFFIIDD","@@@")); FLD(LF_ANAG,"UFFIIDD","@@@"));
com = look_tab("%UID",get_field(LF_ANAG, "UFFIIDD"),"S6"); // Comune imposte dirette
com = current_cursor()->curr(LF_ANAG).get("UFFIIDD"); c = look_tab("%UID",get_field(LF_ANAG, "UFFIIDD"),"S4"); // c.c. Esattoria
a = look_tab("%UID",com,"S6"); look_com(com);
c = look_tab("%UID",com,"S4");
cc = look_com(a);
a = cc.get("DENCOM"); a = cc.get("DENCOM");
b = cc.get("PROVCOM"); b = cc.get("PROVCOM");
set_row(row++,"@20gComune %s %-24s@58gProv. %s",
(const char*)com, (const char*)a, (const char*)b);
set_row(row++,"@20gComune %s@58gProv. %s", set_row(row++,"Ufficio IVA@20gNumero @pn",
(const char*)a, (const char*)b); FLD(LF_ANAG,"UFFIVA","@@@"));
set_row(row++,""); com = look_tab("%UIV",get_field(LF_ANAG, "UFFIVA"),"S6");
set_row(row++,"Esattoria@20gC/C n. %s",(const char*)c); look_com(com);
set_row(row++,"@20gComune %s@58gProv. %s", a = cc.get("DENCOM");
(const char*)a, (const char*)b); b = cc.get("PROVCOM");
set_row(row++,"@20gCodice contribuente @s", set_row(row++,"@20gComune %s %-24s@58gProv. %s",
FLD(LF_ANAG,"CODCONTR")); (const char*)com, (const char*)a, (const char*)b);
set_row(row++,"Esattoria@20gComunale @02s Provinciale @03s C.C. %s",
FLD(LF_ANAG,"CODCONTR",0,2), FLD(LF_ANAG,"CODCONTR",2,5), (const char*)c);
set_row(row++,"@20gCodice contribuente @8s @2s",
FLD(LF_ANAG,"CODCONTR", 5, 13), FLD(LF_ANAG,"CODCONTR", 13, 15));
set_row(row++,""); set_row(row++,"");
// cerca coniuge // cerca coniuge
com = current_cursor()->curr(LF_ANAGFIS).get("CODCONIUGE"); com = get_field(LF_ANAGFIS, "CODCONIUGE");
TLocalisamfile& af = current_cursor()->file(LF_ANAG); TLocalisamfile& af = current_cursor()->file(LF_ANAG);
TRecnotype last = af.recno(); TRecnotype last = af.recno();
int k = af.getkey(); int k = af.getkey();
@ -370,23 +389,37 @@ void TAnaprint_app::set_scheda_anafis()
else tipo_stampa = "Distinta"; else tipo_stampa = "Distinta";
set_row(row++,"Dati conto fiscale @20gTitolare conto fiscale @54g@f @60gTipo stampa %s", set_row(row++,"Dati conto fiscale @20gTitolare conto fiscale @54g@f @60gTipo stampa %s",
FLD(LF_ANAG,"TITCF"), (const char*) tipo_stampa); FLD(LF_ANAG,"TITCF"), (const char*) tipo_stampa);
set_row(row++,"@20gCodice ABI @pn @60gCAB @pn",
FLD(LF_ANAG,"CODABI","@@@@@"), FLD(LF_ANAG,"CODCAB","@@@@@"));
tipo_stampa = current_cursor()->curr(LF_ANAG).get("UFFCONC"); tipo_stampa = current_cursor()->curr(LF_ANAG).get("UFFCONC");
if (tipo_stampa.empty()) if (tipo_stampa.empty())
{ {
TString cod = current_cursor()->curr(LF_ANAG).get("COMRF"); TString cod = get_field(LF_ANAG, "COMRF");
TString sta;
if (cod.empty()) if (cod.empty())
cod = current_cursor()->curr(LF_ANAG).get("COMRES"); {
cod = get_field(LF_ANAG, "COMRES");
sta = get_field(LF_ANAG, "STATORES");
}
if (cod.not_empty()) if (cod.not_empty())
{ {
cc = look_com(cod); look_com(cod,sta);
tipo_stampa = cc.get("UFFCONC"); tipo_stampa = cc.get("UFFCONC");
} }
} }
set_row(row++,"@20gConto fiscale %s @s", set_row(row++,"@20gConto fiscale %s @s",
(const char*)tipo_stampa, FLD(LF_ANAG,"COFI")); (const char*)tipo_stampa, FLD(LF_ANAG,"COFI"));
TString16 abicab = get_field(LF_ANAG, "CODABI");
if (abicab.not_empty() && abicab != "00000")
{
set_row(row++,"@20gABI %s@30g%s", (const char*)abicab, look_tab("%BAN", abicab));
const TString16 cab = get_field(LF_ANAG, "CODCAB");
if (cab.not_empty() && cab != "00000")
{
abicab << cab;
set_row(row++,"@20gCAB %s@30g%s",
(const char*)cab, look_tab("%BAN", abicab));
}
}
set_row(row++,""); set_row(row++,"");
set_row(row++,"Dati Statistici@20gNon residente@53g@f", set_row(row++,"Dati Statistici@20gNon residente@53g@f",
@ -550,7 +583,7 @@ void TAnaprint_app::set_scheda_attiv()
if (c.empty()) c = af.get("COMRES"); if (c.empty()) c = af.get("COMRES");
if (z.empty()) z = af.get("CIVRES"); if (z.empty()) z = af.get("CIVRES");
} }
TRectype& cm = look_com(c); const TRectype& cm = look_com(c);
af.readat(last); af.readat(last);
af.setkey(k); af.setkey(k);
@ -568,7 +601,7 @@ void TAnaprint_app::set_scheda_attiv()
set_row(14,"Luogo@20gIndirizzo @s N. @s", set_row(14,"Luogo@20gIndirizzo @s N. @s",
FLD(LF_ATTIV,"INDCS"), FLD(LF_ATTIV,"INDCS"),
FLD(LF_ATTIV,"CIVCS")); FLD(LF_ATTIV,"CIVCS"));
cm = look_com(get_field(LF_ATTIV,"COMCS")); look_com(get_field(LF_ATTIV,"COMCS"));
a = cm.get("DENCOM"); b = cm.get("PROVCOM"); c = cm.get("CAPCOM"); a = cm.get("DENCOM"); b = cm.get("PROVCOM"); c = cm.get("CAPCOM");
set_row(15,"@20gComune %s@58gProv. %s@68gC.a.p. %s", set_row(15,"@20gComune %s@58gProv. %s@68gC.a.p. %s",
(const char*)a, (const char*)b, (const char*)c); (const char*)a, (const char*)b, (const char*)c);
@ -594,17 +627,16 @@ void TAnaprint_app::set_scheda_unloc()
set_row(2,"@20g@bIndirizzo@r@u @s@r@68g@bNumero @r@u@s", set_row(2,"@20g@bIndirizzo@r@u @s@r@68g@bNumero @r@u@s",
FLD(LF_UNLOC,"INDULC"), FLD(LF_UNLOC,"INDULC"),
FLD(LF_UNLOC,"CIVULC")); FLD(LF_UNLOC,"CIVULC"));
TRectype& cc = look_com(get_field(LF_UNLOC,"COMULC")); const TRectype& cc = look_com(get_field(LF_UNLOC,"COMULC"));
TString a = cc.get("DENCOM"); TString a = cc.get("DENCOM");
TString b = cc.get("PROVCOM"); TString b = cc.get("PROVCOM");
TString c = cc.get("CAPCOM"); TString c = cc.get("CAPCOM");
set_row(3,"@20g@bComune@r@4j@u%s@r@58g@bProv.@r @u%s@r@68g@b" set_row(3,"@20g@bComune@r@4j@u%s@r@58g@bProv.@r @u%s@r@68g@b"
"C.a.p.@r @u%s", "C.a.p.@r @u%s", (const char*)a, (const char*)b, (const char*)c);
(const char*)a, (const char*)b, (const char*)c);
set_row(4,""); set_row(4,"");
set_row(5,"C.C.I.A.A.@20gNumero@30g@pn", set_row(5,"C.C.I.A.A.@20gNumero@30g@pn",
FLD(LF_UNLOC,"NUMCCIAA","@@@@@@@")); FLD(LF_UNLOC,"NUMCCIAA","@@@@@@@"));
cc = look_com(get_field(LF_UNLOC,"COMCCIAA")); look_com(get_field(LF_UNLOC,"COMCCIAA"));
a = cc.get("DENCOM"); a = cc.get("DENCOM");
set_row(6,"@20gComune@30g%s", (const char*)a); set_row(6,"@20gComune@30g%s", (const char*)a);
set_row(7,"@20gData iscrizione @D@48gData ultima variazione @D", set_row(7,"@20gData iscrizione @D@48gData ultima variazione @D",
@ -626,7 +658,7 @@ void TAnaprint_app::set_scheda_unloc()
FLD(LF_UNLOC, "REGIMP", "@@ @@@ @@@@ @@@@@@@@@ @")); FLD(LF_UNLOC, "REGIMP", "@@ @@@ @@@@ @@@@@@@@@ @"));
zio = get_field(LF_UNLOC,"COMTRIB"); zio = get_field(LF_UNLOC,"COMTRIB");
cc = look_com(zio); look_com(zio);
a = cc.get("DENCOM"); a = cc.get("DENCOM");
b = cc.get("PROVCOM"); b = cc.get("PROVCOM");
c = get_field(LF_UNLOC, "CAPTRIB"); c = get_field(LF_UNLOC, "CAPTRIB");
@ -695,7 +727,7 @@ void TAnaprint_app::set_scheda_socio()
anaf->zero(); anaf->zero();
anaf->put("CODANAGR",soc.get("CODANAGRSO")); anaf->put("CODANAGR",soc.get("CODANAGRSO"));
anaf->read(); anaf->read();
TRectype& com = look_com(anaf->get("COMNASC")); const TRectype& com = look_com(anaf->get("COMNASC"));
set_row(1,"@bSOCIO@r @s / @pn@20g@bCognome@r %s", set_row(1,"@bSOCIO@r @s / @pn@20g@bCognome@r %s",
FLD(LF_SOCI,"TIPOASOC"), FLD(LF_SOCI,"TIPOASOC"),
@ -741,7 +773,9 @@ void TAnaprint_app::set_scheda_socio()
} }
set_row(rw,""); set_row(rw,"");
TRectype& com = look_com(ana.get("COMRES")); const TString cod_com = ana.get("COMRES");
const TString cod_sta = ana.get("STATORES");
const TRectype& com = look_com(cod_com, cod_sta);
b1 = com.get("DENCOM"); b1 = com.get("DENCOM");
b2 = com.get("PROVCOM"); b2 = com.get("PROVCOM");