Patch level : 20.424
Files correlati : cg1.exe cg3.exe Ricompilazione Demo : [ ] Commento : Aggiunto supporto per le lingue a cg1.exe e cg3.exe git-svn-id: svn://10.65.10.50/trunk@10914 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
86b1a89d8b
commit
e82c0ef7b3
@ -1,4 +0,0 @@
|
||||
#include <default.url>
|
||||
|
||||
MENU TASK_MENUBAR
|
||||
SUBMENU MENU_FILE "~File"
|
@ -1,3 +0,0 @@
|
||||
#include <default.url>
|
||||
|
||||
#include <mainmenu.url>
|
@ -1,3 +0,0 @@
|
||||
#include <default.url>
|
||||
|
||||
#include <mainmenu.url>
|
@ -19,7 +19,8 @@ HIDDEN bool filtra_mov(const TRelation* r)
|
||||
{
|
||||
const TRectype& mov = r->curr();
|
||||
const int annoiva = mov.get_int(MOV_ANNOIVA);
|
||||
const TString& reg = mov.get(MOV_REG);
|
||||
const TString16 reg = mov.get(MOV_REG);
|
||||
|
||||
TAgg_nprot& a = app();
|
||||
return a.anno() == annoiva && a.reg() == reg;
|
||||
}
|
||||
|
@ -2,13 +2,11 @@
|
||||
|
||||
class TAgg_nprot : public TSkeleton_application
|
||||
{
|
||||
int _anno;
|
||||
TString16 _reg;
|
||||
int _anno;
|
||||
|
||||
protected:
|
||||
public:
|
||||
virtual void main_loop();
|
||||
|
||||
public:
|
||||
int anno() const { return _anno; }
|
||||
const TString& reg() const { return _reg; }
|
||||
|
||||
|
@ -12,22 +12,17 @@ HIDDEN TAgg_codatt& app() { return (TAgg_codatt&) main_app(); }
|
||||
|
||||
bool TAgg_codatt::create()
|
||||
{
|
||||
TApplication::create();
|
||||
|
||||
_tab = new TLocalisamfile(LF_TAB);
|
||||
|
||||
dispatch_e_menu (BAR_ITEM(1));
|
||||
return TRUE;
|
||||
open_files(LF_TAB, 0);
|
||||
|
||||
return TSkeleton_application::create();
|
||||
}
|
||||
|
||||
bool TAgg_codatt::destroy()
|
||||
{
|
||||
delete _tab;
|
||||
|
||||
return TApplication::destroy();
|
||||
return TSkeleton_application::destroy();
|
||||
}
|
||||
|
||||
bool TAgg_codatt::menu(MENU_TAG m)
|
||||
void TAgg_codatt::main_loop()
|
||||
{
|
||||
TProgind* pri;
|
||||
TMask msk("cg1300c");
|
||||
@ -64,7 +59,6 @@ bool TAgg_codatt::menu(MENU_TAG m)
|
||||
delete pri;
|
||||
message_box(TR("Aggiornamento codice attivita' completato"));
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TAgg_codatt::cancella_rec()
|
||||
|
50
cg/cg1304.h
50
cg/cg1304.h
@ -1,27 +1,25 @@
|
||||
#include <applicat.h>
|
||||
#include <mask.h>
|
||||
#include <relation.h>
|
||||
#include <tabutil.h>
|
||||
#include <utility.h>
|
||||
#include <progind.h>
|
||||
#include <urldefid.h>
|
||||
#include <config.h>
|
||||
|
||||
class TAgg_codatt : public TApplication
|
||||
{
|
||||
TLocalisamfile* _tab;
|
||||
TString16 _da, _a;
|
||||
int _anno;
|
||||
bool _pass;
|
||||
|
||||
public:
|
||||
virtual bool create();
|
||||
virtual bool destroy();
|
||||
virtual bool menu(MENU_TAG m);
|
||||
|
||||
void cancella_rec();
|
||||
void aggiorna_att(const char*);
|
||||
|
||||
TAgg_codatt() : _da(""), _a(""), _anno(0) {};
|
||||
virtual ~TAgg_codatt() {};
|
||||
#include <applicat.h>
|
||||
#include <mask.h>
|
||||
#include <relation.h>
|
||||
#include <tabutil.h>
|
||||
#include <utility.h>
|
||||
#include <progind.h>
|
||||
#include <urldefid.h>
|
||||
#include <config.h>
|
||||
|
||||
class TAgg_codatt : public TSkeleton_application
|
||||
{
|
||||
TString16 _da, _a;
|
||||
int _anno;
|
||||
bool _pass;
|
||||
|
||||
public:
|
||||
virtual bool create();
|
||||
virtual bool destroy();
|
||||
virtual void main_loop();
|
||||
|
||||
void cancella_rec();
|
||||
void aggiorna_att(const char*);
|
||||
TAgg_codatt() : _da(""), _a(""), _anno(0) {};
|
||||
virtual ~TAgg_codatt() {};
|
||||
};
|
@ -5,13 +5,11 @@
|
||||
#include <progind.h>
|
||||
#include <urldefid.h>
|
||||
|
||||
class TAgg_datacomp : public TApplication
|
||||
class TAgg_datacomp : public TSkeleton_application
|
||||
{
|
||||
void aggiorna_datacomp();
|
||||
public:
|
||||
virtual bool create();
|
||||
virtual bool destroy();
|
||||
virtual bool menu(MENU_TAG m);
|
||||
virtual void main_loop();
|
||||
|
||||
TAgg_datacomp() {};
|
||||
virtual ~TAgg_datacomp() {};
|
||||
|
@ -28,7 +28,7 @@ const char* const APPNAME = TR("Righe prima nota errate");
|
||||
|
||||
class TElimina_zoppi : public TSkeleton_application
|
||||
{
|
||||
TArray _files;
|
||||
// TArray _files;
|
||||
TArray _decoders;
|
||||
|
||||
protected:
|
||||
@ -44,6 +44,7 @@ protected:
|
||||
static bool select_handler(TMask_field& f, KEY k);
|
||||
|
||||
protected:
|
||||
|
||||
const char* decode(int num, const char* key, const char* field);
|
||||
virtual void main_loop();
|
||||
};
|
||||
|
@ -3577,27 +3577,23 @@ TDate TStampa_bilanci::UltimaData(int g, int c, long s, int anno)
|
||||
// Guy: E tu chi sei?
|
||||
const char* TStampa_bilanci::DescrizioneConto(int g, int c, long s, char tipocf)
|
||||
{
|
||||
TString80 ragsoc;
|
||||
static TString80 ragsoc;
|
||||
const char* desc = NULL;
|
||||
TLocalisamfile pconti(LF_PCON);
|
||||
TLocalisamfile clifo (LF_CLIFO);
|
||||
|
||||
pconti.zero();
|
||||
pconti.put(PCN_GRUPPO, g);
|
||||
TString80 key; key << g;
|
||||
if (c != 0)
|
||||
pconti.put(PCN_CONTO, c);
|
||||
key << "|" << c ;
|
||||
if (s != 0)
|
||||
pconti.put(PCN_SOTTOCONTO, s);
|
||||
pconti.read();
|
||||
if (pconti.good())
|
||||
key << "|" << s;
|
||||
const TRectype & pconti = cache().get(LF_PCON, key);
|
||||
if (!pconti.empty())
|
||||
_tmp = pconti.get(PCN_DESCR);
|
||||
else
|
||||
{
|
||||
clifo.setkey(1); //occorre settare la chiave 1, anche se di solito e' di default, poiche' nella create il file clifo e' stato aperto con la chiave 3
|
||||
clifo.zero();
|
||||
clifo.put(CLI_CODCF, s);
|
||||
clifo.put(CLI_TIPOCF,tipocf);
|
||||
if (clifo.read() == NOERR)
|
||||
key.format("%c|%ld", tipocf, s);
|
||||
const TRectype & clifo = cache().get(LF_CLIFO, key);
|
||||
|
||||
if (!clifo.empty())
|
||||
{
|
||||
char tipoa = clifo.get_char("TIPOAPER");
|
||||
if (tipoa == 'F') //persona fisica
|
||||
@ -3617,8 +3613,10 @@ const char* TStampa_bilanci::DescrizioneConto(int g, int c, long s, char tipocf)
|
||||
}
|
||||
else
|
||||
_tmp = "";
|
||||
|
||||
}
|
||||
return _tmp;
|
||||
|
||||
}
|
||||
|
||||
bool TStampa_bilanci::user_create()
|
||||
|
19
cg/cg2.url
19
cg/cg2.url
@ -1,19 +0,0 @@
|
||||
#include <default.url>
|
||||
|
||||
// Prima nota
|
||||
|
||||
#include <mainmenu.url>
|
||||
SUBMENU M_FONT "~Opzioni"
|
||||
|
||||
MENU M_FONT
|
||||
ITEM MENU_ITEM(1) "~Colori righe"
|
||||
|
||||
// Gestione movimenti provvisori
|
||||
|
||||
MENUBAR MENU_BAR(1)
|
||||
|
||||
MENU MENU_BAR(1)
|
||||
SUBMENU M_FILE "~File"
|
||||
SUBMENU M_HELP "~Help"
|
||||
|
||||
|
2
cg/cg3.h
2
cg/cg3.h
@ -9,8 +9,6 @@
|
||||
#define extern
|
||||
#endif
|
||||
|
||||
extern TString256 TMP;
|
||||
|
||||
#ifdef __MAIN__
|
||||
#undef extern
|
||||
#endif
|
||||
|
34
cg/cg3.url
34
cg/cg3.url
@ -1,34 +0,0 @@
|
||||
#include <default.url>
|
||||
|
||||
#include <mainmenu.url>
|
||||
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* cg3 -2
|
||||
* ---------------------------------------------------- */
|
||||
|
||||
MENUBAR MENU_BAR(2)
|
||||
|
||||
MENU MENU_BAR(2)
|
||||
SUBMENU M_FILE "~File"
|
||||
ITEM BAR_ITEM(1) "~Scelta parametri"
|
||||
ITEM BAR_ITEM(2) "~Ricalcolo"
|
||||
ITEM BAR_ITEM(3) "~Disco"
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* cg3 -5
|
||||
*
|
||||
* cg3600.cpp Mastrini a video
|
||||
* ---------------------------------------------------- */
|
||||
MENUBAR MENU_BAR(5)
|
||||
|
||||
MENU MENU_BAR(5)
|
||||
SUBMENU M_FILE "~File"
|
||||
SUBMENU M_FONT "~Opzioni"
|
||||
SUBMENU M_HELP "~Help"
|
||||
|
||||
MENU M_FONT
|
||||
ITEM MENU_ITEM(1) "~Colori righe"
|
||||
|
||||
|
||||
|
646
cg/cg3100.cpp
646
cg/cg3100.cpp
File diff suppressed because it is too large
Load Diff
911
cg/cg3200.cpp
911
cg/cg3200.cpp
File diff suppressed because it is too large
Load Diff
333
cg/cg3300.cpp
333
cg/cg3300.cpp
@ -7,6 +7,7 @@
|
||||
#include <printapp.h>
|
||||
#include <progind.h>
|
||||
#include <sort.h>
|
||||
#include <recarray.h>
|
||||
#include <tabutil.h>
|
||||
#include <utility.h>
|
||||
#include <validate.h>
|
||||
@ -54,9 +55,6 @@ class TStampa_allegati : public TPrintapp
|
||||
|
||||
TSort* _sort;
|
||||
|
||||
TLocalisamfile * _nditte, * _alleg, * _clifo;
|
||||
TTable * _tpd, * _attiv;
|
||||
|
||||
TDate _data_stampa;
|
||||
int _anno_stampa;
|
||||
stampe _tipo_stampa;
|
||||
@ -109,8 +107,8 @@ public:
|
||||
|
||||
void calcola();
|
||||
|
||||
bool da_sommare();
|
||||
bool buono();
|
||||
bool da_sommare(const TRectype & alleg);
|
||||
bool buono(const TRectype & alleg);
|
||||
|
||||
bool lo_devo_stampare(char tipo, long codice);
|
||||
|
||||
@ -132,7 +130,6 @@ public:
|
||||
TPrintrow * get_record_fine_volume (bool) ;
|
||||
|
||||
long cerca_codice_all(char tipo, long codcf) ;
|
||||
const char * decodifica_desc_att (const TString & codatt);
|
||||
bool corrispettivo (const char * tipodoc);
|
||||
|
||||
TStampa_allegati () {}
|
||||
@ -169,59 +166,29 @@ const char* filler (int size)
|
||||
|
||||
long TStampa_allegati::cerca_codice_all(char tipo, long codcf)
|
||||
{
|
||||
TLocalisamfile& clifo = *_clifo;
|
||||
TString16 key;
|
||||
|
||||
key.format("%c|%ld", tipo, codcf);
|
||||
|
||||
clifo.zero();
|
||||
clifo.put (CLI_TIPOCF, tipo);
|
||||
clifo.put (CLI_CODCF, codcf);
|
||||
clifo.read();
|
||||
const TRectype & clifo = cache().get(LF_CLIFO, key);
|
||||
|
||||
if (clifo.good())
|
||||
{
|
||||
long codice_all = clifo.get_long (CLI_CODALLEG);
|
||||
return codice_all;
|
||||
}
|
||||
if (!clifo.empty())
|
||||
return clifo.get_long (CLI_CODALLEG);
|
||||
|
||||
return 0L;
|
||||
}
|
||||
|
||||
const char * TStampa_allegati::decodifica_desc_att (const TString & codatt)
|
||||
{
|
||||
TTable& attivita = * _attiv;
|
||||
|
||||
attivita.zero();
|
||||
attivita.put ("CODTAB", codatt);
|
||||
|
||||
attivita.read();
|
||||
|
||||
if (attivita.bad())
|
||||
attivita.zero();
|
||||
|
||||
TMP = attivita.get ("S0");
|
||||
|
||||
return TMP;
|
||||
}
|
||||
|
||||
bool TStampa_allegati::corrispettivo (const char * tipodoc)
|
||||
{
|
||||
TTable& tpd = * _tpd;
|
||||
TString natura_doc;
|
||||
bool corrisp;
|
||||
|
||||
tpd.zero();
|
||||
tpd.put ("CODTAB", tipodoc);
|
||||
tpd.read();
|
||||
if (tpd.bad())
|
||||
tpd.zero();
|
||||
const TRectype & tpd = cache().get("%TPD", tipodoc);
|
||||
|
||||
natura_doc = tpd.get("I0");
|
||||
corrisp = tpd.get_bool ("B0");
|
||||
|
||||
if ((natura_doc == "1") || (natura_doc == "9"))
|
||||
if (corrisp)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
return corrisp && (natura_doc == "1" || natura_doc == "9");
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
@ -253,11 +220,7 @@ void TStampa_allegati::init_sort()
|
||||
|
||||
bool TStampa_allegati::user_create()
|
||||
{
|
||||
_nditte = new TLocalisamfile (LF_NDITTE);
|
||||
_alleg = new TLocalisamfile (LF_ALLEG);
|
||||
_clifo = new TLocalisamfile (LF_CLIFO);
|
||||
_tpd = new TTable ("%TPD");
|
||||
_attiv = new TTable ("%AIS");
|
||||
open_files(LF_TABCOM, LF_NDITTE, LF_ALLEG, LF_CLIFO, 0);
|
||||
|
||||
_RecordSort = new SortRecord;
|
||||
_SortRecLen = _RecordSort->RecSize();
|
||||
@ -272,11 +235,6 @@ bool TStampa_allegati::user_create()
|
||||
|
||||
bool TStampa_allegati::user_destroy()
|
||||
{
|
||||
delete _alleg;
|
||||
delete _clifo;
|
||||
delete _nditte;
|
||||
delete _tpd; delete _attiv;
|
||||
|
||||
// delete _sort; // Adesso e' nella postprocess_print()
|
||||
delete _RecordSort;
|
||||
delete _recb;
|
||||
@ -441,11 +399,13 @@ void TStampa_allegati::pulisci_alleg (int anno_dic)
|
||||
for (cur = 0l; cur.pos() < items; ++cur)
|
||||
{
|
||||
prn.addstatus(1);
|
||||
|
||||
|
||||
|
||||
const bool immesso = curr.get_bool (ALL_IMMESSO);
|
||||
if (immesso)
|
||||
continue;
|
||||
|
||||
if (immesso)
|
||||
continue;
|
||||
|
||||
curr.zero(ALL_IMPESC);
|
||||
curr.zero(ALL_IVAESC);
|
||||
curr.zero(ALL_NIESC);
|
||||
@ -473,7 +433,6 @@ void TStampa_allegati::ricalcola(int anno_dic)
|
||||
char tipo;
|
||||
long codcf;
|
||||
int ndoc = 0;
|
||||
bool immesso;
|
||||
bool vendite;
|
||||
real imponibile;
|
||||
real imposta;
|
||||
@ -511,7 +470,7 @@ void TStampa_allegati::ricalcola(int anno_dic)
|
||||
|
||||
const long items = cur.items();
|
||||
cur.freeze();
|
||||
TString str; str.format("Ricalcolo anno %d...", anno_dic);
|
||||
TString str; str.format(TR("Ricalcolo anno %d..."), anno_dic);
|
||||
TProgind pi(items, str, FALSE, TRUE);
|
||||
|
||||
const TRectype& mov_curr = cur.curr(LF_MOV);
|
||||
@ -563,6 +522,7 @@ void TStampa_allegati::ricalcola(int anno_dic)
|
||||
all_curr.put (ALL_ANNO, anno_dic);
|
||||
all_curr.put (ALL_TIPOCF, tipo);
|
||||
all_curr.put (ALL_CODCF, codcf);
|
||||
all_curr.put (ALL_CODATT, reg.get("S8"));
|
||||
|
||||
datareg = mov_curr.get_date (MOV_DATAREG);
|
||||
datadoc = mov_curr.get_date (MOV_DATADOC);
|
||||
@ -590,21 +550,27 @@ void TStampa_allegati::ricalcola(int anno_dic)
|
||||
ndoc = 0;
|
||||
|
||||
const TRectype& rmi = cur.curr(LF_RMOVIVA);
|
||||
bool all_to_save = FALSE;
|
||||
while (cur.next_match (LF_RMOVIVA))
|
||||
{
|
||||
immesso = all.get_bool (ALL_IMMESSO);
|
||||
if (immesso) continue; // scarta i record immessi
|
||||
|
||||
int err = all.read();
|
||||
if (err != NOERR) // aggiungo un record se non presente
|
||||
|
||||
if (err == NOERR) // aggiungo un record se non presente
|
||||
{
|
||||
if (all_curr.get_bool (ALL_IMMESSO))
|
||||
continue; // scarta i record immessi
|
||||
}
|
||||
else
|
||||
{
|
||||
all_curr.zero();
|
||||
all_curr.put (ALL_ANNO, anno_dic);
|
||||
all_curr.put (ALL_TIPOCF, tipo);
|
||||
all_curr.put (ALL_CODCF, codcf);
|
||||
all_curr.put (ALL_CODATT, reg.get("S8"));
|
||||
err = all.write();
|
||||
}
|
||||
|
||||
all_to_save = TRUE;
|
||||
imponibile = rmi.get_real (RMI_IMPONIBILE);
|
||||
imposta = rmi.get_real (RMI_IMPOSTA);
|
||||
|
||||
@ -659,19 +625,23 @@ void TStampa_allegati::ricalcola(int anno_dic)
|
||||
}
|
||||
} // while next_match()
|
||||
|
||||
all.rewrite();
|
||||
if (all_to_save)
|
||||
all.rewrite();
|
||||
} // for cur=0; ++cur
|
||||
cur.freeze(FALSE);
|
||||
}
|
||||
|
||||
bool TStampa_allegati::lo_devo_stampare(char tipo, long codcf)
|
||||
{
|
||||
_clifo->curr().zero();
|
||||
_clifo->curr().put (CLI_TIPOCF, tipo);
|
||||
_clifo->curr().put (CLI_CODCF, codcf);
|
||||
if (_clifo->read() == NOERR)
|
||||
TString16 key ;
|
||||
|
||||
key.format("%c|%ld", tipo, codcf);
|
||||
|
||||
const TRectype & clifo = cache().get(LF_CLIFO, key);
|
||||
|
||||
if (!clifo.empty())
|
||||
{
|
||||
const int codice_all = _clifo->curr().get_int(CLI_ALLEG);
|
||||
const int codice_all = clifo.get_int(CLI_ALLEG);
|
||||
if ((codice_all == 0) || (codice_all == 3) || (codice_all == 4) )
|
||||
return TRUE;
|
||||
else
|
||||
@ -682,21 +652,21 @@ bool TStampa_allegati::lo_devo_stampare(char tipo, long codcf)
|
||||
}
|
||||
|
||||
|
||||
bool TStampa_allegati::da_sommare()
|
||||
bool TStampa_allegati::da_sommare(const TRectype & alleg)
|
||||
{
|
||||
TString tipocf2;
|
||||
long codcf2;
|
||||
int anno2;
|
||||
TString codatt_dett;
|
||||
TString comodo;
|
||||
tipocf2 = _alleg->curr().get (ALL_TIPOCF);
|
||||
codcf2 = _alleg->curr().get_long (ALL_CODCF);
|
||||
anno2 = _alleg->curr().get_int(ALL_ANNO);
|
||||
codatt_dett = _alleg->curr().get (ALL_CODATT);
|
||||
tipocf2 = alleg.get (ALL_TIPOCF);
|
||||
codcf2 = alleg.get_long (ALL_CODCF);
|
||||
anno2 = alleg.get_int(ALL_ANNO);
|
||||
codatt_dett = alleg.get (ALL_CODATT);
|
||||
|
||||
if (_RecordSort->codcf_dett() == -1)
|
||||
{
|
||||
_RecordSort->compila(_alleg);
|
||||
_RecordSort->compila(alleg);
|
||||
return TRUE; // vuol dire che e' il primo => va messo nella struttura
|
||||
}
|
||||
|
||||
@ -727,54 +697,53 @@ bool TStampa_allegati::da_sommare()
|
||||
//
|
||||
// QUI COMPILO IL RECORD B PER I FORNITORI
|
||||
//
|
||||
bool TStampa_allegati::buono()
|
||||
bool TStampa_allegati::buono(const TRectype & alleg)
|
||||
{
|
||||
const TRectype& curr = _alleg->curr();
|
||||
if (curr.empty())
|
||||
return FALSE;
|
||||
|
||||
char tipo = curr.get_char(ALL_TIPOCF);
|
||||
long codcf = curr.get_long(ALL_CODCF);
|
||||
if (!alleg.empty())
|
||||
{
|
||||
char tipo = alleg.get_char(ALL_TIPOCF);
|
||||
long codcf = alleg.get_long(ALL_CODCF);
|
||||
|
||||
//
|
||||
// Se stampo i clienti scarto chi non ha codcf = "C"
|
||||
//
|
||||
if (_tipoa_richiesto != tipo)
|
||||
return FALSE;
|
||||
if (_tipoa_richiesto != tipo)
|
||||
return FALSE;
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// GESTIONE RECORD B
|
||||
// --------------------------------------------------------------------
|
||||
if ((_tipo_stampa == fornitori) || (_tipo_stampa == modulo102))
|
||||
{
|
||||
if (tipo == 'B')
|
||||
{
|
||||
_recb->compila(_alleg);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
if ((_tipo_stampa == fornitori) || (_tipo_stampa == modulo102))
|
||||
{
|
||||
if (tipo == 'B')
|
||||
{
|
||||
_recb->compila(alleg);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (_ricerca_att != "")
|
||||
{
|
||||
// strcpy (_RecordSort->Strutt()->codatt_dett, _alleg->curr().get (ALL_CODATT));
|
||||
const TString& dep = curr.get (ALL_CODATT);
|
||||
if (_ricerca_att != dep)
|
||||
return FALSE;
|
||||
}
|
||||
if (_ricerca_att != "")
|
||||
{
|
||||
// strcpy (_RecordSort->Strutt()->codatt_dett, _alleg->curr().get (ALL_CODATT));
|
||||
const TString& dep = alleg.get (ALL_CODATT);
|
||||
if (_ricerca_att != dep)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (_anno_stampa > 0)
|
||||
{
|
||||
int anno = curr.get_int(ALL_ANNO);
|
||||
if (anno != _anno_stampa)
|
||||
return FALSE;
|
||||
}
|
||||
if (_anno_stampa > 0)
|
||||
{
|
||||
const int anno = alleg.get_int(ALL_ANNO);
|
||||
if (anno != _anno_stampa)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// se la stampa e' di controllo e voglio tutti i clienti mov. stampo tutti
|
||||
if ((_destinazione_stampa == controllo) && _stampa_tutti)
|
||||
return TRUE;
|
||||
// se la stampa e' di controllo e voglio tutti i clienti mov. stampo tutti
|
||||
if ((_destinazione_stampa == controllo) && _stampa_tutti)
|
||||
return TRUE;
|
||||
|
||||
if (!lo_devo_stampare(tipo, codcf))
|
||||
return FALSE;
|
||||
if (!lo_devo_stampare(tipo, codcf))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -799,71 +768,71 @@ void TStampa_allegati::calcola ()
|
||||
|
||||
_num_cf = 0; // contatore C/F
|
||||
|
||||
_nditte->zero();
|
||||
_nditte->put(NDT_CODDITTA, ditta_da);
|
||||
for (int err = _nditte->read(_isgteq); err == NOERR; err = _nditte->next())
|
||||
TRelation relditte(LF_NDITTE);
|
||||
TRectype from(relditte.curr());
|
||||
TRectype to(relditte.curr());
|
||||
|
||||
from.put(NDT_CODDITTA, ditta_da);
|
||||
to.put(NDT_CODDITTA, ditta_a);
|
||||
|
||||
TCursor ditte(&relditte, "", 1, &from, &to);
|
||||
const long items = ditte.items();
|
||||
const TRectype & ditta = ditte.curr();
|
||||
|
||||
ditte.freeze();
|
||||
for (ditte = 0L; ditte.pos() < items; ++ditte)
|
||||
{
|
||||
const long nuova_ditta = _nditte->get_long(NDT_CODDITTA);
|
||||
if (nuova_ditta > ditta_a)
|
||||
break;
|
||||
const long nuova_ditta = ditta.get_long(NDT_CODDITTA);
|
||||
|
||||
if (!prefix().exist(nuova_ditta)) // TBC *** fv mi sembrava ci volesse
|
||||
continue;
|
||||
|
||||
set_firm(nuova_ditta);
|
||||
if (prefix().exist(nuova_ditta)) // TBC *** fv mi sembrava ci volesse
|
||||
{
|
||||
set_firm(nuova_ditta);
|
||||
|
||||
if (_ricalcola)
|
||||
ricalcola(_anno_stampa);
|
||||
if (_ricalcola)
|
||||
ricalcola(_anno_stampa);
|
||||
|
||||
// Legge i dati anagrafici del dichiarante
|
||||
_RecordSort->fill_dati_anag_dic(_nditte);
|
||||
// Legge i dati anagrafici del dichiarante
|
||||
_RecordSort->fill_dati_anag_dic(ditta);
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
// ELABORAZIONE ALLEGATI
|
||||
// ---------------------------------------------------------------------
|
||||
_alleg->zero();
|
||||
_alleg->put (ALL_ANNO, _anno_stampa);
|
||||
_alleg->put (ALL_CODCF, _tipoa_richiesto);
|
||||
// ---------------------------------------------------------------------
|
||||
// ELABORAZIONE ALLEGATI
|
||||
// ---------------------------------------------------------------------
|
||||
TRelation relalleg(LF_ALLEG);
|
||||
TRectype from(relalleg.curr());
|
||||
|
||||
TProgind prnd(_alleg->items(), "Elaborazione allegati in corso...", FALSE, TRUE);
|
||||
from.put (ALL_ANNO, _anno_stampa);
|
||||
from.put (ALL_TIPOCF, _tipoa_richiesto);
|
||||
if (_ricerca_att != "")
|
||||
from.put(ALL_CODATT, _ricerca_att);
|
||||
TCursor alleg(&relalleg, "", _distingui_att ? 1 : 2, &from, &from);
|
||||
const long items = alleg.items();
|
||||
const TRectype & recalleg = alleg.curr();
|
||||
|
||||
if (_ricerca_att != "")
|
||||
_alleg->curr().put (ALL_CODATT, _ricerca_att);
|
||||
alleg.freeze();
|
||||
|
||||
TProgind prnd(items, TR("Elaborazione allegati in corso..."), FALSE, TRUE);
|
||||
|
||||
if (_distingui_att)
|
||||
_alleg->setkey (1);
|
||||
else
|
||||
_alleg->setkey (2); // non distinguo le attivita
|
||||
for (alleg = 0L; alleg.pos() < items; ++alleg)
|
||||
{
|
||||
prnd.addstatus(1);
|
||||
|
||||
for (int err = _alleg->read(_isgteq); err == NOERR; err = _alleg->next())
|
||||
{
|
||||
prnd.addstatus(1);
|
||||
|
||||
if (buono())
|
||||
{
|
||||
if (da_sommare ())
|
||||
_RecordSort->somma(_alleg->curr(), _tipo_stampa); // somma nella struttura
|
||||
else
|
||||
{
|
||||
if (!_RecordSort->importo().is_zero())
|
||||
{
|
||||
_sort->sort (_RecordSort->Strutt_str());
|
||||
_num_cf += 1; // incremento contatore numero di C/F
|
||||
}
|
||||
_t->incrementa_totali(_RecordSort->Strutt(), _tipo_stampa);
|
||||
_RecordSort->compila(_alleg->curr());
|
||||
}
|
||||
} // if buono()
|
||||
}
|
||||
// Sorta anche l'ultimo: BESTIA!
|
||||
if (!_RecordSort->importo().is_zero())
|
||||
{
|
||||
_sort->sort (_RecordSort->Strutt_str());
|
||||
_num_cf += 1; // incremento contatore numero di C/F
|
||||
}
|
||||
|
||||
// rimetto all'inizio il puntatore di _alleg dopo averlo scorso tutto una volta
|
||||
_alleg->first();
|
||||
if (buono(recalleg))
|
||||
{
|
||||
if (da_sommare (recalleg))
|
||||
_RecordSort->somma(recalleg, _tipo_stampa); // somma nella struttura
|
||||
else
|
||||
{
|
||||
if (!_RecordSort->importo().is_zero())
|
||||
{
|
||||
_sort->sort (_RecordSort->Strutt_str());
|
||||
_num_cf += 1; // incremento contatore numero di C/F
|
||||
}
|
||||
_t->incrementa_totali(_RecordSort->Strutt(), _tipo_stampa);
|
||||
_RecordSort->compila(recalleg);
|
||||
}
|
||||
} // if buono()
|
||||
}
|
||||
}
|
||||
} // for su nditte
|
||||
|
||||
//
|
||||
@ -1163,7 +1132,7 @@ void TStampa_allegati::set_rows(int counter)
|
||||
bool TStampa_allegati::preprocess_page(int file,int counter)
|
||||
{
|
||||
static long codditta_curr;
|
||||
static TFixed_string codatt_curr(" "); // Sono 5 spazi
|
||||
static TString16 codatt_curr(" "); // Sono 5 spazi
|
||||
struct alleg_sort * buff = (struct alleg_sort *) _buff;
|
||||
int pagina_corrente = printer().getcurrentpage();
|
||||
|
||||
@ -1409,25 +1378,6 @@ bool TStampa_allegati::intesta()
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/******************
|
||||
const char * TStampa_allegati::get_paiva_cf (const char * tipoa, long codcf)
|
||||
{
|
||||
TString dep;
|
||||
|
||||
_clifo->setkey(1);
|
||||
_clifo->first ();
|
||||
_clifo->curr().zero();
|
||||
_clifo->curr().put (CLI_TIPOCF, tipoa);
|
||||
_clifo->curr().put (CLI_CODCF, codcf);
|
||||
_clifo->read();
|
||||
if (_clifo->good())
|
||||
dep = _clifo->curr().get(CLI_PAIV);
|
||||
else
|
||||
dep = "";
|
||||
return dep;
|
||||
}
|
||||
******************/
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
//
|
||||
// STAMPA SU DISCO
|
||||
@ -1972,14 +1922,14 @@ void TStampa_allegati::scrivi_coda_elenco_fornitori()
|
||||
segno[5] = ' ';
|
||||
|
||||
if (_t->TotE8esc() < 0)
|
||||
segno[8] = '-';
|
||||
segno[6] = '-';
|
||||
else
|
||||
segno[8] = ' ';
|
||||
segno[6] = ' ';
|
||||
|
||||
if (_t->TotE8esp() < 0)
|
||||
segno[8] = '-';
|
||||
segno[7] = '-';
|
||||
else
|
||||
segno[8] = ' ';
|
||||
segno[7] = ' ';
|
||||
|
||||
if (_t->TotTotRigac() < 0)
|
||||
segno[8] = '-';
|
||||
@ -2228,8 +2178,7 @@ TPrintrow * TStampa_allegati::get_record_fine_volume (bool finito)
|
||||
int cg3300(int argc, char* argv[])
|
||||
{
|
||||
TStampa_allegati a;
|
||||
a.run(argc, argv, "Stampa Allegati");
|
||||
a.run(argc, argv, TR("Stampa Allegati"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
23
cg/cg3300.h
23
cg/cg3300.h
@ -117,32 +117,23 @@ struct alleg_sort {
|
||||
};
|
||||
|
||||
class SortRecord {
|
||||
TLocalisamfile * _clifo;
|
||||
TLocalisamfile * _comuni;
|
||||
TLocalisamfile * _anagfis;
|
||||
TLocalisamfile * _anaggiu;
|
||||
TLocalisamfile * _anag;
|
||||
TTable * _attiv;
|
||||
TTable * _tpd;
|
||||
struct alleg_sort * _all;
|
||||
|
||||
protected:
|
||||
TRectype& look_com(const char *);
|
||||
long cerca_codice_all(char tipo, long codcf) ;
|
||||
const TRectype & look_com(const char * cod);
|
||||
const char * decodifica_desc_att (const TString & codatt);
|
||||
bool corrispettivo (const char * tipodoc);
|
||||
|
||||
public:
|
||||
void azzera_struttura();
|
||||
bool fill_dati_anag_dic (TLocalisamfile *);
|
||||
void azzera_struttura();
|
||||
bool fill_dati_anag_dic (const TRectype & ditta);
|
||||
const char * fill_dati_dettaglio (const char * tipo, long codcf);
|
||||
const char * Strutt_str() { return (const char *) _all; }
|
||||
struct alleg_sort * Strutt() { return _all; }
|
||||
void compila(const TRectype& alleg);
|
||||
void somma (const TRectype& rec, stampe);
|
||||
void compila(const TRectype& alleg);
|
||||
void somma (const TRectype& rec, stampe);
|
||||
const real& importo() const { return _all->impesc; }
|
||||
int RecSize () { return sizeof(struct alleg_sort); }
|
||||
long codcf_dett() { return _all->codcf_dett; }
|
||||
int RecSize () { return sizeof(struct alleg_sort); }
|
||||
long codcf_dett() { return _all->codcf_dett; }
|
||||
const real& Impesc() { return _all->impesc; }
|
||||
|
||||
SortRecord();
|
||||
|
@ -143,12 +143,12 @@ BEGIN
|
||||
VALIDATE F_A_DITTA>=F_DA_DITTA
|
||||
END
|
||||
|
||||
BUTTON DLG_OK 9 2
|
||||
BUTTON DLG_OK 10 2
|
||||
BEGIN
|
||||
PROMPT -12 -1 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_CANCEL 9 2
|
||||
BUTTON DLG_CANCEL 10 2
|
||||
BEGIN
|
||||
PROMPT -22 -1 ""
|
||||
END
|
||||
|
269
cg/cg3301.cpp
269
cg/cg3301.cpp
@ -3,9 +3,10 @@
|
||||
// classi di supporto per cg3300_application
|
||||
//
|
||||
|
||||
#include <isam.h>
|
||||
#include <stdlib.h>
|
||||
#include <diction.h>
|
||||
#include <recarray.h>
|
||||
#include <tabutil.h>
|
||||
#include <strings.h>
|
||||
#include <scanner.h>
|
||||
|
||||
#include <comuni.h>
|
||||
@ -18,12 +19,6 @@
|
||||
|
||||
#include "cg3300.h"
|
||||
|
||||
const int CODTABLEN = 15;
|
||||
|
||||
#define MAXSTR 128
|
||||
static char __tmp[MAXSTR];
|
||||
static TFixed_string tmp(__tmp, MAXSTR);
|
||||
|
||||
//
|
||||
// SortRecord
|
||||
//
|
||||
@ -31,93 +26,27 @@ static TFixed_string tmp(__tmp, MAXSTR);
|
||||
SortRecord::SortRecord()
|
||||
{
|
||||
_all = new struct alleg_sort;
|
||||
_clifo = new TLocalisamfile(LF_CLIFO);
|
||||
_comuni = new TLocalisamfile(LF_COMUNI);
|
||||
_anagfis = new TLocalisamfile(LF_ANAGFIS);
|
||||
_anaggiu = new TLocalisamfile(LF_ANAGGIU);
|
||||
_anag = new TLocalisamfile(LF_ANAG);
|
||||
_attiv = new TTable("%AIS");
|
||||
_tpd = new TTable("%TPD");
|
||||
azzera_struttura();
|
||||
}
|
||||
|
||||
SortRecord::~SortRecord()
|
||||
{
|
||||
delete _clifo; delete _comuni; delete _attiv; delete _tpd;
|
||||
delete _anagfis; delete _anaggiu; delete _anag;
|
||||
delete _all;
|
||||
}
|
||||
|
||||
long SortRecord::cerca_codice_all(char tipo, long codcf)
|
||||
{
|
||||
TLocalisamfile& clifo = *_clifo;
|
||||
|
||||
clifo.zero();
|
||||
clifo.put (CLI_TIPOCF, tipo);
|
||||
clifo.put (CLI_CODCF, codcf);
|
||||
clifo.read();
|
||||
|
||||
if (clifo.good())
|
||||
{
|
||||
long codice_all = clifo.get_long (CLI_CODALLEG);
|
||||
return codice_all;
|
||||
}
|
||||
|
||||
return 0L;
|
||||
}
|
||||
|
||||
const char* SortRecord::decodifica_desc_att (const TString& codatt)
|
||||
|
||||
{
|
||||
TTable& attivita = * _attiv;
|
||||
|
||||
attivita.zero();
|
||||
attivita.put ("CODTAB", codatt);
|
||||
|
||||
attivita.read();
|
||||
|
||||
if (attivita.bad())
|
||||
attivita.zero();
|
||||
|
||||
tmp = attivita.get ("S0");
|
||||
|
||||
return __tmp;
|
||||
return cache().get("%AIS", codatt, "S0");
|
||||
}
|
||||
|
||||
bool SortRecord::corrispettivo (const char * tipodoc)
|
||||
const TRectype & SortRecord::look_com(const char * cod)
|
||||
{
|
||||
TTable& tpd = * _tpd;
|
||||
TString natura_doc;
|
||||
bool corrisp;
|
||||
TString16 key;
|
||||
|
||||
key.format("|%s", cod);
|
||||
|
||||
tpd.zero();
|
||||
tpd.put ("CODTAB", tipodoc);
|
||||
tpd.read();
|
||||
if (tpd.bad())
|
||||
tpd.zero();
|
||||
|
||||
natura_doc = tpd.get("I0");
|
||||
corrisp = tpd.get_bool ("B0");
|
||||
|
||||
if ((natura_doc == "1") || (natura_doc == "9"))
|
||||
if (corrisp)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
TRectype& SortRecord::look_com (const char * cod)
|
||||
{
|
||||
TLocalisamfile& com = *_comuni;
|
||||
|
||||
com.zero();
|
||||
com.put (COM_COM, cod);
|
||||
|
||||
com.read();
|
||||
|
||||
if (com.bad())
|
||||
com.zero();
|
||||
|
||||
return com.curr();
|
||||
return cache().get(LF_COMUNI, key);
|
||||
}
|
||||
|
||||
//
|
||||
@ -130,54 +59,37 @@ TRectype& SortRecord::look_com (const char * cod)
|
||||
//
|
||||
const char * SortRecord::fill_dati_dettaglio (const char * tipocf, long codcf)
|
||||
{
|
||||
TLocalisamfile& clifo = *_clifo;
|
||||
static char _rag[51];
|
||||
TString tipop, cog, nom, rag;
|
||||
TString indcf, comcf;
|
||||
TString stato, paiva;
|
||||
TString16 key;
|
||||
|
||||
clifo.zero();
|
||||
clifo.put (CLI_TIPOCF, tipocf);
|
||||
clifo.put (CLI_CODCF, codcf);
|
||||
clifo.read();
|
||||
key.format("%s|%ld", tipocf, codcf);
|
||||
const TRectype & clifo = cache().get(LF_CLIFO, key);
|
||||
|
||||
if ((clifo.good()))
|
||||
if (!clifo.empty())
|
||||
{
|
||||
tipop = clifo.get (CLI_TIPOPERS);
|
||||
rag = clifo.get (CLI_RAGSOC);
|
||||
TString indcf;
|
||||
|
||||
indcf = clifo.curr().get (CLI_INDCF);
|
||||
indcf << ", " << clifo.curr().get (CLI_CIVCF);
|
||||
comcf = clifo.curr().get (CLI_COMCF);
|
||||
|
||||
TRectype dep = look_com ((const char *)comcf);
|
||||
strcpy (_all->comune_dett , dep.get(COM_DENCOM));
|
||||
strcpy (_all->prov_dett , dep.get(COM_PROVCOM));
|
||||
indcf = clifo.get (CLI_INDCF);
|
||||
indcf << ", " << clifo.get (CLI_CIVCF);
|
||||
strcpy (_all->via_dett, indcf);
|
||||
strcpy (_all->paiva_dett, clifo.get (CLI_PAIV));
|
||||
strcpy (_all->statopaiva_dett, clifo.get (CLI_STATOPAIV));
|
||||
|
||||
strcpy (_all->via_dett , indcf);
|
||||
const TRectype & dep = look_com ((const char *)clifo.get (CLI_COMCF));
|
||||
|
||||
paiva = clifo.curr().get (CLI_PAIV);
|
||||
stato = clifo.curr().get (CLI_STATOPAIV);
|
||||
strcpy (_all->comune_dett, dep.get(COM_DENCOM));
|
||||
strcpy (_all->prov_dett, dep.get(COM_PROVCOM));
|
||||
|
||||
strcpy (_all->paiva_dett , paiva);
|
||||
strcpy (_all->statopaiva_dett , stato);
|
||||
|
||||
strcpy (_all->ragsoc_dett , rag);
|
||||
|
||||
if (tipop == "F")
|
||||
const TString & rag = clifo.get (CLI_RAGSOC);
|
||||
if (clifo.get (CLI_TIPOPERS) == "F")
|
||||
{
|
||||
cog = rag.left(30);
|
||||
nom = rag.mid (31);
|
||||
strcpy (_all->cognome_dett , cog.trim());
|
||||
strcpy (_all->nome_dett , nom.trim());
|
||||
//
|
||||
// N.B.
|
||||
// Azzero la ragione sociale se persona fisica.
|
||||
//
|
||||
strcpy (_all->ragsoc_dett , "\0");
|
||||
strcpy (_all->cognome_dett, rag.left(30));
|
||||
strcpy (_all->nome_dett, rag.mid(30));
|
||||
strcpy (_all->ragsoc_dett, "");
|
||||
}
|
||||
strcpy (_rag, (const char*) rag);
|
||||
return _rag;
|
||||
else
|
||||
strcpy (_all->ragsoc_dett, rag);
|
||||
|
||||
return rag;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@ -331,112 +243,83 @@ void SortRecord::compila(const TRectype& alleg)
|
||||
fill_dati_dettaglio (tipoa, codcf);
|
||||
}
|
||||
|
||||
bool SortRecord::fill_dati_anag_dic (TLocalisamfile * nditte)
|
||||
bool SortRecord::fill_dati_anag_dic (const TRectype & ditta)
|
||||
{
|
||||
TLocalisamfile& anagfis = *_anagfis;
|
||||
TLocalisamfile& anaggiu = *_anaggiu;
|
||||
TLocalisamfile& anag = *_anag;
|
||||
TString codanagr;
|
||||
TString tipoa;
|
||||
TString comodo;
|
||||
long codanagr;
|
||||
TString tipoa;
|
||||
TString str;
|
||||
|
||||
_all->codditta_dic = nditte->get_long(NDT_CODDITTA);
|
||||
comodo = nditte->get(NDT_CODATTPREV);
|
||||
_all->codditta_dic = ditta.get_long(NDT_CODDITTA);
|
||||
str = ditta.get(NDT_CODATTPREV);
|
||||
|
||||
strcpy (_all->codatt_dic, comodo);
|
||||
if (comodo.not_empty())
|
||||
comodo = decodifica_desc_att (comodo);
|
||||
str = decodifica_desc_att (str);
|
||||
if (str.not_empty())
|
||||
strcpy (_all->codatt_dic, str);
|
||||
|
||||
if (comodo.not_empty())
|
||||
strcpy (_all->attivita_dic, comodo);
|
||||
else
|
||||
strcpy (_all->attivita_dic, "\0");
|
||||
strcpy (_all->attivita_dic, str);
|
||||
|
||||
codanagr = nditte->curr().get(NDT_CODANAGR);
|
||||
tipoa = nditte->curr().get(NDT_TIPOA);
|
||||
codanagr = ditta.get_long(NDT_CODANAGR);
|
||||
tipoa = ditta.get(NDT_TIPOA);
|
||||
|
||||
strcpy (_all->tipopers_dic, tipoa);
|
||||
|
||||
anag.setkey(1);
|
||||
anag.curr().zero();
|
||||
anag.curr().put (ANA_TIPOA, tipoa);
|
||||
anag.curr().put (ANA_CODANAGR, codanagr);
|
||||
if (anag.read() == NOERR)
|
||||
{
|
||||
strcpy (_all->paiva_dic, anag.curr().get (ANA_PAIV));
|
||||
strcpy (_all->ragsoc_dic , anag.curr().get(ANA_RAGSOC));
|
||||
strcpy (_all->comunefis_dic, anag.curr().get(ANA_COMRF));
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy (_all->paiva_dic, "\0");
|
||||
strcpy (_all->ragsoc_dic , "\0");
|
||||
strcpy (_all->comunefis_dic, "\0");
|
||||
}
|
||||
TString16 key;
|
||||
|
||||
key.format("%s|%ld", (const char *) tipoa, codanagr);
|
||||
|
||||
const TRectype & anag = cache().get(LF_ANAG, key);
|
||||
|
||||
strcpy (_all->paiva_dic, anag.get (ANA_PAIV));
|
||||
strcpy (_all->ragsoc_dic , anag.get(ANA_RAGSOC));
|
||||
strcpy (_all->comunefis_dic, anag.get(ANA_COMRF));
|
||||
|
||||
if (_all->comunefis_dic[0] == '\0')
|
||||
{
|
||||
strcpy (_all->comunefis_dic, anag.curr().get(ANF_COMRES));
|
||||
strcpy (_all->comunefis_dic, anag.get(ANF_COMRES));
|
||||
|
||||
TRectype dep = look_com (_all->comunefis_dic);
|
||||
const TRectype & dep = look_com (_all->comunefis_dic);
|
||||
|
||||
strcpy (_all->comunefis_dic , dep.get(COM_DENCOM));
|
||||
strcpy (_all->provfis_dic , dep.get(COM_PROVCOM));
|
||||
comodo = anag.curr().get(ANA_INDRES);
|
||||
comodo.rtrim();
|
||||
comodo << " " << anag.curr().get (ANA_CIVRES);
|
||||
strcpy (_all->viafis_dic , (const char *) comodo);
|
||||
str = anag.get(ANA_INDRES);
|
||||
str << " " << anag.get(ANA_CIVRES);
|
||||
strcpy (_all->viafis_dic , (const char *) str);
|
||||
}
|
||||
else
|
||||
{
|
||||
TRectype dep = look_com (_all->comunefis_dic);
|
||||
const TRectype & dep = look_com (_all->comunefis_dic);
|
||||
strcpy (_all->comunefis_dic, dep.get(COM_DENCOM));
|
||||
strcpy (_all->provfis_dic , dep.get(COM_PROVCOM));
|
||||
comodo = anag.curr().get(ANA_INDRF);
|
||||
comodo.rtrim();
|
||||
comodo << " " << anag.curr().get (ANA_CIVRF);
|
||||
|
||||
strcpy (_all->viafis_dic, comodo);
|
||||
str = anag.get(ANA_INDRF);
|
||||
str << " " << anag.get (ANA_CIVRF);
|
||||
strcpy (_all->viafis_dic, str);
|
||||
}
|
||||
|
||||
key.format("%ld", codanagr);
|
||||
|
||||
if (tipoa[0] == 'F')
|
||||
{
|
||||
TString cognome, nome;
|
||||
str = _all->ragsoc_dic;
|
||||
strcpy (_all->cognome_dic, str.left(30));
|
||||
strcpy (_all->nome_dic, str.mid(30));
|
||||
|
||||
comodo = _all->ragsoc_dic;
|
||||
cognome = comodo.sub(0,29);
|
||||
cognome.trim();
|
||||
strcpy (_all->cognome_dic, cognome);
|
||||
|
||||
comodo = _all->ragsoc_dic;
|
||||
nome = comodo.mid(30);
|
||||
nome.trim();
|
||||
strcpy (_all->nome_dic, nome);
|
||||
|
||||
anagfis.setkey(1);
|
||||
anagfis.curr().zero();
|
||||
anagfis.curr().put (ANF_CODANAGR, codanagr);
|
||||
anagfis.read();
|
||||
const TRectype &anagfis = cache().get(LF_ANAGFIS, key);
|
||||
|
||||
_all->datana_dic = anagfis.curr().get_date(ANF_DATANASC);
|
||||
strcpy (_all->sesso_dic , anagfis.curr().get(ANF_SESSO));
|
||||
_all->datana_dic = anagfis.get_date(ANF_DATANASC);
|
||||
strcpy (_all->sesso_dic, anagfis.get(ANF_SESSO));
|
||||
|
||||
TRectype dep = look_com (anagfis.curr().get(ANF_COMNASC));
|
||||
const TRectype & dep = look_com (anagfis.get(ANF_COMNASC));
|
||||
|
||||
strcpy (_all->comunena_dic, dep.get(COM_DENCOM));
|
||||
strcpy (_all->provna_dic , dep.get(COM_PROVCOM));
|
||||
strcpy (_all->provna_dic, dep.get(COM_PROVCOM));
|
||||
}
|
||||
else
|
||||
if (tipoa[0] == 'G')
|
||||
{
|
||||
// Leggo natura giuridica dal anagrafe giuridiche
|
||||
anaggiu.setkey(1);
|
||||
anaggiu.curr().zero();
|
||||
anaggiu.curr().put (ANG_CODANAGR, codanagr);
|
||||
if (anaggiu.read() == NOERR)
|
||||
_all->natgiu_dic = anaggiu.curr().get_int (ANG_NATGIU);
|
||||
else
|
||||
_all->natgiu_dic = 0;
|
||||
const TRectype &anaggiu = cache().get(LF_ANAGGIU, key);
|
||||
|
||||
_all->natgiu_dic = anaggiu.get_int(ANG_NATGIU);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@ -540,7 +423,7 @@ void Array_desc_campi::leggi_modulo (const char * file, const char *modulo)
|
||||
}
|
||||
}
|
||||
else
|
||||
error_box("Impossibile trovare la sezione '%s' sul file '%s'", modulo, file);
|
||||
error_box(FR("Impossibile trovare la sezione '%s' sul file '%s'"), modulo, file);
|
||||
}
|
||||
|
||||
void Array_desc_campi::add(int r, const char* f)
|
||||
|
318
cg/cg3400.cpp
318
cg/cg3400.cpp
@ -53,9 +53,6 @@ HIDDEN enum tipo_sospensione { nessuna, normale, vol_affari, liquidazione };
|
||||
class TContoOccas : public TBill
|
||||
{
|
||||
TString16 _occfpi;
|
||||
|
||||
TDecoder _clifoccas;
|
||||
TDecoder _occas;
|
||||
TAssoc_array _desc;
|
||||
|
||||
public:
|
||||
@ -69,8 +66,6 @@ public:
|
||||
};
|
||||
|
||||
TContoOccas::TContoOccas()
|
||||
: _occfpi(NULL), _clifoccas(LF_CLIFO, CLI_OCCAS),
|
||||
_occas(LF_OCCAS, "RAGSOC")
|
||||
{ }
|
||||
|
||||
const TContoOccas& TContoOccas::set(int g, int c, long s, char t, const char* occfpi)
|
||||
@ -85,9 +80,9 @@ const TString& TContoOccas::descrizione()
|
||||
if (_occfpi.not_empty())
|
||||
{
|
||||
TString16 code; code << tipo() << '|' << sottoconto();
|
||||
bool really_occas = _clifoccas.decode(code).not_empty();
|
||||
bool really_occas = cache().get(LF_CLIFO, code, CLI_OCCAS).not_empty();
|
||||
if (really_occas)
|
||||
return _occas.decode(_occfpi);
|
||||
return cache().get(LF_OCCAS, _occfpi, "RAGSOC");
|
||||
}
|
||||
|
||||
TString16 code; code.format("%c%03d%03d%06ld",
|
||||
@ -167,12 +162,9 @@ public:
|
||||
TString16 _provfis, _cap, _occfpi;
|
||||
TString80 _cofi;
|
||||
|
||||
TLocalisamfile *_clifo,*_pconti,*_nditte,*_anag;
|
||||
|
||||
TLocalisamfile* _attiv; // da togliere in futuro (?)
|
||||
|
||||
TTable *_tabreg;
|
||||
|
||||
TDecoder *_causali, *_tabiva; // Guy: saggia aggiunta
|
||||
|
||||
public:
|
||||
virtual void preprocess_header();
|
||||
@ -217,7 +209,7 @@ public:
|
||||
int set_totali_pagina(int r);
|
||||
void get_dati_ditta ();
|
||||
|
||||
const char* get_descr_caus (const char * codcaus);
|
||||
const TString& get_descr_caus (const char * codcaus);
|
||||
const TRectype& look_com (const char* cod, const char* stato = "");
|
||||
const TString& get_codiva_des(const char* codiva);
|
||||
void update_totals (char sezione, real& importo);
|
||||
@ -286,9 +278,9 @@ const TRectype& TStampa_giornale::look_com (const char* cod, const char* stato)
|
||||
return cache().get(LF_COMUNI, codice);
|
||||
}
|
||||
|
||||
const char* TStampa_giornale::get_descr_caus (const char * codcaus)
|
||||
const TString & TStampa_giornale::get_descr_caus (const char * codcaus)
|
||||
{
|
||||
return _causali->decode(codcaus);
|
||||
return cache().get(LF_CAUSALI, codcaus).get("DESCR");
|
||||
}
|
||||
|
||||
void TStampa_giornale::get_dati_ditta ()
|
||||
@ -296,30 +288,25 @@ void TStampa_giornale::get_dati_ditta ()
|
||||
TString16 codanagr;
|
||||
char tipoa;
|
||||
|
||||
_nditte->zero();
|
||||
_nditte->put(NDT_CODDITTA, get_firm());
|
||||
_nditte->read();
|
||||
const TRectype & nditte = cache().get(LF_NDITTE, get_firm());
|
||||
|
||||
if (_nditte->bad()) _nditte->zero();
|
||||
_ragsoc = nditte.get(NDT_RAGSOC);
|
||||
codanagr = nditte.get(NDT_CODANAGR);
|
||||
tipoa = nditte.get_char(NDT_TIPOA);
|
||||
|
||||
_ragsoc = _nditte->get(NDT_RAGSOC);
|
||||
codanagr = _nditte->curr().get(NDT_CODANAGR);
|
||||
tipoa = _nditte->curr().get_char(NDT_TIPOA);
|
||||
TToken_string key ;
|
||||
|
||||
_anag->setkey(1);
|
||||
_anag->zero();
|
||||
_anag->put (ANA_TIPOA, tipoa);
|
||||
_anag->put (ANA_CODANAGR, codanagr);
|
||||
_anag->read();
|
||||
if (_anag->bad()) _anag->zero();
|
||||
key.add(tipoa);
|
||||
key.add(codanagr);
|
||||
const TRectype & anag = cache().get(LF_ANAG, key);
|
||||
|
||||
_cofi = _anag->get(ANA_COFI);
|
||||
_paiva = _anag->get(ANA_PAIV);
|
||||
_comunefis = _anag->get(ANA_COMRF);
|
||||
_cap = _anag->get(ANA_CAPRF);
|
||||
_cofi = anag.get(ANA_COFI);
|
||||
_paiva = anag.get(ANA_PAIV);
|
||||
_comunefis = anag.get(ANA_COMRF);
|
||||
_cap = anag.get(ANA_CAPRF);
|
||||
|
||||
if (_comunefis.empty())
|
||||
_comunefis = _anag->get(ANF_COMRES);
|
||||
_comunefis = anag.get(ANF_COMRES);
|
||||
|
||||
const TRectype& dep = look_com(_comunefis);
|
||||
_comunefis = dep.get(COM_DENCOM);
|
||||
@ -329,15 +316,15 @@ void TStampa_giornale::get_dati_ditta ()
|
||||
|
||||
if (_comunefis.empty())
|
||||
{
|
||||
_viafis = _anag->get(ANA_INDRF);
|
||||
_viafis = anag.get(ANA_INDRF);
|
||||
_viafis.rtrim();
|
||||
_viafis << ' ' << _anag->curr().get (ANA_CIVRF);
|
||||
_viafis << " " << anag.get (ANA_CIVRF);
|
||||
}
|
||||
else
|
||||
{
|
||||
_viafis = _anag->get(ANA_INDRES);
|
||||
_viafis = anag.get(ANA_INDRES);
|
||||
_viafis.rtrim();
|
||||
_viafis << ' ' << _anag->get (ANA_CIVRES);
|
||||
_viafis << " " << anag.get (ANA_CIVRES);
|
||||
}
|
||||
}
|
||||
|
||||
@ -352,15 +339,10 @@ bool TStampa_giornale::user_create()
|
||||
{
|
||||
_ae = 0;
|
||||
_ae_solare = 0;
|
||||
open_files(LF_TABCOM, LF_TAB, LF_NDITTE, LF_ANAG, LF_COMUNI, LF_CLIFO, LF_PCON, LF_OCCAS, 0);
|
||||
_tabreg = new TTable ("REG");
|
||||
_tabiva = new TDecoder("%IVA");
|
||||
|
||||
_nditte = new TLocalisamfile(LF_NDITTE);
|
||||
_anag = new TLocalisamfile (LF_ANAG);
|
||||
_clifo = new TLocalisamfile(LF_CLIFO);
|
||||
_pconti = new TLocalisamfile(LF_PCON);
|
||||
_attiv = new TLocalisamfile(LF_ATTIV); // da togliere
|
||||
_causali = new TDecoder(LF_CAUSALI, "DESCR");
|
||||
|
||||
|
||||
|
||||
_rel = new TRelation (LF_MOV);
|
||||
_rel->add (LF_RMOV, "NUMREG==NUMREG");
|
||||
@ -386,14 +368,7 @@ bool TStampa_giornale::user_destroy()
|
||||
delete _RecPartoDa;
|
||||
delete _RecArrivoA;
|
||||
|
||||
delete _clifo; delete _pconti;
|
||||
delete _nditte; delete _anag;
|
||||
delete _tabreg;
|
||||
delete _tabiva;
|
||||
delete _causali;
|
||||
|
||||
delete _attiv; // da togliere in futuro
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -402,13 +377,10 @@ void TStampa_giornale::aggiorna_mov()
|
||||
TLocalisamfile& mov = _cur->file(LF_MOV);
|
||||
long nprog = _nprog_da + 1;
|
||||
|
||||
// const TRectype da(*_RecPartoDa);
|
||||
// const TRectype a(*_RecArrivoA);
|
||||
// _cur->setregion(da, a);
|
||||
_cur->setregion(*_RecPartoDa, *_RecArrivoA);
|
||||
|
||||
const long items = _cur->items();
|
||||
TProgind prnd (items, "Aggiornamento movimenti ...", FALSE, TRUE);
|
||||
TProgind prnd (items, TR("Aggiornamento movimenti ..."), FALSE, TRUE);
|
||||
|
||||
for ((*_cur) = 0L; _cur->pos() < items; ++(*_cur))
|
||||
{
|
||||
@ -431,15 +403,13 @@ int TStampa_giornale::set_totali_giorno(const TDate& data, const int righeiva)
|
||||
const int SHIFT = 15;
|
||||
const int STACC = 51 + SHIFT;
|
||||
|
||||
// r = righeiva == 0 ? 1 : righeiva + 1;
|
||||
|
||||
// Se e' l'unico totale lo stampo anche se e' zero
|
||||
if (competenza_ec() || (_tot_avere_gg != ZERO || _tot_dare_gg != ZERO))
|
||||
{
|
||||
TString80 td; real2currency(td, _tot_dare_gg);
|
||||
TString80 ta; real2currency(ta, _tot_avere_gg);
|
||||
|
||||
sprintf(dep, "@b@%dgTotale operazioni del %s @%dg%c %s @%dg%c @%dg%s",
|
||||
sprintf(dep, FR("@b@%dgTotale operazioni del %s @%dg%c %s @%dg%c @%dg%s"),
|
||||
_stampa_width == 132 ? SCRITTA : DARE198-STACC,
|
||||
data.string(),
|
||||
_stampa_width == 132 ? TOTDARE132 : DARE198-2,
|
||||
@ -460,7 +430,7 @@ int TStampa_giornale::set_totali_giorno(const TDate& data, const int righeiva)
|
||||
TString80 tdp; real2currency(tdp, _tot_dare_gg_ap);
|
||||
TString80 tap; real2currency(tap, _tot_avere_gg_ap);
|
||||
|
||||
sprintf (dep, "@b@%dgTotale operazioni del %s Anno precedente @%dg%c %s @%dg%c @%dg%s",
|
||||
sprintf (dep, FR("@b@%dgTotale operazioni del %s Anno precedente @%dg%c %s @%dg%c @%dg%s"),
|
||||
_stampa_width == 132 ? SCRITTA : DARE198-STACC,
|
||||
data.string(),
|
||||
_stampa_width == 132 ? TOTDARE132 : DARE198-2,
|
||||
@ -482,7 +452,7 @@ int TStampa_giornale::set_totali_giorno(const TDate& data, const int righeiva)
|
||||
|
||||
void TStampa_giornale::postclose_print()
|
||||
{
|
||||
if (_stampa_definitiva && yesno_box("La stampa e' corretta?"))
|
||||
if (_stampa_definitiva && yesno_box(TR("La stampa e' corretta?")))
|
||||
{
|
||||
const int ultima_fatta = _pagine_contate;
|
||||
aggiorna_mov();
|
||||
@ -518,10 +488,6 @@ void TStampa_giornale::preprocess_footer()
|
||||
// 2. Sono sull'ultima riga
|
||||
//
|
||||
|
||||
/*
|
||||
const bool riporta = _forza_ariportare ||
|
||||
(!_gia_settato_ariportare && _cur->pos() < _cur->items()-1 );
|
||||
*/
|
||||
const int riporta = _devo_riportare;
|
||||
|
||||
if (riporta)
|
||||
@ -533,8 +499,7 @@ void TStampa_giornale::preprocess_footer()
|
||||
|
||||
riga.format ("@b@%dg%s@%dg%c %s @%dg%c @%dg%s",
|
||||
_stampa_width == 132 ? SCRITTA : DARE198-STUMB,
|
||||
// (_nuovo_mese && !_forza_ariportare) ? "Totale progressivi generali " : "A riportare ",
|
||||
"A riportare ",
|
||||
TR("A riportare "),
|
||||
_stampa_width == 132 ? TOTDARE132 : DARE198,
|
||||
'D',
|
||||
(const char *) dts,
|
||||
@ -578,7 +543,7 @@ int TStampa_giornale::set_totali_pagina(int righe)
|
||||
real2currency(progr_dare, _tot_dare_progr);
|
||||
real2currency(progr_avere, _tot_avere_progr);
|
||||
riga = "";
|
||||
riga.format("@b@%dgTotale progressivi @%dg%c %s @%dg%c @%dg%s",
|
||||
riga.format(FR("@b@%dgTotale progressivi @%dg%c %s @%dg%c @%dg%s"),
|
||||
_stampa_width == 132 ? SCRITTA : DARE198-STUMB,
|
||||
_stampa_width == 132 ? TOTDARE132 : DARE198-2,
|
||||
'D',
|
||||
@ -593,7 +558,7 @@ int TStampa_giornale::set_totali_pagina(int righe)
|
||||
|
||||
if (ap)
|
||||
{
|
||||
riga.format("@b@%dgTotale progressivi anno precedente @%dg%c %s @%dg%c @%dg%s",
|
||||
riga.format(FR("@b@%dgTotale progressivi anno precedente @%dg%c %s @%dg%c @%dg%s"),
|
||||
_stampa_width == 132 ? SCRITTA : DARE198-STUMB,
|
||||
_stampa_width == 132 ? TOTDARE132 : DARE198-2,
|
||||
'D',
|
||||
@ -612,7 +577,7 @@ int TStampa_giornale::set_totali_pagina(int righe)
|
||||
real2currency(dts, _tot_dare_generale);
|
||||
real2currency(ats, _tot_avere_generale);
|
||||
|
||||
riga.format("@b@%dgTotale progressivi generali @%dg%c %s @%dg%c @%dg%s",
|
||||
riga.format(FR("@b@%dgTotale progressivi generali @%dg%c %s @%dg%c @%dg%s"),
|
||||
_stampa_width == 132 ? SCRITTA : DARE198-STUMB,
|
||||
_stampa_width == 132 ? TOTDARE132 : DARE198-2,
|
||||
'D',
|
||||
@ -643,7 +608,7 @@ int TStampa_giornale::set_totali_pagina(int righe)
|
||||
// "Se il mese e' finito devo scrivere Totale progressivi generali
|
||||
// invece che A riportare"
|
||||
|
||||
riga.format ("@b@%dgTotale progressivi generali @%dg%c %s @%dg%c @%dg%s",
|
||||
riga.format (FR("@b@%dgTotale progressivi generali @%dg%c %s @%dg%c @%dg%s"),
|
||||
_stampa_width == 132 ? SCRITTA : DARE198-STUMB,
|
||||
_stampa_width == 132 ? TOTDARE132 : DARE198-2,
|
||||
'D',
|
||||
@ -668,22 +633,22 @@ int TStampa_giornale::stampa_intestazione_ditta()
|
||||
riga.fill('-');
|
||||
set_header(r, riga);
|
||||
|
||||
set_header (++r, "Ditta: %5ld %-.50s %.35s %.5s %.20s %.2s",
|
||||
set_header (++r, FR("Ditta: %5ld %-.50s %.35s %.5s %.20s %.2s"),
|
||||
get_firm(),
|
||||
(const char *)_ragsoc,
|
||||
(const char *)_viafis, (const char *)_cap,
|
||||
(const char *)_comunefis, (const char *)_provfis);
|
||||
|
||||
if (_stampa_definitiva)
|
||||
intes.format ("Partita iva %s @24gCodice fiscale %s",
|
||||
intes.format (FR("Partita iva %s @24gCodice fiscale %s"),
|
||||
(const char*)_paiva, (const char*)_cofi,
|
||||
_stampa_width == 132 ? 102 : 168
|
||||
);
|
||||
else
|
||||
intes.format ("Partita iva %s @24gCodice fiscale %s @%dg%s @%dgData @>",
|
||||
intes.format (FR("Partita iva %s @24gCodice fiscale %s @%dg%s @%dgData @>"),
|
||||
(const char*)_paiva, (const char*)_cofi,
|
||||
_stampa_width == 132 ? 102 : 168,
|
||||
"LIBRO DI PROVA",
|
||||
FR("LIBRO DI PROVA"),
|
||||
_stampa_width == 132 ? 117 : 183
|
||||
);
|
||||
|
||||
@ -705,9 +670,9 @@ int TStampa_giornale::set_headers()
|
||||
r += 2;
|
||||
|
||||
if (_stampa_definitiva)
|
||||
set_header(r++, "Codice libro: %s %s ",(const char *) _reg_cod, (const char *) _reg_descr);
|
||||
set_header(r++, FR("Codice libro: %s %s "),(const char *) _reg_cod, (const char *) _reg_descr);
|
||||
else
|
||||
set_header(r++, "Codice libro: %s %s @%dgdalla data: %s alla data: %s @%dgEsercizio: %04d",
|
||||
set_header(r++, FR("Codice libro: %s %s @%dgdalla data: %s alla data: %s @%dgEsercizio: %04d"),
|
||||
(const char *) _reg_cod, (const char *) _reg_descr,
|
||||
_stampa_width == 132 ? 69 : 135,
|
||||
(const char *) data_da, (const char *) data_a,
|
||||
@ -719,33 +684,32 @@ int TStampa_giornale::set_headers()
|
||||
set_header(r++, riga);
|
||||
|
||||
if (_libro_cronologico)
|
||||
set_header(r, "@59gCodice Conto");
|
||||
set_header(r, FR("@59gCodice Conto"));
|
||||
|
||||
if (!_stampa_definitiva) {
|
||||
if (_stampa_width == 132) {
|
||||
set_header(r++, "@131gS");
|
||||
set_header(r, "@1gN.riga");
|
||||
set_header(r, FR("@1gN.riga"));
|
||||
}
|
||||
else {
|
||||
set_header(r++, "@197gS");
|
||||
set_header(r, "@1gN.riga");
|
||||
set_header(r, FR("@1gN.riga"));
|
||||
}
|
||||
}
|
||||
else
|
||||
if (_libro_cronologico) r++; // NON LASCIARE RIGHE IN BIANCO!!
|
||||
|
||||
// set_header(r, "@6gCod.Causale@34gDescrizione operazione");
|
||||
set_header(r, "@8gDescrizione operazione@36gCausale");
|
||||
set_header(r, FR("@8gDescrizione operazione@36gCausale"));
|
||||
if (_libro_cronologico)
|
||||
// POSCONTO = 74;
|
||||
set_header(r, "@74gGeneralita' cliente/fornitore");
|
||||
set_header(r, FR("@74gGeneralita' cliente/fornitore"));
|
||||
else
|
||||
set_header(r, "@59gCodice Conto");
|
||||
set_header(r, FR("@59gCodice Conto"));
|
||||
|
||||
if (_stampa_width == 132)
|
||||
set_header(r, "@120gImporto");
|
||||
set_header(r, FR("@120gImporto"));
|
||||
else
|
||||
set_header(r, "@161gDare @184gAvere");
|
||||
set_header(r, FR("@161gDare @184gAvere"));
|
||||
|
||||
if (!_stampa_definitiva)
|
||||
set_header(r, _stampa_width == 132 ? "@131gB" : "@197gB");
|
||||
@ -793,7 +757,7 @@ void TStampa_giornale::preprocess_header()
|
||||
TString80 avere; real2currency(avere, riporto_avere);
|
||||
|
||||
TString256 riporto;
|
||||
riporto.format("@b@%dgRiporto: @%dg%c %17s @%dg%c@%dg%17s", // prima erano %15s
|
||||
riporto.format(FR("@b@%dgRiporto: @%dg%c %17s @%dg%c@%dg%17s"), // prima erano %15s
|
||||
_stampa_width == 132 ? SCRITTA : DARE198-11,
|
||||
_stampa_width == 132 ? TOTDARE132 : DARE198-2,
|
||||
_stampa_width == 132 ? 'D' : ' ',
|
||||
@ -841,23 +805,6 @@ bool TStampa_giornale::preprocess_print(int file, int counter)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/***
|
||||
bool TStampa_giornale::cancel_hook()
|
||||
{
|
||||
int ultima_fatta = printer().getcurrentpage() - 1;
|
||||
// int stampate = ultima_fatta - _pagina_da + 1;
|
||||
|
||||
if (yesno_box ("Interrompo la stampa ?"))
|
||||
{
|
||||
if (_stampa_definitiva)
|
||||
aggiorna_tabreg (ultima_fatta, ultima_fatta);
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
***/
|
||||
|
||||
int TStampa_giornale::righe_rimaste() const
|
||||
{
|
||||
const TPrinter& p = printer();
|
||||
@ -872,16 +819,7 @@ void TStampa_giornale::fill_page(int righe_da_stampare, int righe_iva_settate)
|
||||
const TPrinter& p = printer();
|
||||
|
||||
TString256 rigas;
|
||||
// int rrr = start_riga + righe_iva_settate + 1;
|
||||
int r = righe_da_stampare + 1;
|
||||
// int rows_left = p.rows_left();
|
||||
/* if (rows_left <= 0)
|
||||
{
|
||||
rows_left = p.formlen() - (p.headersize()+1) - p.footersize();
|
||||
_forza_ariportare = TRUE;
|
||||
}
|
||||
*/
|
||||
// int r_l = p.rows_left() - start_riga - righe_iva_settate;
|
||||
int r_l = p.rows_left() - righe_da_stampare;
|
||||
|
||||
if (r_l < 0)
|
||||
@ -891,8 +829,6 @@ void TStampa_giornale::fill_page(int righe_da_stampare, int righe_iva_settate)
|
||||
if (r_l > 0)
|
||||
{
|
||||
rigas.fill('=', _stampa_width);
|
||||
// rigas.cut(_stampa_width+1);
|
||||
// set_row(rrr++, "%s", (const char*) rigas);
|
||||
set_row(r++, "%s", (const char*) rigas);
|
||||
int j=0;
|
||||
// Calcola una specie di coefficiente angolare
|
||||
@ -1084,22 +1020,22 @@ void TStampa_giornale::set_rows (int file, int counter)
|
||||
|
||||
if (_stampa_definitiva)
|
||||
{
|
||||
set_row(r,"Operazione n. @b%-7ld@r", _nprog_mov);
|
||||
set_row(r," del @b%s@r", (const char*)datareg_str); // XX/XX/XXXX
|
||||
set_row(r," doc. n. @b%-7s@r",(const char*)numdoc);
|
||||
set_row(r," del @b%s@r %-50s",(const char*)datadoc_str,
|
||||
set_row(r,FR("Operazione n. @b%-7ld@r"), _nprog_mov);
|
||||
set_row(r,FR(" del @b%s@r"), (const char*)datareg_str); // XX/XX/XXXX
|
||||
set_row(r,FR(" doc. n. @b%-7s@r"),(const char*)numdoc);
|
||||
set_row(r,FR(" del @b%s@r %-50s"),(const char*)datadoc_str,
|
||||
(const char*)mov_descr);
|
||||
}
|
||||
else
|
||||
{
|
||||
set_row(r,"Operazione n. @b%-7ld@r", numreg);
|
||||
set_row(r," del @b%s@r", (const char*) datareg_str);
|
||||
set_row(r," doc. n. @b%-7s@r", (const char*) numdoc);
|
||||
set_row(r," del @b%s@r %-50s", (const char*)datadoc_str,(const char*)mov_descr);
|
||||
set_row(r,FR("Operazione n. @b%-7ld@r"), numreg);
|
||||
set_row(r,FR(" del @b%s@r"), (const char*) datareg_str);
|
||||
set_row(r,FR(" doc. n. @b%-7s@r"), (const char*) numdoc);
|
||||
set_row(r,FR(" del @b%s@r %-50s"), (const char*)datadoc_str,(const char*)mov_descr);
|
||||
}
|
||||
|
||||
if (_annoEsMov != _ae)
|
||||
set_row(r," Comp. %04d", _annoEsMov);
|
||||
set_row(r,FR(" Comp. %04d"), _annoEsMov);
|
||||
|
||||
if (_MovGiaStampato && !_stampa_definitiva)
|
||||
{
|
||||
@ -1111,9 +1047,9 @@ void TStampa_giornale::set_rows (int file, int counter)
|
||||
if (caus.not_empty())
|
||||
{
|
||||
const char* desc_caus = get_descr_caus(caus);
|
||||
set_row(r+1, "@36gCausale %3s %-50s", (const char*) caus, desc_caus);
|
||||
set_row(r+1, FR("@36gCausale %3s %-50s"), (const char*) caus, desc_caus);
|
||||
if (_reg.not_empty())
|
||||
set_row(r+1, " (R.IVA @b%3s@r Prot. @b%ld@r) ", (const char*)_reg,protiva);
|
||||
set_row(r+1, FR(" (R.IVA @b%3s@r Prot. @b%ld@r) "), (const char*)_reg,protiva);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -1319,7 +1255,7 @@ int TStampa_giornale::setta_righe_descr(TParagraph_string& str, enum descr des)
|
||||
|
||||
const TString& TStampa_giornale::get_codiva_des(const char* codiva)
|
||||
{
|
||||
return _tabiva->decode(codiva);
|
||||
return cache().get("%IVA", codiva).get("S0");
|
||||
}
|
||||
|
||||
// NB
|
||||
@ -1337,12 +1273,9 @@ int TStampa_giornale::setta_righe_iva()
|
||||
r = j+1;
|
||||
TString80 impon_str; real2currency(impon_str, riga._imponibile);
|
||||
TString80 impos_str; real2currency(impos_str, riga._imposta);
|
||||
// set_row(r, " Imponibile@15g%15r", &riga._imponibile);
|
||||
// set_row(r, "@31gImposta@39g%15r", &riga._imposta);
|
||||
set_row(r, " Imponibile@15g%15s", (const char*)impon_str);
|
||||
set_row(r, "@35gImposta@43g%15s", (const char*)impos_str);
|
||||
// set_row(r, "@58gCod.Iva@68g%3s", (const char*)riga._codiva);
|
||||
set_row(r, "@64gCod.Iva %3s", (const char*)riga._codiva);
|
||||
set_row(r, FR(" Imponibile@15g%15s"), (const char*)impon_str);
|
||||
set_row(r, FR("@35gImposta@43g%15s"), (const char*)impos_str);
|
||||
set_row(r, FR("@64gCod.Iva %3s"), (const char*)riga._codiva);
|
||||
const TString& codiva_des = get_codiva_des(riga._codiva);
|
||||
const int tipoatt = riga._tipoatt;
|
||||
if (_stampa_width == 132)
|
||||
@ -1355,16 +1288,16 @@ int TStampa_giornale::setta_righe_iva()
|
||||
switch (riga._tipodet)
|
||||
{
|
||||
case 0 :
|
||||
rig << "Detraibile ";
|
||||
rig << TR("Detraibile ");
|
||||
break;
|
||||
case 1 :
|
||||
rig << "Indetraib. su op.es. ";
|
||||
rig << TR("Indetraib. su op.es. ");
|
||||
break;
|
||||
case 3 :
|
||||
rig << "Passaggi interni ";
|
||||
rig << TR("Passaggi interni ");
|
||||
break;
|
||||
case 9 :
|
||||
rig << "Indetraibile art.19 ";
|
||||
rig << TR("Indetraibile art.19 ");
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
@ -1372,14 +1305,14 @@ int TStampa_giornale::setta_righe_iva()
|
||||
|
||||
const int meseliq = _cur->file(LF_MOV).get_int(MOV_MESELIQ);
|
||||
if (meseliq > 0)
|
||||
set_row(r, " Mese liq. %2d", meseliq);
|
||||
set_row(r, FR(" Mese liq. %2d"), meseliq);
|
||||
|
||||
if (tipoatt != 0)
|
||||
{
|
||||
TRegistro reg(_reg, _anno_iva);
|
||||
const bool att_mista_ev = reg.attivita_mista();
|
||||
if (att_mista_ev)
|
||||
set_row(r, " Tipo attivita' %d", tipoatt);
|
||||
set_row(r, FR(" Tipo attivita' %d"), tipoatt);
|
||||
}
|
||||
}
|
||||
_iva_array.destroy();
|
||||
@ -1394,11 +1327,11 @@ int TStampa_giornale::setta_righe_valuta(int r)
|
||||
{
|
||||
const TString16 codvali = current_cursor()->file(LF_MOV).get(MOV_CODVALI);
|
||||
const TCurrency cur(corrval, codvali);
|
||||
set_row(++r,"@56gValuta %3s", (const char*)codvali);
|
||||
set_row(++r,FR("@56gValuta %3s"), (const char*)codvali);
|
||||
if (_stampa_width == 132)
|
||||
set_row(r,"@89gCorr.in valuta @109g%20v", &cur);
|
||||
set_row(r,FR("@89gCorr.in valuta @109g%20v"), &cur);
|
||||
else
|
||||
set_row(r,"@119gCorr.in valuta @171g%20v", &cur);
|
||||
set_row(r,FR("@119gCorr.in valuta @171g%20v"), &cur);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
@ -1410,51 +1343,42 @@ int TStampa_giornale::setta_righe_indirizzo(char tipocf, long codcf,int rdes)
|
||||
{
|
||||
TString16 prov, comcf, capcf, civcf, statocf;
|
||||
TString80 viacf, comune;
|
||||
bool really_occas = FALSE;
|
||||
char tipoa;
|
||||
long codanagr;
|
||||
char riga[256];
|
||||
int r = rdes;
|
||||
|
||||
_clifo->zero();
|
||||
_clifo->put(CLI_CODCF, codcf);
|
||||
_clifo->put(CLI_TIPOCF, tipocf);
|
||||
TToken_string key;
|
||||
key.add(tipocf);
|
||||
key.add( codcf);
|
||||
|
||||
const bool clifo_ok = (_clifo->read() == NOERR);
|
||||
const TRectype & clifo = cache().get(LF_CLIFO, key);
|
||||
|
||||
if (clifo_ok) really_occas = _clifo->get_bool(CLI_OCCAS);
|
||||
|
||||
if (_occfpi.not_empty() && really_occas) // => e' un occasionale...
|
||||
if (_occfpi.not_empty() && clifo.get_bool(CLI_OCCAS)) // => e' un occasionale...
|
||||
{
|
||||
TLocalisamfile occ(LF_OCCAS);
|
||||
const TRectype & occ = cache().get(LF_OCCAS, _occfpi);
|
||||
|
||||
occ.zero();
|
||||
occ.put(OCC_CFPI, _occfpi);
|
||||
if (occ.read() != NOERR) occ.zero();
|
||||
|
||||
viacf = occ.get (OCC_INDIR);
|
||||
civcf = occ.get (OCC_CIV);
|
||||
capcf = occ.get (OCC_CAP);
|
||||
comcf = occ.get (OCC_COM);
|
||||
viacf = occ.get(OCC_INDIR);
|
||||
civcf = occ.get(OCC_CIV);
|
||||
capcf = occ.get(OCC_CAP);
|
||||
comcf = occ.get(OCC_COM);
|
||||
}
|
||||
else
|
||||
{
|
||||
// E' possibile cio' ?
|
||||
if (!clifo_ok) return r;
|
||||
|
||||
viacf = _clifo->get(CLI_INDCF);
|
||||
civcf = _clifo->get(CLI_CIVCF);
|
||||
comcf = _clifo->get(CLI_COMCF);
|
||||
capcf = _clifo->get(CLI_CAPCF);
|
||||
statocf = _clifo->get(CLI_STATOCF);
|
||||
tipoa = _clifo->get_char(CLI_TIPOAPER);
|
||||
codanagr = _clifo->get_long(CLI_CODANAGPER);
|
||||
viacf = clifo.get(CLI_INDCF);
|
||||
civcf = clifo.get(CLI_CIVCF);
|
||||
comcf = clifo.get(CLI_COMCF);
|
||||
capcf = clifo.get(CLI_CAPCF);
|
||||
statocf = clifo.get(CLI_STATOCF);
|
||||
tipoa = clifo.get_char(CLI_TIPOAPER);
|
||||
codanagr = clifo.get_long(CLI_CODANAGPER);
|
||||
}
|
||||
|
||||
const TRectype& rec = look_com (comcf, statocf);
|
||||
comune = rec.get(COM_DENCOM);
|
||||
prov = rec.get(COM_PROVCOM);
|
||||
if (comcf.empty()) comune = _clifo->get(CLI_LOCCF);
|
||||
if (comcf.empty())
|
||||
comune = clifo.get(CLI_LOCCF);
|
||||
|
||||
if (viacf.not_empty())
|
||||
{
|
||||
@ -1483,12 +1407,12 @@ int TStampa_giornale::setta_righe_indirizzo(char tipocf, long codcf,int rdes)
|
||||
TString80 comna;
|
||||
TString16 datana, codcomna, provna, capna, statona;
|
||||
|
||||
datana = _clifo->get("DATANASC");
|
||||
datana = clifo.get("DATANASC");
|
||||
|
||||
if (datana.not_empty())
|
||||
{
|
||||
codcomna = _clifo->get("COMNASC");
|
||||
statona = _clifo->get("STATONASC");
|
||||
codcomna = clifo.get("COMNASC");
|
||||
statona = clifo.get("STATONASC");
|
||||
const TRectype& dep = look_com (codcomna, statona);
|
||||
|
||||
comna = dep.get(COM_DENCOM);
|
||||
@ -1521,8 +1445,6 @@ void TStampa_giornale::aggiorna_tabreg(int partito_da, int stampate)
|
||||
|
||||
if (_tabreg->good())
|
||||
{
|
||||
// _tabreg->put ("I8", (long)partito_da); // partito_da = -1 se stampa OK
|
||||
// _tabreg->put ("I1", (long)_pagine_stampate + stampate); // pagine stampate
|
||||
_tabreg->put ("I1", (long)_pagina_da + stampate); // pagine stampate
|
||||
_tabreg->put ("I6", _nprog_mov); // ultimo numero di riga
|
||||
_tabreg->put ("R1", _tot_dare_generale);
|
||||
@ -1556,7 +1478,7 @@ bool TStampa_giornale::controlla_mov_aep()
|
||||
|
||||
const TRecnotype items = _cur->items();
|
||||
_cur->freeze();
|
||||
TProgind pi(items, "Controllo movimenti esercizio precedente", FALSE, TRUE);
|
||||
TProgind pi(items, TR("Controllo movimenti esercizio precedente"), FALSE, TRUE);
|
||||
|
||||
bool gia_stampati = TRUE;
|
||||
for (*_cur = 0L ; _cur->pos() < items; ++(*_cur))
|
||||
@ -1567,9 +1489,9 @@ bool TStampa_giornale::controlla_mov_aep()
|
||||
}
|
||||
_cur->freeze(FALSE);
|
||||
if (!gia_stampati)
|
||||
error_box("Impossibile proseguire con la stampa:\n"
|
||||
error_box(TR("Impossibile proseguire con la stampa:\n"
|
||||
"Esistono movimenti nell'esercizio precedente\n"
|
||||
"che non sono ancora stati stampati su bollato.");
|
||||
"che non sono ancora stati stampati su bollato."));
|
||||
return gia_stampati;
|
||||
}
|
||||
|
||||
@ -1585,7 +1507,6 @@ bool TStampa_giornale::leggi_tabreg(const char * reg_cod, int reg_anno)
|
||||
_pagine_stampate = _tabreg->get_int("I1");
|
||||
_pagine_numerate = _tabreg->get_int("I2");
|
||||
_stampa_num_pag = _tabreg->get_bool("S11");
|
||||
// _stampa_ok = _tabreg->get_int("I8");
|
||||
_nprog_da = _tabreg->get_long ("I6");
|
||||
_tot_dare = _tabreg->get_real ("R1");
|
||||
_tot_avere = _tabreg->get_real ("R2");
|
||||
@ -1627,7 +1548,7 @@ bool TStampa_giornale::data_a_hndl (TMask_field& f, KEY k)
|
||||
|
||||
TEsercizi_contabili esc;
|
||||
if (esc.date2esc(data_a) <= 0)
|
||||
return f.error_box("La data non appartiene a nessun esercizio");
|
||||
return f.error_box(TR("La data non appartiene a nessun esercizio"));
|
||||
|
||||
app()._ae_solare = data_a.year();
|
||||
app()._ae = esc.date2esc(data_a);
|
||||
@ -1648,9 +1569,9 @@ bool TStampa_giornale::data_a_hndl (TMask_field& f, KEY k)
|
||||
if (dtda.not_empty())
|
||||
{
|
||||
if (data_da.year() != data_a.year())
|
||||
return f.warning_box("Le date specificate non appartengono allo stesso anno");
|
||||
return f.warning_box(TR("Le date specificate non appartengono allo stesso anno"));
|
||||
if (data_da > data_a)
|
||||
return f.warning_box("La data di partenza non puo' essere maggiore della data finale");
|
||||
return f.warning_box(TR("La data di partenza non puo' essere maggiore della data finale"));
|
||||
}
|
||||
}
|
||||
} // if K_ENTER
|
||||
@ -1671,7 +1592,7 @@ bool TStampa_giornale::data_da_hndl(TMask_field& f, KEY k)
|
||||
return TRUE;
|
||||
|
||||
if (data_da.year() != data_a.year())
|
||||
return f.error_box("Le due date non appartengono allo stesso anno");
|
||||
return f.error_box(TR("Le due date non appartengono allo stesso anno"));
|
||||
}
|
||||
|
||||
if (k == K_ENTER)
|
||||
@ -1684,10 +1605,10 @@ bool TStampa_giornale::data_da_hndl(TMask_field& f, KEY k)
|
||||
|
||||
// se la stampa e' di prova DALLA_DATA e' obbligatoria
|
||||
if (!definitiva && !data_da.ok())
|
||||
return f.warning_box("Manca la data di partenza");
|
||||
return f.warning_box(TR("Manca la data di partenza"));
|
||||
|
||||
if (data_da.ok() && data_da > data_a)
|
||||
return f.warning_box("La data di partenza non puo' essere maggiore della data finale");
|
||||
return f.warning_box(TR("La data di partenza non puo' essere maggiore della data finale"));
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@ -1717,30 +1638,12 @@ bool TStampa_giornale::mask_a_cod_reg (TMask_field& f, KEY k)
|
||||
a._ae = esc.date2esc(data_a); //a._ae_solare; // Anno esercizio
|
||||
}
|
||||
|
||||
const TString16 reg_cod(f.get());
|
||||
|
||||
if (reg_cod.empty())
|
||||
{
|
||||
if (k == K_TAB) // Magari ci ripassa e lo inserisce
|
||||
return TRUE;
|
||||
else // Se e' K_ENTER mi serve davvero
|
||||
return f.error_box("Manca il codice registro");
|
||||
}
|
||||
|
||||
const TString16 reg_cod(f.get());
|
||||
bool reg_ok = a.leggi_tabreg(reg_cod, a._ae_solare);
|
||||
|
||||
// Output da qui della descrizione del registro e dell'anno
|
||||
m.set(REG_DESC, a._reg_descr);
|
||||
m.set(ANNO_ESER, a._ae_solare);
|
||||
/*
|
||||
// CHECKTYPE NORMAL abolito! (nella maschera non ho l'anno...
|
||||
if (!reg_ok)
|
||||
return f.warning_box("Registro inesistente");
|
||||
|
||||
if (app()._tipo != 5)
|
||||
return f.warning_box("Il registro %s per l'anno %d non e' di tipo libro giornale",
|
||||
(const char *) reg_cod, a._ae);
|
||||
*/
|
||||
m.set(ANNO_ESER, a._ae_solare);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@ -1776,7 +1679,7 @@ bool TStampa_giornale::mask_b_warning (TMask_field& f, KEY k)
|
||||
{
|
||||
if (k == K_SPACE)
|
||||
{
|
||||
f.warning_box("Le modifiche a questi progressivi saranno scritte nel registro");
|
||||
f.warning_box(TR("Le modifiche a questi progressivi saranno scritte nel registro"));
|
||||
gia_detto = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
@ -1865,7 +1768,7 @@ bool TStampa_giornale::init_cursor()
|
||||
if (_cur->items() == 0L)
|
||||
{
|
||||
_cur->setfilter("");
|
||||
return warning_box("Non ci sono movimenti da stampare nel periodo selezionato.\nLa stampa e' annullata");
|
||||
return warning_box(TR("Non ci sono movimenti da stampare nel periodo selezionato.\nLa stampa e' annullata"));
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@ -1955,7 +1858,6 @@ bool TStampa_giornale::set_print(int)
|
||||
int cg3400 (int argc, char * argv[])
|
||||
{
|
||||
TStampa_giornale app;
|
||||
app.run(argc, argv, "Stampa libro giornale");
|
||||
app.run(argc, argv, TR("Stampa libro giornale"));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -58,11 +58,8 @@ BEGIN
|
||||
OUTPUT ANNO_ESER CODTAB[1,4]
|
||||
OUTPUT CODREG CODTAB[5,7]
|
||||
OUTPUT REG_DESC S0
|
||||
// OUTPUT PAGINA_DA I1
|
||||
// OUTPUT DATA_DA D0
|
||||
// OUTPUT DATA_A D1
|
||||
CHECKTYPE REQUIRED
|
||||
WARNING "Registro inesistente"
|
||||
WARNING "Registro assente"
|
||||
// VALIDATE ZEROFILL_FUNC 3
|
||||
FLAGS "UZ"
|
||||
END
|
||||
|
129
cg/cg3500.cpp
129
cg/cg3500.cpp
@ -43,7 +43,6 @@ class TStampa_riepilogo : public TPrintapp
|
||||
{
|
||||
TProgind * _prog;
|
||||
TSaldi_list* _lista;
|
||||
TLocalisamfile* _com, * _pcn, * _clifo, * _saldi, * _nditte,* _anag;
|
||||
TIsamtempfile * _tmp_saldi;
|
||||
tipo _tp;
|
||||
real _prg_dare,_prg_avere,_saldo_dare,_saldo_avere,_prg_dare_tot,_prg_avere_tot,_saldo_tot;
|
||||
@ -101,13 +100,15 @@ bool TStampa_riepilogo::riepilogo()
|
||||
cp=-1;
|
||||
_udata_max = 0l;
|
||||
|
||||
for (_pcn->first(); !_pcn->eof(); _pcn->next())
|
||||
TLocalisamfile pcn(LF_PCON);
|
||||
|
||||
for (pcn.first(); !pcn.eof(); pcn.next())
|
||||
{
|
||||
_prog->addstatus(1);
|
||||
g = _pcn->get_int (PCN_GRUPPO);
|
||||
c = _pcn->get_int (PCN_CONTO);
|
||||
s = _pcn->get_long(PCN_SOTTOCONTO);
|
||||
tipo_conto = _pcn->get_char(PCN_TMCF);
|
||||
g = pcn.get_int (PCN_GRUPPO);
|
||||
c = pcn.get_int (PCN_CONTO);
|
||||
s = pcn.get_long(PCN_SOTTOCONTO);
|
||||
tipo_conto = pcn.get_char(PCN_TMCF);
|
||||
|
||||
TConto conto (g,c,s,tipo_conto);
|
||||
|
||||
@ -129,13 +130,11 @@ bool TStampa_riepilogo::riepilogo()
|
||||
_tmp_saldi->put(SLD_PDARE,prg_conto_dare);
|
||||
_tmp_saldi->put(SLD_PAVERE,prg_conto_avere);
|
||||
if (saldo_conto > 0.00) //va stampato in Dare
|
||||
_tmp_saldi->put(SLD_PDAREPRO,saldo_conto); // W96SALDI del 10-06-96
|
||||
//_tmp_saldi->put(SLD_PDARESCA,saldo_conto);
|
||||
_tmp_saldi->put(SLD_PDAREPRO,saldo_conto); // W96SALDI del 10-06-96
|
||||
else
|
||||
{
|
||||
saldo_conto = saldo_conto * (-1.00);
|
||||
_tmp_saldi->put(SLD_PAVEREPRO,saldo_conto); // W96SALDI del 10-06-96
|
||||
//_tmp_saldi->put(SLD_PAVERESCA,saldo_conto);
|
||||
_tmp_saldi->put(SLD_PAVEREPRO,saldo_conto); // W96SALDI del 10-06-96
|
||||
}
|
||||
_tmp_saldi->write();
|
||||
esiste_conto = TRUE;
|
||||
@ -176,16 +175,16 @@ bool TStampa_riepilogo::riepilogo()
|
||||
if ( (tipo_conto == 'C') || (tipo_conto == 'F') ) //si tratta di un conto cliente/fornitore
|
||||
{
|
||||
_udata_max = 0l;
|
||||
indbil = _pcn->get_int(PCN_INDBIL);
|
||||
indbil = pcn.get_int(PCN_INDBIL);
|
||||
esiste_sc = ricerca_cf(conto,indbil,prg_conto_dare,prg_conto_avere);
|
||||
if (esiste_sc)
|
||||
{
|
||||
gp = conto.gruppo();
|
||||
cp = conto.conto();
|
||||
}
|
||||
TRecnotype recnum = _pcn->recno();
|
||||
_pcn->next();
|
||||
if (_pcn->eof())
|
||||
TRecnotype recnum = pcn.recno();
|
||||
pcn.next();
|
||||
if (pcn.eof())
|
||||
{
|
||||
saldo_conto = prg_conto_dare - prg_conto_avere;
|
||||
prg_gruppo_dare += prg_conto_dare;
|
||||
@ -237,14 +236,14 @@ bool TStampa_riepilogo::riepilogo()
|
||||
_tmp_saldi->write();
|
||||
}
|
||||
}
|
||||
_pcn->readat(recnum);
|
||||
pcn.readat(recnum);
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (conto.conto() == 0)
|
||||
indbil = _pcn->get_int(PCN_INDBIL);
|
||||
indbil = pcn.get_int(PCN_INDBIL);
|
||||
|
||||
if ( (conto.conto() == 0) || (conto.sottoconto() == 0) ) //e' un gruppo o un conto
|
||||
{
|
||||
@ -299,9 +298,9 @@ bool TStampa_riepilogo::riepilogo()
|
||||
cp = conto.conto();
|
||||
}
|
||||
|
||||
TRecnotype recnum = _pcn->recno();
|
||||
_pcn->next();
|
||||
if (_pcn->eof())
|
||||
TRecnotype recnum = pcn.recno();
|
||||
pcn.next();
|
||||
if (pcn.eof())
|
||||
{
|
||||
saldo_conto = prg_conto_dare - prg_conto_avere;
|
||||
prg_gruppo_dare += prg_conto_dare;
|
||||
@ -352,7 +351,7 @@ bool TStampa_riepilogo::riepilogo()
|
||||
_tmp_saldi->write();
|
||||
}
|
||||
}
|
||||
_pcn->readat(recnum);
|
||||
pcn.readat(recnum);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@ -727,7 +726,7 @@ void TStampa_riepilogo::setta_riga_conto()
|
||||
if (_scelta == 1)
|
||||
{
|
||||
set_row(r++,"%s",(const char*)riga);
|
||||
set_row(r,"**** Totali conto %3d %3d",_gconto,_cconto);
|
||||
set_row(r,FR("**** Totali conto %3d %3d"),_gconto,_cconto);
|
||||
set_row(r,"@27g%.25s@r",(const char*)_descrconto);
|
||||
|
||||
}
|
||||
@ -754,7 +753,7 @@ void TStampa_riepilogo::setta_riga_gruppo()
|
||||
if (_scelta == 2)
|
||||
if (_tp == fine) r = 3;
|
||||
else r = 2;
|
||||
set_row(r,"**** TOTALI GRUPPO %3d",_ggruppo);
|
||||
set_row(r,FR("**** TOTALI GRUPPO %3d"),_ggruppo);
|
||||
set_row(r,"@27g%.25s@r",(const char*)_descrgruppo);
|
||||
set_row(r++,"@53g%r@73g%r@93g%r@113g%r",&_prg_dare_gruppo,&_prg_avere_gruppo,&_saldo_dare_gruppo,&_saldo_avere_gruppo);
|
||||
set_row(r++,"%s",(const char*)riga);
|
||||
@ -769,7 +768,7 @@ void TStampa_riepilogo::setta_riga_totale()
|
||||
const int r = _scelta == 1 ? 8 : 6;
|
||||
|
||||
//17/11/1995
|
||||
set_row(r, "**** TOTALE GENERALE @53g%r@73g%r", &_prg_dare_tot, &_prg_avere_tot);
|
||||
set_row(r, FR("**** TOTALE GENERALE @53g%r@73g%r"), &_prg_dare_tot, &_prg_avere_tot);
|
||||
|
||||
// Guy: 10/01/97 errore MI6125
|
||||
if (_saldo_tot != 0.0)
|
||||
@ -811,24 +810,14 @@ TDate TStampa_riepilogo::UltimaData(int g, int c, long s)
|
||||
|
||||
bool TStampa_riepilogo::user_create()
|
||||
{
|
||||
_clifo = new TLocalisamfile(LF_CLIFO);
|
||||
_com = new TLocalisamfile(LF_COMUNI);
|
||||
_pcn = new TLocalisamfile(LF_PCON);
|
||||
_saldi = new TLocalisamfile(LF_SALDI);
|
||||
_nditte = new TLocalisamfile(LF_NDITTE);
|
||||
_anag = new TLocalisamfile(LF_ANAG);
|
||||
open_files(LF_CLIFO, LF_COMUNI, LF_PCON, LF_SALDI, LF_NDITTE, LF_ANAG,
|
||||
LF_TABCOM, LF_TAB, 0);
|
||||
_tmp_saldi = NULL;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TStampa_riepilogo::user_destroy()
|
||||
{
|
||||
delete _com;
|
||||
delete _pcn;
|
||||
delete _clifo;
|
||||
delete _saldi;
|
||||
delete _nditte;
|
||||
delete _anag;
|
||||
delete _tmp_saldi;
|
||||
return TRUE;
|
||||
}
|
||||
@ -842,7 +831,9 @@ bool TStampa_riepilogo::set_print(int)
|
||||
_scelta = m.get_int(F_STAMPA);
|
||||
_richiesta = m.get_int(F_RICHIESTA);
|
||||
_data = m.get(F_DATASTAMPA);
|
||||
_prog = new TProgind(_pcn->items(), "Elaborazione in corso...", FALSE);
|
||||
TLocalisamfile pcn(LF_PCON);
|
||||
|
||||
_prog = new TProgind(pcn.items(), TR("Elaborazione in corso..."), FALSE);
|
||||
|
||||
riepilogo();
|
||||
|
||||
@ -852,40 +843,22 @@ bool TStampa_riepilogo::set_print(int)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
TRectype& cerca_com (const char * cod, TLocalisamfile *comuni)
|
||||
{
|
||||
comuni->zero();
|
||||
comuni->put(COM_COM, cod);
|
||||
comuni->read();
|
||||
if (comuni->bad())
|
||||
comuni->zero();
|
||||
|
||||
return comuni->curr();
|
||||
}
|
||||
|
||||
void TStampa_riepilogo::get_dati_ditta()
|
||||
{
|
||||
TLocalisamfile nditte(LF_NDITTE);
|
||||
TLocalisamfile anag(LF_ANAG);
|
||||
TString codanagr;
|
||||
TString tipoa;
|
||||
|
||||
nditte.zero();
|
||||
nditte.put(NDT_CODDITTA, get_firm());
|
||||
nditte.read();
|
||||
|
||||
if (nditte.bad()) nditte.zero();
|
||||
const TRectype & nditte = cache().get(LF_NDITTE, get_firm());
|
||||
|
||||
codanagr = nditte.get(NDT_CODANAGR);
|
||||
tipoa = nditte.get(NDT_TIPOA);
|
||||
_ragsoc = nditte.get(NDT_RAGSOC);
|
||||
|
||||
anag.setkey(1);
|
||||
anag.zero();
|
||||
anag.put (ANA_TIPOA, tipoa);
|
||||
anag.put (ANA_CODANAGR, codanagr);
|
||||
anag.read();
|
||||
if (anag.bad()) anag.zero();
|
||||
TToken_string key;
|
||||
key.add(tipoa);
|
||||
key.add(codanagr);
|
||||
|
||||
const TRectype & anag = cache().get(LF_ANAG, key);
|
||||
|
||||
_cofi = anag.get(ANA_COFI);
|
||||
_paiva = anag.get(ANA_PAIV);
|
||||
@ -894,11 +867,15 @@ void TStampa_riepilogo::get_dati_ditta()
|
||||
if (_comunefis.empty())
|
||||
_comunefis = anag.get(ANA_COMRES);
|
||||
|
||||
TRectype dep = cerca_com (_comunefis, _com);
|
||||
key.cut(0);
|
||||
key.add("");
|
||||
key.add(_comunefis);
|
||||
|
||||
_comunefis = dep.get(COM_DENCOM);
|
||||
_provfis = dep.get(COM_PROVCOM);
|
||||
_cap = dep.get(COM_CAPCOM);
|
||||
const TRectype & com = cache().get(LF_COMUNI, key);
|
||||
|
||||
_comunefis = com.get(COM_DENCOM);
|
||||
_provfis = com.get(COM_PROVCOM);
|
||||
_cap = com.get(COM_CAPCOM);
|
||||
if (_comunefis.empty())
|
||||
{
|
||||
_viafis = anag.get(ANA_INDRF);
|
||||
@ -922,15 +899,15 @@ int TStampa_riepilogo::stampa_intestazione_ditta()
|
||||
get_dati_ditta();
|
||||
codice_ditta << get_firm();
|
||||
|
||||
set_header (r, "Ditta %s %s %s %s %s %s", (const char*)codice_ditta,
|
||||
set_header (r, FR("Ditta %s %s %s %s %s %s"), (const char*)codice_ditta,
|
||||
(const char*)_ragsoc, (const char*)_viafis,
|
||||
(const char*)_cap, (const char*)_comunefis,
|
||||
(const char*)_provfis);
|
||||
r++;
|
||||
printer().setdate(_data);
|
||||
riga = "Data @< Pag. @#";
|
||||
riga = FR("Data @< Pag. @#");
|
||||
riga.right_just(127);
|
||||
riga.overwrite (format ("Partita iva %s Codice fiscale %s", (const char*)_paiva, (const char*)_cofi));
|
||||
riga.overwrite (format (FR("Partita iva %s Codice fiscale %s"), (const char*)_paiva, (const char*)_cofi));
|
||||
set_header (r, "%s", (const char*) riga);
|
||||
r++;
|
||||
|
||||
@ -946,19 +923,19 @@ void TStampa_riepilogo::preprocess_header()
|
||||
|
||||
r++;
|
||||
if (_scelta == 1) //stampa riepilogo conti
|
||||
set_header(r,"*** MASTRO DI CONTO ***");
|
||||
else set_header(r,"*** MASTRO DI GRUPPO ***");
|
||||
set_header(r,"@33gCod. esercizio %d", _annoese);
|
||||
set_header(r,TR("*** MASTRO DI CONTO ***"));
|
||||
else set_header(r,TR("*** MASTRO DI GRUPPO ***"));
|
||||
set_header(r,FR("@33gCod. esercizio %d"), _annoese);
|
||||
if (_richiesta == 1)
|
||||
set_header(r,"@70gPROGRESSIVI ATTUALI@114gSALDO ATTUALE");
|
||||
else set_header(r,"@70gPROG. MOV. ELIMINATI@110gSALDO MOV. ELIMINATI");
|
||||
set_header(r,FR("@70gPROGRESSIVI ATTUALI@114gSALDO ATTUALE"));
|
||||
else set_header(r,FR("@70gPROG. MOV. ELIMINATI@110gSALDO MOV. ELIMINATI"));
|
||||
|
||||
r++;
|
||||
r++;
|
||||
if (_scelta == 1)
|
||||
set_header(r,"SOTTOC DESCRIZIONE");
|
||||
else set_header(r,"CONTO DESCRIZIONE");
|
||||
set_header(r++,"@40gDATA ULT.MOV@68gDARE@87gAVERE@108gDARE@127gAVERE");
|
||||
set_header(r,TR("SOTTOC DESCRIZIONE"));
|
||||
else set_header(r,TR("CONTO DESCRIZIONE"));
|
||||
set_header(r++,FR("@40gDATA ULT.MOV@68gDARE@87gAVERE@108gDARE@127gAVERE"));
|
||||
riga.fill('-');
|
||||
set_header(r,"%s",(const char*)riga);
|
||||
r++;
|
||||
@ -969,7 +946,7 @@ void TStampa_riepilogo::preprocess_header()
|
||||
int cg3500 (int argc, char* argv[])
|
||||
{
|
||||
TStampa_riepilogo a;
|
||||
a.run(argc, argv, "Stampa riepilogo gruppi/conti");
|
||||
a.run(argc, argv, TR("Stampa riepilogo gruppi/conti"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -360,20 +360,15 @@ bool TBalance::find(const TBill& b, int esercizio,
|
||||
{
|
||||
CHECK(b.sottoconto() > 0L, "Sottoconto mancante");
|
||||
|
||||
TLocalisamfile saldi(LF_SALDI);
|
||||
TRectype& curr = saldi.curr();
|
||||
curr.put(SLD_GRUPPO, b.gruppo());
|
||||
curr.put(SLD_CONTO, b.conto());
|
||||
curr.put(SLD_SOTTOCONTO, b.sottoconto());
|
||||
curr.put(SLD_ANNOES, esercizio);
|
||||
curr.put(SLD_FLSCA, FALSE);
|
||||
const bool ok = saldi.read() == NOERR;
|
||||
if (ok)
|
||||
TString key(30);
|
||||
key.format("%d||%d|%d|%ld", esercizio, b.gruppo(), b.conto(), b.sottoconto());
|
||||
const TRectype & saldi = cache().get(LF_SALDI, key);
|
||||
if (!saldi.empty())
|
||||
{
|
||||
si.set(curr.get_char(SLD_FLAGSALINI), curr.get_real(SLD_SALDO));
|
||||
da.set('D', curr.get_real(SLD_PDARE));
|
||||
av.set('A', curr.get_real(SLD_PAVERE));
|
||||
sf.set(curr.get_char(SLD_FLAGSALFIN), curr.get_real(SLD_SALDOFIN));
|
||||
si.set(saldi.get_char(SLD_FLAGSALINI), saldi.get_real(SLD_SALDO));
|
||||
da.set('D', saldi.get_real(SLD_PDARE));
|
||||
av.set('A', saldi.get_real(SLD_PAVERE));
|
||||
sf.set(saldi.get_char(SLD_FLAGSALFIN), saldi.get_real(SLD_SALDOFIN));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -761,7 +756,7 @@ void TMastrino::read(const TBill& conto,
|
||||
cur.freeze();
|
||||
|
||||
TString caption(80);
|
||||
caption.format("Caricamento mastrino %03d.%03d.%06ld",
|
||||
caption.format(FR("Caricamento mastrino %03d.%03d.%06ld"),
|
||||
_conto.gruppo(), _conto.conto(), _conto.sottoconto());
|
||||
TProgind pi(totrows, caption, FALSE, TRUE);
|
||||
|
||||
@ -776,7 +771,7 @@ void TMastrino::read(const TBill& conto,
|
||||
if (sec > 0.0)
|
||||
{
|
||||
TString80 msg;
|
||||
msg.format("%ld records at %ld rec/sec", num_rec, long(num_rec/sec));
|
||||
msg.format(FR("%ld records at %ld rec/sec"), num_rec, long(num_rec/sec));
|
||||
pi.set_text(msg);
|
||||
}
|
||||
}
|
||||
@ -2092,7 +2087,7 @@ bool TColor_mask::color_handler(TMask_field& f, KEY k)
|
||||
|
||||
bool TColor_mask::reset_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
if (k == K_SPACE && f.yesno_box("Si desidera azzerare tutti i colori?"))
|
||||
if (k == K_SPACE && f.yesno_box(TR("Si desidera azzerare tutti i colori?")))
|
||||
{
|
||||
TColor_mask& m = (TColor_mask&) f.mask();
|
||||
|
||||
@ -2136,7 +2131,7 @@ TColor_mask::TColor_mask(COLOR mb, COLOR mf, COLOR cb, COLOR cf)
|
||||
COLOR back, fore;
|
||||
type2colors(*c, back, fore);
|
||||
TToken_string& riga = s.row(-1);
|
||||
riga << "Riga " << (*c == 'M' ? "mastrino" : "contropartita");
|
||||
riga << TR("Riga ") << (*c == 'M' ? TR("mastrino") : TR("contropartita"));
|
||||
s.set_back_and_fore_color(back, fore, row++);
|
||||
}
|
||||
}
|
||||
@ -2389,7 +2384,7 @@ void TMastrini_grid::on_grid_button()
|
||||
TProgind* pi = NULL;
|
||||
|
||||
if (total > 50)
|
||||
pi = new TProgind(total, "Aggiornamento contropartite ...", FALSE, TRUE, 48);
|
||||
pi = new TProgind(total, TR("Aggiornamento contropartite ..."), FALSE, TRUE, 48);
|
||||
else
|
||||
begin_wait();
|
||||
|
||||
@ -2420,7 +2415,7 @@ void TMastrini_grid::on_grid_button()
|
||||
if (sec > 0.0)
|
||||
{
|
||||
TString80 msg;
|
||||
msg.format("%ld records at %ld rec/sec", step, long(step/sec));
|
||||
msg.format(FR("%ld records at %ld rec/sec"), step, long(step/sec));
|
||||
pi->set_text(msg);
|
||||
}
|
||||
}
|
||||
@ -2466,7 +2461,7 @@ void TMastrini_grid::on_record_button(long rec)
|
||||
TMailbox mail;
|
||||
if (mail.next_s(MSG_LN) != NULL)
|
||||
{
|
||||
if (yesno_box("Si desidera aggiornare il mastrino?"))
|
||||
if (yesno_box(TR("Si desidera aggiornare il mastrino?")))
|
||||
reread();
|
||||
}
|
||||
}
|
||||
@ -2682,8 +2677,8 @@ void TGrid_mask::handler(WINDOW win, EVENT* ep)
|
||||
xvt_res_free_menu_tree(menu);
|
||||
}
|
||||
#else
|
||||
ASK_RESPONSE r = xvt_dm_post_ask("Annulla", "Ripristina", "Salva",
|
||||
"Ordinamento delle colonne");
|
||||
ASK_RESPONSE r = xvt_dm_post_ask(TR("Annulla"), TR("Ripristina"), TR("Salva"),
|
||||
TR("Ordinamento delle colonne"));
|
||||
if (r == RESP_2)
|
||||
sht.reset_columns_order();
|
||||
if (r == RESP_2 || r == RESP_3)
|
||||
@ -2762,7 +2757,7 @@ bool TQuery_mask::esercizio_handler(TMask_field& f, KEY k)
|
||||
else
|
||||
{
|
||||
if (anno > 0)
|
||||
return error_box("Esercizio inesistente: %d", anno);
|
||||
return error_box(FR("Esercizio inesistente: %d"), anno);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
@ -2788,7 +2783,7 @@ bool TQuery_mask::data_handler(TMask_field& f, KEY k)
|
||||
if (f.empty())
|
||||
{
|
||||
if (codice_esercizio == 0)
|
||||
return error_box("E' necessario specificare almeno una data.");
|
||||
return error_box(TR("E' necessario specificare almeno una data."));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -2797,12 +2792,12 @@ bool TQuery_mask::data_handler(TMask_field& f, KEY k)
|
||||
if (codice_esercizio != 0)
|
||||
{
|
||||
if (esercizio != codice_esercizio)
|
||||
ok = error_box("La data deve appartenere all'esercizio %d", codice_esercizio);
|
||||
ok = error_box(FR("La data deve appartenere all'esercizio %d"), codice_esercizio);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (esercizio == 0)
|
||||
ok = error_box("La data deve appartenere ad un esercizio contabile");
|
||||
ok = error_box(TR("La data deve appartenere ad un esercizio contabile"));
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
@ -2867,23 +2862,8 @@ protected:
|
||||
virtual void on_firm_change();
|
||||
|
||||
public:
|
||||
void open_files(int logicnum, ...);
|
||||
};
|
||||
|
||||
void TMastrini_video::open_files(int logicnum, ...)
|
||||
{
|
||||
va_list marker;
|
||||
va_start(marker, logicnum);
|
||||
while (logicnum > 0)
|
||||
{
|
||||
if (_file.objptr(logicnum))
|
||||
NFCHECK("File gia' aperto: %d", logicnum);
|
||||
else
|
||||
_file.add(new TLocalisamfile(logicnum), logicnum);
|
||||
logicnum = va_arg(marker, int);
|
||||
}
|
||||
va_end(marker);
|
||||
}
|
||||
};
|
||||
|
||||
bool TMastrini_video::create()
|
||||
{
|
||||
@ -2968,7 +2948,7 @@ bool TMastrini_video::menu(MENU_TAG mt)
|
||||
int cg3600(int argc, char* argv[])
|
||||
{
|
||||
TMastrini_video mv;
|
||||
mv.run(argc, argv, "Mastrini");
|
||||
mv.run(argc, argv, TR("Mastrini"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
116
cg/cg3700.cpp
116
cg/cg3700.cpp
@ -44,9 +44,6 @@ enum tipo_st
|
||||
|
||||
class TLista_fatture : public TPrintapp
|
||||
{
|
||||
TLocalisamfile *_nditte; // File delle ditte
|
||||
TDecoder *_reg;
|
||||
TDecoder *_iva;
|
||||
TRelation* _rel; // Relazione principale
|
||||
int _cur1,
|
||||
_cur2,
|
||||
@ -120,11 +117,8 @@ inline TLista_fatture& app() { return (TLista_fatture&) main_app(); }
|
||||
int TLista_fatture::tiporeg(const TString& reg)
|
||||
{
|
||||
TString16 s; s.format("%4d%-3s",_date_from.year(),(const char*)reg);
|
||||
// _reg->put("CODTAB",s);
|
||||
// if (_reg->read() == NOERR)
|
||||
// return _reg->get_int("I0");
|
||||
// return 0;
|
||||
return atoi(_reg->decode(s));
|
||||
|
||||
return atoi(cache().get("REG", s).get("I0"));
|
||||
}
|
||||
|
||||
bool TLista_fatture::filter_func1(const TRelation *r)
|
||||
@ -184,9 +178,9 @@ bool TLista_fatture::date_handler(TMask_field& f, KEY key)
|
||||
if (key == K_ENTER && f.empty())
|
||||
{
|
||||
if (f.dlg() == FLD_DATE_FROM)
|
||||
return f.error_box("La data di inizio e' obbligatoria.");
|
||||
return f.error_box(TR("La data di inizio e' obbligatoria."));
|
||||
else
|
||||
return f.error_box("La data di fine e' obbligatoria.");
|
||||
return f.error_box(TR("La data di fine e' obbligatoria."));
|
||||
}
|
||||
|
||||
if ((key == K_TAB && f.focusdirty()) || key == K_ENTER)
|
||||
@ -198,9 +192,9 @@ bool TLista_fatture::date_handler(TMask_field& f, KEY key)
|
||||
if (a.ok() && da.ok()) // Solo se sono entrambi compilati
|
||||
{
|
||||
if (da > a)
|
||||
return f.error_box("La data di fine deve essere maggiore della data di inizio.");
|
||||
return f.error_box(TR("La data di fine deve essere maggiore della data di inizio."));
|
||||
if (da.year() != a.year())
|
||||
return f.error_box("Le date devono appartenere allo stesso anno.");
|
||||
return f.error_box(TR("Le date devono appartenere allo stesso anno."));
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
@ -227,11 +221,11 @@ bool TLista_fatture::mix_handler(TMask_field& f, KEY key)
|
||||
const long l1 = m.get_long(dlg1);
|
||||
const long l2 = m.get_long(dlg2);
|
||||
if (l1 != 0L && l2 != 0L && l1 < l2)
|
||||
return f.error_box("Intervallo clienti/fornitori errato.");
|
||||
return f.error_box(TR("Intervallo clienti/fornitori errato."));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
const TString msg(dlg1 == FLD_TO_REG ? "Intervallo registri errato." : "Intervallo causali errato.");
|
||||
const TString msg(dlg1 == FLD_TO_REG ? TR("Intervallo registri errato.") : TR("Intervallo causali errato."));
|
||||
const TString s1(m.get(dlg1));
|
||||
const TString s2(m.get(dlg2));
|
||||
if (s1.not_empty() && s2.not_empty() && s1 < s2)
|
||||
@ -369,13 +363,15 @@ void TLista_fatture::set_choice_limits(TMask& m)
|
||||
void TLista_fatture::build_ditte_sheet()
|
||||
{
|
||||
_ditte->destroy();
|
||||
for (_nditte->first(); _nditte->good(); _nditte->next())
|
||||
TLocalisamfile nditte(LF_NDITTE);
|
||||
|
||||
for (nditte.first(); nditte.good(); nditte.next())
|
||||
{
|
||||
TToken_string* d = new TToken_string(64);
|
||||
d->add(" ");
|
||||
const long n = _nditte->get_long(NDT_CODDITTA);
|
||||
const long n = nditte.get_long(NDT_CODDITTA);
|
||||
d->add(n);
|
||||
d->add(_nditte->get(NDT_RAGSOC));
|
||||
d->add(nditte.get(NDT_RAGSOC));
|
||||
|
||||
const bool unselectable = !prefix().exist(n);
|
||||
|
||||
@ -405,10 +401,10 @@ bool TLista_fatture::preprocess_page(int file, int counter)
|
||||
if (new_det || new_cr) // Stampa totali parziali
|
||||
{
|
||||
const bool is_cr = _tipo == costo_ricavo;
|
||||
TString256 s("TOTALE TIPO ");
|
||||
TString256 s(TR("TOTALE TIPO "));
|
||||
_pr.reset();
|
||||
_pr.set_style(boldstyle);
|
||||
s << (is_cr ? "COSTO/RICAVO " : "INDETRAIBILITA' ");
|
||||
s << (is_cr ? TR("COSTO/RICAVO ") : TR("INDETRAIBILITA' "));
|
||||
s << (is_cr ? _tipocrprec : _tipodetprec);
|
||||
_pr.put(s,42);
|
||||
if (_tp_doc != 0.0)
|
||||
@ -491,10 +487,10 @@ print_action TLista_fatture::postprocess_print(int file, int counter)
|
||||
if (_tipo != intra)
|
||||
{
|
||||
const bool is_cr = _tipo == costo_ricavo;
|
||||
TString256 s("TOTALE TIPO ");
|
||||
TString256 s(TR("TOTALE TIPO "));
|
||||
_pr.reset();
|
||||
_pr.set_style(boldstyle);
|
||||
s << (is_cr ? "COSTO/RICAVO " : "INDETRAIBILITA' ");
|
||||
s << (is_cr ? TR("COSTO/RICAVO ") : TR("INDETRAIBILITA' "));
|
||||
s << (is_cr ? _tipocrprec : _tipodetprec);
|
||||
_pr.put(s,42);
|
||||
if (_tp_doc != 0.0)
|
||||
@ -508,7 +504,7 @@ print_action TLista_fatture::postprocess_print(int file, int counter)
|
||||
p.print(_pr);
|
||||
p.print(_pr);
|
||||
_pr.set_style(boldstyle);
|
||||
_pr.put("TOTALE GENERALE :",42);
|
||||
_pr.put(TR("TOTALE GENERALE :"),42);
|
||||
if (_tot_doc != 0.0)
|
||||
_pr.put(real2string(_tot_doc),73);
|
||||
if (_tot_imp != 0.0)
|
||||
@ -528,10 +524,10 @@ print_action TLista_fatture::postprocess_print(int file, int counter)
|
||||
_pr.reset();
|
||||
for (int i=0; i<3; i++)
|
||||
p.print(_pr);
|
||||
_pr.put("Cod.@57gVENDITE@92gACQUISTI",1);
|
||||
_pr.put(FR("Cod.@57gVENDITE@92gACQUISTI"),1);
|
||||
p.print(_pr);
|
||||
_pr.reset();
|
||||
_pr.put("IVA Descrizione@45gImponibile@66gImposta@82gImponibile@101gImposta",1);
|
||||
_pr.put(FR("IVA Descrizione@45gImponibile@66gImposta@82gImponibile@101gImposta"),1);
|
||||
p.print(_pr);
|
||||
_pr.reset();
|
||||
p.print(_pr);
|
||||
@ -546,7 +542,7 @@ print_action TLista_fatture::postprocess_print(int file, int counter)
|
||||
if (cod == "~A19")
|
||||
{
|
||||
p.print(_pr);
|
||||
_pr.put("Totale ",1);
|
||||
_pr.put(TR("Totale "),1);
|
||||
if (tot1 != 0.0)
|
||||
_pr.put(real2string(tot1),40);
|
||||
if (tot2 != 0.0)
|
||||
@ -558,12 +554,12 @@ print_action TLista_fatture::postprocess_print(int file, int counter)
|
||||
p.print(_pr);
|
||||
_pr.reset();
|
||||
p.print(_pr);
|
||||
des = "Totale acquisti indeducibili per ART.19";
|
||||
des = TR("Totale acquisti indeducibili per ART.19");
|
||||
_pr.put(des,1);
|
||||
}
|
||||
else
|
||||
{
|
||||
des = _iva->decode(cod);
|
||||
des = cache().get("%IVA", cod).get("S0");
|
||||
_pr.put(cod,1);
|
||||
_pr.put(des,6);
|
||||
}
|
||||
@ -583,7 +579,7 @@ print_action TLista_fatture::postprocess_print(int file, int counter)
|
||||
_pr.reset();
|
||||
}
|
||||
p.print(_pr);
|
||||
_pr.put("Totale Generale IVA",1);
|
||||
_pr.put(TR("Totale Generale IVA"),1);
|
||||
if (tot1 != 0.0)
|
||||
_pr.put(real2string(tot1),40);
|
||||
if (tot2 != 0.0)
|
||||
@ -603,62 +599,58 @@ void TLista_fatture::set_the_header()
|
||||
const long firm = get_firm();
|
||||
|
||||
reset_header ();
|
||||
_nditte->zero();
|
||||
_nditte->put(NDT_CODDITTA, firm);
|
||||
_nditte->read();
|
||||
if (_nditte->bad())
|
||||
_nditte->zero();
|
||||
const TRectype & nditte = cache().get(LF_NDITTE, firm);
|
||||
|
||||
TDate today(TODAY);
|
||||
TString s(132), rw(132);
|
||||
TString16 s1,s2;
|
||||
s = _nditte->get(NDT_RAGSOC);
|
||||
s = nditte.get(NDT_RAGSOC);
|
||||
s1 = _date_from.string();
|
||||
s2 = _date_to.string();
|
||||
char c[2]={'N','D'};
|
||||
|
||||
set_header (soh++, "Ditta : %ld %s@100gData@106g%s @123gPag. @#",
|
||||
set_header (soh++, FR("Ditta : %ld %s@100gData@106g%s @123gPag. @#"),
|
||||
firm, (const char *)s, (const char *)today);
|
||||
|
||||
s.format("Dalla data %s Alla data %s",(const char*)s1,(const char*)s2);
|
||||
s.format(FR("Dalla data %s Alla data %s"),(const char*)s1,(const char*)s2);
|
||||
if (_tipo == indetraibile || _tipo == costo_ricavo)
|
||||
{
|
||||
s << "@45g Dal fornitore ";
|
||||
s << FR("@45g Dal fornitore ");
|
||||
if (_from_cf == 0L && _to_cf == 999999L)
|
||||
s << " Al fornitore";
|
||||
s << TR(" Al fornitore");
|
||||
else
|
||||
{
|
||||
s << _from_cf;
|
||||
s << " Al fornitore ";
|
||||
s << TR(" Al fornitore ");
|
||||
s << _to_cf;
|
||||
}
|
||||
s << "@94g Dal registro ";
|
||||
s << FR("@94g Dal registro ");
|
||||
if (_from_reg.empty() && _to_reg == "~~~")
|
||||
s << " Al registro";
|
||||
s << TR(" Al registro");
|
||||
else
|
||||
{
|
||||
s << _from_reg;
|
||||
s << " Al registro ";
|
||||
s << TR(" Al registro ");
|
||||
s << _to_reg;
|
||||
}
|
||||
if (_tipo == costo_ricavo)
|
||||
{
|
||||
set_header(soh++,"@50gLISTA FATTURE PER TIPO COSTO/RICAVO");
|
||||
set_header(soh++,FR("@50gLISTA FATTURE PER TIPO COSTO/RICAVO"));
|
||||
strncpy(c,"CR",2);
|
||||
}
|
||||
else
|
||||
set_header(soh++,"@50gLISTA FATTURE CON IVA INDETRAIBILE");
|
||||
set_header(soh++,FR("@50gLISTA FATTURE CON IVA INDETRAIBILE"));
|
||||
}
|
||||
else
|
||||
{
|
||||
set_header(soh++,"@50gLISTA FATTURE INTRACOMUNITARIE");
|
||||
s << "@45g Dal c. causale ";
|
||||
set_header(soh++,FR("@50gLISTA FATTURE INTRACOMUNITARIE"));
|
||||
s << FR("@45g Dal c. causale ");
|
||||
if (_from_cau.empty() && _to_cau == "~~~")
|
||||
s << " Al c. causale";
|
||||
s << TR(" Al c. causale");
|
||||
else
|
||||
{
|
||||
s << _from_cau;
|
||||
s << " Al codice causale ";
|
||||
s << TR(" Al codice causale ");
|
||||
s << _to_cau;
|
||||
}
|
||||
}
|
||||
@ -667,9 +659,9 @@ void TLista_fatture::set_the_header()
|
||||
|
||||
rw.fill('-');
|
||||
set_header(soh++, (const char *) rw);
|
||||
set_header(soh++, "@12gNum@21gDocumento@63gCod.@68gM@70gTipo@106gCod@110g%c@128gNum.",c[0]);
|
||||
set_header(soh++, "Data reg.@12gprot.@18gData@30gNumero@37gCodice@44gRagione sociale@63gReg.@68gL@70gDoc."
|
||||
"@75gTot.documento@94gImponibile@106gIva@110g%c@118gImposta@128gReg.",c[1]);
|
||||
set_header(soh++, FR("@12gNum@21gDocumento@63gCod.@68gM@70gTipo@106gCod@110g%c@128gNum."),c[0]);
|
||||
set_header(soh++, FR("Data reg.@12gprot.@18gData@30gNumero@37gCodice@44gRagione sociale@63gReg.@68gL@70gDoc."
|
||||
"@75gTot.documento@94gImponibile@106gIva@110g%c@118gImposta@128gReg."),c[1]);
|
||||
set_header(soh++, (const char *) rw);
|
||||
|
||||
set_header(soh,"");
|
||||
@ -717,12 +709,12 @@ bool TLista_fatture::set_print(int m)
|
||||
switch (_tipo)
|
||||
{
|
||||
case costo_ricavo:
|
||||
msk.set_caption("Lista fatture per costo/ricavo");
|
||||
msk.field(FLD_FROM_FOR).set_prompt("Da cli./for. ");
|
||||
msk.field(FLD_TO_FOR).set_prompt("A cli./for. ");
|
||||
msk.set_caption(TR("Lista fatture per costo/ricavo"));
|
||||
msk.field(FLD_FROM_FOR).set_prompt(TR("Da cli./for. "));
|
||||
msk.field(FLD_TO_FOR).set_prompt(TR("A cli./for. "));
|
||||
break;
|
||||
case intra:
|
||||
msk.set_caption("Lista fatture intracomunitarie");
|
||||
msk.set_caption(TR("Lista fatture intracomunitarie"));
|
||||
msk.hide(-1);
|
||||
msk.show(-2);
|
||||
break;
|
||||
@ -821,11 +813,10 @@ bool TLista_fatture::user_create()
|
||||
break;
|
||||
}
|
||||
}
|
||||
_ditte = new TArray_sheet(-1, -1, -4, -4, "Selezione Ditte",
|
||||
"@1|Cod.@5R|Ragione Sociale@50");
|
||||
_nditte = new TLocalisamfile(LF_NDITTE);
|
||||
_reg = new TDecoder("REG", "I0");
|
||||
_iva = new TDecoder("%IVA");
|
||||
_ditte = new TArray_sheet(-1, -1, -4, -4, TR("Selezione Ditte"),
|
||||
HR("@1|Cod.@5R|Ragione Sociale@50"));
|
||||
open_files(LF_NDITTE, LF_TAB, LF_TABCOM, 0);
|
||||
|
||||
_rel = new TRelation(LF_RMOVIVA);
|
||||
_rel->add(LF_MOV,"NUMREG==NUMREG");
|
||||
_rel->add(LF_CAUSALI,"CODCAUS==CODCAUS",1,LF_MOV); // Relazione
|
||||
@ -842,11 +833,8 @@ bool TLista_fatture::user_create()
|
||||
|
||||
bool TLista_fatture::user_destroy()
|
||||
{
|
||||
if (_nditte) delete _nditte;
|
||||
if (_ditte) delete _ditte;
|
||||
if (_rel) delete _rel;
|
||||
if (_reg) delete _reg;
|
||||
if (_iva) delete _iva;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -857,7 +845,7 @@ bool TLista_fatture::user_destroy()
|
||||
int cg3700(int argc, char* argv[])
|
||||
{
|
||||
TLista_fatture lf;
|
||||
lf.run(argc, argv, "Lista fatture");
|
||||
lf.run(argc, argv, TR("Lista fatture"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1,4 +0,0 @@
|
||||
#include <default.url>
|
||||
#include <mainmenu.url>
|
||||
|
||||
|
@ -1,4 +0,0 @@
|
||||
#include <default.url>
|
||||
|
||||
#include <mainmenu.url>
|
||||
|
@ -1,3 +0,0 @@
|
||||
#include <default.url>
|
||||
|
||||
#include <mainmenu.url>
|
@ -1,4 +0,0 @@
|
||||
#include <default.url>
|
||||
#include <mainmenu.url>
|
||||
|
||||
|
@ -1,4 +0,0 @@
|
||||
#include <default.url>
|
||||
#include <mainmenu.url>
|
||||
|
||||
|
@ -1,4 +0,0 @@
|
||||
#include <default.url>
|
||||
#include <mainmenu.url>
|
||||
|
||||
|
BIN
cg/trasfer.xls
BIN
cg/trasfer.xls
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user