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:
alex 2003-03-14 15:13:36 +00:00
parent 86b1a89d8b
commit e82c0ef7b3
31 changed files with 1098 additions and 1920 deletions

View File

@ -1,4 +0,0 @@
#include <default.url>
MENU TASK_MENUBAR
SUBMENU MENU_FILE "~File"

View File

@ -1,3 +0,0 @@
#include <default.url>
#include <mainmenu.url>

View File

@ -1,3 +0,0 @@
#include <default.url>
#include <mainmenu.url>

View File

@ -19,7 +19,8 @@ HIDDEN bool filtra_mov(const TRelation* r)
{ {
const TRectype& mov = r->curr(); const TRectype& mov = r->curr();
const int annoiva = mov.get_int(MOV_ANNOIVA); 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(); TAgg_nprot& a = app();
return a.anno() == annoiva && a.reg() == reg; return a.anno() == annoiva && a.reg() == reg;
} }

View File

@ -2,13 +2,11 @@
class TAgg_nprot : public TSkeleton_application class TAgg_nprot : public TSkeleton_application
{ {
int _anno;
TString16 _reg; TString16 _reg;
int _anno;
protected:
virtual void main_loop();
public: public:
virtual void main_loop();
int anno() const { return _anno; } int anno() const { return _anno; }
const TString& reg() const { return _reg; } const TString& reg() const { return _reg; }

View File

@ -12,22 +12,17 @@ HIDDEN TAgg_codatt& app() { return (TAgg_codatt&) main_app(); }
bool TAgg_codatt::create() bool TAgg_codatt::create()
{ {
TApplication::create(); open_files(LF_TAB, 0);
_tab = new TLocalisamfile(LF_TAB); return TSkeleton_application::create();
dispatch_e_menu (BAR_ITEM(1));
return TRUE;
} }
bool TAgg_codatt::destroy() bool TAgg_codatt::destroy()
{ {
delete _tab; return TSkeleton_application::destroy();
return TApplication::destroy();
} }
bool TAgg_codatt::menu(MENU_TAG m) void TAgg_codatt::main_loop()
{ {
TProgind* pri; TProgind* pri;
TMask msk("cg1300c"); TMask msk("cg1300c");
@ -64,7 +59,6 @@ bool TAgg_codatt::menu(MENU_TAG m)
delete pri; delete pri;
message_box(TR("Aggiornamento codice attivita' completato")); message_box(TR("Aggiornamento codice attivita' completato"));
} }
return FALSE;
} }
void TAgg_codatt::cancella_rec() void TAgg_codatt::cancella_rec()

View File

@ -7,9 +7,8 @@
#include <urldefid.h> #include <urldefid.h>
#include <config.h> #include <config.h>
class TAgg_codatt : public TApplication class TAgg_codatt : public TSkeleton_application
{ {
TLocalisamfile* _tab;
TString16 _da, _a; TString16 _da, _a;
int _anno; int _anno;
bool _pass; bool _pass;
@ -17,11 +16,10 @@ class TAgg_codatt : public TApplication
public: public:
virtual bool create(); virtual bool create();
virtual bool destroy(); virtual bool destroy();
virtual bool menu(MENU_TAG m); virtual void main_loop();
void cancella_rec(); void cancella_rec();
void aggiorna_att(const char*); void aggiorna_att(const char*);
TAgg_codatt() : _da(""), _a(""), _anno(0) {}; TAgg_codatt() : _da(""), _a(""), _anno(0) {};
virtual ~TAgg_codatt() {}; virtual ~TAgg_codatt() {};
}; };

View File

@ -5,13 +5,11 @@
#include <progind.h> #include <progind.h>
#include <urldefid.h> #include <urldefid.h>
class TAgg_datacomp : public TApplication class TAgg_datacomp : public TSkeleton_application
{ {
void aggiorna_datacomp(); void aggiorna_datacomp();
public: public:
virtual bool create(); virtual void main_loop();
virtual bool destroy();
virtual bool menu(MENU_TAG m);
TAgg_datacomp() {}; TAgg_datacomp() {};
virtual ~TAgg_datacomp() {}; virtual ~TAgg_datacomp() {};

View File

@ -28,7 +28,7 @@ const char* const APPNAME = TR("Righe prima nota errate");
class TElimina_zoppi : public TSkeleton_application class TElimina_zoppi : public TSkeleton_application
{ {
TArray _files; // TArray _files;
TArray _decoders; TArray _decoders;
protected: protected:
@ -44,6 +44,7 @@ protected:
static bool select_handler(TMask_field& f, KEY k); static bool select_handler(TMask_field& f, KEY k);
protected: protected:
const char* decode(int num, const char* key, const char* field); const char* decode(int num, const char* key, const char* field);
virtual void main_loop(); virtual void main_loop();
}; };

View File

@ -3577,27 +3577,23 @@ TDate TStampa_bilanci::UltimaData(int g, int c, long s, int anno)
// Guy: E tu chi sei? // Guy: E tu chi sei?
const char* TStampa_bilanci::DescrizioneConto(int g, int c, long s, char tipocf) const char* TStampa_bilanci::DescrizioneConto(int g, int c, long s, char tipocf)
{ {
TString80 ragsoc; static TString80 ragsoc;
const char* desc = NULL; const char* desc = NULL;
TLocalisamfile pconti(LF_PCON);
TLocalisamfile clifo (LF_CLIFO);
pconti.zero(); TString80 key; key << g;
pconti.put(PCN_GRUPPO, g);
if (c != 0) if (c != 0)
pconti.put(PCN_CONTO, c); key << "|" << c ;
if (s != 0) if (s != 0)
pconti.put(PCN_SOTTOCONTO, s); key << "|" << s;
pconti.read(); const TRectype & pconti = cache().get(LF_PCON, key);
if (pconti.good()) if (!pconti.empty())
_tmp = pconti.get(PCN_DESCR); _tmp = pconti.get(PCN_DESCR);
else 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 key.format("%c|%ld", tipocf, s);
clifo.zero(); const TRectype & clifo = cache().get(LF_CLIFO, key);
clifo.put(CLI_CODCF, s);
clifo.put(CLI_TIPOCF,tipocf); if (!clifo.empty())
if (clifo.read() == NOERR)
{ {
char tipoa = clifo.get_char("TIPOAPER"); char tipoa = clifo.get_char("TIPOAPER");
if (tipoa == 'F') //persona fisica if (tipoa == 'F') //persona fisica
@ -3617,8 +3613,10 @@ const char* TStampa_bilanci::DescrizioneConto(int g, int c, long s, char tipocf)
} }
else else
_tmp = ""; _tmp = "";
} }
return _tmp; return _tmp;
} }
bool TStampa_bilanci::user_create() bool TStampa_bilanci::user_create()

View File

@ -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"

View File

@ -9,8 +9,6 @@
#define extern #define extern
#endif #endif
extern TString256 TMP;
#ifdef __MAIN__ #ifdef __MAIN__
#undef extern #undef extern
#endif #endif

View File

@ -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"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -7,6 +7,7 @@
#include <printapp.h> #include <printapp.h>
#include <progind.h> #include <progind.h>
#include <sort.h> #include <sort.h>
#include <recarray.h>
#include <tabutil.h> #include <tabutil.h>
#include <utility.h> #include <utility.h>
#include <validate.h> #include <validate.h>
@ -54,9 +55,6 @@ class TStampa_allegati : public TPrintapp
TSort* _sort; TSort* _sort;
TLocalisamfile * _nditte, * _alleg, * _clifo;
TTable * _tpd, * _attiv;
TDate _data_stampa; TDate _data_stampa;
int _anno_stampa; int _anno_stampa;
stampe _tipo_stampa; stampe _tipo_stampa;
@ -109,8 +107,8 @@ public:
void calcola(); void calcola();
bool da_sommare(); bool da_sommare(const TRectype & alleg);
bool buono(); bool buono(const TRectype & alleg);
bool lo_devo_stampare(char tipo, long codice); bool lo_devo_stampare(char tipo, long codice);
@ -132,7 +130,6 @@ public:
TPrintrow * get_record_fine_volume (bool) ; TPrintrow * get_record_fine_volume (bool) ;
long cerca_codice_all(char tipo, long codcf) ; long cerca_codice_all(char tipo, long codcf) ;
const char * decodifica_desc_att (const TString & codatt);
bool corrispettivo (const char * tipodoc); bool corrispettivo (const char * tipodoc);
TStampa_allegati () {} TStampa_allegati () {}
@ -169,59 +166,29 @@ const char* filler (int size)
long TStampa_allegati::cerca_codice_all(char tipo, long codcf) long TStampa_allegati::cerca_codice_all(char tipo, long codcf)
{ {
TLocalisamfile& clifo = *_clifo; TString16 key;
clifo.zero(); key.format("%c|%ld", tipo, codcf);
clifo.put (CLI_TIPOCF, tipo);
clifo.put (CLI_CODCF, codcf);
clifo.read();
if (clifo.good()) const TRectype & clifo = cache().get(LF_CLIFO, key);
{
long codice_all = clifo.get_long (CLI_CODALLEG); if (!clifo.empty())
return codice_all; return clifo.get_long (CLI_CODALLEG);
}
return 0L; 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) bool TStampa_allegati::corrispettivo (const char * tipodoc)
{ {
TTable& tpd = * _tpd;
TString natura_doc; TString natura_doc;
bool corrisp; bool corrisp;
tpd.zero(); const TRectype & tpd = cache().get("%TPD", tipodoc);
tpd.put ("CODTAB", tipodoc);
tpd.read();
if (tpd.bad())
tpd.zero();
natura_doc = tpd.get("I0"); natura_doc = tpd.get("I0");
corrisp = tpd.get_bool ("B0"); corrisp = tpd.get_bool ("B0");
if ((natura_doc == "1") || (natura_doc == "9")) return corrisp && (natura_doc == "1" || natura_doc == "9");
if (corrisp)
return TRUE;
return FALSE;
} }
// -------------------------------------------------------------------- // --------------------------------------------------------------------
@ -253,11 +220,7 @@ void TStampa_allegati::init_sort()
bool TStampa_allegati::user_create() bool TStampa_allegati::user_create()
{ {
_nditte = new TLocalisamfile (LF_NDITTE); open_files(LF_TABCOM, LF_NDITTE, LF_ALLEG, LF_CLIFO, 0);
_alleg = new TLocalisamfile (LF_ALLEG);
_clifo = new TLocalisamfile (LF_CLIFO);
_tpd = new TTable ("%TPD");
_attiv = new TTable ("%AIS");
_RecordSort = new SortRecord; _RecordSort = new SortRecord;
_SortRecLen = _RecordSort->RecSize(); _SortRecLen = _RecordSort->RecSize();
@ -272,11 +235,6 @@ bool TStampa_allegati::user_create()
bool TStampa_allegati::user_destroy() bool TStampa_allegati::user_destroy()
{ {
delete _alleg;
delete _clifo;
delete _nditte;
delete _tpd; delete _attiv;
// delete _sort; // Adesso e' nella postprocess_print() // delete _sort; // Adesso e' nella postprocess_print()
delete _RecordSort; delete _RecordSort;
delete _recb; delete _recb;
@ -442,7 +400,9 @@ void TStampa_allegati::pulisci_alleg (int anno_dic)
{ {
prn.addstatus(1); prn.addstatus(1);
const bool immesso = curr.get_bool (ALL_IMMESSO); const bool immesso = curr.get_bool (ALL_IMMESSO);
if (immesso) if (immesso)
continue; continue;
@ -473,7 +433,6 @@ void TStampa_allegati::ricalcola(int anno_dic)
char tipo; char tipo;
long codcf; long codcf;
int ndoc = 0; int ndoc = 0;
bool immesso;
bool vendite; bool vendite;
real imponibile; real imponibile;
real imposta; real imposta;
@ -511,7 +470,7 @@ void TStampa_allegati::ricalcola(int anno_dic)
const long items = cur.items(); const long items = cur.items();
cur.freeze(); 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); TProgind pi(items, str, FALSE, TRUE);
const TRectype& mov_curr = cur.curr(LF_MOV); 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_ANNO, anno_dic);
all_curr.put (ALL_TIPOCF, tipo); all_curr.put (ALL_TIPOCF, tipo);
all_curr.put (ALL_CODCF, codcf); all_curr.put (ALL_CODCF, codcf);
all_curr.put (ALL_CODATT, reg.get("S8"));
datareg = mov_curr.get_date (MOV_DATAREG); datareg = mov_curr.get_date (MOV_DATAREG);
datadoc = mov_curr.get_date (MOV_DATADOC); datadoc = mov_curr.get_date (MOV_DATADOC);
@ -590,21 +550,27 @@ void TStampa_allegati::ricalcola(int anno_dic)
ndoc = 0; ndoc = 0;
const TRectype& rmi = cur.curr(LF_RMOVIVA); const TRectype& rmi = cur.curr(LF_RMOVIVA);
bool all_to_save = FALSE;
while (cur.next_match (LF_RMOVIVA)) while (cur.next_match (LF_RMOVIVA))
{ {
immesso = all.get_bool (ALL_IMMESSO);
if (immesso) continue; // scarta i record immessi
int err = all.read(); 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.zero();
all_curr.put (ALL_ANNO, anno_dic); all_curr.put (ALL_ANNO, anno_dic);
all_curr.put (ALL_TIPOCF, tipo); all_curr.put (ALL_TIPOCF, tipo);
all_curr.put (ALL_CODCF, codcf); all_curr.put (ALL_CODCF, codcf);
all_curr.put (ALL_CODATT, reg.get("S8"));
err = all.write(); err = all.write();
} }
all_to_save = TRUE;
imponibile = rmi.get_real (RMI_IMPONIBILE); imponibile = rmi.get_real (RMI_IMPONIBILE);
imposta = rmi.get_real (RMI_IMPOSTA); imposta = rmi.get_real (RMI_IMPOSTA);
@ -659,6 +625,7 @@ void TStampa_allegati::ricalcola(int anno_dic)
} }
} // while next_match() } // while next_match()
if (all_to_save)
all.rewrite(); all.rewrite();
} // for cur=0; ++cur } // for cur=0; ++cur
cur.freeze(FALSE); cur.freeze(FALSE);
@ -666,12 +633,15 @@ void TStampa_allegati::ricalcola(int anno_dic)
bool TStampa_allegati::lo_devo_stampare(char tipo, long codcf) bool TStampa_allegati::lo_devo_stampare(char tipo, long codcf)
{ {
_clifo->curr().zero(); TString16 key ;
_clifo->curr().put (CLI_TIPOCF, tipo);
_clifo->curr().put (CLI_CODCF, codcf); key.format("%c|%ld", tipo, codcf);
if (_clifo->read() == NOERR)
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) ) if ((codice_all == 0) || (codice_all == 3) || (codice_all == 4) )
return TRUE; return TRUE;
else 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; TString tipocf2;
long codcf2; long codcf2;
int anno2; int anno2;
TString codatt_dett; TString codatt_dett;
TString comodo; TString comodo;
tipocf2 = _alleg->curr().get (ALL_TIPOCF); tipocf2 = alleg.get (ALL_TIPOCF);
codcf2 = _alleg->curr().get_long (ALL_CODCF); codcf2 = alleg.get_long (ALL_CODCF);
anno2 = _alleg->curr().get_int(ALL_ANNO); anno2 = alleg.get_int(ALL_ANNO);
codatt_dett = _alleg->curr().get (ALL_CODATT); codatt_dett = alleg.get (ALL_CODATT);
if (_RecordSort->codcf_dett() == -1) if (_RecordSort->codcf_dett() == -1)
{ {
_RecordSort->compila(_alleg); _RecordSort->compila(alleg);
return TRUE; // vuol dire che e' il primo => va messo nella struttura return TRUE; // vuol dire che e' il primo => va messo nella struttura
} }
@ -727,14 +697,12 @@ bool TStampa_allegati::da_sommare()
// //
// QUI COMPILO IL RECORD B PER I FORNITORI // 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 (!alleg.empty())
if (curr.empty()) {
return FALSE; char tipo = alleg.get_char(ALL_TIPOCF);
long codcf = alleg.get_long(ALL_CODCF);
char tipo = curr.get_char(ALL_TIPOCF);
long codcf = curr.get_long(ALL_CODCF);
// //
// Se stampo i clienti scarto chi non ha codcf = "C" // Se stampo i clienti scarto chi non ha codcf = "C"
@ -749,7 +717,7 @@ bool TStampa_allegati::buono()
{ {
if (tipo == 'B') if (tipo == 'B')
{ {
_recb->compila(_alleg); _recb->compila(alleg);
return FALSE; return FALSE;
} }
} }
@ -757,14 +725,14 @@ bool TStampa_allegati::buono()
if (_ricerca_att != "") if (_ricerca_att != "")
{ {
// strcpy (_RecordSort->Strutt()->codatt_dett, _alleg->curr().get (ALL_CODATT)); // strcpy (_RecordSort->Strutt()->codatt_dett, _alleg->curr().get (ALL_CODATT));
const TString& dep = curr.get (ALL_CODATT); const TString& dep = alleg.get (ALL_CODATT);
if (_ricerca_att != dep) if (_ricerca_att != dep)
return FALSE; return FALSE;
} }
if (_anno_stampa > 0) if (_anno_stampa > 0)
{ {
int anno = curr.get_int(ALL_ANNO); const int anno = alleg.get_int(ALL_ANNO);
if (anno != _anno_stampa) if (anno != _anno_stampa)
return FALSE; return FALSE;
} }
@ -775,6 +743,7 @@ bool TStampa_allegati::buono()
if (!lo_devo_stampare(tipo, codcf)) if (!lo_devo_stampare(tipo, codcf))
return FALSE; return FALSE;
}
return TRUE; return TRUE;
} }
@ -799,50 +768,58 @@ void TStampa_allegati::calcola ()
_num_cf = 0; // contatore C/F _num_cf = 0; // contatore C/F
_nditte->zero(); TRelation relditte(LF_NDITTE);
_nditte->put(NDT_CODDITTA, ditta_da); TRectype from(relditte.curr());
for (int err = _nditte->read(_isgteq); err == NOERR; err = _nditte->next()) 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); const long nuova_ditta = ditta.get_long(NDT_CODDITTA);
if (nuova_ditta > ditta_a)
break;
if (!prefix().exist(nuova_ditta)) // TBC *** fv mi sembrava ci volesse
continue;
if (prefix().exist(nuova_ditta)) // TBC *** fv mi sembrava ci volesse
{
set_firm(nuova_ditta); set_firm(nuova_ditta);
if (_ricalcola) if (_ricalcola)
ricalcola(_anno_stampa); ricalcola(_anno_stampa);
// Legge i dati anagrafici del dichiarante // Legge i dati anagrafici del dichiarante
_RecordSort->fill_dati_anag_dic(_nditte); _RecordSort->fill_dati_anag_dic(ditta);
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
// ELABORAZIONE ALLEGATI // ELABORAZIONE ALLEGATI
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
_alleg->zero(); TRelation relalleg(LF_ALLEG);
_alleg->put (ALL_ANNO, _anno_stampa); TRectype from(relalleg.curr());
_alleg->put (ALL_CODCF, _tipoa_richiesto);
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 != "") if (_ricerca_att != "")
_alleg->curr().put (ALL_CODATT, _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 (_distingui_att) alleg.freeze();
_alleg->setkey (1);
else
_alleg->setkey (2); // non distinguo le attivita
for (int err = _alleg->read(_isgteq); err == NOERR; err = _alleg->next()) TProgind prnd(items, TR("Elaborazione allegati in corso..."), FALSE, TRUE);
for (alleg = 0L; alleg.pos() < items; ++alleg)
{ {
prnd.addstatus(1); prnd.addstatus(1);
if (buono()) if (buono(recalleg))
{ {
if (da_sommare ()) if (da_sommare (recalleg))
_RecordSort->somma(_alleg->curr(), _tipo_stampa); // somma nella struttura _RecordSort->somma(recalleg, _tipo_stampa); // somma nella struttura
else else
{ {
if (!_RecordSort->importo().is_zero()) if (!_RecordSort->importo().is_zero())
@ -851,19 +828,11 @@ void TStampa_allegati::calcola ()
_num_cf += 1; // incremento contatore numero di C/F _num_cf += 1; // incremento contatore numero di C/F
} }
_t->incrementa_totali(_RecordSort->Strutt(), _tipo_stampa); _t->incrementa_totali(_RecordSort->Strutt(), _tipo_stampa);
_RecordSort->compila(_alleg->curr()); _RecordSort->compila(recalleg);
} }
} // if buono() } // 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();
} // for su nditte } // for su nditte
// //
@ -1163,7 +1132,7 @@ void TStampa_allegati::set_rows(int counter)
bool TStampa_allegati::preprocess_page(int file,int counter) bool TStampa_allegati::preprocess_page(int file,int counter)
{ {
static long codditta_curr; 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; struct alleg_sort * buff = (struct alleg_sort *) _buff;
int pagina_corrente = printer().getcurrentpage(); int pagina_corrente = printer().getcurrentpage();
@ -1409,25 +1378,6 @@ bool TStampa_allegati::intesta()
return TRUE; 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 // STAMPA SU DISCO
@ -1972,14 +1922,14 @@ void TStampa_allegati::scrivi_coda_elenco_fornitori()
segno[5] = ' '; segno[5] = ' ';
if (_t->TotE8esc() < 0) if (_t->TotE8esc() < 0)
segno[8] = '-'; segno[6] = '-';
else else
segno[8] = ' '; segno[6] = ' ';
if (_t->TotE8esp() < 0) if (_t->TotE8esp() < 0)
segno[8] = '-'; segno[7] = '-';
else else
segno[8] = ' '; segno[7] = ' ';
if (_t->TotTotRigac() < 0) if (_t->TotTotRigac() < 0)
segno[8] = '-'; segno[8] = '-';
@ -2228,8 +2178,7 @@ TPrintrow * TStampa_allegati::get_record_fine_volume (bool finito)
int cg3300(int argc, char* argv[]) int cg3300(int argc, char* argv[])
{ {
TStampa_allegati a; TStampa_allegati a;
a.run(argc, argv, "Stampa Allegati"); a.run(argc, argv, TR("Stampa Allegati"));
return 0; return 0;
} }

View File

@ -117,24 +117,15 @@ struct alleg_sort {
}; };
class SortRecord { class SortRecord {
TLocalisamfile * _clifo;
TLocalisamfile * _comuni;
TLocalisamfile * _anagfis;
TLocalisamfile * _anaggiu;
TLocalisamfile * _anag;
TTable * _attiv;
TTable * _tpd;
struct alleg_sort * _all; struct alleg_sort * _all;
protected: protected:
TRectype& look_com(const char *); const TRectype & look_com(const char * cod);
long cerca_codice_all(char tipo, long codcf) ;
const char * decodifica_desc_att (const TString & codatt); const char * decodifica_desc_att (const TString & codatt);
bool corrispettivo (const char * tipodoc);
public: public:
void azzera_struttura(); void azzera_struttura();
bool fill_dati_anag_dic (TLocalisamfile *); bool fill_dati_anag_dic (const TRectype & ditta);
const char * fill_dati_dettaglio (const char * tipo, long codcf); const char * fill_dati_dettaglio (const char * tipo, long codcf);
const char * Strutt_str() { return (const char *) _all; } const char * Strutt_str() { return (const char *) _all; }
struct alleg_sort * Strutt() { return _all; } struct alleg_sort * Strutt() { return _all; }

View File

@ -143,12 +143,12 @@ BEGIN
VALIDATE F_A_DITTA>=F_DA_DITTA VALIDATE F_A_DITTA>=F_DA_DITTA
END END
BUTTON DLG_OK 9 2 BUTTON DLG_OK 10 2
BEGIN BEGIN
PROMPT -12 -1 "" PROMPT -12 -1 ""
END END
BUTTON DLG_CANCEL 9 2 BUTTON DLG_CANCEL 10 2
BEGIN BEGIN
PROMPT -22 -1 "" PROMPT -22 -1 ""
END END

View File

@ -3,9 +3,10 @@
// classi di supporto per cg3300_application // classi di supporto per cg3300_application
// //
#include <isam.h> #include <stdlib.h>
#include <diction.h>
#include <recarray.h>
#include <tabutil.h> #include <tabutil.h>
#include <strings.h>
#include <scanner.h> #include <scanner.h>
#include <comuni.h> #include <comuni.h>
@ -18,12 +19,6 @@
#include "cg3300.h" #include "cg3300.h"
const int CODTABLEN = 15;
#define MAXSTR 128
static char __tmp[MAXSTR];
static TFixed_string tmp(__tmp, MAXSTR);
// //
// SortRecord // SortRecord
// //
@ -31,93 +26,27 @@ static TFixed_string tmp(__tmp, MAXSTR);
SortRecord::SortRecord() SortRecord::SortRecord()
{ {
_all = new struct alleg_sort; _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(); azzera_struttura();
} }
SortRecord::~SortRecord() SortRecord::~SortRecord()
{ {
delete _clifo; delete _comuni; delete _attiv; delete _tpd;
delete _anagfis; delete _anaggiu; delete _anag;
delete _all; 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) const char* SortRecord::decodifica_desc_att (const TString& codatt)
{ {
TTable& attivita = * _attiv; return cache().get("%AIS", codatt, "S0");
attivita.zero();
attivita.put ("CODTAB", codatt);
attivita.read();
if (attivita.bad())
attivita.zero();
tmp = attivita.get ("S0");
return __tmp;
} }
bool SortRecord::corrispettivo (const char * tipodoc) const TRectype & SortRecord::look_com(const char * cod)
{ {
TTable& tpd = * _tpd; TString16 key;
TString natura_doc;
bool corrisp;
tpd.zero(); key.format("|%s", cod);
tpd.put ("CODTAB", tipodoc);
tpd.read();
if (tpd.bad())
tpd.zero();
natura_doc = tpd.get("I0"); return cache().get(LF_COMUNI, key);
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();
} }
// //
@ -130,54 +59,37 @@ TRectype& SortRecord::look_com (const char * cod)
// //
const char * SortRecord::fill_dati_dettaglio (const char * tipocf, long codcf) const char * SortRecord::fill_dati_dettaglio (const char * tipocf, long codcf)
{ {
TLocalisamfile& clifo = *_clifo; TString16 key;
static char _rag[51];
TString tipop, cog, nom, rag;
TString indcf, comcf;
TString stato, paiva;
clifo.zero(); key.format("%s|%ld", tipocf, codcf);
clifo.put (CLI_TIPOCF, tipocf); const TRectype & clifo = cache().get(LF_CLIFO, key);
clifo.put (CLI_CODCF, codcf);
clifo.read();
if ((clifo.good())) if (!clifo.empty())
{ {
tipop = clifo.get (CLI_TIPOPERS); TString indcf;
rag = clifo.get (CLI_RAGSOC);
indcf = clifo.curr().get (CLI_INDCF); indcf = clifo.get (CLI_INDCF);
indcf << ", " << clifo.curr().get (CLI_CIVCF); indcf << ", " << clifo.get (CLI_CIVCF);
comcf = clifo.curr().get (CLI_COMCF); strcpy (_all->via_dett, indcf);
strcpy (_all->paiva_dett, clifo.get (CLI_PAIV));
strcpy (_all->statopaiva_dett, clifo.get (CLI_STATOPAIV));
const TRectype & dep = look_com ((const char *)clifo.get (CLI_COMCF));
TRectype dep = look_com ((const char *)comcf);
strcpy (_all->comune_dett, dep.get(COM_DENCOM)); strcpy (_all->comune_dett, dep.get(COM_DENCOM));
strcpy (_all->prov_dett, dep.get(COM_PROVCOM)); strcpy (_all->prov_dett, dep.get(COM_PROVCOM));
strcpy (_all->via_dett , indcf); const TString & rag = clifo.get (CLI_RAGSOC);
if (clifo.get (CLI_TIPOPERS) == "F")
paiva = clifo.curr().get (CLI_PAIV); {
stato = clifo.curr().get (CLI_STATOPAIV); strcpy (_all->cognome_dett, rag.left(30));
strcpy (_all->nome_dett, rag.mid(30));
strcpy (_all->paiva_dett , paiva); strcpy (_all->ragsoc_dett, "");
strcpy (_all->statopaiva_dett , stato); }
else
strcpy (_all->ragsoc_dett, rag); strcpy (_all->ragsoc_dett, rag);
if (tipop == "F") return rag;
{
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 (_rag, (const char*) rag);
return _rag;
} }
return NULL; return NULL;
} }
@ -331,97 +243,72 @@ void SortRecord::compila(const TRectype& alleg)
fill_dati_dettaglio (tipoa, codcf); 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; long codanagr;
TLocalisamfile& anaggiu = *_anaggiu;
TLocalisamfile& anag = *_anag;
TString codanagr;
TString tipoa; TString tipoa;
TString comodo; TString str;
_all->codditta_dic = nditte->get_long(NDT_CODDITTA); _all->codditta_dic = ditta.get_long(NDT_CODDITTA);
comodo = nditte->get(NDT_CODATTPREV); str = ditta.get(NDT_CODATTPREV);
strcpy (_all->codatt_dic, comodo); str = decodifica_desc_att (str);
if (comodo.not_empty()) if (str.not_empty())
comodo = decodifica_desc_att (comodo); strcpy (_all->codatt_dic, str);
if (comodo.not_empty()) strcpy (_all->attivita_dic, str);
strcpy (_all->attivita_dic, comodo);
else
strcpy (_all->attivita_dic, "\0");
codanagr = nditte->curr().get(NDT_CODANAGR); codanagr = ditta.get_long(NDT_CODANAGR);
tipoa = nditte->curr().get(NDT_TIPOA); tipoa = ditta.get(NDT_TIPOA);
strcpy (_all->tipopers_dic, tipoa); strcpy (_all->tipopers_dic, tipoa);
anag.setkey(1); TString16 key;
anag.curr().zero();
anag.curr().put (ANA_TIPOA, tipoa); key.format("%s|%ld", (const char *) tipoa, codanagr);
anag.curr().put (ANA_CODANAGR, codanagr);
if (anag.read() == NOERR) const TRectype & anag = cache().get(LF_ANAG, key);
{
strcpy (_all->paiva_dic, anag.curr().get (ANA_PAIV)); strcpy (_all->paiva_dic, anag.get (ANA_PAIV));
strcpy (_all->ragsoc_dic , anag.curr().get(ANA_RAGSOC)); strcpy (_all->ragsoc_dic , anag.get(ANA_RAGSOC));
strcpy (_all->comunefis_dic, anag.curr().get(ANA_COMRF)); strcpy (_all->comunefis_dic, anag.get(ANA_COMRF));
}
else
{
strcpy (_all->paiva_dic, "\0");
strcpy (_all->ragsoc_dic , "\0");
strcpy (_all->comunefis_dic, "\0");
}
if (_all->comunefis_dic[0] == '\0') 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->comunefis_dic , dep.get(COM_DENCOM));
strcpy (_all->provfis_dic , dep.get(COM_PROVCOM)); strcpy (_all->provfis_dic , dep.get(COM_PROVCOM));
comodo = anag.curr().get(ANA_INDRES); str = anag.get(ANA_INDRES);
comodo.rtrim(); str << " " << anag.get(ANA_CIVRES);
comodo << " " << anag.curr().get (ANA_CIVRES); strcpy (_all->viafis_dic , (const char *) str);
strcpy (_all->viafis_dic , (const char *) comodo);
} }
else 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->comunefis_dic, dep.get(COM_DENCOM));
strcpy (_all->provfis_dic , dep.get(COM_PROVCOM)); strcpy (_all->provfis_dic , dep.get(COM_PROVCOM));
comodo = anag.curr().get(ANA_INDRF); str = anag.get(ANA_INDRF);
comodo.rtrim(); str << " " << anag.get (ANA_CIVRF);
comodo << " " << anag.curr().get (ANA_CIVRF); strcpy (_all->viafis_dic, str);
strcpy (_all->viafis_dic, comodo);
} }
key.format("%ld", codanagr);
if (tipoa[0] == 'F') 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; const TRectype &anagfis = cache().get(LF_ANAGFIS, key);
cognome = comodo.sub(0,29);
cognome.trim();
strcpy (_all->cognome_dic, cognome);
comodo = _all->ragsoc_dic; _all->datana_dic = anagfis.get_date(ANF_DATANASC);
nome = comodo.mid(30); strcpy (_all->sesso_dic, anagfis.get(ANF_SESSO));
nome.trim();
strcpy (_all->nome_dic, nome);
anagfis.setkey(1); const TRectype & dep = look_com (anagfis.get(ANF_COMNASC));
anagfis.curr().zero();
anagfis.curr().put (ANF_CODANAGR, codanagr);
anagfis.read();
_all->datana_dic = anagfis.curr().get_date(ANF_DATANASC);
strcpy (_all->sesso_dic , anagfis.curr().get(ANF_SESSO));
TRectype dep = look_com (anagfis.curr().get(ANF_COMNASC));
strcpy (_all->comunena_dic, dep.get(COM_DENCOM)); strcpy (_all->comunena_dic, dep.get(COM_DENCOM));
strcpy (_all->provna_dic, dep.get(COM_PROVCOM)); strcpy (_all->provna_dic, dep.get(COM_PROVCOM));
@ -430,13 +317,9 @@ bool SortRecord::fill_dati_anag_dic (TLocalisamfile * nditte)
if (tipoa[0] == 'G') if (tipoa[0] == 'G')
{ {
// Leggo natura giuridica dal anagrafe giuridiche // Leggo natura giuridica dal anagrafe giuridiche
anaggiu.setkey(1); const TRectype &anaggiu = cache().get(LF_ANAGGIU, key);
anaggiu.curr().zero();
anaggiu.curr().put (ANG_CODANAGR, codanagr); _all->natgiu_dic = anaggiu.get_int(ANG_NATGIU);
if (anaggiu.read() == NOERR)
_all->natgiu_dic = anaggiu.curr().get_int (ANG_NATGIU);
else
_all->natgiu_dic = 0;
} }
return TRUE; return TRUE;
@ -540,7 +423,7 @@ void Array_desc_campi::leggi_modulo (const char * file, const char *modulo)
} }
} }
else 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) void Array_desc_campi::add(int r, const char* f)

View File

@ -53,9 +53,6 @@ HIDDEN enum tipo_sospensione { nessuna, normale, vol_affari, liquidazione };
class TContoOccas : public TBill class TContoOccas : public TBill
{ {
TString16 _occfpi; TString16 _occfpi;
TDecoder _clifoccas;
TDecoder _occas;
TAssoc_array _desc; TAssoc_array _desc;
public: public:
@ -69,8 +66,6 @@ public:
}; };
TContoOccas::TContoOccas() 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) 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()) if (_occfpi.not_empty())
{ {
TString16 code; code << tipo() << '|' << sottoconto(); 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) if (really_occas)
return _occas.decode(_occfpi); return cache().get(LF_OCCAS, _occfpi, "RAGSOC");
} }
TString16 code; code.format("%c%03d%03d%06ld", TString16 code; code.format("%c%03d%03d%06ld",
@ -167,12 +162,9 @@ public:
TString16 _provfis, _cap, _occfpi; TString16 _provfis, _cap, _occfpi;
TString80 _cofi; TString80 _cofi;
TLocalisamfile *_clifo,*_pconti,*_nditte,*_anag;
TLocalisamfile* _attiv; // da togliere in futuro (?)
TTable *_tabreg; TTable *_tabreg;
TDecoder *_causali, *_tabiva; // Guy: saggia aggiunta
public: public:
virtual void preprocess_header(); virtual void preprocess_header();
@ -217,7 +209,7 @@ public:
int set_totali_pagina(int r); int set_totali_pagina(int r);
void get_dati_ditta (); 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 TRectype& look_com (const char* cod, const char* stato = "");
const TString& get_codiva_des(const char* codiva); const TString& get_codiva_des(const char* codiva);
void update_totals (char sezione, real& importo); 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); 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 () void TStampa_giornale::get_dati_ditta ()
@ -296,30 +288,25 @@ void TStampa_giornale::get_dati_ditta ()
TString16 codanagr; TString16 codanagr;
char tipoa; char tipoa;
_nditte->zero(); const TRectype & nditte = cache().get(LF_NDITTE, get_firm());
_nditte->put(NDT_CODDITTA, get_firm());
_nditte->read();
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); TToken_string key ;
codanagr = _nditte->curr().get(NDT_CODANAGR);
tipoa = _nditte->curr().get_char(NDT_TIPOA);
_anag->setkey(1); key.add(tipoa);
_anag->zero(); key.add(codanagr);
_anag->put (ANA_TIPOA, tipoa); const TRectype & anag = cache().get(LF_ANAG, key);
_anag->put (ANA_CODANAGR, codanagr);
_anag->read();
if (_anag->bad()) _anag->zero();
_cofi = _anag->get(ANA_COFI); _cofi = anag.get(ANA_COFI);
_paiva = _anag->get(ANA_PAIV); _paiva = anag.get(ANA_PAIV);
_comunefis = _anag->get(ANA_COMRF); _comunefis = anag.get(ANA_COMRF);
_cap = _anag->get(ANA_CAPRF); _cap = anag.get(ANA_CAPRF);
if (_comunefis.empty()) if (_comunefis.empty())
_comunefis = _anag->get(ANF_COMRES); _comunefis = anag.get(ANF_COMRES);
const TRectype& dep = look_com(_comunefis); const TRectype& dep = look_com(_comunefis);
_comunefis = dep.get(COM_DENCOM); _comunefis = dep.get(COM_DENCOM);
@ -329,15 +316,15 @@ void TStampa_giornale::get_dati_ditta ()
if (_comunefis.empty()) if (_comunefis.empty())
{ {
_viafis = _anag->get(ANA_INDRF); _viafis = anag.get(ANA_INDRF);
_viafis.rtrim(); _viafis.rtrim();
_viafis << ' ' << _anag->curr().get (ANA_CIVRF); _viafis << " " << anag.get (ANA_CIVRF);
} }
else else
{ {
_viafis = _anag->get(ANA_INDRES); _viafis = anag.get(ANA_INDRES);
_viafis.rtrim(); _viafis.rtrim();
_viafis << ' ' << _anag->get (ANA_CIVRES); _viafis << " " << anag.get (ANA_CIVRES);
} }
} }
@ -352,15 +339,10 @@ bool TStampa_giornale::user_create()
{ {
_ae = 0; _ae = 0;
_ae_solare = 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"); _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 = new TRelation (LF_MOV);
_rel->add (LF_RMOV, "NUMREG==NUMREG"); _rel->add (LF_RMOV, "NUMREG==NUMREG");
@ -386,14 +368,7 @@ bool TStampa_giornale::user_destroy()
delete _RecPartoDa; delete _RecPartoDa;
delete _RecArrivoA; delete _RecArrivoA;
delete _clifo; delete _pconti;
delete _nditte; delete _anag;
delete _tabreg; delete _tabreg;
delete _tabiva;
delete _causali;
delete _attiv; // da togliere in futuro
return TRUE; return TRUE;
} }
@ -402,13 +377,10 @@ void TStampa_giornale::aggiorna_mov()
TLocalisamfile& mov = _cur->file(LF_MOV); TLocalisamfile& mov = _cur->file(LF_MOV);
long nprog = _nprog_da + 1; long nprog = _nprog_da + 1;
// const TRectype da(*_RecPartoDa);
// const TRectype a(*_RecArrivoA);
// _cur->setregion(da, a);
_cur->setregion(*_RecPartoDa, *_RecArrivoA); _cur->setregion(*_RecPartoDa, *_RecArrivoA);
const long items = _cur->items(); 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)) 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 SHIFT = 15;
const int STACC = 51 + SHIFT; const int STACC = 51 + SHIFT;
// r = righeiva == 0 ? 1 : righeiva + 1;
// Se e' l'unico totale lo stampo anche se e' zero // Se e' l'unico totale lo stampo anche se e' zero
if (competenza_ec() || (_tot_avere_gg != ZERO || _tot_dare_gg != ZERO)) if (competenza_ec() || (_tot_avere_gg != ZERO || _tot_dare_gg != ZERO))
{ {
TString80 td; real2currency(td, _tot_dare_gg); TString80 td; real2currency(td, _tot_dare_gg);
TString80 ta; real2currency(ta, _tot_avere_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, _stampa_width == 132 ? SCRITTA : DARE198-STACC,
data.string(), data.string(),
_stampa_width == 132 ? TOTDARE132 : DARE198-2, _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 tdp; real2currency(tdp, _tot_dare_gg_ap);
TString80 tap; real2currency(tap, _tot_avere_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, _stampa_width == 132 ? SCRITTA : DARE198-STACC,
data.string(), data.string(),
_stampa_width == 132 ? TOTDARE132 : DARE198-2, _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() 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; const int ultima_fatta = _pagine_contate;
aggiorna_mov(); aggiorna_mov();
@ -518,10 +488,6 @@ void TStampa_giornale::preprocess_footer()
// 2. Sono sull'ultima riga // 2. Sono sull'ultima riga
// //
/*
const bool riporta = _forza_ariportare ||
(!_gia_settato_ariportare && _cur->pos() < _cur->items()-1 );
*/
const int riporta = _devo_riportare; const int riporta = _devo_riportare;
if (riporta) if (riporta)
@ -533,8 +499,7 @@ void TStampa_giornale::preprocess_footer()
riga.format ("@b@%dg%s@%dg%c %s @%dg%c @%dg%s", riga.format ("@b@%dg%s@%dg%c %s @%dg%c @%dg%s",
_stampa_width == 132 ? SCRITTA : DARE198-STUMB, _stampa_width == 132 ? SCRITTA : DARE198-STUMB,
// (_nuovo_mese && !_forza_ariportare) ? "Totale progressivi generali " : "A riportare ", TR("A riportare "),
"A riportare ",
_stampa_width == 132 ? TOTDARE132 : DARE198, _stampa_width == 132 ? TOTDARE132 : DARE198,
'D', 'D',
(const char *) dts, (const char *) dts,
@ -578,7 +543,7 @@ int TStampa_giornale::set_totali_pagina(int righe)
real2currency(progr_dare, _tot_dare_progr); real2currency(progr_dare, _tot_dare_progr);
real2currency(progr_avere, _tot_avere_progr); real2currency(progr_avere, _tot_avere_progr);
riga = ""; 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 ? SCRITTA : DARE198-STUMB,
_stampa_width == 132 ? TOTDARE132 : DARE198-2, _stampa_width == 132 ? TOTDARE132 : DARE198-2,
'D', 'D',
@ -593,7 +558,7 @@ int TStampa_giornale::set_totali_pagina(int righe)
if (ap) 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 ? SCRITTA : DARE198-STUMB,
_stampa_width == 132 ? TOTDARE132 : DARE198-2, _stampa_width == 132 ? TOTDARE132 : DARE198-2,
'D', 'D',
@ -612,7 +577,7 @@ int TStampa_giornale::set_totali_pagina(int righe)
real2currency(dts, _tot_dare_generale); real2currency(dts, _tot_dare_generale);
real2currency(ats, _tot_avere_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 ? SCRITTA : DARE198-STUMB,
_stampa_width == 132 ? TOTDARE132 : DARE198-2, _stampa_width == 132 ? TOTDARE132 : DARE198-2,
'D', 'D',
@ -643,7 +608,7 @@ int TStampa_giornale::set_totali_pagina(int righe)
// "Se il mese e' finito devo scrivere Totale progressivi generali // "Se il mese e' finito devo scrivere Totale progressivi generali
// invece che A riportare" // 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 ? SCRITTA : DARE198-STUMB,
_stampa_width == 132 ? TOTDARE132 : DARE198-2, _stampa_width == 132 ? TOTDARE132 : DARE198-2,
'D', 'D',
@ -668,22 +633,22 @@ int TStampa_giornale::stampa_intestazione_ditta()
riga.fill('-'); riga.fill('-');
set_header(r, riga); 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(), get_firm(),
(const char *)_ragsoc, (const char *)_ragsoc,
(const char *)_viafis, (const char *)_cap, (const char *)_viafis, (const char *)_cap,
(const char *)_comunefis, (const char *)_provfis); (const char *)_comunefis, (const char *)_provfis);
if (_stampa_definitiva) 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, (const char*)_paiva, (const char*)_cofi,
_stampa_width == 132 ? 102 : 168 _stampa_width == 132 ? 102 : 168
); );
else 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, (const char*)_paiva, (const char*)_cofi,
_stampa_width == 132 ? 102 : 168, _stampa_width == 132 ? 102 : 168,
"LIBRO DI PROVA", FR("LIBRO DI PROVA"),
_stampa_width == 132 ? 117 : 183 _stampa_width == 132 ? 117 : 183
); );
@ -705,9 +670,9 @@ int TStampa_giornale::set_headers()
r += 2; r += 2;
if (_stampa_definitiva) 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 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, (const char *) _reg_cod, (const char *) _reg_descr,
_stampa_width == 132 ? 69 : 135, _stampa_width == 132 ? 69 : 135,
(const char *) data_da, (const char *) data_a, (const char *) data_da, (const char *) data_a,
@ -719,33 +684,32 @@ int TStampa_giornale::set_headers()
set_header(r++, riga); set_header(r++, riga);
if (_libro_cronologico) if (_libro_cronologico)
set_header(r, "@59gCodice Conto"); set_header(r, FR("@59gCodice Conto"));
if (!_stampa_definitiva) { if (!_stampa_definitiva) {
if (_stampa_width == 132) { if (_stampa_width == 132) {
set_header(r++, "@131gS"); set_header(r++, "@131gS");
set_header(r, "@1gN.riga"); set_header(r, FR("@1gN.riga"));
} }
else { else {
set_header(r++, "@197gS"); set_header(r++, "@197gS");
set_header(r, "@1gN.riga"); set_header(r, FR("@1gN.riga"));
} }
} }
else else
if (_libro_cronologico) r++; // NON LASCIARE RIGHE IN BIANCO!! if (_libro_cronologico) r++; // NON LASCIARE RIGHE IN BIANCO!!
// set_header(r, "@6gCod.Causale@34gDescrizione operazione"); set_header(r, FR("@8gDescrizione operazione@36gCausale"));
set_header(r, "@8gDescrizione operazione@36gCausale");
if (_libro_cronologico) if (_libro_cronologico)
// POSCONTO = 74; // POSCONTO = 74;
set_header(r, "@74gGeneralita' cliente/fornitore"); set_header(r, FR("@74gGeneralita' cliente/fornitore"));
else else
set_header(r, "@59gCodice Conto"); set_header(r, FR("@59gCodice Conto"));
if (_stampa_width == 132) if (_stampa_width == 132)
set_header(r, "@120gImporto"); set_header(r, FR("@120gImporto"));
else else
set_header(r, "@161gDare @184gAvere"); set_header(r, FR("@161gDare @184gAvere"));
if (!_stampa_definitiva) if (!_stampa_definitiva)
set_header(r, _stampa_width == 132 ? "@131gB" : "@197gB"); set_header(r, _stampa_width == 132 ? "@131gB" : "@197gB");
@ -793,7 +757,7 @@ void TStampa_giornale::preprocess_header()
TString80 avere; real2currency(avere, riporto_avere); TString80 avere; real2currency(avere, riporto_avere);
TString256 riporto; 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 ? SCRITTA : DARE198-11,
_stampa_width == 132 ? TOTDARE132 : DARE198-2, _stampa_width == 132 ? TOTDARE132 : DARE198-2,
_stampa_width == 132 ? 'D' : ' ', _stampa_width == 132 ? 'D' : ' ',
@ -841,23 +805,6 @@ bool TStampa_giornale::preprocess_print(int file, int counter)
return TRUE; 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 int TStampa_giornale::righe_rimaste() const
{ {
const TPrinter& p = printer(); 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(); const TPrinter& p = printer();
TString256 rigas; TString256 rigas;
// int rrr = start_riga + righe_iva_settate + 1;
int r = righe_da_stampare + 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; int r_l = p.rows_left() - righe_da_stampare;
if (r_l < 0) 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) if (r_l > 0)
{ {
rigas.fill('=', _stampa_width); rigas.fill('=', _stampa_width);
// rigas.cut(_stampa_width+1);
// set_row(rrr++, "%s", (const char*) rigas);
set_row(r++, "%s", (const char*) rigas); set_row(r++, "%s", (const char*) rigas);
int j=0; int j=0;
// Calcola una specie di coefficiente angolare // Calcola una specie di coefficiente angolare
@ -1084,22 +1020,22 @@ void TStampa_giornale::set_rows (int file, int counter)
if (_stampa_definitiva) if (_stampa_definitiva)
{ {
set_row(r,"Operazione n. @b%-7ld@r", _nprog_mov); set_row(r,FR("Operazione n. @b%-7ld@r"), _nprog_mov);
set_row(r," del @b%s@r", (const char*)datareg_str); // XX/XX/XXXX set_row(r,FR(" 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,FR(" doc. n. @b%-7s@r"),(const char*)numdoc);
set_row(r," del @b%s@r %-50s",(const char*)datadoc_str, set_row(r,FR(" del @b%s@r %-50s"),(const char*)datadoc_str,
(const char*)mov_descr); (const char*)mov_descr);
} }
else else
{ {
set_row(r,"Operazione n. @b%-7ld@r", numreg); set_row(r,FR("Operazione n. @b%-7ld@r"), numreg);
set_row(r," del @b%s@r", (const char*) datareg_str); set_row(r,FR(" del @b%s@r"), (const char*) datareg_str);
set_row(r," doc. n. @b%-7s@r", (const char*) numdoc); set_row(r,FR(" 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(" del @b%s@r %-50s"), (const char*)datadoc_str,(const char*)mov_descr);
} }
if (_annoEsMov != _ae) if (_annoEsMov != _ae)
set_row(r," Comp. %04d", _annoEsMov); set_row(r,FR(" Comp. %04d"), _annoEsMov);
if (_MovGiaStampato && !_stampa_definitiva) if (_MovGiaStampato && !_stampa_definitiva)
{ {
@ -1111,9 +1047,9 @@ void TStampa_giornale::set_rows (int file, int counter)
if (caus.not_empty()) if (caus.not_empty())
{ {
const char* desc_caus = get_descr_caus(caus); 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()) 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; 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) const TString& TStampa_giornale::get_codiva_des(const char* codiva)
{ {
return _tabiva->decode(codiva); return cache().get("%IVA", codiva).get("S0");
} }
// NB // NB
@ -1337,12 +1273,9 @@ int TStampa_giornale::setta_righe_iva()
r = j+1; r = j+1;
TString80 impon_str; real2currency(impon_str, riga._imponibile); TString80 impon_str; real2currency(impon_str, riga._imponibile);
TString80 impos_str; real2currency(impos_str, riga._imposta); TString80 impos_str; real2currency(impos_str, riga._imposta);
// set_row(r, " Imponibile@15g%15r", &riga._imponibile); set_row(r, FR(" Imponibile@15g%15s"), (const char*)impon_str);
// set_row(r, "@31gImposta@39g%15r", &riga._imposta); set_row(r, FR("@35gImposta@43g%15s"), (const char*)impos_str);
set_row(r, " Imponibile@15g%15s", (const char*)impon_str); set_row(r, FR("@64gCod.Iva %3s"), (const char*)riga._codiva);
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);
const TString& codiva_des = get_codiva_des(riga._codiva); const TString& codiva_des = get_codiva_des(riga._codiva);
const int tipoatt = riga._tipoatt; const int tipoatt = riga._tipoatt;
if (_stampa_width == 132) if (_stampa_width == 132)
@ -1355,16 +1288,16 @@ int TStampa_giornale::setta_righe_iva()
switch (riga._tipodet) switch (riga._tipodet)
{ {
case 0 : case 0 :
rig << "Detraibile "; rig << TR("Detraibile ");
break; break;
case 1 : case 1 :
rig << "Indetraib. su op.es. "; rig << TR("Indetraib. su op.es. ");
break; break;
case 3 : case 3 :
rig << "Passaggi interni "; rig << TR("Passaggi interni ");
break; break;
case 9 : case 9 :
rig << "Indetraibile art.19 "; rig << TR("Indetraibile art.19 ");
break; break;
default: break; default: break;
} }
@ -1372,14 +1305,14 @@ int TStampa_giornale::setta_righe_iva()
const int meseliq = _cur->file(LF_MOV).get_int(MOV_MESELIQ); const int meseliq = _cur->file(LF_MOV).get_int(MOV_MESELIQ);
if (meseliq > 0) if (meseliq > 0)
set_row(r, " Mese liq. %2d", meseliq); set_row(r, FR(" Mese liq. %2d"), meseliq);
if (tipoatt != 0) if (tipoatt != 0)
{ {
TRegistro reg(_reg, _anno_iva); TRegistro reg(_reg, _anno_iva);
const bool att_mista_ev = reg.attivita_mista(); const bool att_mista_ev = reg.attivita_mista();
if (att_mista_ev) if (att_mista_ev)
set_row(r, " Tipo attivita' %d", tipoatt); set_row(r, FR(" Tipo attivita' %d"), tipoatt);
} }
} }
_iva_array.destroy(); _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 TString16 codvali = current_cursor()->file(LF_MOV).get(MOV_CODVALI);
const TCurrency cur(corrval, 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) if (_stampa_width == 132)
set_row(r,"@89gCorr.in valuta @109g%20v", &cur); set_row(r,FR("@89gCorr.in valuta @109g%20v"), &cur);
else else
set_row(r,"@119gCorr.in valuta @171g%20v", &cur); set_row(r,FR("@119gCorr.in valuta @171g%20v"), &cur);
} }
return r; return r;
} }
@ -1410,27 +1343,20 @@ int TStampa_giornale::setta_righe_indirizzo(char tipocf, long codcf,int rdes)
{ {
TString16 prov, comcf, capcf, civcf, statocf; TString16 prov, comcf, capcf, civcf, statocf;
TString80 viacf, comune; TString80 viacf, comune;
bool really_occas = FALSE;
char tipoa; char tipoa;
long codanagr; long codanagr;
char riga[256]; char riga[256];
int r = rdes; int r = rdes;
_clifo->zero(); TToken_string key;
_clifo->put(CLI_CODCF, codcf); key.add(tipocf);
_clifo->put(CLI_TIPOCF, 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() && clifo.get_bool(CLI_OCCAS)) // => e' un occasionale...
if (_occfpi.not_empty() && really_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); viacf = occ.get(OCC_INDIR);
civcf = occ.get(OCC_CIV); civcf = occ.get(OCC_CIV);
@ -1439,22 +1365,20 @@ int TStampa_giornale::setta_righe_indirizzo(char tipocf, long codcf,int rdes)
} }
else else
{ {
// E' possibile cio' ? viacf = clifo.get(CLI_INDCF);
if (!clifo_ok) return r; civcf = clifo.get(CLI_CIVCF);
comcf = clifo.get(CLI_COMCF);
viacf = _clifo->get(CLI_INDCF); capcf = clifo.get(CLI_CAPCF);
civcf = _clifo->get(CLI_CIVCF); statocf = clifo.get(CLI_STATOCF);
comcf = _clifo->get(CLI_COMCF); tipoa = clifo.get_char(CLI_TIPOAPER);
capcf = _clifo->get(CLI_CAPCF); codanagr = clifo.get_long(CLI_CODANAGPER);
statocf = _clifo->get(CLI_STATOCF);
tipoa = _clifo->get_char(CLI_TIPOAPER);
codanagr = _clifo->get_long(CLI_CODANAGPER);
} }
const TRectype& rec = look_com (comcf, statocf); const TRectype& rec = look_com (comcf, statocf);
comune = rec.get(COM_DENCOM); comune = rec.get(COM_DENCOM);
prov = rec.get(COM_PROVCOM); 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()) if (viacf.not_empty())
{ {
@ -1483,12 +1407,12 @@ int TStampa_giornale::setta_righe_indirizzo(char tipocf, long codcf,int rdes)
TString80 comna; TString80 comna;
TString16 datana, codcomna, provna, capna, statona; TString16 datana, codcomna, provna, capna, statona;
datana = _clifo->get("DATANASC"); datana = clifo.get("DATANASC");
if (datana.not_empty()) if (datana.not_empty())
{ {
codcomna = _clifo->get("COMNASC"); codcomna = clifo.get("COMNASC");
statona = _clifo->get("STATONASC"); statona = clifo.get("STATONASC");
const TRectype& dep = look_com (codcomna, statona); const TRectype& dep = look_com (codcomna, statona);
comna = dep.get(COM_DENCOM); comna = dep.get(COM_DENCOM);
@ -1521,8 +1445,6 @@ void TStampa_giornale::aggiorna_tabreg(int partito_da, int stampate)
if (_tabreg->good()) 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 ("I1", (long)_pagina_da + stampate); // pagine stampate
_tabreg->put ("I6", _nprog_mov); // ultimo numero di riga _tabreg->put ("I6", _nprog_mov); // ultimo numero di riga
_tabreg->put ("R1", _tot_dare_generale); _tabreg->put ("R1", _tot_dare_generale);
@ -1556,7 +1478,7 @@ bool TStampa_giornale::controlla_mov_aep()
const TRecnotype items = _cur->items(); const TRecnotype items = _cur->items();
_cur->freeze(); _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; bool gia_stampati = TRUE;
for (*_cur = 0L ; _cur->pos() < items; ++(*_cur)) for (*_cur = 0L ; _cur->pos() < items; ++(*_cur))
@ -1567,9 +1489,9 @@ bool TStampa_giornale::controlla_mov_aep()
} }
_cur->freeze(FALSE); _cur->freeze(FALSE);
if (!gia_stampati) 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" "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; 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_stampate = _tabreg->get_int("I1");
_pagine_numerate = _tabreg->get_int("I2"); _pagine_numerate = _tabreg->get_int("I2");
_stampa_num_pag = _tabreg->get_bool("S11"); _stampa_num_pag = _tabreg->get_bool("S11");
// _stampa_ok = _tabreg->get_int("I8");
_nprog_da = _tabreg->get_long ("I6"); _nprog_da = _tabreg->get_long ("I6");
_tot_dare = _tabreg->get_real ("R1"); _tot_dare = _tabreg->get_real ("R1");
_tot_avere = _tabreg->get_real ("R2"); _tot_avere = _tabreg->get_real ("R2");
@ -1627,7 +1548,7 @@ bool TStampa_giornale::data_a_hndl (TMask_field& f, KEY k)
TEsercizi_contabili esc; TEsercizi_contabili esc;
if (esc.date2esc(data_a) <= 0) 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_solare = data_a.year();
app()._ae = esc.date2esc(data_a); 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 (dtda.not_empty())
{ {
if (data_da.year() != data_a.year()) 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) 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 } // if K_ENTER
@ -1671,7 +1592,7 @@ bool TStampa_giornale::data_da_hndl(TMask_field& f, KEY k)
return TRUE; return TRUE;
if (data_da.year() != data_a.year()) 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) 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 // se la stampa e' di prova DALLA_DATA e' obbligatoria
if (!definitiva && !data_da.ok()) 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) 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; return TRUE;
} }
@ -1718,29 +1639,11 @@ bool TStampa_giornale::mask_a_cod_reg (TMask_field& f, KEY k)
} }
const TString16 reg_cod(f.get()); 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");
}
bool reg_ok = a.leggi_tabreg(reg_cod, a._ae_solare); bool reg_ok = a.leggi_tabreg(reg_cod, a._ae_solare);
// Output da qui della descrizione del registro e dell'anno // Output da qui della descrizione del registro e dell'anno
m.set(REG_DESC, a._reg_descr); m.set(REG_DESC, a._reg_descr);
m.set(ANNO_ESER, a._ae_solare); 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);
*/
} }
return TRUE; return TRUE;
} }
@ -1776,7 +1679,7 @@ bool TStampa_giornale::mask_b_warning (TMask_field& f, KEY k)
{ {
if (k == K_SPACE) 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; gia_detto = TRUE;
return TRUE; return TRUE;
} }
@ -1865,7 +1768,7 @@ bool TStampa_giornale::init_cursor()
if (_cur->items() == 0L) if (_cur->items() == 0L)
{ {
_cur->setfilter(""); _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; return TRUE;
@ -1955,7 +1858,6 @@ bool TStampa_giornale::set_print(int)
int cg3400 (int argc, char * argv[]) int cg3400 (int argc, char * argv[])
{ {
TStampa_giornale app; TStampa_giornale app;
app.run(argc, argv, "Stampa libro giornale"); app.run(argc, argv, TR("Stampa libro giornale"));
return TRUE; return TRUE;
} }

View File

@ -58,11 +58,8 @@ BEGIN
OUTPUT ANNO_ESER CODTAB[1,4] OUTPUT ANNO_ESER CODTAB[1,4]
OUTPUT CODREG CODTAB[5,7] OUTPUT CODREG CODTAB[5,7]
OUTPUT REG_DESC S0 OUTPUT REG_DESC S0
// OUTPUT PAGINA_DA I1
// OUTPUT DATA_DA D0
// OUTPUT DATA_A D1
CHECKTYPE REQUIRED CHECKTYPE REQUIRED
WARNING "Registro inesistente" WARNING "Registro assente"
// VALIDATE ZEROFILL_FUNC 3 // VALIDATE ZEROFILL_FUNC 3
FLAGS "UZ" FLAGS "UZ"
END END

View File

@ -43,7 +43,6 @@ class TStampa_riepilogo : public TPrintapp
{ {
TProgind * _prog; TProgind * _prog;
TSaldi_list* _lista; TSaldi_list* _lista;
TLocalisamfile* _com, * _pcn, * _clifo, * _saldi, * _nditte,* _anag;
TIsamtempfile * _tmp_saldi; TIsamtempfile * _tmp_saldi;
tipo _tp; tipo _tp;
real _prg_dare,_prg_avere,_saldo_dare,_saldo_avere,_prg_dare_tot,_prg_avere_tot,_saldo_tot; 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; cp=-1;
_udata_max = 0l; _udata_max = 0l;
for (_pcn->first(); !_pcn->eof(); _pcn->next()) TLocalisamfile pcn(LF_PCON);
for (pcn.first(); !pcn.eof(); pcn.next())
{ {
_prog->addstatus(1); _prog->addstatus(1);
g = _pcn->get_int (PCN_GRUPPO); g = pcn.get_int (PCN_GRUPPO);
c = _pcn->get_int (PCN_CONTO); c = pcn.get_int (PCN_CONTO);
s = _pcn->get_long(PCN_SOTTOCONTO); s = pcn.get_long(PCN_SOTTOCONTO);
tipo_conto = _pcn->get_char(PCN_TMCF); tipo_conto = pcn.get_char(PCN_TMCF);
TConto conto (g,c,s,tipo_conto); TConto conto (g,c,s,tipo_conto);
@ -130,12 +131,10 @@ bool TStampa_riepilogo::riepilogo()
_tmp_saldi->put(SLD_PAVERE,prg_conto_avere); _tmp_saldi->put(SLD_PAVERE,prg_conto_avere);
if (saldo_conto > 0.00) //va stampato in Dare 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_PDAREPRO,saldo_conto); // W96SALDI del 10-06-96
//_tmp_saldi->put(SLD_PDARESCA,saldo_conto);
else else
{ {
saldo_conto = saldo_conto * (-1.00); saldo_conto = saldo_conto * (-1.00);
_tmp_saldi->put(SLD_PAVEREPRO,saldo_conto); // W96SALDI del 10-06-96 _tmp_saldi->put(SLD_PAVEREPRO,saldo_conto); // W96SALDI del 10-06-96
//_tmp_saldi->put(SLD_PAVERESCA,saldo_conto);
} }
_tmp_saldi->write(); _tmp_saldi->write();
esiste_conto = TRUE; 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 if ( (tipo_conto == 'C') || (tipo_conto == 'F') ) //si tratta di un conto cliente/fornitore
{ {
_udata_max = 0l; _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); esiste_sc = ricerca_cf(conto,indbil,prg_conto_dare,prg_conto_avere);
if (esiste_sc) if (esiste_sc)
{ {
gp = conto.gruppo(); gp = conto.gruppo();
cp = conto.conto(); cp = conto.conto();
} }
TRecnotype recnum = _pcn->recno(); TRecnotype recnum = pcn.recno();
_pcn->next(); pcn.next();
if (_pcn->eof()) if (pcn.eof())
{ {
saldo_conto = prg_conto_dare - prg_conto_avere; saldo_conto = prg_conto_dare - prg_conto_avere;
prg_gruppo_dare += prg_conto_dare; prg_gruppo_dare += prg_conto_dare;
@ -237,14 +236,14 @@ bool TStampa_riepilogo::riepilogo()
_tmp_saldi->write(); _tmp_saldi->write();
} }
} }
_pcn->readat(recnum); pcn.readat(recnum);
continue; continue;
} }
} }
if (conto.conto() == 0) 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 if ( (conto.conto() == 0) || (conto.sottoconto() == 0) ) //e' un gruppo o un conto
{ {
@ -299,9 +298,9 @@ bool TStampa_riepilogo::riepilogo()
cp = conto.conto(); cp = conto.conto();
} }
TRecnotype recnum = _pcn->recno(); TRecnotype recnum = pcn.recno();
_pcn->next(); pcn.next();
if (_pcn->eof()) if (pcn.eof())
{ {
saldo_conto = prg_conto_dare - prg_conto_avere; saldo_conto = prg_conto_dare - prg_conto_avere;
prg_gruppo_dare += prg_conto_dare; prg_gruppo_dare += prg_conto_dare;
@ -352,7 +351,7 @@ bool TStampa_riepilogo::riepilogo()
_tmp_saldi->write(); _tmp_saldi->write();
} }
} }
_pcn->readat(recnum); pcn.readat(recnum);
} }
return TRUE; return TRUE;
} }
@ -727,7 +726,7 @@ void TStampa_riepilogo::setta_riga_conto()
if (_scelta == 1) if (_scelta == 1)
{ {
set_row(r++,"%s",(const char*)riga); 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); set_row(r,"@27g%.25s@r",(const char*)_descrconto);
} }
@ -754,7 +753,7 @@ void TStampa_riepilogo::setta_riga_gruppo()
if (_scelta == 2) if (_scelta == 2)
if (_tp == fine) r = 3; if (_tp == fine) r = 3;
else r = 2; 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,"@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++,"@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); set_row(r++,"%s",(const char*)riga);
@ -769,7 +768,7 @@ void TStampa_riepilogo::setta_riga_totale()
const int r = _scelta == 1 ? 8 : 6; const int r = _scelta == 1 ? 8 : 6;
//17/11/1995 //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 // Guy: 10/01/97 errore MI6125
if (_saldo_tot != 0.0) if (_saldo_tot != 0.0)
@ -811,24 +810,14 @@ TDate TStampa_riepilogo::UltimaData(int g, int c, long s)
bool TStampa_riepilogo::user_create() bool TStampa_riepilogo::user_create()
{ {
_clifo = new TLocalisamfile(LF_CLIFO); open_files(LF_CLIFO, LF_COMUNI, LF_PCON, LF_SALDI, LF_NDITTE, LF_ANAG,
_com = new TLocalisamfile(LF_COMUNI); LF_TABCOM, LF_TAB, 0);
_pcn = new TLocalisamfile(LF_PCON);
_saldi = new TLocalisamfile(LF_SALDI);
_nditte = new TLocalisamfile(LF_NDITTE);
_anag = new TLocalisamfile(LF_ANAG);
_tmp_saldi = NULL; _tmp_saldi = NULL;
return TRUE; return TRUE;
} }
bool TStampa_riepilogo::user_destroy() bool TStampa_riepilogo::user_destroy()
{ {
delete _com;
delete _pcn;
delete _clifo;
delete _saldi;
delete _nditte;
delete _anag;
delete _tmp_saldi; delete _tmp_saldi;
return TRUE; return TRUE;
} }
@ -842,7 +831,9 @@ bool TStampa_riepilogo::set_print(int)
_scelta = m.get_int(F_STAMPA); _scelta = m.get_int(F_STAMPA);
_richiesta = m.get_int(F_RICHIESTA); _richiesta = m.get_int(F_RICHIESTA);
_data = m.get(F_DATASTAMPA); _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(); riepilogo();
@ -852,40 +843,22 @@ bool TStampa_riepilogo::set_print(int)
return FALSE; 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() void TStampa_riepilogo::get_dati_ditta()
{ {
TLocalisamfile nditte(LF_NDITTE);
TLocalisamfile anag(LF_ANAG);
TString codanagr; TString codanagr;
TString tipoa; TString tipoa;
nditte.zero(); const TRectype & nditte = cache().get(LF_NDITTE, get_firm());
nditte.put(NDT_CODDITTA, get_firm());
nditte.read();
if (nditte.bad()) nditte.zero();
codanagr = nditte.get(NDT_CODANAGR); codanagr = nditte.get(NDT_CODANAGR);
tipoa = nditte.get(NDT_TIPOA); tipoa = nditte.get(NDT_TIPOA);
_ragsoc = nditte.get(NDT_RAGSOC); _ragsoc = nditte.get(NDT_RAGSOC);
anag.setkey(1); TToken_string key;
anag.zero(); key.add(tipoa);
anag.put (ANA_TIPOA, tipoa); key.add(codanagr);
anag.put (ANA_CODANAGR, codanagr);
anag.read(); const TRectype & anag = cache().get(LF_ANAG, key);
if (anag.bad()) anag.zero();
_cofi = anag.get(ANA_COFI); _cofi = anag.get(ANA_COFI);
_paiva = anag.get(ANA_PAIV); _paiva = anag.get(ANA_PAIV);
@ -894,11 +867,15 @@ void TStampa_riepilogo::get_dati_ditta()
if (_comunefis.empty()) if (_comunefis.empty())
_comunefis = anag.get(ANA_COMRES); _comunefis = anag.get(ANA_COMRES);
TRectype dep = cerca_com (_comunefis, _com); key.cut(0);
key.add("");
key.add(_comunefis);
_comunefis = dep.get(COM_DENCOM); const TRectype & com = cache().get(LF_COMUNI, key);
_provfis = dep.get(COM_PROVCOM);
_cap = dep.get(COM_CAPCOM); _comunefis = com.get(COM_DENCOM);
_provfis = com.get(COM_PROVCOM);
_cap = com.get(COM_CAPCOM);
if (_comunefis.empty()) if (_comunefis.empty())
{ {
_viafis = anag.get(ANA_INDRF); _viafis = anag.get(ANA_INDRF);
@ -922,15 +899,15 @@ int TStampa_riepilogo::stampa_intestazione_ditta()
get_dati_ditta(); get_dati_ditta();
codice_ditta << get_firm(); 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*)_ragsoc, (const char*)_viafis,
(const char*)_cap, (const char*)_comunefis, (const char*)_cap, (const char*)_comunefis,
(const char*)_provfis); (const char*)_provfis);
r++; r++;
printer().setdate(_data); printer().setdate(_data);
riga = "Data @< Pag. @#"; riga = FR("Data @< Pag. @#");
riga.right_just(127); 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); set_header (r, "%s", (const char*) riga);
r++; r++;
@ -946,19 +923,19 @@ void TStampa_riepilogo::preprocess_header()
r++; r++;
if (_scelta == 1) //stampa riepilogo conti if (_scelta == 1) //stampa riepilogo conti
set_header(r,"*** MASTRO DI CONTO ***"); set_header(r,TR("*** MASTRO DI CONTO ***"));
else set_header(r,"*** MASTRO DI GRUPPO ***"); else set_header(r,TR("*** MASTRO DI GRUPPO ***"));
set_header(r,"@33gCod. esercizio %d", _annoese); set_header(r,FR("@33gCod. esercizio %d"), _annoese);
if (_richiesta == 1) if (_richiesta == 1)
set_header(r,"@70gPROGRESSIVI ATTUALI@114gSALDO ATTUALE"); set_header(r,FR("@70gPROGRESSIVI ATTUALI@114gSALDO ATTUALE"));
else set_header(r,"@70gPROG. MOV. ELIMINATI@110gSALDO MOV. ELIMINATI"); else set_header(r,FR("@70gPROG. MOV. ELIMINATI@110gSALDO MOV. ELIMINATI"));
r++; r++;
r++; r++;
if (_scelta == 1) if (_scelta == 1)
set_header(r,"SOTTOC DESCRIZIONE"); set_header(r,TR("SOTTOC DESCRIZIONE"));
else set_header(r,"CONTO DESCRIZIONE"); else set_header(r,TR("CONTO DESCRIZIONE"));
set_header(r++,"@40gDATA ULT.MOV@68gDARE@87gAVERE@108gDARE@127gAVERE"); set_header(r++,FR("@40gDATA ULT.MOV@68gDARE@87gAVERE@108gDARE@127gAVERE"));
riga.fill('-'); riga.fill('-');
set_header(r,"%s",(const char*)riga); set_header(r,"%s",(const char*)riga);
r++; r++;
@ -969,7 +946,7 @@ void TStampa_riepilogo::preprocess_header()
int cg3500 (int argc, char* argv[]) int cg3500 (int argc, char* argv[])
{ {
TStampa_riepilogo a; TStampa_riepilogo a;
a.run(argc, argv, "Stampa riepilogo gruppi/conti"); a.run(argc, argv, TR("Stampa riepilogo gruppi/conti"));
return 0; return 0;
} }

View File

@ -360,20 +360,15 @@ bool TBalance::find(const TBill& b, int esercizio,
{ {
CHECK(b.sottoconto() > 0L, "Sottoconto mancante"); CHECK(b.sottoconto() > 0L, "Sottoconto mancante");
TLocalisamfile saldi(LF_SALDI); TString key(30);
TRectype& curr = saldi.curr(); key.format("%d||%d|%d|%ld", esercizio, b.gruppo(), b.conto(), b.sottoconto());
curr.put(SLD_GRUPPO, b.gruppo()); const TRectype & saldi = cache().get(LF_SALDI, key);
curr.put(SLD_CONTO, b.conto()); if (!saldi.empty())
curr.put(SLD_SOTTOCONTO, b.sottoconto());
curr.put(SLD_ANNOES, esercizio);
curr.put(SLD_FLSCA, FALSE);
const bool ok = saldi.read() == NOERR;
if (ok)
{ {
si.set(curr.get_char(SLD_FLAGSALINI), curr.get_real(SLD_SALDO)); si.set(saldi.get_char(SLD_FLAGSALINI), saldi.get_real(SLD_SALDO));
da.set('D', curr.get_real(SLD_PDARE)); da.set('D', saldi.get_real(SLD_PDARE));
av.set('A', curr.get_real(SLD_PAVERE)); av.set('A', saldi.get_real(SLD_PAVERE));
sf.set(curr.get_char(SLD_FLAGSALFIN), curr.get_real(SLD_SALDOFIN)); sf.set(saldi.get_char(SLD_FLAGSALFIN), saldi.get_real(SLD_SALDOFIN));
} }
else else
{ {
@ -761,7 +756,7 @@ void TMastrino::read(const TBill& conto,
cur.freeze(); cur.freeze();
TString caption(80); TString caption(80);
caption.format("Caricamento mastrino %03d.%03d.%06ld", caption.format(FR("Caricamento mastrino %03d.%03d.%06ld"),
_conto.gruppo(), _conto.conto(), _conto.sottoconto()); _conto.gruppo(), _conto.conto(), _conto.sottoconto());
TProgind pi(totrows, caption, FALSE, TRUE); TProgind pi(totrows, caption, FALSE, TRUE);
@ -776,7 +771,7 @@ void TMastrino::read(const TBill& conto,
if (sec > 0.0) if (sec > 0.0)
{ {
TString80 msg; 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); 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) 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(); 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; COLOR back, fore;
type2colors(*c, back, fore); type2colors(*c, back, fore);
TToken_string& riga = s.row(-1); 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++); s.set_back_and_fore_color(back, fore, row++);
} }
} }
@ -2389,7 +2384,7 @@ void TMastrini_grid::on_grid_button()
TProgind* pi = NULL; TProgind* pi = NULL;
if (total > 50) if (total > 50)
pi = new TProgind(total, "Aggiornamento contropartite ...", FALSE, TRUE, 48); pi = new TProgind(total, TR("Aggiornamento contropartite ..."), FALSE, TRUE, 48);
else else
begin_wait(); begin_wait();
@ -2420,7 +2415,7 @@ void TMastrini_grid::on_grid_button()
if (sec > 0.0) if (sec > 0.0)
{ {
TString80 msg; 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); pi->set_text(msg);
} }
} }
@ -2466,7 +2461,7 @@ void TMastrini_grid::on_record_button(long rec)
TMailbox mail; TMailbox mail;
if (mail.next_s(MSG_LN) != NULL) 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(); reread();
} }
} }
@ -2682,8 +2677,8 @@ void TGrid_mask::handler(WINDOW win, EVENT* ep)
xvt_res_free_menu_tree(menu); xvt_res_free_menu_tree(menu);
} }
#else #else
ASK_RESPONSE r = xvt_dm_post_ask("Annulla", "Ripristina", "Salva", ASK_RESPONSE r = xvt_dm_post_ask(TR("Annulla"), TR("Ripristina"), TR("Salva"),
"Ordinamento delle colonne"); TR("Ordinamento delle colonne"));
if (r == RESP_2) if (r == RESP_2)
sht.reset_columns_order(); sht.reset_columns_order();
if (r == RESP_2 || r == RESP_3) if (r == RESP_2 || r == RESP_3)
@ -2762,7 +2757,7 @@ bool TQuery_mask::esercizio_handler(TMask_field& f, KEY k)
else else
{ {
if (anno > 0) if (anno > 0)
return error_box("Esercizio inesistente: %d", anno); return error_box(FR("Esercizio inesistente: %d"), anno);
} }
} }
return TRUE; return TRUE;
@ -2788,7 +2783,7 @@ bool TQuery_mask::data_handler(TMask_field& f, KEY k)
if (f.empty()) if (f.empty())
{ {
if (codice_esercizio == 0) 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; return TRUE;
} }
@ -2797,12 +2792,12 @@ bool TQuery_mask::data_handler(TMask_field& f, KEY k)
if (codice_esercizio != 0) if (codice_esercizio != 0)
{ {
if (esercizio != codice_esercizio) 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 else
{ {
if (esercizio == 0) 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; return ok;
@ -2867,23 +2862,8 @@ protected:
virtual void on_firm_change(); virtual void on_firm_change();
public: 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() bool TMastrini_video::create()
{ {
@ -2968,7 +2948,7 @@ bool TMastrini_video::menu(MENU_TAG mt)
int cg3600(int argc, char* argv[]) int cg3600(int argc, char* argv[])
{ {
TMastrini_video mv; TMastrini_video mv;
mv.run(argc, argv, "Mastrini"); mv.run(argc, argv, TR("Mastrini"));
return 0; return 0;
} }

View File

@ -44,9 +44,6 @@ enum tipo_st
class TLista_fatture : public TPrintapp class TLista_fatture : public TPrintapp
{ {
TLocalisamfile *_nditte; // File delle ditte
TDecoder *_reg;
TDecoder *_iva;
TRelation* _rel; // Relazione principale TRelation* _rel; // Relazione principale
int _cur1, int _cur1,
_cur2, _cur2,
@ -120,11 +117,8 @@ inline TLista_fatture& app() { return (TLista_fatture&) main_app(); }
int TLista_fatture::tiporeg(const TString& reg) int TLista_fatture::tiporeg(const TString& reg)
{ {
TString16 s; s.format("%4d%-3s",_date_from.year(),(const char*)reg); TString16 s; s.format("%4d%-3s",_date_from.year(),(const char*)reg);
// _reg->put("CODTAB",s);
// if (_reg->read() == NOERR) return atoi(cache().get("REG", s).get("I0"));
// return _reg->get_int("I0");
// return 0;
return atoi(_reg->decode(s));
} }
bool TLista_fatture::filter_func1(const TRelation *r) 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 (key == K_ENTER && f.empty())
{ {
if (f.dlg() == FLD_DATE_FROM) 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 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) 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 (a.ok() && da.ok()) // Solo se sono entrambi compilati
{ {
if (da > a) 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()) 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; 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 l1 = m.get_long(dlg1);
const long l2 = m.get_long(dlg2); const long l2 = m.get_long(dlg2);
if (l1 != 0L && l2 != 0L && l1 < l2) 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; 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 s1(m.get(dlg1));
const TString s2(m.get(dlg2)); const TString s2(m.get(dlg2));
if (s1.not_empty() && s2.not_empty() && s1 < s2) 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() void TLista_fatture::build_ditte_sheet()
{ {
_ditte->destroy(); _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); TToken_string* d = new TToken_string(64);
d->add(" "); d->add(" ");
const long n = _nditte->get_long(NDT_CODDITTA); const long n = nditte.get_long(NDT_CODDITTA);
d->add(n); d->add(n);
d->add(_nditte->get(NDT_RAGSOC)); d->add(nditte.get(NDT_RAGSOC));
const bool unselectable = !prefix().exist(n); 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 if (new_det || new_cr) // Stampa totali parziali
{ {
const bool is_cr = _tipo == costo_ricavo; const bool is_cr = _tipo == costo_ricavo;
TString256 s("TOTALE TIPO "); TString256 s(TR("TOTALE TIPO "));
_pr.reset(); _pr.reset();
_pr.set_style(boldstyle); _pr.set_style(boldstyle);
s << (is_cr ? "COSTO/RICAVO " : "INDETRAIBILITA' "); s << (is_cr ? TR("COSTO/RICAVO ") : TR("INDETRAIBILITA' "));
s << (is_cr ? _tipocrprec : _tipodetprec); s << (is_cr ? _tipocrprec : _tipodetprec);
_pr.put(s,42); _pr.put(s,42);
if (_tp_doc != 0.0) if (_tp_doc != 0.0)
@ -491,10 +487,10 @@ print_action TLista_fatture::postprocess_print(int file, int counter)
if (_tipo != intra) if (_tipo != intra)
{ {
const bool is_cr = _tipo == costo_ricavo; const bool is_cr = _tipo == costo_ricavo;
TString256 s("TOTALE TIPO "); TString256 s(TR("TOTALE TIPO "));
_pr.reset(); _pr.reset();
_pr.set_style(boldstyle); _pr.set_style(boldstyle);
s << (is_cr ? "COSTO/RICAVO " : "INDETRAIBILITA' "); s << (is_cr ? TR("COSTO/RICAVO ") : TR("INDETRAIBILITA' "));
s << (is_cr ? _tipocrprec : _tipodetprec); s << (is_cr ? _tipocrprec : _tipodetprec);
_pr.put(s,42); _pr.put(s,42);
if (_tp_doc != 0.0) 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);
p.print(_pr); p.print(_pr);
_pr.set_style(boldstyle); _pr.set_style(boldstyle);
_pr.put("TOTALE GENERALE :",42); _pr.put(TR("TOTALE GENERALE :"),42);
if (_tot_doc != 0.0) if (_tot_doc != 0.0)
_pr.put(real2string(_tot_doc),73); _pr.put(real2string(_tot_doc),73);
if (_tot_imp != 0.0) if (_tot_imp != 0.0)
@ -528,10 +524,10 @@ print_action TLista_fatture::postprocess_print(int file, int counter)
_pr.reset(); _pr.reset();
for (int i=0; i<3; i++) for (int i=0; i<3; i++)
p.print(_pr); p.print(_pr);
_pr.put("Cod.@57gVENDITE@92gACQUISTI",1); _pr.put(FR("Cod.@57gVENDITE@92gACQUISTI"),1);
p.print(_pr); p.print(_pr);
_pr.reset(); _pr.reset();
_pr.put("IVA Descrizione@45gImponibile@66gImposta@82gImponibile@101gImposta",1); _pr.put(FR("IVA Descrizione@45gImponibile@66gImposta@82gImponibile@101gImposta"),1);
p.print(_pr); p.print(_pr);
_pr.reset(); _pr.reset();
p.print(_pr); p.print(_pr);
@ -546,7 +542,7 @@ print_action TLista_fatture::postprocess_print(int file, int counter)
if (cod == "~A19") if (cod == "~A19")
{ {
p.print(_pr); p.print(_pr);
_pr.put("Totale ",1); _pr.put(TR("Totale "),1);
if (tot1 != 0.0) if (tot1 != 0.0)
_pr.put(real2string(tot1),40); _pr.put(real2string(tot1),40);
if (tot2 != 0.0) if (tot2 != 0.0)
@ -558,12 +554,12 @@ print_action TLista_fatture::postprocess_print(int file, int counter)
p.print(_pr); p.print(_pr);
_pr.reset(); _pr.reset();
p.print(_pr); p.print(_pr);
des = "Totale acquisti indeducibili per ART.19"; des = TR("Totale acquisti indeducibili per ART.19");
_pr.put(des,1); _pr.put(des,1);
} }
else else
{ {
des = _iva->decode(cod); des = cache().get("%IVA", cod).get("S0");
_pr.put(cod,1); _pr.put(cod,1);
_pr.put(des,6); _pr.put(des,6);
} }
@ -583,7 +579,7 @@ print_action TLista_fatture::postprocess_print(int file, int counter)
_pr.reset(); _pr.reset();
} }
p.print(_pr); p.print(_pr);
_pr.put("Totale Generale IVA",1); _pr.put(TR("Totale Generale IVA"),1);
if (tot1 != 0.0) if (tot1 != 0.0)
_pr.put(real2string(tot1),40); _pr.put(real2string(tot1),40);
if (tot2 != 0.0) if (tot2 != 0.0)
@ -603,62 +599,58 @@ void TLista_fatture::set_the_header()
const long firm = get_firm(); const long firm = get_firm();
reset_header (); reset_header ();
_nditte->zero(); const TRectype & nditte = cache().get(LF_NDITTE, firm);
_nditte->put(NDT_CODDITTA, firm);
_nditte->read();
if (_nditte->bad())
_nditte->zero();
TDate today(TODAY); TDate today(TODAY);
TString s(132), rw(132); TString s(132), rw(132);
TString16 s1,s2; TString16 s1,s2;
s = _nditte->get(NDT_RAGSOC); s = nditte.get(NDT_RAGSOC);
s1 = _date_from.string(); s1 = _date_from.string();
s2 = _date_to.string(); s2 = _date_to.string();
char c[2]={'N','D'}; 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); 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) if (_tipo == indetraibile || _tipo == costo_ricavo)
{ {
s << "@45g Dal fornitore "; s << FR("@45g Dal fornitore ");
if (_from_cf == 0L && _to_cf == 999999L) if (_from_cf == 0L && _to_cf == 999999L)
s << " Al fornitore"; s << TR(" Al fornitore");
else else
{ {
s << _from_cf; s << _from_cf;
s << " Al fornitore "; s << TR(" Al fornitore ");
s << _to_cf; s << _to_cf;
} }
s << "@94g Dal registro "; s << FR("@94g Dal registro ");
if (_from_reg.empty() && _to_reg == "~~~") if (_from_reg.empty() && _to_reg == "~~~")
s << " Al registro"; s << TR(" Al registro");
else else
{ {
s << _from_reg; s << _from_reg;
s << " Al registro "; s << TR(" Al registro ");
s << _to_reg; s << _to_reg;
} }
if (_tipo == costo_ricavo) 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); strncpy(c,"CR",2);
} }
else else
set_header(soh++,"@50gLISTA FATTURE CON IVA INDETRAIBILE"); set_header(soh++,FR("@50gLISTA FATTURE CON IVA INDETRAIBILE"));
} }
else else
{ {
set_header(soh++,"@50gLISTA FATTURE INTRACOMUNITARIE"); set_header(soh++,FR("@50gLISTA FATTURE INTRACOMUNITARIE"));
s << "@45g Dal c. causale "; s << FR("@45g Dal c. causale ");
if (_from_cau.empty() && _to_cau == "~~~") if (_from_cau.empty() && _to_cau == "~~~")
s << " Al c. causale"; s << TR(" Al c. causale");
else else
{ {
s << _from_cau; s << _from_cau;
s << " Al codice causale "; s << TR(" Al codice causale ");
s << _to_cau; s << _to_cau;
} }
} }
@ -667,9 +659,9 @@ void TLista_fatture::set_the_header()
rw.fill('-'); rw.fill('-');
set_header(soh++, (const char *) rw); set_header(soh++, (const char *) rw);
set_header(soh++, "@12gNum@21gDocumento@63gCod.@68gM@70gTipo@106gCod@110g%c@128gNum.",c[0]); set_header(soh++, FR("@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." 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]); "@75gTot.documento@94gImponibile@106gIva@110g%c@118gImposta@128gReg."),c[1]);
set_header(soh++, (const char *) rw); set_header(soh++, (const char *) rw);
set_header(soh,""); set_header(soh,"");
@ -717,12 +709,12 @@ bool TLista_fatture::set_print(int m)
switch (_tipo) switch (_tipo)
{ {
case costo_ricavo: case costo_ricavo:
msk.set_caption("Lista fatture per costo/ricavo"); msk.set_caption(TR("Lista fatture per costo/ricavo"));
msk.field(FLD_FROM_FOR).set_prompt("Da cli./for. "); msk.field(FLD_FROM_FOR).set_prompt(TR("Da cli./for. "));
msk.field(FLD_TO_FOR).set_prompt("A cli./for. "); msk.field(FLD_TO_FOR).set_prompt(TR("A cli./for. "));
break; break;
case intra: case intra:
msk.set_caption("Lista fatture intracomunitarie"); msk.set_caption(TR("Lista fatture intracomunitarie"));
msk.hide(-1); msk.hide(-1);
msk.show(-2); msk.show(-2);
break; break;
@ -821,11 +813,10 @@ bool TLista_fatture::user_create()
break; break;
} }
} }
_ditte = new TArray_sheet(-1, -1, -4, -4, "Selezione Ditte", _ditte = new TArray_sheet(-1, -1, -4, -4, TR("Selezione Ditte"),
"@1|Cod.@5R|Ragione Sociale@50"); HR("@1|Cod.@5R|Ragione Sociale@50"));
_nditte = new TLocalisamfile(LF_NDITTE); open_files(LF_NDITTE, LF_TAB, LF_TABCOM, 0);
_reg = new TDecoder("REG", "I0");
_iva = new TDecoder("%IVA");
_rel = new TRelation(LF_RMOVIVA); _rel = new TRelation(LF_RMOVIVA);
_rel->add(LF_MOV,"NUMREG==NUMREG"); _rel->add(LF_MOV,"NUMREG==NUMREG");
_rel->add(LF_CAUSALI,"CODCAUS==CODCAUS",1,LF_MOV); // Relazione _rel->add(LF_CAUSALI,"CODCAUS==CODCAUS",1,LF_MOV); // Relazione
@ -842,11 +833,8 @@ bool TLista_fatture::user_create()
bool TLista_fatture::user_destroy() bool TLista_fatture::user_destroy()
{ {
if (_nditte) delete _nditte;
if (_ditte) delete _ditte; if (_ditte) delete _ditte;
if (_rel) delete _rel; if (_rel) delete _rel;
if (_reg) delete _reg;
if (_iva) delete _iva;
return TRUE; return TRUE;
} }
@ -857,7 +845,7 @@ bool TLista_fatture::user_destroy()
int cg3700(int argc, char* argv[]) int cg3700(int argc, char* argv[])
{ {
TLista_fatture lf; TLista_fatture lf;
lf.run(argc, argv, "Lista fatture"); lf.run(argc, argv, TR("Lista fatture"));
return 0; return 0;
} }

View File

@ -1,4 +0,0 @@
#include <default.url>
#include <mainmenu.url>

View File

@ -1,4 +0,0 @@
#include <default.url>
#include <mainmenu.url>

View File

@ -1,3 +0,0 @@
#include <default.url>
#include <mainmenu.url>

View File

@ -1,4 +0,0 @@
#include <default.url>
#include <mainmenu.url>

View File

@ -1,4 +0,0 @@
#include <default.url>
#include <mainmenu.url>

View File

@ -1,4 +0,0 @@
#include <default.url>
#include <mainmenu.url>

Binary file not shown.